CMS 3D CMS Logo

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