All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbndcode/sbndcode/CosmicId/Algs/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 // sbndcode
14 
15 // framework
16 #include "fhiclcpp/ParameterSet.h"
17 #include "fhiclcpp/types/Table.h"
18 #include "fhiclcpp/types/Atom.h"
19 #include "canvas/Persistency/Common/Ptr.h"
20 
21 // LArSoft
24 namespace detinfo {
25  class DetectorPropertiesData;
26 }
27 
28 // c++
29 #include <vector>
30 #include <utility>
31 
32 
33 namespace sbnd{
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 Config& config);
76 
77  ApaCrossCosmicIdAlg(const fhicl::ParameterSet& pset) :
78  ApaCrossCosmicIdAlg(fhicl::Table<Config>(pset, {})()) {}
79 
81 
83 
84  void reconfigure(const Config& config);
85 
86  // Get the minimum distance from track to APA for different times
87  std::pair<double, double> MinApaDistance(detinfo::DetectorPropertiesData const& detProp,
88  recob::Track track, std::vector<double> t0List, int tpc);
89 
90  // Get time by matching tracks which cross the APA
92  recob::Track track, std::vector<double> t0List, int tpc);
93 
94  // Get the distance from track to APA at fixed time
96  recob::Track track, double t0, std::vector<art::Ptr<recob::Hit>> hits);
97 
98  // Work out what TPC track is in and get the minimum distance from track to APA for different times
99  std::pair<double, double> MinApaDistance(detinfo::DetectorPropertiesData const& detProp,
100  recob::Track track, std::vector<art::Ptr<recob::Hit>> hits, std::vector<double> t0Tpc0, std::vector<double> t0Tpc1);
101 
102  // Tag tracks with times outside the beam
104  recob::Track track, std::vector<art::Ptr<recob::Hit>> hits, std::vector<double> t0Tpc0, std::vector<double> t0Tpc1);
105 
106  private:
107 
110  double fBeamTimeMin;
111  double fBeamTimeMax;
112 
114 
115  };
116 
117 }
118 
119 #endif
Declaration of signal hit object.
process_name use argoneut_mc_hitfinder track
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
double ApaDistance(detinfo::DetectorPropertiesData const &detProp, recob::Track track, double t0, std::vector< art::Ptr< recob::Hit >> hits)
BEGIN_PROLOG vertical distance to the surface Name
std::pair< double, double > MinApaDistance(detinfo::DetectorPropertiesData const &detProp, recob::Track track, std::vector< double > t0List, int tpc)
Provides recob::Track data product.
bool ApaCrossCosmicId(detinfo::DetectorPropertiesData const &detProp, recob::Track track, std::vector< art::Ptr< recob::Hit >> hits, std::vector< double > t0Tpc0, std::vector< double > t0Tpc1)
stream1 can override from command line with o or output services user sbnd
auto const detProp
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track:
double T0FromApaCross(detinfo::DetectorPropertiesData const &detProp, recob::Track track, std::vector< double > t0List, int tpc)