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
 
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:64
unsigned int fhOffset_
Definition: RecHitTools.h:64
unsigned int bhOffset_
Definition: RecHitTools.h:64
const CaloGeometry * geom_
Definition: RecHitTools.h:63
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 332 of file RecHitTools.cc.

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

332  {
333  int cellU = std::numeric_limits<int>::max();
334  int cellV = 0;
335  if (id.det() == DetId::Forward) {
336  cellU = HGCalDetId(id).cell();
337  } else if ((id.det() == DetId::HGCalEE) || (id.det() == DetId::HGCalHSi)) {
338  cellU = HGCSiliconDetId(id).cellU();
339  cellV = HGCSiliconDetId(id).cellV();
340  } else {
341  edm::LogError("getCell::InvalidSiliconDetid")
342  << "det id: " << std::hex << id.rawId() << std::dec << ":"
343  << id.det() << " is not HGCal silicon!";
344  }
345  return std::pair<int,int>(cellU,cellV);
346 }
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 361 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().

361  {
362  GlobalPoint corrected_position = GlobalPoint(position.x(), position.y(), position.z()-vertex_z);
363  return corrected_position.eta();
364 }
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 366 of file RecHitTools.cc.

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

366  {
368  float eta = getEta(position, vertex_z);
369  return eta;
370 }
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: RecHitTools.cc:361
GlobalPoint getPosition(const DetId &id) const
Definition: RecHitTools.cc:133
static int position[264][3]
Definition: ReadPGInfo.cc:509
void RecHitTools::getEvent ( const edm::Event ev)

Definition at line 91 of file RecHitTools.cc.

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

91  {
92 }
void RecHitTools::getEventSetup ( const edm::EventSetup es)

Definition at line 94 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(), HGCalImagingAlgo::getEventSetup(), PFHGCalRecHitCreator< DET, Layer, det, subdet >::importRecHits(), and RealisticSimClusterMapper::update().

94  {
95 
97  es.get<CaloGeometryRecord>().get(geom);
98 
99  geom_ = geom.product();
100  unsigned int wmaxEE(0), wmaxFH(0);
102  //check if it's the new geometry
103  if(geomEE) {
104  geometryType_ = 1;
105  fhOffset_ = (geomEE->topology().dddConstants()).layers(true);
106  wmaxEE = (geomEE->topology().dddConstants()).waferCount(0);
109  wmaxFH = (geomFH->topology().dddConstants()).waferCount(0);
110  fhLastLayer_ = fhOffset_ + (geomFH->topology().dddConstants()).layers(true);
111  }
112  else {
113  geometryType_ = 0;
115  fhOffset_ = (geomEE->topology().dddConstants()).layers(true);
116  wmaxEE = 1 + (geomEE->topology().dddConstants()).waferMax();
118  bhOffset_ = fhOffset_ + (geomFH->topology().dddConstants()).layers(true);
119  wmaxFH = 1 + (geomFH->topology().dddConstants()).waferMax();
121  }
122  maxNumberOfWafersPerLayer_ = std::max(wmaxEE,wmaxFH);
123 }
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:64
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
unsigned int fhOffset_
Definition: RecHitTools.h:64
unsigned int bhOffset_
Definition: RecHitTools.h:64
unsigned int maxNumberOfWafersPerLayer_
Definition: RecHitTools.h:64
const CaloGeometry * geom_
Definition: RecHitTools.h:63
T get() const
Definition: EventSetup.h:62
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:63
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 259 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().

259  {
260 
261  int layer;
262  switch (type) {
263  case(DetId::HGCalEE): {
265  layer = (geomEE->topology().dddConstants()).layers(true);
266  break;
267  }
268  case (DetId::HGCalHSi): {
270  layer = (geomFH->topology().dddConstants()).layers(true);
271  break;
272  }
273  case (DetId::HGCalHSc): {
275  layer = (geomBH->topology().dddConstants()).layers(true);
276  break;
277  }
278  case (DetId::Forward): {
280  layer = (geomEE->topology().dddConstants()).layers(true);
282  layer += (geomFH->topology().dddConstants()).layers(true);
283  break;
284  }
285  default: layer = 0;
286  }
287  return (unsigned int)(layer);
288 }
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:63
unsigned int RecHitTools::getLayer ( ForwardSubdetector  type) const

Definition at line 226 of file RecHitTools.cc.

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

226  {
227 
228  int layer;
229  switch (type) {
232  layer = (geomEE->topology().dddConstants()).layers(true);
233  break;
234  }
237  layer = (geomFH->topology().dddConstants()).layers(true);
238  break;
239  }
242  layer = (geomBH->topology().dddConstants())->getMaxDepth(1);
243  break;
244  }
247  layer = (geomEE->topology().dddConstants()).layers(true);
249  layer += (geomFH->topology().dddConstants()).layers(true);
251  layer += (geomBH->topology().dddConstants())->getMaxDepth(1);
252  break;
253  }
254  default: layer = 0;
255  }
256  return (unsigned int)(layer);
257 }
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:63
unsigned int RecHitTools::getLayer ( const DetId id) const

Definition at line 290 of file RecHitTools.cc.

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

290  {
291  unsigned int layer = std::numeric_limits<unsigned int>::max();
292  if (id.det() == DetId::Forward) {
293  layer = HGCalDetId(id).layer();
294  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
295  layer = HcalDetId(id).depth();
296  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
297  layer = HGCSiliconDetId(id).layer();
298  } else if (id.det() == DetId::HGCalHSc) {
299  layer = HGCScintillatorDetId(id).layer();
300  }
301  return layer;
302 }
int depth() const
get the tower depth
Definition: HcalDetId.h:162
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 304 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(), HGCalImagingAlgo::populate(), HGCalIsoCalculator::produceHGCalIso(), and hgcal::EGammaPCAHelper::storeRecHits().

304  {
305  unsigned int layer = getLayer(id);
306  if (id.det() == DetId::Forward && id.subdetId() == HGCHEF ) {
307  layer += fhOffset_;
308  } else if (id.det() == DetId::HGCalHSi || id.det() == DetId::HGCalHSc) {
309  layer += fhOffset_;
310  } else if (id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
311  layer += bhOffset_;
312  }
313  return layer;
314 }
unsigned int getLayer(DetId::Detector type) const
Definition: RecHitTools.cc:259
unsigned int fhOffset_
Definition: RecHitTools.h:64
unsigned int bhOffset_
Definition: RecHitTools.h:64
float RecHitTools::getPhi ( const GlobalPoint position) const

Definition at line 372 of file RecHitTools.cc.

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

Referenced by HGCalIsoCalculator::setRecHits().

372  {
373  float phi = atan2(position.y(),position.x());
374  return phi;
375 }
T y() const
Definition: PV3DBase.h:63
T x() const
Definition: PV3DBase.h:62
float RecHitTools::getPhi ( const DetId id) const

Definition at line 377 of file RecHitTools.cc.

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

377  {
379  float phi = atan2(position.y(),position.x());
380  return phi;
381 }
T y() const
Definition: PV3DBase.h:63
GlobalPoint getPosition(const DetId &id) const
Definition: RecHitTools.cc:133
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 133 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(), HGCalImagingAlgo::Hexel::Hexel(), HGCalImagingAlgo::populate(), HGCalIsoCalculator::setRecHits(), and hgcal::EGammaPCAHelper::storeRecHits().

133  {
134  auto geom = getSubdetectorGeometry(id);
136  if (id.det() == DetId::Hcal) {
137  position = geom->getGeometry(id)->getPosition();
138  } else {
139  auto hg = static_cast<const HGCalGeometry*>(geom);
140  position = hg->getPosition(id);
141  }
142  return position;
143 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:125
static int position[264][3]
Definition: ReadPGInfo.cc:509
GlobalPoint RecHitTools::getPositionLayer ( int  layer) const

Definition at line 145 of file RecHitTools.cc.

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

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

145  {
146  int lay = std::abs(layer);
147  const HGCalDDDConstants* ddd = get_ddd(geom_, geometryType_, fhOffset_, lay);
148  double z = (layer > 0) ? ddd->waferZ(lay,true) : -ddd->waferZ(lay,true);
149  return GlobalPoint(0,0,z);
150 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
unsigned int fhOffset_
Definition: RecHitTools.h:64
const CaloGeometry * geom_
Definition: RecHitTools.h:63
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 383 of file RecHitTools.cc.

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

383  {
384  float eta = getEta(position, vertex_z);
385  float pt = hitEnergy / cosh(eta);
386  return pt;
387 }
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: RecHitTools.cc:361
float RecHitTools::getPt ( const DetId id,
const float &  hitEnergy,
const float &  vertex_z = 0. 
) const

Definition at line 389 of file RecHitTools.cc.

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

389  {
391  float eta = getEta(position, vertex_z);
392  float pt = hitEnergy / cosh(eta);
393  return pt;
394 }
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: RecHitTools.cc:361
GlobalPoint getPosition(const DetId &id) const
Definition: RecHitTools.cc:133
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::float_t RecHitTools::getRadiusToSide ( const DetId id) const

Definition at line 207 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().

207  {
208  auto geom = getSubdetectorGeometry(id);
210  if (id.det() == DetId::Forward) {
211  const HGCalDetId hid(id);
212  auto ddd = get_ddd(geom,hid);
213  size = ddd->cellSizeHex(hid.waferType());
214  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
215  const HGCSiliconDetId hid(id);
216  auto ddd = get_ddd(geom,hid);
217  size = ddd->cellSizeHex(hid.type());
218  } else {
219  edm::LogError("getRadiusToSide::InvalidSiliconDetid")
220  << "det id: " << std::hex << id.rawId() << std::dec << ":"
221  << id.det() << " is not HGCal silicon!";
222  }
223  return size;
224 }
size
Write out results.
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:125
int RecHitTools::getSiThickIndex ( const DetId id) const

Definition at line 189 of file RecHitTools.cc.

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

Referenced by HGCalImagingAlgo::populate(), and hgcal::EGammaPCAHelper::storeRecHits().

189  {
190  int thickIndex = -1;
191  if (id.det() == DetId::Forward) {
192  float thickness = getSiThickness(id);
193  if (thickness > 99. && thickness < 121.)
194  thickIndex = 0;
195  else if (thickness > 199. && thickness < 201.)
196  thickIndex = 1;
197  else if (thickness > 299. && thickness < 301.)
198  thickIndex = 2;
199  else
200  assert(thickIndex > 0 && "ERROR - silicon thickness has a nonsensical value");
201  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
202  thickIndex = HGCSiliconDetId(id).type();
203  }
204  return thickIndex;
205 }
int type() const
get the type
std::float_t getSiThickness(const DetId &) const
Definition: RecHitTools.cc:166
std::float_t RecHitTools::getSiThickness ( const DetId id) const

Definition at line 166 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(), getSiThickIndex(), and HGCalImagingAlgo::populate().

166  {
167  auto geom = getSubdetectorGeometry(id);
168  std::float_t thick(0.37);
169  if (id.det() == DetId::Forward) {
170  const HGCalDetId hid(id);
171  auto ddd = get_ddd(geom,hid);
172  thick = ddd->cellThickness(hid.layer(),hid.wafer(),0);
173  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
174  const HGCSiliconDetId hid(id);
175  auto ddd = get_ddd(geom,hid);
176  thick = ddd->cellThickness(hid.layer(),hid.waferU(),hid.waferV());
177  } else {
178  LogDebug("getSiThickness::InvalidSiliconDetid")
179  << "det id: " << std::hex << id.rawId() << std::dec << ":"
180  << id.det() << " is not HGCal silicon!";
181  // It does not make any sense to return 0.37 as thickness for a detector
182  // that is not Silicon(does it?). Mark it as 0. to be able to distinguish
183  // the case.
184  thick = 0.f;
185  }
186  return thick;
187 }
#define LogDebug(id)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:125
const CaloSubdetectorGeometry * RecHitTools::getSubdetectorGeometry ( const DetId id) const

Definition at line 125 of file RecHitTools.cc.

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

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

125  {
126  DetId::Detector det = id.det();
127  int subdet = (det == DetId::HGCalEE || det == DetId::HGCalHSi || det == DetId::HGCalHSc) ? ForwardSubdetector::ForwardEmpty : id.subdetId();
128  auto geom = geom_->getSubdetectorGeometry(det,subdet);
129  check_geom(geom);
130  return geom;
131 }
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:63
Detector
Definition: DetId.h:26
std::pair< int, int > RecHitTools::getWafer ( const DetId id) const

Definition at line 316 of file RecHitTools.cc.

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

316  {
317  int waferU = std::numeric_limits<int>::max();
318  int waferV = 0;
319  if (id.det() == DetId::Forward) {
320  waferU = HGCalDetId(id).wafer();
321  } else if ((id.det() == DetId::HGCalEE) || (id.det() == DetId::HGCalHSi)) {
322  waferU = HGCSiliconDetId(id).waferU();
323  waferV = HGCSiliconDetId(id).waferV();
324  } else {
325  edm::LogError("getWafer::InvalidSiliconDetid")
326  << "det id: " << std::hex << id.rawId() << std::dec << ":"
327  << id.det() << " is not HGCal silicon!";
328  }
329  return std::pair<int,int>(waferU,waferV);
330 }
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 348 of file RecHitTools.cc.

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

Referenced by HGCalImagingAlgo::populate().

348  {
349  bool ishalf = false;
350  if (id.det() == DetId::Forward) {
351  HGCalDetId hid(id);
352  auto geom = getSubdetectorGeometry(hid);
353  auto ddd = get_ddd(geom,hid);
354  const int waferType = ddd->waferTypeT(hid.waferType());
355  return ddd->isHalfCell(waferType,hid.cell());
356  }
357  //new geometry is always false
358  return ishalf;
359 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:125
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:64
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:64
unsigned int hgcal::RecHitTools::maxNumberOfWafersPerLayer ( ) const
inline

Definition at line 60 of file RecHitTools.h.

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

Definition at line 152 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().

Referenced by HGCalImagingAlgo::populate().

152  {
153  int zside = 0;
154  if (id.det() == DetId::Forward) {
155  zside = HGCalDetId(id).zside();
156  } else if( id.det() == DetId::Hcal && id.subdetId() == HcalEndcap) {
157  zside = HcalDetId(id).zside();
158  } else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
159  zside = HGCSiliconDetId(id).zside();
160  } else if (id.det() == DetId::HGCalHSc) {
161  zside = HGCScintillatorDetId(id).zside();
162  }
163  return zside;
164 }
int zside(const DetId &id) const
Definition: RecHitTools.cc:152
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:145
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 64 of file RecHitTools.h.

Referenced by getEventSetup(), and getLayerWithOffset().

unsigned int hgcal::RecHitTools::fhLastLayer_
private

Definition at line 64 of file RecHitTools.h.

Referenced by getEventSetup().

unsigned int hgcal::RecHitTools::fhOffset_
private

Definition at line 64 of file RecHitTools.h.

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

const CaloGeometry* hgcal::RecHitTools::geom_
private

Definition at line 63 of file RecHitTools.h.

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

int hgcal::RecHitTools::geometryType_
private

Definition at line 65 of file RecHitTools.h.

Referenced by getEventSetup(), and getPositionLayer().

unsigned int hgcal::RecHitTools::maxNumberOfWafersPerLayer_
private

Definition at line 64 of file RecHitTools.h.

Referenced by getEventSetup().