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
 
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 ()
 
void setGeometry (CaloGeometry const &)
 
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 23 of file RecHitTools.h.

Constructor & Destructor Documentation

◆ RecHitTools()

hgcal::RecHitTools::RecHitTools ( )
inline

Definition at line 25 of file RecHitTools.h.

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

◆ ~RecHitTools()

hgcal::RecHitTools::~RecHitTools ( )
inline

Definition at line 26 of file RecHitTools.h.

26 {}

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 384 of file RecHitTools.cc.

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

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 431 of file RecHitTools.cc.

431  {
433  float eta = getEta(position, vertex_z);
434  return eta;
435 }

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 426 of file RecHitTools.cc.

426  {
427  GlobalPoint corrected_position = GlobalPoint(position.x(), position.y(), position.z() - vertex_z);
428  return corrected_position.eta();
429 }

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

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

◆ getGeometry()

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

Definition at line 63 of file RecHitTools.h.

63 { return geom_; };

References geom_.

◆ getGeometryType()

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

Definition at line 73 of file RecHitTools.h.

73 { return geometryType_; }

References geometryType_.

Referenced by RealisticSimClusterMapper::buildClusters().

◆ getLayer() [1/3]

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

Definition at line 336 of file RecHitTools.cc.

336  {
338  if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
339  layer = HGCSiliconDetId(id).layer();
340  } else if (id.det() == DetId::HGCalHSc) {
342  } else if (id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)) {
343  layer = HFNoseDetId(id).layer();
344  } else if (id.det() == DetId::Forward) {
345  layer = HGCalDetId(id).layer();
346  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
347  layer = HcalDetId(id).depth();
348  }
349  return layer;
350 }

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

◆ getLayer() [2/3]

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

Definition at line 294 of file RecHitTools.cc.

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

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

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

◆ getLayer() [3/3]

unsigned int RecHitTools::getLayer ( ForwardSubdetector  type) const

Definition at line 244 of file RecHitTools.cc.

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

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

◆ getLayerWithOffset()

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

◆ getPhi() [1/2]

float RecHitTools::getPhi ( const DetId id) const

Definition at line 442 of file RecHitTools.cc.

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

References getPosition(), and position.

◆ getPhi() [2/2]

float RecHitTools::getPhi ( const GlobalPoint position) const

Definition at line 437 of file RecHitTools.cc.

437  {
438  float phi = atan2(position.y(), position.x());
439  return phi;
440 }

References position.

Referenced by HGCalIsoCalculator::setRecHits().

◆ getPosition()

GlobalPoint RecHitTools::getPosition ( const DetId id) const

Definition at line 126 of file RecHitTools.cc.

126  {
127  auto geom = getSubdetectorGeometry(id);
129  if (id.det() == DetId::Hcal) {
130  position = geom->getGeometry(id)->getPosition();
131  } else {
132  auto hg = static_cast<const HGCalGeometry*>(geom);
133  position = hg->getPosition(id);
134  }
135  return position;
136 }

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 138 of file RecHitTools.cc.

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

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

Referenced by PositionAtECalEntranceComputer::beginEvent(), hgcal::EGammaPCAHelper::findZFirstLayer(), TrackstersMergeProducer::produce(), and TrackstersFromSimClustersProducer::produce().

◆ getPt() [1/2]

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

Definition at line 454 of file RecHitTools.cc.

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

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 448 of file RecHitTools.cc.

448  {
449  float eta = getEta(position, vertex_z);
450  float pt = hitEnergy / cosh(eta);
451  return pt;
452 }

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

◆ getRadiusToSide()

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

Definition at line 222 of file RecHitTools.cc.

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

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 72 of file RecHitTools.h.

72 { return bhMaxIphi_; }

References bhMaxIphi_.

Referenced by HGCalClusteringAlgoBase::getEventSetup().

◆ getSiThickIndex()

int RecHitTools::getSiThickIndex ( const DetId id) const

Definition at line 202 of file RecHitTools.cc.

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

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 176 of file RecHitTools.cc.

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

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 116 of file RecHitTools.cc.

116  {
117  DetId::Detector det = id.det();
118  int subdet = (det == DetId::HGCalEE || det == DetId::HGCalHSi || det == DetId::HGCalHSc)
120  : id.subdetId();
121  auto geom = geom_->getSubdetectorGeometry(det, subdet);
122  check_geom(geom);
123  return geom;
124 }

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 366 of file RecHitTools.cc.

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

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

◆ isHalfCell()

bool RecHitTools::isHalfCell ( const DetId id) const

Definition at line 402 of file RecHitTools.cc.

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

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

◆ isOnlySilicon()

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

Definition at line 420 of file RecHitTools.cc.

420  {
421  // HFnose TODO
422  bool isonlysilicon = (layer % bhLastLayer_) < bhOffset_;
423  return isonlysilicon;
424 }

References bhLastLayer_, bhOffset_, and phase1PixelTopology::layer.

◆ isSilicon()

bool RecHitTools::isSilicon ( const DetId id) const

Definition at line 415 of file RecHitTools.cc.

415  {
416  return (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi ||
417  (id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)));
418 }

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

Referenced by ticl::ClusterFilterByAlgoAndSize::filter(), and ticl::ClusterFilterByAlgoAndSizeAndLayerRange::filter().

◆ lastLayer()

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

Definition at line 68 of file RecHitTools.h.

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

References bhLastLayer_, and noseLastLayer_.

Referenced by HGCalClusteringAlgoBase::getEventSetup(), and TICLLayerTileProducer::produce().

◆ lastLayerBH()

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

Definition at line 67 of file RecHitTools.h.

67 { 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

Definition at line 65 of file RecHitTools.h.

65 { return fhLastLayer_; }

References fhLastLayer_.

Referenced by RealisticSimClusterMapper::buildClusters(), and HGCalClusteringAlgoBase::getEventSetup().

◆ maskCell()

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

Definition at line 461 of file RecHitTools.cc.

461  {
462  if (id.det() == DetId::Hcal) {
463  return false;
464  } else {
465  auto hg = static_cast<const HGCalGeometry*>(getSubdetectorGeometry(id));
466  return hg->topology().dddConstants().maskCell(id, corners);
467  }
468 }

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 69 of file RecHitTools.h.

69  {
71  }

References maxNumberOfWafersNose_, and maxNumberOfWafersPerLayer_.

◆ setGeometry()

void RecHitTools::setGeometry ( CaloGeometry const &  geom)

Definition at line 68 of file RecHitTools.cc.

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

References bhLastLayer_, bhMaxIphi_, bhOffset_, fhLastLayer_, fhOffset_, DetId::Forward, ForwardEmpty, relativeConstraints::geom, geom_, geometryType_, 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 HeterogeneousHGCalRecHitsValidator::analyze(), HGCalShowerSeparation::analyze(), HGCalHitCalibration::analyze(), PositionAtECalEntranceComputer::beginEvent(), TICLLayerTileProducer::beginRun(), FilteredLayerClustersProducer::beginRun(), TICLTrackstersEdgesValidation::dqmBeginRun(), HGCalEgammaIDHelper::eventInit(), hgcal::ClusterTools::getEventSetup(), HGCal3DClustering::getEventSetup(), HGCalDepthPreClusterer::getEventSetup(), HGCalClusteringAlgoBase::getEventSetup(), PFHGCalRecHitCreator< DET, Layer, det, subdet >::importRecHits(), TrackstersMergeProducer::produce(), TrackstersFromSimClustersProducer::produce(), HGCalRecHitAbsAlgo::set(), and RealisticSimClusterMapper::update().

◆ zside()

int RecHitTools::zside ( const DetId id) const

Definition at line 160 of file RecHitTools.cc.

160  {
161  int zside = 0;
162  if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
163  zside = HGCSiliconDetId(id).zside();
164  } else if (id.det() == DetId::HGCalHSc) {
166  } else if (id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)) {
167  zside = HFNoseDetId(id).zside();
168  } else if (id.det() == DetId::Forward) {
169  zside = HGCalDetId(id).zside();
170  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
171  zside = HcalDetId(id).zside();
172  }
173  return zside;
174 }

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 78 of file RecHitTools.h.

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

◆ bhMaxIphi_

int hgcal::RecHitTools::bhMaxIphi_
private

Definition at line 81 of file RecHitTools.h.

Referenced by getScintMaxIphi(), and setGeometry().

◆ bhOffset_

unsigned int hgcal::RecHitTools::bhOffset_
private

Definition at line 78 of file RecHitTools.h.

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

◆ fhLastLayer_

unsigned int hgcal::RecHitTools::fhLastLayer_
private

Definition at line 78 of file RecHitTools.h.

Referenced by lastLayerFH(), and setGeometry().

◆ fhOffset_

unsigned int hgcal::RecHitTools::fhOffset_
private

Definition at line 78 of file RecHitTools.h.

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

◆ geom_

const CaloGeometry* hgcal::RecHitTools::geom_
private

◆ geometryType_

int hgcal::RecHitTools::geometryType_
private

Definition at line 80 of file RecHitTools.h.

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

◆ maxNumberOfWafersNose_

unsigned int hgcal::RecHitTools::maxNumberOfWafersNose_
private

Definition at line 79 of file RecHitTools.h.

Referenced by maxNumberOfWafersPerLayer(), and setGeometry().

◆ maxNumberOfWafersPerLayer_

unsigned int hgcal::RecHitTools::maxNumberOfWafersPerLayer_
private

Definition at line 79 of file RecHitTools.h.

Referenced by maxNumberOfWafersPerLayer(), and setGeometry().

◆ noseLastLayer_

unsigned int hgcal::RecHitTools::noseLastLayer_
private

Definition at line 78 of file RecHitTools.h.

Referenced by lastLayer(), and setGeometry().

hgcal::RecHitTools::geom_
const CaloGeometry * geom_
Definition: RecHitTools.h:77
hgcal::RecHitTools::getSiThickness
std::float_t getSiThickness(const DetId &) const
Definition: RecHitTools.cc:176
hgcal::RecHitTools::geometryType_
int geometryType_
Definition: RecHitTools.h:80
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
HFNoseDetId::layer
int layer() const
get the layer #
Definition: HFNoseDetId.h:56
HGCalDDDConstants::waferZ
double waferZ(int layer, bool reco) const
Definition: HGCalDDDConstants.cc:1390
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:78
HGCalWaferIndex::waferU
int32_t waferU(const int32_t index)
Definition: HGCalWaferIndex.cc:27
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:79
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:78
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
HGCalDDDConstants
Definition: HGCalDDDConstants.h:27
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:50
HFNoseDetId::waferU
int waferU() const
Definition: HFNoseDetId.h:75
DetId::HGCalHSi
Definition: DetId.h:33
DetId::HGCalEE
Definition: DetId.h:32
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:115
PVValHelper::eta
Definition: PVValidationHelpers.h:70
HFNose
Definition: ForwardSubdetector.h:11
DDAxes::z
HGCalWaferIndex::waferV
int32_t waferV(const int32_t index)
Definition: HGCalWaferIndex.cc:32
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:47
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
HGCEE
Definition: ForwardSubdetector.h:8
HFNoseDetId::type
int type() const
get the type
Definition: HFNoseDetId.h:50
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
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:79
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:160
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
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
hgcal::RecHitTools::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:116
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:294
DDAxes::phi
hgcal::RecHitTools::getEta
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: RecHitTools.cc:426
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
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:78
HcalEndcap
Definition: HcalAssistant.h:34
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:23
DetId::HGCalHSc
Definition: DetId.h:34
hgcal::RecHitTools::noseLastLayer_
unsigned int noseLastLayer_
Definition: RecHitTools.h:78
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:81
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:78
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:126
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