Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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

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

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

0004 
0005 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaResultType.h"
0006 #include "Riostream.h"
0007 
0008 //--------------------------------------

0009 //  TEcnaResultType.cc

0010 //  Class creation: 03 Dec 2002

0011 //  Documentation: see TEcnaResultType.h

0012 //--------------------------------------

0013 
0014 ClassImp(TEcnaResultType);
0015 //___________________________________________________________________________

0016 //

0017 
0018 // INFO ========> fMatMat and fMatHis Type is TEcnaNArrayD (visible in TEcnaResultType.h only)

0019 //

0020 //.... Constructor without Arguments

0021 
0022 TEcnaResultType::TEcnaResultType() {
0023   // std::cout << "[Info Management] CLASS: TEcnaResultType.    CREATE OBJECT: this = " << this << std::endl;

0024 
0025   fMatMat.ReSet(1, 1);
0026   fMatHis.ReSet(1, 1);
0027 }
0028 
0029 TEcnaResultType::TEcnaResultType(TEcnaObject* pObjectManager) {
0030   // std::cout << "[Info Management] CLASS: TEcnaResultType.    CREATE OBJECT: this = " << this << std::endl;

0031 
0032   Long_t i_this = (Long_t)this;
0033   pObjectManager->RegisterPointer("TEcnaResultType", i_this);
0034 
0035   fMatMat.ReSet(1, 1);
0036   fMatHis.ReSet(1, 1);
0037 }
0038 
0039 #define CWAR
0040 #ifndef CWAR
0041 
0042 TEcnaResultType::TEcnaResultType(
0043     CnaResultTyp typ, Int_t i, Int_t xArgNrowMat, Int_t xArgNcolMat, Int_t xArgNrowHis, Int_t xArgNcolHis) {
0044   //constructor

0045 
0046   // std::cout << "[Info Management] CLASS: TEcnaResultType.    CREATE OBJECT: this = " << this << std::endl;

0047 
0048   fTypOfCnaResult = typ;
0049   fIthElement = i;
0050 
0051   fMatMat.ReSet(1, 1);
0052   fMatHis.ReSet(1, 1);
0053 
0054   if ((xArgNrowMat > 0) && (xArgNcolMat > 0)) {
0055     fMatMat.ReSet(xArgNrowMat, xArgNcolMat);
0056   } else {
0057     fMatMat.ReSet(1, 1);
0058   }
0059 
0060   if ((xArgNrowHis > 0) && (xArgNcolHis > 0)) {
0061     fMatHis.ReSet(xArgNrowHis, xArgNcolHis);
0062   } else {
0063     fMatHis.ReSet(1, 1);
0064   }
0065 }
0066 
0067 #endif  // CWAR

0068 
0069 TEcnaResultType::~TEcnaResultType() {
0070   //destructor

0071 
0072   // std::cout << "[Info Management] CLASS: TEcnaResultType.    DESTROY OBJECT: this = " << this << std::endl;

0073 }
0074 
0075 void TEcnaResultType::SetSizeMat(Int_t nrow, Int_t ncol) {
0076   //Set size of fMatMat

0077   nrow = TMath::Abs(nrow);
0078   ncol = TMath::Abs(ncol);
0079   if ((nrow > 0) && (ncol > 0))
0080     fMatMat.ReSet(nrow, ncol);
0081   else
0082     fMatMat.ReSet(1, 1);
0083 }
0084 
0085 void TEcnaResultType::SetSizeHis(Int_t nrow, Int_t ncol) {
0086   //Set size of fMatHis

0087   nrow = TMath::Abs(nrow);
0088   ncol = TMath::Abs(ncol);
0089   if ((nrow > 0) && (ncol > 0))
0090     fMatHis.ReSet(nrow, ncol);
0091   else
0092     fMatHis.ReSet(1, 1);
0093 }
0094 
0095 CnaResultTyp TEcnaResultType::GetTypOfEntry(Int_t kEntry) {
0096   //Gives the type of the kth entry

0097 
0098   //.......... List of the different types and associated parameters:

0099   //

0100   //    Nb of     Type of array            Type      Type

0101   //   arrays                             Number

0102   //

0103   //        1   fMatHis(1,tower)           ( 0)    cTypNumbers

0104   //        1   fMatHis(channel, sample)   ( 1)    cTypMSp

0105   //        1   fMatHis(channel, sample)   ( 2)    cTypSSp

0106   //  channel   fMatHis(sample,  bins)     ( 3)    cTypAvTno,

0107   //        1   fMatHis(channel, sample)   ( 4)    cTypAvLfn

0108   //        1   fMatHis(channel, sample)   ( 5)    cTypAvHfn

0109   //   sample   fMatMat(channel, channel)  ( 6)    cTypHfCov

0110   //   sample   fMatMat(channel, channel)  ( 7)    cTypHfCor

0111   //  channel   fMatMat(sample,  sample)   ( 8)    cTypCovCss

0112   //  channel   fMatMat(sample,  sample)   ( 9)    cTypCorCss

0113   //        1   fMatHis(1,channel)         (10)    cTypMeanCorss

0114   //        1   fMatHis(1,channel)         (11)    cTypSigCorss

0115   //        1   fMatHis(channel, sample)   (12)    cTypAvPed

0116   //  channel   fMatMat(sample,  sample)   (13)    cTypAvMeanCorss

0117   //  channel   fMatMat(sample,  sample)   (14)    cTypAvSigCorss

0118   //        1   fMatHis(channel, sample)   (15)    cTypNbOfEvts

0119   //        1   fMatHis(1,channel)         (16)    cTypPed

0120   //        1   fMatHis(1,channel)         (17)    cTypTno

0121   //        1   fMatHis(1,channel)         (18)    cTypLfn

0122   //        1   fMatHis(1,channel)         (19)    cTypHfn

0123   //  channel   fMatHis(sample,  bins)     (20)    cTypAdcEvt

0124   //        1   fMatMat(channel, channel)  (21)    cTypLfCov

0125   //        1   fMatMat(channel, channel)  (22)    cTypLfCor

0126   //        1   fMatMat(channel, channel)  (23)    cTypLFccMoStins

0127   //        1   fMatMat(channel, channel)  (24)    cTypHFccMoStins

0128   //        1   fMatMat(tower, bin_evt)    (25)    cTypEvtNbInLoop

0129 
0130   CnaResultTyp xResultType = cTypNumbers;  // (default)

0131 
0132   if (kEntry == 0) {
0133     xResultType = cTypNumbers;
0134   }
0135   if (kEntry == 1) {
0136     xResultType = cTypMSp;
0137   }
0138   if (kEntry == 2) {
0139     xResultType = cTypSSp;
0140   }
0141 
0142   if (kEntry == 3) {
0143     xResultType = cTypAvTno;
0144   }
0145   if (kEntry == 4) {
0146     xResultType = cTypAvLfn;
0147   }
0148   if (kEntry == 5) {
0149     xResultType = cTypAvHfn;
0150   }
0151 
0152   if (kEntry == 6) {
0153     xResultType = cTypHfCov;
0154   }
0155   if (kEntry == 7) {
0156     xResultType = cTypHfCor;
0157   }
0158 
0159   if (kEntry == 8) {
0160     xResultType = cTypCovCss;
0161   }
0162   if (kEntry == 9) {
0163     xResultType = cTypCorCss;
0164   }
0165 
0166   if (kEntry == 10) {
0167     xResultType = cTypMeanCorss;
0168   }
0169   if (kEntry == 11) {
0170     xResultType = cTypSigCorss;
0171   }
0172 
0173   if (kEntry == 12) {
0174     xResultType = cTypAvPed;
0175   }
0176   if (kEntry == 13) {
0177     xResultType = cTypAvMeanCorss;
0178   }
0179   if (kEntry == 14) {
0180     xResultType = cTypAvSigCorss;
0181   }
0182 
0183   if (kEntry == 15) {
0184     xResultType = cTypNbOfEvts;
0185   }
0186 
0187   if (kEntry == 16) {
0188     xResultType = cTypPed;
0189   }
0190   if (kEntry == 17) {
0191     xResultType = cTypTno;
0192   }
0193   if (kEntry == 18) {
0194     xResultType = cTypLfn;
0195   }
0196   if (kEntry == 19) {
0197     xResultType = cTypHfn;
0198   }
0199 
0200   if (kEntry == 20) {
0201     xResultType = cTypAdcEvt;
0202   }
0203 
0204   if (kEntry == 21) {
0205     xResultType = cTypLfCov;
0206   }
0207   if (kEntry == 22) {
0208     xResultType = cTypLfCor;
0209   }
0210 
0211   if (kEntry == 23) {
0212     xResultType = cTypLFccMoStins;
0213   }
0214   if (kEntry == 24) {
0215     xResultType = cTypHFccMoStins;
0216   }
0217 
0218   if (kEntry == 25) {
0219     xResultType = cTypEvtNbInLoop;
0220   }  // (FREE)

0221 
0222   return xResultType;
0223 }