CMS 3D CMS Logo

HGCalSD.cc
Go to the documentation of this file.
1 // File: HGCalSD.cc
3 // Description: Sensitive Detector class for High Granularity Calorimeter
5 
14 #include "G4LogicalVolumeStore.hh"
15 #include "G4LogicalVolume.hh"
16 #include "G4Step.hh"
17 #include "G4Track.hh"
18 #include "G4ParticleTable.hh"
19 #include "G4VProcess.hh"
20 #include "G4Trap.hh"
21 
22 #include <cmath>
23 #include <fstream>
24 #include <iomanip>
25 #include <iostream>
26 #include <memory>
27 #include <sstream>
28 
29 //#define EDM_ML_DEBUG
30 
31 using namespace angle_units::operators;
32 
34  const HGCalDDDConstants* hgc,
35  const SensitiveDetectorCatalog& clg,
36  edm::ParameterSet const& p,
37  const SimTrackManager* manager)
38  : CaloSD(name,
39  clg,
40  p,
41  manager,
42  static_cast<float>(p.getParameter<edm::ParameterSet>("HGCSD").getParameter<double>("TimeSliceUnit")),
43  p.getParameter<edm::ParameterSet>("HGCSD").getParameter<bool>("IgnoreTrackID"),
44  ("Calibration" + name)),
45  myName_(name),
46  hgcons_(hgc),
47  ps_(p),
48  slopeMin_(0),
49  levelT1_(99),
50  levelT2_(99),
51  useSimWt_(0),
52  calibCells_(false),
53  tan30deg_(std::tan(30.0 * CLHEP::deg)),
54  cos30deg_(std::cos(30.0 * CLHEP::deg)) {
55  numberingScheme_.reset(nullptr);
56  guardRing_.reset(nullptr);
57  guardRingPartial_.reset(nullptr);
58  mouseBite_.reset(nullptr);
59  cellOffset_.reset(nullptr);
60 
61  edm::ParameterSet m_HGC = p.getParameter<edm::ParameterSet>("HGCSD");
62  eminHit_ = m_HGC.getParameter<double>("EminHit") * CLHEP::MeV;
63  fiducialCut_ = m_HGC.getParameter<bool>("FiducialCut");
64  storeAllG4Hits_ = m_HGC.getParameter<bool>("StoreAllG4Hits");
65  rejectMB_ = m_HGC.getParameter<bool>("RejectMouseBite");
66  waferRot_ = m_HGC.getParameter<bool>("RotatedWafer");
67  cornerMinMask_ = m_HGC.getParameter<int>("CornerMinMask");
68  nHC_ = m_HGC.getParameter<int>("HitCollection");
69  angles_ = m_HGC.getUntrackedParameter<std::vector<double>>("WaferAngles");
70  missingFile_ = m_HGC.getUntrackedParameter<std::string>("MissingWaferFile");
71  checkID_ = m_HGC.getUntrackedParameter<bool>("CheckID");
72  verbose_ = m_HGC.getUntrackedParameter<int>("Verbosity");
73  dd4hep_ = p.getParameter<bool>("g4GeometryDD4hepSource");
74 
75  if (storeAllG4Hits_) {
76  setUseMap(false);
78  }
79 
80  //this is defined in the hgcsens.xml
82  nameX_ = "HGCal";
83  if (myName_.find("HitsEE") != std::string::npos) {
85  nameX_ = "HGCalEESensitive";
86  } else if (myName_.find("HitsHEfront") != std::string::npos) {
88  nameX_ = "HGCalHESiliconSensitive";
89  }
90 
91 #ifdef EDM_ML_DEBUG
92  edm::LogVerbatim("HGCSim") << "**************************************************"
93  << "\n"
94  << "* *"
95  << "\n"
96  << "* Constructing a HGCalSD with name " << name << "\n"
97  << "* *"
98  << "\n"
99  << "**************************************************";
100 #endif
101  edm::LogVerbatim("HGCSim") << "HGCalSD:: Threshold for storing hits: " << eminHit_ << " for " << nameX_
102  << " detector " << mydet_ << " with " << nHC_ << " hit collections";
103  edm::LogVerbatim("HGCSim") << "Flag for storing individual Geant4 Hits " << storeAllG4Hits_;
104  edm::LogVerbatim("HGCSim") << "Fiducial volume cut with cut from eta/phi "
105  << "boundary " << fiducialCut_ << " at " << distanceFromEdge_;
106  edm::LogVerbatim("HGCSim") << "Reject MosueBite Flag: " << rejectMB_ << " cuts along " << angles_.size()
107  << " axes: " << angles_[0] << ", " << angles_[1];
108 }
109 
110 double HGCalSD::getEnergyDeposit(const G4Step* aStep) {
111  double r = aStep->GetPreStepPoint()->GetPosition().perp();
112  double z = std::abs(aStep->GetPreStepPoint()->GetPosition().z());
113 #ifdef EDM_ML_DEBUG
114  G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
115  G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
116  G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
117  edm::LogVerbatim("HGCSim") << "HGCalSD: Hit from standard path from " << lv->GetName() << " for Track "
118  << aStep->GetTrack()->GetTrackID() << " (" << parCode << ":" << parName << ") R = " << r
119  << " Z = " << z << " slope = " << r / z << ":" << slopeMin_;
120 #endif
121  // Apply fiducial cut
122  if (r < z * slopeMin_) {
123 #ifdef EDM_ML_DEBUG
124  edm::LogVerbatim("HGCSim") << "HGCalSD: Fiducial Volume cut";
125 #endif
126  return 0.0;
127  }
128 
129  double wt1 = getResponseWt(aStep->GetTrack());
130  double wt2 = aStep->GetTrack()->GetWeight();
131  double destep = weight_ * wt1 * (aStep->GetTotalEnergyDeposit());
132  if (wt2 > 0)
133  destep *= wt2;
134 #ifdef EDM_ML_DEBUG
135  edm::LogVerbatim("HGCSim") << "HGCalSD: weights= " << weight_ << ":" << wt1 << ":" << wt2 << " Total weight "
136  << weight_ * wt1 * wt2 << " deStep: " << aStep->GetTotalEnergyDeposit() << ":" << destep;
137 #endif
138  return destep;
139 }
140 
141 uint32_t HGCalSD::setDetUnitId(const G4Step* aStep) {
142  const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
143  const G4VTouchable* touch = preStepPoint->GetTouchable();
144  fraction_ = 1.0;
145  calibCell_ = false;
146  int dn = touch->GetHistoryDepth();
147 
148 #ifdef EDM_ML_DEBUG
149  edm::LogVerbatim("HGCSim") << "DepthsTop: " << dn << ":" << levelT1_ << ":" << levelT2_;
150  printDetectorLevels(touch);
151 #endif
152  //determine the exact position in global coordinates in the mass geometry
153  G4ThreeVector hitPoint = preStepPoint->GetPosition();
154  float globalZ = touch->GetTranslation(0).z();
155  int iz(globalZ > 0 ? 1 : -1);
156 
157  int layer(0), moduleLev(-1), cell(-1);
158  if (useSimWt_ > 0) {
159  layer = touch->GetReplicaNumber(2);
160  moduleLev = 1;
161  } else if (touch->GetHistoryDepth() > levelT2_) {
162  layer = touch->GetReplicaNumber(4);
163  cell = touch->GetReplicaNumber(1);
164  moduleLev = 3;
165  } else {
166  layer = touch->GetReplicaNumber(3);
167  moduleLev = 2;
168  }
169  int module = touch->GetReplicaNumber(moduleLev);
170  if (verbose_ && (cell == -1))
171  edm::LogVerbatim("HGCSim") << "Top " << touch->GetVolume(0)->GetName() << " Module "
172  << touch->GetVolume(moduleLev)->GetName();
173 #ifdef EDM_ML_DEBUG
174  edm::LogVerbatim("HGCSim") << "DepthsTop: " << touch->GetHistoryDepth() << ":" << levelT1_ << ":" << levelT2_ << ":"
175  << useSimWt_ << " name " << touch->GetVolume(0)->GetName() << " layer:module:cell "
176  << layer << ":" << moduleLev << ":" << module << ":" << cell;
177  printDetectorLevels(touch);
178  G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
179  edm::LogVerbatim("HGCSim") << "Depths: " << touch->GetHistoryDepth() << " name " << touch->GetVolume(0)->GetName()
180  << ":" << touch->GetReplicaNumber(0) << " " << touch->GetVolume(1)->GetName() << ":"
181  << touch->GetReplicaNumber(1) << " " << touch->GetVolume(2)->GetName() << ":"
182  << touch->GetReplicaNumber(2) << " " << touch->GetVolume(3)->GetName() << ":"
183  << touch->GetReplicaNumber(3) << " " << touch->GetVolume(4)->GetName() << ":"
184  << touch->GetReplicaNumber(4) << " "
185  << " layer:module:cell " << layer << ":" << module << ":" << cell << " Material "
186  << mat->GetName() << ":" << mat->GetRadlen();
187 #endif
188  // The following statement should be examined later before elimination
189  if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
190  return 0;
191 
192  uint32_t id = setDetUnitId(layer, module, cell, iz, hitPoint);
193  if ((rejectMB_ || fiducialCut_) && id != 0) {
194  auto uv = HGCSiliconDetId(id).waferUV();
195 #ifdef EDM_ML_DEBUG
196  edm::LogVerbatim("HGCSim") << "ID " << std::hex << id << std::dec << " " << HGCSiliconDetId(id);
197 #endif
198  G4ThreeVector local = (touch->GetHistory()->GetTransform(dn - moduleLev).TransformPoint(hitPoint));
199 #ifdef EDM_ML_DEBUG
200  edm::LogVerbatim("HGCSim") << "Global Point " << hitPoint << " Down0 "
201  << touch->GetHistory()->GetTransform(dn).TransformPoint(hitPoint) << " Down1 "
202  << touch->GetHistory()->GetTransform(dn - 1).TransformPoint(hitPoint) << " Down2 "
203  << touch->GetHistory()->GetTransform(dn - 2).TransformPoint(hitPoint) << " Down3 "
204  << touch->GetHistory()->GetTransform(dn - 3).TransformPoint(hitPoint) << " Local "
205  << local;
206 #endif
207  if (fiducialCut_) {
208  int layertype = hgcons_->layerType(layer);
209  int frontBack = HGCalTypes::layerFrontBack(layertype);
210  if (guardRing_->exclude(local, iz, frontBack, layer, uv.first, uv.second) ||
211  guardRingPartial_->exclude(local, iz, frontBack, layer, uv.first, uv.second)) {
212  id = 0;
213 #ifdef EDM_ML_DEBUG
214  edm::LogVerbatim("HGCSim") << "Rejected by GuardRing cutoff *****";
215 #endif
216  }
217  }
218  if ((rejectMB_) && (mouseBite_->exclude(local, iz, layer, uv.first, uv.second))) {
219  id = 0;
220 #ifdef EDM_ML_DEBUG
221  edm::LogVerbatim("HGCSim") << "Rejected by MouseBite cutoff *****";
222 #endif
223  }
224  }
225 #ifdef EDM_ML_DEBUG
226  if (id != 0)
227  edm::LogVerbatim("HGCSim") << HGCSiliconDetId(id);
228 #endif
229  if ((id != 0) && checkID_) {
230  HGCSiliconDetId hid1(id);
231  bool cshift = (hgcons_->cassetteShiftSilicon(hid1.zside(), hid1.layer(), hid1.waferU(), hid1.waferV()));
232  std::string_view pid = (cshift ? "HGCSim" : "HGCalSim");
233  bool debug = (verbose_ > 0) ? true : false;
234  auto xy = hgcons_->locateCell(hid1, debug);
235  double xx = (hid1.zside() > 0) ? xy.first : -xy.first;
236  double dx = xx - (hitPoint.x() / CLHEP::cm);
237  double dy = xy.second - (hitPoint.y() / CLHEP::cm);
238  double diff = (dx * dx + dy * dy);
239  constexpr double tol = 2.0 * 2.0;
240  bool valid1 = hgcons_->isValidHex8(hid1.layer(), hid1.waferU(), hid1.waferV(), hid1.cellU(), hid1.cellV(), true);
241  if ((diff > tol) || (!valid1))
242  pid = "HGCalError";
243  auto partn = hgcons_->waferTypeRotation(hid1.layer(), hid1.waferU(), hid1.waferV(), false, false);
244  int indx = HGCalWaferIndex::waferIndex(layer, hid1.waferU(), hid1.waferV());
245  edm::LogVerbatim(pid) << "CheckID " << HGCSiliconDetId(id) << " Layer:Module:Cell:ModuleLev " << layer << ":"
246  << module << ":" << cell << ":" << moduleLev << " SimWt:history " << useSimWt_ << ":"
247  << touch->GetHistoryDepth() << ":" << levelT1_ << ":" << levelT2_ << " input position: ("
248  << hitPoint.x() / CLHEP::cm << ", " << hitPoint.y() / CLHEP::cm << ":"
249  << convertRadToDeg(std::atan2(hitPoint.y(), hitPoint.x())) << "); position from ID (" << xx
250  << ", " << xy.second << ") distance " << dx << ":" << dy << ":" << std::sqrt(diff)
251  << " Valid " << valid1 << " Wafer type|rotation " << partn.first << ":" << partn.second
252  << " Part:Orient:Cassette " << std::get<1>(hgcons_->waferFileInfo(indx)) << ":"
253  << std::get<2>(hgcons_->waferFileInfo(indx)) << ":"
254  << std::get<3>(hgcons_->waferFileInfo(indx)) << " CassetteShift " << cshift;
255  if ((diff > tol) || (!valid1)) {
256  printDetectorLevels(touch);
257  hgcons_->locateCell(hid1, true);
258  }
259  }
260 
261  if ((id != 0) && calibCells_)
262  calibCell_ = calibCell(id);
263 
264  return id;
265 }
266 
267 void HGCalSD::update(const BeginOfJob* job) {
268  if (hgcons_ != nullptr) {
271  levelT1_ = hgcons_->levelTop(0);
272  levelT2_ = hgcons_->levelTop(1);
273  if (dd4hep_) {
274  ++levelT1_;
275  ++levelT2_;
276  }
278  int useOffset = hgcons_->getParameter()->useOffset_;
279  waferSize_ = hgcons_->waferSize(false);
280  double mouseBite = hgcons_->mouseBite(false);
282  double sensorSizeOffset = hgcons_->sensorSizeOffset(false);
283  if (useOffset > 0) {
284  rejectMB_ = true;
285  fiducialCut_ = true;
286  }
287  double mouseBiteNew = (fiducialCut_) ? (mouseBite + guardRingOffset_ + sensorSizeOffset / cos30deg_) : mouseBite;
288  mouseBiteCut_ = waferSize_ * tan30deg_ - mouseBiteNew;
289 #ifdef EDM_ML_DEBUG
290  edm::LogVerbatim("HGCSim") << "HGCalSD::Initialized with mode " << geom_mode_ << " Slope cut " << slopeMin_
291  << " top Level " << levelT1_ << ":" << levelT2_ << " useSimWt " << useSimWt_ << " wafer "
292  << waferSize_ << ":" << mouseBite << ":" << guardRingOffset_ << ":" << sensorSizeOffset
293  << ":" << mouseBiteNew << ":" << mouseBiteCut_ << " useOffset " << useOffset
294  << " dd4hep " << dd4hep_;
295 #endif
296 
297  numberingScheme_ = std::make_unique<HGCalNumberingScheme>(*hgcons_, mydet_, nameX_, missingFile_);
298  if (rejectMB_)
299  mouseBite_ = std::make_unique<HGCMouseBite>(*hgcons_, angles_, mouseBiteCut_, waferRot_);
300  if (fiducialCut_) {
301  guardRing_ = std::make_unique<HGCGuardRing>(*hgcons_);
302  guardRingPartial_ = std::make_unique<HGCGuardRingPartial>(*hgcons_);
303  }
304 
305  //Now for calibration cells
308  calibCellFullHD_ = hgcons_->calibCells(true, true);
309  calibCellPartHD_ = hgcons_->calibCells(true, false);
310  calibCellFullLD_ = hgcons_->calibCells(false, true);
311  calibCellPartLD_ = hgcons_->calibCells(false, false);
312  calibCells_ = ((!calibCellFullHD_.empty()) || (!calibCellPartHD_.empty()));
313  calibCells_ |= ((!calibCellFullLD_.empty()) || (!calibCellPartLD_.empty()));
314 #ifdef EDM_ML_DEBUG
315  edm::LogVerbatim("HGCSim") << "HGCalSD::Calibration cells initialized with flag " << calibCells_;
316  edm::LogVerbatim("HGCSim") << " Radii " << calibCellRHD_ << ":" << calibCellRLD_;
317  std::ostringstream st1;
318  for (const auto& cell : calibCellFullHD_)
319  st1 << " " << cell;
320  edm::LogVerbatim("HGCSim") << calibCellFullHD_.size() << " cells for High Density full wafers: " << st1.str();
321  std::ostringstream st2;
322  for (const auto& cell : calibCellPartHD_)
323  st2 << " " << cell;
324  edm::LogVerbatim("HGCSim") << calibCellPartHD_.size() << " cells for High Density partial wafers: " << st2.str();
325  std::ostringstream st3;
326  for (const auto& cell : calibCellFullLD_)
327  st3 << " " << cell;
328  edm::LogVerbatim("HGCSim") << calibCellFullLD_.size() << " cells for Low Density full wafers: " << st3.str();
329  std::ostringstream st4;
330  for (const auto& cell : calibCellPartLD_)
331  st4 << " " << cell;
332  edm::LogVerbatim("HGCSim") << calibCellPartLD_.size() << " cells for Low Density partial wafers: " << st4.str();
333 #endif
334  } else {
335  throw cms::Exception("Unknown", "HGCalSD") << "Cannot find HGCalDDDConstants for " << nameX_ << "\n";
336  }
337  if ((nHC_ > 1) && calibCells_) {
339  cellOffset_ = std::make_unique<HGCalCellOffset>(
341  }
342 }
343 
345 
346 bool HGCalSD::filterHit(CaloG4Hit* aHit, double time) {
347  return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > eminHit_));
348 }
349 
350 void HGCalSD::processSecondHit(const G4Step* aStep, const G4Track* theTrack) {
351  if (calibCell_) {
352  float edEM(edepositEM), edHad(edepositHAD);
353  currentID[1] = currentID[0];
356  if (!hitExists(aStep, 1)) {
357  currentHit[1] = createNewHit(aStep, theTrack, 1);
358  }
359  edepositEM = edEM;
360  edepositHAD = edHad;
361  }
362 }
363 
364 uint32_t HGCalSD::setDetUnitId(int layer, int module, int cell, int iz, G4ThreeVector& pos) {
365  uint32_t id = numberingScheme_ ? numberingScheme_->getUnitID(layer, module, cell, iz, pos, weight_) : 0;
366  if (cornerMinMask_ > 2) {
367  if (hgcons_->maskCell(DetId(id), cornerMinMask_)) {
368  id = 0;
369  ignoreRejection();
370  }
371  }
372  if (hgcons_->waferHexagon8File() || (id == 0))
373  ignoreRejection();
374 
375  return id;
376 }
377 
378 bool HGCalSD::calibCell(const uint32_t& id) {
379  bool flag(false);
380  int type, zside, layer, waferU, waferV, cellU, cellV;
381  HGCSiliconDetId(id).unpack(type, zside, layer, waferU, waferV, cellU, cellV);
383  bool hd = HGCalTypes::waferHD(info.type);
384  bool full = HGCalTypes::waferFull(info.part);
385  int indx = 100 * cellU + cellV;
386  if (hd) {
387  if (full)
388  flag = (std::find(calibCellFullHD_.begin(), calibCellFullHD_.end(), indx) != calibCellFullHD_.end());
389  else
390  flag = (std::find(calibCellPartHD_.begin(), calibCellPartHD_.end(), indx) != calibCellPartHD_.end());
391  } else {
392  if (full)
393  flag = (std::find(calibCellFullLD_.begin(), calibCellFullLD_.end(), indx) != calibCellFullLD_.end());
394  else
395  flag = (std::find(calibCellPartLD_.begin(), calibCellPartLD_.end(), indx) != calibCellPartLD_.end());
396  }
397  if (flag) {
398  int32_t place =
400  int32_t type = hd ? 0 : 1;
401  double num = hd ? (M_PI * calibCellRHD_ * calibCellRHD_) : (M_PI * calibCellRLD_ * calibCellRLD_);
402  double bot = cellOffset_->cellAreaUV(cellU, cellV, place, type, true);
403  fraction_ = (bot > 0 && bot > num) ? (num / bot) : 1.0;
404 #ifdef EDM_ML_DEBUG
405  edm::LogVerbatim("HGCSim") << HGCSiliconDetId(id) << " CalibrationCell flag " << flag << " and fraction " << num
406  << ":" << bot << ":" << fraction_;
407 #endif
408  } else {
409 #ifdef EDM_ML_DEBUG
410  edm::LogVerbatim("HGCSim") << HGCSiliconDetId(id) << " CalibrationCell flag " << flag;
411 #endif
412  }
413  return flag;
414 }
CaloG4Hit * currentHit[2]
Definition: CaloSD.h:152
float edepositEM
Definition: CaloSD.h:144
bool maskCell(const DetId &id, int corners) const
Log< level::Info, true > LogVerbatim
int verbose_
Definition: HGCalSD.h:62
static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient)
Definition: HGCalCell.cc:237
bool calibCell_
Definition: HGCalSD.h:70
static constexpr bool waferHD(int32_t type)
Definition: HGCalTypes.h:135
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
double distanceFromEdge_
Definition: HGCalSD.h:57
int levelT2_
Definition: HGCalSD.h:59
static const TGPicture * info(bool iBackgroundIsBlack)
void processSecondHit(const G4Step *, const G4Track *) override
Definition: HGCalSD.cc:350
edm::ParameterSet const & ps_
Definition: HGCalSD.h:48
std::vector< int > calibCellPartLD_
Definition: HGCalSD.h:66
double slopeMin_
Definition: HGCalSD.h:57
const HGCalParameters * getParameter() const
Definition: CaloSD.h:40
void setNumberCheckedHits(int val, int k=0)
Definition: CaloSD.h:126
std::string myName_
Definition: HGCalSD.h:46
HGCalSD(const std::string &, const HGCalDDDConstants *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: HGCalSD.cc:33
int32_t waferU(const int32_t index)
std::vector< int > calibCellPartHD_
Definition: HGCalSD.h:65
HGCalParameters::waferInfo waferInfo(int lay, int waferU, int waferV) const
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
void newCollection(const std::string &name, edm::ParameterSet const &p)
Definition: CaloSD.cc:176
std::unique_ptr< HGCalNumberingScheme > numberingScheme_
Definition: HGCalSD.h:49
std::pair< int, int > waferTypeRotation(int layer, int waferU, int waferV, bool fromFile, bool debug) const
std::string nameX_
Definition: HGCalSD.h:55
int zside(DetId const &)
double mouseBiteCut_
Definition: HGCalSD.h:58
static constexpr bool waferFull(int32_t type)
Definition: HGCalTypes.h:136
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HGCalGeometryMode::GeometryMode geomMode() const
bool isValidHex8(int lay, int waferU, int waferV, bool fullAndPart) const
void setUseMap(bool val)
Definition: CaloSD.h:115
void ignoreRejection()
Definition: CaloSD.h:112
T getUntrackedParameter(std::string const &, T const &) const
int nHC_
Definition: CaloSD.h:158
constexpr int32_t waferV() const
void initRun() override
Definition: HGCalSD.cc:344
bool calibCells_
Definition: HGCalSD.h:63
double getEnergyDeposit(const G4Step *) override
Definition: HGCalSD.cc:110
constexpr void unpack(int32_t &ty, int32_t &zs, int32_t &ly, int32_t &wU, int32_t &wV, int32_t &cU, int32_t &cV) const
bool rejectMB_
Definition: HGCalSD.h:61
double getResponseWt(const G4Track *, int k=0)
Definition: CaloSD.cc:927
DetId::Detector mydet_
Definition: HGCalSD.h:54
CaloG4Hit * createNewHit(const G4Step *, const G4Track *, int k)
Definition: CaloSD.cc:623
uint32_t setDetUnitId(const G4Step *step) override
Definition: HGCalSD.cc:141
std::tuple< int, int, int, int > waferFileInfo(unsigned int kk) const
std::vector< int > calibCellFullHD_
Definition: HGCalSD.h:65
float edepositHAD
Definition: CaloSD.h:144
T sqrt(T t)
Definition: SSEVec.h:19
const double cos30deg_
Definition: HGCalSD.h:67
std::string missingFile_
Definition: HGCalSD.h:69
bool storeAllG4Hits_
Definition: HGCalSD.h:60
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double fraction_
Definition: HGCalSD.h:71
Definition: GenABIO.cc:168
constexpr int32_t zside() const
get the z-side of the cell (1/-1)
std::vector< double > angles_
Definition: HGCalSD.h:68
const HGCalDDDConstants * hgcons_
Definition: HGCalSD.h:47
int getUVMax(int type) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const double tan30deg_
Definition: HGCalSD.h:67
double mouseBite(bool reco) const
bool waferRot_
Definition: HGCalSD.h:61
double waferSize_
Definition: HGCalSD.h:58
bool dd4hep_
Definition: HGCalSD.h:63
double calibCellRLD_
Definition: HGCalSD.h:64
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
constexpr int32_t cellU() const
get the cell #&#39;s in u,v or in x,y
#define M_PI
double tmaxHit
Definition: CaloSD.h:148
bool checkID_
Definition: HGCalSD.h:61
Definition: DetId.h:17
bool calibCell(const uint32_t &id)
Definition: HGCalSD.cc:378
int cornerMinMask_
Definition: HGCalSD.h:59
#define debug
Definition: HDRShower.cc:19
double minSlope() const
double getEnergyDeposit() const
Definition: CaloG4Hit.h:79
HGCalGeometryMode::GeometryMode geom_mode_
Definition: HGCalSD.h:56
constexpr int32_t layer() const
get the layer #
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
bool waferHexagon8File() const
constexpr int32_t cellV() const
bool hitExists(const G4Step *, int k)
Definition: CaloSD.cc:462
double weight_
Definition: HGCalSD.h:58
std::unique_ptr< HGCalCellOffset > cellOffset_
Definition: HGCalSD.h:53
bool fiducialCut_
Definition: HGCalSD.h:61
void printDetectorLevels(const G4VTouchable *) const
Definition: CaloSD.cc:1157
std::unique_ptr< HGCGuardRingPartial > guardRingPartial_
Definition: HGCalSD.h:51
std::vector< int > calibCellFullLD_
Definition: HGCalSD.h:66
HLT enums.
bool filterHit(CaloG4Hit *, double) override
Definition: HGCalSD.cc:346
bool cassetteShiftSilicon(int zside, int layer, int waferU, int waferV) const
std::vector< int > calibCells(bool hd, bool full) const
int32_t waferV(const int32_t index)
CaloHitID currentID[2]
Definition: CaloSD.h:146
double guardRingOffset(bool reco) const
std::string collName_[2]
Definition: CaloSD.h:159
int useSimWt_
Definition: HGCalSD.h:62
std::unique_ptr< HGCGuardRing > guardRing_
Definition: HGCalSD.h:50
double sensorSizeOffset(bool reco) const
int levelT1_
Definition: HGCalSD.h:59
double calibCellRad(bool hd) const
double guardRingOffset_
Definition: HGCalSD.h:58
std::unique_ptr< HGCMouseBite > mouseBite_
Definition: HGCalSD.h:52
constexpr int32_t waferU() const
double eminHit_
Definition: HGCalSD.h:57
int levelTop(int ind=0) const
double calibCellRHD_
Definition: HGCalSD.h:64
constexpr std::pair< int32_t, int32_t > waferUV() const
double waferSize(bool reco) const
int layerType(int lay) const
static constexpr int32_t layerFrontBack(int32_t layerOrient)
Definition: HGCalTypes.h:132
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
Definition: HGCalSD.cc:267