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 #ifdef EDM_ML_DEBUG
194  edm::LogVerbatim("HGCSim") << "ID Layer " << layer << " Module " << module << " Cell " << cell << " " << std::hex
195  << id << std::dec << " " << HGCSiliconDetId(id);
196 #endif
197  if ((rejectMB_ || fiducialCut_) && id != 0) {
198  auto uv = HGCSiliconDetId(id).waferUV();
199 #ifdef EDM_ML_DEBUG
200  edm::LogVerbatim("HGCSim") << "ID " << std::hex << id << std::dec << " " << HGCSiliconDetId(id);
201 #endif
202  G4ThreeVector local = (touch->GetHistory()->GetTransform(dn - moduleLev).TransformPoint(hitPoint));
203 #ifdef EDM_ML_DEBUG
204  edm::LogVerbatim("HGCSim") << "Global Point " << hitPoint << " Down0 "
205  << touch->GetHistory()->GetTransform(dn).TransformPoint(hitPoint) << " Down1 "
206  << touch->GetHistory()->GetTransform(dn - 1).TransformPoint(hitPoint) << " Down2 "
207  << touch->GetHistory()->GetTransform(dn - 2).TransformPoint(hitPoint) << " Down3 "
208  << touch->GetHistory()->GetTransform(dn - 3).TransformPoint(hitPoint) << " Local "
209  << local;
210 #endif
211  if (fiducialCut_) {
212  int layertype = hgcons_->layerType(layer);
213  int frontBack = HGCalTypes::layerFrontBack(layertype);
214  if (guardRing_->exclude(local, iz, frontBack, layer, uv.first, uv.second) ||
215  guardRingPartial_->exclude(local, iz, frontBack, layer, uv.first, uv.second)) {
216  id = 0;
217 #ifdef EDM_ML_DEBUG
218  edm::LogVerbatim("HGCSim") << "Rejected by GuardRing cutoff *****";
219 #endif
220  }
221  }
222  if ((rejectMB_) && (mouseBite_->exclude(local, iz, layer, uv.first, uv.second))) {
223  id = 0;
224 #ifdef EDM_ML_DEBUG
225  edm::LogVerbatim("HGCSim") << "Rejected by MouseBite cutoff *****";
226 #endif
227  }
228  }
229 #ifdef EDM_ML_DEBUG
230  if (id != 0)
231  edm::LogVerbatim("HGCSim") << HGCSiliconDetId(id);
232 #endif
233  if ((id != 0) && checkID_) {
234  HGCSiliconDetId hid1(id);
235  bool cshift = (hgcons_->cassetteShiftSilicon(hid1.zside(), hid1.layer(), hid1.waferU(), hid1.waferV()));
236  std::string_view pid = (cshift ? "HGCSim" : "HGCalSim");
237  bool debug = (verbose_ > 0) ? true : false;
238  auto xy = hgcons_->locateCell(hid1, debug);
239  double xx = (hid1.zside() > 0) ? xy.first : -xy.first;
240  double dx = xx - (hitPoint.x() / CLHEP::cm);
241  double dy = xy.second - (hitPoint.y() / CLHEP::cm);
242  double diff = (dx * dx + dy * dy);
243  constexpr double tol = 2.0 * 2.0;
244  bool valid1 = hgcons_->isValidHex8(hid1.layer(), hid1.waferU(), hid1.waferV(), hid1.cellU(), hid1.cellV(), true);
245  if ((diff > tol) || (!valid1))
246  pid = "HGCalError";
247  auto partn = hgcons_->waferTypeRotation(hid1.layer(), hid1.waferU(), hid1.waferV(), false, false);
248  int indx = HGCalWaferIndex::waferIndex(layer, hid1.waferU(), hid1.waferV());
249  edm::LogVerbatim(pid) << "CheckID " << HGCSiliconDetId(id) << " Layer:Module:Cell:ModuleLev " << layer << ":"
250  << module << ":" << cell << ":" << moduleLev << " SimWt:history " << useSimWt_ << ":"
251  << touch->GetHistoryDepth() << ":" << levelT1_ << ":" << levelT2_ << " input position: ("
252  << hitPoint.x() / CLHEP::cm << ", " << hitPoint.y() / CLHEP::cm << ":"
253  << convertRadToDeg(std::atan2(hitPoint.y(), hitPoint.x())) << "); position from ID (" << xx
254  << ", " << xy.second << ") distance " << dx << ":" << dy << ":" << std::sqrt(diff)
255  << " Valid " << valid1 << " Wafer type|rotation " << partn.first << ":" << partn.second
256  << " Part:Orient:Cassette " << std::get<1>(hgcons_->waferFileInfo(indx)) << ":"
257  << std::get<2>(hgcons_->waferFileInfo(indx)) << ":"
258  << std::get<3>(hgcons_->waferFileInfo(indx)) << " CassetteShift " << cshift;
259  if ((diff > tol) || (!valid1)) {
260  printDetectorLevels(touch);
261  hgcons_->locateCell(hid1, true);
262  }
263  }
264 
265  if ((id != 0) && calibCells_)
266  calibCell_ = calibCell(id);
267 
268  return id;
269 }
270 
271 void HGCalSD::update(const BeginOfJob* job) {
272  if (hgcons_ != nullptr) {
275  levelT1_ = hgcons_->levelTop(0);
276  levelT2_ = hgcons_->levelTop(1);
277  if (dd4hep_) {
278  ++levelT1_;
279  ++levelT2_;
280  }
282  int useOffset = hgcons_->getParameter()->useOffset_;
283  waferSize_ = hgcons_->waferSize(false);
284  double mouseBite = hgcons_->mouseBite(false);
287  if (useOffset > 0) {
288  rejectMB_ = true;
289  fiducialCut_ = true;
290  }
291  double mouseBiteNew = (fiducialCut_) ? (mouseBite + guardRingOffset_ + sensorSizeOffset_ / cos30deg_) : mouseBite;
292  mouseBiteCut_ = waferSize_ * tan30deg_ - mouseBiteNew;
293 #ifdef EDM_ML_DEBUG
294  edm::LogVerbatim("HGCSim") << "HGCalSD::Initialized with mode " << geom_mode_ << " Slope cut " << slopeMin_
295  << " top Level " << levelT1_ << ":" << levelT2_ << " useSimWt " << useSimWt_ << " wafer "
296  << waferSize_ << ":" << mouseBite << ":" << guardRingOffset_ << ":" << sensorSizeOffset_
297  << ":" << mouseBiteNew << ":" << mouseBiteCut_ << " useOffset " << useOffset
298  << " dd4hep " << dd4hep_;
299 #endif
300 
301  numberingScheme_ = std::make_unique<HGCalNumberingScheme>(*hgcons_, mydet_, nameX_, missingFile_);
302  if (rejectMB_)
303  mouseBite_ = std::make_unique<HGCMouseBite>(*hgcons_, angles_, mouseBiteCut_, waferRot_);
304  if (fiducialCut_) {
305  guardRing_ = std::make_unique<HGCGuardRing>(*hgcons_);
306  guardRingPartial_ = std::make_unique<HGCGuardRingPartial>(*hgcons_);
307  }
308 
309  //Now for calibration cells
312  calibCellFullHD_ = hgcons_->calibCells(true, true);
313  calibCellPartHD_ = hgcons_->calibCells(true, false);
314  calibCellFullLD_ = hgcons_->calibCells(false, true);
315  calibCellPartLD_ = hgcons_->calibCells(false, false);
316  calibCells_ = ((!calibCellFullHD_.empty()) || (!calibCellPartHD_.empty()));
317  calibCells_ |= ((!calibCellFullLD_.empty()) || (!calibCellPartLD_.empty()));
318 #ifdef EDM_ML_DEBUG
319  edm::LogVerbatim("HGCSim") << "HGCalSD::Calibration cells initialized with flag " << calibCells_;
320  edm::LogVerbatim("HGCSim") << " Radii " << calibCellRHD_ << ":" << calibCellRLD_;
321  std::ostringstream st1;
322  for (const auto& cell : calibCellFullHD_)
323  st1 << " " << cell;
324  edm::LogVerbatim("HGCSim") << calibCellFullHD_.size() << " cells for High Density full wafers: " << st1.str();
325  std::ostringstream st2;
326  for (const auto& cell : calibCellPartHD_)
327  st2 << " " << cell;
328  edm::LogVerbatim("HGCSim") << calibCellPartHD_.size() << " cells for High Density partial wafers: " << st2.str();
329  std::ostringstream st3;
330  for (const auto& cell : calibCellFullLD_)
331  st3 << " " << cell;
332  edm::LogVerbatim("HGCSim") << calibCellFullLD_.size() << " cells for Low Density full wafers: " << st3.str();
333  std::ostringstream st4;
334  for (const auto& cell : calibCellPartLD_)
335  st4 << " " << cell;
336  edm::LogVerbatim("HGCSim") << calibCellPartLD_.size() << " cells for Low Density partial wafers: " << st4.str();
337 #endif
338  } else {
339  throw cms::Exception("Unknown", "HGCalSD") << "Cannot find HGCalDDDConstants for " << nameX_ << "\n";
340  }
341  if ((nHC_ > 1) && calibCells_)
343  cellOffset_ = std::make_unique<HGCalCellOffset>(
345 }
346 
348 
349 bool HGCalSD::filterHit(CaloG4Hit* aHit, double time) {
350  return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > eminHit_));
351 }
352 
353 void HGCalSD::processSecondHit(const G4Step* aStep, const G4Track* theTrack) {
354  if (calibCell_) {
355  float edEM(edepositEM), edHad(edepositHAD);
356  currentID[1] = currentID[0];
359  if (!hitExists(aStep, 1)) {
360  currentHit[1] = createNewHit(aStep, theTrack, 1);
361  }
362  edepositEM = edEM;
363  edepositHAD = edHad;
364  }
365 }
366 
367 uint32_t HGCalSD::setDetUnitId(int layer, int module, int cell, int iz, G4ThreeVector& pos) {
368  uint32_t id = numberingScheme_ ? numberingScheme_->getUnitID(layer, module, cell, iz, pos, weight_) : 0;
369  if (cornerMinMask_ > 2) {
370  if (hgcons_->maskCell(DetId(id), cornerMinMask_)) {
371  id = 0;
372  ignoreRejection();
373  }
374  }
375  if (hgcons_->waferHexagon8File() || (id == 0))
376  ignoreRejection();
377 
378  return id;
379 }
380 
381 bool HGCalSD::calibCell(const uint32_t& id) {
382  bool flag(false);
383  int type, zside, layer, waferU, waferV, cellU, cellV;
384  HGCSiliconDetId(id).unpack(type, zside, layer, waferU, waferV, cellU, cellV);
386  bool hd = HGCalTypes::waferHD(info.type);
387  bool full = HGCalTypes::waferFull(info.part);
388  int indx = 100 * cellU + cellV;
389  if (hd) {
390  if (full)
391  flag = (std::find(calibCellFullHD_.begin(), calibCellFullHD_.end(), indx) != calibCellFullHD_.end());
392  else
393  flag = (std::find(calibCellPartHD_.begin(), calibCellPartHD_.end(), indx) != calibCellPartHD_.end());
394  } else {
395  if (full)
396  flag = (std::find(calibCellFullLD_.begin(), calibCellFullLD_.end(), indx) != calibCellFullLD_.end());
397  else
398  flag = (std::find(calibCellPartLD_.begin(), calibCellPartLD_.end(), indx) != calibCellPartLD_.end());
399  }
400  if (flag) {
401  int32_t place =
403  int32_t type = hd ? 0 : 1;
404  double num = hd ? (M_PI * calibCellRHD_ * calibCellRHD_) : (M_PI * calibCellRLD_ * calibCellRLD_);
405  double bot = cellOffset_->cellAreaUV(cellU, cellV, place, type, true);
406  fraction_ = (bot > 0 && bot > num) ? (num / bot) : 1.0;
407 #ifdef EDM_ML_DEBUG
408  edm::LogVerbatim("HGCSim") << HGCSiliconDetId(id) << " CalibrationCell flag " << flag << " and fraction " << num
409  << ":" << bot << ":" << fraction_;
410 #endif
411  } else {
412 #ifdef EDM_ML_DEBUG
413  edm::LogVerbatim("HGCSim") << HGCSiliconDetId(id) << " CalibrationCell flag " << flag;
414 #endif
415  }
416  return flag;
417 }
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:239
bool calibCell_
Definition: HGCalSD.h:70
static constexpr bool waferHD(int32_t type)
Definition: HGCalTypes.h:140
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:353
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:177
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:141
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:347
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:929
DetId::Detector mydet_
Definition: HGCalSD.h:54
CaloG4Hit * createNewHit(const G4Step *, const G4Track *, int k)
Definition: CaloSD.cc:625
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:23
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:381
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:463
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:1159
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:349
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
double sensorSizeOffset_
Definition: HGCalSD.h:58
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:137
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
Definition: HGCalSD.cc:271