File indexing completed on 2023-03-17 10:41:32
0001 #ifndef MusEcal_hh
0002 #define MusEcal_hh
0003
0004 #include <map>
0005
0006
0007
0008
0009
0010
0011
0012 #include <TROOT.h>
0013 #include <TH1.h>
0014 #include <TH2.h>
0015 #include <TTree.h>
0016 #include <TFile.h>
0017
0018 #include "../../interface/ME.h"
0019
0020 class MERunManager;
0021 class MERun;
0022 class MEChannel;
0023
0024
0025
0026
0027 class MusEcal
0028 {
0029
0030 public:
0031
0032 typedef std::map< ME::Time, MERun* > RunMap;
0033 typedef std::map< ME::Time, float > FloatTimeMap;
0034 typedef std::map< ME::Time, bool > BoolTimeMap;
0035 typedef std::pair< float, bool > Var;
0036 typedef std::map< ME::Time, Var > VarTimeMap;
0037 typedef std::vector<Var> VarVec;
0038 typedef std::map< ME::Time, VarVec* > VarVecTimeMap;
0039 typedef RunMap::iterator RunIterator;
0040 typedef RunMap::const_iterator RunConstIterator;
0041
0042 enum HistCateg { iH_APD=0, iH_PN, iH_MTQ, iSizeHC };
0043 enum HistType { iHIST=0, iVS_CHANNEL, iMAP, iSizeHT };
0044
0045
0046 enum { iNLS, iCorNLS, iAPDoPNA, iAPDoPNB, iAPDoPN, iAPD, iAPDTime,
0047 iPNA, iPNB, iPNBoPNA, iAlphaBeta, iAlphaBeta_used, iShapeCor,
0048 iMTQTrise, iMTQAmpl, iMTQFwhm, iMTQFw20, iMTQFw80, iMTQTime,
0049 iSizeLV };
0050
0051
0052 enum { iTPAPD_0, iTPAPD_1, iTPAPD_2, iTPPNA_0, iTPPNA_1, iTPPNB_0, iTPPNB_1, iSizeTPV };
0053
0054
0055 enum { iOneHundredPercent, iFiftyPercent, iThirtyPercent, iTenPercent,
0056 iFivePercent, iThreePercent, iPercent,
0057 iFivePerMil, iThreePerMil, iPerMil, iZero };
0058
0059 static TString historyVarTitle[iSizeLV];
0060 static TString historyVarName[iSizeLV];
0061 static int iGVar[iSizeLV];
0062 static int historyVarZoom[ME::iSizeC][iSizeLV];
0063 static int historyVarColor[iSizeLV];
0064 static TString historyTPVarName[iSizeTPV];
0065 static TString historyTPVarTitle[iSizeTPV];
0066 static int iGTPVar[iSizeTPV];
0067 static int historyTPVarColor[iSizeTPV];
0068 static int historyTPVarZoom[iSizeTPV];
0069 static TString zoomName[ iZero ];
0070 static double zoomRange[ iZero ];
0071 static TString mgrName( int lmr, int type, int color );
0072 static int firstRun;
0073 static int lastRun;
0074
0075
0076 MusEcal( int type=ME::iLaser, int color=ME::iBlue );
0077 virtual ~MusEcal();
0078
0079
0080 MERunManager* runMgr( int lmr ) { return runMgr( lmr, _type, _color ); }
0081 MERunManager* runMgr() { return runMgr( _lmr, _type, _color ); }
0082
0083
0084 MERunManager* curMgr() { return runMgr( _lmr ); }
0085
0086
0087 virtual void setType( int type, int color=ME::iBlue );
0088
0089
0090 virtual void setLMRegion( int lmr );
0091
0092
0093 virtual void setTime( ME::Time );
0094
0095
0096 virtual void setChannel( MEChannel* );
0097 virtual void setChannel( int ig, int ieta, int iphi, bool useEtaPhi=true );
0098
0099
0100 void oneLevelUp();
0101
0102
0103 void setDefaultTime();
0104
0105
0106 void setRunAndSequence( unsigned int run, int seq=1 );
0107
0108
0109 bool nextSequence();
0110
0111
0112 void setVar( int var=MusEcal::iAPD ) { _var = var; _zoom = 0; }
0113
0114
0115 void dumpVector( int ivar );
0116
0117
0118 void histConfig();
0119 void bookHistograms();
0120 void bookEBAPDHistograms();
0121 void bookEBPNHistograms();
0122 void bookEEAPDHistograms();
0123 void bookEEPNHistograms();
0124 void fillHistograms();
0125 void fillEBGlobalHistograms();
0126 void fillEBLocalHistograms();
0127 void fillEEGlobalHistograms();
0128 void fillEELocalHistograms();
0129 void writeGlobalHistograms();
0130
0131
0132 static bool verbose;
0133
0134 protected:
0135
0136 virtual void refresh();
0137
0138
0139 std::map< TString, MERunManager* > _runMgr;
0140
0141
0142 MERunManager* runMgr( int lmr, int type, int color );
0143
0144
0145 int _lmr;
0146 bool isBarrel();
0147
0148
0149 int _type;
0150
0151
0152 int _color;
0153
0154
0155 MEChannel* _leaf;
0156
0157
0158 int _ig;
0159
0160
0161 ME::Time _time;
0162
0163
0164 int _var;
0165
0166
0167 int _zoom;
0168
0169
0170 bool _debug;
0171
0172
0173 bool _isGUI;
0174
0175
0176
0177
0178 bool _histoBooked;
0179 bool _ebHistoBooked;
0180 bool _eeHistoBooked;
0181
0182 TFile* _febgeom;
0183 TH2 *_eb_h, *_eb_loc_h;
0184 std::map< TString, TH1* > _eb_m;
0185 std::map< TString, TH1* > _eb_loc_m;
0186
0187 TFile* _feegeom;
0188 TH2* _ee_h;
0189 TH2* _ee_loc_h[10];
0190 std::map< TString, TH1* > _ee_m;
0191 std::map< TString, TH1* > _ee_loc_m;
0192
0193
0194 std::map< TString, int > _eb_nbin;
0195 std::map< TString, float > _eb_min;
0196 std::map< TString, float > _eb_max;
0197 std::map< TString, int > _ee_nbin;
0198 std::map< TString, float > _ee_min;
0199 std::map< TString, float > _ee_max;
0200 int hist_nbin( TString& );
0201 float hist_min( TString& );
0202 float hist_max( TString& );
0203
0204 TTree* _seq_t;
0205 Int_t _seq_run;
0206 Int_t _seq_lb;
0207 Int_t _seq_tbeg;
0208 Int_t _seq_tlmr[92];
0209
0210 TBranch *b_seq_run;
0211 TBranch *b_seq_lb;
0212 TBranch *b_seq_tbeg;
0213 TBranch *b_seq_tlmr[92];
0214
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238
0239
0240
0241
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255
0256
0257
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293
0294
0295 public:
0296
0297
0298 ClassDef(MusEcal,0)
0299 };
0300
0301 #endif
0302