Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
upmuana::UpMuProb Class Reference
Inheritance diagram for upmuana::UpMuProb:
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

 UpMuProb (fhicl::ParameterSet const &p)
 
 UpMuProb (UpMuProb const &)=delete
 
 UpMuProb (UpMuProb &&)=delete
 
UpMuProboperator= (UpMuProb const &)=delete
 
UpMuProboperator= (UpMuProb &&)=delete
 
void produce (art::Event &e) override
 
void beginJob () override
 
void endJob () override
 
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 fTrackLabel
 
std::string fSliceLabel
 

Detailed Description

Definition at line 55 of file UpMuProb_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

upmuana::UpMuProb::UpMuProb ( fhicl::ParameterSet const &  p)
explicit

Definition at line 85 of file UpMuProb_module.cc.

References reconfigure().

88 {
89  // Call appropriate produces<>() functions here.
90  reconfigure(p);
91 }
const char * p
Definition: xmltok.h:285
void reconfigure(const fhicl::ParameterSet &p)
upmuana::UpMuProb::UpMuProb ( UpMuProb const &  )
delete
upmuana::UpMuProb::UpMuProb ( UpMuProb &&  )
delete

Member Function Documentation

void upmuana::UpMuProb::beginJob ( )
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 154 of file UpMuProb_module.cc.

155 {
156  // Implementation of optional member function here.
157 }
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
void upmuana::UpMuProb::endJob ( )
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 159 of file UpMuProb_module.cc.

References DEFINE_ART_MODULE().

160 {
161  // Implementation of optional member function here.
162 }
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
UpMuProb& upmuana::UpMuProb::operator= ( UpMuProb const &  )
delete
UpMuProb& upmuana::UpMuProb::operator= ( UpMuProb &&  )
delete
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void upmuana::UpMuProb::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 103 of file UpMuProb_module.cc.

References rb::Cluster::AllCells(), art::PtrVector< T >::at(), util::CreateAssn(), PandAna.Demos.pi0_spectra::fmt, fSliceLabel, fTrackLabel, art::DataViewImpl::getByLabel(), rb::CellHit::GoodTiming(), MECModelEnuComparisons::i, rb::RecoHit::IsCalibrated(), make_pair(), upmuana::pairHitComp(), art::PtrVector< T >::push_back(), art::Event::put(), rb::Cluster::RecoHit(), upmuana::LlrUpmu::setLLR(), art::PtrVector< T >::size(), and tmp.

104 {
105  // Implementation of required member function here.
106 
107  std::unique_ptr<std::vector<upmuana::LlrUpmu> > upmucol(new std::vector<upmuana::LlrUpmu>);
108  std::unique_ptr< art::Assns<upmuana::LlrUpmu,rb::Track> > assncol(new art::Assns<upmuana::LlrUpmu,rb::Track>);
109 
111  e.getByLabel(fSliceLabel,slicecol);
112  art::PtrVector<rb::Cluster> slicelist;
113  for(unsigned int i = 0; i<slicecol->size();++i){
114  art::Ptr<rb::Cluster>slice(slicecol,i);
115  slicelist.push_back(slice);
116  }
117 
120  e.getByLabel(fTrackLabel, tracks);
121 
122  // loop over all of the slices
123  for(unsigned int iSlice = 0; iSlice<slicelist.size(); ++iSlice){
124  // get all of the tracks in this slice
125  const std::vector< art::Ptr<rb::Track> > slicetrks = fmt.at(iSlice);
126  for(unsigned int i_track = 0;i_track<slicetrks.size(); ++i_track){
127  //for (size_t i_track=0; i_track < tracks->size(); ++i_track){
128 
129  art::Ptr<rb::Track> track = slicetrks[i_track];
130 
131  art::PtrVector<rb::CellHit> trackHits = track->AllCells();
132  std::set< std::pair<rb::CellHit,rb::RecoHit>,
133  bool(*)(std::pair<rb::CellHit,rb::RecoHit>,
134  std::pair<rb::CellHit,rb::RecoHit>)>
135  sortedTrackHits (pairHitComp);
136 
137  for (size_t i_hit=0; i_hit < trackHits.size(); ++i_hit) {
138  art::Ptr<rb::CellHit> theHit = trackHits.at(i_hit);
139  if (!theHit->GoodTiming()) continue;
140  rb::RecoHit theRecoHit = track->RecoHit(theHit);
141  if (!theRecoHit.IsCalibrated()) continue;
142  sortedTrackHits.insert(std::make_pair(*theHit,theRecoHit));
143  }
144 
146  tmp.setLLR(sortedTrackHits);
147  upmucol->push_back(tmp);
148  util::CreateAssn(*this, e, *(upmucol.get()), track, *(assncol.get()));
149  }
150  }
151  e.put(std::move(upmucol));
152  e.put(std::move(assncol));
153 }
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.
void setLLR(std::set< std::pair< rb::CellHit, rb::RecoHit >, bool(*)(std::pair< rb::CellHit, rb::RecoHit >, std::pair< rb::CellHit, rb::RecoHit >)>)
Definition: LlrUpmu.cxx:30
Definition: event.h:19
Float_t tmp
Definition: plot.C:36
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
std::string fSliceLabel
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
Definition: Cluster.cxx:180
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
Definition: RecoHit.h:19
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
std::string fTrackLabel
rb::RecoHit RecoHit(const art::Ptr< rb::CellHit > &chit) const
Return calibrated hit based on assumed W coordinate.
Definition: Cluster.cxx:259
bool IsCalibrated() const
You MUST check here before accessing PECorr, MIP or GeV.
Definition: RecoHit.cxx:35
reference at(size_type n)
Definition: PtrVector.h:365
size_type size() const
Definition: PtrVector.h:308
bool pairHitComp(std::pair< rb::CellHit, rb::RecoHit > lhp, std::pair< rb::CellHit, rb::RecoHit > rhp)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
bool GoodTiming() const
Definition: CellHit.h:48
void upmuana::UpMuProb::reconfigure ( const fhicl::ParameterSet p)

Definition at line 93 of file UpMuProb_module.cc.

References fSliceLabel, fTrackLabel, fhicl::ParameterSet::get(), and string.

Referenced by UpMuProb().

94 {
95  fTrackLabel = p.get<std::string>("trackInputTag");
96  fSliceLabel = p.get<std::string>("sliceInputTag");
97 
98  produces<std::vector<upmuana::LlrUpmu> >();
99  produces< art::Assns<upmuana::LlrUpmu,rb::Track> >();
100 
101 }
std::string fSliceLabel
std::string fTrackLabel
T get(std::string const &key) const
Definition: ParameterSet.h:231
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 upmuana::UpMuProb::fSliceLabel
private

Definition at line 80 of file UpMuProb_module.cc.

Referenced by produce(), and reconfigure().

std::string upmuana::UpMuProb::fTrackLabel
private

Definition at line 79 of file UpMuProb_module.cc.

Referenced by produce(), and reconfigure().


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