Public Member Functions | Private Member Functions | Private Attributes | List of all members
larg4::CheckSimEnergyDeposit Class Reference
Inheritance diagram for larg4::CheckSimEnergyDeposit:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 CheckSimEnergyDeposit (fhicl::ParameterSet const &p)
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void beginJob () override
 
void analyze (const art::Event &event) override
 

Private Attributes

TH1F * _hnHits {nullptr}
 
TH1F * _hEdep {nullptr}
 
TH1F * _hnumPhotons {nullptr}
 
TH1F * _hLandauPhotons {nullptr}
 
TH1F * _hLandauEdep {nullptr}
 
TH1F * _hSteplength {nullptr}
 
TNtuple * _ntuple {nullptr}
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 27 of file CheckSimEnergyDeposit_module.cc.

Constructor & Destructor Documentation

larg4::CheckSimEnergyDeposit::CheckSimEnergyDeposit ( fhicl::ParameterSet const &  p)
explicit

Definition at line 45 of file CheckSimEnergyDeposit_module.cc.

45  :
47 {}
p
Definition: test.py:223

Member Function Documentation

void larg4::CheckSimEnergyDeposit::analyze ( const art::Event event)
overrideprivate

Definition at line 62 of file CheckSimEnergyDeposit_module.cc.

63 {
64  //std::vector<art::Handle<sim::SimEnergyDepositCollection>> allSims;
65  //event.getManyByType(allSims);
66  auto allSims = event.getMany<sim::SimEnergyDepositCollection>();
67  for (auto const& sims : allSims) {
68  double sumPhotons=0.0;
69  double sumE = 0.0;
70  _hnHits->Fill(sims->size());
71  for (auto const& hit : *sims) {
72  // sum up energy deposit in a 1cm slice of liquid Argon.
73  if (std::abs(hit.EndZ())<0.5) {
74  sumPhotons= sumPhotons + hit.NumPhotons();
75  sumE= sumE +hit.Energy();
76  }
77  _hnumPhotons->Fill( hit.NumPhotons());
78  _hEdep->Fill( hit.Energy()); // energy deposit in MeV
79  _hSteplength->Fill( hit.StepLength()); // step length in cm
80  /*
81  _ntuple->Fill(event.event(),
82  hit.GetEdep(),
83  hit.GetEdepEM(),
84  hit.GetEdepnonEM(),
85  hit.GetXpos(),
86  hit.GetYpos(),
87  hit.GetZpos(),
88  hit.GetTime());
89  */
90  }
91  _hLandauPhotons->Fill(sumPhotons);
92  _hLandauEdep->Fill(sumE);
93  }
94 } // end analyze
T abs(T value)
Detector simulation of raw signals on wires.
std::vector< SimEnergyDeposit > SimEnergyDepositCollection
void larg4::CheckSimEnergyDeposit::beginJob ( )
overrideprivatevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 49 of file CheckSimEnergyDeposit_module.cc.

50 {
52  _hnHits = tfs->make<TH1F>("hnHits", "Number of SimEnergyDeposits", 300, 0, 0);
53  _hEdep = tfs->make<TH1F>("hEdep", "Energy deposition in SimEnergyDeposits", 100,0.,0.02);
54  _hnumPhotons = tfs->make<TH1F>("hnumPhotons", "number of photons per SimEnergyDeposit", 100,0.,500.);
55  _hLandauPhotons= tfs->make<TH1F>("hLandauPhotons", "number of photons/cm", 100,0.,2000000.);
56  _hLandauEdep= tfs->make<TH1F>("hLandauEdep", "Edep/cm", 100,0.,10.);
57  _hSteplength= tfs->make<TH1F>("hSteplength", "geant 4 step length", 100,0.,0.05);
58  _ntuple = tfs->make<TNtuple>("ntuple","Demo ntuple",
59  "Event:Edep:em_Edep:nonem_Edep:xpos:ypos:zpos:time");
60 } // end beginJob

Member Data Documentation

TH1F* larg4::CheckSimEnergyDeposit::_hEdep {nullptr}
private

Definition at line 37 of file CheckSimEnergyDeposit_module.cc.

TH1F* larg4::CheckSimEnergyDeposit::_hLandauEdep {nullptr}
private

Definition at line 40 of file CheckSimEnergyDeposit_module.cc.

TH1F* larg4::CheckSimEnergyDeposit::_hLandauPhotons {nullptr}
private

Definition at line 39 of file CheckSimEnergyDeposit_module.cc.

TH1F* larg4::CheckSimEnergyDeposit::_hnHits {nullptr}
private

Definition at line 36 of file CheckSimEnergyDeposit_module.cc.

TH1F* larg4::CheckSimEnergyDeposit::_hnumPhotons {nullptr}
private

Definition at line 38 of file CheckSimEnergyDeposit_module.cc.

TH1F* larg4::CheckSimEnergyDeposit::_hSteplength {nullptr}
private

Definition at line 41 of file CheckSimEnergyDeposit_module.cc.

TNtuple* larg4::CheckSimEnergyDeposit::_ntuple {nullptr}
private

Definition at line 42 of file CheckSimEnergyDeposit_module.cc.


The documentation for this class was generated from the following file: