CMS 3D CMS Logo

EcalSimRawData.h
Go to the documentation of this file.
1 /*
2  */
3 
11 #include <fstream>
12 #include <string>
13 
43 public:
47  explicit EcalSimRawData(const edm::ParameterSet &pset);
48 
51  ~EcalSimRawData() override{};
52 
56  void analyze(const edm::Event &, const edm::EventSetup &) override;
57 
58 private:
59  int iEvent;
60 
63  static const int nEbEta = 170;
64 
67  static const int nEbPhi = 360;
68 
71  static const int nEeX = 100;
72 
75  static const int nEeY = 100;
76 
79  static const int nEndcaps = 2;
80 
83  static const int scEdge = 5;
84 
87  static const int nScX = 20;
88 
91  static const int nScY = 20;
92 
93  /* Edge size of a barrel TT in num. of crystals
94  */
95  static const int ttEdge = 5;
96 
99  static const int nTtSmPhi = 4;
100 
103  static const int nTtSmEta = 17;
104 
107  static const int nTtPhi = nEbPhi / ttEdge; // 72
108 
111  static const int nEbTtEta = nEbEta / ttEdge; // 34
112 
115  static const int nEeTtEta = 11;
116 
119  static const int nTtEta = nEbTtEta + 2 * nEeTtEta; // 56
120 
123  static const int nDccInPhi = 18;
124 
127  static const int nDccEndcap = 9;
128 
131  static const int ebTccPhiEdge = 20;
132 
135  static const int nTccInPhi = 18;
136 
139  static const int nTccEndcap = 36;
140 
143  static const int ebDccPhiEdge = 20;
144 
147  static const int nTtPhisPerEbDcc = 4;
148 
151  static const int nTtPhisPerEbTcc = 4;
152 
155  static const int nTtTypes = 2;
156 
161  static const int ttType[nEbTtEta];
162 
169  static const int stripCh2Phi[nTtTypes][ttEdge][ttEdge];
170 
176  static const int strip2Eta[nTtTypes][ttEdge];
177 
186 
187 private:
188  /*
189  const EBDigiCollection*
190  getEBDigis(const edm::Event& event) const;
191 
192  const EEDigiCollection*
193  getEEDigis(const edm::Event& event) const;
194 
195  const EcalTrigPrimDigiCollection*
196  getTrigPrims(const edm::Event& event) const;
197  */
198 
201  void checkGeometry(const edm::EventSetup &eventSetup);
202  void checkTriggerMap(const edm::EventSetup &eventSetup);
203 
209  int iEta2cIndex(int iEta) const { return (iEta < 0) ? iEta + 85 : iEta + 84; }
210 
216  int iPhi2cIndex(int iPhi) const {
217  int iPhi0 = iPhi - 11;
218  if (iPhi0 < 0)
219  iPhi0 += nEbPhi;
220  return iPhi0;
221  }
222 
229  int iTtEta2cIndex(int iTtEta) const { return (iTtEta < 0) ? (iTtEta + 28) : (iTtEta + 27); }
230 
235  int cIndex2iTtEta(int iTtEta0) const { return (iTtEta0 < 28) ? (iTtEta0 - 28) : (iTtEta0 - 27); }
236 
241  int cIndex2TtPhi(int iTtPhi0) const { return iTtPhi0 + 1; }
242 
248  int iTtPhi2cIndex(int iTtPhi) const { return iTtPhi - 1; }
249 
250  /*
251  int iXY2cIndex(int iX) const{
252  return iX-1;
253  }
254  */
255 
265  void elec2GeomNum(int ittEta0, int ittPhi0, int strip1, int ch1, int &iEta0, int &iPhi0) const;
266 
267  /* Set horizontal parity of a 16-bit word of FE data
268  * @param a the word whose parity must be set.
269  */
270  void setHParity(uint16_t &a) const;
271 
278  void genFeData(std::string basename, int iEvent, const std::vector<uint16_t> adcCount[nEbEta][nEbPhi]) const;
279 
286  void genTccIn(std::string basename, int iEvent, const int tps[nTtEta][nTtPhi]) const;
287 
294  void genTccOut(std::string basename, int iEvent, const int tps[nTtEta][nTtPhi]) const;
295 
300  void getEbDigi(const edm::Event &event, std::vector<uint16_t> adc[nEbEta][nEbPhi]) const;
301 
310  void getTp(const edm::Event &event, const std::string &collName, int tp[nTtEta][nTtPhi]) const;
311 
315  std::string getExt() const;
316 
326  void fwrite(std::ofstream &f, uint16_t data, int &iword, bool hpar = true) const;
327 
333  void getSrfs(const edm::Event &event, int ebSrf[nTtEta][nTtPhi], int eeSrf[nEndcaps][nScX][nScY]) const;
334 
341  void genSrData(std::string basename, int iEvent, int ttf[nEbTtEta][nTtPhi]) const;
342 
343 private:
347 
351 
355 
359 
363 
367 
371 
375 
379 
383 
387 
391 
395 
398  bool srp2dcc_;
399 
402  bool tcc2dcc_;
403 
406  bool fe2dcc_;
407 
410  bool fe2tcc_;
411 
415 
418  std::unique_ptr<EcalSelectiveReadout> esr_;
419 
422  std::ofstream ttfFile;
423 
426  std::ofstream srfFile;
427 
430  int tccNum_;
431 
434  int dccNum_;
435 
439 
443 };
EcalSimRawData::iPhi2cIndex
int iPhi2cIndex(int iPhi) const
Definition: EcalSimRawData.h:216
EcalSimRawData::bigEndian
Definition: EcalSimRawData.h:185
EcalSimRawData::fwrite
void fwrite(std::ofstream &f, uint16_t data, int &iword, bool hpar=true) const
Definition: EcalSimRawData.cc:129
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
EcalSimRawData::ttEdge
static const int ttEdge
Definition: EcalSimRawData.h:95
EDAnalyzer.h
EcalSimRawData::nTtSmEta
static const int nTtSmEta
Definition: EcalSimRawData.h:103
EcalSimRawData::nTtPhi
static const int nTtPhi
Definition: EcalSimRawData.h:107
EcalSimRawData::strip2Eta
static const int strip2Eta[nTtTypes][ttEdge]
Definition: EcalSimRawData.h:176
EcalSimRawData::srfFile
std::ofstream srfFile
Definition: EcalSimRawData.h:426
EcalSimRawData::nDccInPhi
static const int nDccInPhi
Definition: EcalSimRawData.h:123
EcalSimRawData::nTccInPhi
static const int nTccInPhi
Definition: EcalSimRawData.h:135
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
EcalSimRawData::tpVerbose_
bool tpVerbose_
Definition: EcalSimRawData.h:394
EcalSimRawData::nTccEndcap
static const int nTccEndcap
Definition: EcalSimRawData.h:139
EcalSimRawData::littleEndian
Definition: EcalSimRawData.h:185
EcalSimRawData::checkTriggerMap
void checkTriggerMap(const edm::EventSetup &eventSetup)
EcalSimRawData::nTtSmPhi
static const int nTtSmPhi
Definition: EcalSimRawData.h:99
trigObjTnPSource_cfi.collName
collName
Definition: trigObjTnPSource_cfi.py:66
EcalSimRawData::elec2GeomNum
void elec2GeomNum(int ittEta0, int ittPhi0, int strip1, int ch1, int &iEta0, int &iPhi0) const
Definition: EcalSimRawData.cc:117
EcalSimRawData::eeSrFlagCollection_
std::string eeSrFlagCollection_
Definition: EcalSimRawData.h:366
EcalSimRawData::nEbEta
static const int nEbEta
Definition: EcalSimRawData.h:63
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
EcalSimRawData::nScX
static const int nScX
Definition: EcalSimRawData.h:87
EcalSimRawData::nEndcaps
static const int nEndcaps
Definition: EcalSimRawData.h:79
EcalSimRawData::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: EcalSimRawData.cc:77
EcalSimRawData::dccNum_
int dccNum_
Definition: EcalSimRawData.h:434
EcalSimRawData::digiProducer_
std::string digiProducer_
Definition: EcalSimRawData.h:346
EcalSimRawData::getExt
std::string getExt() const
Definition: EcalSimRawData.cc:156
EcalSimRawData::genTccOut
void genTccOut(std::string basename, int iEvent, const int tps[nTtEta][nTtPhi]) const
Definition: EcalSimRawData.cc:356
CaloGeometry
Definition: CaloGeometry.h:21
EcalSimRawData::checkGeometry
void checkGeometry(const edm::EventSetup &eventSetup)
EcalSimRawData::scEdge
static const int scEdge
Definition: EcalSimRawData.h:83
EcalSimRawData::tcpDigiCollection_
std::string tcpDigiCollection_
Definition: EcalSimRawData.h:374
EcalSimRawData::ebSrFlagCollection_
std::string ebSrFlagCollection_
Definition: EcalSimRawData.h:362
EcalDigiCollections.h
EcalSimRawData::eeDigiCollection_
std::string eeDigiCollection_
Definition: EcalSimRawData.h:354
EcalSimRawData::nEeX
static const int nEeX
Definition: EcalSimRawData.h:71
EcalSimRawData::genSrData
void genSrData(std::string basename, int iEvent, int ttf[nEbTtEta][nTtPhi]) const
Definition: EcalSimRawData.cc:244
EcalSimRawData::writeMode_t
writeMode_t
Definition: EcalSimRawData.h:185
EcalSimRawData::setHParity
void setHParity(uint16_t &a) const
Definition: EcalSimRawData.cc:417
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
EcalSimRawData::tcc2dcc_
bool tcc2dcc_
Definition: EcalSimRawData.h:402
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTrigTowerConstituentsMap
Definition: EcalTrigTowerConstituentsMap.h:19
EcalSimRawData::iTtEta2cIndex
int iTtEta2cIndex(int iTtEta) const
Definition: EcalSimRawData.h:229
EcalSimRawData::genTccIn
void genTccIn(std::string basename, int iEvent, const int tps[nTtEta][nTtPhi]) const
Definition: EcalSimRawData.cc:307
EcalSimRawData::getSrfs
void getSrfs(const edm::Event &event, int ebSrf[nTtEta][nTtPhi], int eeSrf[nEndcaps][nScX][nScY]) const
Definition: EcalSimRawData.cc:428
EcalSimRawData::nEeY
static const int nEeY
Definition: EcalSimRawData.h:75
edm::ParameterSet
Definition: ParameterSet.h:36
a
double a
Definition: hdecay.h:119
EcalSelectiveReadout.h
Event.h
EcalSimRawData::xtalVerbose_
bool xtalVerbose_
Definition: EcalSimRawData.h:390
EcalSimRawData::~EcalSimRawData
~EcalSimRawData() override
Definition: EcalSimRawData.h:51
EcalSimRawData::ttfFile
std::ofstream ttfFile
Definition: EcalSimRawData.h:422
EcalSimRawData::EcalSimRawData
EcalSimRawData(const edm::ParameterSet &pset)
Definition: EcalSimRawData.cc:42
EcalSimRawData::nScY
static const int nScY
Definition: EcalSimRawData.h:91
EcalSimRawData::nTtPhisPerEbTcc
static const int nTtPhisPerEbTcc
Definition: EcalSimRawData.h:151
EcalSimRawData::fe2tcc_
bool fe2tcc_
Definition: EcalSimRawData.h:410
EcalSimRawData::srp2dcc_
bool srp2dcc_
Definition: EcalSimRawData.h:398
EcalSimRawData
Definition: EcalSimRawData.h:42
EcalSimRawData::tccNum_
int tccNum_
Definition: EcalSimRawData.h:430
edm::EventSetup
Definition: EventSetup.h:57
EcalSimRawData::ebDccPhiEdge
static const int ebDccPhiEdge
Definition: EcalSimRawData.h:143
EcalSimRawData::esr_
std::unique_ptr< EcalSelectiveReadout > esr_
Definition: EcalSimRawData.h:418
EcalSimRawData::iTtPhi2cIndex
int iTtPhi2cIndex(int iTtPhi) const
Definition: EcalSimRawData.h:248
EcalSimRawData::theTriggerTowerMap
const EcalTrigTowerConstituentsMap * theTriggerTowerMap
Definition: EcalSimRawData.h:414
EcalSimRawData::getEbDigi
void getEbDigi(const edm::Event &event, std::vector< uint16_t > adc[nEbEta][nEbPhi]) const
Definition: EcalSimRawData.cc:478
EcalSimRawData::tpProducer_
std::string tpProducer_
Definition: EcalSimRawData.h:382
EcalTrigTowerConstituentsMap.h
EcalSimRawData::srDigiProducer_
std::string srDigiProducer_
Definition: EcalSimRawData.h:358
EcalSimRawData::iEvent
int iEvent
Definition: EcalSimRawData.h:59
EcalSimRawData::fe2dcc_
bool fe2dcc_
Definition: EcalSimRawData.h:406
EcalSimRawData::ebDigiCollection_
std::string ebDigiCollection_
Definition: EcalSimRawData.h:350
EcalSimRawData::cIndex2TtPhi
int cIndex2TtPhi(int iTtPhi0) const
Definition: EcalSimRawData.h:241
EcalSimRawData::genFeData
void genFeData(std::string basename, int iEvent, const std::vector< uint16_t > adcCount[nEbEta][nEbPhi]) const
Definition: EcalSimRawData.cc:169
CaloGeometry.h
EcalSimRawData::nTtPhisPerEbDcc
static const int nTtPhisPerEbDcc
Definition: EcalSimRawData.h:147
EventSetup.h
EcalSimRawData::nTtEta
static const int nTtEta
Definition: EcalSimRawData.h:119
EcalSimRawData::ebTccPhiEdge
static const int ebTccPhiEdge
Definition: EcalSimRawData.h:131
EcalSimRawData::nEbPhi
static const int nEbPhi
Definition: EcalSimRawData.h:67
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
EcalSimRawData::iEta2cIndex
int iEta2cIndex(int iEta) const
Definition: EcalSimRawData.h:209
EcalSimRawData::nEbTtEta
static const int nEbTtEta
Definition: EcalSimRawData.h:111
EcalSimRawData::nDccEndcap
static const int nDccEndcap
Definition: EcalSimRawData.h:127
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
EcalSimRawData::stripCh2Phi
static const int stripCh2Phi[nTtTypes][ttEdge][ttEdge]
Definition: EcalSimRawData.h:169
EcalSimRawData::theGeometry
const CaloGeometry * theGeometry
Definition: EcalSimRawData.h:378
EcalSimRawData::ttType
static const int ttType[nEbTtEta]
Definition: EcalSimRawData.h:161
event
Definition: event.py:1
EcalSimRawData::cIndex2iTtEta
int cIndex2iTtEta(int iTtEta0) const
Definition: EcalSimRawData.h:235
edm::Event
Definition: Event.h:73
EcalSimRawData::getTp
void getTp(const edm::Event &event, const std::string &collName, int tp[nTtEta][nTtPhi]) const
Definition: EcalSimRawData.cc:545
EcalSimRawData::nEeTtEta
static const int nEeTtEta
Definition: EcalSimRawData.h:115
EcalSimRawData::ascii
Definition: EcalSimRawData.h:185
EcalSimRawData::nTtTypes
static const int nTtTypes
Definition: EcalSimRawData.h:155
EcalSimRawData::basename_
std::string basename_
Definition: EcalSimRawData.h:442
EcalSimRawData::tpDigiCollection_
std::string tpDigiCollection_
Definition: EcalSimRawData.h:370
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
EcalSimRawData::tccInDefaultVal_
int tccInDefaultVal_
Definition: EcalSimRawData.h:438
EcalSimRawData::writeMode_
writeMode_t writeMode_
Definition: EcalSimRawData.h:386