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