File indexing completed on 2024-04-06 12:30:26
0001 #ifndef SimG4Core_FieldStepWatcher_H
0002 #define SimG4Core_FieldStepWatcher_H
0003
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "SimG4Core/Notification/interface/Observer.h"
0006 #include "SimG4Core/Watcher/interface/SimWatcher.h"
0007
0008 #include "DQMServices/Core/interface/DQMStore.h"
0009 #include "FWCore/ServiceRegistry/interface/Service.h"
0010
0011 #include "G4NavigationHistory.hh"
0012
0013 #include <iostream>
0014 #include <map>
0015 #include <string>
0016 #include <vector>
0017
0018 class BeginOfRun;
0019 class BeginOfEvent;
0020 class EndOfEvent;
0021 class G4Step;
0022
0023 class FieldStepWatcher : public SimWatcher,
0024 public Observer<const BeginOfRun *>,
0025 public Observer<const BeginOfEvent *>,
0026 public Observer<const EndOfEvent *>,
0027 public Observer<const G4Step *> {
0028 public:
0029 typedef dqm::legacy::DQMStore DQMStore;
0030 typedef dqm::legacy::MonitorElement MonitorElement;
0031
0032 FieldStepWatcher(edm::ParameterSet const &p);
0033 ~FieldStepWatcher() override;
0034
0035 private:
0036 void update(const BeginOfRun *) override;
0037 void update(const BeginOfEvent *) override;
0038 void update(const EndOfEvent *) override;
0039 void update(const G4Step *) override;
0040 void findTouch(G4VPhysicalVolume *, int);
0041 int findName(std::string);
0042
0043 private:
0044 int level;
0045 std::string outFile;
0046
0047 std::vector<std::string> lvnames;
0048 std::vector<int> steps;
0049 G4NavigationHistory fHistory;
0050
0051 DQMStore *dbe_;
0052 std::vector<MonitorElement *> meStep, meCall, meStepCH, meStepNH, meStepC;
0053 std::vector<MonitorElement *> meStepE, meStepG, meStepMu, meStepNu, meStepN;
0054 };
0055
0056 #endif