CMS 3D CMS Logo

Classes | Functions
hgcal::mappingtools Namespace Reference

Classes

class  HGCalEntityList
 

Functions

uint16_t getEcondErx (uint16_t chip, uint16_t half)
 
uint32_t getElectronicsId (bool zside, uint16_t fedid, uint16_t captureblock, uint16_t econdidx, int cellchip, int cellhalf, int cellseq)
 
template<class T1 , class T2 >
uint32_t getElectronicsIdForSiCell (const T1 &modules, const T2 &cells, uint32_t detid)
 after getting the module/cell indices it returns the sum of the corresponding electronics ids More...
 
template<class T1 , class T2 >
std::pair< int32_t, int32_t > getModuleCellIndicesForSiCell (const T1 &modules, const T2 &cells, uint32_t detid)
 matches the module and cell info by detId and returns their indices (-1 is used in case index was not found) More...
 
uint32_t getSiDetId (bool zside, int moduleplane, int moduleu, int modulev, int celltype, int celliu, int celliv)
 
uint32_t getSiPMDetId (bool zside, int moduleplane, int modulev, int celltype, int celliu, int celliv)
 

Function Documentation

◆ getEcondErx()

uint16_t hgcal::mappingtools::getEcondErx ( uint16_t  chip,
uint16_t  half 
)

Definition at line 34 of file HGCalMappingTools.cc.

Referenced by getElectronicsId().

34 { return chip * 2 + half; }

◆ getElectronicsId()

uint32_t hgcal::mappingtools::getElectronicsId ( bool  zside,
uint16_t  fedid,
uint16_t  captureblock,
uint16_t  econdidx,
int  cellchip,
int  cellhalf,
int  cellseq 
)

Definition at line 37 of file HGCalMappingTools.cc.

References PixelSLinkDataInputSource_cfi::fedid, getEcondErx(), HGCalElectronicsId::raw(), and ecaldqm::zside().

Referenced by EcalElectronicsMapping::getDCCandSC(), EcalElectronicsMapping::getDetId(), EcalElectronicsMapping::getLMNumber(), and EcalElectronicsMapping::getTriggerElectronicsId().

38  {
39  uint16_t econderx = getEcondErx(cellchip, cellhalf);
40 
41  return HGCalElectronicsId(zside, fedid, captureblock, econdidx, econderx, cellseq).raw();
42  }
uint32_t raw() const
int zside(DetId const &)
uint16_t getEcondErx(uint16_t chip, uint16_t half)
wrapper for a 32b data word identifying a readout channel in the raw data The format is the following...

◆ getElectronicsIdForSiCell()

template<class T1 , class T2 >
uint32_t hgcal::mappingtools::getElectronicsIdForSiCell ( const T1 &  modules,
const T2 &  cells,
uint32_t  detid 
)

after getting the module/cell indices it returns the sum of the corresponding electronics ids

Definition at line 107 of file HGCalMappingTools.h.

References hgcalTBTopologyTester_cfi::cells, heavyIonCSV_trainingSettings::idx, and LogMessageMonitor_cff::modules.

107  {
108  std::pair<int32_t, int32_t> idx = getModuleCellIndicesForSiCell<T1, T2>(modules, cells, detid);
109  if (idx.first < 0 || idx.first < 0)
110  return 0;
111  return modules.view()[idx.first].eleid() + cells.view()[idx.second].eleid();
112  }

◆ getModuleCellIndicesForSiCell()

template<class T1 , class T2 >
std::pair<int32_t, int32_t> hgcal::mappingtools::getModuleCellIndicesForSiCell ( const T1 &  modules,
const T2 &  cells,
uint32_t  detid 
)

matches the module and cell info by detId and returns their indices (-1 is used in case index was not found)

Definition at line 69 of file HGCalMappingTools.h.

References hgcalTBTopologyTester_cfi::cells, HGCSiliconDetId::cellU(), HGCSiliconDetId::cellV(), mps_fire::i, dqmiolumiharvest::j, submitPVResolutionJobs::key, HGCSiliconDetId::moduleId(), DetId::rawId(), and nano_mu_digi_cff::rawId.

69  {
70  std::pair<int32_t, int32_t> key(-1, -1);
71 
72  //get the module and cell parts of the id
73  HGCSiliconDetId siid(detid);
74 
75  // match module det id
76  uint32_t modid = siid.moduleId().rawId();
77  for (int i = 0; i < modules.view().metadata().size(); i++) {
78  auto imod = modules.view()[i];
79  if (imod.detid() != modid)
80  continue;
81 
82  key.first = i;
83 
84  //match cell by type of module and by cell det id
85  DetId::Detector det(DetId::Detector::HGCalEE);
86  uint32_t cellid = 0x3ff & HGCSiliconDetId(det, 0, 0, 0, 0, 0, siid.cellU(), siid.cellV()).rawId();
87  for (int j = 0; j < cells.view().metadata().size(); j++) {
88  auto jcell = cells.view()[j];
89  if (jcell.typeidx() != imod.typeidx())
90  continue;
91  if (jcell.detid() != cellid)
92  continue;
93  key.second = j;
94  return key;
95  }
96 
97  return key;
98  }
99 
100  return key;
101  }
key
prepare the HTCondor submission files and eventually submit them
Detector
Definition: DetId.h:24

◆ getSiDetId()

uint32_t hgcal::mappingtools::getSiDetId ( bool  zside,
int  moduleplane,
int  moduleu,
int  modulev,
int  celltype,
int  celliu,
int  celliv 
)

Definition at line 45 of file HGCalMappingTools.cc.

References DetId::rawId(), and ecaldqm::zside().

45  {
46  DetId::Detector det = moduleplane <= 26 ? DetId::Detector::HGCalEE : DetId::Detector::HGCalHSi;
47  int zp(zside ? 1 : -1);
48 
49  return HGCSiliconDetId(det, zp, celltype, moduleplane, moduleu, modulev, celliu, celliv).rawId();
50  }
int zside(DetId const &)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Detector
Definition: DetId.h:24

◆ getSiPMDetId()

uint32_t hgcal::mappingtools::getSiPMDetId ( bool  zside,
int  moduleplane,
int  modulev,
int  celltype,
int  celliu,
int  celliv 
)

Definition at line 53 of file HGCalMappingTools.cc.

References hcalRecHitTable_cff::iphi, DetId::rawId(), relativeConstraints::ring, and ecaldqm::zside().

53  {
54  int layer = moduleplane - 25;
55  int type = 0; // depends on SiPM size to be updated with new geometry
56 
57  int ring = (zside ? celliu : (-1) * celliu);
58  int iphi = modulev * 8 + celliv + 1;
59 
60  return HGCScintillatorDetId(type, layer, ring, iphi, false, celltype).rawId();
61  }
int zside(DetId const &)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57