CMS 3D CMS Logo

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

#include <HcalLogicalMap.h>

Public Member Functions

void checkElectronicsHashIds ()
 
void checkHashIds ()
 
void checkIdFunctions ()
 
HcalElectronicsMap generateHcalElectronicsMap ()
 
const DetId getDetId (const HcalElectronicsId &)
 
const HcalFrontEndId getHcalFrontEndId (const DetId &)
 
 HcalLogicalMap (const HcalTopology *, std::vector< HBHEHFLogicalMapEntry > &, std::vector< HOHXLogicalMapEntry > &, std::vector< CALIBLogicalMapEntry > &, std::vector< ZDCLogicalMapEntry > &, std::vector< HTLogicalMapEntry > &, std::vector< uint32_t > &, std::vector< uint32_t > &, std::vector< uint32_t > &, std::vector< uint32_t > &, std::vector< uint32_t > &, std::vector< uint32_t > &, std::vector< uint32_t > &, std::vector< uint32_t > &)
 
void printMap (unsigned int mapIOV)
 
 ~HcalLogicalMap ()
 

Static Public Member Functions

static uint32_t makeEntryNumber (bool, int, int)
 

Private Member Functions

void printCalibMap (FILE *calibmapfile)
 
void printHBEFMap (FILE *hbefmapfile)
 
void printHOXMap (FILE *hoxmapfile)
 
void printHTMap (FILE *htmapfile)
 
void printZDCMap (FILE *zdcmapfile)
 

Private Attributes

std::vector< CALIBLogicalMapEntryCALIBEntries_
 
std::vector< uint32_t > HbHash2Entry_
 
std::vector
< HBHEHFLogicalMapEntry
HBHEHFEntries_
 
std::vector< uint32_t > HeHash2Entry_
 
std::vector< uint32_t > HfHash2Entry_
 
std::vector< uint32_t > HoHash2Entry_
 
std::vector< HOHXLogicalMapEntryHOHXEntries_
 
std::vector< HTLogicalMapEntryHTEntries_
 
std::vector< uint32_t > HtHash2Entry_
 
std::vector< uint32_t > HxCalibHash2Entry_
 
std::vector< uint32_t > LinearIndex2Entry_
 
unsigned int mapIOV_
 
const HcalTopologytopo_
 
std::vector< ZDCLogicalMapEntryZDCEntries_
 
std::vector< uint32_t > ZdcHash2Entry_
 

Detailed Description

Definition at line 9 of file HcalLogicalMap.h.

Constructor & Destructor Documentation

HcalLogicalMap::HcalLogicalMap ( const HcalTopology topo,
std::vector< HBHEHFLogicalMapEntry > &  HBHEHFEntries,
std::vector< HOHXLogicalMapEntry > &  HOHXEntries,
std::vector< CALIBLogicalMapEntry > &  CALIBEntries,
std::vector< ZDCLogicalMapEntry > &  ZDCEntries,
std::vector< HTLogicalMapEntry > &  HTEntries,
std::vector< uint32_t > &  LinearIndex2Entry,
std::vector< uint32_t > &  HbHash2Entry,
std::vector< uint32_t > &  HeHash2Entry,
std::vector< uint32_t > &  HfHash2Entry,
std::vector< uint32_t > &  HtHash2Entry,
std::vector< uint32_t > &  HoHash2Entry,
std::vector< uint32_t > &  HxCalibHash2Entry,
std::vector< uint32_t > &  ZdcHash2Entry 
)

Definition at line 16 of file HcalLogicalMap.cc.

References CALIBEntries_, filterCSVwithJSON::copy, HbHash2Entry_, HBHEHFEntries_, HeHash2Entry_, HfHash2Entry_, HoHash2Entry_, HOHXEntries_, HTEntries_, HtHash2Entry_, HxCalibHash2Entry_, LinearIndex2Entry_, ZDCEntries_, and ZdcHash2Entry_.

28  : topo_(topo)
29 
30 {
31  HBHEHFEntries_.resize(HBHEHFEntries.size());
32  HOHXEntries_.resize(HOHXEntries.size());
33  CALIBEntries_.resize(CALIBEntries.size());
34  ZDCEntries_.resize(ZDCEntries.size());
35  HTEntries_.resize(HTEntries.size());
36 
37  LinearIndex2Entry_.resize(LinearIndex2Entry.size());
38  HbHash2Entry_.resize(HbHash2Entry.size());
39  HeHash2Entry_.resize(HeHash2Entry.size());
40  HfHash2Entry_.resize(HfHash2Entry.size());
41  HtHash2Entry_.resize(HtHash2Entry.size());
42  HoHash2Entry_.resize(HoHash2Entry.size());
43  HxCalibHash2Entry_.resize(HxCalibHash2Entry.size());
44  ZdcHash2Entry_.resize(ZdcHash2Entry.size());
45 
46  copy(HBHEHFEntries.begin(),HBHEHFEntries.end(),HBHEHFEntries_.begin());
47  copy(HOHXEntries.begin(),HOHXEntries.end(),HOHXEntries_.begin());
48  copy(CALIBEntries.begin(),CALIBEntries.end(),CALIBEntries_.begin());
49  copy(ZDCEntries.begin(),ZDCEntries.end(),ZDCEntries_.begin());
50  copy(HTEntries.begin(),HTEntries.end(),HTEntries_.begin());
51  copy(LinearIndex2Entry.begin(),LinearIndex2Entry.end(),LinearIndex2Entry_.begin());
52  copy(HbHash2Entry.begin(),HbHash2Entry.end(),HbHash2Entry_.begin());
53  copy(HeHash2Entry.begin(),HeHash2Entry.end(),HeHash2Entry_.begin());
54  copy(HfHash2Entry.begin(),HfHash2Entry.end(),HfHash2Entry_.begin());
55  copy(HtHash2Entry.begin(),HtHash2Entry.end(),HtHash2Entry_.begin());
56  copy(HoHash2Entry.begin(),HoHash2Entry.end(),HoHash2Entry_.begin());
57  copy(HxCalibHash2Entry.begin(),HxCalibHash2Entry.end(),HxCalibHash2Entry_.begin());
58  copy(ZdcHash2Entry.begin(),ZdcHash2Entry.end(),ZdcHash2Entry_.begin());
59 }
std::vector< uint32_t > HeHash2Entry_
std::vector< HBHEHFLogicalMapEntry > HBHEHFEntries_
std::vector< uint32_t > HbHash2Entry_
std::vector< uint32_t > LinearIndex2Entry_
std::vector< uint32_t > HoHash2Entry_
std::vector< uint32_t > ZdcHash2Entry_
const HcalTopology * topo_
std::vector< HTLogicalMapEntry > HTEntries_
std::vector< HOHXLogicalMapEntry > HOHXEntries_
std::vector< uint32_t > HtHash2Entry_
std::vector< CALIBLogicalMapEntry > CALIBEntries_
std::vector< ZDCLogicalMapEntry > ZDCEntries_
std::vector< uint32_t > HxCalibHash2Entry_
std::vector< uint32_t > HfHash2Entry_
HcalLogicalMap::~HcalLogicalMap ( )

Definition at line 61 of file HcalLogicalMap.cc.

62 {
63 }

Member Function Documentation

void HcalLogicalMap::checkElectronicsHashIds ( )

Definition at line 481 of file HcalLogicalMap.cc.

References CALIBEntries_, gather_cfg::cout, diffTreeTool::diff, HBHEHFEntries_, HOHXEntries_, HTEntries_, i, python.multivaluedict::sort(), and ZDCEntries_.

481  {
482  std::vector<int> Electronics_Hashes_;
483 
484  int numfails = 0;
485  int numpass = 0;
486  int numnotdense = 0;
487 
488  cout << "\nRunning the hash checker for electronics Ids..." << endl;
489  for (std::vector<HBHEHFLogicalMapEntry>::iterator it = HBHEHFEntries_.begin(); it!=HBHEHFEntries_.end(); ++it) {
490  Electronics_Hashes_.push_back((it->getHcalElectronicsId()).linearIndex());
491  }
492  for (std::vector<ZDCLogicalMapEntry>::iterator it = ZDCEntries_.begin(); it!=ZDCEntries_.end(); ++it) {
493  Electronics_Hashes_.push_back((it->getHcalElectronicsId()).linearIndex());
494  }
495  for (std::vector<CALIBLogicalMapEntry>::iterator it = CALIBEntries_.begin(); it!=CALIBEntries_.end(); ++it) {
496  Electronics_Hashes_.push_back((it->getHcalElectronicsId()).linearIndex());
497  }
498  for (std::vector<HOHXLogicalMapEntry>::iterator it = HOHXEntries_.begin(); it!=HOHXEntries_.end(); ++it) {
499  Electronics_Hashes_.push_back((it->getHcalElectronicsId()).linearIndex());
500  }
501  for (std::vector<HTLogicalMapEntry>::iterator it = HTEntries_.begin(); it!=HTEntries_.end(); ++it) {
502  Electronics_Hashes_.push_back((it->getHcalTrigElectronicsId()).linearIndex());
503  }
504 
505  sort(Electronics_Hashes_.begin() , Electronics_Hashes_.end());
506 
507  for(unsigned int i = 0; i<Electronics_Hashes_.size()-1; i++) {
508  int diff = Electronics_Hashes_.at(i+1)-Electronics_Hashes_.at(i);
509  if (diff==0) numfails++;
510  else if (diff>1) numnotdense++;
511  else numpass++;
512  }
513  cout << "Electronics Id linearIndex (pass, collisions, nondense) = (" << numpass << "," << numfails << "," << numnotdense << ")" << endl;
514 }
int i
Definition: DBlmapReader.cc:9
std::vector< HBHEHFLogicalMapEntry > HBHEHFEntries_
std::vector< HTLogicalMapEntry > HTEntries_
std::vector< HOHXLogicalMapEntry > HOHXEntries_
std::vector< CALIBLogicalMapEntry > CALIBEntries_
std::vector< ZDCLogicalMapEntry > ZDCEntries_
tuple cout
Definition: gather_cfg.py:121
void HcalLogicalMap::checkHashIds ( )

Definition at line 379 of file HcalLogicalMap.cc.

References CALIBEntries_, gather_cfg::cout, HcalTopology::detId2denseIdCALIB(), HcalTopology::detId2denseIdHB(), HcalTopology::detId2denseIdHE(), HcalTopology::detId2denseIdHF(), HcalTopology::detId2denseIdHO(), HcalTopology::detId2denseIdHT(), diffTreeTool::diff, HBHEHFEntries_, HcalBarrel, HcalEndcap, HcalForward, HOHXEntries_, HTEntries_, i, python.multivaluedict::sort(), topo_, and ZDCEntries_.

379  {
380  std::vector<int> HB_Hashes_; // index 0
381  std::vector<int> HE_Hashes_; // index 1
382  std::vector<int> HF_Hashes_; // index 2
383  std::vector<int> HO_Hashes_; // index 3
384  std::vector<int> CALIBHX_Hashes_;// index 4
385  std::vector<int> ZDC_Hashes_; // index 5
386  std::vector<int> HT_Hashes_; // index 6
387 
388  int numfails[7] = {0,0,0,0,0,0,0};
389  int numpass[7] = {0,0,0,0,0,0,0};
390  int numnotdense[7] = {0,0,0,0,0,0,0};
391 
392  cout << "\nRunning the hash checker for detIds..." << endl;
393  for (std::vector<HBHEHFLogicalMapEntry>::iterator it = HBHEHFEntries_.begin(); it!=HBHEHFEntries_.end(); ++it) {
394  if (it->getDetId().subdetId()==HcalBarrel) {
395  HB_Hashes_.push_back(topo_->detId2denseIdHB(it->getDetId()));
396  }
397  else if (it->getDetId().subdetId()==HcalEndcap) {
398  HE_Hashes_.push_back(topo_->detId2denseIdHE(it->getDetId()));
399  }
400  else if (it->getDetId().subdetId()==HcalForward) {
401  HF_Hashes_.push_back(topo_->detId2denseIdHF(it->getDetId()));
402  }
403  }
404  for (std::vector<HOHXLogicalMapEntry>::iterator it = HOHXEntries_.begin(); it!=HOHXEntries_.end(); ++it) {
405  if (HcalGenericDetId(it->getDetId().rawId()).isHcalCalibDetId() ) {
406  CALIBHX_Hashes_.push_back(topo_->detId2denseIdCALIB(it->getDetId()));
407  }
408  else {
409  HO_Hashes_.push_back(topo_->detId2denseIdHO(it->getDetId()));
410  }
411  }
412  for (std::vector<CALIBLogicalMapEntry>::iterator it = CALIBEntries_.begin(); it!=CALIBEntries_.end(); ++it) {
413  CALIBHX_Hashes_.push_back(topo_->detId2denseIdCALIB(it->getDetId()));
414  }
415  for (std::vector<ZDCLogicalMapEntry>::iterator it = ZDCEntries_.begin(); it!=ZDCEntries_.end(); ++it) {
416  ZDC_Hashes_.push_back(HcalZDCDetId(it->getDetId()).denseIndex());
417  }
418  for (std::vector<HTLogicalMapEntry>::iterator it = HTEntries_.begin(); it!=HTEntries_.end(); ++it) {
419  HT_Hashes_.push_back(topo_->detId2denseIdHT(it->getDetId()));
420  }
421 
422  sort(HB_Hashes_.begin() , HB_Hashes_.end());
423  sort(HE_Hashes_.begin() , HE_Hashes_.end());
424  sort(HF_Hashes_.begin() , HF_Hashes_.end());
425  sort(HO_Hashes_.begin() , HO_Hashes_.end());
426  sort(CALIBHX_Hashes_.begin(), CALIBHX_Hashes_.end());
427  sort(ZDC_Hashes_.begin() , ZDC_Hashes_.end());
428  sort(HT_Hashes_.begin() , HT_Hashes_.end());
429 
430  for(unsigned int i = 0; i<HB_Hashes_.size()-1; i++) {
431  int diff = HB_Hashes_.at(i+1)-HB_Hashes_.at(i);
432  if (diff==0) numfails[0]++;
433  else if (diff>1) numnotdense[0]++;
434  else numpass[0]++;
435  }
436  for(unsigned int i = 0; i<HE_Hashes_.size()-1; i++) {
437  int diff = HE_Hashes_.at(i+1)-HE_Hashes_.at(i);
438  if (diff==0) numfails[1]++;
439  else if (diff>1) numnotdense[1]++;
440  else numpass[1]++;
441  }
442  for(unsigned int i = 0; i<HF_Hashes_.size()-1; i++) {
443  int diff = HF_Hashes_.at(i+1)-HF_Hashes_.at(i);
444  if (diff==0) numfails[2]++;
445  else if (diff>1) numnotdense[2]++;
446  else numpass[2]++;
447  }
448  for(unsigned int i = 0; i<HO_Hashes_.size()-1; i++) {
449  int diff = HO_Hashes_.at(i+1)-HO_Hashes_.at(i);
450  if (diff==0) numfails[3]++;
451  else if (diff>1) numnotdense[3]++;
452  else numpass[3]++;
453  }
454  for(unsigned int i = 0; i<CALIBHX_Hashes_.size()-1; i++) {
455  int diff = CALIBHX_Hashes_.at(i+1)-CALIBHX_Hashes_.at(i);
456  if (diff==0) numfails[4]++;
457  else if (diff>1) numnotdense[4]++;
458  else numpass[4]++;
459  }
460  for(unsigned int i = 0; i<ZDC_Hashes_.size()-1; i++) {
461  int diff = ZDC_Hashes_.at(i+1)-ZDC_Hashes_.at(i);
462  if (diff==0) numfails[5]++;
463  else if (diff>1) numnotdense[5]++;
464  else numpass[5]++;
465  }
466  for(unsigned int i = 0; i<HT_Hashes_.size()-1; i++) {
467  int diff = HT_Hashes_.at(i+1)-HT_Hashes_.at(i);
468  if (diff==0) numfails[6]++;
469  else if (diff>1) numnotdense[6]++;
470  else numpass[6]++;
471  }
472  cout << "HB HashIds (pass, collisions, non-dense) = (" << numpass[0] << "," << numfails[0] << "," << numnotdense[0] << ")" << endl;
473  cout << "HE HashIds (pass, collisions, non-dense) = (" << numpass[1] << "," << numfails[1] << "," << numnotdense[1] << ")" << endl;
474  cout << "HF HashIds (pass, collisions, non-dense) = (" << numpass[2] << "," << numfails[2] << "," << numnotdense[2] << ")" << endl;
475  cout << "HO HashIds (pass, collisions, non-dense) = (" << numpass[3] << "," << numfails[3] << "," << numnotdense[3] << ")" << endl;
476  cout << "CALIB/HX HashIds (pass, collisions, non-dense) = (" << numpass[4] << "," << numfails[4] << "," << numnotdense[4] << ")" << endl;
477  cout << "ZDC HashIds (pass, collisions, non-dense) = (" << numpass[5] << "," << numfails[5] << "," << numnotdense[5] << ")" << endl;
478  cout << "HT HashIds (pass, collisions, non-dense) = (" << numpass[6] << "," << numfails[6] << "," << numnotdense[6] << ")" << endl;
479 }
int i
Definition: DBlmapReader.cc:9
unsigned int detId2denseIdHT(const DetId &id) const
return a linear packed id from HT
unsigned int detId2denseIdHF(const DetId &id) const
return a linear packed id from HF
std::vector< HBHEHFLogicalMapEntry > HBHEHFEntries_
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
const HcalTopology * topo_
std::vector< HTLogicalMapEntry > HTEntries_
std::vector< HOHXLogicalMapEntry > HOHXEntries_
std::vector< CALIBLogicalMapEntry > CALIBEntries_
std::vector< ZDCLogicalMapEntry > ZDCEntries_
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
unsigned int detId2denseIdHE(const DetId &id) const
return a linear packed id from HE
tuple cout
Definition: gather_cfg.py:121
unsigned int detId2denseIdCALIB(const DetId &id) const
return a linear packed id from CALIB
void HcalLogicalMap::checkIdFunctions ( )

Definition at line 303 of file HcalLogicalMap.cc.

References CALIBEntries_, gather_cfg::cout, getDetId(), getHcalFrontEndId(), HBHEHFEntries_, HOHXEntries_, and ZDCEntries_.

303  {
304  int HBHEHF_EID_pass=0;
305  int HBHEHF_EID_fail=0;
306  int HOHX_EID_pass=0;
307  int HOHX_EID_fail=0;
308  int CALIB_EID_pass=0;
309  int CALIB_EID_fail=0;
310  int ZDC_EID_pass=0;
311  int ZDC_EID_fail=0;
312 
313  int HBHEHF_FEID_pass=0;
314  int HBHEHF_FEID_fail=0;
315  int HOHX_FEID_pass=0;
316  int HOHX_FEID_fail=0;
317  int CALIB_FEID_pass=0;
318  int CALIB_FEID_fail=0;
319 
320  cout << "\nRunning the id function checker..." << endl;
321 
322  for (std::vector<HBHEHFLogicalMapEntry>::iterator it = HBHEHFEntries_.begin(); it!=HBHEHFEntries_.end(); ++it) {
323  const HcalElectronicsId heid=it->getHcalElectronicsId();
324  const DetId did0=it->getDetId();
325  const DetId did1=getDetId(heid);
326  if (did0==did1) HBHEHF_EID_pass++;
327  else HBHEHF_EID_fail++;
328 
329  const HcalFrontEndId hfeid0=it->getHcalFrontEndId();
330  const HcalFrontEndId hfeid1=getHcalFrontEndId(did0);
331  if (hfeid0==hfeid1) HBHEHF_FEID_pass++;
332  else HBHEHF_FEID_fail++;
333  }
334  for (std::vector<HOHXLogicalMapEntry>::iterator it = HOHXEntries_.begin(); it!=HOHXEntries_.end(); ++it) {
335  const HcalElectronicsId heid=it->getHcalElectronicsId();
336  const DetId did0=it->getDetId();
337  const DetId did1=getDetId(heid);
338  if (did0==did1) HOHX_EID_pass++;
339  else HOHX_EID_fail++;
340 
341  const HcalFrontEndId hfeid0=it->getHcalFrontEndId();
342  const HcalFrontEndId hfeid1=getHcalFrontEndId(did0);
343  if (hfeid0==hfeid1) HOHX_FEID_pass++;
344  else HOHX_FEID_fail++;
345  }
346  for (std::vector<CALIBLogicalMapEntry>::iterator it = CALIBEntries_.begin(); it!=CALIBEntries_.end(); ++it) {
347  const HcalElectronicsId heid=it->getHcalElectronicsId();
348  const DetId did0=it->getDetId();
349  const DetId did1=getDetId(heid);
350  if (did0==did1) CALIB_EID_pass++;
351  else CALIB_EID_fail++;
352 
353  const HcalFrontEndId hfeid0=it->getHcalFrontEndId();
354  const HcalFrontEndId hfeid1=getHcalFrontEndId(did0);
355  if (hfeid0==hfeid1) CALIB_FEID_pass++;
356  else CALIB_FEID_fail++;
357  }
358  for (std::vector<ZDCLogicalMapEntry>::iterator it = ZDCEntries_.begin(); it!=ZDCEntries_.end(); ++it) {
359  const HcalElectronicsId heid=it->getHcalElectronicsId();
360  const DetId did0=it->getDetId();
361  const DetId did1=getDetId(heid);
362  if (did0==did1) ZDC_EID_pass++;
363  else ZDC_EID_fail++;
364  }
365 
366  cout << "Checking detIds from electronics ids..." << endl;
367  cout << "HBHEHF EID (pass,fail) = (" << HBHEHF_EID_pass << "," << HBHEHF_EID_fail << ")" << endl;
368  cout << "HOHX EID (pass,fail) = (" << HOHX_EID_pass << "," << HOHX_EID_fail << ")" << endl;
369  cout << "CALIB EID (pass,fail) = (" << CALIB_EID_pass << "," << CALIB_EID_fail << ")" << endl;
370  cout << "ZDC EID (pass,fail) = (" << ZDC_EID_pass << "," << ZDC_EID_fail << ")" << endl;
371  cout << endl;
372  cout << "Checking frontEndIds from electronics ids..." << endl;
373  cout << "HBHEHF FEID (pass,fail) = (" << HBHEHF_FEID_pass << "," << HBHEHF_FEID_fail << ")" << endl;
374  cout << "HOHX FEID (pass,fail) = (" << HOHX_FEID_pass << "," << HOHX_FEID_fail << ")" << endl;
375  cout << "CALIB FEID (pass,fail) = (" << CALIB_FEID_pass << "," << CALIB_FEID_fail << ")" << endl;
376 }
std::vector< HBHEHFLogicalMapEntry > HBHEHFEntries_
const HcalFrontEndId getHcalFrontEndId(const DetId &)
Definition: DetId.h:20
std::vector< HOHXLogicalMapEntry > HOHXEntries_
std::vector< CALIBLogicalMapEntry > CALIBEntries_
const DetId getDetId(const HcalElectronicsId &)
std::vector< ZDCLogicalMapEntry > ZDCEntries_
tuple cout
Definition: gather_cfg.py:121
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
HcalElectronicsMap HcalLogicalMap::generateHcalElectronicsMap ( )

Definition at line 155 of file HcalLogicalMap.cc.

References CALIBEntries_, HBHEHFEntries_, HOHXEntries_, HTEntries_, HcalElectronicsMap::mapEId2chId(), HcalElectronicsMap::mapEId2tId(), HcalElectronicsMap::sort(), and ZDCEntries_.

Referenced by HcalDetDiagLEDMonitor::analyze(), HcalDetDiagLEDClient::htmlOutput(), and HcalDetDiagPedestalClient::htmlOutput().

156 {
157  HcalElectronicsMap* theemap = new HcalElectronicsMap();
158 
159  for (std::vector<HBHEHFLogicalMapEntry>::iterator it = HBHEHFEntries_.begin(); it!=HBHEHFEntries_.end(); ++it) {
160  theemap->mapEId2chId( it->getHcalElectronicsId(), it->getDetId() );}
161  for (std::vector<HOHXLogicalMapEntry>::iterator it = HOHXEntries_.begin(); it!=HOHXEntries_.end(); ++it) {
162  theemap->mapEId2chId( it->getHcalElectronicsId(), it->getDetId() );}
163  for (std::vector<CALIBLogicalMapEntry>::iterator it = CALIBEntries_.begin(); it!=CALIBEntries_.end(); ++it) {
164  theemap->mapEId2chId( it->getHcalElectronicsId(), it->getDetId() );}
165  for (std::vector<ZDCLogicalMapEntry>::iterator it = ZDCEntries_.begin(); it!=ZDCEntries_.end(); ++it) {
166  theemap->mapEId2chId( it->getHcalElectronicsId(), it->getDetId() );}
167  for (std::vector<HTLogicalMapEntry>::iterator it = HTEntries_.begin(); it!=HTEntries_.end(); ++it) {
168  theemap->mapEId2tId( it->getHcalTrigElectronicsId(), it->getDetId() );}
169  theemap->sort();
170  return *theemap;
171 }
std::vector< HBHEHFLogicalMapEntry > HBHEHFEntries_
bool mapEId2tId(HcalElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
std::vector< HTLogicalMapEntry > HTEntries_
bool mapEId2chId(HcalElectronicsId fElectronicsId, DetId fId)
std::vector< HOHXLogicalMapEntry > HOHXEntries_
std::vector< CALIBLogicalMapEntry > CALIBEntries_
std::vector< ZDCLogicalMapEntry > ZDCEntries_
const DetId HcalLogicalMap::getDetId ( const HcalElectronicsId eid)

Definition at line 251 of file HcalLogicalMap.cc.

References CALIBEntries_, HBHEHFEntries_, HOHXEntries_, HcalElectronicsId::linearIndex(), LinearIndex2Entry_, and ZDCEntries_.

Referenced by checkIdFunctions().

252 {
253  const uint32_t entry=LinearIndex2Entry_.at(eid.linearIndex());
254  if ( !(entry&0x1) ) return DetId(0);
255  if ( ((entry>>1)&0x3)==0) return HBHEHFEntries_.at(entry>>3).getDetId();
256  if ( ((entry>>1)&0x3)==1) return HOHXEntries_.at(entry>>3).getDetId();
257  if ( ((entry>>1)&0x3)==2) return CALIBEntries_.at(entry>>3).getDetId();
258  if ( ((entry>>1)&0x3)==3) return ZDCEntries_.at(entry>>3).getDetId();
259  return DetId(0);
260 }
std::vector< HBHEHFLogicalMapEntry > HBHEHFEntries_
std::vector< uint32_t > LinearIndex2Entry_
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
Definition: DetId.h:20
std::vector< HOHXLogicalMapEntry > HOHXEntries_
std::vector< CALIBLogicalMapEntry > CALIBEntries_
std::vector< ZDCLogicalMapEntry > ZDCEntries_
int linearIndex() const
get a fast, compact, unique index for linear lookups (maximum value = 16384)
const HcalFrontEndId HcalLogicalMap::getHcalFrontEndId ( const DetId did)

Definition at line 262 of file HcalLogicalMap.cc.

References CALIBEntries_, HcalCalibDetId::calibFlavor(), HcalCalibDetId::CalibrationBox, HcalTopology::detId2denseIdCALIB(), HcalTopology::detId2denseIdHB(), HcalTopology::detId2denseIdHE(), HcalTopology::detId2denseIdHF(), HcalTopology::detId2denseIdHO(), HcalGenericDetId::genericSubdet(), HbHash2Entry_, HBHEHFEntries_, HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenCalibration, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HeHash2Entry_, HfHash2Entry_, HcalCalibDetId::HOCrosstalk, HoHash2Entry_, HOHXEntries_, HxCalibHash2Entry_, and topo_.

Referenced by HcalDetDiagNoiseMonitor::analyze(), checkIdFunctions(), HcalDetDiagLEDMonitor::fillHistos(), HcalDeadCellMonitor::fillNevents_recentdigis(), HcalDeadCellMonitor::fillNevents_recentrechits(), HcalDetDiagLEDClient::htmlOutput(), HcalDetDiagPedestalClient::htmlOutput(), HcalDeadCellMonitor::process_RecHit(), HcalRecHitMonitor::processEvent_rechit(), HBHEStatusBitSetter::SetFlagsFromDigi(), and HBHEStatusBitSetter::SetFlagsFromRecHits().

263 {
264  const HcalGenericDetId hgdi(did);
265 
266  const HcalGenericDetId::HcalGenericSubdetector hgsd=hgdi.genericSubdet();
268  const int hashedId=topo_->detId2denseIdHB(did);
269  const uint32_t entry=HbHash2Entry_.at(hashedId)-1;
270  return HBHEHFEntries_.at(entry).getHcalFrontEndId();
271  }
272  else if (hgsd==HcalGenericDetId::HcalGenEndcap) {
273  const int hashedId=topo_->detId2denseIdHE(did);
274  const uint32_t entry=HeHash2Entry_.at(hashedId)-1;
275  return HBHEHFEntries_.at(entry).getHcalFrontEndId();
276  }
277  else if (hgsd==HcalGenericDetId::HcalGenForward) {
278  const int hashedId=topo_->detId2denseIdHF(did);
279  const uint32_t entry=HfHash2Entry_.at(hashedId)-1;
280  return HBHEHFEntries_.at(entry).getHcalFrontEndId();
281  }
282  else if (hgsd==HcalGenericDetId::HcalGenOuter) {
283  const int hashedId=topo_->detId2denseIdHO(did);
284  const uint32_t entry=HoHash2Entry_.at(hashedId)-1;
285  return HOHXEntries_.at(entry).getHcalFrontEndId();
286  }
287  else if (hgsd==HcalGenericDetId::HcalGenCalibration) {
288  HcalCalibDetId hcid(did);
289  if (hcid.calibFlavor()==HcalCalibDetId::HOCrosstalk) {
290  const int hashedId=topo_->detId2denseIdCALIB(did);
291  const uint32_t entry=HxCalibHash2Entry_.at(hashedId)-1;
292  return HOHXEntries_.at(entry).getHcalFrontEndId();
293  }
294  else if (hcid.calibFlavor()==HcalCalibDetId::CalibrationBox) {
295  const int hashedId=topo_->detId2denseIdCALIB(did);
296  const uint32_t entry=HxCalibHash2Entry_.at(hashedId)-1;
297  return CALIBEntries_.at(entry).getHcalFrontEndId();
298  }
299  }
300  return HcalFrontEndId(0);
301 }
std::vector< uint32_t > HeHash2Entry_
unsigned int detId2denseIdHF(const DetId &id) const
return a linear packed id from HF
std::vector< HBHEHFLogicalMapEntry > HBHEHFEntries_
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
std::vector< uint32_t > HbHash2Entry_
std::vector< uint32_t > HoHash2Entry_
const HcalTopology * topo_
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
std::vector< HOHXLogicalMapEntry > HOHXEntries_
std::vector< CALIBLogicalMapEntry > CALIBEntries_
std::vector< uint32_t > HxCalibHash2Entry_
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
unsigned int detId2denseIdHE(const DetId &id) const
return a linear packed id from HE
std::vector< uint32_t > HfHash2Entry_
unsigned int detId2denseIdCALIB(const DetId &id) const
return a linear packed id from CALIB
uint32_t HcalLogicalMap::makeEntryNumber ( bool  isvalid,
int  vectorid,
int  entry 
)
static

Definition at line 65 of file HcalLogicalMap.cc.

References submit::answer.

Referenced by HcalLogicalMapGenerator::buildCALIBMap(), HcalLogicalMapGenerator::buildHBEFTMap(), HcalLogicalMapGenerator::buildHOXMap(), and HcalLogicalMapGenerator::buildZDCMap().

66 {
67  uint32_t answer=0;
68  answer|=isvalid;
69  answer|=(vectorid&0x3)<<1;
70  answer|=entry<<3;
71  return answer;
72 }
answer
Definition: submit.py:44
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
void HcalLogicalMap::printCalibMap ( FILE *  calibmapfile)
private

Definition at line 204 of file HcalLogicalMap.cc.

References CALIBEntries_.

Referenced by printMap().

204  {
205 
206  int titlecounter = 0;
207 
208  for (std::vector<CALIBLogicalMapEntry>::iterator it = CALIBEntries_.begin(); it!=CALIBEntries_.end(); ++it) {
209  titlecounter = titlecounter % 21;
210  if (titlecounter == 0){
211  fprintf(calibmapfile,"# side eta phi dphi det rbx sector rm rm_fi ");
212  fprintf(calibmapfile," fi_ch crate htr fpga htr_fi dcc_sl spigo dcc fedid ch_type name\n");
213  }
214  titlecounter++;
215  fprintf(calibmapfile,"%s",it->printLMapLine());
216  }
217 }
std::vector< CALIBLogicalMapEntry > CALIBEntries_
void HcalLogicalMap::printHBEFMap ( FILE *  hbefmapfile)
private

Definition at line 174 of file HcalLogicalMap.cc.

References HBHEHFEntries_.

Referenced by printMap().

174  {
175  int titlecounter = 0;
176 
177  for (std::vector<HBHEHFLogicalMapEntry>::iterator it = HBHEHFEntries_.begin(); it!=HBHEHFEntries_.end(); ++it) {
178  titlecounter = titlecounter % 21;
179  if (titlecounter == 0){
180  fprintf(hbefmapfile,"# side eta phi dphi depth det rbx wedge rm pixel qie adc");
181  fprintf(hbefmapfile," rm_fi fi_ch crate htr fpga htr_fi dcc_sl spigo dcc slb slbin slbin2");
182  fprintf(hbefmapfile," slnam rctcra rctcar rctcon rctnam fedid\n");
183  }
184  titlecounter++;
185  fprintf(hbefmapfile,"%s",it->printLMapLine());
186  }
187 }
std::vector< HBHEHFLogicalMapEntry > HBHEHFEntries_
void HcalLogicalMap::printHOXMap ( FILE *  hoxmapfile)
private

Definition at line 189 of file HcalLogicalMap.cc.

References HOHXEntries_.

Referenced by printMap().

189  {
190 
191  int titlecounter = 0;
192 
193  for (std::vector<HOHXLogicalMapEntry>::iterator it = HOHXEntries_.begin(); it!=HOHXEntries_.end(); ++it) {
194  titlecounter = titlecounter % 21;
195  if (titlecounter == 0){
196  fprintf(hoxmapfile,"# side eta phi dphi depth det rbx sector rm pixel qie adc");
197  fprintf(hoxmapfile," rm_fi fi_ch let_code crate htr fpga htr_fi dcc_sl spigo dcc fedid\n");
198  }
199  titlecounter++;
200  fprintf(hoxmapfile,"%s",it->printLMapLine());
201  }
202 }
std::vector< HOHXLogicalMapEntry > HOHXEntries_
void HcalLogicalMap::printHTMap ( FILE *  htmapfile)
private

Definition at line 234 of file HcalLogicalMap.cc.

References HTEntries_.

Referenced by printMap().

234  {
235 
236  int titlecounter = 0;
237 
238  for (std::vector<HTLogicalMapEntry>::iterator it = HTEntries_.begin(); it!=HTEntries_.end(); ++it) {
239  titlecounter = titlecounter % 21;
240  if (titlecounter == 0){
241  fprintf(htmapfile,"# side eta phi dphi depth det wedge crate");
242  fprintf(htmapfile," htr fpga dcc_sl spigo dcc slb slbin slbin2 nDat ");
243  fprintf(htmapfile," slnam rctcra rctcar rctcon rctnam fedid\n");
244  }
245  titlecounter++;
246  fprintf(htmapfile,"%s",it->printLMapLine());
247  }
248 }
std::vector< HTLogicalMapEntry > HTEntries_
void HcalLogicalMap::printMap ( unsigned int  mapIOV)

Definition at line 74 of file HcalLogicalMap.cc.

References gather_cfg::cout, printCalibMap(), printHBEFMap(), printHOXMap(), printHTMap(), printZDCMap(), and cond::rpcobgas::time.

74  {
75  using namespace std;
76 
77  static FILE* HBEFmap;
78  static FILE* HOXmap;
79  static FILE* CALIBmap;
80  static FILE* ZDCmap;
81  static FILE* HTmap;
82 
83  char tempbuff[30];
84 
85  stringstream mystream;
86  string HBEFmapstr, HOXmapstr, CALIBmapstr, ZDCmapstr, HTmapstr;
87  string date;
88  string IOVlabel;
89 
90  time_t myTime;
91  time(&myTime);
92 
93  strftime(tempbuff,128,"%d.%b.%Y",localtime(&myTime) );
94  mystream<<tempbuff;
95  date= mystream.str();
96 
97  mystream.str("");
98  if (mapIOV==1) IOVlabel = "A";
99  else if (mapIOV==2) IOVlabel = "B";
100  else if (mapIOV==3) IOVlabel = "C";
101  else IOVlabel = "D";
102 
103  HBEFmapstr = "./HCALmapHBEF_"+IOVlabel+".txt";
104  HOXmapstr = "./HCALmapHO_"+IOVlabel+".txt";
105  CALIBmapstr = "./HCALmapCALIB_"+IOVlabel+".txt";
106  ZDCmapstr = "./ZDCmap_"+IOVlabel+".txt";
107  HTmapstr = "./HCALmapHT_"+IOVlabel+".txt";
108 
109 // HBEFmapstr = "./HCALmapHBEF_"+date+".txt";
110 // HOXmapstr = "./HCALmapHO_"+date+"_"+IOVlabel+".txt";
111 // CALIBmapstr = "./HCALmapCALIB_"+date+".txt";
112 // ZDCmapstr = "./ZDCmap_"+date+".txt";
113 // HTmapstr = "./HCALmapHT_"+date+".txt";
114 
115  HBEFmap = fopen(HBEFmapstr.c_str(),"w");
116  HOXmap = fopen(HOXmapstr.c_str(),"w");
117  CALIBmap = fopen(CALIBmapstr.c_str(),"w");
118  ZDCmap = fopen(ZDCmapstr.c_str(),"w");
119  HTmap = fopen(HTmapstr.c_str(),"w");
120  /**********************/
121 
122  if(HBEFmap) {
123  fprintf(HBEFmap,"## file created %s ##\n",date.c_str());
124  printHBEFMap(HBEFmap);
125  }
126  else cout <<HBEFmapstr<<" not found!"<<endl;
127 
128  if(HOXmap) {
129  fprintf(HOXmap,"## file created %s ##\n",date.c_str());
130  printHOXMap(HOXmap);
131  }
132  else cout <<HOXmapstr<<" not found!"<<endl;
133 
134  if(CALIBmap) {
135  fprintf(CALIBmap,"## file created %s ##\n",date.c_str());
136  printCalibMap(CALIBmap);
137  }
138  else cout <<CALIBmapstr<<" not found!"<<endl;
139 
140  if(ZDCmap) {
141  fprintf(ZDCmap,"## file created %s ##\n",date.c_str());
142  printZDCMap(ZDCmap);
143  }
144  else cout <<ZDCmapstr<<" not found!"<<endl;
145 
146  if(HTmap) {
147  fprintf(HTmap,"## file created %s ##\n",date.c_str());
148  printHTMap(HTmap);
149  }
150  else cout <<HTmapstr<<" not found!"<<endl;
151 
152 }
void printCalibMap(FILE *calibmapfile)
void printHTMap(FILE *htmapfile)
void printHOXMap(FILE *hoxmapfile)
void printZDCMap(FILE *zdcmapfile)
void printHBEFMap(FILE *hbefmapfile)
tuple cout
Definition: gather_cfg.py:121
void HcalLogicalMap::printZDCMap ( FILE *  zdcmapfile)
private

Definition at line 219 of file HcalLogicalMap.cc.

References ZDCEntries_.

Referenced by printMap().

219  {
220 
221  int titlecounter = 0;
222 
223  for (std::vector<ZDCLogicalMapEntry>::iterator it = ZDCEntries_.begin(); it!=ZDCEntries_.end(); ++it) {
224  titlecounter = titlecounter % 21;
225  if (titlecounter == 0){
226  fprintf(zdcmapfile,"# side x y dx depth det det_ch cable rm qie ");
227  fprintf(zdcmapfile," adc rm_fi fi_ch crate htr fpga htr_fi dcc_sl spigo dcc fedid\n");
228  }
229  titlecounter++;
230  fprintf(zdcmapfile,"%s",it->printLMapLine());
231  }
232 }
std::vector< ZDCLogicalMapEntry > ZDCEntries_

Member Data Documentation

std::vector<CALIBLogicalMapEntry> HcalLogicalMap::CALIBEntries_
private
std::vector<uint32_t> HcalLogicalMap::HbHash2Entry_
private

Definition at line 54 of file HcalLogicalMap.h.

Referenced by getHcalFrontEndId(), and HcalLogicalMap().

std::vector<HBHEHFLogicalMapEntry> HcalLogicalMap::HBHEHFEntries_
private
std::vector<uint32_t> HcalLogicalMap::HeHash2Entry_
private

Definition at line 55 of file HcalLogicalMap.h.

Referenced by getHcalFrontEndId(), and HcalLogicalMap().

std::vector<uint32_t> HcalLogicalMap::HfHash2Entry_
private

Definition at line 56 of file HcalLogicalMap.h.

Referenced by getHcalFrontEndId(), and HcalLogicalMap().

std::vector<uint32_t> HcalLogicalMap::HoHash2Entry_
private

Definition at line 58 of file HcalLogicalMap.h.

Referenced by getHcalFrontEndId(), and HcalLogicalMap().

std::vector<HOHXLogicalMapEntry> HcalLogicalMap::HOHXEntries_
private
std::vector<HTLogicalMapEntry> HcalLogicalMap::HTEntries_
private
std::vector<uint32_t> HcalLogicalMap::HtHash2Entry_
private

Definition at line 57 of file HcalLogicalMap.h.

Referenced by HcalLogicalMap().

std::vector<uint32_t> HcalLogicalMap::HxCalibHash2Entry_
private

Definition at line 59 of file HcalLogicalMap.h.

Referenced by getHcalFrontEndId(), and HcalLogicalMap().

std::vector<uint32_t> HcalLogicalMap::LinearIndex2Entry_
private

Definition at line 53 of file HcalLogicalMap.h.

Referenced by getDetId(), and HcalLogicalMap().

unsigned int HcalLogicalMap::mapIOV_
private

Definition at line 46 of file HcalLogicalMap.h.

const HcalTopology* HcalLogicalMap::topo_
private

Definition at line 62 of file HcalLogicalMap.h.

Referenced by checkHashIds(), and getHcalFrontEndId().

std::vector<ZDCLogicalMapEntry> HcalLogicalMap::ZDCEntries_
private
std::vector<uint32_t> HcalLogicalMap::ZdcHash2Entry_
private

Definition at line 60 of file HcalLogicalMap.h.

Referenced by HcalLogicalMap().