Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:48

0001 #ifndef SimG4CMS_HGCSD_h
0002 #define SimG4CMS_HGCSD_h
0003 ///////////////////////////////////////////////////////////////////////////////
0004 // File: HGCSD.h
0005 // Description: Stores hits of the High Granularity Calorimeter (HGC) in the
0006 //              appropriate container
0007 ///////////////////////////////////////////////////////////////////////////////
0008 
0009 //#define plotDebug
0010 
0011 #include "SimG4CMS/Calo/interface/CaloSD.h"
0012 #include "SimG4Core/Notification/interface/BeginOfJob.h"
0013 #include "SimG4Core/Notification/interface/BeginOfEvent.h"
0014 #include "SimG4CMS/Calo/interface/HGCNumberingScheme.h"
0015 #include "SimG4CMS/Calo/interface/HGCMouseBite.h"
0016 #include "Geometry/HGCalTBCommonData/interface/HGCalTBDDDConstants.h"
0017 
0018 #include <string>
0019 #ifdef plotDebug
0020 #include <TTree.h>
0021 #endif
0022 class G4LogicalVolume;
0023 class G4Material;
0024 class G4Step;
0025 
0026 class HGCSD : public CaloSD, public Observer<const BeginOfJob *> {
0027 public:
0028   HGCSD(const std::string &,
0029         const HGCalTBDDDConstants *,
0030         const SensitiveDetectorCatalog &,
0031         edm::ParameterSet const &,
0032         const SimTrackManager *);
0033   ~HGCSD() override = default;
0034 
0035   uint32_t setDetUnitId(const G4Step *step) override;
0036 
0037 protected:
0038   double getEnergyDeposit(const G4Step *) override;
0039   using CaloSD::update;
0040   void update(const BeginOfJob *) override;
0041   void initRun() override;
0042   void initEvent(const BeginOfEvent *) override;
0043   void endEvent() override;
0044   bool filterHit(CaloG4Hit *, double) override;
0045 
0046 private:
0047   uint32_t setDetUnitId(ForwardSubdetector &, int, int, int, int, G4ThreeVector &);
0048   bool isItinFidVolume(const G4ThreeVector &) { return true; }
0049 
0050   const HGCalTBDDDConstants *hgcons_;
0051   std::string nameX_;
0052   HGCalGeometryMode::GeometryMode geom_mode_;
0053   std::unique_ptr<HGCNumberingScheme> numberingScheme_;
0054   std::unique_ptr<HGCMouseBite> mouseBite_;
0055   double eminHit_;
0056   ForwardSubdetector myFwdSubdet_;
0057   double slopeMin_;
0058   int levelT_;
0059   bool storeAllG4Hits_, rejectMB_, waferRot_;
0060   double mouseBiteCut_;
0061   bool dd4hep_;
0062   std::vector<double> angles_;
0063 
0064 #ifdef plotDebug
0065   TTree *tree_;
0066 #endif
0067   uint32_t t_EventID_;
0068   std::vector<int> t_Layer_, t_Parcode_;
0069   std::vector<double> t_dEStep1_, t_dEStep2_, t_TrackE_;
0070   std::vector<double> t_Angle_;
0071 };
0072 
0073 #endif  // HGCSD_h