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

Public Member Functions

 VtxScore (fhicl::ParameterSet const &p)
 
 VtxScore (VtxScore const &)=delete
 
 VtxScore (VtxScore &&)=delete
 
VtxScoreoperator= (VtxScore const &)=delete
 
VtxScoreoperator= (VtxScore &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
- 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 Attributes

art::InputTag fNNetModuleLabel
 
art::InputTag fHitsModuleLabel
 
TTree * ftree
 
int run
 
int subrun
 
int event
 
std::vector< short > channel
 
std::vector< short > tpc
 
std::vector< short > plane
 
std::vector< short > wire
 
std::vector< double > charge
 
std::vector< double > peakt
 
std::vector< double > score_inel
 
std::vector< double > score_el
 
std::vector< double > score_none
 

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 30 of file VtxScore_module.cc.

Constructor & Destructor Documentation

pdsp::VtxScore::VtxScore ( fhicl::ParameterSet const &  p)
explicit

Definition at line 71 of file VtxScore_module.cc.

72  : EDAnalyzer{p},
73  fNNetModuleLabel(p.get<art::InputTag>("NNetModuleLabel")),
74  fHitsModuleLabel(p.get<art::InputTag>("HitsModuleLabel"))
75 {
76 }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
art::InputTag fNNetModuleLabel
p
Definition: test.py:223
art::InputTag fHitsModuleLabel
pdsp::VtxScore::VtxScore ( VtxScore const &  )
delete
pdsp::VtxScore::VtxScore ( VtxScore &&  )
delete

Member Function Documentation

void pdsp::VtxScore::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 78 of file VtxScore_module.cc.

79 {
80 
81  run = e.run();
82  subrun = e.subRun();
83  event = e.id().event();
84  channel.clear();
85  tpc.clear();
86  plane.clear();
87  wire.clear();
88  charge.clear();
89  peakt.clear();
90  score_inel.clear();
91  score_el.clear();
92  score_none.clear();
93 
95 
96  std::vector<art::Ptr<recob::Hit> > hitlist;
97  auto hitListHandle = e.getHandle< std::vector<recob::Hit> >(fHitsModuleLabel);
98  if (hitListHandle) art::fill_ptr_vector(hitlist, hitListHandle);
99 
100  // loop over hits
101  // for (size_t h = 0; h < hitResults.size(); ++h) {
102  for (auto & hit : hitlist){
103 
104  // Get cnn output for hit h
105  std::array<float,3> cnn_out = hitResults.getOutput(hit);
106 
107  if (hit->WireID().Plane == 2){
108  channel.push_back(hit->Channel());
109  tpc.push_back(hit->WireID().TPC);
110  plane.push_back(hit->WireID().Plane);
111  wire.push_back(hit->WireID().Wire);
112  charge.push_back(hit->Integral());
113  peakt.push_back(hit->PeakTime());
114  score_inel.push_back(cnn_out[hitResults.getIndex("inel")]);
115  score_el.push_back(cnn_out[hitResults.getIndex("el")]);
116  score_none.push_back(cnn_out[hitResults.getIndex("none")]);
117 // std::cout<<hit->WireID().TPC<<" "
118 // <<hit->WireID().Wire<<" "
119 // <<hit->PeakTime()<<" "
120 // <<cnn_out[hitResults.getIndex("el")]<<" "
121 // <<cnn_out[hitResults.getIndex("inel")]<<" "
122 // <<cnn_out[hitResults.getIndex("none")]<<std::endl;
123  }
124  }
125  if (!channel.empty()) ftree->Fill();
126 }
std::vector< double > score_el
std::vector< short > plane
art::InputTag fNNetModuleLabel
std::vector< short > wire
std::vector< double > score_none
const double e
std::vector< double > charge
Detector simulation of raw signals on wires.
std::vector< double > score_inel
std::vector< double > peakt
art::InputTag fHitsModuleLabel
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
std::vector< short > tpc
std::vector< short > channel
void pdsp::VtxScore::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 128 of file VtxScore_module.cc.

129 {
130  art::ServiceHandle<art::TFileService> fileServiceHandle;
131  ftree = fileServiceHandle->make<TTree>("ftree", "hit info");
132  ftree->Branch("run", &run, "run/I");
133  ftree->Branch("event", &event, "event/I");
134  ftree->Branch("channel", &channel);
135  ftree->Branch("tpc", &tpc);
136  ftree->Branch("plane", &plane);
137  ftree->Branch("wire", &wire);
138  ftree->Branch("charge", &charge);
139  ftree->Branch("peakt", &peakt);
140  ftree->Branch("score_inel", &score_inel);
141  ftree->Branch("score_el", &score_el);
142  ftree->Branch("score_none", &score_none);
143 }
std::vector< double > score_el
std::vector< short > plane
std::vector< short > wire
std::vector< double > score_none
std::vector< double > charge
std::vector< double > score_inel
std::vector< double > peakt
std::vector< short > tpc
std::vector< short > channel
Event finding and building.
VtxScore& pdsp::VtxScore::operator= ( VtxScore const &  )
delete
VtxScore& pdsp::VtxScore::operator= ( VtxScore &&  )
delete

Member Data Documentation

std::vector<short> pdsp::VtxScore::channel
private

Definition at line 59 of file VtxScore_module.cc.

std::vector<double> pdsp::VtxScore::charge
private

Definition at line 63 of file VtxScore_module.cc.

int pdsp::VtxScore::event
private

Definition at line 58 of file VtxScore_module.cc.

art::InputTag pdsp::VtxScore::fHitsModuleLabel
private

Definition at line 53 of file VtxScore_module.cc.

art::InputTag pdsp::VtxScore::fNNetModuleLabel
private

Definition at line 52 of file VtxScore_module.cc.

TTree* pdsp::VtxScore::ftree
private

Definition at line 55 of file VtxScore_module.cc.

std::vector<double> pdsp::VtxScore::peakt
private

Definition at line 64 of file VtxScore_module.cc.

std::vector<short> pdsp::VtxScore::plane
private

Definition at line 61 of file VtxScore_module.cc.

int pdsp::VtxScore::run
private

Definition at line 56 of file VtxScore_module.cc.

std::vector<double> pdsp::VtxScore::score_el
private

Definition at line 66 of file VtxScore_module.cc.

std::vector<double> pdsp::VtxScore::score_inel
private

Definition at line 65 of file VtxScore_module.cc.

std::vector<double> pdsp::VtxScore::score_none
private

Definition at line 67 of file VtxScore_module.cc.

int pdsp::VtxScore::subrun
private

Definition at line 57 of file VtxScore_module.cc.

std::vector<short> pdsp::VtxScore::tpc
private

Definition at line 60 of file VtxScore_module.cc.

std::vector<short> pdsp::VtxScore::wire
private

Definition at line 62 of file VtxScore_module.cc.


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