CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalSimRawData.h
Go to the documentation of this file.
1 /*
2  */
3 
12 #include <string>
13 #include <fstream>
14 
42  public:
46  explicit EcalSimRawData(const edm::ParameterSet& pset);
47 
50  virtual ~EcalSimRawData(){};
51 
55  virtual void analyze(const edm::Event&, const edm::EventSetup&);
56 
57 private:
60  static const int nEbEta = 170;
61 
64  static const int nEbPhi = 360;
65 
68  static const int nEeX = 100;
69 
72  static const int nEeY = 100;
73 
76  static const int nEndcaps = 2;
77 
80  static const int scEdge = 5;
81 
84  static const int nScX = 20;
85 
88  static const int nScY = 20;
89 
90  /* Edge size of a barrel TT in num. of crystals
91  */
92  static const int ttEdge = 5;
93 
96  static const int nTtSmPhi = 4;
97 
100  static const int nTtSmEta = 17;
101 
104  static const int nTtPhi = nEbPhi/ttEdge;//72
105 
108  static const int nEbTtEta = nEbEta/ttEdge;//34
109 
112  static const int nEeTtEta = 11;
113 
116  static const int nTtEta = nEbTtEta+2*nEeTtEta;//56
117 
120  static const int nDccInPhi = 18;
121 
124  static const int nDccEndcap = 9;
125 
128  static const int ebTccPhiEdge = 20;
129 
132  static const int nTccInPhi = 18;
133 
136  static const int nTccEndcap = 36;
137 
140  static const int ebDccPhiEdge = 20;
141 
144  static const int nTtPhisPerEbDcc = 4;
145 
148  static const int nTtPhisPerEbTcc = 4;
149 
152  static const int nTtTypes = 2;
153 
158  static const int ttType[nEbTtEta];
159 
166  static const int stripCh2Phi[nTtTypes][ttEdge][ttEdge];
167 
173  static const int strip2Eta[nTtTypes][ttEdge];
174 
183 
184 private:
185  /*
186  const EBDigiCollection*
187  getEBDigis(const edm::Event& event) const;
188 
189  const EEDigiCollection*
190  getEEDigis(const edm::Event& event) const;
191 
192  const EcalTrigPrimDigiCollection*
193  getTrigPrims(const edm::Event& event) const;
194  */
195 
198  void
199  checkGeometry(const edm::EventSetup& eventSetup);
200  void
201  checkTriggerMap(const edm::EventSetup& eventSetup);
202 
208  int iEta2cIndex(int iEta) const{
209  return (iEta<0)?iEta+85:iEta+84;
210  }
211 
217  int iPhi2cIndex(int iPhi) const{
218  int iPhi0 = iPhi -11;
219  if(iPhi0<0) iPhi0+=nEbPhi;
220  return iPhi0;
221  }
222 
229  int iTtEta2cIndex(int iTtEta) const{
230  return (iTtEta<0)?(iTtEta+28):(iTtEta+27);
231  }
232 
237  int cIndex2iTtEta(int iTtEta0) const{
238  return (iTtEta0<28)?(iTtEta0-28):(iTtEta0-27);
239  }
240 
245  int cIndex2TtPhi(int iTtPhi0) const{
246  return iTtPhi0+1;
247  }
248 
254  int iTtPhi2cIndex(int iTtPhi) const{
255  return iTtPhi-1;
256  }
257 
258  /*
259  int iXY2cIndex(int iX) const{
260  return iX-1;
261  }
262  */
263 
273  void elec2GeomNum(int ittEta0, int ittPhi0, int strip1,
274  int ch1, int& iEta0, int& iPhi0) const;
275 
276  /* Set horizontal parity of a 16-bit word of FE data
277  * @param a the word whose parity must be set.
278  */
279  void setHParity(uint16_t& a) const;
280 
287  void genFeData(std::string basename, int iEvent,
288  const std::vector<uint16_t> adcCount[nEbEta][nEbPhi]) const;
289 
290 
297  void genTccIn(std::string basename, int iEvent,
298  const int tps[nTtEta][nTtPhi]) const;
299 
306  void genTccOut(std::string basename, int iEvent,
307  const int tps[nTtEta][nTtPhi]) const;
308 
309 
310 
315  void getEbDigi(const edm::Event& event,
316  std::vector<uint16_t> adc[nEbEta][nEbPhi]) const;
317 
318 
327  void getTp(const edm::Event& event, const std::string& collName,
328  int tp[nTtEta][nTtPhi]) const;
329 
330 
334  std::string getExt() const;
335 
345  void fwrite(std::ofstream& f, uint16_t data, int& iword,
346  bool hpar = true) const;
347 
348 
354  void getSrfs(const edm::Event& event, int ebSrf[nTtEta][nTtPhi],
355  int eeSrf[nEndcaps][nScX][nScY]) const;
356 
363  void genSrData(std::string basename, int iEvent,
364  int ttf[nEbTtEta][nTtPhi]) const;
365 
366 private:
370 
374 
378 
379 
383 
387 
391 
395 
399 
403 
407 
411 
415 
419 
422  bool srp2dcc_;
423 
426  bool tcc2dcc_;
427 
430  bool fe2dcc_;
431 
434  bool fe2tcc_;
435 
439 
442  std::auto_ptr<EcalSelectiveReadout> esr_;
443 
446  std::ofstream ttfFile;
447 
450  std::ofstream srfFile;
451 
454  int tccNum_;
455 
458  int dccNum_;
459 
463 
467 };
468 
int adc(sample_type sample)
get the ADC sample (12 bits)
std::string srDigiProducer_
static const int nDccInPhi
writeMode_t writeMode_
static const int nTtPhi
static const int nTccInPhi
static const int nEeTtEta
static const int nTtSmPhi
int iPhi2cIndex(int iPhi) const
static const int nEbEta
static const int nScX
virtual ~EcalSimRawData()
void checkGeometry(const edm::EventSetup &eventSetup)
static const int scEdge
void checkTriggerMap(const edm::EventSetup &eventSetup)
static const int nEbPhi
static const int nDccEndcap
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::string digiProducer_
void getTp(const edm::Event &event, const std::string &collName, int tp[nTtEta][nTtPhi]) const
std::string eeSrFlagCollection_
std::string getExt() const
int cIndex2iTtEta(int iTtEta0) const
static const int nEndcaps
void setHParity(uint16_t &a) const
int iEta2cIndex(int iEta) const
int iEvent
Definition: GenABIO.cc:230
static const int strip2Eta[nTtTypes][ttEdge]
std::string ebDigiCollection_
void genFeData(std::string basename, int iEvent, const std::vector< uint16_t > adcCount[nEbEta][nEbPhi]) const
static const int nTtPhisPerEbDcc
static const int nTccEndcap
void getSrfs(const edm::Event &event, int ebSrf[nTtEta][nTtPhi], int eeSrf[nEndcaps][nScX][nScY]) const
static const int nEeY
std::string ebSrFlagCollection_
static const int nEbTtEta
static const int nScY
double f[11][100]
EcalSimRawData(const edm::ParameterSet &pset)
std::string tcpDigiCollection_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
static const int ebTccPhiEdge
std::string basename_
static const int ebDccPhiEdge
void fwrite(std::ofstream &f, uint16_t data, int &iword, bool hpar=true) const
static const int nTtPhisPerEbTcc
void genTccOut(std::string basename, int iEvent, const int tps[nTtEta][nTtPhi]) const
const EcalTrigTowerConstituentsMap * theTriggerTowerMap
static const int nEeX
void genSrData(std::string basename, int iEvent, int ttf[nEbTtEta][nTtPhi]) const
std::ofstream ttfFile
std::string eeDigiCollection_
void getEbDigi(const edm::Event &event, std::vector< uint16_t > adc[nEbEta][nEbPhi]) const
std::string tpDigiCollection_
void genTccIn(std::string basename, int iEvent, const int tps[nTtEta][nTtPhi]) const
int cIndex2TtPhi(int iTtPhi0) const
static const int nTtEta
double a
Definition: hdecay.h:121
std::string tpProducer_
std::ofstream srfFile
static const int stripCh2Phi[nTtTypes][ttEdge][ttEdge]
const CaloGeometry * theGeometry
void elec2GeomNum(int ittEta0, int ittPhi0, int strip1, int ch1, int &iEta0, int &iPhi0) const
std::auto_ptr< EcalSelectiveReadout > esr_
static const int ttEdge
int iTtPhi2cIndex(int iTtPhi) const
int iTtEta2cIndex(int iTtEta) const
static const int nTtSmEta
static const int ttType[nEbTtEta]
static const int nTtTypes