Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-20 22:46:47

0001 #ifndef SimG4CMS_ShowerLibraryProducer_HFWedgeSD_h
0002 #define SimG4CMS_ShowerLibraryProducer_HFWedgeSD_h
0003 
0004 #include "SimG4Core/SensitiveDetector/interface/SensitiveCaloDetector.h"
0005 #include "SimG4Core/Notification/interface/SimTrackManager.h"
0006 
0007 #include "SimG4CMS/ShowerLibraryProducer/interface/HFShowerG4Hit.h"
0008 #include "FWCore/Framework/interface/Frameworkfwd.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 
0012 #include "G4VPhysicalVolume.hh"
0013 #include "G4Track.hh"
0014 
0015 #include <map>
0016 
0017 class G4Step;
0018 class G4HCofThisEvent;
0019 
0020 class HFWedgeSD : public SensitiveCaloDetector {
0021 public:
0022   explicit HFWedgeSD(const std::string&,
0023                     const SensitiveDetectorCatalog& clg,
0024                     const SimTrackManager*);
0025   ~HFWedgeSD() override;
0026 
0027   void Initialize(G4HCofThisEvent* HCE) override;
0028   bool ProcessHits(G4Step* step, G4TouchableHistory* tHistory) override;
0029   void EndOfEvent(G4HCofThisEvent* eventHC) override;
0030   void clear() override;
0031   void DrawAll() override;
0032   void PrintAll() override;
0033 
0034   void clearHits() override;
0035   uint32_t setDetUnitId(const G4Step*) override;
0036   void fillHits(edm::PCaloHitContainer&, const std::string&) override;
0037 
0038 protected:
0039   G4bool hitExists();
0040   HFShowerG4Hit* createNewHit();
0041   void updateHit(HFShowerG4Hit*);
0042 
0043 private:
0044   int hcID;
0045   HFShowerG4HitsCollection* theHC;
0046   std::map<int, HFShowerG4Hit*> hitMap;
0047 
0048   int currentID, previousID, trackID;
0049   double edep, time;
0050   G4ThreeVector globalPos, localPos, momDir;
0051   HFShowerG4Hit* currentHit;
0052 };
0053 
0054 #endif