Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
trk::TrkAssn Class Reference
Inheritance diagram for trk::TrkAssn:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 TrkAssn (fhicl::ParameterSet const &pset)
 
virtual ~TrkAssn ()
 
void produce (art::Event &evt)
 
void reconfigure (const fhicl::ParameterSet &p)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

std::string fTrackInput
 
std::string fSliceInput
 
std::string fProngInput
 
std::string fVertexInput
 

Detailed Description

Definition at line 26 of file TrkAssn_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

using art::EDProducer::WorkerType = WorkerT<EDProducer>
inherited

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

trk::TrkAssn::TrkAssn ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 45 of file TrkAssn_module.cc.

References reconfigure().

46  {
47  reconfigure(pset);
48  produces< art::Assns<rb::Cluster, rb::Track> >();
49  produces< art::Assns<rb::Cluster, rb::Prong> >();
50  produces< art::Assns<rb::Cluster, rb::Vertex> >();
51  }
void reconfigure(const fhicl::ParameterSet &p)
trk::TrkAssn::~TrkAssn ( )
virtual

Definition at line 54 of file TrkAssn_module.cc.

55  {
56  }

Member Function Documentation

template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDProducer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void trk::TrkAssn::produce ( art::Event evt)
virtual

Reconstruction method for this module. Provides read-write access to the event data.

Implements art::EDProducer.

Definition at line 70 of file TrkAssn_module.cc.

References rb::Cluster::AllCells(), rb::Cluster::Cell(), util::CreateAssn(), DEFINE_ART_MODULE(), fProngInput, fSliceInput, fTrackInput, fVertexInput, art::DataViewImpl::getByLabel(), rb::Vertex::GetT(), MECModelEnuComparisons::i, ip, rb::Cluster::MaxTNS(), rb::Cluster::MinTNS(), rb::Cluster::NCell(), art::Event::put(), art::PtrVector< T >::size(), and track.

71  {
72  // Declare a container for Track objects to be stored in the art::event
73  std::unique_ptr< art::Assns<rb::Cluster,rb::Track> > assns(new art::Assns<rb::Cluster, rb::Track>);
74  std::unique_ptr< art::Assns<rb::Cluster,rb::Prong> > passns(new art::Assns<rb::Cluster, rb::Prong>);
75  std::unique_ptr< art::Assns<rb::Cluster,rb::Vertex> > vassns(new art::Assns<rb::Cluster, rb::Vertex>);
76 
77  // define a vector holding slices
79  evt.getByLabel(fSliceInput,slicecol);
80 
81  // define a vector holding tracks
83  evt.getByLabel(fTrackInput,trkcol);
84 
86  evt.getByLabel(fProngInput,pcol);
87 
89  evt.getByLabel(fVertexInput,vcol);
90 
91  std::vector<bool> foundsl;
92  for(unsigned int i = 0; i<trkcol->size();++i){
93  foundsl.push_back(false);
94  }
95 
96  std::vector<bool> foundslp;
97  for(unsigned int i = 0; i<pcol->size();++i){
98  foundslp.push_back(false);
99  }
100 
101  std::vector<bool> foundslv;
102  for(unsigned int i = 0; i<vcol->size();++i){
103  foundslv.push_back(false);
104  }
105 
106  // loop over the slices
107  for(unsigned int isl = 0; isl<slicecol->size(); ++isl){
108  // get the vector of cell hits for this slice
109  art::Ptr<rb::Cluster> slice(slicecol,isl);
110  art::PtrVector<rb::CellHit> slicehits = slice->AllCells();
111  // loop over the tracks
112  std::vector<art::Ptr<rb::Track> > slicetrks;
113  for(unsigned int itrk = 0; itrk<trkcol->size(); ++itrk){
114  art::Ptr<rb::Track> track(trkcol,itrk);
115  if(foundsl[itrk]){ continue; }
116  if(track->NCell() < 1){ continue; }
117  // any hit on the track should only belong to one slice so take the first one
118  art::Ptr<rb::CellHit> trkhit = track->Cell(0);
119  // loop over the slice hits and see if this on is in the list
120  bool foundtrkhit = false;
121  for(unsigned int ihit = 0; ihit<slicehits.size(); ++ihit){
122  if(trkhit == slicehits[ihit]){
123  foundtrkhit = true;
124  break;
125  }
126  }
127  if(foundtrkhit){
128  foundsl[itrk] = true;
129  // add this track to the vector of tracks to be associated with this slice
130  slicetrks.push_back(track);
131  }
132  }
133  // loop over the prongs
134  std::vector<art::Ptr<rb::Prong> > sliceprongs;
135  for(unsigned int ip = 0; ip<pcol->size(); ++ip){
136  art::Ptr<rb::Prong> prong(pcol,ip);
137  if(foundslp[ip]){ continue; }
138  if(prong->NCell() < 1){ continue; }
139  // any hit in the prong should only belong to one slice so take the first one
140  art::Ptr<rb::CellHit> phit = prong->Cell(0);
141  // loop over the slice hits and see if this on is in the list
142  bool foundphit = false;
143  for(unsigned int ihit = 0; ihit<slicehits.size(); ++ihit){
144  if(phit == slicehits[ihit]){
145  foundphit = true;
146  break;
147  }
148  }
149  if(foundphit){
150  foundslp[ip] = true;
151  // add this prong to the vector of prongs to be associated with this slice
152  sliceprongs.push_back(prong);
153  }
154  }
155  // loop over the verticies
156  std::vector<art::Ptr<rb::Vertex> > slicevertex;
157  for(unsigned int iv = 0; iv<vcol->size(); ++iv){
158  art::Ptr<rb::Vertex> vert(vcol,iv);
159  if(foundslv[iv]){ continue; }
160  // vertex time should fall inside a slice
161  if ((vert->GetT() >= slice->MinTNS()) && (vert->GetT() <= slice->MaxTNS())){
162  foundslv[iv] = true;
163  // add this vertex to the vector of verticies to be associated with this slice
164  slicevertex.push_back(vert);
165  }
166  }
167  if(slicetrks.size()>0){
168  util::CreateAssn(*this,evt,slice,slicetrks,*(assns.get()));
169  }
170  if(sliceprongs.size()>0){
171  util::CreateAssn(*this,evt,slice,sliceprongs,*(passns.get()));
172  }
173  if(slicevertex.size()>0){
174  util::CreateAssn(*this,evt,slice,slicevertex,*(vassns.get()));
175  }
176  }
177 
178  evt.put(std::move(assns));
179  evt.put(std::move(passns));
180  evt.put(std::move(vassns));
181  }
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
std::string fVertexInput
std::string fSliceInput
Definition: event.h:19
TString ip
Definition: loadincs.C:5
std::string fProngInput
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
unsigned short Cell() const
Definition: CellHit.h:40
size_type size() const
Definition: PtrVector.h:308
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Float_t track
Definition: plot.C:35
std::string fTrackInput
void trk::TrkAssn::reconfigure ( const fhicl::ParameterSet p)

Definition at line 59 of file TrkAssn_module.cc.

References fProngInput, fSliceInput, fTrackInput, fVertexInput, fhicl::ParameterSet::get(), and string.

Referenced by TrkAssn().

60  {
61  fTrackInput = pset.get< std::string >("TrackInput") ;
62  fSliceInput = pset.get< std::string >("SliceInput") ;
63  fProngInput = pset.get< std::string >("ProngInput") ;
64  fVertexInput = pset.get< std::string >("VertexInput");
65  }
std::string fVertexInput
std::string fSliceInput
std::string fProngInput
std::string fTrackInput
enum BeamMode string
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

std::string trk::TrkAssn::fProngInput
private

Definition at line 36 of file TrkAssn_module.cc.

Referenced by produce(), and reconfigure().

std::string trk::TrkAssn::fSliceInput
private

Definition at line 35 of file TrkAssn_module.cc.

Referenced by produce(), and reconfigure().

std::string trk::TrkAssn::fTrackInput
private

Definition at line 34 of file TrkAssn_module.cc.

Referenced by produce(), and reconfigure().

std::string trk::TrkAssn::fVertexInput
private

Definition at line 37 of file TrkAssn_module.cc.

Referenced by produce(), and reconfigure().


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