CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
EcalDumpRaw Class Reference

#include <EcalDumpRaw.h>

Inheritance diagram for EcalDumpRaw:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
void analyzeEB (const edm::Event &, const edm::EventSetup &) const
 
void analyzeEE (const edm::Event &, const edm::EventSetup &) const
 
 EcalDumpRaw (const edm::ParameterSet &)
 
void endJob ()
 
 ~EcalDumpRaw ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

enum  {
  inDaqHeader, inDccHeader, inTccBlock, inSrBlock,
  inTowerBlock
}
 

Private Member Functions

void analyzeApd ()
 
void analyzeFed (int fedId)
 
bool decode (const uint32_t *data, int iWord32, std::ostream &out)
 
double max (const std::vector< double > &a, unsigned &pos)
 
double min (const std::vector< double > &a)
 
std::string srRange (int offset) const
 
std::string toNth (int n)
 
template<class T >
std::string toString (T val)
 
std::string tpgTag (int tccType, unsigned iSeq) const
 
std::string ttfTag (int tccType, unsigned iSeq) const
 

Static Private Member Functions

static int lmodOfRu (int ru1)
 
static int modOfRu (int ru1)
 
static int sideOfRu (int ru1)
 

Private Attributes

std::vector< double > adc_
 
double amplCut_
 
int beg_fed_id_
 
int bx_
 
int dccCh_
 
std::vector< int > dccChStatus_
 
unsigned dccId_
 
enum EcalDumpRaw:: { ... }  decodeState_
 
int detailedTrigType_
 
bool dump_
 
bool dumpAdc_
 
std::ofstream dumpFile_
 
int end_fed_id_
 
unsigned eventId_
 
std::vector< unsigned > eventList_
 
std::vector< int > feBx_
 
unsigned fedId_
 
edm::InputTag fedRawDataCollectionTag_
 
std::vector< int > feL1a_
 
std::vector< int > feRuId_
 
std::string filename_
 
int first_event_
 
int iEvent_
 
int iRu_
 
unsigned iSrWord64_
 
int iTcc_
 
unsigned iTccWord64_
 
int iTow_
 
unsigned iTowerWord64_
 
int l1a_
 
edm::InputTag l1AcceptBunchCrossingCollectionTag_
 
bool l1aHistory_
 
int l1amax_
 
int l1aMaxX_
 
int l1amin_
 
int l1aMinX_
 
std::vector< std::vector
< uint32_t > > 
l1as_
 
int last_event_
 
std::vector< uint32_t > lastOrbit_
 
unsigned maxEventId_
 
int maxEvt_
 
unsigned minEventId_
 
std::vector< int > nTpgs_
 
int nTts_
 
unsigned orbit0_
 
bool orbit0Set_
 
uint32_t orbit_
 
std::vector< std::vector
< uint32_t > > 
orbits_
 
int profileFedId_
 
int profileRuId_
 
bool pulsePerLme_
 
bool pulsePerLmod_
 
bool pulsePerRu_
 
unsigned side_
 
int simpleTrigType_
 
int srpBx_
 
int srpL1a_
 
int tccBlockLen64_
 
int tccBx_
 
int tccId_
 
int tccL1a_
 
int tccType_
 type of TCC currently parsed More...
 
size_t towerBlockLength_
 
std::vector< std::vector< int > > tpg_
 
int verbosity_
 
bool writeDcc_
 

Static Private Attributes

static const unsigned fedStart_ = 601
 
static const int maxTccsPerDcc_ = 4
 
static const int maxTpgsPerTcc_ = 68
 
static const unsigned nDccs_ = 54
 
static const int nRu_ = 70
 
static const int nSamples = 10
 
static const int ttId_ [nTccTypes_][maxTpgsPerTcc_]
 
static const int ebmTcc_ = 0
 
static const int ebpTcc_ = 1
 
static const int eeInnerTcc_ = 2
 
static const int eeOuterTcc_ = 3
 
static const int nTccTypes_ = 4
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Utility to dump ECAL Raw data. Hexadecimal dump is accompagned with a side by data interpretention.

The script test/dumpRaw can be used to run this module. E. g.: dumpRaw /store/..../data_file.root Run dumpRaw -h to get help on this script.

Author: Ph. Gras CEA/IRFU Saclay

Definition at line 32 of file EcalDumpRaw.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
inDaqHeader 
inDccHeader 
inTccBlock 
inSrBlock 
inTowerBlock 

Definition at line 101 of file EcalDumpRaw.h.

Constructor & Destructor Documentation

EcalDumpRaw::EcalDumpRaw ( const edm::ParameterSet ps)
explicit

Definition at line 129 of file EcalDumpRaw.cc.

References beg_fed_id_, gather_cfg::cout, dumpFile_, end_fed_id_, filename_, first_event_, edm::ParameterSet::getUntrackedParameter(), last_event_, max(), verbosity_, and writeDcc_.

129  :
130  iEvent_(0),
131  adc_(nSamples, 0.),
132  amplCut_(ps.getUntrackedParameter<double>("amplCut", 5.)),
133  dump_(ps.getUntrackedParameter<bool>("dump", true)),
134  dumpAdc_(ps.getUntrackedParameter<bool>("dumpAdc", true)),
135  l1aHistory_(ps.getUntrackedParameter<bool>("l1aHistory", true)),
136  // doHisto_(ps.getUntrackedParameter<bool>("doHisto", true)),
137  maxEvt_(ps.getUntrackedParameter<int>("maxEvt", 10000)),
138  profileFedId_(ps.getUntrackedParameter<int>("profileFedId", 0)),
139  profileRuId_(ps.getUntrackedParameter<int>("profileRuId", 1)),
140  l1aMinX_(ps.getUntrackedParameter<int>("l1aMinX", 1)),
141  l1aMaxX_(ps.getUntrackedParameter<int>("l1aMaxX", 601)),
144  eventList_(ps.getUntrackedParameter<vector<unsigned> >("eventList", vector<unsigned>())),
145  minEventId_(999999),
146  maxEventId_(0),
147  orbit0_(0),
148  orbit0Set_(false),
149  bx_(-1),
150  l1a_(-1),
153  simpleTrigType_(-1),
154  detailedTrigType_(-1),
155  // histo_("hist.root", "RECREATE"),
156  l1as_(36+2),
157  orbits_(36+2),
158  tpg_(maxTccsPerDcc_, std::vector<int>(maxTpgsPerTcc_)),
160  dccChStatus_(70, 0),
161  srpL1a_(-1),
162  tccL1a_(-1),
163  nTts_(-1),
164  tccBlockLen64_(19),
165  feL1a_(nRu_,-1),
166  srpBx_(-1),
167  tccBx_(-1),
168  tccType_(0),
169  feBx_(nRu_,-1),
170  feRuId_(nRu_,-1),
171  iTow_(0),
172  pulsePerRu_(ps.getUntrackedParameter<bool>("pulsePerRu", true)),
173  pulsePerLmod_(ps.getUntrackedParameter<bool>("pulsePerLmod", true)),
174  pulsePerLme_(ps.getUntrackedParameter<bool>("pulsePerLme", true)),
175  tccId_(0),
176  fedRawDataCollectionTag_(ps.getParameter<edm::InputTag>("fedRawDataCollectionTag")),
177  l1AcceptBunchCrossingCollectionTag_(ps.getParameter<edm::InputTag>("l1AcceptBunchCrossingCollectionTag"))
178 {
179  verbosity_= ps.getUntrackedParameter<int>("verbosity",1);
180 
181  beg_fed_id_= ps.getUntrackedParameter<int>("beg_fed_id",601);
182  end_fed_id_= ps.getUntrackedParameter<int>("end_fed_id",654);
183 
184 
185  first_event_ = ps.getUntrackedParameter<int>("first_event",1);
186  last_event_ = ps.getUntrackedParameter<int>("last_event",
188 
189  writeDcc_ = ps.getUntrackedParameter<bool>("writeDCC",false);
190  filename_ = ps.getUntrackedParameter<string>("filename","dump.bin");
191  if(writeDcc_){
192  dumpFile_.open(filename_.c_str());
193  if(dumpFile_.bad()){
194  /*edm::LogError("EcalDumpRaw")*/ std::cout << "Failed to open file '"
195  << filename_.c_str() << "' specified by "
196  << "parameter filename for writing. DCC data "
197  " dump will be disabled.";
198  writeDcc_ = false;
199  }
200  }
201 }
T getParameter(std::string const &) const
int tccBlockLen64_
Definition: EcalDumpRaw.h:168
T getUntrackedParameter(std::string const &, T const &) const
int end_fed_id_
Definition: EcalDumpRaw.h:92
bool pulsePerLme_
Definition: EcalDumpRaw.h:181
static const int nRu_
Definition: EcalDumpRaw.h:169
bool orbit0Set_
Definition: EcalDumpRaw.h:149
int detailedTrigType_
Definition: EcalDumpRaw.h:155
std::vector< double > adc_
Definition: EcalDumpRaw.h:105
bool l1aHistory_
Definition: EcalDumpRaw.h:111
int first_event_
Definition: EcalDumpRaw.h:93
double amplCut_
Definition: EcalDumpRaw.h:108
unsigned minEventId_
Definition: EcalDumpRaw.h:145
bool writeDcc_
Definition: EcalDumpRaw.h:90
std::vector< uint32_t > lastOrbit_
Definition: EcalDumpRaw.h:119
bool pulsePerLmod_
Definition: EcalDumpRaw.h:180
std::vector< unsigned > eventList_
Definition: EcalDumpRaw.h:144
std::vector< int > feL1a_
Definition: EcalDumpRaw.h:170
std::vector< std::vector< uint32_t > > orbits_
Definition: EcalDumpRaw.h:158
std::vector< int > feBx_
Definition: EcalDumpRaw.h:175
const T & max(const T &a, const T &b)
unsigned maxEventId_
Definition: EcalDumpRaw.h:146
int profileRuId_
Definition: EcalDumpRaw.h:115
std::ofstream dumpFile_
Definition: EcalDumpRaw.h:178
edm::InputTag fedRawDataCollectionTag_
Definition: EcalDumpRaw.h:185
std::string filename_
Definition: EcalDumpRaw.h:95
std::vector< int > nTpgs_
Definition: EcalDumpRaw.h:160
static const int nSamples
Definition: EcalDumpRaw.h:107
std::vector< std::vector< int > > tpg_
Definition: EcalDumpRaw.h:159
bool pulsePerRu_
Definition: EcalDumpRaw.h:179
int tccType_
type of TCC currently parsed
Definition: EcalDumpRaw.h:174
int simpleTrigType_
Definition: EcalDumpRaw.h:154
std::vector< int > dccChStatus_
Definition: EcalDumpRaw.h:161
std::vector< int > feRuId_
Definition: EcalDumpRaw.h:176
int profileFedId_
Definition: EcalDumpRaw.h:114
std::vector< std::vector< uint32_t > > l1as_
Definition: EcalDumpRaw.h:157
static const int maxTpgsPerTcc_
Definition: EcalDumpRaw.h:122
edm::InputTag l1AcceptBunchCrossingCollectionTag_
Definition: EcalDumpRaw.h:186
unsigned eventId_
Definition: EcalDumpRaw.h:143
unsigned orbit0_
Definition: EcalDumpRaw.h:147
tuple cout
Definition: gather_cfg.py:121
int beg_fed_id_
Definition: EcalDumpRaw.h:91
static const unsigned nDccs_
Definition: EcalDumpRaw.h:120
static const int maxTccsPerDcc_
Definition: EcalDumpRaw.h:123
int verbosity_
Definition: EcalDumpRaw.h:89
int last_event_
Definition: EcalDumpRaw.h:94
EcalDumpRaw::~EcalDumpRaw ( )

Definition at line 206 of file EcalDumpRaw.cc.

206  {
207 }

Member Function Documentation

void EcalDumpRaw::analyze ( const edm::Event event,
const edm::EventSetup es 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 211 of file EcalDumpRaw.cc.

References beg_fed_id_, bx_, dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, FEDRawData::data(), data, dccChStatus_, dccId_, decode(), dump_, dumpFile_, end_fed_id_, eventId_, eventList_, feBx_, feBxOffset, fedRawDataCollectionTag_, feL1a_, feRuId_, lumiContext::fill, spr::find(), first_event_, i, iEvent_, iRu_, edm::HandleBase::isValid(), iTcc_, iTow_, l1a_, l1AcceptBunchCrossingCollectionTag_, l1aHistory_, l1amax_, l1amin_, last_event_, FEDNumbering::lastFEDId(), maxEventId_, minEventId_, nRu_, nTpgs_, nTts_, lumiPlot::rawdata, alignCSCRings::s, FEDRawData::size(), srpBx_, srpL1a_, dqm_diff::start, tccBx_, tccL1a_, tccType_, toNth(), trigNames, and writeDcc_.

211  {
212  ++iEvent_;
213  eventId_ = event.id().event();
214 
215  if(eventList_.size()!=0 && find(eventList_.begin(), eventList_.end(),
216  eventId_) == eventList_.end()){
217  cout << "Skipping event " << eventId_ << ".\n";
218  return;
219  }
220 
221  if ((first_event_ > 0 && iEvent_ < first_event_) ||
222  (last_event_ > 0 && last_event_ < iEvent_)) return;
223  timeval start;
224  timeval stop;
225  gettimeofday(&start, 0);
226 
228  event.getByLabel(fedRawDataCollectionTag_, rawdata);
229 
230  if(dump_ || l1aHistory_) cout << "\n======================================================================\n"
231  << toNth(iEvent_)
232  << " read event. "
233  << "Event id: "
234  << " " << eventId_
235  << "\n----------------------------------------------------------------------\n";
236 
237  if(l1aHistory_){
239  event.getByLabel(l1AcceptBunchCrossingCollectionTag_, l1aHist);
240  if(!l1aHist.isValid()) {
241  cout << "L1A history not found.\n";
242  } else if (l1aHist->size() == 0) {
243  cout << "L1A history is empty.\n";
244  } else{
245  cout << "L1A history: \n";
246  for(L1AcceptBunchCrossingCollection::const_iterator it = l1aHist->begin();
247  it != l1aHist->end();
248  ++it){
249  cout << "L1A offset: " << it->l1AcceptOffset() << "\t"
250  << "BX: " << it->bunchCrossing() << "\t"
251  << "Orbit ID: " << it->orbitNumber() << "\t"
252  << "Trigger type: " << it->eventType() << " ("
253  << trigNames[it->eventType()&0xF] << ")\n";
254  }
255  }
256  cout << "----------------------------------------------------------------------\n";
257  }
258 
259  if(eventId_ < minEventId_) minEventId_ = eventId_;
260  if(eventId_ > maxEventId_) maxEventId_ = eventId_;
261 
262 #if 1
263 
264  bool dccIdErr = false;
265  unsigned iFed = 0;
266  unsigned refDccId = 0;
267  // static bool recordNextPhys = false;
268  //static int bxCalib = -1;
269  //x static int nCalib = 0;
270 
271  for (int id = 0; id<=FEDNumbering::lastFEDId(); ++id){
272 
273  if (id < beg_fed_id_ || end_fed_id_ < id) continue;
274 
275  const FEDRawData& data = rawdata->FEDData(id);
276 
277  if (data.size()>4){
278  ++iFed;
279  if ((data.size() % 8) !=0){
280  cout << "***********************************************\n";
281  cout << " Fed size in bits not multiple of 64, strange.\n";
282  cout << "***********************************************\n";
283  }
284 
285 
286  size_t nWord32 = data.size()/4;
287  const uint32_t * pData = ( reinterpret_cast<uint32_t*>(const_cast<unsigned char*> ( data.data())));
288  stringstream s;
289  srpL1a_ = -1;
290  tccL1a_ = -1;
291  srpBx_ = -1;
292  tccBx_ = -1;
293  iTow_ = 0;
294  iRu_ = 0;
295  nTts_ = -1;
296  iTcc_ = 0;
297  tccType_ = 0;
298 
299  for(int i = 0; i < nRu_; ++i){
300  feL1a_[i] = -1;
301  feBx_[i] = -1;
302  feRuId_[i] = -1;
303  }
304 
305  fill(nTpgs_.begin(), nTpgs_.end(), 0);
306 
307  fill(dccChStatus_.begin(), dccChStatus_.end(), 0);
308 
309  bool rc;
310  for(size_t iWord32=0; iWord32 < nWord32; iWord32+=2){
311  s.str("");
312  if(id>=601 && id<=654){// ECAL DCC data
313  rc = decode(pData+iWord32, iWord32/2, s);
314  } else{
315  rc = true;
316  }
317  if(rc && dump_){
318  cout << setfill('0') << hex
319  << "[" << setw(8) << iWord32*4 << "] "
320  << setw(4) << (pData[iWord32+1]>>16 & 0xFFFF) << " "
321  << setw(4) << (pData[iWord32+1]>>0 & 0xFFFF) << " "
322  << setw(4) << (pData[iWord32]>>16 & 0xFFFF) << " "
323  << setw(4) << (pData[iWord32]>>0 & 0xFFFF) << " "
324  << setfill(' ') << dec
325  << s.str() << "\n";
326  }
327  }
328 
329  if(iFed==1){
330  refDccId = dccId_;
331  } else{
332  if(dccId_!=refDccId){
333  dccIdErr = true;
334  }
335  }
336 
337  if(dump_) cout << flush; //flushing cout before writing to cerr
338 
339  if(srpBx_!=-1 && srpBx_!=bx_){
340  cerr << "Bx discrepancy between SRP and DCC, Bx(SRP) = "
341  << srpBx_ << ", Bx(DCC) = " << bx_
342  << " in " << toNth(iEvent_) << " event, FED "
343  << id << endl;
344  }
345 
346  if(tccBx_!=-1 && tccBx_!=bx_){
347  cerr << "Bx discrepancy between TCC and DCC, Bx(TCC) = "
348  << srpBx_ << ", Bx(DCC) = " << bx_
349  << " in " << toNth(iEvent_) << " event, FED "
350  << id << endl;
351  }
352 
353  bool feBxErr = false;
354  for(int i=0; i < nRu_; ++i){
355  int expectedFeBx;
356  if(feBxOffset==0){
357  expectedFeBx = bx_ - 1;
358  } else{
359  expectedFeBx = (bx_==3564) ? 0 : bx_;
360  }
361  if(feBx_[i]!=-1 && feBx_[i]!=expectedFeBx){
362  cerr << "BX error for " << toNth(i+1) << " RU, RU ID "
363  << feRuId_[i];
364  if((unsigned) feRuId_[i] <= dccChStatus_.size()){
365  bool detected = (dccChStatus_[feRuId_[i]-1] == 10 || dccChStatus_[feRuId_[i]-1] == 11);
366  cerr << (detected?" ":" not ") << "detected by DCC (ch status: "
367  << dccChStatus_[feRuId_[i]-1] << ")";
368  }
369  cerr << " in " << toNth(iEvent_) << " event, FED "
370  << id << "." << endl;
371 
372  feBxErr = true;
373  }
374  }
375  if(feBxErr) cerr << "Bx discrepancy between DCC and at least one FE"
376  << " in " << toNth(iEvent_) << " event, FED "
377  << id << "\n";
378 
379 
380  int localL1a = l1a_ & 0xFFF;
381  if(srpL1a_!=-1 && srpL1a_!=localL1a){
382  cerr << "Discrepancy between SRP and DCC L1a counter, L1a(SRP) = "
383  << srpL1a_ << ", L1a(DCC) & 0xFFF = " << localL1a
384  << " in " << toNth(iEvent_) << " event, FED "
385  << id << endl;
386 
387  }
388 
389  if(tccL1a_!=-1 && tccL1a_!=localL1a){
390  cerr << "Discrepancy between TCC and DCC L1a counter, L1a(TCC) = "
391  << srpL1a_ << ", L1a(DCC) & 0xFFF = " << localL1a
392  << " in " << toNth(iEvent_) << " event, FED "
393  << id << endl;
394 
395  }
396 
397  bool feL1aErr = false;
398  for(int i=0; i < nRu_; ++i){
399  if(feL1a_[i] != -1 && feL1a_[i] != ((localL1a-1) & 0xFFF)){
400  cerr << "FE L1A error for " << toNth(i+1) << " RU, RU ID "
401  << feRuId_[i];
402  if((unsigned) feRuId_[i] <= dccChStatus_.size()){
403  bool detected = (dccChStatus_[feRuId_[i]-1] == 9 || dccChStatus_[feRuId_[i]-1] == 11);
404  cerr << (detected?" ":" not ") << "detected by DCC (ch status: "
405  << dccChStatus_[feRuId_[i]-1] << ")";
406  }
407  cerr << " in " << toNth(iEvent_) << " event, FED "
408  << id << "." << endl;
409  feL1aErr = true;
410  }
411  }
412  if(feL1aErr) cerr << "Discrepancy in L1a counter between DCC "
413  "and at least one FE (L1A(DCC) & 0xFFF = " << localL1a << ")"
414  << " in " << toNth(iEvent_) << " event, FED "
415  << id << "\n";
416 
417 
418  if(iTow_>0 && iTow_< nRu_ && feRuId_[iTow_] < feRuId_[iTow_-1]){
419  cerr << "Error in RU ID (TT/SC ID)"
420  << " in " << toNth(iEvent_) << " event, FED "
421  << id << endl;
422  }
423 
424  if (beg_fed_id_ <= id && id <= end_fed_id_ && writeDcc_){
425  dumpFile_.write( reinterpret_cast <const char *> (pData), nWord32*4);
426  }
427 
428  if(dump_) cout << "\n";
429  } else{
430  // cout << "No data for FED " << id << ". Size = "
431  // << data.size() << " byte(s).\n";
432  }
433  } //next fed
434 
435  if(dump_) cout << "Number of selected FEDs with a data block: "
436  << iFed << "\n";
437 
438  if(dccIdErr){
439  cout << flush;
440  cerr << "DCC ID discrepancy in detailed trigger type "
441  << " of " << toNth(iEvent_) << " event." << endl;
442  }
443 
444  if(l1a_>0 && l1a_< l1amin_) l1amin_ = l1a_;
445  if(l1a_>l1amax_) l1amax_ = l1a_;
446 
447 
448 #endif
449 
450  gettimeofday(&stop, 0);
451  // double dt = (stop.tv_sec-start.tv_sec)*1.e3
452  // + (stop.tv_usec-start.tv_usec)*1.e-3;
453  // histo_.fillD("hCodeTime", "Code execution time;Duration (ms);Event count",
454  // PGXAxis(100, 0, 100),
455  // dt);
456 }
int i
Definition: DBlmapReader.cc:9
std::string toNth(int n)
Definition: EcalDumpRaw.cc:458
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
int end_fed_id_
Definition: EcalDumpRaw.h:92
string fill
Definition: lumiContext.py:319
static const int nRu_
Definition: EcalDumpRaw.h:169
bool l1aHistory_
Definition: EcalDumpRaw.h:111
int first_event_
Definition: EcalDumpRaw.h:93
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
unsigned minEventId_
Definition: EcalDumpRaw.h:145
bool writeDcc_
Definition: EcalDumpRaw.h:90
bool decode(const uint32_t *data, int iWord32, std::ostream &out)
Definition: EcalDumpRaw.cc:482
std::vector< unsigned > eventList_
Definition: EcalDumpRaw.h:144
std::vector< int > feL1a_
Definition: EcalDumpRaw.h:170
std::vector< int > feBx_
Definition: EcalDumpRaw.h:175
unsigned maxEventId_
Definition: EcalDumpRaw.h:146
std::ofstream dumpFile_
Definition: EcalDumpRaw.h:178
edm::InputTag fedRawDataCollectionTag_
Definition: EcalDumpRaw.h:185
std::vector< int > nTpgs_
Definition: EcalDumpRaw.h:160
bool isValid() const
Definition: HandleBase.h:76
static int lastFEDId()
Definition: FEDNumbering.cc:17
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
int tccType_
type of TCC currently parsed
Definition: EcalDumpRaw.h:174
std::vector< int > dccChStatus_
Definition: EcalDumpRaw.h:161
std::vector< int > feRuId_
Definition: EcalDumpRaw.h:176
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const int feBxOffset
Definition: EcalDumpRaw.cc:33
edm::InputTag l1AcceptBunchCrossingCollectionTag_
Definition: EcalDumpRaw.h:186
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
unsigned eventId_
Definition: EcalDumpRaw.h:143
tuple cout
Definition: gather_cfg.py:121
dictionary rawdata
Definition: lumiPlot.py:393
int beg_fed_id_
Definition: EcalDumpRaw.h:91
unsigned dccId_
Definition: EcalDumpRaw.h:141
int last_event_
Definition: EcalDumpRaw.h:94
void EcalDumpRaw::analyzeApd ( )
private
void EcalDumpRaw::analyzeEB ( const edm::Event ,
const edm::EventSetup  
) const
void EcalDumpRaw::analyzeEE ( const edm::Event ,
const edm::EventSetup  
) const
void EcalDumpRaw::analyzeFed ( int  fedId)
private
bool EcalDumpRaw::decode ( const uint32_t *  data,
int  iWord32,
std::ostream &  out 
)
private

Definition at line 482 of file EcalDumpRaw.cc.

References adc_, amplCut_, bx_, dtNoiseDBValidation_cfg::cerr, colorNames, gather_cfg::cout, pyrootRender::da, dtTPAnalyzer_cfg::dataType, dccCh_, dccChStatus_, dccId_, detailedTrigNames, detailedTrigType_, dump_, dumpAdc_, ebmTcc_, ebpTcc_, eeInnerTcc_, eeOuterTcc_, feBx_, fedId_, fedStart_, feL1a_, feRuId_, lumiContext::fill, g, i, iRu_, iSrWord64_, iTcc_, iTccWord64_, iTowerWord64_, l1a_, lastOrbit_, max(), max(), maxTccsPerDcc_, maxTpgsPerTcc_, mgpaGainFactors, min(), nDccs_, nRu_, nTpgs_, nTts_, orbit0_, orbit0Set_, orbit_, alignCSCRings::s, side_, sideOfRu(), simpleTrigType_, srpBx_, srpL1a_, srRange(), tccBlockLen64_, tccId_, tccL1a_, tccType_, towerBlockLength_, tpg_, tpgTag(), trigNames, ttfTag(), and ttsNames.

Referenced by analyze().

482  {
483  bool rc = true;
484  const bool d = dump_;
485  if(iWord64==0){//start of event
486  iSrWord64_ = 0;
487  iTccWord64_ = 0;
488  iTowerWord64_ = 0;
489  }
490  int dataType = (data[1] >>28) & 0xF;
491  const int boe = 5;
492  const int eoe = 10;
493  if(dataType==boe){//Begin of Event header
494  /**********************************************************************
495  * DAQ header
496  *
497  **********************************************************************/
498  simpleTrigType_ = (data[1] >>24) & 0xF;
499  l1a_ = (data[1]>>0 ) & 0xFFffFF;
500  bx_ = (data[0] >>20) & 0xFFF;
501  fedId_ = (data[0] >>8 ) & 0xFFF;
502  if(d) out << "Trigger type: " << simpleTrigType_
503  << "(" << trigNames[(data[1]>>24) & 0xF] << ")"
504  << " L1A: " << l1a_
505  << " BX: " << bx_
506  << " FED ID: " << fedId_
507  << " FOV: " << ((data[0] >>4 ) & 0xF)
508  << " H: " << ((data[0] >>3 ) & 0x1);
509  } else if((dataType>>2)==0){//DCC header
510  /**********************************************************************
511  * ECAL DCC header
512  *
513  **********************************************************************/
514  int dccHeaderId = (data[1] >>24) & 0x3F;
515  switch(dccHeaderId){
516  case 1:
517  if(d) out << "Run #: " << ((data[1] >>0 ) & 0xFFFFFF)
518  << " DCC Err: " << ((data[0] >>24) & 0xFF)
519  << " Evt Len: " << ((data[0] >>0 ) & 0xFFFFFF);
520  break;
521  case 2:
522  side_ = (data[1] >>11) & 0x1;
523  detailedTrigType_ = (data[1] >>8 ) & 0x7;
524  dccId_ = (data[1] >>0 ) & 0x3F;
525  if(d) out << "DCC FOV: " << ((data[1] >>16) & 0xF)
526  << " Side: " << side_
527  << " Trig.: " << detailedTrigType_
528  << " (" << detailedTrigNames[(data[1]>>8)&0x7] << ")"
529  << " Color: " << ((data[1] >>6 ) & 0x3)
530  << " (" << colorNames[(data[1]>>6)&0x3] << ")"
531  << " DCC ID: " << dccId_;
532  break;
533  case 3:
534  {
535  if(d) out << "TCC Status ch<4..1>: 0x"
536  << hex << ((data[1]>>8) & 0xFFFF) << dec
537  << " SR status: " << ((data[1] >>4 ) & 0xF)
538  << " TZS: " << ((data[1] >>2 ) & 0x1)
539  << " ZS: " << ((data[1] >>1 ) & 0x1)
540  << " SR: " << ((data[1] >>0 ) & 0x1);
541  orbit_ = data[0];
542  if(d) out << " Orbit: " << orbit_;
543  if(!orbit0Set_){
544  orbit0_ = orbit_;
545  orbit0Set_ = true;
546  }
547  int iDcc0 = fedId_-fedStart_;
548  if((unsigned)iDcc0<nDccs_){
550  if(d) out << " (+" << (int)orbit_-(int)lastOrbit_[iDcc0] <<")";
551  }
552  lastOrbit_[iDcc0] = orbit_;
553  }
554  }
555  break;
556  case 4:
557  case 5:
558  case 6:
559  case 7:
560  case 8:
561  {
562  int chOffset = (dccHeaderId-4)*14;
563  dccChStatus_[13+chOffset] = ((data[1] >>20) & 0xF);
564  dccChStatus_[12+chOffset] = ((data[1] >>16) & 0xF);
565  dccChStatus_[11+chOffset] = ((data[1] >>12) & 0xF);
566  dccChStatus_[10+chOffset] = ((data[1] >>8 ) & 0xF);
567  dccChStatus_[ 9+chOffset] = ((data[1] >>4 ) & 0xF);
568  dccChStatus_[ 8+chOffset] = ((data[1] >>0) & 0xF);
569  dccChStatus_[ 7+chOffset] = ((data[0] >>28) & 0xF);
570  dccChStatus_[ 6+chOffset] = ((data[0] >>24) & 0xF);
571  dccChStatus_[ 5+chOffset] = ((data[0] >>20) & 0xF);
572  dccChStatus_[ 4+chOffset] = ((data[0] >>16) & 0xF);
573  dccChStatus_[ 3+chOffset] = ((data[0] >>12) & 0xF);
574  dccChStatus_[ 2+chOffset] = ((data[0] >>8 ) & 0xF);
575  dccChStatus_[ 1+chOffset] = ((data[0] >>4 ) & 0xF);
576  dccChStatus_[ 0+chOffset] = ((data[0] >>0 ) & 0xF);
577 
578  if(d){
579  out << "FE CH status:";
580  for(int i = chOffset; i < chOffset + 14; ++i){
581  out << " #" << (i+1) << ":" << dccChStatus_[i];
582  }
583  }
584  }
585  break;
586  default:
587  if(d) out << " bits<63..62>=0 (DCC header) bits<61..56>=" << dccHeaderId
588  << "(unknown=>ERROR?)";
589  }
590  } else if((dataType>>1)==3){//TCC block
591  /**********************************************************************
592  * TCC block
593  *
594  **********************************************************************/
595  if(iTccWord64_==0){
596  //header
597  tccL1a_ = (data[1] >>0 ) & 0xFFF;
598  tccId_ = ((data[0] >>0 ) & 0xFF);
599  nTts_ = ((data[1] >>16) & 0x7F);
601  ++iTcc_;
602  if(d) out << "LE1: " << ((data[1] >>28) & 0x1)
603  << " LE0: " << ((data[1] >>27) & 0x1)
604  << " N_samples: " << ((data[1] >>23) & 0x1F)
605  << " N_TTs: " << nTts_
606  << " E1: " << ((data[1] >>12) & 0x1)
607  << " L1A: " << tccL1a_
608  << " '3': " << ((data[0] >>29) & 0x7)
609  << " E0: " << ((data[0] >>28) & 0x1)
610  << " Bx: " << ((data[0] >>16) & 0xFFF)
611  << " TTC ID: " << tccId_;
612  if(nTts_==68){ //EB TCC (TCC68)
613  if(fedId_ < 628) tccType_ = ebmTcc_;
614  else tccType_ = ebpTcc_;
615  } else if(nTts_ == 16){//Inner EE TCC (TCC48)
617  } else if(nTts_ == 28){//Outer EE TCC (TCC48)
619  } else {
620  cout << flush;
621  cerr << "Error in #TT field of TCC block."
622  "This field is normally used to determine type of TCC "
623  "(TCC48 or TCC68). Type of TCC will be deduced from the TCC ID.\n";
624  if(tccId_ < 19) tccType_ = eeInnerTcc_;
625  else if(tccId_ < 37) tccType_ = eeOuterTcc_;
626  else if(tccId_ < 55) tccType_ = ebmTcc_;
627  else if(tccId_ < 73) tccType_ = ebpTcc_;
628  else if(tccId_ < 91) tccType_ = eeOuterTcc_;
629  else if(tccId_ < 109) tccType_ = eeInnerTcc_;
630  else{
631  cerr << "TCC ID is also invalid. EB- TCC type will be assumed.\n";
632  tccType_ = ebmTcc_;
633  }
634  cerr << flush;
635  }
636  tccBlockLen64_ = (tccType_==ebmTcc_ || tccType_==ebpTcc_) ? 18 : 9;
637  } else{// if(iTccWord64_<18){
638  int tpgOffset = (iTccWord64_-1)*4;
639  if(iTcc_ > maxTccsPerDcc_){
640  out << "Too many TCC blocks";
641  } else if(tpgOffset > (maxTpgsPerTcc_ - 4)){
642  out << "Too many TPG in one TCC block";
643  } else{
644  tpg_[iTcc_-1][3+tpgOffset] = (data[1] >>16) & 0x1FF;
645  tpg_[iTcc_-1][2+tpgOffset] = (data[1] >>0 ) & 0x1FF;
646  tpg_[iTcc_-1][1+tpgOffset] = (data[0] >>16) & 0x1FF;
647  tpg_[iTcc_-1][0+tpgOffset] = (data[0] >>0 ) & 0x1FF;
648  //int n[2][4] = {{1,2,3,4},
649  // {4,3,2,1}};
650  //int iorder = (628<=fedId_ && fedId_<=645)?1:0;
651  if(d) out << ttfTag(tccType_, 3+tpgOffset) << ":" //"TTF# " << setw(2) << ttId_[3 + tpgOffset] << ":"
652  << ((data[1] >>25) & 0x7) << " "
653  << tpgTag(tccType_, 3+tpgOffset) << ":" //" TPG# "<< setw(2) << ttId_[3 + tpgOffset] << ":"
654  << setw(3) << tpg_[iTcc_-1][3+tpgOffset] << " "
655  << ttfTag(tccType_, 2+tpgOffset) << ":" //" TTF# "<< setw(2) << ttId_[2 + tpgOffset] << ":"
656  << ((data[1] >>9 ) & 0x7) << " "
657  << tpgTag(tccType_, 2+tpgOffset) << ":" //" TPG# "<< setw(2) << ttId_[2 + tpgOffset] << ":"
658  << setw(3) << tpg_[iTcc_-1][2+tpgOffset] << " "
659  << " '3': " << ((data[0] >>29) & 0x7) << " "
660  << ttfTag(tccType_, 1+tpgOffset) << ":" //" TTF# "<< setw(2) << ttId_[1 + tpgOffset] << ":"
661  << ((data[0] >>25) & 0x7) << " "
662  << setw(3) << tpgTag(tccType_, 1+tpgOffset) << ": "//" TPG# "<< setw(2) << ttId_[1 + tpgOffset] << ":"
663  << tpg_[iTcc_-1][1+tpgOffset] << " "
664  << ttfTag(tccType_, 0+tpgOffset) << ":" //" TTF# "<< setw(2) << ttId_[0 + tpgOffset] << ":"
665  << ((data[0] >>9 ) & 0x7) << " "
666  << setw(3) << tpgTag(tccType_, 0+tpgOffset) << ":" //" TPG# "<< setw(2) << ttId_[0 + tpgOffset] << ":"
667  << tpg_[iTcc_-1][0+tpgOffset];
668  }
669  }// else{
670  // if(d) out << "ERROR";
671  //}
672  ++iTccWord64_;
673  if(iTccWord64_ >= (unsigned)tccBlockLen64_) iTccWord64_ = 0;
674  } else if((dataType>>1)==4){//SRP block
675  /**********************************************************************
676  * SRP block
677  *
678  **********************************************************************/
679  if(iSrWord64_==0){//header
680  srpL1a_ = (data[1] >>0 ) & 0xFFF;
681  srpBx_ = (data[0] >>16) & 0xFFF;
682  if(d) out << "LE1: " << ((data[1] >>28) & 0x1)
683  << " LE0: " << ((data[1] >>27) & 0x1)
684  << " N_SRFs: " << ((data[1] >>16) & 0x7F)
685  << " E1: " << ((data[1] >>12) & 0x1)
686  << " L1A: " << srpL1a_
687  << " '4': " << ((data[0] >>29) & 0x7)
688  << " E0: " << ((data[0] >>28) & 0x1)
689  << " Bx: " << srpBx_
690  << " SRP ID: " << ((data[0] >>0 ) & 0xFF);
691  } else if(iSrWord64_<6){
692  int ttfOffset = (iSrWord64_-1)*16;
693  if(d){
694  if(iSrWord64_<5){
695  out <<"SRF# " << setw(6) << right << srRange(12+ttfOffset)/*16+ttfOffset << "..#" << 13+ttfOffset*/ << ": "
696  << oct << ((data[1] >>16) & 0xFFF) << dec
697  << " SRF# " << srRange(8+ttfOffset) /*12+ttfOffset << "..#" << 9+ttfOffset*/ << ": "
698  << oct << ((data[1] >>0 ) & 0xFFF) << dec
699  << " '4':" << ((data[0] >>29) & 0x7)
700  << " SRF# " << srRange(4+ttfOffset) /*8+ttfOffset << "..#" << 5+ttfOffset*/ << ": "
701  << oct << ((data[0] >>16) & 0xFFF) << dec;
702  } else{//last 64-bit word has only 4 SRFs.
703  out << " ";
704  }
705  out << " SRF# " << srRange(ttfOffset) /*4+ttfOffset << "..#" << 1+ttfOffset*/ << ": "
706  << oct << ((data[0] >>0 ) & 0xFFF) << dec;
707  }
708  } else{
709  if(d) out << "ERROR";
710  }
711  ++iSrWord64_;
712  } else if((dataType>>2)==3){//Tower block
713  /**********************************************************************
714  * "Tower" block (crystal channel data from a RU (=1 FE cards))
715  *
716  **********************************************************************/
717  if(iTowerWord64_==0){//header
718  towerBlockLength_ = (data[1]>>16) & 0x1FF;
719  int l1a;
720  int bx;
721  l1a = (data[1] >>0 ) & 0xFFF;
722  bx = (data[0] >>16) & 0xFFF;
723  dccCh_=(data[0] >>0 ) & 0xFF;
724  if(d) out << "Block Len: " << towerBlockLength_
725  << " E1: " << ((data[1] >>12) & 0x1)
726  << " L1A: " << l1a
727  << " '3': " << ((data[0] >>30) & 0x3)
728  << " E0: " << ((data[0] >>28) & 0x1)
729  << " Bx: " << bx
730  << " N_samples: " << ((data[0] >>8 ) & 0x7F)
731  << " RU ID: " << dccCh_;
732  if(iRu_ < nRu_){
733  feL1a_[iRu_] = l1a;
734  feBx_[iRu_] = bx;
735  feRuId_[iRu_] = dccCh_;
736  ++iRu_;
737  }
738  } else if((unsigned)iTowerWord64_<towerBlockLength_){
739  if(!dumpAdc_){
740  //no output.
741  rc = false;
742  }
743  const bool da = dumpAdc_ && dump_;
744  switch((iTowerWord64_-1)%3){
745  int s[4];
746  int g[4];
747  case 0:
748  s[0]=(data[0] >>16) & 0xFFF;
749  g[0]=(data[0] >>28) & 0x3;
750  s[1]=(data[1] >>0 ) & 0xFFF;
751  g[1]=(data[1] >>12) & 0x3;
752  s[2]=(data[1] >>16) & 0xFFF;
753  g[2]=(data[1] >>28) & 0x3;
754  fill(adc_.begin(), adc_.end(), 0.);
755  if(da) out << "GMF: " << ((data[0] >>11) & 0x1)
756  << " SMF: " << ((data[0] >>9 ) & 0x1)
757  << " M: " << ((data[0] >>8 ) & 0x1)
758  << " XTAL: " << ((data[0] >>4 ) & 0x7)
759  << " STRIP: " << ((data[0] >>0 ) & 0x7)
760  << " " << setw(4) << s[0]
761  << "G" << g[0]
762  << " " << setw(4) << s[1]
763  << "G" << g[1]
764  << " " << setw(4) << s[2]
765  << "G" << g[2];
766  for(int i=0; i<3; ++i) adc_[i] = s[i]*mgpaGainFactors[g[i]];
767  break;
768  case 1:
769  s[0]=(data[0] >>0 ) & 0xFFF;
770  g[0]=(data[0] >>12) & 0x3;
771  s[1]=(data[0] >>16) & 0xFFF;
772  g[1]=(data[0] >>28) & 0x3;
773  s[2]=(data[1] >>0 ) & 0xFFF;
774  g[2]=(data[1] >>12) & 0x3;
775  s[3]=(data[1] >>16) & 0xFFF;
776  g[3]=(data[1] >>28) & 0x3;
777  if(da) out << " "
778  << " " << setw(4) << s[0]
779  << "G" << g[0]
780  << " " << setw(4) << s[1]
781  << "G" << g[1]
782  << " " << setw(4) << s[2]
783  << "G" << g[2]
784  << " " << setw(4) << s[3]
785  << "G" << g[3];
786  for(int i=0; i<4; ++i) adc_[i+3] = s[i]*mgpaGainFactors[g[i]];
787  break;
788  case 2:
789  if(da) out << "TZS: " << ((data[1] >>14) & 0x1);
790 
791  s[0]=(data[0] >>0 ) & 0xFFF;
792  g[0]=(data[0] >>12) & 0x3;
793  s[1]=(data[0] >>16) & 0xFFF;
794  g[1]=(data[0] >>28) & 0x3;
795  s[2]=(data[1] >>0 ) & 0xFFF;
796  g[2]=(data[1] >>12) & 0x3 ;
797 
798  for(int i=0; i<3; ++i) adc_[i+7] = s[i]*mgpaGainFactors[g[i]];
799  if(dccCh_<=68){
800  unsigned bom0; //Bin of Maximum, starting counting from 0
801  double ampl = max(adc_, bom0)-min(adc_);
802  if(da) out << " Ampl: " << setw(4) << ampl
803  << (ampl>amplCut_?"*":" ")
804  << " BoM:" << setw(2) << (bom0+1)
805  << " ";
806  if(fedId_ == dccId_ + 600 //block of the read-out SM
807  //if laser, only one side:
808  && (detailedTrigType_!=4 || sideOfRu(dccCh_)==(int)side_)
809  ){
810  }
811  } else{
812  if(da) out << setw(29) << "";
813  }
814  if(da) out << " " << setw(4) << s[0]
815  << "G" << g[0]
816  << " " << setw(4) << s[1]
817  << "G" << g[1]
818  << " " << setw(4) << s[2]
819  << "G" << g[2];
820  break;
821  default:
822  assert(false);
823  }
824  } else {
825  if(d) out << "ERROR";
826  }
827  ++iTowerWord64_;
830  ++dccCh_;
831  }
832  } else if(dataType==eoe){//End of event trailer
833  /**********************************************************************
834  * Event DAQ trailer
835  *
836  **********************************************************************/
837  int tts = (data[0] >>4) & 0xF;
838  if(d) out << "Evt Len.: " << ((data[1] >>0 ) & 0xFFFFFF)
839  << " CRC16: " << ((data[0] >>16) & 0xFFFF)
840  << " Evt Status: " << ((data[0] >>8 ) & 0xF)
841  << " TTS: " << tts
842  << " (" << ttsNames[tts] << ")"
843  << " T:" << ((data[0] >>3) & 0x1);
844  } else{
845  if(d) out << " incorrect 64-bit word type marker (see MSBs)";
846  }
847  return rc;
848 }
int tccBlockLen64_
Definition: EcalDumpRaw.h:168
static int sideOfRu(int ru1)
Definition: EcalDumpRaw.cc:885
int i
Definition: DBlmapReader.cc:9
std::string tpgTag(int tccType, unsigned iSeq) const
Definition: EcalDumpRaw.cc:950
string fill
Definition: lumiContext.py:319
unsigned iTowerWord64_
Definition: EcalDumpRaw.h:98
static const int nRu_
Definition: EcalDumpRaw.h:169
static const unsigned fedStart_
Definition: EcalDumpRaw.h:121
bool orbit0Set_
Definition: EcalDumpRaw.h:149
size_t towerBlockLength_
Definition: EcalDumpRaw.h:103
std::string ttfTag(int tccType, unsigned iSeq) const
Definition: EcalDumpRaw.cc:933
int detailedTrigType_
Definition: EcalDumpRaw.h:155
double min(const std::vector< double > &a)
Definition: EcalDumpRaw.h:59
std::vector< double > adc_
Definition: EcalDumpRaw.h:105
double amplCut_
Definition: EcalDumpRaw.h:108
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
std::vector< uint32_t > lastOrbit_
Definition: EcalDumpRaw.h:119
unsigned side_
Definition: EcalDumpRaw.h:142
std::vector< int > feL1a_
Definition: EcalDumpRaw.h:170
static const char *const ttsNames[]
Definition: EcalDumpRaw.cc:103
static const int eeOuterTcc_
Definition: EcalDumpRaw.h:132
uint32_t orbit_
Definition: EcalDumpRaw.h:148
std::vector< int > feBx_
Definition: EcalDumpRaw.h:175
const T & max(const T &a, const T &b)
static const int ebmTcc_
Definition: EcalDumpRaw.h:129
unsigned iTccWord64_
Definition: EcalDumpRaw.h:100
std::vector< int > nTpgs_
Definition: EcalDumpRaw.h:160
static const char *const detailedTrigNames[]
Definition: EcalDumpRaw.cc:85
unsigned iSrWord64_
Definition: EcalDumpRaw.h:99
std::vector< std::vector< int > > tpg_
Definition: EcalDumpRaw.h:159
tuple out
Definition: dbtoconf.py:99
unsigned fedId_
Definition: EcalDumpRaw.h:140
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
std::string srRange(int offset) const
Definition: EcalDumpRaw.cc:916
int tccType_
type of TCC currently parsed
Definition: EcalDumpRaw.h:174
int simpleTrigType_
Definition: EcalDumpRaw.h:154
std::vector< int > dccChStatus_
Definition: EcalDumpRaw.h:161
static const char *const colorNames[]
Definition: EcalDumpRaw.cc:96
static const int eeInnerTcc_
Definition: EcalDumpRaw.h:131
std::vector< int > feRuId_
Definition: EcalDumpRaw.h:176
static const int maxTpgsPerTcc_
Definition: EcalDumpRaw.h:122
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned orbit0_
Definition: EcalDumpRaw.h:147
tuple cout
Definition: gather_cfg.py:121
static const unsigned nDccs_
Definition: EcalDumpRaw.h:120
static const int maxTccsPerDcc_
Definition: EcalDumpRaw.h:123
double mgpaGainFactors[]
Definition: EcalDumpRaw.cc:126
double max(const std::vector< double > &a, unsigned &pos)
Definition: EcalDumpRaw.h:51
unsigned dccId_
Definition: EcalDumpRaw.h:141
static const int ebpTcc_
Definition: EcalDumpRaw.h:130
void EcalDumpRaw::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 203 of file EcalDumpRaw.cc.

203  {
204 }
int EcalDumpRaw::lmodOfRu ( int  ru1)
staticprivate

Definition at line 903 of file EcalDumpRaw.cc.

903  {
904  int iEta0 = (ru1-1)/4;
905  int iPhi0 = (ru1-1)%4;
906  int rs;
907  if(iEta0==0){
908  rs = 1;
909  } else{
910  rs = 2 + ((iEta0-1)/4)*2 + (iPhi0%4)/2;
911  }
912  // cout << "ru1 = " << ru1 << " -> lmod = " << rs << "\n";
913  return rs;
914 }
double EcalDumpRaw::max ( const std::vector< double > &  a,
unsigned &  pos 
)
inlineprivate

Definition at line 51 of file EcalDumpRaw.h.

References i, and m.

Referenced by decode(), and srRange().

51  {
52  pos = 0;
53  double m = a[pos];
54  for(unsigned i = 1; i < a.size(); ++i){
55  if(a[i]>m){ m = a[i]; pos = i;}
56  }
57  return m;
58  }
int i
Definition: DBlmapReader.cc:9
double a
Definition: hdecay.h:121
double EcalDumpRaw::min ( const std::vector< double > &  a)
inlineprivate

Definition at line 59 of file EcalDumpRaw.h.

References i, and m.

Referenced by decode(), and srRange().

59  {
60  double m = a[0];
61  for(unsigned i = 1; i < a.size(); ++i){
62  if(a[i]<m) m = a[i];
63  }
64  return m;
65  }
int i
Definition: DBlmapReader.cc:9
double a
Definition: hdecay.h:121
int EcalDumpRaw::modOfRu ( int  ru1)
staticprivate

Definition at line 894 of file EcalDumpRaw.cc.

894  {
895  int iEta0 = (ru1-1)/4;
896  if(iEta0<5){
897  return 1;
898  } else{
899  return 2 + (iEta0-5)/4;
900  }
901 }
int EcalDumpRaw::sideOfRu ( int  ru1)
staticprivate

Definition at line 885 of file EcalDumpRaw.cc.

Referenced by decode().

885  {
886  if(ru1 < 5 || (ru1-5)%4 >= 2){
887  return 0;
888  } else{
889  return 1;
890  }
891 }
std::string EcalDumpRaw::srRange ( int  offset) const
private

Definition at line 916 of file EcalDumpRaw.cc.

References fedId_, max(), min(), and alignCSCRings::s.

Referenced by decode().

916  {
917  int min = offset+1;
918  int max = offset+4;
919  stringstream buf;
920  if(628 <= fedId_ && fedId_ <= 646){//EB+
921  buf << right << min << ".."
922  << left << max;
923  } else{
924  buf << right << max << ".."
925  << left << min;
926  }
927  string s = buf.str();
928  buf.str("");
929  buf << setw(6) << right << s;
930  return buf.str();
931 }
double min(const std::vector< double > &a)
Definition: EcalDumpRaw.h:59
unsigned int offset(bool)
unsigned fedId_
Definition: EcalDumpRaw.h:140
double max(const std::vector< double > &a, unsigned &pos)
Definition: EcalDumpRaw.h:51
string EcalDumpRaw::toNth ( int  n)
private

Definition at line 458 of file EcalDumpRaw.cc.

References n, and alignCSCRings::s.

Referenced by analyze().

458  {
459  stringstream s;
460  s << n;
461  if(n%100<10 || n%100>20){
462  switch(n%10){
463  case 1:
464  s << "st";
465  break;
466  case 2:
467  s << "nd";
468  break;
469  case 3:
470  s << "rd";
471  break;
472  default:
473  s << "th";
474  }
475  } else{
476  s << "th";
477  }
478  return s.str();
479 }
template<class T >
std::string EcalDumpRaw::toString ( T  val)
inlineprivate

Definition at line 69 of file EcalDumpRaw.h.

References alignCSCRings::s.

69  {
70  std::stringstream s;
71  s << val;
72  return s.str();
73  }
std::string EcalDumpRaw::tpgTag ( int  tccType,
unsigned  iSeq 
) const
private

Definition at line 950 of file EcalDumpRaw.cc.

References edm::hlt::Exception, ecaldqm::ttId(), and ttId_.

Referenced by decode().

950  {
951  if((unsigned)iSeq > sizeof(ttId_))
952  throw cms::Exception("OutOfRange")
953  << __FILE__ << ":" << __LINE__ << ": "
954  << "parameter out of range\n";
955 
956  const int ttId = ttId_[tccType][iSeq];
957  stringstream buf;
958  buf.str("");
959  if(ttId==0){
960  buf << " '0'";
961  } else{
962  buf << "TPG# " << setw(2) << ttId;
963  }
964  return buf.str();
965 }
unsigned ttId(DetId const &)
static const int ttId_[nTccTypes_][maxTpgsPerTcc_]
Definition: EcalDumpRaw.h:138
std::string EcalDumpRaw::ttfTag ( int  tccType,
unsigned  iSeq 
) const
private

Definition at line 933 of file EcalDumpRaw.cc.

References edm::hlt::Exception, ecaldqm::ttId(), and ttId_.

Referenced by decode().

933  {
934  if((unsigned)iSeq > sizeof(ttId_))
935  throw cms::Exception("OutOfRange")
936  << __FILE__ << ":" << __LINE__ << ": "
937  << "parameter out of range\n";
938 
939  const int ttId = ttId_[tccType][iSeq];
940  stringstream buf;
941  buf.str("");
942  if(ttId==0){
943  buf << " '0'";
944  } else{
945  buf << "TTF# " << setw(2) << ttId;
946  }
947  return buf.str();
948 }
unsigned ttId(DetId const &)
static const int ttId_[nTccTypes_][maxTpgsPerTcc_]
Definition: EcalDumpRaw.h:138

Member Data Documentation

std::vector<double> EcalDumpRaw::adc_
private

Definition at line 105 of file EcalDumpRaw.h.

Referenced by decode().

double EcalDumpRaw::amplCut_
private

Definition at line 108 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::beg_fed_id_
private

Definition at line 91 of file EcalDumpRaw.h.

Referenced by analyze(), and EcalDumpRaw().

int EcalDumpRaw::bx_
private

Definition at line 150 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::dccCh_
private

Definition at line 118 of file EcalDumpRaw.h.

Referenced by decode().

std::vector<int> EcalDumpRaw::dccChStatus_
private

Definition at line 161 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

unsigned EcalDumpRaw::dccId_
private

Definition at line 141 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

enum { ... } EcalDumpRaw::decodeState_
int EcalDumpRaw::detailedTrigType_
private

Definition at line 155 of file EcalDumpRaw.h.

Referenced by decode().

bool EcalDumpRaw::dump_
private

Definition at line 109 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

bool EcalDumpRaw::dumpAdc_
private

Definition at line 110 of file EcalDumpRaw.h.

Referenced by decode().

std::ofstream EcalDumpRaw::dumpFile_
private

Definition at line 178 of file EcalDumpRaw.h.

Referenced by analyze(), and EcalDumpRaw().

const int EcalDumpRaw::ebmTcc_ = 0
staticprivate

TCC types

Definition at line 129 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::ebpTcc_ = 1
staticprivate

Definition at line 130 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::eeInnerTcc_ = 2
staticprivate

Definition at line 131 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::eeOuterTcc_ = 3
staticprivate

Definition at line 132 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::end_fed_id_
private

Definition at line 92 of file EcalDumpRaw.h.

Referenced by analyze(), and EcalDumpRaw().

unsigned EcalDumpRaw::eventId_
private

Definition at line 143 of file EcalDumpRaw.h.

Referenced by analyze().

std::vector<unsigned> EcalDumpRaw::eventList_
private

Definition at line 144 of file EcalDumpRaw.h.

Referenced by analyze().

std::vector<int> EcalDumpRaw::feBx_
private

Definition at line 175 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

unsigned EcalDumpRaw::fedId_
private

Definition at line 140 of file EcalDumpRaw.h.

Referenced by decode(), and srRange().

edm::InputTag EcalDumpRaw::fedRawDataCollectionTag_
private

Definition at line 185 of file EcalDumpRaw.h.

Referenced by analyze().

const unsigned EcalDumpRaw::fedStart_ = 601
staticprivate

Definition at line 121 of file EcalDumpRaw.h.

Referenced by decode().

std::vector<int> EcalDumpRaw::feL1a_
private

Definition at line 170 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

std::vector<int> EcalDumpRaw::feRuId_
private

Definition at line 176 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

std::string EcalDumpRaw::filename_
private

Definition at line 95 of file EcalDumpRaw.h.

Referenced by EcalDumpRaw().

int EcalDumpRaw::first_event_
private

Definition at line 93 of file EcalDumpRaw.h.

Referenced by analyze(), and EcalDumpRaw().

int EcalDumpRaw::iEvent_
private

Definition at line 96 of file EcalDumpRaw.h.

Referenced by analyze().

int EcalDumpRaw::iRu_
private

Definition at line 162 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

unsigned EcalDumpRaw::iSrWord64_
private

Definition at line 99 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::iTcc_
private

Definition at line 184 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

unsigned EcalDumpRaw::iTccWord64_
private

Definition at line 100 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::iTow_
private

Definition at line 177 of file EcalDumpRaw.h.

Referenced by analyze().

unsigned EcalDumpRaw::iTowerWord64_
private

Definition at line 98 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::l1a_
private

Definition at line 151 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

edm::InputTag EcalDumpRaw::l1AcceptBunchCrossingCollectionTag_
private

Definition at line 186 of file EcalDumpRaw.h.

Referenced by analyze().

bool EcalDumpRaw::l1aHistory_
private

Definition at line 111 of file EcalDumpRaw.h.

Referenced by analyze().

int EcalDumpRaw::l1amax_
private

Definition at line 153 of file EcalDumpRaw.h.

Referenced by analyze().

int EcalDumpRaw::l1aMaxX_
private

Definition at line 117 of file EcalDumpRaw.h.

int EcalDumpRaw::l1amin_
private

Definition at line 152 of file EcalDumpRaw.h.

Referenced by analyze().

int EcalDumpRaw::l1aMinX_
private

Definition at line 116 of file EcalDumpRaw.h.

std::vector<std::vector<uint32_t> > EcalDumpRaw::l1as_
private

Definition at line 157 of file EcalDumpRaw.h.

int EcalDumpRaw::last_event_
private

Definition at line 94 of file EcalDumpRaw.h.

Referenced by analyze(), and EcalDumpRaw().

std::vector<uint32_t> EcalDumpRaw::lastOrbit_
private

Definition at line 119 of file EcalDumpRaw.h.

Referenced by decode().

unsigned EcalDumpRaw::maxEventId_
private

Definition at line 146 of file EcalDumpRaw.h.

Referenced by analyze().

int EcalDumpRaw::maxEvt_
private

Definition at line 113 of file EcalDumpRaw.h.

const int EcalDumpRaw::maxTccsPerDcc_ = 4
staticprivate

Definition at line 123 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::maxTpgsPerTcc_ = 68
staticprivate

Definition at line 122 of file EcalDumpRaw.h.

Referenced by decode().

unsigned EcalDumpRaw::minEventId_
private

Definition at line 145 of file EcalDumpRaw.h.

Referenced by analyze().

const unsigned EcalDumpRaw::nDccs_ = 54
staticprivate

Definition at line 120 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::nRu_ = 70
staticprivate

Definition at line 169 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

const int EcalDumpRaw::nSamples = 10
staticprivate

Definition at line 107 of file EcalDumpRaw.h.

const int EcalDumpRaw::nTccTypes_ = 4
staticprivate

Definition at line 133 of file EcalDumpRaw.h.

std::vector<int> EcalDumpRaw::nTpgs_
private

Definition at line 160 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::nTts_
private

Definition at line 166 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

unsigned EcalDumpRaw::orbit0_
private

Definition at line 147 of file EcalDumpRaw.h.

Referenced by decode().

bool EcalDumpRaw::orbit0Set_
private

Definition at line 149 of file EcalDumpRaw.h.

Referenced by decode().

uint32_t EcalDumpRaw::orbit_
private

Definition at line 148 of file EcalDumpRaw.h.

Referenced by decode().

std::vector<std::vector<uint32_t> > EcalDumpRaw::orbits_
private

Definition at line 158 of file EcalDumpRaw.h.

int EcalDumpRaw::profileFedId_
private

Definition at line 114 of file EcalDumpRaw.h.

int EcalDumpRaw::profileRuId_
private

Definition at line 115 of file EcalDumpRaw.h.

bool EcalDumpRaw::pulsePerLme_
private

Definition at line 181 of file EcalDumpRaw.h.

bool EcalDumpRaw::pulsePerLmod_
private

Definition at line 180 of file EcalDumpRaw.h.

bool EcalDumpRaw::pulsePerRu_
private

Definition at line 179 of file EcalDumpRaw.h.

unsigned EcalDumpRaw::side_
private

Definition at line 142 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::simpleTrigType_
private

Definition at line 154 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::srpBx_
private

Definition at line 171 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::srpL1a_
private

Definition at line 163 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::tccBlockLen64_
private

Definition at line 168 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::tccBx_
private

Definition at line 172 of file EcalDumpRaw.h.

Referenced by analyze().

int EcalDumpRaw::tccId_
private

Definition at line 182 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::tccL1a_
private

Definition at line 164 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::tccType_
private

type of TCC currently parsed

Definition at line 174 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

size_t EcalDumpRaw::towerBlockLength_
private

Definition at line 103 of file EcalDumpRaw.h.

Referenced by decode().

std::vector<std::vector<int> > EcalDumpRaw::tpg_
private

Definition at line 159 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::ttId_
staticprivate

TT ID in the order the TPG appears in the data

Definition at line 138 of file EcalDumpRaw.h.

Referenced by tpgTag(), and ttfTag().

int EcalDumpRaw::verbosity_
private

Definition at line 89 of file EcalDumpRaw.h.

Referenced by EcalDumpRaw().

bool EcalDumpRaw::writeDcc_
private

Definition at line 90 of file EcalDumpRaw.h.

Referenced by analyze(), and EcalDumpRaw().