Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-24 02:22:26

0001 #ifndef Validation_Geometry_MaterialBudgetHcal_h
0002 #define Validation_Geometry_MaterialBudgetHcal_h
0003 
0004 #include "Validation/Geometry/interface/MaterialBudgetHcalHistos.h"
0005 #include "Validation/Geometry/interface/MaterialBudgetCastorHistos.h"
0006 
0007 #include "SimG4Core/Watcher/interface/SimWatcher.h"
0008 #include "SimG4Core/Notification/interface/Observer.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 
0011 #include "DetectorDescription/Core/interface/DDCompactView.h"
0012 #include "DetectorDescription/DDCMS/interface/DDCompactView.h"
0013 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0014 
0015 #include <CLHEP/Vector/LorentzVector.h>
0016 
0017 class BeginOfTrack;
0018 class G4Step;
0019 class EndOfTrack;
0020 
0021 class MaterialBudgetHcal : public SimWatcher,
0022                            public Observer<const BeginOfTrack*>,
0023                            public Observer<const G4Step*>,
0024                            public Observer<const EndOfTrack*> {
0025 public:
0026   MaterialBudgetHcal(const edm::ParameterSet&);
0027   MaterialBudgetHcal(const MaterialBudgetHcal&) = delete;  // stop default
0028 
0029   const MaterialBudgetHcal& operator=(const MaterialBudgetHcal&) = delete;  // stop default
0030 
0031   void registerConsumes(edm::ConsumesCollector) override;
0032   void beginRun(edm::EventSetup const&) override;
0033 
0034 private:
0035   void update(const BeginOfTrack*) override;
0036   void update(const G4Step*) override;
0037   void update(const EndOfTrack*) override;
0038 
0039   bool stopAfter(const G4Step*);
0040 
0041   std::unique_ptr<MaterialBudgetHcalHistos> theHistoHcal_;
0042   std::unique_ptr<MaterialBudgetCastorHistos> theHistoCastor_;
0043   edm::ESGetToken<DDCompactView, IdealGeometryRecord> cpvTokenDDD_;
0044   edm::ESGetToken<cms::DDCompactView, IdealGeometryRecord> cpvTokenDD4hep_;
0045   double rMax_, zMax_;
0046   bool fromdd4hep_;
0047 };
0048 
0049 #endif