File indexing completed on 2024-04-06 12:32:12
0001 #ifndef Validation_Geometry_MaterialBudgetAction_h
0002 #define Validation_Geometry_MaterialBudgetAction_h
0003
0004 #include <string>
0005 #include <vector>
0006
0007 #include "Validation/Geometry/interface/MaterialBudgetTree.h"
0008 #include "Validation/Geometry/interface/MaterialBudgetFormat.h"
0009 #include "Validation/Geometry/interface/MaterialBudgetHistos.h"
0010 #include "Validation/Geometry/interface/MaterialBudgetTrackerHistos.h"
0011 #include "Validation/Geometry/interface/MaterialBudgetEcalHistos.h"
0012 #include "Validation/Geometry/interface/MaterialBudgetMtdHistos.h"
0013 #include "Validation/Geometry/interface/MaterialBudgetHGCalHistos.h"
0014 #include "Validation/Geometry/interface/MaterialBudgetTxt.h"
0015 #include "Validation/Geometry/interface/TestHistoMgr.h"
0016
0017 #include "SimG4Core/Watcher/interface/SimWatcher.h"
0018 #include "SimG4Core/Notification/interface/Observer.h"
0019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0020
0021 #include <CLHEP/Vector/LorentzVector.h>
0022 #include <G4VTouchable.hh>
0023
0024 class BeginOfTrack;
0025 class BeginOfRun;
0026 class BeginOfEvent;
0027 class EndOfEvent;
0028 class G4Step;
0029 class EndOfTrack;
0030 class EndOfRun;
0031 class G4StepPoint;
0032
0033 class MaterialBudgetAction : public SimWatcher,
0034 public Observer<const BeginOfRun*>,
0035 public Observer<const BeginOfTrack*>,
0036 public Observer<const G4Step*>,
0037 public Observer<const EndOfTrack*>,
0038 public Observer<const EndOfRun*> {
0039 public:
0040 MaterialBudgetAction(const edm::ParameterSet&);
0041 ~MaterialBudgetAction() override;
0042
0043 private:
0044 MaterialBudgetAction(const MaterialBudgetAction&);
0045
0046 const MaterialBudgetAction& operator=(const MaterialBudgetAction&);
0047
0048 void update(const BeginOfRun*) override;
0049 void update(const BeginOfTrack*) override;
0050 void update(const G4Step*) override;
0051 void update(const EndOfTrack*) override;
0052 void update(const EndOfRun*) override;
0053
0054 bool CheckTouchableInSelectedVolumes(const G4VTouchable* touch);
0055 bool StopAfterProcess(const G4Step* aStep);
0056
0057 void save(const G4Step* aStep);
0058 std::string getSubDetectorName(G4StepPoint* aStepPoint);
0059 std::string getPartName(G4StepPoint* aStepPoint);
0060
0061 std::shared_ptr<MaterialBudgetData> theData;
0062 std::shared_ptr<MaterialBudgetTree> theTree;
0063 std::shared_ptr<MaterialBudgetFormat> theHistos;
0064 std::shared_ptr<MaterialBudgetTxt> theTxt;
0065 std::shared_ptr<TestHistoMgr> theHistoMgr;
0066
0067 bool saveToTxt, saveToTree, saveToHistos;
0068 bool storeDecay;
0069 double Ekin;
0070 bool firstParticle;
0071
0072 std::vector<G4String> theVolumeList;
0073 G4String theProcessToStop;
0074 std::string theHistoList;
0075 };
0076
0077 #endif