CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/src/TEcnaResultType.cc

Go to the documentation of this file.
00001 //----------Author's Names:FX. Gentit, B.Fabbro  DSM/IRFU/SPP CEA-Saclay
00002 //----------Copyright:Those valid for CEA sofware
00003 //----------Modified: 17/03/2010
00004 
00005 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaResultType.h"
00006 #include "Riostream.h"
00007 
00008 ClassImp(TEcnaResultType)
00009 //___________________________________________________________________________
00010 //
00011 //  Set the results types and dimensions 
00012 //
00013   
00014 //.... Constructor without Arguments
00015   
00016 TEcnaResultType::TEcnaResultType()
00017 {
00018   
00019   // cout << "[Info Management] CLASS: TEcnaResultType.    CREATE OBJECT: this = " << this << endl;
00020 
00021   fMatMat.ReSet(1,1);
00022   fMatHis.ReSet(1,1);
00023 }
00024 
00025 #define CWAR
00026 #ifndef CWAR
00027 
00028 TEcnaResultType::TEcnaResultType(CnaResultTyp  typ,          Int_t   i,
00029                                Int_t         xArgNrowMat,  Int_t   xArgNcolMat,
00030                                Int_t         xArgNrowHis,  Int_t   xArgNcolHis)
00031 {
00032 //constructor
00033 
00034   // cout << "[Info Management] CLASS: TEcnaResultType.    CREATE OBJECT: this = " << this << endl;
00035 
00036   fTypOfCnaResult = typ;
00037   fIthElement     = i;
00038 
00039   fMatMat.ReSet(1,1);
00040   fMatHis.ReSet(1,1);
00041 
00042   if ( (xArgNrowMat>0) && (xArgNcolMat>0) )
00043     {
00044       fMatMat.ReSet(xArgNrowMat,xArgNcolMat);
00045     }
00046   else
00047     {
00048       fMatMat.ReSet(1,1);
00049     }
00050 
00051   if ( (xArgNrowHis>0) && (xArgNcolHis>0) )
00052     {
00053       fMatHis.ReSet(xArgNrowHis,xArgNcolHis);
00054     }
00055   else 
00056     {
00057       fMatHis.ReSet(1,1);
00058     }
00059 }
00060 
00061 #endif // CWAR
00062 
00063 TEcnaResultType::~TEcnaResultType() {
00064 //destructor
00065 
00066   // cout << "[Info Management] CLASS: TEcnaResultType.    DESTROY OBJECT: this = " << this << endl;
00067 }
00068 
00069 void TEcnaResultType::SetSizeMat(Int_t nrow, Int_t ncol) {
00070 //Set size of fMatMat
00071   nrow = TMath::Abs(nrow);
00072   ncol = TMath::Abs(ncol);
00073   if ((nrow>0) && (ncol>0)) fMatMat.ReSet(nrow,ncol);
00074   else                      fMatMat.ReSet(1,1);
00075 }
00076 
00077 void TEcnaResultType::SetSizeHis(Int_t nrow, Int_t ncol) {
00078 //Set size of fMatHis
00079   nrow = TMath::Abs(nrow);
00080   ncol = TMath::Abs(ncol);
00081   if ((nrow>0) && (ncol>0)) fMatHis.ReSet(nrow,ncol);
00082   else                      fMatHis.ReSet(1,1);
00083 }
00084 
00085 CnaResultTyp  TEcnaResultType::GetTypOfEntry(Int_t  kEntry)
00086 {
00087 //Gives the type of the kth entry
00088 
00089 //.......... List of the different types and associated parameters:
00090 //
00091 //    Nb of     Type of array            Type      Type
00092 //   arrays                             Number 
00093 //
00094 //        1   fMatHis(1,tower)           ( 0)    cTypNumbers  
00095 //        1   fMatHis(channel, sample)   ( 1)    cTypMSp    
00096 //        1   fMatHis(channel, sample)   ( 2)    cTypSSp
00097 //  channel   fMatHis(sample,  bins)     ( 3)    cTypAvTno,
00098 //        1   fMatHis(channel, sample)   ( 4)    cTypAvLfn
00099 //        1   fMatHis(channel, sample)   ( 5)    cTypAvHfn
00100 //   sample   fMatMat(channel, channel)  ( 6)    cTypHfCov
00101 //   sample   fMatMat(channel, channel)  ( 7)    cTypHfCor
00102 //  channel   fMatMat(sample,  sample)   ( 8)    cTypCovCss
00103 //  channel   fMatMat(sample,  sample)   ( 9)    cTypCorCss
00104 //        1   fMatHis(1,channel)         (10)    cTypMeanCorss
00105 //        1   fMatHis(1,channel)         (11)    cTypSigCorss
00106 //        1   fMatHis(channel, sample)   (12)    cTypAvPed
00107 //  channel   fMatMat(sample,  sample)   (13)    cTypAvMeanCorss
00108 //  channel   fMatMat(sample,  sample)   (14)    cTypAvSigCorss
00109 //        1   fMatHis(channel, sample)   (15)    cTypNbOfEvts 
00110 //        1   fMatHis(1,channel)         (16)    cTypPed
00111 //        1   fMatHis(1,channel)         (17)    cTypTno
00112 //        1   fMatHis(1,channel)         (18)    cTypLfn
00113 //        1   fMatHis(1,channel)         (19)    cTypHfn
00114 //  channel   fMatHis(sample,  bins)     (20)    cTypAdcEvt
00115 //        1   fMatMat(channel, channel)  (21)    cTypLfCov
00116 //        1   fMatMat(channel, channel)  (22)    cTypLfCor
00117 //        1   fMatMat(channel, channel)  (23)    cTypLFccMoStins
00118 //        1   fMatMat(channel, channel)  (24)    cTypHFccMoStins
00119 //        1   fMatMat(tower, bin_evt)    (25)    cTypEvtNbInLoop     
00120 
00121   CnaResultTyp  xResultType = cTypNumbers;   // (default)
00122 
00123  if (kEntry ==  0 ) { xResultType = cTypNumbers;}
00124  if (kEntry ==  1 ) { xResultType = cTypMSp;}
00125  if (kEntry ==  2 ) { xResultType = cTypSSp;}
00126 
00127  if (kEntry ==  3 ) { xResultType = cTypAvTno;}
00128  if (kEntry ==  4 ) { xResultType = cTypAvLfn;}
00129  if (kEntry ==  5 ) { xResultType = cTypAvHfn;}
00130 
00131  if (kEntry ==  6 ) { xResultType = cTypHfCov;}
00132  if (kEntry ==  7 ) { xResultType = cTypHfCor;}
00133 
00134  if (kEntry ==  8 ) { xResultType = cTypCovCss;}
00135  if (kEntry ==  9 ) { xResultType = cTypCorCss;}
00136 
00137  if (kEntry == 10 ) { xResultType = cTypMeanCorss;}
00138  if (kEntry == 11 ) { xResultType = cTypSigCorss;}
00139 
00140  if (kEntry == 12 ) { xResultType = cTypAvPed;}
00141  if (kEntry == 13 ) { xResultType = cTypAvMeanCorss;}
00142  if (kEntry == 14 ) { xResultType = cTypAvSigCorss;}
00143 
00144  if (kEntry == 15 ) { xResultType = cTypNbOfEvts;}
00145 
00146  if (kEntry == 16 ) { xResultType = cTypPed;}
00147  if (kEntry == 17 ) { xResultType = cTypTno;}
00148  if (kEntry == 18 ) { xResultType = cTypLfn;}
00149  if (kEntry == 19 ) { xResultType = cTypHfn;}
00150 
00151  if (kEntry == 20 ) { xResultType = cTypAdcEvt;}
00152 
00153  if (kEntry == 21 ) { xResultType = cTypLfCov;}
00154  if (kEntry == 22 ) { xResultType = cTypLfCor;}
00155 
00156  if (kEntry == 23 ) { xResultType = cTypLFccMoStins;}
00157  if (kEntry == 24 ) { xResultType = cTypHFccMoStins;}
00158 
00159  if (kEntry == 25 ) { xResultType = cTypEvtNbInLoop;}      // (FREE)
00160 
00161  return xResultType;
00162 }