Public Member Functions | Private Member Functions | Private Attributes | List of all members
vertex::PrimaryVertexFinder Class Reference
Inheritance diagram for vertex::PrimaryVertexFinder:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 PrimaryVertexFinder (fhicl::ParameterSet const &pset)
 
void beginJob ()
 
void produce (art::Event &evt)
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
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::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- 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 Member Functions

double StartPointSeperation (recob::SpacePoint sp1, recob::SpacePoint sp2)
 
bool IsInVertexCollection (int a, std::vector< std::vector< int > > vertex_collection)
 
int IndexInVertexCollection (int a, int b, std::vector< std::vector< int > > vertex_collection)
 
bool IsInNewVertex (int a, std::vector< int > newvertex)
 
double gammavalue (TVector3 startpoint1, TVector3 startpoint2, TVector3 dircos1, TVector3 dircos2)
 
double alphavalue (double gamma, TVector3 startpoint1, TVector3 startpoint2, TVector3 dircos1, TVector3 dircos2)
 
double MinDist (double alpha, double gamma, TVector3 startpoint1, TVector3 startpoint2, TVector3 dircos1, TVector3 dircos2)
 
TVector3 PointOnExtendedTrack (double alphagamma, TVector3 startpoint, TVector3 dircos)
 

Private Attributes

std::string fTrackModuleLabel
 
double fVertexWindow
 
TH2F * fNoTracks
 
TH1F * fLength_1stTrack
 
TH1F * fLength_2ndTrack
 
TH1F * fLength_3rdTrack
 
TH1F * fLength_4thTrack
 
TH1F * fLength_5thTrack
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- 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 41 of file PrimaryVertexFinder_module.cc.

Constructor & Destructor Documentation

vertex::PrimaryVertexFinder::PrimaryVertexFinder ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 84 of file PrimaryVertexFinder_module.cc.

85  : EDProducer{pset}
86  {
87  fTrackModuleLabel = pset.get< std::string >("TrackModuleLabel");
88  fVertexWindow = pset.get<double > ("VertexWindow");
89 
90  produces< std::vector<recob::Vertex> >();
91  produces< art::Assns<recob::Vertex, recob::Hit> >();
92  produces< art::Assns<recob::Vertex, recob::Track> >();
93  produces< art::Assns<recob::Vertex, recob::Shower> >();
94  }
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20

Member Function Documentation

double vertex::PrimaryVertexFinder::alphavalue ( double  gamma,
TVector3  startpoint1,
TVector3  startpoint2,
TVector3  dircos1,
TVector3  dircos2 
)
private

Definition at line 444 of file PrimaryVertexFinder_module.cc.

445 {
446  double alpha = (gamma*(dircos1*dircos2)) + (startpoint2*dircos1) - (startpoint1*dircos1);
447 
448  return alpha;
449 }
double alpha
Definition: doAna.cpp:15
double gamma(double KE, const simb::MCParticle *part)
void vertex::PrimaryVertexFinder::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 97 of file PrimaryVertexFinder_module.cc.

97  {
98  // get access to the TFile service
100 
101  // fNoVertices= tfs->make<TH2F>("fNoVertices", ";Event No; No of vertices", 100,0, 100, 30, 0, 30);
102  fNoTracks= tfs->make<TH2F>("fNoTracks", ";Event No; No of Tracks", 10,0, 10, 10, 0, 10);
103  fLength_1stTrack = tfs->make<TH1F>("fLength_Track1", "Muon Track Length", 100,0,100);
104  fLength_2ndTrack = tfs->make<TH1F>("fLength_Track2", "2nd Track Length", 100,0,100);
105  fLength_3rdTrack = tfs->make<TH1F>("fLength_Track3", "3rd Track Length", 100,0,100);
106  fLength_4thTrack = tfs->make<TH1F>("fLength_Track4", "4th Track Length", 100,0,100);
107  fLength_5thTrack = tfs->make<TH1F>("fLength_Track5", "5th Track Length", 100,0,100);
108  }
double vertex::PrimaryVertexFinder::gammavalue ( TVector3  startpoint1,
TVector3  startpoint2,
TVector3  dircos1,
TVector3  dircos2 
)
private

Definition at line 437 of file PrimaryVertexFinder_module.cc.

438 {
439  double gamma = ((startpoint1*dircos2)-(startpoint2*dircos2)+((dircos1*dircos2)*(startpoint2*dircos1))-((dircos1*dircos2)*(startpoint1*dircos1)))/(1-((dircos1*dircos2)*(dircos1*dircos2)));
440 
441  return gamma;
442 }
double gamma(double KE, const simb::MCParticle *part)
int vertex::PrimaryVertexFinder::IndexInVertexCollection ( int  a,
int  b,
std::vector< std::vector< int > >  vertex_collection 
)
private

Definition at line 410 of file PrimaryVertexFinder_module.cc.

411 {
412  int index = -1;
413  for(unsigned int i = 0; i < vertex_collection.size() ; i++){
414  for(std::vector<int>::iterator itr = vertex_collection[i].begin(); itr < vertex_collection[i].end(); ++itr){
415  if (a == *itr || b == *itr)
416  index = i;
417  }
418  }
419  return index;
420 }
intermediate_table::iterator iterator
const double a
static bool * b
Definition: config.cpp:1043
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
bool vertex::PrimaryVertexFinder::IsInNewVertex ( int  a,
std::vector< int >  newvertex 
)
private

Definition at line 422 of file PrimaryVertexFinder_module.cc.

423 {
424  int flag = 0;
425  for(unsigned int i = 0; i < newvertex.size() ; i++){
426  if (a == newvertex[i]){
427  flag = 1;
428  break;
429  }
430  }
431 
432  if(flag==1)
433  return true;
434  return false;
435 }
const double a
bool vertex::PrimaryVertexFinder::IsInVertexCollection ( int  a,
std::vector< std::vector< int > >  vertex_collection 
)
private

Definition at line 393 of file PrimaryVertexFinder_module.cc.

394 {
395  int flag = 0;
396 
397  for(unsigned int i = 0; i < vertex_collection.size() ; i++){
398  for(std::vector<int>::iterator itr = vertex_collection[i].begin(); itr < vertex_collection[i].end(); ++itr){
399  if (a == *itr){
400  flag = 1;
401  break;
402  }
403  }
404  }
405  if(flag==1)
406  return true;
407  return false;
408 }
intermediate_table::iterator iterator
const double a
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
double vertex::PrimaryVertexFinder::MinDist ( double  alpha,
double  gamma,
TVector3  startpoint1,
TVector3  startpoint2,
TVector3  dircos1,
TVector3  dircos2 
)
private

Definition at line 451 of file PrimaryVertexFinder_module.cc.

452 {
453  TVector3 mindis_vector = startpoint1 - startpoint2 + alpha*dircos1 - gamma*dircos2;
454  double mindis = mindis_vector.Mag();
455  return mindis;
456 }
double alpha
Definition: doAna.cpp:15
double gamma(double KE, const simb::MCParticle *part)
TVector3 vertex::PrimaryVertexFinder::PointOnExtendedTrack ( double  alphagamma,
TVector3  startpoint,
TVector3  dircos 
)
private

Definition at line 458 of file PrimaryVertexFinder_module.cc.

459 {
460  TVector3 PointOnExtendedTrack = startpoint + (alphagamma * dircos);
461  return PointOnExtendedTrack;
462 }
TVector3 PointOnExtendedTrack(double alphagamma, TVector3 startpoint, TVector3 dircos)
void vertex::PrimaryVertexFinder::produce ( art::Event evt)
virtual
Todo:
replace with the real query when this module is updated to look for showers too

Implements art::EDProducer.

Definition at line 111 of file PrimaryVertexFinder_module.cc.

112  {
113 
114  mf::LogInfo("PrimaryVertexFinder") << "------------------------------------------------------------------------------";
115 
116  // std::cout << "run : " << evt.Header().Run() << std::endl;
117  // std::cout << "subrun : " << evt.Header().Subrun() << std::endl;
118  //std::cout << "event : " << evt.Header().Event() << std::endl;
119 
120  mf::LogInfo("PrimaryVertexFinder") << "event : " << evt.id().event();
121 
122 
124 
125  //mf::LogInfo("PrimaryVertexFinder") << "I am in Primary vertex finder " << std::endl;
126 
127  art::Handle< std::vector<recob::Track> > trackListHandle;
128  evt.getByLabel(fTrackModuleLabel,trackListHandle);
129 
130  //Point to a collection of vertices to output.
131  std::unique_ptr< std::vector<recob::Vertex> > vcol(new std::vector<recob::Vertex>);
132  std::unique_ptr< art::Assns<recob::Vertex, recob::Hit> > vhassn(new art::Assns<recob::Vertex, recob::Hit>);
133  std::unique_ptr< art::Assns<recob::Vertex, recob::Track> > vtassn(new art::Assns<recob::Vertex, recob::Track>);
134  std::unique_ptr< art::Assns<recob::Vertex, recob::Shower> > vsassn(new art::Assns<recob::Vertex, recob::Shower>);
135 
136 
137  std::vector<recob::Track> const& trkIn = *trackListHandle;
138 
139  mf::LogInfo("PrimaryVertexFinder") << "number of tracks in this event = " << trkIn.size();
140  fNoTracks->Fill(evt.id().event(),trkIn.size());
141 
142  std::vector<recob::SpacePoint> startpoints_vec; // first space point of each track
143 
144  std::vector <TVector3> startvec;
145  TVector3 startXYZ;
146 
147  std::vector <TVector3> endvec;
148  TVector3 endXYZ;
149 
150  std::vector <TVector3> dircosvec;
151  TVector3 dircosXYZ;
152 
153  std::vector< std::pair<art::Ptr<recob::Track>, double> > trackpair;
154 
155  art::FindMany<recob::SpacePoint> TrackSpacePoints
156  (trackListHandle, evt, fTrackModuleLabel);
157 
158  for(unsigned int i = 0; i<trkIn.size(); ++i){
159  recob::Track::Point_t start, end;
160  std::tie(start, end) = trkIn[i].Extent();
161  startXYZ.SetXYZ(start.X(),start.Y(),start.Z());
162  endXYZ.SetXYZ(end.X(),end.Y(),end.Z());
163 
164 
165  double length = (endXYZ-startXYZ).Mag();// (endvec[i]-startvec[i]).Mag();
166  //mf::LogInfo("PrimaryVertexFinder") << "Track length calculated = " << length << std::endl;
167  trackpair.push_back(std::pair<art::Ptr<recob::Track>,double>({ trackListHandle, i },length));
168  }
169 
170  for(size_t i = 0; i<trackpair.size(); ++i){
171  mf::LogInfo("PrimaryVertexFinder") << "track id is = " << (trackpair[i].first)->ID()
172  << " track length = " << (trackpair[i].second);
173  }
174 
175  std::sort(trackpair.rbegin(), trackpair.rend(), sort_pred2);
176 
177  mf::LogInfo("PrimaryVertexFinder") << "AFTER SORTING ";
178  for(size_t i = 0; i < trackpair.size(); ++i){
179  mf::LogInfo("PrimaryVertexFinder") << "track id is = " << (trackpair[i].first)->ID()
180  << " track length = " << (trackpair[i].second);
181  }
182 
183  if(trackpair.size()>0)
184  fLength_1stTrack->Fill(trackpair[0].second);
185 
186  if(trackpair.size()>1)
187  fLength_2ndTrack->Fill(trackpair[1].second);
188 
189  if(trackpair.size()>2)
190  fLength_3rdTrack->Fill(trackpair[2].second);
191 
192  if(trackpair.size()>3)
193  fLength_4thTrack->Fill(trackpair[3].second);
194 
195  if(trackpair.size()>4)
196  fLength_5thTrack->Fill(trackpair[4].second);
197 
198  for(size_t j = 0; j < trackpair.size(); ++j) { //loop over tracks
199  art::Ptr<recob::Track> const& track = trackpair[j].first;
200 
201  // the index of this track in the query is the same as its position in
202  // the data product:
203  std::vector<recob::SpacePoint const*> const& spacepoints
204  = TrackSpacePoints.at(track.key());
205 
206  startXYZ = trackpair[j].first->Vertex<TVector3>();
207  endXYZ = trackpair[j].first->End<TVector3>();
208  dircosXYZ = trackpair[j].first->VertexDirection<TVector3>();
209 
210  startvec.push_back(startXYZ);
211  endvec.push_back(endXYZ);
212  dircosvec.push_back(dircosXYZ);
213 
214  mf::LogInfo("PrimaryVertexFinder") << "PrimaryVertexFinder got "<< spacepoints.size()
215  <<" 3D spacepoint(s) from Track3Dreco.cxx";
216 
217  // save the first SpacePoint of each Track... from now the SpacePoint ID represents the Track ID!!
218  startpoints_vec.emplace_back(
219  spacepoints[0]->XYZ(), spacepoints[0]->ErrXYZ(),
220  spacepoints[0]->Chisq(), startpoints_vec.size()
221  );
222 
223  }// loop over tracks
224 
225  for(size_t i = 0; i < startvec.size(); ++i){ //trackpair.size()
226  mf::LogInfo("PrimaryVertexFinder") << "Tvector3 start point SORTED = ";
227  startvec[i].Print();
228  }
229  for(size_t i = 0; i < dircosvec.size(); ++i){ //trackpair.size()
230  mf::LogInfo("PrimaryVertexFinder") << "Tvector3 dir cos SORTED = ";
231  dircosvec[i].Print();
232  }
233 
234  std::vector<std::vector<int> > vertex_collection_int;
235  std::vector <std::vector <TVector3> > vertexcand_vec;
236 
237  for (unsigned int i=0; i<trackpair.size(); ++i){
238  for (unsigned int j=i+1; j<trackpair.size(); ++j){
239  mf::LogInfo("PrimaryVertexFinder") << "distance between " << i << " and " << j
240  << " = "
241  << StartPointSeperation(startpoints_vec[i], startpoints_vec[j]);
242  double GAMMA = gammavalue(startvec[i], startvec[j], dircosvec[i], dircosvec[j]);
243  double ALPHA = alphavalue(GAMMA, startvec[i], startvec[j], dircosvec[i], dircosvec[j]);
244  double MINDIST = MinDist(ALPHA, GAMMA, startvec[i], startvec[j], dircosvec[i], dircosvec[j]);
245  mf::LogInfo("PrimaryVertexFinder") << "alpha = " << ALPHA << " gamma = "
246  << GAMMA << " MINIMUM DISTANCE = " << MINDIST;
247 
248  TVector3 TRACK1POINT = PointOnExtendedTrack(ALPHA, startvec[i], dircosvec[i]);
249  TVector3 TRACK2POINT = PointOnExtendedTrack(GAMMA, startvec[j], dircosvec[j]);
250 
251  mf::LogInfo("PrimaryVertexFinder") << "POINTS ON THE TRACKS ARE:: ";
252  TRACK1POINT.Print();
253  TRACK2POINT.Print();
254 
255  //if(StartPointSeperation(startpoints_vec[i], startpoints_vec[j])<fVertexWindow){ ///// correct this
256  //if(MINDIST<2 && trackpair[i].second >30 && trackpair[j].second >30){
257  if(MINDIST < fVertexWindow && ((TRACK1POINT-startvec[i]).Mag()) < fVertexWindow){
258 
259  if((!IsInVertexCollection(i, vertex_collection_int)) && (!IsInVertexCollection(j, vertex_collection_int))){
260  std::vector<int> newvertex_int;
261  std::vector <TVector3> vertexcand;
262  newvertex_int.push_back(i);
263  newvertex_int.push_back(j);
264  vertex_collection_int.push_back(newvertex_int);
265  //newvertex.clear();
266  vertexcand.push_back(TRACK1POINT);
267  vertexcand.push_back(TRACK2POINT);
268  vertexcand_vec.push_back(vertexcand);
269  }
270  else{
271  int index = IndexInVertexCollection(i, j, vertex_collection_int);
272  //mf::LogInfo("PrimaryVertexFinder") << "index where a new vertex will be added = " << index << std::endl;
273  if(!IsInNewVertex(i, vertex_collection_int[index])){
274  vertex_collection_int[index].push_back(i);
275  vertexcand_vec[index].push_back(TRACK1POINT); //need to fix for delta rays
276  }
277  if(!IsInNewVertex(j, vertex_collection_int[index])){
278  vertex_collection_int[index].push_back(j);
279  vertexcand_vec[index].push_back(TRACK2POINT); //need to fix for delta rays
280  }
281  }
282  }// end else
283  }
284  }
285 
286 
287  //now add the unmatched track IDs to the collection
288  for(size_t i = 0; i < trackpair.size(); ++i){
289  if(!IsInVertexCollection(i, vertex_collection_int)){
290  //if(trackpair[i].second>30){
291  std::vector<int> temp;
292  std::vector <TVector3> temp1;
293  temp.push_back(i);
294  temp1.push_back(startvec[i]);
295  vertex_collection_int.push_back(temp);
296  vertexcand_vec.push_back(temp1);
297  //}
298  }
299  }
300 
301  // indices (in their data products) of tracks and showers connected to the vertex
302  std::vector<size_t> vTrackIndices, vShowerIndices;
303 
304  // find the hits of all the tracks
305  art::FindManyP<recob::Hit> TrackHits(trackListHandle, evt, fTrackModuleLabel);
306 
307  // find the hits of all the showers
308  // art::FindManyP<recob::Hit> ShowerHits(showerListHandle, evt, fShowerModuleLabel);
309  ///\todo replace with the real query when this module is updated to look for showers too
310  art::FindManyP<recob::Hit> ShowerHits(std::vector<art::Ptr<recob::Shower>>(), evt, fTrackModuleLabel);
311 
312  for(size_t i = 0; i < vertex_collection_int.size(); ++i){
313  double x = 0.;
314  double y = 0.;
315  double z = 0.;
316  int elemsize = 0.;
317  for(std::vector<int>::iterator itr = vertex_collection_int[i].begin(); itr < vertex_collection_int[i].end(); ++itr){
318  mf::LogInfo("PrimaryVertexFinder") << "vector elements at index " << i << " are " << *itr
319  << "\ntrack original ID = " << (trackpair[*itr].first)->ID();
320  // save the index in the data product of this track
321  vTrackIndices.push_back(trackpair[*itr].first.key());
322  }
323  mf::LogInfo("PrimaryVertexFinder") << "------------";
324 
325 
326  for(std::vector<TVector3>::iterator itr = vertexcand_vec[i].begin(); itr < vertexcand_vec[i].end(); ++itr){
327  //calculate sum of x, y and z of a vertex
328  x += (*itr).X();
329  y += (*itr).Y();
330  z += (*itr).Z();
331  elemsize = vertexcand_vec[i].size();
332  }
333 
334  double avgx = x/elemsize;
335  double avgy = y/elemsize;
336  double avgz = z/elemsize;
337 
338  Double_t vtxcoord[3];
339  vtxcoord[0] = avgx;
340  vtxcoord[1] = avgy;
341  vtxcoord[2] = avgz;
342 
343  recob::Vertex the3Dvertex(vtxcoord, vcol->size());
344  vcol->push_back(the3Dvertex);
345 
346  if(!vTrackIndices.empty()){
347  // associate the tracks and their hits with the vertex
348  util::CreateAssn(*this, evt, *vtassn,
349  vcol->size() - 1, vTrackIndices.begin(), vTrackIndices.end());
350  for(size_t tIndex: vTrackIndices) {
351  std::vector<art::Ptr<recob::Hit>> const& hits = TrackHits.at(tIndex);
352  util::CreateAssn(*this, evt, *vcol, hits, *vhassn);
353  }
354  vTrackIndices.clear();
355  } // if tracks
356 
357  if(!vShowerIndices.empty()){
358  // associate the showers and their hits with the vertex
359  util::CreateAssn(*this, evt, *vsassn,
360  vcol->size() - 1, vShowerIndices.begin(), vShowerIndices.end());
361  for(size_t sIndex: vShowerIndices){
362  std::vector<art::Ptr<recob::Hit>> const& hits = ShowerHits.at(sIndex);
363  util::CreateAssn(*this, evt, *vcol, hits, *vhassn);
364  }
365  vShowerIndices.clear();
366  } // if showers
367 
368 
369  }// end loop over vertex_collection_ind
370 
371  MF_LOG_VERBATIM("Summary") << std::setfill('-') << std::setw(175) << "-" << std::setfill(' ');
372  MF_LOG_VERBATIM("Summary") << "PrimaryVertexFinder Summary:";
373  for(size_t i = 0; i < vcol->size(); ++i) MF_LOG_VERBATIM("Summary") << vcol->at(i) ;
374 
375  evt.put(std::move(vcol));
376  evt.put(std::move(vtassn));
377  evt.put(std::move(vhassn));
378  evt.put(std::move(vsassn));
379 
380  } // end of produce
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
intermediate_table::iterator iterator
TVector3 PointOnExtendedTrack(double alphagamma, TVector3 startpoint, TVector3 dircos)
unsigned int ID
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
struct vector vector
Definition of vertex object for LArSoft.
Definition: Vertex.h:35
bool IsInNewVertex(int a, std::vector< int > newvertex)
int IndexInVertexCollection(int a, int b, std::vector< std::vector< int > > vertex_collection)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
def move(depos, offset)
Definition: depos.py:107
key_type key() const noexcept
Definition: Ptr.h:216
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
double MinDist(double alpha, double gamma, TVector3 startpoint1, TVector3 startpoint2, TVector3 dircos1, TVector3 dircos2)
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
double StartPointSeperation(recob::SpacePoint sp1, recob::SpacePoint sp2)
bool sort_pred2(const std::pair< art::Ptr< recob::Track >, double > &left, const std::pair< art::Ptr< recob::Track >, double > &right)
#define MF_LOG_VERBATIM(category)
bool IsInVertexCollection(int a, std::vector< std::vector< int > > vertex_collection)
tracking::Point_t Point_t
Definition: Track.h:53
EventNumber_t event() const
Definition: EventID.h:116
double gammavalue(TVector3 startpoint1, TVector3 startpoint2, TVector3 dircos1, TVector3 dircos2)
list x
Definition: train.py:276
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
double alphavalue(double gamma, TVector3 startpoint1, TVector3 startpoint2, TVector3 dircos1, TVector3 dircos2)
Q_EXPORT QTSManip setfill(int f)
Definition: qtextstream.h:337
EventID id() const
Definition: Event.cc:34
double vertex::PrimaryVertexFinder::StartPointSeperation ( recob::SpacePoint  sp1,
recob::SpacePoint  sp2 
)
private

Definition at line 384 of file PrimaryVertexFinder_module.cc.

385 {
386  double x= (sp2.XYZ()[0])-(sp1.XYZ()[0]);
387  double y= (sp2.XYZ()[1])-(sp1.XYZ()[1]);
388  double z= (sp2.XYZ()[2])-(sp1.XYZ()[2]);
389  double distance = std::sqrt(pow(x,2)+pow(y,2)+pow(z,2));
390  return distance;
391 }
constexpr T pow(T x)
Definition: pow.h:72
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
const Double32_t * XYZ() const
Definition: SpacePoint.h:76
list x
Definition: train.py:276

Member Data Documentation

TH1F* vertex::PrimaryVertexFinder::fLength_1stTrack
private

Definition at line 65 of file PrimaryVertexFinder_module.cc.

TH1F* vertex::PrimaryVertexFinder::fLength_2ndTrack
private

Definition at line 66 of file PrimaryVertexFinder_module.cc.

TH1F* vertex::PrimaryVertexFinder::fLength_3rdTrack
private

Definition at line 67 of file PrimaryVertexFinder_module.cc.

TH1F* vertex::PrimaryVertexFinder::fLength_4thTrack
private

Definition at line 68 of file PrimaryVertexFinder_module.cc.

TH1F* vertex::PrimaryVertexFinder::fLength_5thTrack
private

Definition at line 69 of file PrimaryVertexFinder_module.cc.

TH2F* vertex::PrimaryVertexFinder::fNoTracks
private

Definition at line 64 of file PrimaryVertexFinder_module.cc.

std::string vertex::PrimaryVertexFinder::fTrackModuleLabel
private

Definition at line 54 of file PrimaryVertexFinder_module.cc.

double vertex::PrimaryVertexFinder::fVertexWindow
private

Definition at line 55 of file PrimaryVertexFinder_module.cc.


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