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  * $Id: EcalSimRawData.h,v 1.8 2007/05/15 13:40:01 nuno Exp $
3  */
4 
13 #include <string>
14 #include <fstream>
15 
43  public:
47  explicit EcalSimRawData(const edm::ParameterSet& pset);
48 
51  virtual ~EcalSimRawData(){};
52 
56  virtual void analyze(const edm::Event&, const edm::EventSetup&);
57 
58 private:
61  static const int nEbEta = 170;
62 
65  static const int nEbPhi = 360;
66 
69  static const int nEeX = 100;
70 
73  static const int nEeY = 100;
74 
77  static const int nEndcaps = 2;
78 
81  static const int scEdge = 5;
82 
85  static const int nScX = 20;
86 
89  static const int nScY = 20;
90 
91  /* Edge size of a barrel TT in num. of crystals
92  */
93  static const int ttEdge = 5;
94 
97  static const int nTtSmPhi = 4;
98 
101  static const int nTtSmEta = 17;
102 
105  static const int nTtPhi = nEbPhi/ttEdge;//72
106 
109  static const int nEbTtEta = nEbEta/ttEdge;//34
110 
113  static const int nEeTtEta = 11;
114 
117  static const int nTtEta = nEbTtEta+2*nEeTtEta;//56
118 
121  static const int nDccInPhi = 18;
122 
125  static const int nDccEndcap = 9;
126 
129  static const int ebTccPhiEdge = 20;
130 
133  static const int nTccInPhi = 18;
134 
137  static const int nTccEndcap = 36;
138 
141  static const int ebDccPhiEdge = 20;
142 
145  static const int nTtPhisPerEbDcc = 4;
146 
149  static const int nTtPhisPerEbTcc = 4;
150 
153  static const int nTtTypes = 2;
154 
159  static const int ttType[nEbTtEta];
160 
167  static const int stripCh2Phi[nTtTypes][ttEdge][ttEdge];
168 
174  static const int strip2Eta[nTtTypes][ttEdge];
175 
184 
185 private:
186  /*
187  const EBDigiCollection*
188  getEBDigis(const edm::Event& event) const;
189 
190  const EEDigiCollection*
191  getEEDigis(const edm::Event& event) const;
192 
193  const EcalTrigPrimDigiCollection*
194  getTrigPrims(const edm::Event& event) const;
195  */
196 
199  void
200  checkGeometry(const edm::EventSetup& eventSetup);
201  void
202  checkTriggerMap(const edm::EventSetup& eventSetup);
203 
209  int iEta2cIndex(int iEta) const{
210  return (iEta<0)?iEta+85:iEta+84;
211  }
212 
218  int iPhi2cIndex(int iPhi) const{
219  int iPhi0 = iPhi -11;
220  if(iPhi0<0) iPhi0+=nEbPhi;
221  return iPhi0;
222  }
223 
230  int iTtEta2cIndex(int iTtEta) const{
231  return (iTtEta<0)?(iTtEta+28):(iTtEta+27);
232  }
233 
238  int cIndex2iTtEta(int iTtEta0) const{
239  return (iTtEta0<28)?(iTtEta0-28):(iTtEta0-27);
240  }
241 
246  int cIndex2TtPhi(int iTtPhi0) const{
247  return iTtPhi0+1;
248  }
249 
255  int iTtPhi2cIndex(int iTtPhi) const{
256  return iTtPhi-1;
257  }
258 
259  /*
260  int iXY2cIndex(int iX) const{
261  return iX-1;
262  }
263  */
264 
274  void elec2GeomNum(int ittEta0, int ittPhi0, int strip1,
275  int ch1, int& iEta0, int& iPhi0) const;
276 
277  /* Set horizontal parity of a 16-bit word of FE data
278  * @param a the word whose parity must be set.
279  */
280  void setHParity(uint16_t& a) const;
281 
288  void genFeData(std::string basename, int iEvent,
289  const std::vector<uint16_t> adcCount[nEbEta][nEbPhi]) const;
290 
291 
298  void genTccIn(std::string basename, int iEvent,
299  const int tps[nTtEta][nTtPhi]) const;
300 
307  void genTccOut(std::string basename, int iEvent,
308  const int tps[nTtEta][nTtPhi]) const;
309 
310 
311 
316  void getEbDigi(const edm::Event& event,
317  std::vector<uint16_t> adc[nEbEta][nEbPhi]) const;
318 
319 
328  void getTp(const edm::Event& event, const std::string& collName,
329  int tp[nTtEta][nTtPhi]) const;
330 
331 
335  std::string getExt() const;
336 
346  void fwrite(std::ofstream& f, uint16_t data, int& iword,
347  bool hpar = true) const;
348 
349 
355  void getSrfs(const edm::Event& event, int ebSrf[nTtEta][nTtPhi],
356  int eeSrf[nEndcaps][nScX][nScY]) const;
357 
364  void genSrData(std::string basename, int iEvent,
365  int ttf[nEbTtEta][nTtPhi]) const;
366 
367 private:
370  std::string digiProducer_;
371 
374  std::string ebDigiCollection_;
375 
378  std::string eeDigiCollection_;
379 
380 
383  std::string srDigiProducer_;
384 
387  std::string ebSrFlagCollection_;
388 
391  std::string eeSrFlagCollection_;
392 
395  std::string tpDigiCollection_;
396 
399  std::string tcpDigiCollection_;
400 
404 
407  std::string tpProducer_;
408 
412 
416 
420 
423  bool srp2dcc_;
424 
427  bool tcc2dcc_;
428 
431  bool fe2dcc_;
432 
435  bool fe2tcc_;
436 
440 
443  std::auto_ptr<EcalSelectiveReadout> esr_;
444 
447  std::ofstream ttfFile;
448 
451  std::ofstream srfFile;
452 
455  int tccNum_;
456 
459  int dccNum_;
460 
464 
467  std::string basename_;
468 };
469 
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:243
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]
tuple pset
Definition: CrabTask.py:85
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