Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-05 01:48:39

0001 ///////////////////////////////////////////////////////////////////////////////
0002 //Author: Seyed Mohsen Etesami
0003 // setesami@cern.ch
0004 // 2016 Nov
0005 ///////////////////////////////////////////////////////////////////////////////
0006 
0007 #ifndef PPS_PPSDiamondSD_h
0008 #define PPS_PPSDiamondSD_h
0009 
0010 #include "SimG4CMS/PPS/interface/PPSDiamondG4Hit.h"
0011 #include "SimG4CMS/PPS/interface/PPSDiamondG4HitCollection.h"
0012 #include "SimG4CMS/PPS/interface/PPSVDetectorOrganization.h"
0013 
0014 #include "SimG4Core/Notification/interface/Observer.h"
0015 #include "SimG4Core/SensitiveDetector/interface/SensitiveTkDetector.h"
0016 #include "SimG4Core/Notification/interface/BeginOfEvent.h"
0017 #include "SimG4Core/Notification/interface/EndOfEvent.h"
0018 
0019 #include "FWCore/Framework/interface/Frameworkfwd.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0021 
0022 #include <string>
0023 
0024 class G4Step;
0025 class G4HCofThisEvent;
0026 class TrackingSlaveSD;
0027 class SimTrackManager;
0028 
0029 class PPSDiamondSD : public SensitiveTkDetector,
0030                      public Observer<const BeginOfEvent*>,
0031                      public Observer<const EndOfEvent*> {
0032 public:
0033   PPSDiamondSD(const std::string&, const SensitiveDetectorCatalog&, edm::ParameterSet const&, const SimTrackManager*);
0034   ~PPSDiamondSD() override;
0035 
0036   // Geant4 methods
0037   bool ProcessHits(G4Step* step, G4TouchableHistory* tHistory) override;
0038 
0039   void Initialize(G4HCofThisEvent* HCE) override;
0040   void EndOfEvent(G4HCofThisEvent* eventHC) override;
0041   void PrintAll() override;
0042 
0043   // CMSSW methods
0044   uint32_t setDetUnitId(const G4Step*) override;
0045   void fillHits(edm::PSimHitContainer&, const std::string&) override;
0046   void clearHits() override;
0047 
0048 protected:
0049   void update(const BeginOfEvent*) override;
0050   void update(const ::EndOfEvent*) override;
0051 
0052 private:
0053   G4ThreeVector setToLocal(const G4ThreeVector& globalPoint);
0054   void stepInfo(const G4Step* aStep);
0055   void importInfoToHit();  //added pps
0056   void storeHit(PPSDiamondG4Hit*);
0057   void printHitInfo();
0058 
0059   std::unique_ptr<TrackingSlaveSD> slave_;
0060   std::unique_ptr<PPSVDetectorOrganization> numberingScheme_;
0061 
0062   PPSDiamondG4HitCollection* theHC_ = nullptr;
0063   PPSDiamondG4Hit* currentHit_ = nullptr;
0064   G4Track* theTrack_ = nullptr;
0065   G4VPhysicalVolume* currentPV_ = nullptr;
0066   G4int hcID_ = -1;
0067   G4int primaryID_ = 0;
0068   G4int parentID_ = 0;
0069   G4int tSliceID_ = 0;
0070   G4double tSlice_ = 0.0;
0071 
0072   G4StepPoint* preStepPoint_ = nullptr;
0073   G4StepPoint* postStepPoint_ = nullptr;
0074   G4ThreeVector hitPoint_;
0075   G4ThreeVector exitPoint_;
0076   G4ThreeVector theLocalEntryPoint_;
0077   G4ThreeVector theLocalExitPoint_;
0078 
0079   double incidentEnergy_ = 0.0;
0080   double pabs_ = 0.0;
0081   double thePx_ = 0.0;
0082   double thePy_ = 0.0;
0083   double thePz_ = 0.0;
0084   double tof_ = 0.0;
0085   double eloss_ = 0.0;
0086 
0087   double thetaAtEntry_ = 0.0;
0088   double phiAtEntry_ = 0.0;
0089 
0090   double vx_ = 0.0;
0091   double vy_ = 0.0;
0092   double vz_ = 0.0;
0093 
0094   double Globaltimehit_;
0095   double theglobaltimehit_;
0096 
0097   unsigned int unitID_ = 0;
0098   int verbosity_;
0099   int eventno_ = 0;
0100   short particleType_ = 0;
0101 };
0102 
0103 #endif  // PPS_PPSDiamondSD_h