All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LArPandoraShowerAlg.h
Go to the documentation of this file.
1 #ifndef LArPandoraShowerAlg_hxx
2 #define LArPandoraShowerAlg_hxx
3 
4 namespace reco::shower { class ShowerElementHolder; }
5 
6 namespace detinfo {
7  class DetectorClocksData;
8  class DetectorPropertiesData;
9 }
10 
12 
13 namespace recob {
14  class Hit;
15  class PFParticle;
16  class SpacePoint;
17 }
18 
19 namespace spacecharge { class SpaceCharge; }
20 
21 #include "art_root_io/TFileService.h"
22 namespace art { class Event; }
23 #include "art/Framework/Services/Registry/ServiceHandle.h"
24 #include "canvas/Persistency/Common/FindManyP.h"
25 #include "canvas/Persistency/Common/Ptr.h"
26 #include "canvas/Utilities/InputTag.h"
27 
28 #include "TVector3.h"
29 
30 //C++ Includes
31 #include <string>
32 #include <vector>
33 
34 namespace shower {
35  class LArPandoraShowerAlg;
36 }
37 
39 public:
40  explicit LArPandoraShowerAlg(const fhicl::ParameterSet& pset);
41 
43  std::vector<art::Ptr<recob::Hit>>& hits,
44  TVector3 const& ShowerDirection,
45  TVector3 const& ShowerPosition) const;
46 
47  void OrderShowerSpacePointsPerpendicular(std::vector<art::Ptr<recob::SpacePoint>>& showersps,
48  TVector3 const& vertex,
49  TVector3 const& direction) const;
50 
51  void OrderShowerSpacePoints(std::vector<art::Ptr<recob::SpacePoint>>& showersps,
52  TVector3 const& vertex,
53  TVector3 const& direction) const;
54 
55  void OrderShowerSpacePoints(std::vector<art::Ptr<recob::SpacePoint>>& showersps,
56  TVector3 const& vertex) const;
57 
58  TVector3 ShowerCentre(std::vector<art::Ptr<recob::SpacePoint>> const& showersps) const;
59 
60  TVector3 ShowerCentre(detinfo::DetectorClocksData const& clockData,
61  detinfo::DetectorPropertiesData const& detProp,
62  std::vector<art::Ptr<recob::SpacePoint>> const& showersps,
63  art::FindManyP<recob::Hit> const& fmh,
64  float& totalCharge) const;
65 
66  TVector3 ShowerCentre(detinfo::DetectorClocksData const& clockData,
67  detinfo::DetectorPropertiesData const& detProp,
68  std::vector<art::Ptr<recob::SpacePoint>> const& showerspcs,
69  art::FindManyP<recob::Hit> const& fmh) const;
70 
71  TVector3 SpacePointPosition(art::Ptr<recob::SpacePoint> const& sp) const;
72 
73  double DistanceBetweenSpacePoints(art::Ptr<recob::SpacePoint> const& sp_a,
74  art::Ptr<recob::SpacePoint> const& sp_b) const;
75 
76  double SpacePointCharge(art::Ptr<recob::SpacePoint> const& sp,
77  art::FindManyP<recob::Hit> const& fmh) const;
78 
79  double SpacePointTime(art::Ptr<recob::SpacePoint> const& sp,
80  art::FindManyP<recob::Hit> const& fmh) const;
81 
82  TVector2 HitCoordinates(detinfo::DetectorPropertiesData const& detProp,
83  art::Ptr<recob::Hit> const& hit) const;
84 
85  double SpacePointProjection(art::Ptr<recob::SpacePoint> const& sp,
86  TVector3 const& vertex,
87  TVector3 const& direction) const;
88 
89  double SpacePointPerpendicular(art::Ptr<recob::SpacePoint> const& sp,
90  TVector3 const& vertex,
91  TVector3 const& direction) const;
92 
93  double SpacePointPerpendicular(art::Ptr<recob::SpacePoint> const& sp,
94  TVector3 const& vertex,
95  TVector3 const& direction,
96  double proj) const;
97 
98  double RMSShowerGradient(std::vector<art::Ptr<recob::SpacePoint>>& sps,
99  const TVector3& ShowerCentre,
100  const TVector3& Direction,
101  const unsigned int nSegments) const;
102 
103  double CalculateRMS(const std::vector<float>& perps) const;
104 
105  // The SCE service requires thing in geo::Point/Vector form, so overload and be nice
106  double SCECorrectPitch(double const& pitch,
107  TVector3 const& pos,
108  TVector3 const& dir,
109  unsigned int const& TPC) const;
110  double SCECorrectPitch(double const& pitch,
111  geo::Point_t const& pos,
112  geo::Vector_t const& dir,
113  unsigned int const& TPC) const;
114 
115  double SCECorrectEField(double const& EField, TVector3 const& pos) const;
116  double SCECorrectEField(double const& EField, geo::Point_t const& pos) const;
117 
118  void DebugEVD(art::Ptr<recob::PFParticle> const& pfparticle,
119  art::Event const& Event,
120  const reco::shower::ShowerElementHolder& ShowerEleHolder,
121  std::string const& evd_disp_name_append = "") const;
122 
123 private:
125  art::InputTag fPFParticleLabel;
126  bool fSCEXFlip; // If a (legacy) flip is needed in x componant of spatial SCE correction
127 
129  art::ServiceHandle<geo::Geometry const> fGeom;
130  art::ServiceHandle<art::TFileService> tfs;
131 
132  const std::string fInitialTrackInputLabel;
134  const std::string fShowerDirectionInputLabel;
136 };
137 
138 #endif
void OrderShowerSpacePointsPerpendicular(std::vector< art::Ptr< recob::SpacePoint >> &showersps, TVector3 const &vertex, TVector3 const &direction) const
process_name vertex
Definition: cheaterreco.fcl:51
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
double SCECorrectPitch(double const &pitch, TVector3 const &pos, TVector3 const &dir, unsigned int const &TPC) const
double DistanceBetweenSpacePoints(art::Ptr< recob::SpacePoint > const &sp_a, art::Ptr< recob::SpacePoint > const &sp_b) const
void DebugEVD(art::Ptr< recob::PFParticle > const &pfparticle, art::Event const &Event, const reco::shower::ShowerElementHolder &ShowerEleHolder, std::string const &evd_disp_name_append="") const
double CalculateRMS(const std::vector< float > &perps) const
void OrderShowerSpacePoints(std::vector< art::Ptr< recob::SpacePoint >> &showersps, TVector3 const &vertex, TVector3 const &direction) const
art::ServiceHandle< geo::Geometry const > fGeom
const std::string fInitialTrackInputLabel
double RMSShowerGradient(std::vector< art::Ptr< recob::SpacePoint >> &sps, const TVector3 &ShowerCentre, const TVector3 &Direction, const unsigned int nSegments) const
process_name hit
Definition: cheaterreco.fcl:51
double SpacePointTime(art::Ptr< recob::SpacePoint > const &sp, art::FindManyP< recob::Hit > const &fmh) const
process_name shower
Definition: cheaterreco.fcl:51
double SCECorrectEField(double const &EField, TVector3 const &pos) const
BEGIN_PROLOG TPC
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
LArPandoraShowerAlg(const fhicl::ParameterSet &pset)
const std::string fInitialTrackSpacePointsInputLabel
const std::string fShowerDirectionInputLabel
double SpacePointProjection(art::Ptr< recob::SpacePoint > const &sp, TVector3 const &vertex, TVector3 const &direction) const
const std::string fShowerStartPositionInputLabel
tuple dir
Definition: dropbox.py:28
double SpacePointCharge(art::Ptr< recob::SpacePoint > const &sp, art::FindManyP< recob::Hit > const &fmh) const
art::ServiceHandle< art::TFileService > tfs
Contains all timing reference information for the detector.
TVector2 HitCoordinates(detinfo::DetectorPropertiesData const &detProp, art::Ptr< recob::Hit > const &hit) const
TVector3 ShowerCentre(std::vector< art::Ptr< recob::SpacePoint >> const &showersps) const
double SpacePointPerpendicular(art::Ptr< recob::SpacePoint > const &sp, TVector3 const &vertex, TVector3 const &direction) const
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
spacecharge::SpaceCharge const * fSCE
art framework interface to geometry description
auto const detProp
TVector3 SpacePointPosition(art::Ptr< recob::SpacePoint > const &sp) const
void OrderShowerHits(detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> &hits, TVector3 const &ShowerDirection, TVector3 const &ShowerPosition) const