CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalDumpRaw.h
Go to the documentation of this file.
1 /*
2  * $Id: EcalDumpRaw.h,v 1.6 2013/04/22 15:48:17 wmtan Exp $
3  *
4  * Author: Ph Gras. CEA/IRFU - Saclay
5  */
6 
7 #ifndef ECALDUMPRAW_H
8 #define ECALDUMPRAW_H
9 
10 #include <vector>
11 #include <iostream>
12 #include <fstream>
13 #include <sstream>
14 #include <string>
15 #include <inttypes.h>
16 //#include "pgras/PGUtilities/interface/PGHisto.h"
17 
21 
33 class EcalDumpRaw : public edm::EDAnalyzer {
34  //ctors
35 public:
36  explicit EcalDumpRaw(const edm::ParameterSet&);
37  ~EcalDumpRaw();
38 
39 
40  virtual void analyze(const edm::Event&, const edm::EventSetup&);
41 
42  void analyzeEB(const edm::Event&, const edm::EventSetup&) const;
43  void analyzeEE(const edm::Event&, const edm::EventSetup&) const;
44  void endJob();
45  //methods
46 public:
47 private:
48  void analyzeFed(int fedId);
49  void analyzeApd();
50  std::string toNth(int n);
51  bool decode(const uint32_t* data, int iWord32, std::ostream& out);
52  double max(const std::vector<double>& a, unsigned& pos){
53  pos = 0;
54  double m = a[pos];
55  for(unsigned i = 1; i < a.size(); ++i){
56  if(a[i]>m){ m = a[i]; pos = i;}
57  }
58  return m;
59  }
60  double min(const std::vector<double>& a){
61  double m = a[0];
62  for(unsigned i = 1; i < a.size(); ++i){
63  if(a[i]<m) m = a[i];
64  }
65  return m;
66  }
67  //static int lme(int dccId1, int side);
68 
69  template<class T>
71  std::stringstream s;
72  s << val;
73  return s.str();
74  }
75 
76  static int sideOfRu(int ru1);
77 
78  static int modOfRu(int ru1);
79 
80  static int lmodOfRu(int ru1);
81 
82  std::string srRange(int offset) const;
83 
84  std::string ttfTag(int tccType, unsigned iSeq) const;
85 
86  std::string tpgTag(int tccType, unsigned iSeq) const;
87 
88  //fields
89 private:
91  bool writeDcc_;
97  int iEvent_;
98 
99  unsigned iTowerWord64_;
100  unsigned iSrWord64_;
101  unsigned iTccWord64_;
103  decodeState_;
105 
106  std::vector<double> adc_;
107 
108  static const int nSamples = 10;
109  double amplCut_;
110  bool dump_;
111  bool dumpAdc_;
113  // bool doHisto_;
114  int maxEvt_;
117  int l1aMinX_;
118  int l1aMaxX_;
119  int dccCh_;
120  std::vector<uint32_t> lastOrbit_;
121  static const unsigned nDccs_ = 54;
122  static const unsigned fedStart_ = 601;
123  static const int maxTpgsPerTcc_ = 68;
124  static const int maxTccsPerDcc_ = 4;
125 
126 
128 
130  static const int ebmTcc_ = 0;
131  static const int ebpTcc_ = 1;
132  static const int eeInnerTcc_ = 2;
133  static const int eeOuterTcc_ = 3;
134  static const int nTccTypes_ = 4;
136 
139  static const int ttId_[nTccTypes_][maxTpgsPerTcc_];
140 
141  unsigned fedId_;
142  unsigned dccId_;
143  unsigned side_;
144  unsigned eventId_;
145  std::vector<unsigned> eventList_;
146  unsigned minEventId_;
147  unsigned maxEventId_;
148  unsigned orbit0_;
149  uint32_t orbit_;
151  int bx_;
152  int l1a_;
153  int l1amin_;
154  int l1amax_;
157  // PGHisto histo_;
158  std::vector<std::vector<uint32_t> > l1as_;
159  std::vector<std::vector<uint32_t> > orbits_;
160  std::vector<std::vector<int> > tpg_;
161  std::vector<int> nTpgs_;
162  std::vector<int> dccChStatus_;
163  int iRu_;
164  int srpL1a_;
165  int tccL1a_;
166  //Number of TPGs in TCC block currently parsed:
167  int nTts_;
168  //Length of TCC block currently parsed:
170  static const int nRu_ = 70;
171  std::vector<int> feL1a_;
172  int srpBx_;
173  int tccBx_;
175  int tccType_;
176  std::vector<int> feBx_;
177  std::vector<int> feRuId_;
178  int iTow_;
179  std::ofstream dumpFile_;
183  int tccId_;
184  //tcc sequence number of currenlty parsed tower block of one DCC
185  int iTcc_;
188 };
189 
190 #endif //ECALDUMPRAW_H not defined
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: EcalDumpRaw.cc:212
int tccBlockLen64_
Definition: EcalDumpRaw.h:169
static int sideOfRu(int ru1)
Definition: EcalDumpRaw.cc:886
int i
Definition: DBlmapReader.cc:9
std::string toNth(int n)
Definition: EcalDumpRaw.cc:459
std::string tpgTag(int tccType, unsigned iSeq) const
Definition: EcalDumpRaw.cc:951
int end_fed_id_
Definition: EcalDumpRaw.h:93
bool pulsePerLme_
Definition: EcalDumpRaw.h:182
unsigned iTowerWord64_
Definition: EcalDumpRaw.h:99
static const int nRu_
Definition: EcalDumpRaw.h:170
static const unsigned fedStart_
Definition: EcalDumpRaw.h:122
bool orbit0Set_
Definition: EcalDumpRaw.h:150
size_t towerBlockLength_
Definition: EcalDumpRaw.h:104
static const int nTccTypes_
Definition: EcalDumpRaw.h:134
std::string ttfTag(int tccType, unsigned iSeq) const
Definition: EcalDumpRaw.cc:934
enum EcalDumpRaw::@283 decodeState_
int detailedTrigType_
Definition: EcalDumpRaw.h:156
double min(const std::vector< double > &a)
Definition: EcalDumpRaw.h:60
std::vector< double > adc_
Definition: EcalDumpRaw.h:106
void analyzeApd()
bool l1aHistory_
Definition: EcalDumpRaw.h:112
int first_event_
Definition: EcalDumpRaw.h:94
double amplCut_
Definition: EcalDumpRaw.h:109
static int modOfRu(int ru1)
Definition: EcalDumpRaw.cc:895
unsigned minEventId_
Definition: EcalDumpRaw.h:146
bool writeDcc_
Definition: EcalDumpRaw.h:91
std::vector< uint32_t > lastOrbit_
Definition: EcalDumpRaw.h:120
bool pulsePerLmod_
Definition: EcalDumpRaw.h:181
bool decode(const uint32_t *data, int iWord32, std::ostream &out)
Definition: EcalDumpRaw.cc:483
std::vector< unsigned > eventList_
Definition: EcalDumpRaw.h:145
static int lmodOfRu(int ru1)
Definition: EcalDumpRaw.cc:904
unsigned side_
Definition: EcalDumpRaw.h:143
std::vector< int > feL1a_
Definition: EcalDumpRaw.h:171
std::vector< std::vector< uint32_t > > orbits_
Definition: EcalDumpRaw.h:159
static const int eeOuterTcc_
Definition: EcalDumpRaw.h:133
uint32_t orbit_
Definition: EcalDumpRaw.h:149
std::vector< int > feBx_
Definition: EcalDumpRaw.h:176
static const int ttId_[nTccTypes_][maxTpgsPerTcc_]
Definition: EcalDumpRaw.h:139
void endJob()
Definition: EcalDumpRaw.cc:204
static const int ebmTcc_
Definition: EcalDumpRaw.h:130
unsigned maxEventId_
Definition: EcalDumpRaw.h:147
int profileRuId_
Definition: EcalDumpRaw.h:116
std::ofstream dumpFile_
Definition: EcalDumpRaw.h:179
edm::InputTag fedRawDataCollectionTag_
Definition: EcalDumpRaw.h:186
void analyzeEB(const edm::Event &, const edm::EventSetup &) const
unsigned iTccWord64_
Definition: EcalDumpRaw.h:101
std::string filename_
Definition: EcalDumpRaw.h:96
std::vector< int > nTpgs_
Definition: EcalDumpRaw.h:161
EcalDumpRaw(const edm::ParameterSet &)
Definition: EcalDumpRaw.cc:130
static const int nSamples
Definition: EcalDumpRaw.h:108
unsigned int offset(bool)
std::string toString(T val)
Definition: EcalDumpRaw.h:70
void analyzeEE(const edm::Event &, const edm::EventSetup &) const
unsigned iSrWord64_
Definition: EcalDumpRaw.h:100
void analyzeFed(int fedId)
std::vector< std::vector< int > > tpg_
Definition: EcalDumpRaw.h:160
bool pulsePerRu_
Definition: EcalDumpRaw.h:180
tuple out
Definition: dbtoconf.py:99
unsigned fedId_
Definition: EcalDumpRaw.h:141
std::string srRange(int offset) const
Definition: EcalDumpRaw.cc:917
int tccType_
type of TCC currently parsed
Definition: EcalDumpRaw.h:175
int simpleTrigType_
Definition: EcalDumpRaw.h:155
std::vector< int > dccChStatus_
Definition: EcalDumpRaw.h:162
static const int eeInnerTcc_
Definition: EcalDumpRaw.h:132
std::vector< int > feRuId_
Definition: EcalDumpRaw.h:177
int profileFedId_
Definition: EcalDumpRaw.h:115
std::vector< std::vector< uint32_t > > l1as_
Definition: EcalDumpRaw.h:158
static const int maxTpgsPerTcc_
Definition: EcalDumpRaw.h:123
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::InputTag l1AcceptBunchCrossingCollectionTag_
Definition: EcalDumpRaw.h:187
double a
Definition: hdecay.h:121
unsigned eventId_
Definition: EcalDumpRaw.h:144
unsigned orbit0_
Definition: EcalDumpRaw.h:148
int beg_fed_id_
Definition: EcalDumpRaw.h:92
static const unsigned nDccs_
Definition: EcalDumpRaw.h:121
long double T
static const int maxTccsPerDcc_
Definition: EcalDumpRaw.h:124
int verbosity_
Definition: EcalDumpRaw.h:90
double max(const std::vector< double > &a, unsigned &pos)
Definition: EcalDumpRaw.h:52
unsigned dccId_
Definition: EcalDumpRaw.h:142
int last_event_
Definition: EcalDumpRaw.h:95
static const int ebpTcc_
Definition: EcalDumpRaw.h:131