Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:11

0001 #ifndef SimG4CMS_ShowerLibraryProducer_FiberSD_h
0002 #define SimG4CMS_ShowerLibraryProducer_FiberSD_h
0003 
0004 #include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h"
0005 #include "Geometry/HcalCommonData/interface/HcalSimulationConstants.h"
0006 
0007 #include "SimG4Core/Notification/interface/Observer.h"
0008 #include "SimG4Core/Notification/interface/BeginOfJob.h"
0009 #include "SimG4Core/Notification/interface/BeginOfRun.h"
0010 #include "SimG4Core/Notification/interface/BeginOfEvent.h"
0011 #include "SimG4Core/Notification/interface/EndOfEvent.h"
0012 #include "SimG4Core/Notification/interface/SimTrackManager.h"
0013 #include "SimG4Core/SensitiveDetector/interface/SensitiveCaloDetector.h"
0014 
0015 #include "SimG4CMS/ShowerLibraryProducer/interface/FiberG4Hit.h"
0016 #include "SimG4CMS/Calo/interface/HFShower.h"
0017 
0018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0019 
0020 #include "G4Track.hh"
0021 
0022 #include <iostream>
0023 #include <fstream>
0024 #include <vector>
0025 
0026 class G4Step;
0027 class G4HCofThisEvent;
0028 
0029 class FiberSD : public SensitiveCaloDetector,
0030                 public Observer<const BeginOfJob *>,
0031                 public Observer<const BeginOfRun *>,
0032                 public Observer<const BeginOfEvent *>,
0033                 public Observer<const EndOfEvent *> {
0034 public:
0035   explicit FiberSD(const std::string &,
0036                    const HcalSimulationConstants *,
0037                    const HcalDDDSimConstants *,
0038                    const SensitiveDetectorCatalog &,
0039                    edm::ParameterSet const &,
0040                    const SimTrackManager *);
0041   ~FiberSD() override;
0042 
0043   void Initialize(G4HCofThisEvent *HCE) override;
0044   G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist) override;
0045   void EndOfEvent(G4HCofThisEvent *HCE) override;
0046   void clear() override;
0047   void DrawAll() override;
0048   void PrintAll() override;
0049 
0050   void clearHits() override;
0051   uint32_t setDetUnitId(const G4Step *) override;
0052   void fillHits(edm::PCaloHitContainer &, const std::string &) override;
0053 
0054 protected:
0055   void update(const BeginOfJob *) override;
0056   void update(const BeginOfRun *) override;
0057   void update(const BeginOfEvent *) override;
0058   void update(const ::EndOfEvent *) override;
0059 
0060 private:
0061   HFShower *theShower;
0062 
0063   G4int theHCID;
0064   FiberG4HitsCollection *theHC;
0065 };
0066 
0067 #endif