LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SimDriftedElectronClusterAna_module.cc
Go to the documentation of this file.
1 // Class: SimDriftedElectronClusterAna
3 // Plugin Type: analyzer (art v2_05_00)
4 // File: DriftedElectronsClustersSAna_module.cc
5 //
7 
9 
15 #include "art_root_io/TFileService.h"
17 #include "fhiclcpp/ParameterSet.h"
18 
19 #include "TNtuple.h"
20 
21 #include <iostream>
22 #include <vector>
23 
24 namespace detsim {
25 
27  public:
29  // The compiler-generated destructor is fine for non-base
30  // classes without bare pointers or other resource use.
31 
32  // Plugins should not be copied or assigned.
37 
38  // Required functions.
39  void analyze(art::Event const& e) override;
40 
41  // Selected optional functions.
42  void beginJob() override;
43 
44  private:
46 
47  TNtuple* fNtuple;
48  };
49 
51  : EDAnalyzer(p), fEDepTag{p.get<art::InputTag>("EDepModuleLabel")}
52  {}
53 
55  {
56  auto const& edep_handle =
57  e.getValidHandle<std::vector<sim::SimDriftedElectronCluster>>(fEDepTag);
58  auto const& edep_vec(*edep_handle);
59  std::cout << "=====================edep" << edep_vec.size() << std::endl;
60  for (auto const& edep : edep_vec) {
61  fNtuple->Fill(e.run(), e.event(), edep.NumberOfElectrons(), edep.Time());
62  }
63  }
64 
66  {
68  fNtuple = tfs->make<TNtuple>("nt_is", "EDep IS Calc Ntuple", "run:event:ne:t");
69  }
70 } // namespace detsim
71 
contains objects relating to SimDriftedElectronCluster
Detector simulation of raw signals on wires.
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
SimDriftedElectronClusterAna & operator=(SimDriftedElectronClusterAna const &)=delete
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:65
T get(std::string const &key) const
Definition: ParameterSet.h:314
EventNumber_t event() const
Definition: Event.cc:41
Double_t edep
Definition: macro.C:13
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Float_t e
Definition: plot.C:35
RunNumber_t run() const
Definition: Event.cc:29