Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:38

0001 //----------Author's Name:FX Gentit and B.Fabbro  DSM/IRFU/SPP CEA-Saclay

0002 //----------Copyright:Those valid for CEA software

0003 //----------Modified:24/03/2011

0004 
0005 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaHeader.h"
0006 
0007 //--------------------------------------

0008 //  TEcnaHeader.cc

0009 //  Class creation: 03 Dec 2002

0010 //  Documentation: see TEcnaHeader.h

0011 //--------------------------------------

0012 
0013 ClassImp(TEcnaHeader);
0014 //____________________________________________________________________________

0015 
0016 TEcnaHeader::TEcnaHeader() { Init(); }  // constructor without arguments

0017 
0018 TEcnaHeader::TEcnaHeader(TEcnaObject* pObjectManager, const Text_t* name, const Text_t* title) : TNamed(name, title) {
0019   // Constructor with arguments for reading ROOT file.

0020   // Called in FileParameters(...) of TEcnaRead

0021   // Please give a name and a title containing info about what

0022   // you are doing and saving in the ROOT file

0023 
0024   // std::cout << "[Info Management] CLASS: TEcnaHeader.        CREATE OBJECT: this = " << this << std::endl;

0025 
0026   Init();
0027   Long_t i_this = (Long_t)this;
0028   pObjectManager->RegisterPointer("TEcnaHeader", i_this);
0029 }
0030 
0031 TEcnaHeader::~TEcnaHeader() {
0032   //destructor

0033 
0034   // std::cout << "[Info Management] CLASS: TEcnaHeader.        DESTROY OBJECT: this = " << this << std::endl;

0035 }
0036 
0037 void TEcnaHeader::Init() {
0038   //Set default values in all variables and init the counters fxxxCalc

0039 
0040   //--------------------------------- INIT parameters

0041 
0042   fgMaxCar = (Int_t)512;
0043 
0044   //........................ RUN parameters

0045 
0046   fTypAna = "!Analysis name> no info";
0047   fNbOfSamples = (Int_t)0;
0048   fRunNumber = (Int_t)0;
0049   fFirstReqEvtNumber = (Int_t)0;
0050   fLastReqEvtNumber = (Int_t)0;
0051   fReqNbOfEvts = (Int_t)0;
0052   fStex = (Int_t)0;
0053 
0054   fStartTime = (time_t)0;
0055   fStopTime = (time_t)0;
0056 
0057   Int_t MaxCar = fgMaxCar;
0058   fStartDate.Resize(MaxCar);
0059   fStartDate = "!Start date> no info";
0060   MaxCar = fgMaxCar;
0061   fStopDate.Resize(MaxCar);
0062   fStopDate = "!Stop  date> no info";
0063 
0064   fRunType = 9999999;
0065 
0066   //--------------------------------- INIT counters

0067   fStinNumbersCalc = 0;
0068   fNbOfEvtsCalc = 0;
0069   fAdcEvtCalc = 0;
0070   fMSpCalc = 0;
0071   fSSpCalc = 0;
0072 
0073   fCovCssCalc = 0;
0074   fCorCssCalc = 0;
0075   fHfCovCalc = 0;
0076   fHfCorCalc = 0;
0077   fLfCovCalc = 0;
0078   fLfCorCalc = 0;
0079   fLFccMoStinsCalc = 0;
0080   fHFccMoStinsCalc = 0;
0081   fPedCalc = 0;
0082   fTnoCalc = 0;
0083   fMeanCorssCalc = 0;
0084   fLfnCalc = 0;
0085   fHfnCalc = 0;
0086   fSigCorssCalc = 0;
0087 
0088   fAvPedCalc = 0;
0089   fAvTnoCalc = 0;
0090   fAvLfnCalc = 0;
0091   fAvHfnCalc = 0;
0092   fAvMeanCorssCalc = 0;
0093   fAvSigCorssCalc = 0;
0094 }
0095 // ------------ end of Init() ------------

0096 
0097 void TEcnaHeader::HeaderParameters(const TString& typ_ana,
0098                                    const Int_t& nb_of_samples,
0099                                    const Int_t& run_number,
0100                                    const Int_t& aFirstReqEvtNumber,
0101                                    const Int_t& aLastReqEvtNumber,
0102                                    const Int_t& aReqNbOfEvts,
0103                                    const Int_t& Stex,
0104                                    const Int_t& run_type) {
0105   // Constructor with arguments for reading DATA.

0106   // Called in GetReadyToReadData(...) of TEcnaRun

0107   // Please give a name and a title containing info about what

0108   // you are doing and saving in the ROOT file

0109 
0110   // std::cout << "[Info Management] CLASS: TEcnaHeader.        CREATE OBJECT: this = " << this << std::endl;

0111 
0112   Init();
0113 
0114   fTypAna = typ_ana;
0115   fRunNumber = run_number;
0116   fNbOfSamples = nb_of_samples;
0117   fFirstReqEvtNumber = aFirstReqEvtNumber;
0118   fLastReqEvtNumber = aLastReqEvtNumber;
0119   fReqNbOfEvts = aReqNbOfEvts;
0120   fStex = Stex;
0121 
0122   fRunType = run_type;
0123 }
0124 //------------------------------------------------------------------------------

0125 
0126 void TEcnaHeader::HeaderParameters(const TString& typ_ana,
0127                                    const Int_t& nb_of_samples,
0128                                    const Int_t& run_number,
0129                                    const Int_t& aFirstReqEvtNumber,
0130                                    const Int_t& aLastReqEvtNumber,
0131                                    const Int_t& aReqNbOfEvts,
0132                                    const Int_t& Stex) {
0133   // std::cout << "[Info Management] CLASS: TEcnaHeader.        CREATE OBJECT: this = " << this << std::endl;

0134 
0135   Init();
0136 
0137   fTypAna = typ_ana;
0138   fRunNumber = run_number;
0139   fNbOfSamples = nb_of_samples;
0140   fFirstReqEvtNumber = aFirstReqEvtNumber;
0141   fLastReqEvtNumber = aLastReqEvtNumber;
0142   fReqNbOfEvts = aReqNbOfEvts;
0143   fStex = Stex;
0144 }
0145 
0146 void TEcnaHeader::Print() {
0147   // Print the header

0148   std::cout << std::endl;
0149   std::cout << "     Header parameters " << std::endl;
0150   std::cout << std::endl;
0151   std::cout << "Run number                   : " << fRunNumber << std::endl;
0152   std::cout << "First requested event number : " << fFirstReqEvtNumber << std::endl;
0153   std::cout << "Last requested event number  : " << fLastReqEvtNumber << std::endl;
0154   std::cout << "Requested number of events   : " << fReqNbOfEvts << std::endl;
0155   std::cout << "SM or Dee number             : " << fStex << std::endl;
0156   std::cout << "Time first event             : " << fStartTime << std::endl;
0157   std::cout << "Time last event              : " << fStopTime << std::endl;
0158   std::cout << "Date first event             : " << fStartDate.Data() << std::endl;
0159   std::cout << "Date last event              : " << fStopDate.Data() << std::endl;
0160   std::cout << "Run type                     : " << fRunType << std::endl;
0161   std::cout << std::endl;
0162   std::cout << "     Header counters " << std::endl;
0163   std::cout << std::endl;
0164   std::cout << "Stin Numbers                                 : " << fStinNumbersCalc << std::endl;
0165   std::cout << "Numbers of found evts                        : " << fNbOfEvtsCalc << std::endl;
0166   std::cout << "Samples as a function of time histograms     : " << fAdcEvtCalc << std::endl;
0167   std::cout << "Expectation values histogram                 : " << fMSpCalc << std::endl;
0168   std::cout << "Variances histogram                          : " << fSSpCalc << std::endl;
0169   std::cout << "Average total noise                         : " << fAvTnoCalc << std::endl;
0170   std::cout << "Average low frequency noise                 : " << fAvLfnCalc << std::endl;
0171   std::cout << "Average high frequency noise                : " << fAvHfnCalc << std::endl;
0172 
0173   std::cout << "Nb of (sample,sample) covariance  matrices   : " << fCovCssCalc << std::endl;
0174   std::cout << "Nb of (sample,sample) correlation matrices   : " << fCorCssCalc << std::endl;
0175   std::cout << "Nb of (channel,channel) covariance  matrices : " << fHfCovCalc << std::endl;
0176   std::cout << "Nb of (channel,channel) correlation matrices : " << fHfCorCalc << std::endl;
0177   std::cout << "Nb of (channel,channel) cov mat mean on samp : " << fLfCovCalc << std::endl;
0178   std::cout << "Nb of (channel,channel) cor mat mean on samp : " << fLfCorCalc << std::endl;
0179   std::cout << "Nb of mean cov(c,c) mean on samp, all Stins  : " << fLfCovCalc << std::endl;
0180   std::cout << "Nb of mean cor(c,c) mean on samp, all Stins  : " << fLfCorCalc << std::endl;
0181 
0182   std::cout << "Exp. val. of the exp. val. of the samples    : " << fPedCalc << std::endl;
0183   std::cout << "Expect. val. of the sigmas of the samples    : " << fTnoCalc << std::endl;
0184   std::cout << "Expect. val. of the (samp,samp) correlations : " << fMeanCorssCalc << std::endl;
0185 
0186   std::cout << "Sigmas of the exp. val. of the samples       : " << fLfnCalc << std::endl;
0187   std::cout << "Sigmas of the sigmas of the samples          : " << fHfnCalc << std::endl;
0188   std::cout << "Sigmas of the (samp,samp) correlations       : " << fSigCorssCalc << std::endl;
0189 
0190   std::cout << "Average pedestals                           : " << fAvPedCalc << std::endl;
0191   std::cout << "Average mean cor(s,s)                    : " << fAvMeanCorssCalc << std::endl;
0192   std::cout << "Average sigma of Cor(s,s)                   : " << fAvSigCorssCalc << std::endl;
0193   std::cout << std::endl;
0194 }