CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/src/TEcnaHeader.cc

Go to the documentation of this file.
00001 //----------Author's Name:FX Gentit and B.Fabbro  DSM/IRFU/SPP CEA-Saclay
00002 //----------Copyright:Those valid for CEA software
00003 //----------Modified:24/03/2011
00004 
00005 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaHeader.h"
00006 
00007 //--------------------------------------
00008 //  TEcnaHeader.cc
00009 //  Class creation: 03 Dec 2002
00010 //  Documentation: see TEcnaHeader.h
00011 //--------------------------------------
00012 
00013 ClassImp(TEcnaHeader)
00014 //____________________________________________________________________________
00015   
00016 TEcnaHeader::TEcnaHeader(){Init();} // constructor without arguments
00017 
00018 TEcnaHeader::TEcnaHeader(TEcnaObject* pObjectManager, const Text_t* name, const Text_t* title):TNamed(name,title)
00019 {
00020   // Constructor with arguments for reading ROOT file.
00021   // Called in FileParameters(...) of TEcnaRead
00022   // Please give a name and a title containing info about what
00023   // you are doing and saving in the ROOT file
00024 
00025   // cout << "[Info Management] CLASS: TEcnaHeader.        CREATE OBJECT: this = " << this << endl;
00026   
00027   Init();
00028   Long_t i_this = (Long_t)this;
00029   pObjectManager->RegisterPointer("TEcnaHeader", i_this);
00030 }
00031 
00032 TEcnaHeader::~TEcnaHeader() {
00033   //destructor
00034 
00035  // cout << "[Info Management] CLASS: TEcnaHeader.        DESTROY OBJECT: this = " << this << endl;
00036 }
00037 
00038 void TEcnaHeader::Init()
00039 {
00040  //Set default values in all variables and init the counters fxxxCalc
00041 
00042   //--------------------------------- INIT parameters
00043 
00044   fgMaxCar = (Int_t)512;
00045 
00046   //........................ RUN parameters
00047 
00048   fTypAna            = "!Analysis name> no info";
00049   fNbOfSamples       = (Int_t)0;
00050   fRunNumber         = (Int_t)0;
00051   fFirstReqEvtNumber = (Int_t)0;
00052   fLastReqEvtNumber  = (Int_t)0;
00053   fReqNbOfEvts       = (Int_t)0;
00054   fStex              = (Int_t)0;
00055 
00056   fStartTime     = (time_t)0;
00057   fStopTime      = (time_t)0;
00058 
00059   Int_t MaxCar = fgMaxCar;
00060   fStartDate.Resize(MaxCar);
00061   fStartDate     = "!Start date> no info";
00062   MaxCar = fgMaxCar;
00063   fStopDate.Resize(MaxCar);
00064   fStopDate      = "!Stop  date> no info";
00065 
00066   fRunType = 9999999;
00067 
00068   //--------------------------------- INIT counters
00069   fStinNumbersCalc  = 0;
00070   fNbOfEvtsCalc     = 0;
00071   fAdcEvtCalc       = 0;
00072   fMSpCalc          = 0;
00073   fSSpCalc          = 0;
00074 
00075   fCovCssCalc       = 0;
00076   fCorCssCalc       = 0;
00077   fHfCovCalc        = 0;
00078   fHfCorCalc        = 0;
00079   fLfCovCalc        = 0;
00080   fLfCorCalc        = 0;
00081   fLFccMoStinsCalc  = 0;
00082   fHFccMoStinsCalc  = 0;
00083   fPedCalc          = 0;
00084   fTnoCalc          = 0;
00085   fMeanCorssCalc    = 0;
00086   fLfnCalc          = 0;
00087   fHfnCalc          = 0;
00088   fSigCorssCalc     = 0;
00089 
00090   fAvPedCalc        = 0;
00091   fAvTnoCalc        = 0;
00092   fAvLfnCalc        = 0;
00093   fAvHfnCalc        = 0;
00094   fAvMeanCorssCalc  = 0;
00095   fAvSigCorssCalc   = 0;
00096 }
00097 // ------------ end of Init() ------------
00098 
00099 void TEcnaHeader::HeaderParameters(TString      typ_ana,           const Int_t& nb_of_samples,
00100                                    const Int_t& run_number,        const Int_t& aFirstReqEvtNumber,
00101                                    const Int_t& aLastReqEvtNumber, const Int_t& aReqNbOfEvts,
00102                                    const Int_t& Stex,              const Int_t& run_type
00103                                    )
00104 {
00105   // Constructor with arguments for reading DATA.
00106   // Called in GetReadyToReadData(...) of TEcnaRun
00107   // Please give a name and a title containing info about what
00108   // you are doing and saving in the ROOT file
00109  
00110  // cout << "[Info Management] CLASS: TEcnaHeader.        CREATE OBJECT: this = " << this << endl;
00111 
00112   Init();
00113 
00114   fTypAna            = typ_ana;
00115   fRunNumber         = run_number;
00116   fNbOfSamples       = nb_of_samples;
00117   fFirstReqEvtNumber = aFirstReqEvtNumber;
00118   fLastReqEvtNumber  = aLastReqEvtNumber;
00119   fReqNbOfEvts       = aReqNbOfEvts;
00120   fStex              = Stex;
00121 
00122   fRunType           = run_type;
00123 }
00124 //------------------------------------------------------------------------------
00125 
00126 void TEcnaHeader::HeaderParameters(TString      typ_ana,           const Int_t& nb_of_samples,
00127                                    const Int_t& run_number,        const Int_t& aFirstReqEvtNumber,
00128                                    const Int_t& aLastReqEvtNumber, const Int_t& aReqNbOfEvts,
00129                                    const Int_t& Stex)
00130  {
00131  // cout << "[Info Management] CLASS: TEcnaHeader.        CREATE OBJECT: this = " << this << endl;
00132 
00133   Init();
00134 
00135   fTypAna            = typ_ana;
00136   fRunNumber         = run_number;
00137   fNbOfSamples       = nb_of_samples;
00138   fFirstReqEvtNumber = aFirstReqEvtNumber;
00139   fLastReqEvtNumber  = aLastReqEvtNumber;
00140   fReqNbOfEvts       = aReqNbOfEvts;
00141   fStex              = Stex;
00142 }
00143 
00144 void TEcnaHeader::Print() {
00145   // Print the header
00146   cout << endl;
00147   cout << "     Header parameters " << endl;
00148   cout << endl;
00149   cout << "Run number                   : " << fRunNumber         << endl;
00150   cout << "First requested event number : " << fFirstReqEvtNumber << endl;
00151   cout << "Last requested event number  : " << fLastReqEvtNumber  << endl;
00152   cout << "Requested number of events   : " << fReqNbOfEvts       << endl;
00153   cout << "SM or Dee number             : " << fStex              << endl;
00154   cout << "Time first event             : " << fStartTime         << endl;
00155   cout << "Time last event              : " << fStopTime          << endl;
00156   cout << "Date first event             : " << fStartDate.Data()  << endl;
00157   cout << "Date last event              : " << fStopDate.Data()   << endl;
00158   cout << "Run type                     : " << fRunType           << endl;
00159   cout << endl;
00160   cout << "     Header counters " << endl;
00161   cout << endl;
00162   cout << "Stin Numbers                                 : "
00163        << fStinNumbersCalc << endl;
00164   cout << "Numbers of found evts                        : "
00165        << fNbOfEvtsCalc << endl;
00166   cout << "Samples as a function of time histograms     : "
00167        << fAdcEvtCalc << endl;
00168   cout << "Expectation values histogram                 : "
00169        << fMSpCalc    << endl;
00170   cout << "Variances histogram                          : "
00171        << fSSpCalc   << endl;
00172   cout << "Average total noise                         : "
00173        << fAvTnoCalc  << endl;
00174   cout << "Average low frequency noise                 : "
00175        << fAvLfnCalc  << endl;
00176   cout << "Average high frequency noise                : "
00177        << fAvHfnCalc  << endl;
00178 
00179   cout << "Nb of (sample,sample) covariance  matrices   : "
00180        << fCovCssCalc << endl;
00181   cout << "Nb of (sample,sample) correlation matrices   : "
00182        << fCorCssCalc << endl;
00183   cout << "Nb of (channel,channel) covariance  matrices : "
00184        << fHfCovCalc << endl;
00185   cout << "Nb of (channel,channel) correlation matrices : "
00186        << fHfCorCalc << endl;
00187   cout << "Nb of (channel,channel) cov mat mean on samp : "
00188        << fLfCovCalc << endl;
00189   cout << "Nb of (channel,channel) cor mat mean on samp : "
00190        << fLfCorCalc << endl;
00191   cout << "Nb of mean cov(c,c) mean on samp, all Stins  : "
00192        << fLfCovCalc << endl;
00193   cout << "Nb of mean cor(c,c) mean on samp, all Stins  : "
00194        << fLfCorCalc << endl;
00195 
00196   cout << "Exp. val. of the exp. val. of the samples    : "
00197        << fPedCalc     << endl;
00198   cout << "Expect. val. of the sigmas of the samples    : "
00199        << fTnoCalc    << endl;
00200   cout << "Expect. val. of the (samp,samp) correlations : "
00201        << fMeanCorssCalc << endl;
00202 
00203   cout << "Sigmas of the exp. val. of the samples       : "
00204        << fLfnCalc     << endl;
00205   cout << "Sigmas of the sigmas of the samples          : "
00206        << fHfnCalc     << endl;
00207   cout << "Sigmas of the (samp,samp) correlations       : "
00208        << fSigCorssCalc     << endl;
00209 
00210   cout << "Average pedestals                           : "
00211        << fAvPedCalc  << endl;
00212   cout << "Average mean cor(s,s)                    : "
00213        << fAvMeanCorssCalc << endl;
00214   cout << "Average sigma of Cor(s,s)                   : "
00215        << fAvSigCorssCalc << endl;
00216   cout << endl;
00217 }