File indexing completed on 2025-06-03 00:12:39
0001 #ifndef SimG4CMS_HGCalSD_h
0002 #define SimG4CMS_HGCalSD_h
0003
0004
0005
0006
0007
0008
0009 #include "SimG4CMS/Calo/interface/CaloSD.h"
0010 #include "SimG4Core/Notification/interface/BeginOfJob.h"
0011 #include "SimG4CMS/Calo/interface/HGCalNumberingScheme.h"
0012 #include "SimG4CMS/Calo/interface/HGCMouseBite.h"
0013 #include "Geometry/HGCalCommonData/interface/HGCalCellOffset.h"
0014 #include "Geometry/HGCalCommonData/interface/HGCalDDDConstants.h"
0015 #include "Geometry/HGCalCommonData/interface/HGCGuardRing.h"
0016 #include <string>
0017
0018 class G4LogicalVolume;
0019 class G4Step;
0020
0021 class HGCalSD : public CaloSD, public Observer<const BeginOfJob *> {
0022 public:
0023 HGCalSD(const std::string &,
0024 const HGCalDDDConstants *,
0025 const SensitiveDetectorCatalog &,
0026 edm::ParameterSet const &,
0027 const SimTrackManager *);
0028 ~HGCalSD() override = default;
0029
0030 uint32_t setDetUnitId(const G4Step *step) override;
0031
0032 protected:
0033 double getEnergyDeposit(const G4Step *) override;
0034 using CaloSD::update;
0035 void update(const BeginOfJob *) override;
0036 void initRun() override;
0037 bool filterHit(CaloG4Hit *, double) override;
0038 void processSecondHit(const G4Step *, const G4Track *) override;
0039
0040 private:
0041 uint32_t setDetUnitId(int, int, int, int, G4ThreeVector &);
0042 bool isItinFidVolume(const G4ThreeVector &);
0043 bool calibCell(const uint32_t &id);
0044
0045 std::string myName_;
0046 const HGCalDDDConstants *hgcons_;
0047 edm::ParameterSet const &ps_;
0048 std::unique_ptr<HGCalNumberingScheme> numberingScheme_;
0049 std::unique_ptr<HGCGuardRing> guardRing_;
0050 std::unique_ptr<HGCMouseBite> mouseBite_;
0051 std::unique_ptr<HGCalCellOffset> cellOffset_;
0052 DetId::Detector mydet_;
0053 std::string nameX_;
0054 HGCalGeometryMode::GeometryMode geom_mode_;
0055 double eminHit_, slopeMin_, distanceFromEdge_;
0056 double waferSize_, mouseBiteCut_, guardRingOffset_, sensorSizeOffset_, weight_;
0057 int levelT1_, levelT2_, cornerMinMask_;
0058 bool storeAllG4Hits_;
0059 bool fiducialCut_, rejectMB_, waferRot_, checkID_;
0060 int useSimWt_, verbose_;
0061 bool dd4hep_, calibCells_;
0062 double calibCellRHD_, calibCellRLD_;
0063 std::vector<int> calibCellFullHD_, calibCellPartHD_;
0064 std::vector<int> calibCellFullLD_, calibCellPartLD_;
0065 const double tan30deg_, cos30deg_;
0066 std::vector<double> angles_;
0067 std::string missingFile_;
0068 bool calibCell_;
0069 double fraction_;
0070 };
0071
0072 #endif