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

 VertexFinder (fhicl::ParameterSet const &pset)
 
virtual ~VertexFinder ()
 
void produce (art::Event &evt)
 
void beginJob ()
 
void reconfigure (fhicl::ParameterSet const &pset)
 
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 ()
 

Static Public Attributes

static const int GAMMAID = 22
 
static const int PIZEROID = 111
 
static const int PIPLUSID = 211
 
static const int PIMINUSID = -211
 
static const int NUEID = 12
 
static const int NUMUID = 14
 
static const int NUTAUID = 16
 

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

int fMinTrack
 
bool fPi0Reco
 
double fXMax
 
double fYMax
 
double fZMin
 
double fZMax
 
double fDOCA_cut
 
double fAngle_cut
 

Detailed Description

Definition at line 26 of file VertexFinder_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

vf::VertexFinder::VertexFinder ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 73 of file VertexFinder_module.cc.

References reconfigure().

74  {
75  reconfigure(pset);
76  produces< std::vector<rb::Vertex> >();
77  }
void reconfigure(fhicl::ParameterSet const &pset)
vf::VertexFinder::~VertexFinder ( )
virtual

Definition at line 94 of file VertexFinder_module.cc.

95  {
96  }

Member Function Documentation

void vf::VertexFinder::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 99 of file VertexFinder_module.cc.

100  {
101  }
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 vf::VertexFinder::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 104 of file VertexFinder_module.cc.

References vf::DOCAInfo::AngleReco(), rb::Cluster::Cell(), om::cout, DEFINE_ART_MODULE(), delta, vf::DOCAInfo::Doca(), allTimeWatchdog::endl, stan::math::fabs(), fAngle_cut, fDOCA_cut, fMinTrack, fXMax, fYMax, fZMax, fZMin, art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, compare_h5_caf::idx, calib::j, rb::Cluster::NCell(), art::Event::put(), rb::Prong::Start(), rb::CellHit::TNS(), track, trackID, and vf::DOCAInfo::VertexReco().

105  {
106 
107  std::unique_ptr< std::vector<rb::Vertex> > vert(new std::vector<rb::Vertex> );
108 
110  try{ evt.getByLabel("trackmerge",trackhandle); }
111  catch(...){ std::cout<<"couldn't get the trackhandle "<<std::endl; return;}
112 
113  TVector3 mc_vertex,rc_vertex, delta;
114  double doca, angle_reco;
115  std::vector<int> trackID;
116 
117  int NbTrack = trackhandle->size();
118  if (NbTrack<fMinTrack) return;
119 
120  //Get vertex time: finding the earliest cell hit in the track
121 
122 
123  double vertime;
124  art::Ptr<rb::Track> track(trackhandle,0);
125  vertime = track->Cell(0)->TNS();
126  int cell_Nb = track->NCell();
127  for (int idx =1 ; idx!=cell_Nb; idx++){
128  if (vertime > track->Cell(idx)->TNS())
129  vertime = track->Cell(idx)->TNS();
130  }
131 
132  if (NbTrack==1) rc_vertex = track->Start();
133 
134  // Let's do this with the qualified Tracks:
135  int combNB=0;
136  for (int k=0; k<NbTrack; k++) trackID.push_back(k);
137 
138  // rc_vertex.SetXYZ(0.,0.,0.);
139 
140  for (int i=0; i<NbTrack-1;i++){
141  for(int j=i+1;j<NbTrack;j++ )
142  {
143 
144  art::Ptr<rb::Track> track1(trackhandle, trackID[i]);
145  art::Ptr<rb::Track> track2(trackhandle, trackID[j]);
146  DOCAInfo doca_info(*track1, *track2);
147 
148  doca = doca_info.Doca();
149  angle_reco = doca_info.AngleReco();
150 
151  //Choosing right combinations
152  if (doca > fDOCA_cut ||
153  fabs(angle_reco) > fAngle_cut ||
154  fabs(doca_info.VertexReco().x())>fXMax ||
155  fabs(doca_info.VertexReco().y())>fYMax ||
156  doca_info.VertexReco().z()<fZMin ||
157  doca_info.VertexReco().z()>fZMax ) continue;
158 
159  else {
160  rc_vertex = rc_vertex+doca_info.VertexReco();
161  combNB++;
162  }
163 
164  }
165  }
166 
167 
168  if (combNB<1) return;
169  rc_vertex = rc_vertex*(1.0/(combNB+0.0));
170 
171  vert->push_back(rb::Vertex(rc_vertex,vertime));
172 
173  evt.put(std::move(vert));
174  return;
175  }
A 3D position and time representing an interaction vertex.
Definition: Vertex.h:15
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
double delta
Definition: runWimpSim.h:98
Definition: event.h:19
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
const double j
Definition: BetheBloch.cxx:29
OStream cout
Definition: OStream.cxx:6
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Int_t trackID
Definition: plot.C:84
Float_t track
Definition: plot.C:35
void vf::VertexFinder::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 81 of file VertexFinder_module.cc.

References fAngle_cut, fDOCA_cut, fMinTrack, fPi0Reco, fXMax, fYMax, fZMax, fZMin, and fhicl::ParameterSet::get().

Referenced by VertexFinder().

82  {
83  fPi0Reco =pset.get< bool >("Pi0Reco" );
84  fMinTrack =pset.get< int >("MinTrack" );
85  fXMax =pset.get< double >("XMax" );
86  fYMax =pset.get< double >("YMax" );
87  fZMin =pset.get< double >("ZMin" );
88  fZMax =pset.get< double >("ZMax" );
89  fDOCA_cut =pset.get< double >("DOCA_cut" );
90  fAngle_cut =pset.get< double >("Angle_cut" );
91  }
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

double vf::VertexFinder::fAngle_cut
private

Definition at line 56 of file VertexFinder_module.cc.

Referenced by produce(), and reconfigure().

double vf::VertexFinder::fDOCA_cut
private

Definition at line 55 of file VertexFinder_module.cc.

Referenced by produce(), and reconfigure().

int vf::VertexFinder::fMinTrack
private

Definition at line 49 of file VertexFinder_module.cc.

Referenced by produce(), and reconfigure().

bool vf::VertexFinder::fPi0Reco
private

Definition at line 50 of file VertexFinder_module.cc.

Referenced by reconfigure().

double vf::VertexFinder::fXMax
private

Definition at line 51 of file VertexFinder_module.cc.

Referenced by produce(), and reconfigure().

double vf::VertexFinder::fYMax
private

Definition at line 52 of file VertexFinder_module.cc.

Referenced by produce(), and reconfigure().

double vf::VertexFinder::fZMax
private

Definition at line 54 of file VertexFinder_module.cc.

Referenced by produce(), and reconfigure().

double vf::VertexFinder::fZMin
private

Definition at line 53 of file VertexFinder_module.cc.

Referenced by produce(), and reconfigure().

const int vf::VertexFinder::GAMMAID = 22
static

Definition at line 36 of file VertexFinder_module.cc.

const int vf::VertexFinder::NUEID = 12
static

Definition at line 40 of file VertexFinder_module.cc.

const int vf::VertexFinder::NUMUID = 14
static

Definition at line 41 of file VertexFinder_module.cc.

const int vf::VertexFinder::NUTAUID = 16
static

Definition at line 42 of file VertexFinder_module.cc.

const int vf::VertexFinder::PIMINUSID = -211
static

Definition at line 39 of file VertexFinder_module.cc.

const int vf::VertexFinder::PIPLUSID = 211
static

Definition at line 38 of file VertexFinder_module.cc.

const int vf::VertexFinder::PIZEROID = 111
static

Definition at line 37 of file VertexFinder_module.cc.


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