All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbnana/sbnanalysis/ana/SBNOscReco/CosmicIDAlgs/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 // sbncode
18 #include "core/ProviderManager.hh"
19 
20 // framework
21 #include "fhiclcpp/ParameterSet.h"
22 #include "fhiclcpp/types/Table.h"
23 #include "fhiclcpp/types/Atom.h"
24 #include "canvas/Persistency/Common/Ptr.h"
25 #include "canvas/Persistency/Common/FindManyP.h"
26 
27 // LArSoft
31 
32 // c++
33 #include <vector>
34 #include <utility>
35 
36 
37 namespace ana{
38 
40  public:
41 
42  struct Fiducial {
43  using Name = fhicl::Name;
44 
45  fhicl::Atom<double> MinX { Name("MinX") };
46  fhicl::Atom<double> MinY { Name("MinY") };
47  fhicl::Atom<double> MinZ { Name("MinZ") };
48  fhicl::Atom<double> MaxX { Name("MaxX") };
49  fhicl::Atom<double> MaxY { Name("MaxY") };
50  fhicl::Atom<double> MaxZ { Name("MaxZ") };
51 
52  };
53 
54  struct BeamTime {
55  using Name = fhicl::Name;
56  using Comment = fhicl::Comment;
57 
58  fhicl::Atom<double> BeamTimeMin {
59  Name("BeamTimeMin"),
60  Comment("")
61  };
62 
63  fhicl::Atom<double> BeamTimeMax {
64  Name("BeamTimeMax"),
65  Comment("")
66  };
67 
68  };
69 
70  struct Config {
71  using Name = fhicl::Name;
72  using Comment = fhicl::Comment;
73 
74  fhicl::Atom<double> CpaStitchDistance {
75  Name("CpaStitchDistance"),
76  Comment("")
77  };
78 
79  fhicl::Atom<double> CpaStitchAngle {
80  Name("CpaStitchAngle"),
81  Comment("")
82  };
83 
84  fhicl::Atom<double> CpaXDifference {
85  Name("CpaXDifference"),
86  Comment("")
87  };
88 
89  fhicl::Table<Fiducial> FiducialCuts {
90  Name("FiducialCuts"),
91  Comment("")
92  };
93 
94  fhicl::Table<BeamTime> BeamTimeLimits {
95  Name("BeamTimeLimits"),
96  Comment("")
97  };
98 
99  };
100 
101  CpaCrossCosmicIdAlg(const core::ProviderManager &manager, const Config& config);
102 
103  CpaCrossCosmicIdAlg(const core::ProviderManager &manager, const fhicl::ParameterSet& pset) :
104  CpaCrossCosmicIdAlg(manager, fhicl::Table<Config>(pset, {})()) {}
105 
107 
109 
110  void reconfigure(const Config& config);
111 
112  // Calculate the time by stitching tracks across the CPA
113  std::pair<double, bool> T0FromCpaStitching(recob::Track t1, std::vector<recob::Track> tracks);
114 
115  // Tag tracks as cosmics from CPA stitching t0
116  bool CpaCrossCosmicId(recob::Track track, std::vector<recob::Track> tracks, art::FindManyP<recob::Hit> hitAssoc);
117 
118  private:
119 
123  double fMinX;
124  double fMinY;
125  double fMinZ;
126  double fMaxX;
127  double fMaxY;
128  double fMaxZ;
129  double fBeamTimeMin;
130  double fBeamTimeMax;
131 
133  TPCGeoAlg fTpcGeo;
134 
135  };
136 
137 }
138 
139 #endif
ClusterModuleLabel join with tracks
Declaration of signal hit object.
process_name use argoneut_mc_hitfinder track
process_name opflashCryoW ana
CpaCrossCosmicIdAlg(const core::ProviderManager &manager, const Config &config)
Interface to LArSoft services.
BEGIN_PROLOG vertical distance to the surface Name
Provides recob::Track data product.
bool CpaCrossCosmicId(recob::Track track, std::vector< recob::Track > tracks, art::FindManyP< recob::Hit > hitAssoc)
CpaCrossCosmicIdAlg(const core::ProviderManager &manager, const fhicl::ParameterSet &pset)
std::pair< double, bool > T0FromCpaStitching(recob::Track t1, std::vector< recob::Track > tracks)
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track: