CMS 3D CMS Logo

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

#include <RecHitTools.h>

Public Member Functions

std::pair< int, int > getCell (const DetId &) const
 
float getEta (const GlobalPoint &position, const float &vertex_z=0.) const
 
float getEta (const DetId &id, 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 (DetId::Detector type) const
 
unsigned int getLayer (ForwardSubdetector type) const
 
unsigned int getLayer (const DetId &) const
 
unsigned int getLayerWithOffset (const DetId &) const
 
float getPhi (const GlobalPoint &position) const
 
float getPhi (const DetId &id) const
 
GlobalPoint getPosition (const DetId &id) const
 
GlobalPoint getPositionLayer (int layer) const
 
float getPt (const GlobalPoint &position, const float &hitEnergy, const float &vertex_z=0.) const
 
float getPt (const DetId &id, const float &hitEnergy, const float &vertex_z=0.) const
 
std::float_t getRadiusToSide (const DetId &) 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
 
unsigned int lastLayerEE () const
 
unsigned int lastLayerFH () const
 
bool maskCell (const DetId &id, int corners=3) const
 
unsigned int maxNumberOfWafersPerLayer () const
 
 RecHitTools ()
 
int zside (const DetId &id) const
 
 ~RecHitTools ()
 

Private Attributes

unsigned int bhOffset_
 
unsigned int fhLastLayer_
 
unsigned int fhOffset_
 
const CaloGeometrygeom_
 
int geometryType_
 
unsigned int maxNumberOfWafersPerLayer_
 

Detailed Description

Definition at line 20 of file RecHitTools.h.

Constructor & Destructor Documentation

hgcal::RecHitTools::RecHitTools ( )
inline

Definition at line 22 of file RecHitTools.h.

22 : geom_(nullptr), fhOffset_(0), bhOffset_(0), fhLastLayer_(0), geometryType_(0) {}
unsigned int fhLastLayer_
Definition: RecHitTools.h:65
unsigned int fhOffset_
Definition: RecHitTools.h:65
unsigned int bhOffset_
Definition: RecHitTools.h:65
const CaloGeometry * geom_
Definition: RecHitTools.h:64
hgcal::RecHitTools::~RecHitTools ( )
inline

Definition at line 23 of file RecHitTools.h.

References position, and ecaldqm::zside().

23 {}

Member Function Documentation

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

Definition at line 311 of file RecHitTools.cc.

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

311  {
312  int cellU = std::numeric_limits<int>::max();
313  int cellV = 0;
314  if (id.det() == DetId::Forward) {
315  cellU = HGCalDetId(id).cell();
316  } else if ((id.det() == DetId::HGCalEE) || (id.det() == DetId::HGCalHSi)) {
317  cellU = HGCSiliconDetId(id).cellU();
318  cellV = HGCSiliconDetId(id).cellV();
319  } else {
320  edm::LogError("getCell::InvalidSiliconDetid")
321  << "det id: " << std::hex << id.rawId() << std::dec << ":"
322  << id.det() << " is not HGCal silicon!";
323  }
324  return std::pair<int,int>(cellU,cellV);
325 }
int cellV() const
int cellU() const
get the cell #&#39;s in u,v or in x,y
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCalDetId.h:39
float RecHitTools::getEta ( const GlobalPoint position,
const float &  vertex_z = 0. 
) const

Definition at line 340 of file RecHitTools.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 getEta(), getPt(), and HGCalIsoCalculator::setRecHits().

340  {
341  GlobalPoint corrected_position = GlobalPoint(position.x(), position.y(), position.z()-vertex_z);
342  return corrected_position.eta();
343 }
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 RecHitTools::getEta ( const DetId id,
const float &  vertex_z = 0. 
) const

Definition at line 345 of file RecHitTools.cc.

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

345  {
347  float eta = getEta(position, vertex_z);
348  return eta;
349 }
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: RecHitTools.cc:340
GlobalPoint getPosition(const DetId &id) const
Definition: RecHitTools.cc:112
static int position[264][3]
Definition: ReadPGInfo.cc:509
void RecHitTools::getEvent ( const edm::Event ev)

Definition at line 70 of file RecHitTools.cc.

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

70  {
71 }
void RecHitTools::getEventSetup ( const edm::EventSetup es)

Definition at line 73 of file RecHitTools.cc.

References bhOffset_, fhLastLayer_, fhOffset_, DetId::Forward, ForwardEmpty, relativeConstraints::geom, geom_, geometryType_, edm::EventSetup::get(), CaloGeometry::getSubdetectorGeometry(), DetId::HGCalEE, DetId::HGCalHSi, HGCEE, HGCHEF, LayerTriplets::layers(), SiStripPI::max, maxNumberOfWafersPerLayer_, and edm::ESHandle< T >::product().

Referenced by HGCalHitCalibration::analyze(), HGCalShowerSeparation::analyze(), HGCalEgammaIDHelper::eventInit(), hgcal::ClusterTools::getEventSetup(), HGCal3DClustering::getEventSetup(), PFHGCalRecHitCreator< DET, Layer, det, subdet >::importRecHits(), and RealisticSimClusterMapper::update().

73  {
74 
76  es.get<CaloGeometryRecord>().get(geom);
77 
78  geom_ = geom.product();
79  unsigned int wmaxEE(0), wmaxFH(0);
81  //check if it's the new geometry
82  if(geomEE) {
83  geometryType_ = 1;
84  fhOffset_ = (geomEE->topology().dddConstants()).layers(true);
85  wmaxEE = (geomEE->topology().dddConstants()).waferCount(0);
88  wmaxFH = (geomFH->topology().dddConstants()).waferCount(0);
89  fhLastLayer_ = fhOffset_ + (geomFH->topology().dddConstants()).layers(true);
90  }
91  else {
92  geometryType_ = 0;
94  fhOffset_ = (geomEE->topology().dddConstants()).layers(true);
95  wmaxEE = 1 + (geomEE->topology().dddConstants()).waferMax();
97  bhOffset_ = fhOffset_ + (geomFH->topology().dddConstants()).layers(true);
98  wmaxFH = 1 + (geomFH->topology().dddConstants()).waferMax();
100  }
101  maxNumberOfWafersPerLayer_ = std::max(wmaxEE,wmaxFH);
102 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
unsigned int fhLastLayer_
Definition: RecHitTools.h:65
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
unsigned int fhOffset_
Definition: RecHitTools.h:65
unsigned int bhOffset_
Definition: RecHitTools.h:65
unsigned int maxNumberOfWafersPerLayer_
Definition: RecHitTools.h:65
const CaloGeometry * geom_
Definition: RecHitTools.h:64
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
const CaloGeometry* hgcal::RecHitTools::getGeometry ( ) const
inline

Definition at line 57 of file RecHitTools.h.

57 {return geom_;};
const CaloGeometry * geom_
Definition: RecHitTools.h:64
int hgcal::RecHitTools::getGeometryType ( ) const
inline

Definition at line 61 of file RecHitTools.h.

Referenced by RealisticSimClusterMapper::buildClusters().

61 {return geometryType_;}
unsigned int RecHitTools::getLayer ( DetId::Detector  type) const

Definition at line 238 of file RecHitTools.cc.

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

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

238  {
239 
240  int layer;
241  switch (type) {
242  case(DetId::HGCalEE): {
244  layer = (geomEE->topology().dddConstants()).layers(true);
245  break;
246  }
247  case (DetId::HGCalHSi): {
249  layer = (geomFH->topology().dddConstants()).layers(true);
250  break;
251  }
252  case (DetId::HGCalHSc): {
254  layer = (geomBH->topology().dddConstants()).layers(true);
255  break;
256  }
257  case (DetId::Forward): {
259  layer = (geomEE->topology().dddConstants()).layers(true);
261  layer += (geomFH->topology().dddConstants()).layers(true);
262  break;
263  }
264  default: layer = 0;
265  }
266  return (unsigned int)(layer);
267 }
type
Definition: HCALResponse.h:21
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
const CaloGeometry * geom_
Definition: RecHitTools.h:64
unsigned int RecHitTools::getLayer ( ForwardSubdetector  type) const

Definition at line 205 of file RecHitTools.cc.

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

205  {
206 
207  int layer;
208  switch (type) {
211  layer = (geomEE->topology().dddConstants()).layers(true);
212  break;
213  }
216  layer = (geomFH->topology().dddConstants()).layers(true);
217  break;
218  }
221  layer = (geomBH->topology().dddConstants())->getMaxDepth(1);
222  break;
223  }
226  layer = (geomEE->topology().dddConstants()).layers(true);
228  layer += (geomFH->topology().dddConstants()).layers(true);
230  layer += (geomBH->topology().dddConstants())->getMaxDepth(1);
231  break;
232  }
233  default: layer = 0;
234  }
235  return (unsigned int)(layer);
236 }
type
Definition: HCALResponse.h:21
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
const CaloGeometry * geom_
Definition: RecHitTools.h:64
unsigned int RecHitTools::getLayer ( const DetId id) const

Definition at line 269 of file RecHitTools.cc.

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

269  {
270  unsigned int layer = std::numeric_limits<unsigned int>::max();
271  if (id.det() == DetId::Forward) {
272  layer = HGCalDetId(id).layer();
273  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
274  layer = HcalDetId(id).depth();
275  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
276  layer = HGCSiliconDetId(id).layer();
277  } else if (id.det() == DetId::HGCalHSc) {
278  layer = HGCScintillatorDetId(id).layer();
279  }
280  return layer;
281 }
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 int RecHitTools::getLayerWithOffset ( const DetId id) const

Definition at line 283 of file RecHitTools.cc.

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

Referenced by HGCalHitCalibration::analyze(), HGCalShowerSeparation::analyze(), RealisticSimClusterMapper::buildClusters(), HGCalHitCalibration::fillWithRecHits(), hgcal::ClusterTools::getLayer(), HGCal3DClustering::organizeByLayer(), HGCalIsoCalculator::produceHGCalIso(), and hgcal::EGammaPCAHelper::storeRecHits().

283  {
284  unsigned int layer = getLayer(id);
285  if (id.det() == DetId::Forward && id.subdetId() == HGCHEF ) {
286  layer += fhOffset_;
287  } else if (id.det() == DetId::HGCalHSi || id.det() == DetId::HGCalHSc) {
288  layer += fhOffset_;
289  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
290  layer += bhOffset_;
291  }
292  return layer;
293 }
unsigned int getLayer(DetId::Detector type) const
Definition: RecHitTools.cc:238
unsigned int fhOffset_
Definition: RecHitTools.h:65
unsigned int bhOffset_
Definition: RecHitTools.h:65
float RecHitTools::getPhi ( const GlobalPoint position) const

Definition at line 351 of file RecHitTools.cc.

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

Referenced by HGCalIsoCalculator::setRecHits().

351  {
352  float phi = atan2(position.y(),position.x());
353  return phi;
354 }
T y() const
Definition: PV3DBase.h:63
T x() const
Definition: PV3DBase.h:62
float RecHitTools::getPhi ( const DetId id) const

Definition at line 356 of file RecHitTools.cc.

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

356  {
358  float phi = atan2(position.y(),position.x());
359  return phi;
360 }
T y() const
Definition: PV3DBase.h:63
GlobalPoint getPosition(const DetId &id) const
Definition: RecHitTools.cc:112
static int position[264][3]
Definition: ReadPGInfo.cc:509
T x() const
Definition: PV3DBase.h:62
GlobalPoint RecHitTools::getPosition ( const DetId id) const

Definition at line 112 of file RecHitTools.cc.

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

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

112  {
113  auto geom = getSubdetectorGeometry(id);
115  if (id.det() == DetId::Hcal) {
116  position = geom->getGeometry(id)->getPosition();
117  } else {
118  auto hg = static_cast<const HGCalGeometry*>(geom);
119  position = hg->getPosition(id);
120  }
121  return position;
122 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:104
static int position[264][3]
Definition: ReadPGInfo.cc:509
GlobalPoint RecHitTools::getPositionLayer ( int  layer) const

Definition at line 124 of file RecHitTools.cc.

References funct::abs(), fhOffset_, geom_, geometryType_, and HGCalDDDConstants::waferZ().

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

124  {
125  int lay = std::abs(layer);
126  const HGCalDDDConstants* ddd = get_ddd(geom_, geometryType_, fhOffset_, lay);
127  double z = (layer > 0) ? ddd->waferZ(lay,true) : -ddd->waferZ(lay,true);
128  return GlobalPoint(0,0,z);
129 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
unsigned int fhOffset_
Definition: RecHitTools.h:65
const CaloGeometry * geom_
Definition: RecHitTools.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double waferZ(int layer, bool reco) const
float RecHitTools::getPt ( const GlobalPoint position,
const float &  hitEnergy,
const float &  vertex_z = 0. 
) const

Definition at line 362 of file RecHitTools.cc.

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

362  {
363  float eta = getEta(position, vertex_z);
364  float pt = hitEnergy / cosh(eta);
365  return pt;
366 }
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: RecHitTools.cc:340
float RecHitTools::getPt ( const DetId id,
const float &  hitEnergy,
const float &  vertex_z = 0. 
) const

Definition at line 368 of file RecHitTools.cc.

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

368  {
370  float eta = getEta(position, vertex_z);
371  float pt = hitEnergy / cosh(eta);
372  return pt;
373 }
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: RecHitTools.cc:340
GlobalPoint getPosition(const DetId &id) const
Definition: RecHitTools.cc:112
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::float_t RecHitTools::getRadiusToSide ( const DetId id) const

Definition at line 186 of file RecHitTools.cc.

References HGCalDDDConstants::cellSizeHex(), TauDecayModes::dec, DetId::Forward, getSubdetectorGeometry(), DetId::HGCalEE, DetId::HGCalHSi, SiStripPI::max, findQualityFiles::size, HGCSiliconDetId::type(), and HGCalDetId::waferType().

186  {
187  auto geom = getSubdetectorGeometry(id);
189  if (id.det() == DetId::Forward) {
190  const HGCalDetId hid(id);
191  auto ddd = get_ddd(geom,hid);
192  size = ddd->cellSizeHex(hid.waferType());
193  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
194  const HGCSiliconDetId hid(id);
195  auto ddd = get_ddd(geom,hid);
196  size = ddd->cellSizeHex(hid.type());
197  } else {
198  edm::LogError("getRadiusToSide::InvalidSiliconDetid")
199  << "det id: " << std::hex << id.rawId() << std::dec << ":"
200  << id.det() << " is not HGCal silicon!";
201  }
202  return size;
203 }
size
Write out results.
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:104
int RecHitTools::getSiThickIndex ( const DetId id) const

Definition at line 168 of file RecHitTools.cc.

References DetId::Forward, getSiThickness(), DetId::HGCalEE, DetId::HGCalHSi, and HGCSiliconDetId::type().

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

168  {
169  int thickIndex = -1;
170  if (id.det() == DetId::Forward) {
171  float thickness = getSiThickness(id);
172  if (thickness > 99. && thickness < 121.)
173  thickIndex = 0;
174  else if (thickness > 199. && thickness < 201.)
175  thickIndex = 1;
176  else if (thickness > 299. && thickness < 301.)
177  thickIndex = 2;
178  else
179  assert(thickIndex > 0 && "ERROR - silicon thickness has a nonsensical value");
180  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
181  thickIndex = HGCSiliconDetId(id).type();
182  }
183  return thickIndex;
184 }
int type() const
get the type
std::float_t getSiThickness(const DetId &) const
Definition: RecHitTools.cc:145
std::float_t RecHitTools::getSiThickness ( const DetId id) const

Definition at line 145 of file RecHitTools.cc.

References HGCalDDDConstants::cellThickness(), TauDecayModes::dec, DetId::Forward, getSubdetectorGeometry(), DetId::HGCalEE, DetId::HGCalHSi, HGCalDetId::layer(), HGCSiliconDetId::layer(), LogDebug, HGCalDetId::wafer(), HGCSiliconDetId::waferU(), and HGCSiliconDetId::waferV().

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

145  {
146  auto geom = getSubdetectorGeometry(id);
147  std::float_t thick(0.37);
148  if (id.det() == DetId::Forward) {
149  const HGCalDetId hid(id);
150  auto ddd = get_ddd(geom,hid);
151  thick = ddd->cellThickness(hid.layer(),hid.wafer(),0);
152  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
153  const HGCSiliconDetId hid(id);
154  auto ddd = get_ddd(geom,hid);
155  thick = ddd->cellThickness(hid.layer(),hid.waferU(),hid.waferV());
156  } else {
157  LogDebug("getSiThickness::InvalidSiliconDetid")
158  << "det id: " << std::hex << id.rawId() << std::dec << ":"
159  << id.det() << " is not HGCal silicon!";
160  // It does not make any sense to return 0.37 as thickness for a detector
161  // that is not Silicon(does it?). Mark it as 0. to be able to distinguish
162  // the case.
163  thick = 0.f;
164  }
165  return thick;
166 }
#define LogDebug(id)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:104
const CaloSubdetectorGeometry * RecHitTools::getSubdetectorGeometry ( const DetId id) const

Definition at line 104 of file RecHitTools.cc.

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

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

104  {
105  DetId::Detector det = id.det();
106  int subdet = (det == DetId::HGCalEE || det == DetId::HGCalHSi || det == DetId::HGCalHSc) ? ForwardSubdetector::ForwardEmpty : id.subdetId();
107  auto geom = geom_->getSubdetectorGeometry(det,subdet);
108  check_geom(geom);
109  return geom;
110 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
const CaloGeometry * geom_
Definition: RecHitTools.h:64
Detector
Definition: DetId.h:26
std::pair< int, int > RecHitTools::getWafer ( const DetId id) const

Definition at line 295 of file RecHitTools.cc.

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

295  {
296  int waferU = std::numeric_limits<int>::max();
297  int waferV = 0;
298  if (id.det() == DetId::Forward) {
299  waferU = HGCalDetId(id).wafer();
300  } else if ((id.det() == DetId::HGCalEE) || (id.det() == DetId::HGCalHSi)) {
301  waferU = HGCSiliconDetId(id).waferU();
302  waferV = HGCSiliconDetId(id).waferV();
303  } else {
304  edm::LogError("getWafer::InvalidSiliconDetid")
305  << "det id: " << std::hex << id.rawId() << std::dec << ":"
306  << id.det() << " is not HGCal silicon!";
307  }
308  return std::pair<int,int>(waferU,waferV);
309 }
int waferU() const
int waferV() const
int wafer() const
get the wafer #
Definition: HGCalDetId.h:42
bool RecHitTools::isHalfCell ( const DetId id) const

Definition at line 327 of file RecHitTools.cc.

References HGCalDetId::cell(), DetId::Forward, getSubdetectorGeometry(), HGCalDDDConstants::isHalfCell(), HGCalDetId::waferType(), and HGCalDDDConstants::waferTypeT().

327  {
328  bool ishalf = false;
329  if (id.det() == DetId::Forward) {
330  HGCalDetId hid(id);
331  auto geom = getSubdetectorGeometry(hid);
332  auto ddd = get_ddd(geom,hid);
333  const int waferType = ddd->waferTypeT(hid.waferType());
334  return ddd->isHalfCell(waferType,hid.cell());
335  }
336  //new geometry is always false
337  return ishalf;
338 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:104
unsigned int hgcal::RecHitTools::lastLayerEE ( ) const
inline

Definition at line 58 of file RecHitTools.h.

Referenced by RealisticSimClusterMapper::buildClusters(), and hgcal::EGammaPCAHelper::computePCA().

58 {return fhOffset_;}
unsigned int fhOffset_
Definition: RecHitTools.h:65
unsigned int hgcal::RecHitTools::lastLayerFH ( ) const
inline

Definition at line 59 of file RecHitTools.h.

Referenced by RealisticSimClusterMapper::buildClusters().

59 {return fhLastLayer_;}
unsigned int fhLastLayer_
Definition: RecHitTools.h:65
bool RecHitTools::maskCell ( const DetId id,
int  corners = 3 
) const

Definition at line 375 of file RecHitTools.cc.

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

375  {
376  if (id.det() == DetId::Hcal) {
377  return false;
378  } else {
379  auto hg = static_cast<const HGCalGeometry*>(getSubdetectorGeometry(id));
380  return hg->topology().dddConstants().maskCell(id, corners);
381  }
382 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:104
const HGCalTopology & topology() const
const HGCalDDDConstants & dddConstants() const
bool maskCell(const DetId &id, int corners) const
unsigned int hgcal::RecHitTools::maxNumberOfWafersPerLayer ( ) const
inline

Definition at line 60 of file RecHitTools.h.

unsigned int maxNumberOfWafersPerLayer_
Definition: RecHitTools.h:65
int RecHitTools::zside ( const DetId id) const

Definition at line 131 of file RecHitTools.cc.

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

131  {
132  int zside = 0;
133  if (id.det() == DetId::Forward) {
134  zside = HGCalDetId(id).zside();
135  } else if( id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
136  zside = HcalDetId(id).zside();
137  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
138  zside = HGCSiliconDetId(id).zside();
139  } else if (id.det() == DetId::HGCalHSc) {
140  zside = HGCScintillatorDetId(id).zside();
141  }
142  return zside;
143 }
int zside(const DetId &id) const
Definition: RecHitTools.cc:131
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)
Definition: HGCalDetId.h:51
int zside() const
get the z-side of the cell (1/-1)

Member Data Documentation

unsigned int hgcal::RecHitTools::bhOffset_
private

Definition at line 65 of file RecHitTools.h.

Referenced by getEventSetup(), and getLayerWithOffset().

unsigned int hgcal::RecHitTools::fhLastLayer_
private

Definition at line 65 of file RecHitTools.h.

Referenced by getEventSetup().

unsigned int hgcal::RecHitTools::fhOffset_
private

Definition at line 65 of file RecHitTools.h.

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

const CaloGeometry* hgcal::RecHitTools::geom_
private

Definition at line 64 of file RecHitTools.h.

Referenced by getEventSetup(), getLayer(), getPositionLayer(), and getSubdetectorGeometry().

int hgcal::RecHitTools::geometryType_
private

Definition at line 66 of file RecHitTools.h.

Referenced by getEventSetup(), and getPositionLayer().

unsigned int hgcal::RecHitTools::maxNumberOfWafersPerLayer_
private

Definition at line 65 of file RecHitTools.h.

Referenced by getEventSetup().