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

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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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 (std::vector< double > a, unsigned &pos)
 
double min (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 lme (int dccId1, int side)
 
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_
 
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_
 
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_
 
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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

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 130 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_.

130  :
131  iEvent_(0),
132  adc_(nSamples, 0.),
133  amplCut_(ps.getUntrackedParameter<double>("amplCut", 5.)),
134  dump_(ps.getUntrackedParameter<bool>("dump", true)),
135  dumpAdc_(ps.getUntrackedParameter<bool>("dumpAdc", 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  srpL1a_(-1),
161  tccL1a_(-1),
162  nTts_(-1),
163  tccBlockLen64_(19),
164  feL1a_(nRu_,-1),
165  srpBx_(-1),
166  tccBx_(-1),
167  tccType_(0),
168  feBx_(nRu_,-1),
169  feRuId_(nRu_,-1),
170  iTow_(0),
171  pulsePerRu_(ps.getUntrackedParameter<bool>("pulsePerRu", true)),
172  pulsePerLmod_(ps.getUntrackedParameter<bool>("pulsePerLmod", true)),
173  pulsePerLme_(ps.getUntrackedParameter<bool>("pulsePerLme", true)),
174  tccId_(0)
175 {
176  verbosity_= ps.getUntrackedParameter<int>("verbosity",1);
177 
178  beg_fed_id_= ps.getUntrackedParameter<int>("beg_fed_id",601);
179  end_fed_id_= ps.getUntrackedParameter<int>("end_fed_id",654);
180 
181 
182  first_event_ = ps.getUntrackedParameter<int>("first_event",1);
183  last_event_ = ps.getUntrackedParameter<int>("last_event",
185 
186  writeDcc_ = ps.getUntrackedParameter<bool>("writeDCC",false);
187  filename_ = ps.getUntrackedParameter<string>("filename","dump.bin");
188  if(writeDcc_){
189  dumpFile_.open(filename_.c_str());
190  if(dumpFile_.bad()){
191  /*edm::LogError("EcalDumpRaw")*/ std::cout << "Failed to open file '"
192  << filename_.c_str() << "' specified by "
193  << "parameter filename for writing. DCC data "
194  " dump will be disabled.";
195  writeDcc_ = false;
196  }
197  }
198 }
int tccBlockLen64_
Definition: EcalDumpRaw.h:166
T getUntrackedParameter(std::string const &, T const &) const
int end_fed_id_
Definition: EcalDumpRaw.h:92
bool pulsePerLme_
Definition: EcalDumpRaw.h:179
static const int nRu_
Definition: EcalDumpRaw.h:167
bool orbit0Set_
Definition: EcalDumpRaw.h:148
int detailedTrigType_
Definition: EcalDumpRaw.h:154
std::vector< double > adc_
Definition: EcalDumpRaw.h:105
#define min(a, b)
Definition: mlp_lapack.h:161
int first_event_
Definition: EcalDumpRaw.h:93
double amplCut_
Definition: EcalDumpRaw.h:108
unsigned minEventId_
Definition: EcalDumpRaw.h:144
bool writeDcc_
Definition: EcalDumpRaw.h:90
std::vector< uint32_t > lastOrbit_
Definition: EcalDumpRaw.h:118
bool pulsePerLmod_
Definition: EcalDumpRaw.h:178
std::vector< unsigned > eventList_
Definition: EcalDumpRaw.h:143
std::vector< int > feL1a_
Definition: EcalDumpRaw.h:168
std::vector< std::vector< uint32_t > > orbits_
Definition: EcalDumpRaw.h:157
std::vector< int > feBx_
Definition: EcalDumpRaw.h:173
const T & max(const T &a, const T &b)
unsigned maxEventId_
Definition: EcalDumpRaw.h:145
int profileRuId_
Definition: EcalDumpRaw.h:114
std::ofstream dumpFile_
Definition: EcalDumpRaw.h:176
std::string filename_
Definition: EcalDumpRaw.h:95
std::vector< int > nTpgs_
Definition: EcalDumpRaw.h:159
static const int nSamples
Definition: EcalDumpRaw.h:107
std::vector< std::vector< int > > tpg_
Definition: EcalDumpRaw.h:158
bool pulsePerRu_
Definition: EcalDumpRaw.h:177
int tccType_
type of TCC currently parsed
Definition: EcalDumpRaw.h:172
int simpleTrigType_
Definition: EcalDumpRaw.h:153
std::vector< int > feRuId_
Definition: EcalDumpRaw.h:174
int profileFedId_
Definition: EcalDumpRaw.h:113
std::vector< std::vector< uint32_t > > l1as_
Definition: EcalDumpRaw.h:156
static const int maxTpgsPerTcc_
Definition: EcalDumpRaw.h:121
unsigned eventId_
Definition: EcalDumpRaw.h:142
unsigned orbit0_
Definition: EcalDumpRaw.h:146
tuple cout
Definition: gather_cfg.py:41
int beg_fed_id_
Definition: EcalDumpRaw.h:91
static const unsigned nDccs_
Definition: EcalDumpRaw.h:119
static const int maxTccsPerDcc_
Definition: EcalDumpRaw.h:122
int verbosity_
Definition: EcalDumpRaw.h:89
int last_event_
Definition: EcalDumpRaw.h:94
EcalDumpRaw::~EcalDumpRaw ( )

Definition at line 203 of file EcalDumpRaw.cc.

203  {
204 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 208 of file EcalDumpRaw.cc.

References beg_fed_id_, bx_, benchmark_cfg::cerr, gather_cfg::cout, FEDRawData::data(), runTheMatrix::data, dccId_, decode(), dump_, dumpFile_, end_fed_id_, eventId_, eventList_, feBx_, feBxOffset, feL1a_, feRuId_, spr::find(), first_event_, i, iEvent_, iRu_, iTcc_, iTow_, l1a_, l1amax_, l1amin_, last_event_, FEDNumbering::lastFEDId(), maxEventId_, minEventId_, nRu_, nTpgs_, nTts_, asciidump::s, simpleTrigType_, FEDRawData::size(), srpBx_, srpL1a_, tccBx_, tccL1a_, tccType_, toNth(), and writeDcc_.

208  {
209  ++iEvent_;
210  eventId_ = event.id().event();
211 
212  if(eventList_.size()!=0 && find(eventList_.begin(), eventList_.end(),
213  eventId_) == eventList_.end()){
214  cout << "Skipping event " << eventId_ << ".\n";
215  return;
216  }
217 
218  if ((first_event_ > 0 && iEvent_ < first_event_) ||
219  (last_event_ > 0 && last_event_ < iEvent_)) return;
220  timeval start;
221  timeval stop;
222  gettimeofday(&start, 0);
223 
225  event.getByType(rawdata);
226 
227 
228  if(dump_) cout << "\n----------------------------------------------------------------------\n"
229  << toNth(iEvent_)
230  << " read event. "
231  << "Event id: "
232  << " " << eventId_
233  << "\n----------------------------------------------------------------------\n";
234 
235  if(eventId_ < minEventId_) minEventId_ = eventId_;
236  if(eventId_ > maxEventId_) maxEventId_ = eventId_;
237 
238 #if 1
239 
240  bool dccIdErr = false;
241  bool simpleTrigTypeErr = false;
242  bool outOfSync = false;
243  unsigned iFed = 0;
244  unsigned refDccId = 0;
245  int refSimpleTrigType = -1;
246  int refBx = -1;
247  // static bool recordNextPhys = false;
248  //static int bxCalib = -1;
249  //x static int nCalib = 0;
250 
251  for (int id = 0; id<=FEDNumbering::lastFEDId(); ++id){
252 
253  if (id < beg_fed_id_ || end_fed_id_ < id) continue;
254 
255  const FEDRawData& data = rawdata->FEDData(id);
256 
257  if (data.size()>4){
258  ++iFed;
259  if ((data.size() %16) !=0){
260  cout << "***********************************************\n";
261  cout << " Fed size in bits not multiple of 64, strange.\n";
262  cout << "***********************************************\n";
263  }
264 
265 
266  size_t nWord32 = data.size()/4;
267  const uint32_t * pData = ( reinterpret_cast<uint32_t*>(const_cast<unsigned char*> ( data.data())));
268  stringstream s;
269  srpL1a_ = -1;
270  tccL1a_ = -1;
271  srpBx_ = -1;
272  tccBx_ = -1;
273  iTow_ = 0;
274  iRu_ = 0;
275  nTts_ = -1;
276  iTcc_ = 0;
277  tccType_ = 0;
278 
279  for(int i = 0; i < nRu_; ++i){
280  feL1a_[i] = -1;
281  feBx_[i] = -1;
282  feRuId_[i] = -1;
283  }
284 
285  fill(nTpgs_.begin(), nTpgs_.end(), 0);
286 
287  bool rc;
288  for(size_t iWord32=0; iWord32 < nWord32; iWord32+=2){
289  s.str("");
290  if(id>=601 && id<=654){// ECAL DCC data
291  rc = decode(pData+iWord32, iWord32/2, s);
292  } else{
293  rc = true;
294  }
295  if(rc && dump_){
296  cout << setfill('0') << hex
297  << "[" << setw(8) << iWord32*4 << "] "
298  << setw(4) << (pData[iWord32+1]>>16 & 0xFFFF) << " "
299  << setw(4) << (pData[iWord32+1]>>0 & 0xFFFF) << " "
300  << setw(4) << (pData[iWord32]>>16 & 0xFFFF) << " "
301  << setw(4) << (pData[iWord32]>>0 & 0xFFFF) << " "
302  << setfill(' ') << dec
303  << s.str() << "\n";
304  }
305  }
306  if(dump_) cout << "\n";
307 
308  if(iFed==1){
309  refDccId = dccId_;
310  refSimpleTrigType = simpleTrigType_;
311  refBx = bx_;
312  } else{
313  if(dccId_!=refDccId){
314  dccIdErr = true;
315  }
316  if(simpleTrigType_!=refSimpleTrigType){
317  simpleTrigTypeErr = true;
318  }
319  if(refBx!=bx_){
320  outOfSync = true;
321  }
322  }
323 
324  if(dump_) cout << flush; //flushing cout before writing to cerr
325 
326  if(srpBx_!=-1 && srpBx_!=bx_){
327  cerr << "Bx discrepancy between SRP and DCC, Bx(SRP) = "
328  << srpBx_ << ", Bx(DCC) = " << bx_
329  << " in " << toNth(iEvent_) << " event, FED "
330  << id << "\n";
331  }
332 
333  if(tccBx_!=-1 && tccBx_!=bx_){
334  cerr << "Bx discrepancy between TCC and DCC, Bx(TCC) = "
335  << srpBx_ << ", Bx(DCC) = " << bx_
336  << " in " << toNth(iEvent_) << " event, FED "
337  << id << "\n";
338  }
339 
340  bool feBxErr = false;
341  for(int i=0; i < nRu_; ++i){
342  int expectedFeBx;
343  if(feBxOffset==0){
344  expectedFeBx = bx_ - 1;
345  } else{
346  expectedFeBx = (bx_==3564) ? 0 : bx_;
347  }
348  if(feBx_[i]!=-1 && feBx_[i]!=bx_-1+feBxOffset) feBxErr = true;
349  }
350  if(feBxErr) cerr << "Bx discrepancy between DCC and at least one FE"
351  << " in " << toNth(iEvent_) << " event, FED "
352  << id << "\n";
353 
354 
355  int localL1a = l1a_ & 0xFFF;
356  if(srpL1a_!=-1 && srpL1a_!=localL1a){
357  cerr << "Discrepancy between SRP and DCC L1a counter, L1a(SRP) = "
358  << srpL1a_ << ", L1a(DCC) & 0xFFF = " << localL1a
359  << " in " << toNth(iEvent_) << " event, FED "
360  << id << "\n";
361 
362  }
363 
364  if(tccL1a_!=-1 && tccL1a_!=localL1a){
365  cerr << "Discrepancy between TCC and DCC L1a counter, L1a(TCC) = "
366  << srpL1a_ << ", L1a(DCC) & 0xFFF = " << localL1a
367  << " in " << toNth(iEvent_) << " event, FED "
368  << id << "\n";
369 
370  }
371 
372  bool feL1aErr = false;
373  for(int i=0; i < nRu_; ++i){
374  if(feL1a_[i]!=-1 && feL1a_[i]!=localL1a-1){
375  cout << "FE L1A error for RU " << (i+1) << endl;
376  feL1aErr = true;
377  }
378  }
379  if(feL1aErr) cerr << "Discrepancy in L1a counter between DCC "
380  "and at least one FE (L1A(DCC) & 0xFFF = " << localL1a << ")"
381  << " in " << toNth(iEvent_) << " event, FED "
382  << id << "\n";
383 
384 
385  if(iTow_>0 && iTow_< nRu_ && feRuId_[iTow_] < feRuId_[iTow_-1]){
386  cerr << "Error in RU ID (TT/SC ID)"
387  << " in " << toNth(iEvent_) << " event, FED "
388  << id << "\n";
389  }
390 
391  if (beg_fed_id_ <= id && id <= end_fed_id_ && writeDcc_){
392  dumpFile_.write( reinterpret_cast <const char *> (pData), nWord32*4);
393  }
394  } else{
395  // cout << "No data for FED " << id << ". Size = "
396  // << data.size() << " byte(s).\n";
397  }
398  } //next fed
399 
400  if(dump_) cout << "Number of selected FEDs with a data block: "
401  << iFed << "\n";
402 
403  if(dccIdErr){
404  cerr << "DCC ID discrepancy in detailed trigger type "
405  << " of " << toNth(iEvent_) << " event.\n";
406  }
407  int bx = -1;
408  if(!outOfSync){
409  bx = bx_;
410  }
411 
412  if(l1a_>0 && l1a_< l1amin_) l1amin_ = l1a_;
413  if(l1a_>l1amax_) l1amax_ = l1a_;
414 
415 
416 #endif
417 
418  gettimeofday(&stop, 0);
419  // double dt = (stop.tv_sec-start.tv_sec)*1.e3
420  // + (stop.tv_usec-start.tv_usec)*1.e-3;
421  // histo_.fillD("hCodeTime", "Code execution time;Duration (ms);Event count",
422  // PGXAxis(100, 0, 100),
423  // dt);
424 }
int i
Definition: DBlmapReader.cc:9
std::string toNth(int n)
Definition: EcalDumpRaw.cc:426
int end_fed_id_
Definition: EcalDumpRaw.h:92
static const int nRu_
Definition: EcalDumpRaw.h:167
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:144
bool writeDcc_
Definition: EcalDumpRaw.h:90
bool decode(const uint32_t *data, int iWord32, std::ostream &out)
Definition: EcalDumpRaw.cc:450
std::vector< unsigned > eventList_
Definition: EcalDumpRaw.h:143
std::vector< int > feL1a_
Definition: EcalDumpRaw.h:168
std::vector< int > feBx_
Definition: EcalDumpRaw.h:173
unsigned maxEventId_
Definition: EcalDumpRaw.h:145
std::ofstream dumpFile_
Definition: EcalDumpRaw.h:176
std::vector< int > nTpgs_
Definition: EcalDumpRaw.h:159
static int lastFEDId()
Definition: FEDNumbering.cc:19
int simpleTrigType_
Definition: EcalDumpRaw.h:153
int tccType_
type of TCC currently parsed
Definition: EcalDumpRaw.h:172
std::vector< int > feRuId_
Definition: EcalDumpRaw.h:174
const int feBxOffset
Definition: EcalDumpRaw.cc:34
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
unsigned eventId_
Definition: EcalDumpRaw.h:142
tuple cout
Definition: gather_cfg.py:41
string s
Definition: asciidump.py:422
int beg_fed_id_
Definition: EcalDumpRaw.h:91
unsigned dccId_
Definition: EcalDumpRaw.h:140
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 450 of file EcalDumpRaw.cc.

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

Referenced by analyze().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 200 of file EcalDumpRaw.cc.

200  {
201 }
int EcalDumpRaw::lme ( int  dccId1,
int  side 
)
staticprivate

Definition at line 816 of file EcalDumpRaw.cc.

References min.

Referenced by decode().

816  {
817  int fedid = ((dcc1-1)%600) + 600; //to handle both FED and DCC id.
818  vector<int> lmes;
819  // EE -
820  if( fedid <= 609 ) {
821  if ( fedid <= 607 ) {
822  lmes.push_back(fedid-601+83);
823  } else if ( fedid == 608 ) {
824  lmes.push_back(90);
825  lmes.push_back(91);
826  } else if ( fedid == 609 ) {
827  lmes.push_back(92);
828  }
829  } //EB
830  else if ( fedid >= 610 && fedid <= 645 ) {
831  lmes.push_back(2*(fedid-610)+1);
832  lmes.push_back(lmes[0]+1);
833  } // EE+
834  else if ( fedid >= 646 ) {
835  if ( fedid <= 652 ) {
836  lmes.push_back(fedid-646+73);
837  } else if ( fedid == 653 ) {
838  lmes.push_back(80);
839  lmes.push_back(81);
840  } else if ( fedid == 654 ) {
841  lmes.push_back(82);
842  }
843  }
844  return lmes.size()==0?-1:lmes[std::min(lmes.size(), (size_t)side)];
845 }
#define min(a, b)
Definition: mlp_lapack.h:161
int EcalDumpRaw::lmodOfRu ( int  ru1)
staticprivate

Definition at line 866 of file EcalDumpRaw.cc.

866  {
867  int iEta0 = (ru1-1)/4;
868  int iPhi0 = (ru1-1)%4;
869  int rs;
870  if(iEta0==0){
871  rs = 1;
872  } else{
873  rs = 2 + ((iEta0-1)/4)*2 + (iPhi0%4)/2;
874  }
875  // cout << "ru1 = " << ru1 << " -> lmod = " << rs << "\n";
876  return rs;
877 }
double EcalDumpRaw::max ( std::vector< double >  a,
unsigned &  pos 
)
inlineprivate

Definition at line 51 of file EcalDumpRaw.h.

References i, m, and pos.

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 ( 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 857 of file EcalDumpRaw.cc.

857  {
858  int iEta0 = (ru1-1)/4;
859  if(iEta0<5){
860  return 1;
861  } else{
862  return 2 + (iEta0-5)/4;
863  }
864 }
int EcalDumpRaw::sideOfRu ( int  ru1)
staticprivate

Definition at line 848 of file EcalDumpRaw.cc.

Referenced by decode().

848  {
849  if(ru1 < 5 || (ru1-5)%4 >= 2){
850  return 0;
851  } else{
852  return 1;
853  }
854 }
std::string EcalDumpRaw::srRange ( int  offset) const
private

Definition at line 879 of file EcalDumpRaw.cc.

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

Referenced by decode().

879  {
880  int min = offset+1;
881  int max = offset+4;
882  stringstream buf;
883  if(628 <= fedId_ && fedId_ <= 646){//EB+
884  buf << right << min << ".."
885  << left << max;
886  } else{
887  buf << right << max << ".."
888  << left << min;
889  }
890  string s = buf.str();
891  buf.str("");
892  buf << setw(6) << right << s;
893  return buf.str();
894 }
double max(std::vector< double > a, unsigned &pos)
Definition: EcalDumpRaw.h:51
unsigned int offset(bool)
double min(std::vector< double > a)
Definition: EcalDumpRaw.h:59
unsigned fedId_
Definition: EcalDumpRaw.h:139
string s
Definition: asciidump.py:422
string EcalDumpRaw::toNth ( int  n)
private

Definition at line 426 of file EcalDumpRaw.cc.

References n, and asciidump::s.

Referenced by analyze().

426  {
427  stringstream s;
428  s << n;
429  if(n%100<10 || n%100>20){
430  switch(n%10){
431  case 1:
432  s << "st";
433  break;
434  case 2:
435  s << "nd";
436  break;
437  case 3:
438  s << "rd";
439  break;
440  default:
441  s << "th";
442  }
443  } else{
444  s << "th";
445  }
446  return s.str();
447 }
string s
Definition: asciidump.py:422
template<class T >
std::string EcalDumpRaw::toString ( T  val)
inlineprivate

Definition at line 69 of file EcalDumpRaw.h.

References asciidump::s.

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

Definition at line 913 of file EcalDumpRaw.cc.

References edm::hlt::Exception, and ttId_.

Referenced by decode().

913  {
914  if((unsigned)iSeq > sizeof(ttId_))
915  throw cms::Exception("OutOfRange")
916  << __FILE__ << ":" << __LINE__ << ": "
917  << "parameter out of range\n";
918 
919  const int ttId = ttId_[tccType][iSeq];
920  stringstream buf;
921  buf.str("");
922  if(ttId==0){
923  buf << " '0'";
924  } else{
925  buf << "TPG# " << setw(2) << ttId;
926  }
927  return buf.str();
928 }
static const int ttId_[nTccTypes_][maxTpgsPerTcc_]
Definition: EcalDumpRaw.h:137
std::string EcalDumpRaw::ttfTag ( int  tccType,
unsigned  iSeq 
) const
private

Definition at line 896 of file EcalDumpRaw.cc.

References edm::hlt::Exception, and ttId_.

Referenced by decode().

896  {
897  if((unsigned)iSeq > sizeof(ttId_))
898  throw cms::Exception("OutOfRange")
899  << __FILE__ << ":" << __LINE__ << ": "
900  << "parameter out of range\n";
901 
902  const int ttId = ttId_[tccType][iSeq];
903  stringstream buf;
904  buf.str("");
905  if(ttId==0){
906  buf << " '0'";
907  } else{
908  buf << "TTF# " << setw(2) << ttId;
909  }
910  return buf.str();
911 }
static const int ttId_[nTccTypes_][maxTpgsPerTcc_]
Definition: EcalDumpRaw.h:137

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 149 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::dccCh_
private

Definition at line 117 of file EcalDumpRaw.h.

Referenced by decode().

unsigned EcalDumpRaw::dccId_
private

Definition at line 140 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

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

Definition at line 154 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 176 of file EcalDumpRaw.h.

Referenced by analyze(), and EcalDumpRaw().

const int EcalDumpRaw::ebmTcc_ = 0
staticprivate

TCC types

Definition at line 128 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::ebpTcc_ = 1
staticprivate

Definition at line 129 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::eeInnerTcc_ = 2
staticprivate

Definition at line 130 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::eeOuterTcc_ = 3
staticprivate

Definition at line 131 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 142 of file EcalDumpRaw.h.

Referenced by analyze().

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

Definition at line 143 of file EcalDumpRaw.h.

Referenced by analyze().

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

Definition at line 173 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

unsigned EcalDumpRaw::fedId_
private

Definition at line 139 of file EcalDumpRaw.h.

Referenced by decode(), and srRange().

const unsigned EcalDumpRaw::fedStart_ = 601
staticprivate

Definition at line 120 of file EcalDumpRaw.h.

Referenced by decode().

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

Definition at line 168 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

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

Definition at line 174 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 160 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 182 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 175 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 150 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::l1amax_
private

Definition at line 152 of file EcalDumpRaw.h.

Referenced by analyze().

int EcalDumpRaw::l1aMaxX_
private

Definition at line 116 of file EcalDumpRaw.h.

int EcalDumpRaw::l1amin_
private

Definition at line 151 of file EcalDumpRaw.h.

Referenced by analyze().

int EcalDumpRaw::l1aMinX_
private

Definition at line 115 of file EcalDumpRaw.h.

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

Definition at line 156 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 118 of file EcalDumpRaw.h.

Referenced by decode().

unsigned EcalDumpRaw::maxEventId_
private

Definition at line 145 of file EcalDumpRaw.h.

Referenced by analyze().

int EcalDumpRaw::maxEvt_
private

Definition at line 112 of file EcalDumpRaw.h.

const int EcalDumpRaw::maxTccsPerDcc_ = 4
staticprivate

Definition at line 122 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::maxTpgsPerTcc_ = 68
staticprivate

Definition at line 121 of file EcalDumpRaw.h.

Referenced by decode().

unsigned EcalDumpRaw::minEventId_
private

Definition at line 144 of file EcalDumpRaw.h.

Referenced by analyze().

const unsigned EcalDumpRaw::nDccs_ = 54
staticprivate

Definition at line 119 of file EcalDumpRaw.h.

Referenced by decode().

const int EcalDumpRaw::nRu_ = 70
staticprivate

Definition at line 167 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 132 of file EcalDumpRaw.h.

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

Definition at line 159 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::nTts_
private

Definition at line 164 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

unsigned EcalDumpRaw::orbit0_
private

Definition at line 146 of file EcalDumpRaw.h.

Referenced by decode().

bool EcalDumpRaw::orbit0Set_
private

Definition at line 148 of file EcalDumpRaw.h.

Referenced by decode().

uint32_t EcalDumpRaw::orbit_
private

Definition at line 147 of file EcalDumpRaw.h.

Referenced by decode().

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

Definition at line 157 of file EcalDumpRaw.h.

int EcalDumpRaw::profileFedId_
private

Definition at line 113 of file EcalDumpRaw.h.

int EcalDumpRaw::profileRuId_
private

Definition at line 114 of file EcalDumpRaw.h.

bool EcalDumpRaw::pulsePerLme_
private

Definition at line 179 of file EcalDumpRaw.h.

bool EcalDumpRaw::pulsePerLmod_
private

Definition at line 178 of file EcalDumpRaw.h.

bool EcalDumpRaw::pulsePerRu_
private

Definition at line 177 of file EcalDumpRaw.h.

unsigned EcalDumpRaw::side_
private

Definition at line 141 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::simpleTrigType_
private

Definition at line 153 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::srpBx_
private

Definition at line 169 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::srpL1a_
private

Definition at line 161 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::tccBlockLen64_
private

Definition at line 166 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::tccBx_
private

Definition at line 170 of file EcalDumpRaw.h.

Referenced by analyze().

int EcalDumpRaw::tccId_
private

Definition at line 180 of file EcalDumpRaw.h.

Referenced by decode().

int EcalDumpRaw::tccL1a_
private

Definition at line 162 of file EcalDumpRaw.h.

Referenced by analyze(), and decode().

int EcalDumpRaw::tccType_
private

type of TCC currently parsed

Definition at line 172 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 158 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 137 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().