CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
hgcal::RecHitTools Class Reference

#include <RecHitTools.h>

Public Member Functions

unsigned int firstLayerBH () const
 
std::pair< int, int > getCell (const DetId &) const
 
float getEta (const DetId &id, const float &vertex_z=0.) const
 
float getEta (const GlobalPoint &position, const float &vertex_z=0.) const
 
void getEvent (const edm::Event &)
 
void getEventSetup (const edm::EventSetup &)
 
const CaloGeometrygetGeometry () const
 
int getGeometryType () const
 
unsigned int getLayer (const DetId &) const
 
unsigned int getLayer (DetId::Detector type, bool nose=false) const
 
unsigned int getLayer (ForwardSubdetector type) const
 
unsigned int getLayerWithOffset (const DetId &) const
 
float getPhi (const DetId &id) const
 
float getPhi (const GlobalPoint &position) const
 
GlobalPoint getPosition (const DetId &id) const
 
GlobalPoint getPositionLayer (int layer, bool nose=false) const
 
float getPt (const DetId &id, const float &hitEnergy, const float &vertex_z=0.) const
 
float getPt (const GlobalPoint &position, const float &hitEnergy, const float &vertex_z=0.) const
 
std::float_t getRadiusToSide (const DetId &) const
 
int getScintMaxIphi () const
 
int getSiThickIndex (const DetId &) const
 
std::float_t getSiThickness (const DetId &) const
 
const CaloSubdetectorGeometrygetSubdetectorGeometry (const DetId &id) const
 
std::pair< int, int > getWafer (const DetId &) const
 
bool isHalfCell (const DetId &) const
 
bool isOnlySilicon (const unsigned int layer) const
 
bool isSilicon (const DetId &) const
 
unsigned int lastLayer (bool nose=false) const
 
unsigned int lastLayerBH () const
 
unsigned int lastLayerEE (bool nose=false) const
 
unsigned int lastLayerFH () const
 
bool maskCell (const DetId &id, int corners=3) const
 
unsigned int maxNumberOfWafersPerLayer (bool nose=false) const
 
 RecHitTools ()
 
int zside (const DetId &id) const
 
 ~RecHitTools ()
 

Private Attributes

unsigned int bhLastLayer_
 
int bhMaxIphi_
 
unsigned int bhOffset_
 
unsigned int fhLastLayer_
 
unsigned int fhOffset_
 
const CaloGeometrygeom_
 
int geometryType_
 
unsigned int maxNumberOfWafersNose_
 
unsigned int maxNumberOfWafersPerLayer_
 
unsigned int noseLastLayer_
 

Detailed Description

Definition at line 21 of file RecHitTools.h.

Constructor & Destructor Documentation

◆ RecHitTools()

hgcal::RecHitTools::RecHitTools ( )
inline

Definition at line 23 of file RecHitTools.h.

23 : geom_(nullptr), fhOffset_(0), bhOffset_(0), fhLastLayer_(0), noseLastLayer_(0), geometryType_(0) {}

◆ ~RecHitTools()

hgcal::RecHitTools::~RecHitTools ( )
inline

Definition at line 24 of file RecHitTools.h.

24 {}

Member Function Documentation

◆ firstLayerBH()

unsigned int hgcal::RecHitTools::firstLayerBH ( ) const
inline

◆ getCell()

std::pair< int, int > RecHitTools::getCell ( const DetId id) const

Definition at line 388 of file RecHitTools.cc.

388  {
389  int cellU = std::numeric_limits<int>::max();
390  int cellV = 0;
391  if ((id.det() == DetId::HGCalEE) || (id.det() == DetId::HGCalHSi)) {
392  cellU = HGCSiliconDetId(id).cellU();
393  cellV = HGCSiliconDetId(id).cellV();
394  } else if (id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)) {
395  cellU = HFNoseDetId(id).cellU();
396  cellV = HFNoseDetId(id).cellV();
397  } else if (id.det() == DetId::Forward) {
398  cellU = HGCalDetId(id).cell();
399  } else {
400  edm::LogError("getCell::InvalidSiliconDetid")
401  << "det id: " << std::hex << id.rawId() << std::dec << ":" << id.det() << " is not HGCal silicon!";
402  }
403  return std::pair<int, int>(cellU, cellV);
404 }

References HGCalDetId::cell(), HFNoseDetId::cellU(), HGCSiliconDetId::cellU(), HFNoseDetId::cellV(), HGCSiliconDetId::cellV(), TauDecayModes::dec, DetId::Forward, HFNose, DetId::HGCalEE, DetId::HGCalHSi, and SiStripPI::max.

◆ getEta() [1/2]

float RecHitTools::getEta ( const DetId id,
const float &  vertex_z = 0. 
) const

Definition at line 436 of file RecHitTools.cc.

436  {
438  float eta = getEta(position, vertex_z);
439  return eta;
440 }

References PVValHelper::eta, getEta(), getPosition(), and position.

◆ getEta() [2/2]

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

Definition at line 431 of file RecHitTools.cc.

431  {
432  GlobalPoint corrected_position = GlobalPoint(position.x(), position.y(), position.z() - vertex_z);
433  return corrected_position.eta();
434 }

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

Referenced by getEta(), getPt(), and HGCalIsoCalculator::setRecHits().

◆ getEvent()

void RecHitTools::getEvent ( const edm::Event ev)

Definition at line 68 of file RecHitTools.cc.

68 {}

Referenced by hgcal::ClusterTools::getEvent().

◆ getEventSetup()

void RecHitTools::getEventSetup ( const edm::EventSetup es)

Definition at line 70 of file RecHitTools.cc.

70  {
73 
74  geom_ = geom.product();
75  unsigned int wmaxEE(0), wmaxFH(0);
76  auto geomEE = static_cast<const HGCalGeometry*>(
78  //check if it's the new geometry
79  if (geomEE) {
80  geometryType_ = 1;
81  fhOffset_ = (geomEE->topology().dddConstants()).layers(true);
82  wmaxEE = (geomEE->topology().dddConstants()).waferCount(0);
83  auto geomFH = static_cast<const HGCalGeometry*>(
85  wmaxFH = (geomFH->topology().dddConstants()).waferCount(0);
86  fhLastLayer_ = fhOffset_ + (geomFH->topology().dddConstants()).layers(true);
87  auto geomBH = static_cast<const HGCalGeometry*>(
89  bhOffset_ =
90  fhOffset_ + (geomBH->topology().dddConstants()).firstLayer() - (geomEE->topology().dddConstants()).firstLayer();
91  bhLastLayer_ = bhOffset_ + (geomBH->topology().dddConstants()).layers(true);
92  bhMaxIphi_ = geomBH->topology().dddConstants().maxCells(true);
93  } else {
94  geometryType_ = 0;
95  geomEE =
96  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward, ForwardSubdetector::HGCEE));
97  fhOffset_ = (geomEE->topology().dddConstants()).layers(true);
98  wmaxEE = 1 + (geomEE->topology().dddConstants()).waferMax();
99  auto geomFH =
100  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward, ForwardSubdetector::HGCHEF));
101  bhOffset_ = fhOffset_ + (geomFH->topology().dddConstants()).layers(true);
102  wmaxFH = 1 + (geomFH->topology().dddConstants()).waferMax();
104  auto geomBH =
105  static_cast<const HcalGeometry*>(geom_->getSubdetectorGeometry(DetId::Hcal, HcalSubdetector::HcalEndcap));
106  bhLastLayer_ = bhOffset_ + (geomBH->topology().dddConstants())->getMaxDepth(1);
107  }
108  maxNumberOfWafersPerLayer_ = std::max(wmaxEE, wmaxFH);
109  // For nose geometry
110  auto geomNose =
111  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward, ForwardSubdetector::HFNose));
112  if (geomNose) {
113  maxNumberOfWafersNose_ = (geomNose->topology().dddConstants()).waferCount(0);
114  noseLastLayer_ = (geomNose->topology().dddConstants()).layers(true);
115  } else {
117  noseLastLayer_ = 0;
118  }
119 }

References bhLastLayer_, bhMaxIphi_, bhOffset_, fhLastLayer_, fhOffset_, DetId::Forward, ForwardEmpty, relativeConstraints::geom, geom_, geometryType_, edm::EventSetup::get(), get, CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalEndcap, HFNose, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCEE, HGCHEF, hgcalTopologyTester_cfi::layers, SiStripPI::max, maxNumberOfWafersNose_, maxNumberOfWafersPerLayer_, and noseLastLayer_.

Referenced by HGCalHitCalibration::analyze(), HGCalShowerSeparation::analyze(), TICLLayerTileProducer::beginRun(), FilteredLayerClustersProducer::beginRun(), HGCalEgammaIDHelper::eventInit(), hgcal::ClusterTools::getEventSetup(), HGCalDepthPreClusterer::getEventSetup(), HGCal3DClustering::getEventSetup(), HGCalClusteringAlgoBase::getEventSetup(), PFHGCalRecHitCreator< DET, Layer, det, subdet >::importRecHits(), ticl::PatternRecognitionbyCA::makeTracksters(), TrackstersMergeProducer::produce(), HGCalRecHitAbsAlgo::set(), and RealisticSimClusterMapper::update().

◆ getGeometry()

const CaloGeometry* hgcal::RecHitTools::getGeometry ( ) const
inline

Definition at line 62 of file RecHitTools.h.

62 { return geom_; };

References geom_.

◆ getGeometryType()

int hgcal::RecHitTools::getGeometryType ( ) const
inline

Definition at line 72 of file RecHitTools.h.

72 { return geometryType_; }

References geometryType_.

Referenced by RealisticSimClusterMapper::buildClusters().

◆ getLayer() [1/3]

unsigned int RecHitTools::getLayer ( const DetId id) const

Definition at line 341 of file RecHitTools.cc.

341  {
342  unsigned int layer = std::numeric_limits<unsigned int>::max();
343  if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
344  layer = HGCSiliconDetId(id).layer();
345  } else if (id.det() == DetId::HGCalHSc) {
346  layer = HGCScintillatorDetId(id).layer();
347  } else if (id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)) {
348  layer = HFNoseDetId(id).layer();
349  } else if (id.det() == DetId::Forward) {
350  layer = HGCalDetId(id).layer();
351  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
352  layer = HcalDetId(id).depth();
353  }
354  return layer;
355 }

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

◆ getLayer() [2/3]

unsigned int RecHitTools::getLayer ( DetId::Detector  type,
bool  nose = false 
) const

Definition at line 299 of file RecHitTools.cc.

299  {
300  int layer;
301  switch (type) {
302  case (DetId::HGCalEE): {
303  auto geomEE =
304  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(type, ForwardSubdetector::ForwardEmpty));
305  layer = (geomEE->topology().dddConstants()).layers(true);
306  break;
307  }
308  case (DetId::HGCalHSi): {
309  auto geomFH =
310  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(type, ForwardSubdetector::ForwardEmpty));
311  layer = (geomFH->topology().dddConstants()).layers(true);
312  break;
313  }
314  case (DetId::HGCalHSc): {
315  auto geomBH =
316  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(type, ForwardSubdetector::ForwardEmpty));
317  layer = (geomBH->topology().dddConstants()).layers(true);
318  break;
319  }
320  case (DetId::Forward): {
321  if (nose) {
322  auto geomHFN = static_cast<const HGCalGeometry*>(
324  layer = (geomHFN->topology().dddConstants()).layers(true);
325  } else {
326  auto geomEE = static_cast<const HGCalGeometry*>(
328  layer = (geomEE->topology().dddConstants()).layers(true);
329  auto geomFH = static_cast<const HGCalGeometry*>(
331  layer += (geomFH->topology().dddConstants()).layers(true);
332  }
333  break;
334  }
335  default:
336  layer = 0;
337  }
338  return (unsigned int)(layer);
339 }

References DetId::Forward, ForwardEmpty, geom_, CaloGeometry::getSubdetectorGeometry(), HFNose, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, and hgcalTopologyTester_cfi::layers.

Referenced by RealisticSimClusterMapper::buildClusters(), and getLayerWithOffset().

◆ getLayer() [3/3]

unsigned int RecHitTools::getLayer ( ForwardSubdetector  type) const

Definition at line 249 of file RecHitTools.cc.

249  {
250  int layer(0);
251  switch (type) {
252  case (ForwardSubdetector::HGCEE): {
253  auto geomEE =
254  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward, ForwardSubdetector::HGCEE));
255  layer = (geomEE->topology().dddConstants()).layers(true);
256  break;
257  }
259  auto geomFH =
260  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward, ForwardSubdetector::HGCHEF));
261  layer = (geomFH->topology().dddConstants()).layers(true);
262  break;
263  }
265  auto geomBH =
266  static_cast<const HcalGeometry*>(geom_->getSubdetectorGeometry(DetId::Hcal, HcalSubdetector::HcalEndcap));
267  layer = (geomBH->topology().dddConstants())->getMaxDepth(1);
268  break;
269  }
271  auto geomEE =
272  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward, ForwardSubdetector::HGCEE));
273  layer = (geomEE->topology().dddConstants()).layers(true);
274  auto geomFH =
275  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward, ForwardSubdetector::HGCHEF));
276  layer += (geomFH->topology().dddConstants()).layers(true);
277  auto geomBH =
278  static_cast<const HcalGeometry*>(geom_->getSubdetectorGeometry(DetId::Hcal, HcalSubdetector::HcalEndcap));
279  if (geomBH)
280  layer += (geomBH->topology().dddConstants())->getMaxDepth(1);
281  auto geomBH2 =
282  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward, ForwardSubdetector::HGCHEB));
283  if (geomBH2)
284  layer += (geomBH2->topology().dddConstants()).layers(true);
285  break;
286  }
288  auto geomHFN =
289  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward, ForwardSubdetector::HFNose));
290  layer = (geomHFN->topology().dddConstants()).layers(true);
291  break;
292  }
293  default:
294  layer = 0;
295  }
296  return (unsigned int)(layer);
297 }

References DetId::Forward, ForwardEmpty, geom_, CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalEndcap, HFNose, HGCEE, HGCHEB, HGCHEF, and hgcalTopologyTester_cfi::layers.

◆ getLayerWithOffset()

unsigned int RecHitTools::getLayerWithOffset ( const DetId id) const

Definition at line 357 of file RecHitTools.cc.

357  {
358  unsigned int layer = getLayer(id);
359  if (id.det() == DetId::Forward && id.subdetId() == HGCHEF) {
360  layer += fhOffset_;
361  } else if (id.det() == DetId::HGCalHSi || id.det() == DetId::HGCalHSc) {
362  // DetId::HGCalHSc hits include the offset w.r.t. EE already
363  layer += fhOffset_;
364  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
365  layer += bhOffset_;
366  }
367  return layer;
368 }

References bhOffset_, fhOffset_, DetId::Forward, getLayer(), DetId::Hcal, HcalEndcap, DetId::HGCalHSc, DetId::HGCalHSi, and HGCHEF.

Referenced by HGCalHitCalibration::analyze(), HGCalShowerSeparation::analyze(), RealisticSimClusterMapper::buildClusters(), ticl::PatternRecognitionbyCA::energyRegressionAndID(), TrackstersMergeProducer::energyRegressionAndID(), HGCalHitCalibration::fillWithRecHits(), hgcal::ClusterTools::getLayer(), HGCalRecHitSimpleAlgo::makeRecHit(), HGCal3DClustering::organizeByLayer(), TICLLayerTileProducer::produce(), HGCalIsoCalculator::produceHGCalIso(), and hgcal::EGammaPCAHelper::storeRecHits().

◆ getPhi() [1/2]

float RecHitTools::getPhi ( const DetId id) const

Definition at line 447 of file RecHitTools.cc.

447  {
449  float phi = atan2(position.y(), position.x());
450  return phi;
451 }

References getPosition(), and position.

◆ getPhi() [2/2]

float RecHitTools::getPhi ( const GlobalPoint position) const

Definition at line 442 of file RecHitTools.cc.

442  {
443  float phi = atan2(position.y(), position.x());
444  return phi;
445 }

References position.

Referenced by HGCalIsoCalculator::setRecHits().

◆ getPosition()

GlobalPoint RecHitTools::getPosition ( const DetId id) const

Definition at line 131 of file RecHitTools.cc.

131  {
132  auto geom = getSubdetectorGeometry(id);
134  if (id.det() == DetId::Hcal) {
135  position = geom->getGeometry(id)->getPosition();
136  } else {
137  auto hg = static_cast<const HGCalGeometry*>(geom);
138  position = hg->getPosition(id);
139  }
140  return position;
141 }

References relativeConstraints::geom, HGCalGeometry::getPosition(), getSubdetectorGeometry(), DetId::Hcal, and position.

Referenced by HGCalShowerSeparation::analyze(), RealisticSimClusterMapper::buildClusters(), getEta(), getPhi(), getPt(), hgcal::ClusterTools::getWidths(), HGCalIsoCalculator::setRecHits(), and hgcal::EGammaPCAHelper::storeRecHits().

◆ getPositionLayer()

GlobalPoint RecHitTools::getPositionLayer ( int  layer,
bool  nose = false 
) const

Definition at line 143 of file RecHitTools.cc.

143  {
144  unsigned int lay = std::abs(layer);
145  double z(0);
146  if (nose) {
147  auto geomNose =
148  static_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward, ForwardSubdetector::HFNose));
149  if (geomNose) {
150  const HGCalDDDConstants* ddd = &(geomNose->topology().dddConstants());
151  if (ddd)
152  z = (layer > 0) ? ddd->waferZ(lay, true) : -ddd->waferZ(lay, true);
153  }
154  } else {
155  const HGCalDDDConstants* ddd = get_ddd(geom_, geometryType_, fhOffset_, lay);
156  if (geometryType_ == 1) {
157  if (lay > fhOffset_)
158  lay -= fhOffset_;
159  }
160  z = (layer > 0) ? ddd->waferZ(lay, true) : -ddd->waferZ(lay, true);
161  }
162  return GlobalPoint(0, 0, z);
163 }

References funct::abs(), fhOffset_, DetId::Forward, geom_, geometryType_, CaloGeometry::getSubdetectorGeometry(), HFNose, and HGCalDDDConstants::waferZ().

Referenced by hgcal::EGammaPCAHelper::findZFirstLayer(), ticl::PatternRecognitionbyCA::makeTracksters(), and TrackstersMergeProducer::produce().

◆ getPt() [1/2]

float RecHitTools::getPt ( const DetId id,
const float &  hitEnergy,
const float &  vertex_z = 0. 
) const

Definition at line 459 of file RecHitTools.cc.

459  {
461  float eta = getEta(position, vertex_z);
462  float pt = hitEnergy / cosh(eta);
463  return pt;
464 }

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

◆ getPt() [2/2]

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

Definition at line 453 of file RecHitTools.cc.

453  {
454  float eta = getEta(position, vertex_z);
455  float pt = hitEnergy / cosh(eta);
456  return pt;
457 }

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

◆ getRadiusToSide()

std::float_t RecHitTools::getRadiusToSide ( const DetId id) const

Definition at line 227 of file RecHitTools.cc.

227  {
228  auto geom = getSubdetectorGeometry(id);
230  if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
231  const HGCSiliconDetId hid(id);
232  auto ddd = get_ddd(geom, hid);
233  size = ddd->cellSizeHex(hid.type());
234  } else if (id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)) {
235  const HFNoseDetId hid(id);
236  auto ddd = get_ddd(geom, hid);
237  size = ddd->cellSizeHex(hid.type());
238  } else if (id.det() == DetId::Forward) {
239  const HGCalDetId hid(id);
240  auto ddd = get_ddd(geom, hid);
241  size = ddd->cellSizeHex(hid.waferType());
242  } else {
243  edm::LogError("getRadiusToSide::InvalidSiliconDetid")
244  << "det id: " << std::hex << id.rawId() << std::dec << ":" << id.det() << " is not HGCal silicon!";
245  }
246  return size;
247 }

References TauDecayModes::dec, DetId::Forward, relativeConstraints::geom, getSubdetectorGeometry(), HFNose, DetId::HGCalEE, DetId::HGCalHSi, SiStripPI::max, findQualityFiles::size, HFNoseDetId::type(), HGCSiliconDetId::type(), and HGCalDetId::waferType().

◆ getScintMaxIphi()

int hgcal::RecHitTools::getScintMaxIphi ( ) const
inline

Definition at line 71 of file RecHitTools.h.

71 { return bhMaxIphi_; }

References bhMaxIphi_.

Referenced by HGCalClusteringAlgoBase::getEventSetup().

◆ getSiThickIndex()

int RecHitTools::getSiThickIndex ( const DetId id) const

Definition at line 207 of file RecHitTools.cc.

207  {
208  int thickIndex = -1;
209  if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
210  thickIndex = HGCSiliconDetId(id).type();
211  } else if (id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)) {
212  thickIndex = HFNoseDetId(id).type();
213  } else if (id.det() == DetId::Forward) {
214  float thickness = getSiThickness(id);
215  if (thickness > 99. && thickness < 121.)
216  thickIndex = 0;
217  else if (thickness > 199. && thickness < 201.)
218  thickIndex = 1;
219  else if (thickness > 299. && thickness < 301.)
220  thickIndex = 2;
221  else
222  assert(thickIndex > 0 && "ERROR - silicon thickness has a nonsensical value");
223  }
224  return thickIndex;
225 }

References cms::cuda::assert(), DetId::Forward, getSiThickness(), HFNose, DetId::HGCalEE, DetId::HGCalHSi, Calorimetry_cff::thickness, HFNoseDetId::type(), and HGCSiliconDetId::type().

Referenced by hgcal::EGammaPCAHelper::storeRecHits().

◆ getSiThickness()

std::float_t RecHitTools::getSiThickness ( const DetId id) const

Definition at line 181 of file RecHitTools.cc.

181  {
182  auto geom = getSubdetectorGeometry(id);
183  std::float_t thick(0.37);
184  if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
185  const HGCSiliconDetId hid(id);
186  auto ddd = get_ddd(geom, hid);
187  thick = ddd->cellThickness(hid.layer(), hid.waferU(), hid.waferV());
188  } else if (id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)) {
189  const HFNoseDetId hid(id);
190  auto ddd = get_ddd(geom, hid);
191  thick = ddd->cellThickness(hid.layer(), hid.waferU(), hid.waferV());
192  } else if (id.det() == DetId::Forward) {
193  const HGCalDetId hid(id);
194  auto ddd = get_ddd(geom, hid);
195  thick = ddd->cellThickness(hid.layer(), hid.wafer(), 0);
196  } else {
197  LogDebug("getSiThickness::InvalidSiliconDetid")
198  << "det id: " << std::hex << id.rawId() << std::dec << ":" << id.det() << " is not HGCal silicon!";
199  // It does not make any sense to return 0.37 as thickness for a detector
200  // that is not Silicon(does it?). Mark it as 0. to be able to distinguish
201  // the case.
202  thick = 0.f;
203  }
204  return thick;
205 }

References TauDecayModes::dec, DetId::Forward, relativeConstraints::geom, getSubdetectorGeometry(), HFNose, DetId::HGCalEE, DetId::HGCalHSi, HGCalDetId::layer(), HFNoseDetId::layer(), HGCSiliconDetId::layer(), LogDebug, HGCalDetId::wafer(), HFNoseDetId::waferU(), HGCSiliconDetId::waferU(), HGCSiliconDetId::waferV(), and HFNoseDetId::waferV().

Referenced by HGCalHitCalibration::analyze(), HGCalHitCalibration::fillWithRecHits(), and getSiThickIndex().

◆ getSubdetectorGeometry()

const CaloSubdetectorGeometry * RecHitTools::getSubdetectorGeometry ( const DetId id) const

Definition at line 121 of file RecHitTools.cc.

121  {
122  DetId::Detector det = id.det();
123  int subdet = (det == DetId::HGCalEE || det == DetId::HGCalHSi || det == DetId::HGCalHSc)
125  : id.subdetId();
126  auto geom = geom_->getSubdetectorGeometry(det, subdet);
127  check_geom(geom);
128  return geom;
129 }

References ForwardEmpty, relativeConstraints::geom, geom_, CaloGeometry::getSubdetectorGeometry(), DetId::HGCalEE, DetId::HGCalHSc, and DetId::HGCalHSi.

Referenced by getPosition(), getRadiusToSide(), getSiThickness(), isHalfCell(), and maskCell().

◆ getWafer()

std::pair< int, int > RecHitTools::getWafer ( const DetId id) const

Definition at line 370 of file RecHitTools.cc.

370  {
371  int waferU = std::numeric_limits<int>::max();
372  int waferV = 0;
373  if ((id.det() == DetId::HGCalEE) || (id.det() == DetId::HGCalHSi)) {
374  waferU = HGCSiliconDetId(id).waferU();
375  waferV = HGCSiliconDetId(id).waferV();
376  } else if (id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)) {
377  waferU = HFNoseDetId(id).waferU();
378  waferV = HFNoseDetId(id).waferV();
379  } else if (id.det() == DetId::Forward) {
380  waferU = HGCalDetId(id).wafer();
381  } else {
382  edm::LogError("getWafer::InvalidSiliconDetid")
383  << "det id: " << std::hex << id.rawId() << std::dec << ":" << id.det() << " is not HGCal silicon!";
384  }
385  return std::pair<int, int>(waferU, waferV);
386 }

References TauDecayModes::dec, DetId::Forward, HFNose, DetId::HGCalEE, DetId::HGCalHSi, SiStripPI::max, HGCalDetId::wafer(), HFNoseDetId::waferU(), HGCSiliconDetId::waferU(), HGCSiliconDetId::waferV(), and HFNoseDetId::waferV().

◆ isHalfCell()

bool RecHitTools::isHalfCell ( const DetId id) const

Definition at line 406 of file RecHitTools.cc.

406  {
407  bool ishalf = false;
408  if (id.det() == DetId::Forward) {
409  HGCalDetId hid(id);
410  auto geom = getSubdetectorGeometry(hid);
411  auto ddd = get_ddd(geom, hid);
412  const int waferType = ddd->waferTypeT(hid.waferType());
413  return ddd->isHalfCell(waferType, hid.cell());
414  }
415  //new geometry is always false
416  return ishalf;
417 }

References HGCalDetId::cell(), DetId::Forward, relativeConstraints::geom, getSubdetectorGeometry(), and HGCalDetId::waferType().

◆ isOnlySilicon()

bool RecHitTools::isOnlySilicon ( const unsigned int  layer) const

Definition at line 426 of file RecHitTools.cc.

426  {
427  bool isonlysilicon = (layer % bhLastLayer_) < bhOffset_;
428  return isonlysilicon;
429 }

References bhLastLayer_, and bhOffset_.

◆ isSilicon()

bool RecHitTools::isSilicon ( const DetId id) const

Definition at line 419 of file RecHitTools.cc.

419  {
420  bool issilicon = false;
421  if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi)
422  issilicon = true;
423  return issilicon;
424 }

References DetId::HGCalEE, and DetId::HGCalHSi.

Referenced by ticl::ClusterFilterByAlgoAndSize::filter().

◆ lastLayer()

unsigned int hgcal::RecHitTools::lastLayer ( bool  nose = false) const
inline

Definition at line 67 of file RecHitTools.h.

67 { return (nose ? noseLastLayer_ : bhLastLayer_); }

References bhLastLayer_, and noseLastLayer_.

Referenced by HGCalClusteringAlgoBase::getEventSetup().

◆ lastLayerBH()

unsigned int hgcal::RecHitTools::lastLayerBH ( ) const
inline

Definition at line 66 of file RecHitTools.h.

66 { return bhLastLayer_; }

References bhLastLayer_.

Referenced by HGCal3DClustering::getEventSetup(), and hgcal::EGammaPCAHelper::setRecHitTools().

◆ lastLayerEE()

unsigned int hgcal::RecHitTools::lastLayerEE ( bool  nose = false) const
inline

◆ lastLayerFH()

unsigned int hgcal::RecHitTools::lastLayerFH ( ) const
inline

◆ maskCell()

bool RecHitTools::maskCell ( const DetId id,
int  corners = 3 
) const

Definition at line 466 of file RecHitTools.cc.

466  {
467  if (id.det() == DetId::Hcal) {
468  return false;
469  } else {
470  auto hg = static_cast<const HGCalGeometry*>(getSubdetectorGeometry(id));
471  return hg->topology().dddConstants().maskCell(id, corners);
472  }
473 }

References HGCalTopology::dddConstants(), getSubdetectorGeometry(), DetId::Hcal, HGCalDDDConstants::maskCell(), and HGCalGeometry::topology().

◆ maxNumberOfWafersPerLayer()

unsigned int hgcal::RecHitTools::maxNumberOfWafersPerLayer ( bool  nose = false) const
inline

Definition at line 68 of file RecHitTools.h.

68  {
70  }

References maxNumberOfWafersNose_, and maxNumberOfWafersPerLayer_.

◆ zside()

int RecHitTools::zside ( const DetId id) const

Definition at line 165 of file RecHitTools.cc.

165  {
166  int zside = 0;
167  if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
168  zside = HGCSiliconDetId(id).zside();
169  } else if (id.det() == DetId::HGCalHSc) {
171  } else if (id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)) {
172  zside = HFNoseDetId(id).zside();
173  } else if (id.det() == DetId::Forward) {
174  zside = HGCalDetId(id).zside();
175  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
176  zside = HcalDetId(id).zside();
177  }
178  return zside;
179 }

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

Referenced by TICLLayerTileProducer::produce().

Member Data Documentation

◆ bhLastLayer_

unsigned int hgcal::RecHitTools::bhLastLayer_
private

Definition at line 77 of file RecHitTools.h.

Referenced by getEventSetup(), isOnlySilicon(), lastLayer(), and lastLayerBH().

◆ bhMaxIphi_

int hgcal::RecHitTools::bhMaxIphi_
private

Definition at line 80 of file RecHitTools.h.

Referenced by getEventSetup(), and getScintMaxIphi().

◆ bhOffset_

unsigned int hgcal::RecHitTools::bhOffset_
private

Definition at line 77 of file RecHitTools.h.

Referenced by firstLayerBH(), getEventSetup(), getLayerWithOffset(), and isOnlySilicon().

◆ fhLastLayer_

unsigned int hgcal::RecHitTools::fhLastLayer_
private

Definition at line 77 of file RecHitTools.h.

Referenced by getEventSetup(), and lastLayerFH().

◆ fhOffset_

unsigned int hgcal::RecHitTools::fhOffset_
private

Definition at line 77 of file RecHitTools.h.

Referenced by getEventSetup(), getLayerWithOffset(), getPositionLayer(), and lastLayerEE().

◆ geom_

const CaloGeometry* hgcal::RecHitTools::geom_
private

◆ geometryType_

int hgcal::RecHitTools::geometryType_
private

Definition at line 79 of file RecHitTools.h.

Referenced by getEventSetup(), getGeometryType(), and getPositionLayer().

◆ maxNumberOfWafersNose_

unsigned int hgcal::RecHitTools::maxNumberOfWafersNose_
private

Definition at line 78 of file RecHitTools.h.

Referenced by getEventSetup(), and maxNumberOfWafersPerLayer().

◆ maxNumberOfWafersPerLayer_

unsigned int hgcal::RecHitTools::maxNumberOfWafersPerLayer_
private

Definition at line 78 of file RecHitTools.h.

Referenced by getEventSetup(), and maxNumberOfWafersPerLayer().

◆ noseLastLayer_

unsigned int hgcal::RecHitTools::noseLastLayer_
private

Definition at line 77 of file RecHitTools.h.

Referenced by getEventSetup(), and lastLayer().

hgcal::RecHitTools::geom_
const CaloGeometry * geom_
Definition: RecHitTools.h:76
hgcal::RecHitTools::getSiThickness
std::float_t getSiThickness(const DetId &) const
Definition: RecHitTools.cc:181
hgcal::RecHitTools::geometryType_
int geometryType_
Definition: RecHitTools.h:79
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
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
HFNoseDetId::layer
int layer() const
get the layer #
Definition: HFNoseDetId.h:56
HGCalDDDConstants::waferZ
double waferZ(int layer, bool reco) const
Definition: HGCalDDDConstants.cc:1367
DetId::Hcal
Definition: DetId.h:28
HGCalDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalDetId.h:49
hgcal::RecHitTools::fhLastLayer_
unsigned int fhLastLayer_
Definition: RecHitTools.h:77
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
cms::cuda::assert
assert(be >=bs)
HcalDetId::depth
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
hgcal::RecHitTools::maxNumberOfWafersNose_
unsigned int maxNumberOfWafersNose_
Definition: RecHitTools.h:78
HFNoseDetId
Definition: HFNoseDetId.h:22
HGCalDetId::layer
int layer() const
get the layer #
Definition: HGCalDetId.h:46
hgcal::RecHitTools::bhOffset_
unsigned int bhOffset_
Definition: RecHitTools.h:77
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
HGCalDDDConstants
Definition: HGCalDDDConstants.h:25
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:47
HFNoseDetId::waferU
int waferU() const
Definition: HFNoseDetId.h:75
DetId::HGCalHSi
Definition: DetId.h:33
DetId::HGCalEE
Definition: DetId.h:32
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
PVValHelper::eta
Definition: PVValidationHelpers.h:69
HFNose
Definition: ForwardSubdetector.h:11
DDAxes::z
edm::ESHandle< CaloGeometry >
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
HGCScintillatorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCScintillatorDetId.h:44
HGCEE
Definition: ForwardSubdetector.h:8
HFNoseDetId::type
int type() const
get the type
Definition: HFNoseDetId.h:50
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
hgcal::RecHitTools::maxNumberOfWafersPerLayer_
unsigned int maxNumberOfWafersPerLayer_
Definition: RecHitTools.h:78
HcalDetId
Definition: HcalDetId.h:12
HFNoseDetId::cellV
int cellV() const
Definition: HFNoseDetId.h:60
hgcal::RecHitTools::zside
int zside(const DetId &id) const
Definition: RecHitTools.cc:165
DetId::Detector
Detector
Definition: DetId.h:24
HGCSiliconDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCSiliconDetId.h:54
hgcal::RecHitTools::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:121
get
#define get
HFNoseDetId::HFNoseLayerEEmax
static const int HFNoseLayerEEmax
Definition: HFNoseDetId.h:29
HFNoseDetId::cellU
int cellU() const
get the cell #'s in u,v or in x,y
Definition: HFNoseDetId.h:59
hgcal::RecHitTools::getLayer
unsigned int getLayer(DetId::Detector type, bool nose=false) const
Definition: RecHitTools.cc:299
DDAxes::phi
hgcal::RecHitTools::getEta
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: RecHitTools.cc:431
HGCalDetId::wafer
int wafer() const
get the wafer #
Definition: HGCalDetId.h:40
HGCalDetId
Definition: HGCalDetId.h:8
HGCSiliconDetId::cellV
int cellV() const
Definition: HGCSiliconDetId.h:61
type
type
Definition: HCALResponse.h:21
HGCSiliconDetId::cellU
int cellU() const
get the cell #'s in u,v or in x,y
Definition: HGCSiliconDetId.h:60
hgcal::RecHitTools::fhOffset_
unsigned int fhOffset_
Definition: RecHitTools.h:77
HcalEndcap
Definition: HcalAssistant.h:34
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:21
DetId::HGCalHSc
Definition: DetId.h:34
hgcal::RecHitTools::noseLastLayer_
unsigned int noseLastLayer_
Definition: RecHitTools.h:77
HGCSiliconDetId::type
int type() const
get the type
Definition: HGCSiliconDetId.h:51
HGCSiliconDetId::waferU
int waferU() const
Definition: HGCSiliconDetId.h:76
hgcal::RecHitTools::bhMaxIphi_
int bhMaxIphi_
Definition: RecHitTools.h:80
HGCHEF
Definition: ForwardSubdetector.h:9
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
hgcal::RecHitTools::bhLastLayer_
unsigned int bhLastLayer_
Definition: RecHitTools.h:77
HFNoseDetId::waferV
int waferV() const
Definition: HFNoseDetId.h:78
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
hgcal::RecHitTools::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: RecHitTools.cc:131
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
HGCalDetId::cell
int cell() const
get the absolute value of the cell #'s in x and y
Definition: HGCalDetId.h:37
HGCSiliconDetId::waferV
int waferV() const
Definition: HGCSiliconDetId.h:77
HGCHEB
Definition: ForwardSubdetector.h:10
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HGCSiliconDetId::layer
int layer() const
get the layer #
Definition: HGCSiliconDetId.h:57