CMS 3D CMS Logo

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

#include <HGCalTriggerTools.h>

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 unsigned &layerWithOffset) const
 
float getLayerZ (const int &subdet, const unsigned &layer) const
 
float getPhi (const GlobalPoint &position) const
 
float getPt (const GlobalPoint &position, const float &hitEnergy, const float &vertex_z=0.) 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 isScintillator (const DetId &id) const
 
bool isSilicon (const DetId &) const
 
unsigned lastLayerBH () const
 
unsigned lastLayerEE () const
 
unsigned lastLayerFH () const
 
unsigned layer (const DetId &) const
 
unsigned layers (ForwardSubdetector type) const
 
unsigned layers (DetId::Detector type) const
 
unsigned layerWithOffset (const DetId &) const
 
DetId simToReco (const DetId &, const HGCalTopology &) const
 
DetId simToReco (const DetId &, const HcalTopology &) 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 unsigned kScintillatorPseudoThicknessIndex_ = 3
 

Private Member Functions

int sensorCellThicknessV8 (const DetId &id) const
 

Private Attributes

unsigned bhLayers_
 
unsigned eeLayers_
 
unsigned fhLayers_
 
const HGCalTriggerGeometryBasegeom_
 
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.

Constructor & Destructor Documentation

HGCalTriggerTools::HGCalTriggerTools ( )
inline

Definition at line 34 of file HGCalTriggerTools.h.

34 : geom_(nullptr), eeLayers_(0), fhLayers_(0), bhLayers_(0), totalLayers_(0) {}
const HGCalTriggerGeometryBase * geom_
HGCalTriggerTools::~HGCalTriggerTools ( )
inline

Definition at line 35 of file HGCalTriggerTools.h.

References hgcalTopologyTester_cfi::layers.

35 {}

Member Function Documentation

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

Definition at line 73 of file HGCalTriggerTools.h.

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

73  {
74  std::vector<T> outputVector;
75  //loop over collection for a given bx and put the objects into a std::vector
76  outputVector.insert(outputVector.end(), inputBXVector.begin(0), inputBXVector.end(0));
77  return outputVector;
78  }
const_iterator end(int bx) const
const_iterator begin(int bx) const
void HGCalTriggerTools::eventSetup ( const edm::EventSetup es)

Definition at line 33 of file HGCalTriggerTools.cc.

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

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

33  {
35  es.get<CaloGeometryRecord>().get(triggerGeometry_);
36  geom_ = triggerGeometry_.product();
37 
40  if (geom_->isV9Geometry()) {
43  } else {
46  }
47 }
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:164
const HGCalTopology & eeTopology() const
const HGCalTriggerGeometryBase * geom_
unsigned int layers(bool reco) const
const HcalTopology & bhTopology() const
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:96
const HGCalTopology & hscTopology() const
int getMaxDepth(const int &type) const
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
const HGCalTopology & fhTopology() const
float HGCalTriggerTools::getEta ( const GlobalPoint position,
const float &  vertex_z = 0. 
) const

Definition at line 212 of file HGCalTriggerTools.cc.

References PV3DBase< T, PVType, FrameType >::eta(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by getPt(), and getTCEta().

212  {
213  GlobalPoint corrected_position = GlobalPoint(position.x(), position.y(), position.z() - vertex_z);
214  return corrected_position.eta();
215 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:60
T z() const
Definition: PV3DBase.h:61
T eta() const
Definition: PV3DBase.h:73
T x() const
Definition: PV3DBase.h:59
float HGCalTriggerTools::getLayerZ ( const unsigned &  layerWithOffset) const

Definition at line 243 of file HGCalTriggerTools.cc.

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

Referenced by HGCalTriggerNtupleGen::fill().

243  {
244  int subdet = ForwardSubdetector::HGCEE;
245  unsigned offset = 0;
248  offset = lastLayerEE();
249  } else if (layerWithOffset > lastLayerFH()) {
251  offset = lastLayerFH();
252  }
253  return getLayerZ(subdet, layerWithOffset - offset);
254 }
unsigned lastLayerEE() const
float getLayerZ(const unsigned &layerWithOffset) const
unsigned layerWithOffset(const DetId &) const
unsigned lastLayerFH() const
float HGCalTriggerTools::getLayerZ ( const int &  subdet,
const unsigned &  layer 
) const

Definition at line 256 of file HGCalTriggerTools.cc.

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

256  {
257  float layerGlobalZ = 0.;
258  if ((subdet == ForwardSubdetector::HGCEE) || (subdet == DetId::HGCalEE)) {
259  layerGlobalZ = geom_->eeTopology().dddConstants().waferZ(layer, true);
260  } else if ((subdet == ForwardSubdetector::HGCHEF) || (subdet == DetId::HGCalHSi)) {
261  layerGlobalZ = geom_->fhTopology().dddConstants().waferZ(layer, true);
262  } else if ((subdet == HcalSubdetector::HcalEndcap) || (subdet == ForwardSubdetector::HGCHEB) ||
263  (subdet == DetId::HGCalHSc)) {
264  if (geom_->isV9Geometry()) {
265  layerGlobalZ = geom_->hscTopology().dddConstants().waferZ(layer, true);
266  } else {
267  layerGlobalZ = geom_->bhTopology().dddConstants()->getRZ(
269  }
270  }
271  return layerGlobalZ;
272 }
unsigned layer(const DetId &) const
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:164
const HGCalTopology & eeTopology() const
const HGCalTriggerGeometryBase * geom_
const HcalTopology & bhTopology() const
double getRZ(const int &subdet, const int &ieta, const int &depth) const
double waferZ(int layer, bool reco) const
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:96
const HGCalTopology & hscTopology() const
std::pair< int, int > getEtaRange(const int &i) const
const HGCalTopology & fhTopology() const
float HGCalTriggerTools::getPhi ( const GlobalPoint position) const

Definition at line 222 of file HGCalTriggerTools.cc.

References phi, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by getTCPhi().

222  {
223  float phi = atan2(position.y(), position.x());
224  return phi;
225 }
T y() const
Definition: PV3DBase.h:60
T x() const
Definition: PV3DBase.h:59
float HGCalTriggerTools::getPt ( const GlobalPoint position,
const float &  hitEnergy,
const float &  vertex_z = 0. 
) const

Definition at line 232 of file HGCalTriggerTools.cc.

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

Referenced by getTCPt().

232  {
233  float eta = getEta(position, vertex_z);
234  float pt = hitEnergy / cosh(eta);
235  return pt;
236 }
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
float HGCalTriggerTools::getTCEta ( const DetId id,
const float &  vertex_z = 0. 
) const

Definition at line 217 of file HGCalTriggerTools.cc.

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

217  {
219  return getEta(position, vertex_z);
220 }
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
static int position[264][3]
Definition: ReadPGInfo.cc:289
GlobalPoint getTCPosition(const DetId &id) const
float HGCalTriggerTools::getTCPhi ( const DetId id) const

Definition at line 227 of file HGCalTriggerTools.cc.

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

227  {
229  return getPhi(position);
230 }
float getPhi(const GlobalPoint &position) const
static int position[264][3]
Definition: ReadPGInfo.cc:289
GlobalPoint getTCPosition(const DetId &id) const
GlobalPoint HGCalTriggerTools::getTCPosition ( const DetId id) const

Definition at line 49 of file HGCalTriggerTools.cc.

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

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

49  {
50  if (id.det() == DetId::Hcal || id.det() == DetId::HGCalEE) {
51  throw cms::Exception("hgcal::HGCalTriggerTools") << "method getTCPosition called for DetId not belonging to a TC";
52  // FIXME: this would actually need a better test...but at the moment I can not think to anything better
53  // to distinguish a TC detId
54  }
55 
57  return position;
58 }
const HGCalTriggerGeometryBase * geom_
static int position[264][3]
Definition: ReadPGInfo.cc:289
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
float HGCalTriggerTools::getTCPt ( const DetId id,
const float &  hitEnergy,
const float &  vertex_z = 0. 
) const

Definition at line 238 of file HGCalTriggerTools.cc.

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

238  {
240  return getPt(position, hitEnergy, vertex_z);
241 }
float getPt(const GlobalPoint &position, const float &hitEnergy, const float &vertex_z=0.) const
static int position[264][3]
Definition: ReadPGInfo.cc:289
GlobalPoint getTCPosition(const DetId &id) const
const HGCalTriggerGeometryBase* HGCalTriggerTools::getTriggerGeometry ( ) const
inline
bool HGCalTriggerTools::isEm ( const DetId id) const

Definition at line 131 of file HGCalTriggerTools.cc.

References DetId::Forward, DetId::HGCalEE, HGCalEETrigger, DetId::HGCalTrigger, HGCEE, and HGCalTriggerDetId::subdet().

Referenced by HGCalTriggerNtupleHGCTriggerCells::fill(), HGCalHistoSeedingImpl::fillHistoClusters(), and HGCalConcentratorProcessorSelection::run().

131  {
132  bool em = false;
133  if (id.det() == DetId::Forward) {
134  em = (id.subdetId() == HGCEE);
135  } else if (id.det() == DetId::HGCalEE) {
136  em = true;
137  } else if (id.det() == DetId::HGCalTrigger) {
139  }
140  return em;
141 }
HGCalTriggerSubdetector subdet() const
get the subdetector
bool HGCalTriggerTools::isHad ( const DetId id) const
inline

Definition at line 44 of file HGCalTriggerTools.h.

Referenced by layerWithOffset().

44 { return !isEm(id); }
bool isEm(const DetId &) const
bool HGCalTriggerTools::isScintillator ( const DetId id) const
inline
bool HGCalTriggerTools::isSilicon ( const DetId id) const

Definition at line 143 of file HGCalTriggerTools.cc.

References DetId::Forward, DetId::HGCalEE, HGCalHScTrigger, DetId::HGCalHSi, DetId::HGCalTrigger, HGCHEB, and HGCalTriggerDetId::subdet().

Referenced by HGCalTriggerCellCalibration::calibrateInMipT(), HGCalTriggerCellCalibration::calibrateMipTinGeV(), HGCalTriggerNtupleHGCTriggerCells::fill(), layerWithOffset(), and HGCalVFESummationImpl::triggerCellSums().

143  {
144  bool silicon = false;
145  if (id.det() == DetId::Forward) {
146  silicon = (id.subdetId() != HGCHEB);
147  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
148  silicon = true;
149  } else if (id.det() == DetId::HGCalTrigger) {
151  }
152  return silicon;
153 }
HGCalTriggerSubdetector subdet() const
get the subdetector
unsigned HGCalTriggerTools::lastLayerBH ( ) const
inline
unsigned HGCalTriggerTools::lastLayerEE ( ) const
inline
unsigned HGCalTriggerTools::lastLayerFH ( ) const
inline

Definition at line 54 of file HGCalTriggerTools.h.

Referenced by getLayerZ().

54 { return eeLayers_ + fhLayers_; }
unsigned HGCalTriggerTools::layer ( const DetId id) const

Definition at line 102 of file HGCalTriggerTools.cc.

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

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

102  {
104  if (id.det() == DetId::Forward) {
105  layer = HGCalDetId(id).layer();
106  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
107  layer = HcalDetId(id).depth();
108  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
109  layer = HGCSiliconDetId(id).layer();
110  } else if (id.det() == DetId::HGCalTrigger) {
111  layer = HGCalTriggerDetId(id).layer();
112  } else if (id.det() == DetId::HGCalHSc) {
113  layer = HGCScintillatorDetId(id).layer();
114  }
115  return layer;
116 }
unsigned layer(const DetId &) const
int layer() const
get the layer #
int depth() const
get the tower depth
Definition: HcalDetId.h:164
int layer() const
get the layer #
int layer() const
get the layer #
int layer() const
get the layer #
Definition: HGCalDetId.h:46
unsigned HGCalTriggerTools::layers ( ForwardSubdetector  type) const

Definition at line 60 of file HGCalTriggerTools.cc.

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

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

60  {
61  unsigned layers = 0;
62  switch (type) {
64  layers = eeLayers_;
65  break;
67  layers = fhLayers_;
68  break;
70  layers = bhLayers_;
71  break;
73  layers = totalLayers_;
74  break;
75  default:
76  break;
77  };
78  return layers;
79 }
type
Definition: HCALResponse.h:21
unsigned layers(ForwardSubdetector type) const
unsigned HGCalTriggerTools::layers ( DetId::Detector  type) const

Definition at line 81 of file HGCalTriggerTools.cc.

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

81  {
82  unsigned layers = 0;
83  switch (type) {
84  case DetId::HGCalEE:
85  layers = eeLayers_;
86  break;
87  case DetId::HGCalHSi:
88  layers = fhLayers_;
89  break;
90  case DetId::HGCalHSc:
91  layers = bhLayers_;
92  break;
93  case DetId::Forward:
94  layers = totalLayers_;
95  break;
96  default:
97  break;
98  }
99  return layers;
100 }
type
Definition: HCALResponse.h:21
unsigned layers(ForwardSubdetector type) const
unsigned HGCalTriggerTools::layerWithOffset ( const DetId id) const

Definition at line 118 of file HGCalTriggerTools.cc.

References eeLayers_, fhLayers_, geom_, isHad(), 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(), HGCalTriggerNtupleHGCDigis::fill(), HGCalTriggerNtupleHGCTriggerCells::fill(), HGCalShowerShape::firstLayer(), HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId(), HGCalCoarseTriggerCellMapping::getConstituentTriggerCells(), HGCalShowerShape::lastLayer(), HGCalShowerShape::maxLayer(), HGCalShowerShape::sigmaEtaEtaMax(), HGCalShowerShape::sigmaPhiPhiMax(), HGCalShowerShape::sigmaRRMax(), HGCalShowerShape::sigmaRRMean(), and HGCalClusteringImpl::triggerCellReshuffling().

118  {
119  unsigned int l = layer(id);
120  if (isHad(id) && isSilicon(id)) {
121  l += eeLayers_;
122  } else if (isHad(id) && isScintillator(id)) {
123  if (geom_->isV9Geometry())
124  l += eeLayers_; // mixed silicon and scintillator layers
125  else
126  l += eeLayers_ + fhLayers_;
127  }
128  return l;
129 }
bool isScintillator(const DetId &id) const
unsigned layer(const DetId &) const
const HGCalTriggerGeometryBase * geom_
bool isHad(const DetId &id) const
bool isSilicon(const DetId &) const
int HGCalTriggerTools::sensorCellThicknessV8 ( const DetId id) const
private

Definition at line 308 of file HGCalTriggerTools.cc.

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

Referenced by thicknessIndex().

308  {
309  int thickness = 0;
310  switch (id.subdetId()) {
312  thickness = geom_->eeTopology().dddConstants().waferTypeL(HGCalDetId(id).wafer()) - 1;
313  break;
315  thickness = geom_->fhTopology().dddConstants().waferTypeL(HGCalDetId(id).wafer()) - 1;
316  break;
317  default:
318  break;
319  };
320  return thickness;
321 }
const HGCalTopology & eeTopology() const
const HGCalTriggerGeometryBase * geom_
int waferTypeL(int wafer) const
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:96
const HGCalTopology & fhTopology() const
DetId HGCalTriggerTools::simToReco ( const DetId simid,
const HGCalTopology topo 
) const

Definition at line 274 of file HGCalTriggerTools.cc.

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

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

274  {
275  DetId recoid(0);
276  const auto& dddConst = topo.dddConstants();
277  // V9
278  if (dddConst.geomMode() == HGCalGeometryMode::Hexagon8 || dddConst.geomMode() == HGCalGeometryMode::Hexagon8Full ||
279  dddConst.geomMode() == HGCalGeometryMode::Trapezoid) {
280  recoid = simid;
281  }
282  // V8
283  else {
284  int subdet(simid.subdetId());
285  int layer = 0, cell = 0, sec = 0, subsec = 0, zp = 0;
286  HGCalTestNumbering::unpackHexagonIndex(simid, subdet, zp, layer, sec, subsec, cell);
287  //sec is wafer and subsec is celltype
288  //skip this hit if after ganging it is not valid
289  auto recoLayerCell = dddConst.simToReco(cell, layer, sec, topo.detectorType());
290  cell = recoLayerCell.first;
291  layer = recoLayerCell.second;
292  if (layer >= 0 && cell >= 0) {
293  recoid = HGCalDetId((ForwardSubdetector)subdet, zp, layer, subsec, sec, cell);
294  }
295  }
296  return recoid;
297 }
unsigned layer(const DetId &) const
bool detectorType() const
ForwardSubdetector
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:96
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
DetId HGCalTriggerTools::simToReco ( const DetId simid,
const HcalTopology topo 
) const

Definition at line 299 of file HGCalTriggerTools.cc.

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

299  {
300  DetId recoid(0);
301  const auto& dddConst = topo.dddConstants();
302  HcalDetId id = HcalHitRelabeller::relabel(simid, dddConst);
303  if (id.subdet() == int(HcalEndcap))
304  recoid = id;
305  return recoid;
306 }
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:164
Definition: DetId.h:17
DetId relabel(const uint32_t testId) const
int HGCalTriggerTools::thicknessIndex ( const DetId id,
bool  tc = false 
) const

Definition at line 171 of file HGCalTriggerTools.cc.

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

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

171  {
172  if (isScintillator(id)) {
174  }
175  unsigned det = id.det();
176  int thickness = 0;
177  // For the v8 detid scheme
178  if (det == DetId::Forward) {
179  if (!tc)
180  thickness = sensorCellThicknessV8(id);
181  else {
182  // For the old geometry, TCs can contain sensor cells
183  // with different thicknesses.
184  // Use a majority logic to find the TC thickness
185  std::array<unsigned, 3> occurences = {{0, 0, 0}};
186  for (const auto& c_id : geom_->getCellsFromTriggerCell(id)) {
187  unsigned c_det = DetId(c_id).det();
188  int c_thickness = -1;
189  // For the v8 detid scheme
190  if (c_det == DetId::Forward) {
191  c_thickness = sensorCellThicknessV8(c_id);
192  } else {
193  c_thickness = HGCSiliconDetId(c_id).type();
194  }
195  if (c_thickness < 0 || unsigned(c_thickness) >= occurences.size()) {
196  throw cms::Exception("OutOfBound") << "Found thickness index = " << c_thickness;
197  }
198  occurences[c_thickness]++;
199  }
200  thickness = std::max_element(occurences.begin(), occurences.end()) - occurences.begin();
201  }
202  }
203  // For the v9 detid scheme
204  else if (det == DetId::HGCalEE || det == DetId::HGCalHSi) {
205  thickness = HGCSiliconDetId(id).type();
206  } else if (det == DetId::HGCalTrigger) {
207  thickness = HGCalTriggerDetId(id).type();
208  }
209  return thickness;
210 }
bool isScintillator(const DetId &id) const
virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const =0
const HGCalTriggerGeometryBase * geom_
static unsigned kScintillatorPseudoThicknessIndex_
int type() const
get the type
int type() const
get the type
Definition: DetId.h:17
int sensorCellThicknessV8(const DetId &id) const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
unsigned HGCalTriggerTools::triggerLayer ( const unsigned  id) const
inline

Definition at line 82 of file HGCalTriggerTools.h.

Referenced by HGCalTriggerClusterInterpretationEM::interpret().

82 { return geom_->triggerLayer(id); }
const HGCalTriggerGeometryBase * geom_
virtual unsigned triggerLayer(const unsigned id) const =0
int HGCalTriggerTools::zside ( const DetId id) const

Definition at line 155 of file HGCalTriggerTools.cc.

References DetId::Forward, DetId::Hcal, HcalEndcap, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, DetId::HGCalTrigger, HGCScintillatorDetId::zside(), HGCalDetId::zside(), HGCalTriggerDetId::zside(), HGCSiliconDetId::zside(), and HcalDetId::zside().

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

155  {
156  int zside = 0;
157  if (id.det() == DetId::Forward) {
158  zside = HGCalDetId(id).zside();
159  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
160  zside = HcalDetId(id).zside();
161  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
162  zside = HGCSiliconDetId(id).zside();
163  } else if (id.det() == DetId::HGCalTrigger) {
164  zside = HGCalTriggerDetId(id).zside();
165  } else if (id.det() == DetId::HGCalHSc) {
166  zside = HGCScintillatorDetId(id).zside();
167  }
168  return zside;
169 }
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
int zside() const
get the z-side of the cell (1/-1)
int zside() const
get the z-side of the cell (1/-1)
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalDetId.h:49
int zside(const DetId &) const
int zside() const
get the z-side of the cell (1/-1)

Member Data Documentation

unsigned HGCalTriggerTools::bhLayers_
private

Definition at line 90 of file HGCalTriggerTools.h.

Referenced by eventSetup(), and layers().

unsigned HGCalTriggerTools::eeLayers_
private

Definition at line 88 of file HGCalTriggerTools.h.

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

unsigned HGCalTriggerTools::fhLayers_
private

Definition at line 89 of file HGCalTriggerTools.h.

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

const HGCalTriggerGeometryBase* HGCalTriggerTools::geom_
private
unsigned HGCalTriggerTools::kScintillatorPseudoThicknessIndex_ = 3
static

Definition at line 84 of file HGCalTriggerTools.h.

Referenced by thicknessIndex().

unsigned HGCalTriggerTools::totalLayers_
private

Definition at line 91 of file HGCalTriggerTools.h.

Referenced by eventSetup(), and layers().