LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ISCalculationAna_module.cc
Go to the documentation of this file.
1 // Class: ISCalculationAna
3 // Plugin Type: analyzer (art v2_05_00)
4 // File: ISCalculationAna_module.cc
5 //
6 // Generated at Tue Mar 7 14:59:03 2017 by Wesley Ketchum using cetskelgen
7 // from cetlib version v1_21_00.
9 
17 #include "fhiclcpp/ParameterSet.h"
19 
21 #include "TNtuple.h"
22 
23 #include "ISCalcSeparate.h"
25 
30 
31 namespace larg4 {
32  class ISCalculationAna;
33 }
34 
35 
37 public:
38  explicit ISCalculationAna(fhicl::ParameterSet const & p);
39  // The compiler-generated destructor is fine for non-base
40  // classes without bare pointers or other resource use.
41 
42  // Plugins should not be copied or assigned.
43  ISCalculationAna(ISCalculationAna const &) = delete;
45  ISCalculationAna & operator = (ISCalculationAna const &) = delete;
47 
48  // Required functions.
49  void analyze(art::Event const & e) override;
50 
51  // Selected optional functions.
52  void beginJob() override;
53  void reconfigure(fhicl::ParameterSet const & p);
54 
55 private:
56 
59 
60  TNtuple* fNtuple;
61 };
62 
63 
65  :
66  EDAnalyzer(p) // ,
67  // More initializers here.
68 {
69  this->reconfigure(p);
70 }
71 
73 {
74  auto const& edep_handle = e.getValidHandle< std::vector<sim::SimEnergyDeposit> >(fEDepTag);
75  auto const& edep_vec(*edep_handle);
76 
77  for(auto const& edep : edep_vec){
78  fISAlg.Reset();
80  fNtuple->Fill(e.run(),e.event(),
81  edep.T(),
82  edep.X(),edep.Y(),edep.Z(),edep.StepLength(),
83  edep.Energy(),edep.TrackID(),edep.PdgCode(),
87  }
88 }
89 
91 {
93  fISAlg.Initialize(lar::providerFrom<detinfo::LArPropertiesService>(),
94  lar::providerFrom<detinfo::DetectorPropertiesService>(),
95  &(*lgpHandle),
96  lar::providerFrom<spacecharge::SpaceChargeService>());
98  fNtuple = tfs->make<TNtuple>("nt_is","EDep IS Calc Ntuple","run:event:t:x:y:z:ds:e:trackid:pdg:e_deposit:n_electron:n_photon");
99 }
100 
102 {
103  fEDepTag = p.get<art::InputTag>("EDepModuleLabel");
104 }
105 
Store parameters for running LArG4.
void Initialize(const detinfo::LArProperties *larp, const detinfo::DetectorProperties *detp, const sim::LArG4Parameters *lgp, const spacecharge::SpaceCharge *sce)
void CalculateIonizationAndScintillation(sim::SimEnergyDeposit const &edep)
Geant4 interface.
double NumberScintillationPhotons() const
double EnergyDeposit() const
ISCalculationAna & operator=(ISCalculationAna const &)=delete
void reconfigure(fhicl::ParameterSet const &p)
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:42
void analyze(art::Event const &e) override
T get(std::string const &key) const
Definition: ParameterSet.h:231
EventNumber_t event() const
Definition: Event.h:67
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
Double_t edep
Definition: macro.C:13
T * make(ARGS...args) const
double NumberIonizationElectrons() const
contains information for a single step in the detector simulation
ISCalculationAna(fhicl::ParameterSet const &p)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Float_t e
Definition: plot.C:34
RunNumber_t run() const
Definition: Event.h:77