CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

HcalLogicalMap Class Reference

#include <HcalLogicalMap.h>

List of all members.

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

                                                                   : topo_(topo)

{
  HBHEHFEntries_.resize(HBHEHFEntries.size());
  HOHXEntries_.resize(HOHXEntries.size());
  CALIBEntries_.resize(CALIBEntries.size());
  ZDCEntries_.resize(ZDCEntries.size());
  HTEntries_.resize(HTEntries.size());

  LinearIndex2Entry_.resize(LinearIndex2Entry.size());
  HbHash2Entry_.resize(HbHash2Entry.size());
  HeHash2Entry_.resize(HeHash2Entry.size());
  HfHash2Entry_.resize(HfHash2Entry.size());
  HtHash2Entry_.resize(HtHash2Entry.size());
  HoHash2Entry_.resize(HoHash2Entry.size());
  HxCalibHash2Entry_.resize(HxCalibHash2Entry.size());
  ZdcHash2Entry_.resize(ZdcHash2Entry.size());
  
  copy(HBHEHFEntries.begin(),HBHEHFEntries.end(),HBHEHFEntries_.begin());
  copy(HOHXEntries.begin(),HOHXEntries.end(),HOHXEntries_.begin());
  copy(CALIBEntries.begin(),CALIBEntries.end(),CALIBEntries_.begin());
  copy(ZDCEntries.begin(),ZDCEntries.end(),ZDCEntries_.begin());
  copy(HTEntries.begin(),HTEntries.end(),HTEntries_.begin());
  copy(LinearIndex2Entry.begin(),LinearIndex2Entry.end(),LinearIndex2Entry_.begin());
  copy(HbHash2Entry.begin(),HbHash2Entry.end(),HbHash2Entry_.begin());
  copy(HeHash2Entry.begin(),HeHash2Entry.end(),HeHash2Entry_.begin());
  copy(HfHash2Entry.begin(),HfHash2Entry.end(),HfHash2Entry_.begin());
  copy(HtHash2Entry.begin(),HtHash2Entry.end(),HtHash2Entry_.begin());
  copy(HoHash2Entry.begin(),HoHash2Entry.end(),HoHash2Entry_.begin());
  copy(HxCalibHash2Entry.begin(),HxCalibHash2Entry.end(),HxCalibHash2Entry_.begin());
  copy(ZdcHash2Entry.begin(),ZdcHash2Entry.end(),ZdcHash2Entry_.begin());
}
HcalLogicalMap::~HcalLogicalMap ( )

Definition at line 61 of file HcalLogicalMap.cc.

{
}

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

                                             {
  std::vector<int> Electronics_Hashes_;

  int numfails = 0;
  int numpass  = 0;
  int numnotdense = 0;

  cout << "\nRunning the hash checker for electronics Ids..." << endl;
  for (std::vector<HBHEHFLogicalMapEntry>::iterator it = HBHEHFEntries_.begin(); it!=HBHEHFEntries_.end(); ++it) {
    Electronics_Hashes_.push_back((it->getHcalElectronicsId()).linearIndex());
  }
  for (std::vector<ZDCLogicalMapEntry>::iterator it = ZDCEntries_.begin(); it!=ZDCEntries_.end(); ++it) {
    Electronics_Hashes_.push_back((it->getHcalElectronicsId()).linearIndex());
  }
  for (std::vector<CALIBLogicalMapEntry>::iterator it = CALIBEntries_.begin(); it!=CALIBEntries_.end(); ++it) {
    Electronics_Hashes_.push_back((it->getHcalElectronicsId()).linearIndex());
  }
  for (std::vector<HOHXLogicalMapEntry>::iterator it = HOHXEntries_.begin(); it!=HOHXEntries_.end(); ++it) {
    Electronics_Hashes_.push_back((it->getHcalElectronicsId()).linearIndex());
  }
  for (std::vector<HTLogicalMapEntry>::iterator it = HTEntries_.begin(); it!=HTEntries_.end(); ++it) {
    Electronics_Hashes_.push_back((it->getHcalTrigElectronicsId()).linearIndex());
  }

  sort(Electronics_Hashes_.begin() , Electronics_Hashes_.end());

  for(unsigned int i = 0; i<Electronics_Hashes_.size()-1; i++) {
    int diff = Electronics_Hashes_.at(i+1)-Electronics_Hashes_.at(i);
    if (diff==0) numfails++;
    else if (diff>1) numnotdense++;
    else numpass++;
  }
  cout << "Electronics Id linearIndex (pass, collisions, nondense) = (" << numpass << "," << numfails << "," << numnotdense << ")" << endl;
}
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_.

                                  {
  std::vector<int> HB_Hashes_;     // index 0
  std::vector<int> HE_Hashes_;     // index 1
  std::vector<int> HF_Hashes_;     // index 2
  std::vector<int> HO_Hashes_;     // index 3
  std::vector<int> CALIBHX_Hashes_;// index 4
  std::vector<int> ZDC_Hashes_;    // index 5
  std::vector<int> HT_Hashes_;     // index 6

  int numfails[7]    = {0,0,0,0,0,0,0};
  int numpass[7]     = {0,0,0,0,0,0,0};
  int numnotdense[7] = {0,0,0,0,0,0,0};

  cout << "\nRunning the hash checker for detIds..." << endl;
  for (std::vector<HBHEHFLogicalMapEntry>::iterator it = HBHEHFEntries_.begin(); it!=HBHEHFEntries_.end(); ++it) {
    if (it->getDetId().subdetId()==HcalBarrel) {
      HB_Hashes_.push_back(topo_->detId2denseIdHB(it->getDetId()));
    }
    else if (it->getDetId().subdetId()==HcalEndcap) {
      HE_Hashes_.push_back(topo_->detId2denseIdHE(it->getDetId()));
    }
    else if (it->getDetId().subdetId()==HcalForward) {
      HF_Hashes_.push_back(topo_->detId2denseIdHF(it->getDetId()));
    }
  }
  for (std::vector<HOHXLogicalMapEntry>::iterator it = HOHXEntries_.begin(); it!=HOHXEntries_.end(); ++it) {
    if (HcalGenericDetId(it->getDetId().rawId()).isHcalCalibDetId() ) {
      CALIBHX_Hashes_.push_back(topo_->detId2denseIdCALIB(it->getDetId()));
    }
    else {
      HO_Hashes_.push_back(topo_->detId2denseIdHO(it->getDetId()));
    }
  }
  for (std::vector<CALIBLogicalMapEntry>::iterator it = CALIBEntries_.begin(); it!=CALIBEntries_.end(); ++it) {
    CALIBHX_Hashes_.push_back(topo_->detId2denseIdCALIB(it->getDetId()));
  }
  for (std::vector<ZDCLogicalMapEntry>::iterator it = ZDCEntries_.begin(); it!=ZDCEntries_.end(); ++it) {
    ZDC_Hashes_.push_back(HcalZDCDetId(it->getDetId()).denseIndex());
  }
  for (std::vector<HTLogicalMapEntry>::iterator it = HTEntries_.begin(); it!=HTEntries_.end(); ++it) {
    HT_Hashes_.push_back(topo_->detId2denseIdHT(it->getDetId()));
  }

  sort(HB_Hashes_.begin()     , HB_Hashes_.end());
  sort(HE_Hashes_.begin()     , HE_Hashes_.end());
  sort(HF_Hashes_.begin()     , HF_Hashes_.end());
  sort(HO_Hashes_.begin()     , HO_Hashes_.end());
  sort(CALIBHX_Hashes_.begin(), CALIBHX_Hashes_.end());
  sort(ZDC_Hashes_.begin()    , ZDC_Hashes_.end());
  sort(HT_Hashes_.begin()     , HT_Hashes_.end());

  for(unsigned int i = 0; i<HB_Hashes_.size()-1; i++) {
    int diff = HB_Hashes_.at(i+1)-HB_Hashes_.at(i);
    if (diff==0) numfails[0]++;
    else if (diff>1) numnotdense[0]++;
    else numpass[0]++;
  }
  for(unsigned int i = 0; i<HE_Hashes_.size()-1; i++) {
    int diff = HE_Hashes_.at(i+1)-HE_Hashes_.at(i);
    if (diff==0) numfails[1]++;
    else if (diff>1) numnotdense[1]++;
    else numpass[1]++;
  }
  for(unsigned int i = 0; i<HF_Hashes_.size()-1; i++) {
    int diff = HF_Hashes_.at(i+1)-HF_Hashes_.at(i);
    if (diff==0) numfails[2]++;
    else if (diff>1) numnotdense[2]++;
    else numpass[2]++;
  }
  for(unsigned int i = 0; i<HO_Hashes_.size()-1; i++) {
    int diff = HO_Hashes_.at(i+1)-HO_Hashes_.at(i);
    if (diff==0) numfails[3]++;
    else if (diff>1) numnotdense[3]++;
    else numpass[3]++;
  }
  for(unsigned int i = 0; i<CALIBHX_Hashes_.size()-1; i++) {
    int diff = CALIBHX_Hashes_.at(i+1)-CALIBHX_Hashes_.at(i);
    if (diff==0) numfails[4]++;
    else if (diff>1) numnotdense[4]++;
    else numpass[4]++;
  }
  for(unsigned int i = 0; i<ZDC_Hashes_.size()-1; i++) {
    int diff = ZDC_Hashes_.at(i+1)-ZDC_Hashes_.at(i);
    if (diff==0) numfails[5]++;
    else if (diff>1) numnotdense[5]++;
    else numpass[5]++;
  }
  for(unsigned int i = 0; i<HT_Hashes_.size()-1; i++) {
    int diff = HT_Hashes_.at(i+1)-HT_Hashes_.at(i);
    if (diff==0) numfails[6]++;
    else if (diff>1) numnotdense[6]++;
    else numpass[6]++;
  }
  cout << "HB HashIds (pass, collisions, non-dense) = (" << numpass[0] << "," << numfails[0] << "," << numnotdense[0] << ")" << endl;
  cout << "HE HashIds (pass, collisions, non-dense) = (" << numpass[1] << "," << numfails[1] << "," << numnotdense[1] << ")" << endl;
  cout << "HF HashIds (pass, collisions, non-dense) = (" << numpass[2] << "," << numfails[2] << "," << numnotdense[2] << ")" << endl;
  cout << "HO HashIds (pass, collisions, non-dense) = (" << numpass[3] << "," << numfails[3] << "," << numnotdense[3] << ")" << endl;
  cout << "CALIB/HX HashIds (pass, collisions, non-dense) = (" << numpass[4] << "," << numfails[4] << "," << numnotdense[4] << ")" << endl;
  cout << "ZDC HashIds (pass, collisions, non-dense) = (" << numpass[5] << "," << numfails[5] << "," << numnotdense[5] << ")" << endl;
  cout << "HT HashIds (pass, collisions, non-dense) = (" << numpass[6] << "," << numfails[6] << "," << numnotdense[6] << ")" << endl;
}
void HcalLogicalMap::checkIdFunctions ( )

Definition at line 303 of file HcalLogicalMap.cc.

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

                                      {
  int HBHEHF_EID_pass=0;
  int HBHEHF_EID_fail=0;
  int HOHX_EID_pass=0;
  int HOHX_EID_fail=0;
  int CALIB_EID_pass=0;
  int CALIB_EID_fail=0;
  int ZDC_EID_pass=0;
  int ZDC_EID_fail=0;

  int HBHEHF_FEID_pass=0;
  int HBHEHF_FEID_fail=0;
  int HOHX_FEID_pass=0;
  int HOHX_FEID_fail=0;
  int CALIB_FEID_pass=0;
  int CALIB_FEID_fail=0;

  cout << "\nRunning the id function checker..." << endl;

  for (std::vector<HBHEHFLogicalMapEntry>::iterator it = HBHEHFEntries_.begin(); it!=HBHEHFEntries_.end(); ++it) {
    const HcalElectronicsId heid=it->getHcalElectronicsId();
    const DetId did0=it->getDetId();
    const DetId did1=getDetId(heid);
    if (did0==did1) HBHEHF_EID_pass++;
    else HBHEHF_EID_fail++;

    const HcalFrontEndId hfeid0=it->getHcalFrontEndId();
    const HcalFrontEndId hfeid1=getHcalFrontEndId(did0);
    if (hfeid0==hfeid1) HBHEHF_FEID_pass++;
    else HBHEHF_FEID_fail++;
  }
  for (std::vector<HOHXLogicalMapEntry>::iterator it = HOHXEntries_.begin(); it!=HOHXEntries_.end(); ++it) {
    const HcalElectronicsId heid=it->getHcalElectronicsId();
    const DetId did0=it->getDetId();
    const DetId did1=getDetId(heid);
    if (did0==did1) HOHX_EID_pass++;
    else HOHX_EID_fail++;

    const HcalFrontEndId hfeid0=it->getHcalFrontEndId();
    const HcalFrontEndId hfeid1=getHcalFrontEndId(did0);
    if (hfeid0==hfeid1) HOHX_FEID_pass++;
    else HOHX_FEID_fail++;
  }
  for (std::vector<CALIBLogicalMapEntry>::iterator it = CALIBEntries_.begin(); it!=CALIBEntries_.end(); ++it) {
    const HcalElectronicsId heid=it->getHcalElectronicsId();
    const DetId did0=it->getDetId();
    const DetId did1=getDetId(heid);
    if (did0==did1) CALIB_EID_pass++;
    else CALIB_EID_fail++;

    const HcalFrontEndId hfeid0=it->getHcalFrontEndId();
    const HcalFrontEndId hfeid1=getHcalFrontEndId(did0);
    if (hfeid0==hfeid1) CALIB_FEID_pass++;
    else CALIB_FEID_fail++;
  }
  for (std::vector<ZDCLogicalMapEntry>::iterator it = ZDCEntries_.begin(); it!=ZDCEntries_.end(); ++it) {
    const HcalElectronicsId heid=it->getHcalElectronicsId();
    const DetId did0=it->getDetId();
    const DetId did1=getDetId(heid);
    if (did0==did1) ZDC_EID_pass++;
    else ZDC_EID_fail++;
  }
  
  cout << "Checking detIds from electronics ids..." << endl;
  cout << "HBHEHF EID (pass,fail) = (" << HBHEHF_EID_pass << "," << HBHEHF_EID_fail << ")" << endl;
  cout << "HOHX EID (pass,fail) = (" << HOHX_EID_pass << "," << HOHX_EID_fail << ")" << endl;
  cout << "CALIB EID (pass,fail) = (" << CALIB_EID_pass << "," << CALIB_EID_fail << ")" << endl;
  cout << "ZDC EID (pass,fail) = (" << ZDC_EID_pass << "," << ZDC_EID_fail << ")" << endl;
  cout << endl;
  cout << "Checking frontEndIds from electronics ids..." << endl;
  cout << "HBHEHF FEID (pass,fail) = (" << HBHEHF_FEID_pass << "," << HBHEHF_FEID_fail << ")" << endl;
  cout << "HOHX FEID (pass,fail) = (" << HOHX_FEID_pass << "," << HOHX_FEID_fail << ")" << endl;
  cout << "CALIB FEID (pass,fail) = (" << CALIB_FEID_pass << "," << CALIB_FEID_fail << ")" << endl;
}
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().

{
  HcalElectronicsMap* theemap = new HcalElectronicsMap();
  
  for (std::vector<HBHEHFLogicalMapEntry>::iterator it = HBHEHFEntries_.begin(); it!=HBHEHFEntries_.end(); ++it) {
    theemap->mapEId2chId( it->getHcalElectronicsId(), it->getDetId() );}
  for (std::vector<HOHXLogicalMapEntry>::iterator it = HOHXEntries_.begin(); it!=HOHXEntries_.end(); ++it) {
    theemap->mapEId2chId( it->getHcalElectronicsId(), it->getDetId() );}
  for (std::vector<CALIBLogicalMapEntry>::iterator it = CALIBEntries_.begin(); it!=CALIBEntries_.end(); ++it) {
    theemap->mapEId2chId( it->getHcalElectronicsId(), it->getDetId() );}
  for (std::vector<ZDCLogicalMapEntry>::iterator it = ZDCEntries_.begin(); it!=ZDCEntries_.end(); ++it) {
    theemap->mapEId2chId( it->getHcalElectronicsId(), it->getDetId() );}
  for (std::vector<HTLogicalMapEntry>::iterator it = HTEntries_.begin(); it!=HTEntries_.end(); ++it) {
    theemap->mapEId2tId( it->getHcalTrigElectronicsId(), it->getDetId() );}
  theemap->sort();
  return *theemap;
}
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().

{
  const uint32_t entry=LinearIndex2Entry_.at(eid.linearIndex());
  if ( !(entry&0x1) ) return DetId(0);
  if ( ((entry>>1)&0x3)==0) return HBHEHFEntries_.at(entry>>3).getDetId();
  if ( ((entry>>1)&0x3)==1) return HOHXEntries_.at(entry>>3).getDetId();
  if ( ((entry>>1)&0x3)==2) return CALIBEntries_.at(entry>>3).getDetId();
  if ( ((entry>>1)&0x3)==3) return ZDCEntries_.at(entry>>3).getDetId();
  return DetId(0);
}
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().

{
  const HcalGenericDetId hgdi(did);
  
  const HcalGenericDetId::HcalGenericSubdetector hgsd=hgdi.genericSubdet();
  if (hgsd==HcalGenericDetId::HcalGenBarrel) {
    const int hashedId=topo_->detId2denseIdHB(did);
    const uint32_t entry=HbHash2Entry_.at(hashedId)-1;
    return HBHEHFEntries_.at(entry).getHcalFrontEndId();
  }
  else if (hgsd==HcalGenericDetId::HcalGenEndcap) {
    const int hashedId=topo_->detId2denseIdHE(did);
    const uint32_t entry=HeHash2Entry_.at(hashedId)-1;
    return HBHEHFEntries_.at(entry).getHcalFrontEndId();
  }
  else if (hgsd==HcalGenericDetId::HcalGenForward) {
    const int hashedId=topo_->detId2denseIdHF(did);
    const uint32_t entry=HfHash2Entry_.at(hashedId)-1;
    return HBHEHFEntries_.at(entry).getHcalFrontEndId();
  }
  else if (hgsd==HcalGenericDetId::HcalGenOuter) {
    const int hashedId=topo_->detId2denseIdHO(did);
    const uint32_t entry=HoHash2Entry_.at(hashedId)-1;
    return HOHXEntries_.at(entry).getHcalFrontEndId();
  }
  else if (hgsd==HcalGenericDetId::HcalGenCalibration) {
    HcalCalibDetId hcid(did);
    if (hcid.calibFlavor()==HcalCalibDetId::HOCrosstalk) {
      const int hashedId=topo_->detId2denseIdCALIB(did);
      const uint32_t entry=HxCalibHash2Entry_.at(hashedId)-1;
      return HOHXEntries_.at(entry).getHcalFrontEndId();
    }
    else if (hcid.calibFlavor()==HcalCalibDetId::CalibrationBox) {
      const int hashedId=topo_->detId2denseIdCALIB(did);
      const uint32_t entry=HxCalibHash2Entry_.at(hashedId)-1;
      return CALIBEntries_.at(entry).getHcalFrontEndId();
    }
  }
  return HcalFrontEndId(0);
}
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().

{
  uint32_t answer=0;
  answer|=isvalid;
  answer|=(vectorid&0x3)<<1;
  answer|=entry<<3;
  return answer;
}
void HcalLogicalMap::printCalibMap ( FILE *  calibmapfile) [private]

Definition at line 204 of file HcalLogicalMap.cc.

References CALIBEntries_.

Referenced by printMap().

                                                    {

  int titlecounter = 0;

  for (std::vector<CALIBLogicalMapEntry>::iterator it = CALIBEntries_.begin(); it!=CALIBEntries_.end(); ++it) {
    titlecounter = titlecounter % 21;
    if (titlecounter == 0){       
      fprintf(calibmapfile,"#   side    eta    phi   dphi    det     rbx  sector  rm  rm_fi ");
      fprintf(calibmapfile," fi_ch  crate  htr  fpga  htr_fi  dcc_sl  spigo  dcc  fedid  ch_type      name\n");
    }
    titlecounter++;
    fprintf(calibmapfile,"%s",it->printLMapLine());
  }
}
void HcalLogicalMap::printHBEFMap ( FILE *  hbefmapfile) [private]

Definition at line 174 of file HcalLogicalMap.cc.

References HBHEHFEntries_.

Referenced by printMap().

                                                  {
  int titlecounter = 0;

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

Definition at line 189 of file HcalLogicalMap.cc.

References HOHXEntries_.

Referenced by printMap().

                                                {

  int titlecounter = 0;

  for (std::vector<HOHXLogicalMapEntry>::iterator it = HOHXEntries_.begin(); it!=HOHXEntries_.end(); ++it) {
    titlecounter = titlecounter % 21;
    if (titlecounter == 0){
      fprintf(hoxmapfile,"#   side    eta    phi   dphi  depth    det     rbx  sector    rm  pixel   qie    adc");
      fprintf(hoxmapfile,"  rm_fi  fi_ch let_code  crate    htr   fpga  htr_fi  dcc_sl  spigo    dcc  fedid\n");
    }
    titlecounter++;
    fprintf(hoxmapfile,"%s",it->printLMapLine());
  }    
}
void HcalLogicalMap::printHTMap ( FILE *  htmapfile) [private]

Definition at line 234 of file HcalLogicalMap.cc.

References HTEntries_.

Referenced by printMap().

                                              {

  int titlecounter = 0;

  for (std::vector<HTLogicalMapEntry>::iterator it = HTEntries_.begin(); it!=HTEntries_.end(); ++it) {
    titlecounter = titlecounter % 21;
      if (titlecounter == 0){
        fprintf(htmapfile,"#  side  eta  phi  dphi  depth  det   wedge  crate");
        fprintf(htmapfile,"  htr  fpga  dcc_sl  spigo  dcc  slb  slbin  slbin2  nDat    ");
        fprintf(htmapfile,"     slnam  rctcra  rctcar  rctcon            rctnam  fedid\n");
      }
    titlecounter++;
    fprintf(htmapfile,"%s",it->printLMapLine());
  }
}
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.

                                                  {  
  using namespace std;

  static FILE* HBEFmap; 
  static FILE* HOXmap;
  static FILE* CALIBmap; 
  static FILE* ZDCmap; 
  static FILE* HTmap;  
  
  char tempbuff[30];

  stringstream mystream;
  string HBEFmapstr, HOXmapstr, CALIBmapstr, ZDCmapstr, HTmapstr;
  string date;
  string IOVlabel;
  
  time_t myTime;
  time(&myTime);
  
  strftime(tempbuff,128,"%d.%b.%Y",localtime(&myTime) );
  mystream<<tempbuff;
  date= mystream.str();

  mystream.str("");
  if      (mapIOV==1) IOVlabel = "A";
  else if (mapIOV==2) IOVlabel = "B";
  else if (mapIOV==3) IOVlabel = "C";
  else                IOVlabel = "D";

  HBEFmapstr  = "./HCALmapHBEF_"+IOVlabel+".txt";
  HOXmapstr   = "./HCALmapHO_"+IOVlabel+".txt";
  CALIBmapstr = "./HCALmapCALIB_"+IOVlabel+".txt";
  ZDCmapstr   = "./ZDCmap_"+IOVlabel+".txt";
  HTmapstr    = "./HCALmapHT_"+IOVlabel+".txt";

//  HBEFmapstr  = "./HCALmapHBEF_"+date+".txt";
//  HOXmapstr   = "./HCALmapHO_"+date+"_"+IOVlabel+".txt";
//  CALIBmapstr = "./HCALmapCALIB_"+date+".txt";
//  ZDCmapstr   = "./ZDCmap_"+date+".txt";
//  HTmapstr    = "./HCALmapHT_"+date+".txt";
  
  HBEFmap     = fopen(HBEFmapstr.c_str(),"w");
  HOXmap      = fopen(HOXmapstr.c_str(),"w");
  CALIBmap    = fopen(CALIBmapstr.c_str(),"w");
  ZDCmap      = fopen(ZDCmapstr.c_str(),"w");
  HTmap       = fopen(HTmapstr.c_str(),"w");
  /**********************/

  if(HBEFmap) {
    fprintf(HBEFmap,"## file created %s ##\n",date.c_str());
    printHBEFMap(HBEFmap);
  }
  else cout <<HBEFmapstr<<" not found!"<<endl;

  if(HOXmap) {
    fprintf(HOXmap,"## file created %s ##\n",date.c_str());
    printHOXMap(HOXmap);
  }
  else cout <<HOXmapstr<<" not found!"<<endl;

  if(CALIBmap) {
    fprintf(CALIBmap,"## file created %s ##\n",date.c_str());
    printCalibMap(CALIBmap);
  }
  else cout <<CALIBmapstr<<" not found!"<<endl;

  if(ZDCmap) {
    fprintf(ZDCmap,"## file created %s ##\n",date.c_str());
    printZDCMap(ZDCmap);
  }
  else cout <<ZDCmapstr<<" not found!"<<endl;

  if(HTmap) {
    fprintf(HTmap,"## file created %s ##\n",date.c_str());
    printHTMap(HTmap);
  }
  else cout <<HTmapstr<<" not found!"<<endl;

}
void HcalLogicalMap::printZDCMap ( FILE *  zdcmapfile) [private]

Definition at line 219 of file HcalLogicalMap.cc.

References ZDCEntries_.

Referenced by printMap().

                                                {

  int titlecounter = 0;

  for (std::vector<ZDCLogicalMapEntry>::iterator it = ZDCEntries_.begin(); it!=ZDCEntries_.end(); ++it) {
    titlecounter = titlecounter % 21;
    if (titlecounter == 0){
      fprintf(zdcmapfile,"#  side  x  y  dx  depth     det  det_ch  cable  rm  qie ");
      fprintf(zdcmapfile," adc  rm_fi  fi_ch  crate  htr  fpga  htr_fi  dcc_sl  spigo  dcc  fedid\n");
    }
    titlecounter++;
    fprintf(zdcmapfile,"%s",it->printLMapLine());
  }
}

Member Data Documentation

std::vector<uint32_t> HcalLogicalMap::HbHash2Entry_ [private]

Definition at line 54 of file HcalLogicalMap.h.

Referenced by getHcalFrontEndId(), and HcalLogicalMap().

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

Definition at line 62 of file HcalLogicalMap.h.

Referenced by checkHashIds(), and getHcalFrontEndId().

std::vector<uint32_t> HcalLogicalMap::ZdcHash2Entry_ [private]

Definition at line 60 of file HcalLogicalMap.h.

Referenced by HcalLogicalMap().