All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbndcode/sbndcode/CosmicId/Algs/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 
13 
14 // framework
15 #include "fhiclcpp/ParameterSet.h"
16 #include "fhiclcpp/types/Table.h"
17 #include "fhiclcpp/types/Atom.h"
18 #include "canvas/Persistency/Common/Ptr.h"
19 
20 // LArSoft
23 
24 // ROOT
25 #include "TGraph.h"
26 #include "TF1.h"
27 
28 // c++
29 #include <vector>
30 
31 namespace sbnd{
32 
34  public:
35 
36  struct Containment {
37  using Name = fhicl::Name;
38 
39  fhicl::Atom<double> MinX { Name("MinX") };
40  fhicl::Atom<double> MinY { Name("MinY") };
41  fhicl::Atom<double> MinZ { Name("MinZ") };
42  fhicl::Atom<double> MaxX { Name("MaxX") };
43  fhicl::Atom<double> MaxY { Name("MaxY") };
44  fhicl::Atom<double> MaxZ { Name("MaxZ") };
45 
46  };
47 
48  struct Config {
49  using Name = fhicl::Name;
50  using Comment = fhicl::Comment;
51 
52  fhicl::Table<Containment> ContainmentCuts {
53  Name("ContainmentCuts"),
54  Comment("Fiducial volume cut (cm) to decide if track exits")
55  };
56 
57  fhicl::Atom<double> ResRangeMin {
58  Name("ResRangeMin"),
59  Comment("Minumum residual range (cm) to fit")
60  };
61 
62  fhicl::Atom<double> ResRangeMax {
63  Name("ResRangeMax"),
64  Comment("Maximum residual range (cm) to fit")
65  };
66 
67  fhicl::Atom<double> DEdxMax {
68  Name("DEdxMax"),
69  Comment("Maximum dE/dx (MeV/cm) to fit")
70  };
71 
72  fhicl::Atom<double> StoppingChi2Limit {
73  Name("StoppingChi2Limit"),
74  Comment("Limit of pol/exp chi2 ratio to cut on to determine if stopping")
75  };
76 
77  };
78 
79  StoppingParticleCosmicIdAlg(const Config& config);
80 
81  StoppingParticleCosmicIdAlg(const fhicl::ParameterSet& pset) :
82  StoppingParticleCosmicIdAlg(fhicl::Table<Config>(pset, {})()) {}
83 
85 
87 
88  void reconfigure(const Config& config);
89 
90  // Calculate the chi2 ratio of pol0 and exp fit to dE/dx vs residual range
91  double StoppingChiSq(geo::Point_t end, std::vector<art::Ptr<anab::Calorimetry>> calos);
92 
93  // Determine if the track end looks like it stops
94  bool StoppingEnd(geo::Point_t end, std::vector<art::Ptr<anab::Calorimetry>> calos);
95 
96  // Determine if a track looks like a stopping cosmic
97  bool StoppingParticleCosmicId(recob::Track track, std::vector<art::Ptr<anab::Calorimetry>> calos);
98 
99  // Determine if two tracks look like a stopping cosmic if they are merged
100  bool StoppingParticleCosmicId(recob::Track track, recob::Track track2, std::vector<art::Ptr<anab::Calorimetry>> calos, std::vector<art::Ptr<anab::Calorimetry>> calos2);
101 
102  private:
103 
104  double fMinX;
105  double fMinY;
106  double fMinZ;
107  double fMaxX;
108  double fMaxY;
109  double fMaxZ;
110  double fResRangeMin;
111  double fResRangeMax;
112  double fDEdxMax;
114 
116 
117  };
118 
119 }
120 
121 #endif
bool StoppingEnd(geo::Point_t end, std::vector< art::Ptr< anab::Calorimetry >> calos)
process_name use argoneut_mc_hitfinder track
double StoppingChiSq(geo::Point_t end, std::vector< art::Ptr< anab::Calorimetry >> calos)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
bool StoppingParticleCosmicId(recob::Track track, std::vector< art::Ptr< anab::Calorimetry >> calos)
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
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
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
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track: