All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbnana/sbnanalysis/ana/SBNOscReco/CosmicIDAlgs/ApaCrossCosmicIdAlg.h
Go to the documentation of this file.
1 #ifndef APACROSSCOSMICIDALG_H_SEEN
2 #define APACROSSCOSMICIDALG_H_SEEN
3 
4 
5 ///////////////////////////////////////////////
6 // ApaCrossCosmicIdAlg.h
7 //
8 // Functions for APA crossing cosmic tagger
9 // T Brooks (tbrooks@fnal.gov), November 2018
10 ///////////////////////////////////////////////
11 
12 // sbncode
13 #include "core/ProviderManager.hh"
14 #include "Util.h"
15 
16 // framework
17 #include "fhiclcpp/ParameterSet.h"
18 #include "fhiclcpp/types/Table.h"
19 #include "fhiclcpp/types/Atom.h"
20 #include "canvas/Persistency/Common/Ptr.h"
21 
22 // LArSoft
27 
28 // c++
29 #include <vector>
30 #include <utility>
31 #include <map>
32 
33 namespace ana{
34 
36  public:
37 
38  struct BeamTime {
39  using Name = fhicl::Name;
40  using Comment = fhicl::Comment;
41 
42  fhicl::Atom<double> BeamTimeMin {
43  Name("BeamTimeMin"),
44  Comment("")
45  };
46 
47  fhicl::Atom<double> BeamTimeMax {
48  Name("BeamTimeMax"),
49  Comment("")
50  };
51 
52  };
53 
54  struct Config {
55  using Name = fhicl::Name;
56  using Comment = fhicl::Comment;
57 
58  fhicl::Atom<double> DistanceLimit {
59  Name("DistanceLimit"),
60  Comment("")
61  };
62 
63  fhicl::Atom<double> MaxApaDistance {
64  Name("MaxApaDistance"),
65  Comment("")
66  };
67 
68  fhicl::Table<BeamTime> BeamTimeLimits {
69  Name("BeamTimeLimits"),
70  Comment("")
71  };
72 
73  };
74 
75  ApaCrossCosmicIdAlg(const core::ProviderManager &manager, const Config& config);
76 
77  ApaCrossCosmicIdAlg(const core::ProviderManager &manager, const fhicl::ParameterSet& pset) :
78  ApaCrossCosmicIdAlg(manager, fhicl::Table<Config>(pset, {})()) {}
79 
81 
83 
84  void reconfigure(const core::ProviderManager &manager, const Config& config);
85 
86  // Get the minimum distance from track to APA for different times
87  std::pair<double, double> MinApaDistance(const recob::Track &track, std::vector<double> &t0List, geo::TPCID &tpcid);
88 
89  // Get time by matching tracks which cross the APA
90  double T0FromApaCross(const recob::Track &track, std::vector<art::Ptr<recob::Hit>> hits, std::map<geo::CryostatID, std::vector<double>> &t_zeros);
91 
92  // Get the distance from track to APA at fixed time
93  double ApaDistance(recob::Track track, double t0, std::vector<art::Ptr<recob::Hit>> hits);
94 
95  // Tag tracks with times outside the beam
96  bool ApaCrossCosmicId(const recob::Track &track, std::vector<art::Ptr<recob::Hit>> &hits, std::map<geo::CryostatID, std::vector<double>> &t_zeros);
97 
98  private:
99 
102  double fBeamTimeMin;
103  double fBeamTimeMax;
104 
107  };
108 
109 }
110 
111 #endif
ApaCrossCosmicIdAlg(const core::ProviderManager &manager, const Config &config)
void reconfigure(const core::ProviderManager &manager, const Config &config)
Declaration of signal hit object.
std::pair< double, double > MinApaDistance(const recob::Track &track, std::vector< double > &t0List, geo::TPCID &tpcid)
bool ApaCrossCosmicId(const recob::Track &track, std::vector< art::Ptr< recob::Hit >> &hits, std::map< geo::CryostatID, std::vector< double >> &t_zeros)
process_name use argoneut_mc_hitfinder track
process_name opflashCryoW ana
ApaCrossCosmicIdAlg(const core::ProviderManager &manager, const fhicl::ParameterSet &pset)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Access the description of detector geometry.
Interface to LArSoft services.
BEGIN_PROLOG vertical distance to the surface Name
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
Description of geometry of one entire detector.
Provides recob::Track data product.
double ApaDistance(recob::Track track, double t0, std::vector< art::Ptr< recob::Hit >> hits)
double T0FromApaCross(const recob::Track &track, std::vector< art::Ptr< recob::Hit >> hits, std::map< geo::CryostatID, std::vector< double >> &t_zeros)
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track:
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190