CMS 3D CMS Logo

TCnaHeaderEB.cc

Go to the documentation of this file.
00001 //----------Author's Name:FX Gentit and B.Fabbro  DAPNIA/SPP CEN Saclay
00002 //----------Copyright:Those valid for CEA software
00003 //----------Modified:07/06/2007
00004 
00005 #include "Riostream.h"
00006 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEBParameters.h"
00007 
00008 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TCnaHeaderEB.h"
00009 
00010 ClassImp(TCnaHeaderEB)
00011   //____________________________________________________________________________
00012 
00013   TCnaHeaderEB::TCnaHeaderEB(){
00014   // Constructor without argument. Call to Init()
00015 
00016   Init();
00017 }
00018 
00019 TCnaHeaderEB::TCnaHeaderEB(Text_t        *name,          Text_t        *title,
00020                            TString       typ_ana,        const Int_t&  run_number, 
00021                            const Int_t&  first_evt,      const Int_t&  nb_of_taken_evts,
00022                            const Int_t&  super_module,   const Int_t&  nentries
00023                            ):TNamed(name,title) {
00024 
00025   // Constructor with arguments for reading DATA.
00026   // Called in GetReadyToReadData(...) of TCnaRunEB
00027   // Please give a name and a title containing info about what
00028   // you are doing and saving in the ROOT file
00029 
00030   Init();
00031 
00032   fTypAna        = typ_ana;
00033   fRunNumber     = run_number;
00034   fFirstEvt      = first_evt;
00035   fNbOfTakenEvts = nb_of_taken_evts;
00036   fSuperModule   = super_module;
00037 
00038   fNentries      = nentries;
00039 
00040   fNbBinsSampTime = fNbOfTakenEvts;
00041 }
00042 //------------------------------------------------------------------------------
00043 
00044 TCnaHeaderEB::TCnaHeaderEB(Text_t        *name,        Text_t        *title,
00045                            TString       typ_ana,      const Int_t&  run_number, 
00046                            const Int_t&  first_evt,    const Int_t&  nb_of_taken_evts,
00047                            const Int_t&  super_module):TNamed(name,title) {
00048   
00049   // Constructor with arguments for reading ROOT file.
00050   // Called in GetReadyToReadRootfile(...) of TCnaReadEB
00051   // Please give a name and a title containing info about what
00052   // you are doing and saving in the ROOT file
00053 
00054   Init();
00055 
00056   fTypAna        = typ_ana;
00057   fRunNumber     = run_number;
00058   fFirstEvt      = first_evt;
00059   fNbOfTakenEvts = nb_of_taken_evts;
00060   fSuperModule   = super_module;
00061 
00062   fNbBinsSampTime = fNbOfTakenEvts;
00063 }
00064 
00065 TCnaHeaderEB::~TCnaHeaderEB() {
00066   //destructor
00067 
00068 }
00069 
00070 void TCnaHeaderEB::Init() {
00071   //Set default values in all variables and init the counters fxxxCalc
00072 
00073   //--------------------------------- INIT parameters
00074 
00075   //........................ RUN parameters
00076 
00077   fTypAna        = "!Analysis name> no info";
00078   fRunNumber     = (Int_t)0;
00079   fFirstEvt      = (Int_t)0;
00080   fNbOfTakenEvts = (Int_t)0;
00081   fSuperModule   = (Int_t)0;
00082   fStartTime     = (time_t)0;
00083   fStopTime      = (time_t)0;
00084   fStartDate     = "!Start date> no info";
00085   fStopDate      = "!Stop  date> no info";
00086   fNentries      = (Int_t)0;
00087 
00088   //....................... CMS/ECAL parameters
00089 
00090   TEBParameters* MyEcal = new TEBParameters();   fCnew++;
00091 
00092   fMaxTowEtaInSM = MyEcal->fMaxTowEtaInSM;
00093   fMaxTowPhiInSM = MyEcal->fMaxTowPhiInSM;
00094   fMaxTowInSM    = MyEcal->fMaxTowInSM;
00095   fMaxCrysInTow  = MyEcal->fMaxCrysInTow;
00096   fMaxSampADC    = MyEcal->fMaxSampADC;
00097   fMaxCrysInSM   = MyEcal->fMaxCrysInSM;
00098 
00099   //....................... CNA internal parameters
00100   fNbBinsADC      = (Int_t)100;      // 100 bins for histos of the event distributions
00101   fNbBinsSampTime = MyEcal->fMaxEvtsInBurstPedRun; // nb of bins for histos of the sample as a function of the event
00102                                                    // = nb of evts per burst (i.e. per gain) in a pedestal run  
00103 
00104   delete MyEcal;                                     fCdelete++;
00105 
00106   //--------------------------------- INIT counters
00107   fTowerNumbersCalc  = 0;
00108   fLastEvtNumberCalc = 0;
00109   fEvtNbInLoopCalc   = 0;
00110   fSampTimeCalc      = 0;
00111   fEvCalc            = 0;
00112   fVarCalc           = 0;
00113   fEvtsCalc          = 0;
00114   fCovCssCalc        = 0;
00115   fCorCssCalc        = 0;
00116   fCovSccCalc        = 0;
00117   fCorSccCalc        = 0;
00118   fCovSccMosCalc     = 0;
00119   fCorSccMosCalc     = 0;
00120   fCovMosccMotCalc   = 0;
00121   fCorMosccMotCalc   = 0;
00122   fEvEvCalc          = 0;
00123   fEvSigCalc         = 0;
00124   fEvCorCssCalc      = 0;
00125   fSigEvCalc         = 0;
00126   fSigSigCalc        = 0;
00127   fSigCorCssCalc     = 0;
00128 
00129   fSvCorrecCovCssCalc  = 0;
00130   fCovCorrecCovCssCalc = 0;
00131   fCorCorrecCovCssCalc = 0;
00132 }
00133 
00134 void TCnaHeaderEB::Print() {
00135   // Print the header
00136   cout << endl;
00137   cout << "     Header parameters " << endl;
00138   cout << endl;
00139   cout << "Run number                   : " << fRunNumber        << endl;
00140   cout << "First taken event            : " << fFirstEvt         << endl;
00141   cout << "Nb of taken events           : " << fNbOfTakenEvts    << endl;
00142   cout << "Super-module number          : " << fSuperModule      << endl;
00143   cout << "Time first taken event       : " << fStartTime        << endl;
00144   cout << "Time last  taken event       : " << fStopTime         << endl;
00145   cout << "Date first taken event       : " << fStartDate ;
00146   cout << "Date last  taken event       : " << fStopDate  ;
00147   cout << "Number of entries            : " << fNentries         << endl;
00148   cout << endl;
00149   cout << "Max nb of towers in SM       : " << fMaxTowInSM       << endl;
00150   cout << "Max nN of crystals in tower  : " << fMaxCrysInTow     << endl;
00151   cout << " ( => Max nb of crystals in SM =  " << fMaxCrysInSM << " ) " << endl;
00152   cout << endl;
00153   cout << "Max nb of samples ADC        : " << fMaxSampADC       << endl;
00154   cout << "Nb of bins for ADC distribs  : " << fNbBinsADC        << endl;
00155   //cout << "Nb of points for evol graphs : " << fNbBinsEvol       << endl;
00156   cout << "Nb of bins for sample/evt    : " << fNbBinsSampTime   << endl;
00157   cout << endl;
00158 
00159   cout << "     Header counters " << endl;
00160   cout << endl;
00161   cout << "Tower Numbers                                : "
00162        << fTowerNumbersCalc << endl;
00163   cout << "Numbers of found evts                        : "
00164        << fLastEvtNumberCalc << endl;
00165   cout << "Event numbers in loop of the data reading    : "
00166        << fEvtNbInLoopCalc << endl;
00167   cout << "Samples as a function of time histograms     : "
00168        << fSampTimeCalc << endl;
00169   cout << "Expectation values histogram                 : "
00170        << fEvCalc    << endl;
00171   cout << "Variances histogram                          : "
00172        << fVarCalc   << endl;
00173   cout << "Nb of events histograms (ADC's values)       : "
00174        << fEvtsCalc  << endl;
00175   cout << "Nb of (sample,sample) covariance  matrices   : "
00176        << fCovCssCalc << endl;
00177   cout << "Nb of (sample,sample) correlation matrices   : "
00178        << fCorCssCalc << endl;
00179   cout << "Nb of (channel,channel) covariance  matrices : "
00180        << fCovSccCalc << endl;
00181   cout << "Nb of (channel,channel) correlation matrices : "
00182        << fCorSccCalc << endl;
00183   cout << "Nb of (channel,channel) cov mat mean on samp : "
00184        << fCovSccMosCalc << endl;
00185   cout << "Nb of (channel,channel) cor mat mean on samp : "
00186        << fCorSccMosCalc << endl;
00187   cout << "Nb of mean cov(c,c) mean on samp, all towers : "
00188        << fCovSccMosCalc << endl;
00189   cout << "Nb of mean cor(c,c) mean on samp, all towers : "
00190        << fCorSccMosCalc << endl;
00191 
00192   cout << "Exp. val. of the exp. val. of the samples    : "
00193        << fEvEvCalc     << endl;
00194   cout << "Expect. val. of the sigmas of the samples    : "
00195        << fEvSigCalc    << endl;
00196   cout << "Expect. val. of the (samp,samp) correlations : "
00197        << fEvCorCssCalc << endl;
00198 
00199   cout << "Sigmas of the exp. val. of the samples       : "
00200        << fSigEvCalc     << endl;
00201   cout << "Sigmas of the sigmas of the samples          : "
00202        << fSigSigCalc     << endl;
00203   cout << "Sigmas of the (samp,samp) correlations       : "
00204        << fSigCorCssCalc     << endl;
00205 
00206   cout << "Corrections to the sample values             : "
00207        << fSvCorrecCovCssCalc  << endl;
00208   cout << "Corrections to the (samp,samp) covariances   : "
00209        << fCovCorrecCovCssCalc << endl;
00210   cout << "Corrections to the (samp,samp) correlations  : "
00211        << fCorCorrecCovCssCalc << endl;
00212   cout << endl;
00213 }

Generated on Tue Jun 9 17:25:16 2009 for CMSSW by  doxygen 1.5.4