CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ME.h
Go to the documentation of this file.
1 #ifndef ME_hh
2 #define ME_hh
3 
4 #include <vector>
5 #include <map>
6 #include <string>
7 #include <TString.h>
8 
9 class MEChannel;
10 
11 class ME
12 {
13 public:
14 
15  // ECAL regions
16  enum EcalRegion { iEEM=0, iEBM, iEBP, iEEP, iSizeE };
17 
20 
23 
24  // ECAL region from Laser Monitoring Region
25  static int ecalRegion( int ilmr );
26  static bool isBarrel( int ilmr );
27 
28  // Laser Monitoring Region from dcc and side
29  static int lmr( int idcc, int iside );
30 
31  // ECAL Region, Sector, dcc and side from Laser Monitoring Region
32  static void regionAndSector( int ilmr, int& ireg, int& isect, int& idcc, int& iside );
33 
34  // dcc and side from the laser monitoring region
35  static std::pair<int, int> dccAndSide( int ilmr );
36 
37  // get trees of channels
38  static MEChannel* regTree( int ireg );
39  static MEChannel* lmrTree( int ilmr );
41 
42  typedef int DCCid;
43  typedef int LMRid;
44  typedef int LMMid;
45  typedef int PNid;
46  enum PN { iPNA=0, iPNB };
47  static std::pair<ME::DCCid,ME::PNid> pn( ME::LMRid ilmr,
48  ME::LMMid ilmmod,
49  ME::PN ipn );
50  static std::pair<ME::DCCid,ME::DCCid> memFromLmr( ME::LMRid ilmr );
51  static std::vector<ME::LMMid> lmmodFromLmr( ME::LMRid ilmr );
52  static std::vector<ME::DCCid> memFromDcc( ME::DCCid idcc );
53  static std::vector<ME::LMMid> lmmodFromDcc( ME::DCCid idcc );
54  static std::vector< int> apdRefChannels( ME::LMMid ilmmod , ME::LMRid ilmr);
55 
56  // ECAL Region names
57  static TString region[4];
58 
59  // unit names
60  static TString granularity[iSizeG];
61 
62  // Super-Module name from Laser Monitoring Region
63  static TString smNameFromDcc( int idcc );
64  static TString smName( int ilmr );
65 
66  // Super-Module name from ECAL Region and Super-Module
67  static TString smName( int ireg, int ism );
68 
73 
74  typedef unsigned long Time;
75  typedef unsigned long long TimeStamp;
76  static const TimeStamp kLowMask;
77 
78  typedef struct
79  {
80  std::string rundir; int dcc; int side; int run; int lb; int events;
82  } Header;
83 
84  typedef struct
85  {
86  int type; int wavelength; int power; int filter; int delay;
87  int mgpagain; int memgain;
88  } Settings;
89 
90  // Database tables
91  enum { iLmfLaserRun,
101 
102  // Laser primitive variables (table LmfLaserPrim)
110  static TString APDPrimVar[ iSizeAPD ];
111 
112  // PN primitive variables (table LmfLaserPnPrim)
116  static TString PNPrimVar[ iSizePN ];
117 
118  // MATAQ Primitive variables (table iLmfLaserPulse)
123  static TString MTQPrimVar[ iSizeMTQ ];
124 
125  // TP-APD Primitive variables (table iLmfTestPulsePrim)
128  static TString TPAPDPrimVar[ iSizeTPAPD ];
129 
130  // TP-PN Primitive variables (table iLmfTestPulsePnPrim)
133  static TString TPPNPrimVar[ iSizeTPPN ];
134 
135  // Time functions
137  static std::vector< Time > timeDiff( Time t1, Time t2,
138  short int& sign );
139  static float timeDiff( Time t1, Time t0, int tunit=iHour );
140  static Time time( float dt, Time t0, int tunit=iHour );
141  static Time time_low( TimeStamp t );
142  static Time time_high( TimeStamp t );
143 
144  static TString type[iSizeT];
145  static TString color[iSizeC];
146 
147  // get file names
148  static TString path(); // MusEcal main working directory
149  static TString primPath( int lmr ); // where the primitives are
150  static TString lmdataPath( int lmr ); // where the LM data are
151  static TString rootFileName( ME::Header header, ME::Settings settings );
152  static TString runListName( int lmr, int type, int color );
153 
154  virtual ~ME() {}
155 
156  static std::vector<MEChannel*> _trees;
157  //GHM ClassDef(ME,0) // ME -- MusEcal name space
158 };
159 
160 #endif
int PNid
Definition: ME.h:45
static void regionAndSector(int ilmr, int &ireg, int &isect, int &idcc, int &iside)
Definition: ME.cc:348
type
Definition: HCALResponse.h:22
float dt
Definition: AMPTWrapper.h:126
static TString PNPrimVar[iSizePN]
Definition: ME.h:116
static std::vector< ME::DCCid > memFromDcc(ME::DCCid idcc)
Definition: ME.cc:608
int mgpagain
Definition: ME.h:87
int wavelength
Definition: ME.h:86
static TString APDPrimVar[iSizeAPD]
Definition: ME.h:110
static bool useElectronicNumbering
Definition: ME.h:40
static std::pair< ME::DCCid, ME::DCCid > memFromLmr(ME::LMRid ilmr)
Definition: ME.cc:579
static TString TPAPDPrimVar[iSizeTPAPD]
Definition: ME.h:128
virtual ~ME()
Definition: ME.h:154
Definition: ME.h:19
Definition: ME.h:46
static TString type[iSizeT]
Definition: ME.h:144
static TString path()
Definition: ME.cc:82
Definition: ME.h:16
int LMMid
Definition: ME.h:44
EcalRegion
Definition: ME.h:16
Definition: ME.h:16
unsigned long Time
Definition: ME.h:74
static TString granularity[iSizeG]
Definition: ME.h:60
static TString lmdataPath(int lmr)
Definition: ME.cc:62
static std::pair< ME::DCCid, ME::PNid > pn(ME::LMRid ilmr, ME::LMMid ilmmod, ME::PN ipn)
Definition: ME.cc:648
Definition: ME.h:69
static bool isBarrel(int ilmr)
Definition: ME.cc:569
static TString runListName(int lmr, int type, int color)
Definition: ME.cc:118
Definition: ME.h:70
static const TimeStamp kLowMask
Definition: ME.h:76
static Time time_low(TimeStamp t)
Definition: ME.cc:232
static TString MTQPrimVar[iSizeMTQ]
Definition: ME.h:123
static TString rootFileName(ME::Header header, ME::Settings settings)
Definition: ME.cc:88
Definition: ME.h:11
Definition: ME.h:70
TUnit
Definition: ME.h:136
Definition: ME.h:22
Definition: ME.h:113
Definition: ME.h:70
Definition: ME.h:70
static TString TPPNPrimVar[iSizeTPPN]
Definition: ME.h:133
Definition: ME.h:69
static std::pair< int, int > dccAndSide(int ilmr)
Definition: ME.cc:313
TimeStamp ts_end
Definition: ME.h:81
static TString smNameFromDcc(int idcc)
Definition: ME.cc:428
Definition: ME.h:70
int DCCid
Definition: ME.h:42
Definition: ME.h:70
EcalElec
Definition: ME.h:21
Definition: ME.h:16
Definition: ME.h:136
static TString region[4]
Definition: ME.h:57
static Time time(float dt, Time t0, int tunit=iHour)
Definition: ME.cc:208
int side
Definition: ME.h:80
unsigned long long TimeStamp
Definition: ME.h:75
static int ecalRegion(int ilmr)
Definition: ME.cc:249
static MEChannel * regTree(int ireg)
Definition: ME.cc:441
Definition: ME.h:78
PNGain
Definition: ME.h:72
static std::vector< ME::LMMid > lmmodFromLmr(ME::LMRid ilmr)
Definition: ME.cc:598
static int lmr(int idcc, int iside)
Definition: ME.cc:261
static TString primPath(int lmr)
Definition: ME.cc:72
Definition: ME.h:46
RunType
Definition: ME.h:69
tuple events
Definition: patZpeak.py:19
static TString color[iSizeC]
Definition: ME.h:145
Definition: ME.h:70
EcalUnit
Definition: ME.h:18
static Time time_high(TimeStamp t)
Definition: ME.cc:238
static std::vector< Time > timeDiff(Time t1, Time t2, short int &sign)
Definition: ME.cc:142
PN
Definition: ME.h:46
static std::vector< MEChannel * > _trees
Definition: ME.h:156
Definition: ME.h:18
Definition: ME.h:136
int LMRid
Definition: ME.h:43
static TString smName(int ilmr)
Definition: ME.cc:415
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
Definition: ME.h:16
Gain
Definition: ME.h:71
static MEChannel * lmrTree(int ilmr)
Definition: ME.cc:435
static std::vector< int > apdRefChannels(ME::LMMid ilmmod, ME::LMRid ilmr)
Definition: ME.cc:588
Definition: ME.h:16
static std::vector< ME::LMMid > lmmodFromDcc(ME::DCCid idcc)
Definition: ME.cc:623
Color
Definition: ME.h:70