CMS 3D CMS Logo

EcalTestPulseAnalyzer.h
Go to the documentation of this file.
1 
2 #include <memory>
4 
5 class TFile;
6 class TTree;
7 
8 // Define geometrical constants
9 // NOT the same for "EB" and "EE"
10 //
11 // "EB" "EE"
12 //
13 // 0 0
14 // 1 2 1 2
15 // 3 4
16 // 5 6
17 // 7 8
18 //
19 //
20 // "EB" geometry
21 // "EB" geometry
22 #define NCRYSEB 1700 // Number of crystals per EB supermodule
23 #define NTTEB 68 // Number of EB Trigger Towers
24 #define NMODEB 9 // Number of EB submodules
25 #define NPNPERMOD 2 // Number of PN per module
26 
27 // "EE" geometry
28 #define NCRYSEE 830 // Number of crystals per EE supermodule
29 #define NTTEE 68 // Number of EE Trigger Towers
30 #define NMODEE 21 // Number of EE submodules
31 
32 #define NGAINPN 2 // Number of gains
33 #define NGAINAPD 4 // Number of gains
34 
35 
37 
38  public:
39 
40  explicit EcalTestPulseAnalyzer(const edm::ParameterSet& iConfig);
42 
43 
44  virtual void analyze( const edm::Event & e, const edm::EventSetup& c);
45  virtual void beginJob();
46  virtual void endJob();
47 
48 
49  private:
50 
51  int iEvent;
52 
53  // Framework parameters
54 
55  unsigned int _nsamples;
56  unsigned int _presample;
57  unsigned int _firstsample;
58  unsigned int _lastsample;
59  unsigned int _samplemin;
60  unsigned int _samplemax;
61  unsigned int _nsamplesPN;
62  unsigned int _presamplePN;
63  unsigned int _firstsamplePN;
64  unsigned int _lastsamplePN;
65  unsigned int _niter ;
66  double _chi2max ;
67  double _timeofmax ;
69  int _fedid;
70 
77 
78 
79  // Output file names
80 
83 
84  // Define geometrical constants
85  // Default values correspond to "EB" geometry (1700 crystals)
86 
87  unsigned int nCrys;
88  unsigned int nTT;
89  unsigned int nMod;
90  unsigned int nGainPN;
91  unsigned int nGainAPD;
92 
93 
94  // Count TP Events
95  int TPEvents;
96 
97  double ret_data[20];
98 
99  int towerID;
101 
102  // Identify run
103 
104  int runType;
105  int runNum;
106  int fedID;
107  int dccID;
108  int side;
109  int iZ;
110 
111 
112  // Root Files
113 
114  TFile *outFile; // from 'analyze': Data
115  TFile *resFile; // from 'endJob': Results
116 
117 
118  // Temporary data trees
119 
120  TTree *trees[NCRYSEB];
121 
122  // Declaration of leaves types
123 
124  int phi, eta;
125  int event ;
126  double adc[10] ;
127  double pn[50] ;
128 
129  int apdGain;
130  int pnGain;
131  int pnG;
132  double apdAmpl;
133  double apdTime;
134  double pnAmpl0;
135  double pnAmpl1;
136  double pnAmpl;
137 
138 
139  // Results trees
140 
141  TTree *restrees;
142  TTree *respntrees;
143 
144 
145  std::map<int, int> channelMapEE;
146  std::vector<int> dccMEM;
147  std::vector<int> modules;
148 
149 
150  // Declaration of leaves types
151 
152  int ieta, iphi, flag, gain;
155  double APD[6], PN[6];
156 
158  unsigned int iModule[NCRYSEB];
160 
161  unsigned int firstChanMod[NMODEB];
163 
164 
165 };
166 
167 
std::map< int, int > channelMapEE
unsigned int iModule[1700]
#define NCRYSEB
std::vector< int > modules
EcalTestPulseAnalyzer(const edm::ParameterSet &iConfig)
#define NMODEB
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
unsigned int isFirstChanModFilled[9]