All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
icarus::crt::CRTTrueHitProducer Class Reference
Inheritance diagram for icarus::crt::CRTTrueHitProducer:

Public Types

using CRTHit = sbn::crt::CRTHit
 

Public Member Functions

 CRTTrueHitProducer (fhicl::ParameterSet const &p)
 
 CRTTrueHitProducer (CRTTrueHitProducer const &)=delete
 
 CRTTrueHitProducer (CRTTrueHitProducer &&)=delete
 
CRTTrueHitProduceroperator= (CRTTrueHitProducer const &)=delete
 
CRTTrueHitProduceroperator= (CRTTrueHitProducer &&)=delete
 
void produce (art::Event &e) override
 
void reconfigure (fhicl::ParameterSet const &p)
 

Private Attributes

art::InputTag fCrtModuleLabel
 name of crt producer More...
 
CRTTrueHitRecoAlg hitAlg
 

Detailed Description

Definition at line 45 of file CRTTrueHitProducer_module.cc.

Member Typedef Documentation

Definition at line 48 of file CRTTrueHitProducer_module.cc.

Constructor & Destructor Documentation

icarus::crt::CRTTrueHitProducer::CRTTrueHitProducer ( fhicl::ParameterSet const &  p)
explicit

Definition at line 77 of file CRTTrueHitProducer_module.cc.

78  : EDProducer{p}, hitAlg(p.get<fhicl::ParameterSet>("HitAlg"))
79  // Initialize member data here, if know don't want to reconfigure on the fly
80 {
81  this->reconfigure(p);
82 
83  // Call appropriate produces<>() functions here.
84  produces< vector<CRTHit> >();
85  produces< vector<AuxDetIDE> >();
86  produces< art::Assns<CRTHit , AuxDetIDE> >();
87 
88 } // CRTTrueHitProducer()
pdgs p
Definition: selectors.fcl:22
void reconfigure(fhicl::ParameterSet const &p)
icarus::crt::CRTTrueHitProducer::CRTTrueHitProducer ( CRTTrueHitProducer const &  )
delete
icarus::crt::CRTTrueHitProducer::CRTTrueHitProducer ( CRTTrueHitProducer &&  )
delete

Member Function Documentation

CRTTrueHitProducer& icarus::crt::CRTTrueHitProducer::operator= ( CRTTrueHitProducer const &  )
delete
CRTTrueHitProducer& icarus::crt::CRTTrueHitProducer::operator= ( CRTTrueHitProducer &&  )
delete
void icarus::crt::CRTTrueHitProducer::produce ( art::Event &  e)
override

Definition at line 95 of file CRTTrueHitProducer_module.cc.

96 {
97  std::unique_ptr< vector<CRTHit> > CRTHitcol( new vector<CRTHit>);
98  std::unique_ptr< vector<AuxDetIDE> > IDEcol( new vector<AuxDetIDE>);
99  std::unique_ptr< art::Assns<CRTHit, AuxDetIDE> > Hitassn( new art::Assns<CRTHit,AuxDetIDE>);
100  art::PtrMaker<CRTHit> makeHitPtr(event);
101  art::PtrMaker<AuxDetIDE> makeAdPtr(event);
102 
103  int nHits = 0;
104 
105  // Retrieve list of CRT hits
106  art::Handle< vector<sim::AuxDetSimChannel>> adscListHandle;
107  vector<art::Ptr<sim::AuxDetSimChannel> > adscList;
108 
109  if (event.getByLabel(fCrtModuleLabel, adscListHandle))
110  art::fill_ptr_vector(adscList, adscListHandle);
111 
112  mf::LogInfo("CRTTrueHitProducer")
113  <<"Number of AuxDetSimChannels = "<<adscList.size();
114 
115  vector<std::pair<CRTHit, vector<AuxDetIDE>>> crtHitPairs = hitAlg.CreateCRTHits(adscList);
116 
117  for(auto const& crtHitPair : crtHitPairs){
118 
119  CRTHitcol->push_back(crtHitPair.first);
120  art::Ptr<CRTHit> hitPtr = makeHitPtr(CRTHitcol->size()-1);
121  nHits++;
122 
123  for(auto const& ide : crtHitPair.second){
124 
125  IDEcol->push_back(ide);
126  art::Ptr<AuxDetIDE> idePtr = makeAdPtr(IDEcol->size()-1);
127  Hitassn->addSingle(hitPtr, idePtr);
128  }
129  }
130 
131  event.put(std::move(CRTHitcol));
132  event.put(std::move(IDEcol));
133  event.put(std::move(Hitassn));
134 
135  mf::LogInfo("CRTTrueHitProducer")
136  <<"Number of CRT hits produced = "<<nHits;
137 
138 } // CRTTrueHitProducer::produce()
art::InputTag fCrtModuleLabel
name of crt producer
vector< pair< CRTHit, vector< sim::AuxDetIDE > > > CreateCRTHits(vector< art::Ptr< sim::AuxDetSimChannel >> adscList)
void icarus::crt::CRTTrueHitProducer::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 90 of file CRTTrueHitProducer_module.cc.

91 {
92  fCrtModuleLabel = (p.get<art::InputTag> ("CrtModuleLabel"));
93 } // CRTTrueHitProducer::reconfigure()
art::InputTag fCrtModuleLabel
name of crt producer
pdgs p
Definition: selectors.fcl:22

Member Data Documentation

art::InputTag icarus::crt::CRTTrueHitProducer::fCrtModuleLabel
private

name of crt producer

Definition at line 70 of file CRTTrueHitProducer_module.cc.

CRTTrueHitRecoAlg icarus::crt::CRTTrueHitProducer::hitAlg
private

Definition at line 72 of file CRTTrueHitProducer_module.cc.


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