CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
HGCalTriggerTools Class Reference

#include <HGCalTriggerTools.h>

Public Types

enum  SubDetectorType { hgcal_silicon_CEE, hgcal_silicon_CEH, hgcal_scintillator }
 

Public Member Functions

template<typename T >
std::vector< TbxVectorToVector (const BXVector< T > &inputBXVector)
 
void eventSetup (const edm::EventSetup &)
 
float getEta (const GlobalPoint &position, const float &vertex_z=0.) const
 
float getLayerZ (const int &subdet, const unsigned &layer) const
 
float getLayerZ (const unsigned &layerWithOffset) const
 
float getPhi (const GlobalPoint &position) const
 
float getPt (const GlobalPoint &position, const float &hitEnergy, const float &vertex_z=0.) const
 
SubDetectorType getSubDetectorType (const DetId &id) const
 
float getTCEta (const DetId &id, const float &vertex_z=0.) const
 
float getTCPhi (const DetId &id) const
 
GlobalPoint getTCPosition (const DetId &id) const
 
float getTCPt (const DetId &id, const float &hitEnergy, const float &vertex_z=0.) const
 
const HGCalTriggerGeometryBasegetTriggerGeometry () const
 
 HGCalTriggerTools ()
 
bool isEm (const DetId &) const
 
bool isHad (const DetId &id) const
 
bool isNose (const DetId &) const
 
bool isScintillator (const DetId &id) const
 
bool isSilicon (const DetId &) const
 
unsigned lastLayerBH () const
 
unsigned lastLayerEE () const
 
unsigned lastLayerFH () const
 
unsigned lastLayerNose () const
 
unsigned layer (const DetId &) const
 
unsigned layers (DetId::Detector type) const
 
unsigned layers (ForwardSubdetector type) const
 
unsigned layerWithOffset (const DetId &) const
 
DetId simToReco (const DetId &, const HcalTopology &) const
 
DetId simToReco (const DetId &, const HGCalTopology &) const
 
int thicknessIndex (const DetId &, bool tc=false) const
 
unsigned triggerLayer (const unsigned id) const
 
int zside (const DetId &) const
 
 ~HGCalTriggerTools ()
 

Static Public Attributes

static constexpr unsigned kScintillatorPseudoThicknessIndex_ = 3
 

Private Member Functions

int sensorCellThicknessV8 (const DetId &id) const
 

Private Attributes

unsigned bhLayers_
 
unsigned eeLayers_
 
unsigned fhLayers_
 
const HGCalTriggerGeometryBasegeom_
 
unsigned noseLayers_
 
unsigned totalLayers_
 

Detailed Description

Tools for handling HGCal trigger det-ID: in the current version of trhe HGCAL simulation only HGCalDetId for the TriggerCells (TC) are used and not HcalDetId as in the offline! As a consequence the class assumes that only DetIds of the first kind are used in the getTC* methods NOTE: this uses the trigger geometry hence would give wrong results when used for offline reco!!!!

Author
G. Cerminara (CERN), heavily "inspired" by HGCalRechHitTools ;)

Definition at line 32 of file HGCalTriggerTools.h.

Member Enumeration Documentation

◆ SubDetectorType

Enumerator
hgcal_silicon_CEE 
hgcal_silicon_CEH 
hgcal_scintillator 

Definition at line 88 of file HGCalTriggerTools.h.

88  {
92  };

Constructor & Destructor Documentation

◆ HGCalTriggerTools()

HGCalTriggerTools::HGCalTriggerTools ( )
inline

Definition at line 34 of file HGCalTriggerTools.h.

34 : geom_(nullptr), eeLayers_(0), fhLayers_(0), bhLayers_(0), noseLayers_(0), totalLayers_(0) {}

◆ ~HGCalTriggerTools()

HGCalTriggerTools::~HGCalTriggerTools ( )
inline

Definition at line 35 of file HGCalTriggerTools.h.

35 {}

Member Function Documentation

◆ bxVectorToVector()

template<typename T >
std::vector<T> HGCalTriggerTools::bxVectorToVector ( const BXVector< T > &  inputBXVector)
inline

Definition at line 75 of file HGCalTriggerTools.h.

75  {
76  std::vector<T> outputVector;
77  // loop over collection for a given bx and put the objects into a std::vector
78  outputVector.insert(outputVector.end(), inputBXVector.begin(0), inputBXVector.end(0));
79  return outputVector;
80  }

References BXVector< T >::begin(), and BXVector< T >::end().

◆ eventSetup()

void HGCalTriggerTools::eventSetup ( const edm::EventSetup es)

Definition at line 35 of file HGCalTriggerTools.cc.

35  {
37  es.get<CaloGeometryRecord>().get(triggerGeometry_);
38  geom_ = triggerGeometry_.product();
39 
44 
45  if (geom_->isV9Geometry()) {
48  } else {
51  }
52 }

References bhLayers_, HGCalTriggerGeometryBase::bhTopology(), HGCalTopology::dddConstants(), HcalTopology::dddConstants(), eeLayers_, HGCalTriggerGeometryBase::eeTopology(), fhLayers_, HGCalTriggerGeometryBase::fhTopology(), geom_, edm::EventSetup::get(), get, HcalDDDRecConstants::getMaxDepth(), HGCalTriggerGeometryBase::hscTopology(), HGCalTriggerGeometryBase::isV9Geometry(), HGCalTriggerGeometryBase::isWithNoseGeometry(), HGCalDDDConstants::layers(), noseLayers_, HGCalTriggerGeometryBase::noseTopology(), edm::ESHandle< T >::product(), and totalLayers_.

Referenced by HGCalTriggerValidator::analyze(), HGCalTriggerClusterInterpretationEM::eventSetup(), HGCalTriggerCellCalibration::eventSetup(), HGCalVFESummationImpl::eventSetup(), HGCalConcentratorCoarsenerImpl::eventSetup(), HGCalClusteringDummyImpl::eventSetup(), HGCalConcentratorThresholdImpl::eventSetup(), HGCalCoarseTriggerCellMapping::eventSetup(), HGCalConcentratorTrigSumImpl::eventSetup(), HGCalMulticlusteringImpl::eventSetup(), HGCalHistoClusteringImpl::eventSetup(), HGCalConcentratorBestChoiceImpl::eventSetup(), HGCalConcentratorSuperTriggerCellImpl::eventSetup(), HGCalShowerShape::eventSetup(), HGCalClusteringImpl::eventSetup(), HGCalTriggerTowerGeometryHelper::eventSetup(), HGCalTowerMap2DImpl::eventSetup(), HGCalHistoSeedingImpl::eventSetup(), HGCalTriggerNtupleHGCClusters::fill(), HGCalTriggerNtupleHGCTriggerSums::fill(), HGCalTriggerNtupleHGCDigis::fill(), HGCalTriggerNtupleHGCTriggerCells::fill(), HGCalTriggerNtupleGen::fill(), CaloTruthCellsProducer::produce(), HGCalVFEProcessorSums::run(), and HGCalConcentratorProcessorSelection::run().

◆ getEta()

float HGCalTriggerTools::getEta ( const GlobalPoint position,
const float &  vertex_z = 0. 
) const

Definition at line 281 of file HGCalTriggerTools.cc.

281  {
282  GlobalPoint corrected_position = GlobalPoint(position.x(), position.y(), position.z() - vertex_z);
283  return corrected_position.eta();
284 }

References PV3DBase< T, PVType, FrameType >::eta(), and position.

Referenced by getPt(), and getTCEta().

◆ getLayerZ() [1/2]

float HGCalTriggerTools::getLayerZ ( const int &  subdet,
const unsigned &  layer 
) const

Definition at line 326 of file HGCalTriggerTools.cc.

326  {
327  float layerGlobalZ = 0.;
328  if ((subdet == ForwardSubdetector::HGCEE) || (subdet == DetId::HGCalEE)) {
329  layerGlobalZ = geom_->eeTopology().dddConstants().waferZ(layer, true);
330  } else if ((subdet == ForwardSubdetector::HGCHEF) || (subdet == DetId::HGCalHSi)) {
331  layerGlobalZ = geom_->fhTopology().dddConstants().waferZ(layer, true);
332  } else if (subdet == ForwardSubdetector::HFNose) {
333  layerGlobalZ = geom_->noseTopology().dddConstants().waferZ(layer, true);
334  } else if ((subdet == HcalSubdetector::HcalEndcap) || (subdet == ForwardSubdetector::HGCHEB) ||
335  (subdet == DetId::HGCalHSc)) {
336  if (geom_->isV9Geometry()) {
337  layerGlobalZ = geom_->hscTopology().dddConstants().waferZ(layer, true);
338  } else {
339  layerGlobalZ = geom_->bhTopology().dddConstants()->getRZ(
341  }
342  }
343  return layerGlobalZ;
344 }

References HGCalTriggerGeometryBase::bhTopology(), HGCalTopology::dddConstants(), HcalTopology::dddConstants(), HGCalTriggerGeometryBase::eeTopology(), HGCalTriggerGeometryBase::fhTopology(), geom_, HcalDDDRecConstants::getEtaRange(), HcalDDDRecConstants::getRZ(), HcalEndcap, HFNose, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCEE, HGCHEB, HGCHEF, HGCalTriggerGeometryBase::hscTopology(), HGCalTriggerGeometryBase::isV9Geometry(), layer(), HGCalTriggerGeometryBase::noseTopology(), and HGCalDDDConstants::waferZ().

◆ getLayerZ() [2/2]

float HGCalTriggerTools::getLayerZ ( const unsigned &  layerWithOffset) const

Definition at line 312 of file HGCalTriggerTools.cc.

312  {
313  int subdet = ForwardSubdetector::HGCEE;
314  unsigned offset = 0;
317  offset = lastLayerEE();
318  } else if (layerWithOffset > lastLayerFH()) {
320  offset = lastLayerFH();
321  }
322  // note for HFnose offset is always zero since we have less layers than HGCEE
323  return getLayerZ(subdet, layerWithOffset - offset);
324 }

References HcalEndcap, HGCEE, HGCHEF, lastLayerEE(), lastLayerFH(), layerWithOffset(), and hltrates_dqm_sourceclient-live_cfg::offset.

Referenced by HGCalTriggerNtupleGen::fill().

◆ getPhi()

float HGCalTriggerTools::getPhi ( const GlobalPoint position) const

Definition at line 291 of file HGCalTriggerTools.cc.

291  {
292  float phi = atan2(position.y(), position.x());
293  return phi;
294 }

References phi, and position.

Referenced by getTCPhi().

◆ getPt()

float HGCalTriggerTools::getPt ( const GlobalPoint position,
const float &  hitEnergy,
const float &  vertex_z = 0. 
) const

Definition at line 301 of file HGCalTriggerTools.cc.

301  {
302  float eta = getEta(position, vertex_z);
303  float pt = hitEnergy / cosh(eta);
304  return pt;
305 }

References PVValHelper::eta, getEta(), position, and DiDispStaMuonMonitor_cfi::pt.

Referenced by getTCPt().

◆ getSubDetectorType()

HGCalTriggerTools::SubDetectorType HGCalTriggerTools::getSubDetectorType ( const DetId id) const

◆ getTCEta()

float HGCalTriggerTools::getTCEta ( const DetId id,
const float &  vertex_z = 0. 
) const

Definition at line 286 of file HGCalTriggerTools.cc.

286  {
288  return getEta(position, vertex_z);
289 }

References getEta(), getTCPosition(), and position.

◆ getTCPhi()

float HGCalTriggerTools::getTCPhi ( const DetId id) const

Definition at line 296 of file HGCalTriggerTools.cc.

296  {
298  return getPhi(position);
299 }

References getPhi(), getTCPosition(), and position.

◆ getTCPosition()

GlobalPoint HGCalTriggerTools::getTCPosition ( const DetId id) const

Definition at line 54 of file HGCalTriggerTools.cc.

54  {
55  if (id.det() == DetId::Hcal || id.det() == DetId::HGCalEE) {
56  throw cms::Exception("hgcal::HGCalTriggerTools") << "method getTCPosition called for DetId not belonging to a TC";
57  // FIXME: this would actually need a better test...but at the moment I can not think to anything better
58  // to distinguish a TC detId
59  }
60 
62  return position;
63 }

References Exception, geom_, HGCalTriggerGeometryBase::getTriggerCellPosition(), DetId::Hcal, DetId::HGCalEE, and position.

Referenced by HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosition(), HGCalCoarseTriggerCellMapping::getCoarseTriggerCellPosition(), getTCEta(), getTCPhi(), and getTCPt().

◆ getTCPt()

float HGCalTriggerTools::getTCPt ( const DetId id,
const float &  hitEnergy,
const float &  vertex_z = 0. 
) const

Definition at line 307 of file HGCalTriggerTools.cc.

307  {
309  return getPt(position, hitEnergy, vertex_z);
310 }

References getPt(), getTCPosition(), and position.

◆ getTriggerGeometry()

const HGCalTriggerGeometryBase* HGCalTriggerTools::getTriggerGeometry ( ) const
inline

◆ isEm()

bool HGCalTriggerTools::isEm ( const DetId id) const

Definition at line 151 of file HGCalTriggerTools.cc.

151  {
152  bool em = false;
153 
154  if (id.det() == DetId::Forward && id.subdetId() != ForwardSubdetector::HFNose) {
155  em = (id.subdetId() == HGCEE);
156  } else if (id.det() == DetId::Forward && id.subdetId() == ForwardSubdetector::HFNose) {
157  em = HFNoseDetId(id).isEE();
158  } else if (id.det() == DetId::HGCalEE) {
159  em = true;
160  } else if (id.det() == DetId::HGCalTrigger &&
162  em = true;
163  } else if (id.det() == DetId::HGCalTrigger &&
165  em = HFNoseTriggerDetId(id).isEE();
166  }
167  return em;
168 }

References DetId::Forward, HFNose, HFNoseTrigger, DetId::HGCalEE, HGCalEETrigger, DetId::HGCalTrigger, HGCEE, HFNoseTriggerDetId::isEE(), and HFNoseDetId::isEE().

Referenced by HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosition(), HGCalTriggerNtupleHGCTriggerCells::fill(), HGCalHistoSeedingImpl::fillHistoClusters(), getSubDetectorType(), isHad(), HGCalVFEProcessorSums::run(), and HGCalConcentratorProcessorSelection::run().

◆ isHad()

bool HGCalTriggerTools::isHad ( const DetId id) const
inline

Definition at line 44 of file HGCalTriggerTools.h.

44 { return !isEm(id); }

References isEm().

Referenced by layerWithOffset().

◆ isNose()

bool HGCalTriggerTools::isNose ( const DetId id) const

◆ isScintillator()

bool HGCalTriggerTools::isScintillator ( const DetId id) const
inline

◆ isSilicon()

bool HGCalTriggerTools::isSilicon ( const DetId id) const

◆ lastLayerBH()

unsigned HGCalTriggerTools::lastLayerBH ( ) const
inline

◆ lastLayerEE()

unsigned HGCalTriggerTools::lastLayerEE ( ) const
inline

Definition at line 54 of file HGCalTriggerTools.h.

54 { return eeLayers_; }

References eeLayers_.

Referenced by HGCalTowerMap2DImpl::buildTowerMap2D(), getLayerZ(), and HGCalTowerMap2DImpl::newTowerMaps().

◆ lastLayerFH()

unsigned HGCalTriggerTools::lastLayerFH ( ) const
inline

Definition at line 55 of file HGCalTriggerTools.h.

55 { return eeLayers_ + fhLayers_; }

References eeLayers_, and fhLayers_.

Referenced by getLayerZ().

◆ lastLayerNose()

unsigned HGCalTriggerTools::lastLayerNose ( ) const
inline

Definition at line 57 of file HGCalTriggerTools.h.

57 { return noseLayers_; }

References noseLayers_.

◆ layer()

unsigned HGCalTriggerTools::layer ( const DetId id) const

Definition at line 111 of file HGCalTriggerTools.cc.

111  {
113  if (id.det() == DetId::Forward && id.subdetId() != ForwardSubdetector::HFNose) {
114  layer = HGCalDetId(id).layer();
115  } else if (id.det() == DetId::Forward && id.subdetId() == ForwardSubdetector::HFNose) {
116  layer = HFNoseDetId(id).layer();
117  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
118  layer = HcalDetId(id).depth();
119  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
120  layer = HGCSiliconDetId(id).layer();
121  } else if (id.det() == DetId::HGCalTrigger &&
124  layer = HGCalTriggerDetId(id).layer();
125  } else if (id.det() == DetId::HGCalTrigger &&
128  } else if (id.det() == DetId::HGCalHSc) {
130  }
131  return layer;
132 }

References HcalDetId::depth(), DetId::Forward, DetId::Hcal, HcalEndcap, HFNose, HFNoseTrigger, DetId::HGCalEE, HGCalEETrigger, DetId::HGCalHSc, DetId::HGCalHSi, HGCalHSiTrigger, DetId::HGCalTrigger, HGCalDetId::layer(), HGCScintillatorDetId::layer(), HFNoseTriggerDetId::layer(), HGCalTriggerDetId::layer(), HFNoseDetId::layer(), HGCSiliconDetId::layer(), and SiStripPI::max.

Referenced by getLayerZ(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), HGCalClusteringImpl::isPertinent(), layerWithOffset(), and simToReco().

◆ layers() [1/2]

unsigned HGCalTriggerTools::layers ( DetId::Detector  type) const

Definition at line 89 of file HGCalTriggerTools.cc.

89  {
90  unsigned layers = 0;
91  switch (type) {
92  case DetId::HGCalEE:
93  layers = eeLayers_;
94  break;
95  case DetId::HGCalHSi:
96  layers = fhLayers_;
97  break;
98  case DetId::HGCalHSc:
99  layers = bhLayers_;
100  break;
101  // FIXME: to do HFNose
102  case DetId::Forward:
104  break;
105  default:
106  break;
107  }
108  return layers;
109 }

References bhLayers_, eeLayers_, fhLayers_, DetId::Forward, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, layers(), and totalLayers_.

◆ layers() [2/2]

unsigned HGCalTriggerTools::layers ( ForwardSubdetector  type) const

Definition at line 65 of file HGCalTriggerTools.cc.

65  {
66  unsigned layers = 0;
67  switch (type) {
69  layers = eeLayers_;
70  break;
72  layers = fhLayers_;
73  break;
75  layers = bhLayers_;
76  break;
79  break;
82  break;
83  default:
84  break;
85  };
86  return layers;
87 }

References bhLayers_, eeLayers_, fhLayers_, ForwardEmpty, HFNose, HGCEE, HGCHEB, HGCHEF, noseLayers_, and totalLayers_.

Referenced by HGCalClusteringImpl::clusterizeNN(), HGCalShowerShape::coreShowerLength(), layers(), and HGCalShowerShape::percentileLayer().

◆ layerWithOffset()

unsigned HGCalTriggerTools::layerWithOffset ( const DetId id) const

Definition at line 134 of file HGCalTriggerTools.cc.

134  {
135  unsigned int l = layer(id);
136 
137  if (isNose(id)) {
138  l = layer(id); // no offset for HFnose
139  } else if (isHad(id) && isSilicon(id)) {
140  l += eeLayers_;
141  } else if (isHad(id) && isScintillator(id)) {
142  if (geom_->isV9Geometry())
143  l += eeLayers_; // mixed silicon and scintillator layers
144  else
145  l += eeLayers_ + fhLayers_;
146  }
147 
148  return l;
149 }

References eeLayers_, fhLayers_, geom_, isHad(), isNose(), isScintillator(), isSilicon(), HGCalTriggerGeometryBase::isV9Geometry(), cmsLHEtoEOSManager::l, and layer().

Referenced by HGCalTriggerValidator::analyze(), HGCalTowerMap2DImpl::buildTowerMap2D(), HGCalTriggerCellCalibration::calibrateMipTinGeV(), HGCalClusteringDummyImpl::calibratePt(), HGCalClusteringImpl::calibratePt(), HGCalHistoClusteringImpl::clusterSeedMulticluster(), HGCalShowerShape::eMax(), HGCalTriggerNtupleHGCClusters::fill(), HGCalTriggerNtupleHGCTriggerSums::fill(), HGCalTriggerNtupleHGCDigis::fill(), HGCalTriggerNtupleHGCTriggerCells::fill(), HGCalShowerShape::firstLayer(), HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId(), HGCalCoarseTriggerCellMapping::getConstituentTriggerCells(), getLayerZ(), HGCalShowerShape::lastLayer(), HGCalShowerShape::maxLayer(), HGCalShowerShape::sigmaEtaEtaMax(), HGCalShowerShape::sigmaPhiPhiMax(), HGCalShowerShape::sigmaRRMax(), HGCalShowerShape::sigmaRRMean(), and HGCalClusteringImpl::triggerCellReshuffling().

◆ sensorCellThicknessV8()

int HGCalTriggerTools::sensorCellThicknessV8 ( const DetId id) const
private

Definition at line 379 of file HGCalTriggerTools.cc.

379  {
380  int thickness = 0;
381  switch (id.subdetId()) {
384  break;
387  break;
388  default:
389  break;
390  };
391  return thickness;
392 }

References HGCalTopology::dddConstants(), HGCalTriggerGeometryBase::eeTopology(), HGCalTriggerGeometryBase::fhTopology(), geom_, HGCEE, HGCHEF, Calorimetry_cff::thickness, and HGCalDDDConstants::waferTypeL().

Referenced by thicknessIndex().

◆ simToReco() [1/2]

DetId HGCalTriggerTools::simToReco ( const DetId simid,
const HcalTopology topo 
) const

Definition at line 370 of file HGCalTriggerTools.cc.

370  {
371  DetId recoid(0);
372  const auto& dddConst = topo.dddConstants();
373  HcalDetId id = HcalHitRelabeller::relabel(simid, dddConst);
374  if (id.subdet() == int(HcalEndcap))
375  recoid = id;
376  return recoid;
377 }

References HcalTopology::dddConstants(), HcalEndcap, triggerObjects_cff::id, and HcalHitRelabeller::relabel().

◆ simToReco() [2/2]

DetId HGCalTriggerTools::simToReco ( const DetId simid,
const HGCalTopology topo 
) const

Definition at line 346 of file HGCalTriggerTools.cc.

346  {
347  DetId recoid(0);
348  const auto& dddConst = topo.dddConstants();
349  // V9
350  if (dddConst.waferHexagon8() || dddConst.tileTrapezoid()) {
351  recoid = simid;
352  }
353  // V8
354  else {
355  int subdet(simid.subdetId());
356  int layer = 0, cell = 0, sec = 0, subsec = 0, zp = 0;
357  HGCalTestNumbering::unpackHexagonIndex(simid, subdet, zp, layer, sec, subsec, cell);
358  // sec is wafer and subsec is celltype
359  // skip this hit if after ganging it is not valid
360  auto recoLayerCell = dddConst.simToReco(cell, layer, sec, topo.detectorType());
361  cell = recoLayerCell.first;
362  layer = recoLayerCell.second;
363  if (layer >= 0 && cell >= 0) {
364  recoid = HGCalDetId((ForwardSubdetector)subdet, zp, layer, subsec, sec, cell);
365  }
366  }
367  return recoid;
368 }

References HGCalTopology::dddConstants(), HGCalTopology::detectorType(), layer(), fileinputsource_cfi::sec, DetId::subdetId(), and HGCalTestNumbering::unpackHexagonIndex().

Referenced by CaloTruthCellsProducer::makeHitMap(), HGCalTriggerNtupleHGCDigis::simhits(), and HGCalTriggerNtupleHGCTriggerCells::simhits().

◆ thicknessIndex()

int HGCalTriggerTools::thicknessIndex ( const DetId id,
bool  tc = false 
) const

Definition at line 233 of file HGCalTriggerTools.cc.

233  {
234  if (isScintillator(id)) {
236  }
237  unsigned det = id.det();
238  int thickness = 0;
239  // For the v8 detid scheme
240  if (det == DetId::Forward && id.subdetId() != ForwardSubdetector::HFNose) {
241  if (!tc)
243  else {
244  // For the old geometry, TCs can contain sensor cells
245  // with different thicknesses.
246  // Use a majority logic to find the TC thickness
247  std::array<unsigned, 3> occurences = {{0, 0, 0}};
248  for (const auto& c_id : geom_->getCellsFromTriggerCell(id)) {
249  unsigned c_det = DetId(c_id).det();
250  int c_thickness = -1;
251  // For the v8 detid scheme
252  if (c_det == DetId::Forward) {
253  c_thickness = sensorCellThicknessV8(c_id);
254  } else {
255  c_thickness = HGCSiliconDetId(c_id).type();
256  }
257  if (c_thickness < 0 || unsigned(c_thickness) >= occurences.size()) {
258  throw cms::Exception("OutOfBound") << "Found thickness index = " << c_thickness;
259  }
260  occurences[c_thickness]++;
261  }
262  thickness = std::max_element(occurences.begin(), occurences.end()) - occurences.begin();
263  }
264  }
265  // For the v9 detid scheme
266  else if (det == DetId::HGCalEE || det == DetId::HGCalHSi) {
268  } else if (det == DetId::Forward && id.subdetId() == ForwardSubdetector::HFNose) {
269  thickness = HFNoseDetId(id).type();
270  } else if (id.det() == DetId::HGCalTrigger &&
274  } else if (id.det() == DetId::HGCalTrigger &&
277  }
278  return thickness;
279 }

References DetId::det(), Exception, DetId::Forward, geom_, HGCalTriggerGeometryBase::getCellsFromTriggerCell(), HFNose, HFNoseTrigger, DetId::HGCalEE, HGCalEETrigger, DetId::HGCalHSi, HGCalHSiTrigger, DetId::HGCalTrigger, isScintillator(), kScintillatorPseudoThicknessIndex_, mps_monitormerge::occurences, sensorCellThicknessV8(), Calorimetry_cff::thickness, HGCalTriggerDetId::type(), HFNoseTriggerDetId::type(), HFNoseDetId::type(), and HGCSiliconDetId::type().

Referenced by HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosition(), HGCalTriggerCellCalibration::calibrateInMipT(), HGCalTriggerCellCalibration::calibrateMipTinGeV(), HGCalConcentratorCoarsenerImpl::coarsen(), HGCalConcentratorSuperTriggerCellImpl::createAllTriggerCells(), HGCalTriggerNtupleHGCTriggerCells::fill(), HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId(), HGCalCoarseTriggerCellMapping::getConstituentTriggerCells(), HGCalVFEProcessorSums::run(), HGCalConcentratorProcessorSelection::run(), and HGCalVFESummationImpl::triggerCellSums().

◆ triggerLayer()

unsigned HGCalTriggerTools::triggerLayer ( const unsigned  id) const
inline

Definition at line 84 of file HGCalTriggerTools.h.

84 { return geom_->triggerLayer(id); }

References geom_, and HGCalTriggerGeometryBase::triggerLayer().

Referenced by HGCalTriggerClusterInterpretationEM::interpret().

◆ zside()

int HGCalTriggerTools::zside ( const DetId id) const

Definition at line 210 of file HGCalTriggerTools.cc.

210  {
211  int zside = 0;
212  if (id.det() == DetId::Forward && id.subdetId() != ForwardSubdetector::HFNose) {
213  zside = HGCalDetId(id).zside();
214  } else if (id.det() == DetId::Forward && id.subdetId() == ForwardSubdetector::HFNose) {
215  zside = HFNoseDetId(id).zside();
216  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
217  zside = HcalDetId(id).zside();
218  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
219  zside = HGCSiliconDetId(id).zside();
220  } else if (id.det() == DetId::HGCalTrigger &&
223  zside = HGCalTriggerDetId(id).zside();
224  } else if (id.det() == DetId::HGCalTrigger &&
227  } else if (id.det() == DetId::HGCalHSc) {
229  }
230  return zside;
231 }

References DetId::Forward, DetId::Hcal, HcalEndcap, HFNose, HFNoseTrigger, DetId::HGCalEE, HGCalEETrigger, DetId::HGCalHSc, DetId::HGCalHSi, HGCalHSiTrigger, DetId::HGCalTrigger, HGCScintillatorDetId::zside(), HGCalDetId::zside(), HGCalTriggerDetId::zside(), HFNoseTriggerDetId::zside(), HFNoseDetId::zside(), HGCSiliconDetId::zside(), and HcalDetId::zside().

Referenced by HGCalMulticlusteringImpl::clusterizeDBSCAN(), HGCalHistoClusteringImpl::clusterSeedMulticluster(), HGCalTriggerNtupleHGCTriggerSums::fill(), HGCalTriggerNtupleHGCDigis::fill(), HGCalTriggerNtupleHGCTriggerCells::fill(), HGCalHistoSeedingImpl::fillHistoClusters(), HGCalTriggerTowerGeometryHelper::HGCalTriggerTowerGeometryHelper(), HGCalMulticlusteringImpl::isPertinent(), HGCalClusteringImpl::isPertinent(), and HGCalClusteringImpl::triggerCellReshuffling().

Member Data Documentation

◆ bhLayers_

unsigned HGCalTriggerTools::bhLayers_
private

Definition at line 99 of file HGCalTriggerTools.h.

Referenced by eventSetup(), and layers().

◆ eeLayers_

unsigned HGCalTriggerTools::eeLayers_
private

Definition at line 97 of file HGCalTriggerTools.h.

Referenced by eventSetup(), lastLayerEE(), lastLayerFH(), layers(), and layerWithOffset().

◆ fhLayers_

unsigned HGCalTriggerTools::fhLayers_
private

Definition at line 98 of file HGCalTriggerTools.h.

Referenced by eventSetup(), lastLayerFH(), layers(), and layerWithOffset().

◆ geom_

const HGCalTriggerGeometryBase* HGCalTriggerTools::geom_
private

◆ kScintillatorPseudoThicknessIndex_

constexpr unsigned HGCalTriggerTools::kScintillatorPseudoThicknessIndex_ = 3
staticconstexpr

Definition at line 86 of file HGCalTriggerTools.h.

Referenced by thicknessIndex().

◆ noseLayers_

unsigned HGCalTriggerTools::noseLayers_
private

Definition at line 100 of file HGCalTriggerTools.h.

Referenced by eventSetup(), lastLayerNose(), and layers().

◆ totalLayers_

unsigned HGCalTriggerTools::totalLayers_
private

Definition at line 101 of file HGCalTriggerTools.h.

Referenced by eventSetup(), lastLayerBH(), and layers().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
HGCalTriggerGeometryBase::eeTopology
const HGCalTopology & eeTopology() const
Definition: HGCalTriggerGeometryBase.h:65
HGCalTriggerTools::geom_
const HGCalTriggerGeometryBase * geom_
Definition: HGCalTriggerTools.h:96
DetId::HGCalTrigger
Definition: DetId.h:35
HGCalTopology::dddConstants
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
HGCalTriggerDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalTriggerDetId.h:50
HFNoseTriggerDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HFNoseTriggerDetId.h:50
ForwardEmpty
Definition: ForwardSubdetector.h:5
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
HFNoseDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HFNoseDetId.h:53
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
HFNoseDetId::layer
int layer() const
get the layer #
Definition: HFNoseDetId.h:56
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HGCalTestNumbering::unpackHexagonIndex
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
Definition: HGCalTestNumbering.cc:47
HGCalDDDConstants::waferZ
double waferZ(int layer, bool reco) const
Definition: HGCalDDDConstants.cc:1388
HGCalTriggerTools::isHad
bool isHad(const DetId &id) const
Definition: HGCalTriggerTools.h:44
DetId::Hcal
Definition: DetId.h:28
HGCalDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalDetId.h:49
HFNoseTriggerDetId::type
int type() const
get the type
Definition: HFNoseTriggerDetId.h:47
HcalDetId::depth
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
HGCalTriggerTools::isScintillator
bool isScintillator(const DetId &id) const
Definition: HGCalTriggerTools.h:46
HFNoseDetId
Definition: HFNoseDetId.h:22
HFNoseTriggerDetId
Definition: HFNoseTriggerDetId.h:26
HGCalDetId::layer
int layer() const
get the layer #
Definition: HGCalDetId.h:46
HGCalTriggerTools::isSilicon
bool isSilicon(const DetId &) const
Definition: HGCalTriggerTools.cc:181
HGCalHSiTrigger
Definition: ForwardSubdetector.h:14
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:50
DetId
Definition: DetId.h:17
HGCalTriggerTools::noseLayers_
unsigned noseLayers_
Definition: HGCalTriggerTools.h:100
DetId::HGCalHSi
Definition: DetId.h:33
DetId::HGCalEE
Definition: DetId.h:32
HGCalTriggerGeometryBase::triggerLayer
virtual unsigned triggerLayer(const unsigned id) const =0
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
PVValHelper::eta
Definition: PVValidationHelpers.h:69
HFNose
Definition: ForwardSubdetector.h:11
HGCalTopology::detectorType
bool detectorType() const
Definition: HGCalTopology.h:119
HGCalTriggerDetId::layer
int layer() const
get the layer #
Definition: HGCalTriggerDetId.h:53
edm::ESHandle< HGCalTriggerGeometryBase >
HGCalTriggerTools::hgcal_silicon_CEE
Definition: HGCalTriggerTools.h:89
HGCalEETrigger
Definition: ForwardSubdetector.h:14
HGCalTriggerTools::layerWithOffset
unsigned layerWithOffset(const DetId &) const
Definition: HGCalTriggerTools.cc:134
HGCalTriggerTools::hgcal_silicon_CEH
Definition: HGCalTriggerTools.h:90
HGCalTriggerTools::zside
int zside(const DetId &) const
Definition: HGCalTriggerTools.cc:210
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
HGCalTriggerGeometryBase::getCellsFromTriggerCell
virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const =0
Point3DBase< float, GlobalTag >
BXVector::begin
const_iterator begin(int bx) const
HGCScintillatorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCScintillatorDetId.h:47
HGCalTriggerTools::lastLayerFH
unsigned lastLayerFH() const
Definition: HGCalTriggerTools.h:55
HGCalTriggerTools::getTCPosition
GlobalPoint getTCPosition(const DetId &id) const
Definition: HGCalTriggerTools.cc:54
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
HGCalTriggerTools::isNose
bool isNose(const DetId &) const
Definition: HGCalTriggerTools.cc:170
HGCalTriggerDetId
Definition: HGCalTriggerDetId.h:26
HGCEE
Definition: ForwardSubdetector.h:8
HGCalTriggerTools::isEm
bool isEm(const DetId &) const
Definition: HGCalTriggerTools.cc:151
HGCalTriggerTools::getEta
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: HGCalTriggerTools.cc:281
HFNoseDetId::type
int type() const
get the type
Definition: HFNoseDetId.h:50
HGCalTriggerTools::bhLayers_
unsigned bhLayers_
Definition: HGCalTriggerTools.h:99
HGCalTriggerTools::sensorCellThicknessV8
int sensorCellThicknessV8(const DetId &id) const
Definition: HGCalTriggerTools.cc:379
BXVector::end
const_iterator end(int bx) const
HGCalTriggerDetId::subdet
HGCalTriggerSubdetector subdet() const
get the subdetector
Definition: HGCalTriggerDetId.h:42
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HcalTopology::dddConstants
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:164
HGCalDDDConstants::layers
unsigned int layers(bool reco) const
Definition: HGCalDDDConstants.cc:561
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
HGCalTriggerTools::layer
unsigned layer(const DetId &) const
Definition: HGCalTriggerTools.cc:111
HcalDetId
Definition: HcalDetId.h:12
HFNoseDetId::isEE
bool isEE() const
consistency check : no bits left => no overhead
Definition: HFNoseDetId.h:104
HFNoseTrigger
Definition: ForwardSubdetector.h:14
HGCalTriggerTools::getPhi
float getPhi(const GlobalPoint &position) const
Definition: HGCalTriggerTools.cc:291
HGCalTriggerGeometryBase::bhTopology
const HcalTopology & bhTopology() const
Definition: HGCalTriggerGeometryBase.h:67
HGCalTriggerGeometryBase::isV9Geometry
bool isV9Geometry() const
Definition: HGCalTriggerGeometryBase.h:30
HGCalTriggerTools::totalLayers_
unsigned totalLayers_
Definition: HGCalTriggerTools.h:101
HGCalTriggerTools::layers
unsigned layers(ForwardSubdetector type) const
Definition: HGCalTriggerTools.cc:65
HGCSiliconDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCSiliconDetId.h:54
get
#define get
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:87
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
DDAxes::phi
HcalHitRelabeller::relabel
DetId relabel(const uint32_t testId) const
Definition: HcalHitRelabeller.cc:49
HGCalDetId
Definition: HGCalDetId.h:8
HcalDDDRecConstants::getRZ
double getRZ(const int &subdet, const int &ieta, const int &depth) const
Definition: HcalDDDRecConstants.cc:416
HcalDDDRecConstants::getEtaRange
std::pair< int, int > getEtaRange(const int &i) const
Definition: HcalDDDRecConstants.h:74
HGCalTriggerTools::eeLayers_
unsigned eeLayers_
Definition: HGCalTriggerTools.h:97
HcalEndcap
Definition: HcalAssistant.h:34
HGCalTriggerTools::SubDetectorType
SubDetectorType
Definition: HGCalTriggerTools.h:88
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:23
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
DetId::HGCalHSc
Definition: DetId.h:34
Exception
Definition: hltDiff.cc:246
HGCalTriggerGeometryBase::getTriggerCellPosition
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
HGCalTriggerTools::fhLayers_
unsigned fhLayers_
Definition: HGCalTriggerTools.h:98
mps_monitormerge.occurences
list occurences
Definition: mps_monitormerge.py:28
HGCSiliconDetId::type
int type() const
get the type
Definition: HGCSiliconDetId.h:51
HGCalTriggerTools::kScintillatorPseudoThicknessIndex_
static constexpr unsigned kScintillatorPseudoThicknessIndex_
Definition: HGCalTriggerTools.h:86
HGCalTriggerTools::getPt
float getPt(const GlobalPoint &position, const float &hitEnergy, const float &vertex_z=0.) const
Definition: HGCalTriggerTools.cc:301
HcalDDDRecConstants::getMaxDepth
int getMaxDepth(const int &type) const
Definition: HcalDDDRecConstants.h:88
HGCalDDDConstants::waferTypeL
int waferTypeL(int wafer) const
Definition: HGCalDDDConstants.h:183
HGCHEF
Definition: ForwardSubdetector.h:9
HGCalTriggerDetId::type
int type() const
get the type
Definition: HGCalTriggerDetId.h:47
HFNoseTriggerDetId::layer
int layer() const
get the layer #
Definition: HFNoseTriggerDetId.h:53
HGCalTriggerGeometryBase::isWithNoseGeometry
bool isWithNoseGeometry() const
Definition: HGCalTriggerGeometryBase.h:31
DetId::Forward
Definition: DetId.h:30
HcalDetId::zside
constexpr int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
HGCalTriggerTools::lastLayerEE
unsigned lastLayerEE() const
Definition: HGCalTriggerTools.h:54
HGCalTriggerTools::getLayerZ
float getLayerZ(const unsigned &layerWithOffset) const
Definition: HGCalTriggerTools.cc:312
HFNoseTriggerDetId::isEE
bool isEE() const
consistency check : no bits left => no overhead
Definition: HFNoseTriggerDetId.h:87
HGCalTriggerGeometryBase::noseTopology
const HGCalTopology & noseTopology() const
Definition: HGCalTriggerGeometryBase.h:64
HGCHEB
Definition: ForwardSubdetector.h:10
HGCalTriggerGeometryBase::fhTopology
const HGCalTopology & fhTopology() const
Definition: HGCalTriggerGeometryBase.h:66
HGCalTriggerTools::hgcal_scintillator
Definition: HGCalTriggerTools.h:91
HGCSiliconDetId::layer
int layer() const
get the layer #
Definition: HGCSiliconDetId.h:57
HGCalTriggerGeometryBase::hscTopology
const HGCalTopology & hscTopology() const
Definition: HGCalTriggerGeometryBase.h:69