CMS 3D CMS Logo

EcnaAnalyzer.h
Go to the documentation of this file.
1 #ifndef CL_EcnaAnalyzer_H
2 #define CL_EcnaAnalyzer_H
3 
4 // -*- C++ -*-
5 //
6 // Package: EcalCorrelatedNoiseAnalysisModules
7 // Class: EcnaAnalyzer
8 //
17 //
18 // Original Author: Bernard Fabbro
19 // Created: Fri Jun 2 10:27:01 CEST 2006
20 // $Id: EcnaAnalyzer.h,v 1.3 2013/04/05 20:17:20 wmtan Exp $
21 //
22 //
23 
24 // system include files
25 #include "Riostream.h"
26 #include <ctime>
27 #include <fstream>
28 #include <iomanip>
29 #include <iostream>
30 #include <memory>
31 #include <string>
32 #include <vector>
33 
34 #include <csignal>
35 #include <sys/time.h>
36 
37 // ROOT include files
38 #include "TObject.h"
39 #include "TString.h"
40 #include "TSystem.h"
41 #include "TTreeIndex.h"
42 #include "TVectorD.h"
43 
44 // CMSSW include files
53 
55 
63 
65 
68 
69 // user include files
75 
128 
129 //
130 // class declaration
131 //
132 
134 public:
135  enum { kChannels = 1700, kGains = 3, kFirstGainId = 1 };
136 
137  explicit EcnaAnalyzer(const edm::ParameterSet &);
138  ~EcnaAnalyzer() override;
139 
140  void analyze(const edm::Event &, const edm::EventSetup &) override;
141  TString runtype(const Int_t &);
142  Int_t gainvalue(const Int_t &);
143  void CheckMsg(const Int_t &, const Int_t &);
144  void CheckMsg(const Int_t &);
145  Bool_t AnalysisOutcome(const TString &);
146 
147 private:
148  constexpr static Int_t fgMaxCar = 512; // Max nb of caracters for char*
149  TString fTTBELL;
150 
151  // ----------member data ---------------------------
152  unsigned int verbosity_;
153  Int_t nChannels_;
154  Int_t iEvent_; // should be removed when we can access class EventID
163 
164  TString sAnalysisName_;
165  TString sNbOfSamples_;
167  TString sLastReqEvent_;
168  TString sReqNbOfEvts_;
169  TString sStexName_;
170  TString sStexNumber_;
171 
173 
174  Int_t fEvtNumber;
176  Int_t fRecNumber;
179 
180  std::vector<Int_t> fBuildEventDistribBad;
181  std::vector<Int_t> fBuildEventDistribGood;
182 
183  TString fCfgAnalyzerParametersFilePath; // absolute path for the analyzer
184  // parameters files (/afs/etc...)
185  TString fCfgAnalyzerParametersFileName; // name of the analyzer parameters file
186  std::ifstream fFcin_f;
187 
188  TString fAnalysisName;
189  Int_t fChozenGainNumber; // determined from fAnalysisName
190  Int_t fChozenRunTypeNumber; // determined from fAnalysisName
191  TString fDynBaseLineSub; // determined from fAnalysisName
192 
194  Int_t fRunNumber;
198  TString fStexName;
199  Int_t fStexNumber;
200 
203 
210 
211  Int_t fFedTcc;
212  std::vector<Int_t> fSMFromFedTcc;
213  std::vector<Int_t> fESFromFedTcc;
215  std::vector<Int_t> fFedStatusOrder;
216  Int_t fFedId;
217  std::vector<std::string> fDeeNumberString;
218 
222  std::vector<Int_t> fStexDigiOK;
223  std::vector<Int_t> fStexNbOfTreatedEvents;
224  std::vector<Int_t> fStexStatus;
225 
227  std::vector<Int_t> fFedStatus;
228  std::vector<Int_t> fFedDigiOK;
229  std::vector<Int_t> fFedNbOfTreatedEvents;
230 
231  Int_t fMemoCutOK;
233  std::vector<Int_t> fNbOfTreatedFedsInDee;
234  std::vector<Int_t> fNbOfTreatedFedsInStex;
235 
236  Int_t fANY_RUN;
239  Int_t fLASER_STD;
241  Int_t fPEDSIM;
242 
243  std::vector<time_t> fTimeFirst;
244  std::vector<time_t> fTimeLast;
245  std::vector<TString> fDateFirst;
246  std::vector<TString> fDateLast;
247 
248  std::vector<Int_t> fMemoDateFirstEvent;
249 
252 
253  std::vector<std::unique_ptr<TEcnaRun>> fMyCnaEBSM;
254  std::vector<std::unique_ptr<TEcnaRun>> fMyCnaEEDee;
255 
258 
261 
262  // Int_t** fT2d_LastEvt; // 2D array[channel][sample] max nb of evts read for
263  // a given (channel,sample) Int_t* fT1d_LastEvt;
264 
265  constexpr static Int_t fMaxRunTypeCounter = 26;
266  std::array<Int_t, fMaxRunTypeCounter> fRunTypeCounter;
267 
268  constexpr static Int_t fMaxMgpaGainCounter = 4; // Because chozen gain = 0,1,2,3
269  std::array<Int_t, fMaxMgpaGainCounter> fMgpaGainCounter;
270 
271  constexpr static Int_t fMaxFedIdCounter = 54;
272  std::array<Int_t, fMaxFedIdCounter> fFedIdCounter;
273 };
274 
275 #endif
Int_t fFirstReqEvent
Definition: EcnaAnalyzer.h:196
edm::EDGetTokenT< EEDigiCollection > EEdigiToken_
Definition: EcnaAnalyzer.h:162
std::string digiProducer_
Definition: EcnaAnalyzer.h:156
Int_t fStexIndexBegin
Definition: EcnaAnalyzer.h:208
Int_t fDeeDS5Memo2
Definition: EcnaAnalyzer.h:221
TEcnaParEcal fMyEEEcal
Definition: EcnaAnalyzer.h:260
std::vector< time_t > fTimeLast
Definition: EcnaAnalyzer.h:244
Int_t fRunTypeNumber
Definition: EcnaAnalyzer.h:195
TString runtype(const Int_t &)
Int_t fChozenRunTypeNumber
Definition: EcnaAnalyzer.h:190
EcnaAnalyzer(const edm::ParameterSet &)
Definition: EcnaAnalyzer.cc:45
~EcnaAnalyzer() override
TEcnaParEcal fMyEBEcal
Definition: EcnaAnalyzer.h:257
TString sAnalysisName_
Definition: EcnaAnalyzer.h:164
Int_t fDeeIndexStop
Definition: EcnaAnalyzer.h:207
std::vector< Int_t > fNbOfTreatedFedsInStex
Definition: EcnaAnalyzer.h:234
Int_t fNbOfTreatedStexs
Definition: EcnaAnalyzer.h:232
Int_t gainvalue(const Int_t &)
TString sNbOfSamples_
Definition: EcnaAnalyzer.h:165
Bool_t AnalysisOutcome(const TString &)
TString fAnalysisName
Definition: EcnaAnalyzer.h:188
void CheckMsg(const Int_t &, const Int_t &)
Int_t fCurrentEventNumber
Definition: EcnaAnalyzer.h:177
std::vector< Int_t > fFedNbOfTreatedEvents
Definition: EcnaAnalyzer.h:229
Int_t fPEDESTAL_GAP
Definition: EcnaAnalyzer.h:238
Int_t fDeeDS5Memo1
Definition: EcnaAnalyzer.h:220
std::vector< Int_t > fBuildEventDistribBad
Definition: EcnaAnalyzer.h:180
TString sLastReqEvent_
Definition: EcnaAnalyzer.h:167
TString fStexName
Definition: EcnaAnalyzer.h:198
std::vector< TString > fDateLast
Definition: EcnaAnalyzer.h:246
std::array< Int_t, fMaxRunTypeCounter > fRunTypeCounter
Definition: EcnaAnalyzer.h:266
static constexpr Int_t fMaxFedIdCounter
Definition: EcnaAnalyzer.h:271
Int_t fMgpaGainNumber
Definition: EcnaAnalyzer.h:202
std::vector< Int_t > fStexDigiOK
Definition: EcnaAnalyzer.h:222
Int_t fStexNumber
Definition: EcnaAnalyzer.h:199
std::string EBdigiCollection_
Definition: EcnaAnalyzer.h:158
Bool_t fOutcomeError
Definition: EcnaAnalyzer.h:172
Int_t fMaxTreatedStexCounter
Definition: EcnaAnalyzer.h:219
Int_t fEvtNumber
Definition: EcnaAnalyzer.h:174
TString fDynBaseLineSub
Definition: EcnaAnalyzer.h:191
edm::EDGetTokenT< EcalRawDataCollection > eventHeaderToken_
Definition: EcnaAnalyzer.h:160
std::ifstream fFcin_f
Definition: EcnaAnalyzer.h:186
std::vector< time_t > fTimeFirst
Definition: EcnaAnalyzer.h:243
TString fCfgAnalyzerParametersFileName
Definition: EcnaAnalyzer.h:185
Int_t fNbOfSelectedEvents
Definition: EcnaAnalyzer.h:178
Int_t fMaxFedUnitCounter
Definition: EcnaAnalyzer.h:226
std::array< Int_t, fMaxFedIdCounter > fFedIdCounter
Definition: EcnaAnalyzer.h:272
Int_t fRecNumber
Definition: EcnaAnalyzer.h:176
Int_t fSMIndexBegin
Definition: EcnaAnalyzer.h:204
edm::EDGetTokenT< EBDigiCollection > EBdigiToken_
Definition: EcnaAnalyzer.h:161
std::vector< Int_t > fMemoDateFirstEvent
Definition: EcnaAnalyzer.h:248
Int_t fPEDESTAL_STD
Definition: EcnaAnalyzer.h:237
Int_t fTreatedFedOrder
Definition: EcnaAnalyzer.h:214
Int_t fPHYSICS_GLOBAL
Definition: EcnaAnalyzer.h:240
Int_t fSMIndexStop
Definition: EcnaAnalyzer.h:205
Int_t fRunNumber
Definition: EcnaAnalyzer.h:194
static constexpr Int_t fgMaxCar
Definition: EcnaAnalyzer.h:148
std::vector< std::unique_ptr< TEcnaRun > > fMyCnaEBSM
Definition: EcnaAnalyzer.h:253
std::array< Int_t, fMaxMgpaGainCounter > fMgpaGainCounter
Definition: EcnaAnalyzer.h:269
TEcnaObject fMyEcnaEBObjectManager
Definition: EcnaAnalyzer.h:250
std::vector< Int_t > fBuildEventDistribGood
Definition: EcnaAnalyzer.h:181
std::vector< std::unique_ptr< TEcnaRun > > fMyCnaEEDee
Definition: EcnaAnalyzer.h:254
std::string eventHeaderProducer_
Definition: EcnaAnalyzer.h:155
std::vector< Int_t > fStexStatus
Definition: EcnaAnalyzer.h:224
TEcnaObject fMyEcnaEEObjectManager
Definition: EcnaAnalyzer.h:251
TString fTTBELL
Definition: EcnaAnalyzer.h:149
Int_t fLastReqEvent
Definition: EcnaAnalyzer.h:197
TEcnaNumbering fMyEENumbering
Definition: EcnaAnalyzer.h:259
Int_t fMemoCutOK
Definition: EcnaAnalyzer.h:231
std::vector< Int_t > fFedStatusOrder
Definition: EcnaAnalyzer.h:215
Int_t nChannels_
Definition: EcnaAnalyzer.h:153
static constexpr Int_t fMaxRunTypeCounter
Definition: EcnaAnalyzer.h:265
Int_t fDeeIndexBegin
Definition: EcnaAnalyzer.h:206
Int_t fNbOfSamples
Definition: EcnaAnalyzer.h:193
std::vector< Int_t > fESFromFedTcc
Definition: EcnaAnalyzer.h:213
std::vector< Int_t > fSMFromFedTcc
Definition: EcnaAnalyzer.h:212
std::string eventHeaderCollection_
Definition: EcnaAnalyzer.h:157
TString fCfgAnalyzerParametersFilePath
Definition: EcnaAnalyzer.h:183
void analyze(const edm::Event &, const edm::EventSetup &) override
Int_t fEvtNumberMemo
Definition: EcnaAnalyzer.h:175
TString sFirstReqEvent_
Definition: EcnaAnalyzer.h:166
Int_t fLASER_STD
Definition: EcnaAnalyzer.h:239
Int_t fStexIndexStop
Definition: EcnaAnalyzer.h:209
std::string EEdigiCollection_
Definition: EcnaAnalyzer.h:159
TString sStexNumber_
Definition: EcnaAnalyzer.h:170
std::vector< Int_t > fFedStatus
Definition: EcnaAnalyzer.h:227
static constexpr Int_t fMaxMgpaGainCounter
Definition: EcnaAnalyzer.h:268
std::vector< Int_t > fStexNbOfTreatedEvents
Definition: EcnaAnalyzer.h:223
std::vector< TString > fDateFirst
Definition: EcnaAnalyzer.h:245
Int_t fReqNbOfEvts
Definition: EcnaAnalyzer.h:201
std::vector< Int_t > fNbOfTreatedFedsInDee
Definition: EcnaAnalyzer.h:233
TString sReqNbOfEvts_
Definition: EcnaAnalyzer.h:168
TEcnaNumbering fMyEBNumbering
Definition: EcnaAnalyzer.h:256
Int_t fChozenGainNumber
Definition: EcnaAnalyzer.h:189
unsigned int verbosity_
Definition: EcnaAnalyzer.h:152
TString sStexName_
Definition: EcnaAnalyzer.h:169
std::vector< Int_t > fFedDigiOK
Definition: EcnaAnalyzer.h:228
std::vector< std::string > fDeeNumberString
Definition: EcnaAnalyzer.h:217