All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbnana/sbnanalysis/ana/SBNOscReco/CosmicIDAlgs/StoppingParticleCosmicIdAlg.h
Go to the documentation of this file.
1 #ifndef STOPPINGPARTICLECOSMICIDALG_H_SEEN
2 #define STOPPINGPARTICLECOSMICIDALG_H_SEEN
3 
4 
5 ///////////////////////////////////////////////
6 // StoppingParticleCosmicIdAlg.h
7 //
8 // Functions for stopping particle cosmic tagger
9 // T Brooks (tbrooks@fnal.gov), November 2018
10 ///////////////////////////////////////////////
11 
12 // framework
13 #include "fhiclcpp/ParameterSet.h"
14 #include "fhiclcpp/types/Table.h"
15 #include "fhiclcpp/types/Atom.h"
16 #include "canvas/Persistency/Common/Ptr.h"
17 
18 // LArSoft
23 
24 // ROOT
25 #include "TGraph.h"
26 #include "TF1.h"
27 
28 // sbncode
29 #include "core/ProviderManager.hh"
30 
31 // c++
32 #include <vector>
33 
34 namespace ana{
35 
37  public:
38 
39  struct Containment {
40  using Name = fhicl::Name;
41 
42  fhicl::Atom<double> MinX { Name("MinX") };
43  fhicl::Atom<double> MinY { Name("MinY") };
44  fhicl::Atom<double> MinZ { Name("MinZ") };
45  fhicl::Atom<double> MaxX { Name("MaxX") };
46  fhicl::Atom<double> MaxY { Name("MaxY") };
47  fhicl::Atom<double> MaxZ { Name("MaxZ") };
48 
49  };
50 
51  struct Config {
52  using Name = fhicl::Name;
53  using Comment = fhicl::Comment;
54 
55  fhicl::Table<Containment> ContainmentCuts {
56  Name("ContainmentCuts"),
57  Comment("Fiducial volume cut (cm) to decide if track exits")
58  };
59 
60  fhicl::Atom<double> ResRangeMin {
61  Name("ResRangeMin"),
62  Comment("Minumum residual range (cm) to fit")
63  };
64 
65 
66  fhicl::Atom<double> ResRangeMax {
67  Name("ResRangeMax"),
68  Comment("Maximum residual range (cm) to fit")
69  };
70 
71  fhicl::Atom<double> DEdxMax {
72  Name("DEdxMax"),
73  Comment("Maximum dE/dx (MeV/cm) to fit")
74  };
75 
76  fhicl::Atom<double> StoppingChi2Limit {
77  Name("StoppingChi2Limit"),
78  Comment("Limit of pol/exp chi2 ratio to cut on to determine if stopping")
79  };
80 
81  };
82 
83  StoppingParticleCosmicIdAlg(const core::ProviderManager &manager, const Config& config);
84 
85  StoppingParticleCosmicIdAlg(const core::ProviderManager &manager, const fhicl::ParameterSet& pset) :
86  StoppingParticleCosmicIdAlg(manager, fhicl::Table<Config>(pset, {})()) {}
87 
89 
91 
92  void reconfigure(const core::ProviderManager &manager, const Config& config);
93 
94  // Calculate the chi2 ratio of pol0 and exp fit to dE/dx vs residual range
95  double StoppingChiSq(geo::Point_t end, std::vector<art::Ptr<anab::Calorimetry>> calos);
96 
97  // Determine if the track end looks like it stops
98  bool StoppingEnd(geo::Point_t end, std::vector<art::Ptr<anab::Calorimetry>> calos);
99 
100  // Determine if a track looks like a stopping cosmic
101  bool StoppingParticleCosmicId(recob::Track track, std::vector<art::Ptr<anab::Calorimetry>> calos);
102 
103  // Determine if two tracks look like a stopping cosmic if they are merged
104  bool StoppingParticleCosmicId(recob::Track track, recob::Track track2, std::vector<art::Ptr<anab::Calorimetry>> calos, std::vector<art::Ptr<anab::Calorimetry>> calos2);
105 
106  // Whether a point is inside the fiducial volume defined for this module
107  bool InFiducial(geo::Point_t point);
108 
109  private:
110 
111  double fMinX;
112  double fMinY;
113  double fMinZ;
114  double fMaxX;
115  double fMaxY;
116  double fMaxZ;
117  double fResRangeMin;
118  double fResRangeMax;
119  double fDEdxMax;
121 
122  std::vector<geo::BoxBoundedGeo> fFiducialVolumes;
123 
124  };
125 
126 }
127 
128 #endif
void reconfigure(const core::ProviderManager &manager, const Config &config)
process_name use argoneut_mc_hitfinder track
process_name opflashCryoW ana
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.
StoppingParticleCosmicIdAlg(const core::ProviderManager &manager, const Config &config)
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
BEGIN_PROLOG vertical distance to the surface Name
Provides recob::Track data product.
Provides a base class aware of world box coordinates.
double StoppingChiSq(geo::Point_t end, std::vector< art::Ptr< anab::Calorimetry >> calos)
StoppingParticleCosmicIdAlg(const core::ProviderManager &manager, const fhicl::ParameterSet &pset)
bool StoppingEnd(geo::Point_t end, std::vector< art::Ptr< anab::Calorimetry >> calos)
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
bool StoppingParticleCosmicId(recob::Track track, std::vector< art::Ptr< anab::Calorimetry >> calos)
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track: