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 
36 public:
37  explicit EcalTestPulseAnalyzer(const edm::ParameterSet &iConfig);
38  ~EcalTestPulseAnalyzer() override;
39 
40  void analyze(const edm::Event &e, const edm::EventSetup &c) override;
41  void beginJob() override;
42  void endJob() override;
43 
44 private:
45  int iEvent;
46 
47  // Framework parameters
48 
49  unsigned int _nsamples;
50  unsigned int _presample;
51  unsigned int _firstsample;
52  unsigned int _lastsample;
53  unsigned int _samplemin;
54  unsigned int _samplemax;
55  unsigned int _nsamplesPN;
56  unsigned int _presamplePN;
57  unsigned int _firstsamplePN;
58  unsigned int _lastsamplePN;
59  unsigned int _niter;
60  double _chi2max;
61  double _timeofmax;
63  int _fedid;
64 
71 
72  // Output file names
73 
76 
77  // Define geometrical constants
78  // Default values correspond to "EB" geometry (1700 crystals)
79 
80  unsigned int nCrys;
81  unsigned int nTT;
82  unsigned int nMod;
83  unsigned int nGainPN;
84  unsigned int nGainAPD;
85 
86  // Count TP Events
87  int TPEvents;
88 
89  double ret_data[20];
90 
91  int towerID;
92  int channelID;
93 
94  // Identify run
95 
96  int runType;
97  int runNum;
98  int fedID;
99  int dccID;
100  int side;
101  int iZ;
102 
103  // Root Files
104 
105  TFile *outFile; // from 'analyze': Data
106  TFile *resFile; // from 'endJob': Results
107 
108  // Temporary data trees
109 
110  TTree *trees[NCRYSEB];
111 
112  // Declaration of leaves types
113 
114  int phi, eta;
115  int event;
116  double adc[10];
117  double pn[50];
118 
119  int apdGain;
120  int pnGain;
121  int pnG;
122  double apdAmpl;
123  double apdTime;
124  double pnAmpl0;
125  double pnAmpl1;
126  double pnAmpl;
127 
128  // Results trees
129 
130  TTree *restrees;
131  TTree *respntrees;
132 
133  std::map<int, int> channelMapEE;
134  std::vector<int> dccMEM;
135  std::vector<int> modules;
136 
137  // Declaration of leaves types
138 
139  int ieta, iphi, flag, gain;
142  double APD[6], PN[6];
143 
145  unsigned int iModule[NCRYSEB];
147 
148  unsigned int firstChanMod[NMODEB];
150 };
std::map< int, int > channelMapEE
unsigned int iModule[1700]
#define NCRYSEB
void analyze(const edm::Event &e, const edm::EventSetup &c) override
std::vector< int > modules
EcalTestPulseAnalyzer(const edm::ParameterSet &iConfig)
#define NMODEB
unsigned int isFirstChanModFilled[9]