CMS 3D CMS Logo

List of all members | Public Member Functions | 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
 
int zside (const DetId &) const
 
 ~HGCalTriggerTools ()
 

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 34 of file HGCalTriggerTools.h.

Constructor & Destructor Documentation

HGCalTriggerTools::HGCalTriggerTools ( )
inline

Definition at line 36 of file HGCalTriggerTools.h.

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

Definition at line 37 of file HGCalTriggerTools.h.

References LayerTriplets::layers().

37 {}

Member Function Documentation

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

Definition at line 75 of file HGCalTriggerTools.h.

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

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  }
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(), HGCalClusteringDummyImpl::eventSetup(), HGCalHistoSeedingImpl::eventSetup(), HGCalMulticlusteringImpl::eventSetup(), HGCalTriggerCellCalibration::eventSetup(), HGCalVFESummationImpl::eventSetup(), HGCalHistoClusteringImpl::eventSetup(), HGCalShowerShape::eventSetup(), HGCalConcentratorSuperTriggerCellImpl::eventSetup(), HGCalTowerMap2DImpl::eventSetup(), HGCalClusteringImpl::eventSetup(), HGCalConcentratorSelectionImpl::eventSetup(), HGCalTriggerNtupleHGCClusters::fill(), HGCalTriggerNtupleHGCTriggerCells::fill(), HGCalTriggerNtupleHGCDigis::fill(), and HGCalTriggerNtupleGen::fill().

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:168
const HGCalTopology & eeTopology() const
const HGCalTriggerGeometryBase * geom_
unsigned int layers(bool reco) const
const HcalTopology & bhTopology() const
const HGCalDDDConstants & dddConstants() const
const HGCalTopology & hscTopology() const
int getMaxDepth(const int &type) const
T get() const
Definition: EventSetup.h:71
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 199 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().

199  {
200  GlobalPoint corrected_position = GlobalPoint(position.x(), position.y(), position.z() - vertex_z);
201  return corrected_position.eta();
202 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
T eta() const
Definition: PV3DBase.h:76
T x() const
Definition: PV3DBase.h:62
float HGCalTriggerTools::getLayerZ ( const unsigned &  layerWithOffset) const

Definition at line 230 of file HGCalTriggerTools.cc.

References HcalEndcap, HGCEE, HGCHEF, lastLayerEE(), lastLayerFH(), and PFRecoTauDiscriminationByIsolation_cfi::offset.

Referenced by HGCalTriggerNtupleGen::fill().

230  {
231  int subdet = ForwardSubdetector::HGCEE;
232  unsigned offset = 0;
235  offset = lastLayerEE();
236  } else if (layerWithOffset > lastLayerFH()) {
238  offset = lastLayerFH();
239  }
240  return getLayerZ(subdet, layerWithOffset - offset);
241 }
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 243 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().

243  {
244  float layerGlobalZ = 0.;
245  if ((subdet == ForwardSubdetector::HGCEE) || (subdet == DetId::HGCalEE)) {
246  layerGlobalZ = geom_->eeTopology().dddConstants().waferZ(layer, true);
247  } else if ((subdet == ForwardSubdetector::HGCHEF) || (subdet == DetId::HGCalHSi)) {
248  layerGlobalZ = geom_->fhTopology().dddConstants().waferZ(layer, true);
249  } else if ((subdet == HcalSubdetector::HcalEndcap) || (subdet == ForwardSubdetector::HGCHEB) ||
250  (subdet == DetId::HGCalHSc)) {
251  if (geom_->isV9Geometry()) {
252  layerGlobalZ = geom_->hscTopology().dddConstants().waferZ(layer, true);
253  } else {
254  layerGlobalZ = geom_->bhTopology().dddConstants()->getRZ(
256  }
257  }
258  return layerGlobalZ;
259 }
unsigned layer(const DetId &) const
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:168
const HGCalTopology & eeTopology() const
const HGCalTriggerGeometryBase * geom_
std::pair< int, int > getEtaRange(const int &i) const
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
const HGCalTopology & hscTopology() const
const HGCalTopology & fhTopology() const
float HGCalTriggerTools::getPhi ( const GlobalPoint position) const

Definition at line 209 of file HGCalTriggerTools.cc.

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

Referenced by getTCPhi().

209  {
210  float phi = atan2(position.y(), position.x());
211  return phi;
212 }
T y() const
Definition: PV3DBase.h:63
T x() const
Definition: PV3DBase.h:62
float HGCalTriggerTools::getPt ( const GlobalPoint position,
const float &  hitEnergy,
const float &  vertex_z = 0. 
) const

Definition at line 219 of file HGCalTriggerTools.cc.

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

Referenced by getTCPt().

219  {
220  float eta = getEta(position, vertex_z);
221  float pt = hitEnergy / cosh(eta);
222  return pt;
223 }
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 204 of file HGCalTriggerTools.cc.

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

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

Definition at line 214 of file HGCalTriggerTools.cc.

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

214  {
216  return getPhi(position);
217 }
float getPhi(const GlobalPoint &position) const
static int position[264][3]
Definition: ReadPGInfo.cc:509
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 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:509
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 225 of file HGCalTriggerTools.cc.

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

225  {
227  return getPt(position, hitEnergy, vertex_z);
228 }
float getPt(const GlobalPoint &position, const float &hitEnergy, const float &vertex_z=0.) const
static int position[264][3]
Definition: ReadPGInfo.cc:509
GlobalPoint getTCPosition(const DetId &id) const
const HGCalTriggerGeometryBase* HGCalTriggerTools::getTriggerGeometry ( ) const
inline

Definition at line 69 of file HGCalTriggerTools.h.

69 { return geom_; };
const HGCalTriggerGeometryBase * geom_
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().

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 46 of file HGCalTriggerTools.h.

Referenced by layerWithOffset().

46 { 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(), 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 56 of file HGCalTriggerTools.h.

Referenced by getLayerZ().

56 { 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:166
int layer() const
get the layer #
int layer() const
get the layer #
int layer() const
get the layer #
Definition: HGCalDetId.h:48
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(), and layers().

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(), checklumidiff::l, and layer().

Referenced by HGCalTriggerValidator::analyze(), HGCalTowerMap2DImpl::buildTowerMap2D(), HGCalTriggerCellCalibration::calibrateMipTinGeV(), HGCalClusteringDummyImpl::calibratePt(), HGCalClusteringImpl::calibratePt(), HGCalHistoClusteringImpl::clusterSeedMulticluster(), HGCalShowerShape::eMax(), HGCalTriggerNtupleHGCClusters::fill(), HGCalTriggerNtupleHGCTriggerCells::fill(), HGCalTriggerNtupleHGCDigis::fill(), HGCalShowerShape::firstLayer(), 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 295 of file HGCalTriggerTools.cc.

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

Referenced by thicknessIndex().

295  {
296  int thickness = 0;
297  switch (id.subdetId()) {
299  thickness = geom_->eeTopology().dddConstants().waferTypeL(HGCalDetId(id).wafer()) - 1;
300  break;
302  thickness = geom_->fhTopology().dddConstants().waferTypeL(HGCalDetId(id).wafer()) - 1;
303  break;
304  default:
305  break;
306  };
307  return thickness;
308 }
const HGCalTopology & eeTopology() const
const HGCalTriggerGeometryBase * geom_
int waferTypeL(int wafer) const
const HGCalDDDConstants & dddConstants() const
const HGCalTopology & fhTopology() const
DetId HGCalTriggerTools::simToReco ( const DetId simid,
const HGCalTopology topo 
) const

Definition at line 261 of file HGCalTriggerTools.cc.

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

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

261  {
262  DetId recoid(0);
263  const auto& dddConst = topo.dddConstants();
264  // V9
265  if (dddConst.geomMode() == HGCalGeometryMode::Hexagon8 || dddConst.geomMode() == HGCalGeometryMode::Hexagon8Full ||
266  dddConst.geomMode() == HGCalGeometryMode::Trapezoid) {
267  recoid = simid;
268  }
269  // V8
270  else {
271  int subdet(simid.subdetId());
272  int layer = 0, cell = 0, sec = 0, subsec = 0, zp = 0;
273  HGCalTestNumbering::unpackHexagonIndex(simid, subdet, zp, layer, sec, subsec, cell);
274  //sec is wafer and subsec is celltype
275  //skip this hit if after ganging it is not valid
276  auto recoLayerCell = dddConst.simToReco(cell, layer, sec, topo.detectorType());
277  cell = recoLayerCell.first;
278  layer = recoLayerCell.second;
279  if (layer >= 0 && cell >= 0) {
280  recoid = HGCalDetId((ForwardSubdetector)subdet, zp, layer, subsec, sec, cell);
281  }
282  }
283  return recoid;
284 }
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:41
Definition: DetId.h:18
const HGCalDDDConstants & dddConstants() const
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 286 of file HGCalTriggerTools.cc.

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

286  {
287  DetId recoid(0);
288  const auto& dddConst = topo.dddConstants();
289  HcalDetId id = HcalHitRelabeller::relabel(simid, dddConst);
290  if (id.subdet() == int(HcalEndcap))
291  recoid = id;
292  return recoid;
293 }
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:168
Definition: DetId.h:18
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::Forward, geom_, HGCalTriggerGeometryBase::getCellsFromTriggerCell(), DetId::HGCalEE, DetId::HGCalHSi, DetId::HGCalTrigger, mps_monitormerge::occurences, sensorCellThicknessV8(), HGCalTriggerDetId::type(), and HGCSiliconDetId::type().

Referenced by HGCalTriggerNtupleHGCTriggerCells::fill(), HGCalConcentratorSuperTriggerCellImpl::getSuperTriggerCellId(), and HGCalVFESummationImpl::triggerCellSums().

171  {
172  unsigned det = id.det();
173  int thickness = 0;
174  // For the v8 geometry
175  if (det == DetId::Forward) {
176  if (!tc)
177  thickness = sensorCellThicknessV8(id);
178  else {
179  // For the old geometry, TCs can contain sensor cells
180  // with different thicknesses.
181  // Use a majority logic to find the TC thickness
182  std::array<unsigned, 3> occurences = {{0, 0, 0}};
183  for (const auto& c_id : geom_->getCellsFromTriggerCell(id)) {
184  int c_thickness = sensorCellThicknessV8(c_id);
185  occurences[c_thickness]++;
186  }
187  thickness = std::max_element(occurences.begin(), occurences.end()) - occurences.begin();
188  }
189  }
190  // For the v9 geometry
191  else if (det == DetId::HGCalEE || det == DetId::HGCalHSi) {
192  thickness = HGCSiliconDetId(id).type();
193  } else if (det == DetId::HGCalTrigger) {
194  thickness = HGCalTriggerDetId(id).type();
195  }
196  return thickness;
197 }
virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const =0
const HGCalTriggerGeometryBase * geom_
int type() const
get the type
int type() const
get the type
int sensorCellThicknessV8(const DetId &id) const
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(), 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:149
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:51
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 89 of file HGCalTriggerTools.h.

Referenced by eventSetup(), and layers().

unsigned HGCalTriggerTools::eeLayers_
private

Definition at line 87 of file HGCalTriggerTools.h.

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

unsigned HGCalTriggerTools::fhLayers_
private

Definition at line 88 of file HGCalTriggerTools.h.

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

const HGCalTriggerGeometryBase* HGCalTriggerTools::geom_
private
unsigned HGCalTriggerTools::totalLayers_
private

Definition at line 90 of file HGCalTriggerTools.h.

Referenced by eventSetup(), and layers().