SimDriftedElectronClusterAna_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: SimDriftedElectronClusterAna
3 // Plugin Type: analyzer (art v2_05_00)
4 // File: DriftedElectronsClustersSAna_module.cc
5 //
6 ////////////////////////////////////////////////////////////////////////
7 
13 #include "fhiclcpp/ParameterSet.h"
14 
15 #include "art_root_io/TFileService.h"
16 #include "TNtuple.h"
17 
18 
20 
21 
22 
23 namespace detsim {
24 
26 public:
28  // The compiler-generated destructor is fine for non-base
29  // classes without bare pointers or other resource use.
30 
31  // Plugins should not be copied or assigned.
36 
37  // Required functions.
38  void analyze(art::Event const & e) override;
39 
40  // Selected optional functions.
41  void beginJob() override;
42 
43 private:
44 
45 
47 
48  TNtuple* fNtuple;
49 };
50 
51 
53  : EDAnalyzer(p)
54  , fEDepTag{p.get<art::InputTag>("EDepModuleLabel")}
55 {}
56 
58 {
59  auto const& edep_handle = e.getValidHandle< std::vector<sim::SimDriftedElectronCluster> >(fEDepTag);
60  auto const& edep_vec(*edep_handle);
61  std::cout<< "=====================edep"<<edep_vec.size()<<std::endl;
62  for(auto const& edep : edep_vec){
63  fNtuple->Fill(e.run(),e.event(),
64  edep.NumberOfElectrons(),
65  edep.Time());
66  }
67 }
68 
70 {
72  fNtuple = tfs->make<TNtuple>("nt_is","EDep IS Calc Ntuple","run:event:ne:t");
73 }
74 } // namespace detsim
75 
EventNumber_t event() const
Definition: DataViewImpl.cc:85
contains objects relating to SimDriftedElectronCluster
Detector simulation of raw signals on wires.
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
SimDriftedElectronClusterAna & operator=(SimDriftedElectronClusterAna const &)=delete
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
T get(std::string const &key) const
Definition: ParameterSet.h:271
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
p
Definition: test.py:223
RunNumber_t run() const
Definition: DataViewImpl.cc:71
QTextStream & endl(QTextStream &s)