All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbndcode/sbndcode/CosmicId/Algs/CpaCrossCosmicIdAlg.h
Go to the documentation of this file.
1 #ifndef CPACROSSCOSMICIDALG_H_SEEN
2 #define CPACROSSCOSMICIDALG_H_SEEN
3 
4 
5 ///////////////////////////////////////////////
6 // CpaCrossCosmicIdAlg.h
7 //
8 // Functions for CPA stitching cosmic tagger
9 // Only useful if you forgot to run track stitching
10 // in your tracking
11 // T Brooks (tbrooks@fnal.gov), November 2018
12 ///////////////////////////////////////////////
13 
14 // sbndcode
16 
17 // framework
18 #include "fhiclcpp/ParameterSet.h"
19 #include "fhiclcpp/types/Table.h"
20 #include "fhiclcpp/types/Atom.h"
21 #include "canvas/Persistency/Common/Ptr.h"
22 #include "canvas/Persistency/Common/FindManyP.h"
23 
24 // LArSoft
27 namespace detinfo {
28  class DetectorPropertiesData;
29 }
30 
31 // c++
32 #include <vector>
33 #include <utility>
34 
35 
36 namespace sbnd{
37 
39  public:
40 
41  struct Fiducial {
42  using Name = fhicl::Name;
43 
44  fhicl::Atom<double> MinX { Name("MinX") };
45  fhicl::Atom<double> MinY { Name("MinY") };
46  fhicl::Atom<double> MinZ { Name("MinZ") };
47  fhicl::Atom<double> MaxX { Name("MaxX") };
48  fhicl::Atom<double> MaxY { Name("MaxY") };
49  fhicl::Atom<double> MaxZ { Name("MaxZ") };
50 
51  };
52 
53  struct BeamTime {
54  using Name = fhicl::Name;
55  using Comment = fhicl::Comment;
56 
57  fhicl::Atom<double> BeamTimeMin {
58  Name("BeamTimeMin"),
59  Comment("")
60  };
61 
62  fhicl::Atom<double> BeamTimeMax {
63  Name("BeamTimeMax"),
64  Comment("")
65  };
66 
67  };
68 
69  struct Config {
70  using Name = fhicl::Name;
71  using Comment = fhicl::Comment;
72 
73  fhicl::Atom<double> CpaStitchDistance {
74  Name("CpaStitchDistance"),
75  Comment("")
76  };
77 
78  fhicl::Atom<double> CpaStitchAngle {
79  Name("CpaStitchAngle"),
80  Comment("")
81  };
82 
83  fhicl::Atom<double> CpaXDifference {
84  Name("CpaXDifference"),
85  Comment("")
86  };
87 
88  fhicl::Table<Fiducial> FiducialCuts {
89  Name("FiducialCuts"),
90  Comment("")
91  };
92 
93  fhicl::Table<BeamTime> BeamTimeLimits {
94  Name("BeamTimeLimits"),
95  Comment("")
96  };
97 
98  };
99 
100  CpaCrossCosmicIdAlg(const Config& config);
101 
102  CpaCrossCosmicIdAlg(const fhicl::ParameterSet& pset) :
103  CpaCrossCosmicIdAlg(fhicl::Table<Config>(pset, {})()) {}
104 
106 
108 
109  void reconfigure(const Config& config);
110 
111  // Calculate the time by stitching tracks across the CPA
112  std::pair<double, bool> T0FromCpaStitching(detinfo::DetectorPropertiesData const& detProp,
113  recob::Track t1, std::vector<recob::Track> tracks);
114 
115  // Tag tracks as cosmics from CPA stitching t0
117  recob::Track track, std::vector<recob::Track> tracks, art::FindManyP<recob::Hit> hitAssoc);
118 
119  private:
120 
124  double fMinX;
125  double fMinY;
126  double fMinZ;
127  double fMaxX;
128  double fMaxY;
129  double fMaxZ;
130  double fBeamTimeMin;
131  double fBeamTimeMax;
132 
134 
135  };
136 
137 }
138 
139 #endif
ClusterModuleLabel join with tracks
bool CpaCrossCosmicId(detinfo::DetectorPropertiesData const &detProp, recob::Track track, std::vector< recob::Track > tracks, art::FindManyP< recob::Hit > hitAssoc)
Declaration of signal hit object.
process_name use argoneut_mc_hitfinder track
std::pair< double, bool > T0FromCpaStitching(detinfo::DetectorPropertiesData const &detProp, recob::Track t1, std::vector< recob::Track > tracks)
BEGIN_PROLOG vertical distance to the surface Name
Provides recob::Track data product.
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: