LArPandoraShowerAlg.h
Go to the documentation of this file.
1 #ifndef LArPandoraShowerAlg_hxx
2 #define LArPandoraShowerAlg_hxx
3 
4 //Framework Includes
5 #include "art_root_io/TFileService.h"
6 #include "canvas/Persistency/Common/FindManyP.h"
8 #include "cetlib_except/exception.h"
11 
12 //LArSoft Includes
25 
26 //C++ Includes
27 #include <algorithm>
28 #include <iostream>
29 #include <map>
30 #include <vector>
31 
32 //Root Includes
33 #include "TCanvas.h"
34 #include "TH3F.h"
35 #include "TMath.h"
36 #include "TPolyLine3D.h"
37 #include "TPolyMarker3D.h"
38 #include "TString.h"
39 #include "TStyle.h"
40 #include "TTree.h"
41 #include "TVector.h"
42 #include "TVector3.h"
43 
44 namespace detinfo {
45  class DetectorClocksData;
46  class DetectorPropertiesData;
47 }
48 
49 namespace shower {
50  class LArPandoraShowerAlg;
51 }
52 
54 public:
55  explicit LArPandoraShowerAlg(const fhicl::ParameterSet& pset);
56 
57  void OrderShowerHits(detinfo::DetectorPropertiesData const& detProp,
59  TVector3 const& ShowerDirection,
60  TVector3 const& ShowerPosition) const;
61 
62  void OrderShowerSpacePointsPerpendicular(std::vector<art::Ptr<recob::SpacePoint>>& showersps,
63  TVector3 const& vertex,
64  TVector3 const& direction) const;
65 
66  void OrderShowerSpacePoints(std::vector<art::Ptr<recob::SpacePoint>>& showersps,
67  TVector3 const& vertex,
68  TVector3 const& direction) const;
69 
70  void OrderShowerSpacePoints(std::vector<art::Ptr<recob::SpacePoint>>& showersps,
71  TVector3 const& vertex) const;
72 
73  TVector3 ShowerCentre(std::vector<art::Ptr<recob::SpacePoint>> const& showersps) const;
74 
75  TVector3 ShowerCentre(detinfo::DetectorClocksData const& clockData,
76  detinfo::DetectorPropertiesData const& detProp,
77  std::vector<art::Ptr<recob::SpacePoint>> const& showersps,
78  art::FindManyP<recob::Hit> const& fmh,
79  float& totalCharge) const;
80 
81  TVector3 ShowerCentre(detinfo::DetectorClocksData const& clockData,
82  detinfo::DetectorPropertiesData const& detProp,
83  std::vector<art::Ptr<recob::SpacePoint>> const& showerspcs,
84  art::FindManyP<recob::Hit> const& fmh) const;
85 
86  TVector3 SpacePointPosition(art::Ptr<recob::SpacePoint> const& sp) const;
87 
88  double DistanceBetweenSpacePoints(art::Ptr<recob::SpacePoint> const& sp_a,
89  art::Ptr<recob::SpacePoint> const& sp_b) const;
90 
91  double SpacePointCharge(art::Ptr<recob::SpacePoint> const& sp,
92  art::FindManyP<recob::Hit> const& fmh) const;
93 
94  double SpacePointTime(art::Ptr<recob::SpacePoint> const& sp,
95  art::FindManyP<recob::Hit> const& fmh) const;
96 
97  TVector2 HitCoordinates(detinfo::DetectorPropertiesData const& detProp,
98  art::Ptr<recob::Hit> const& hit) const;
99 
100  double SpacePointProjection(art::Ptr<recob::SpacePoint> const& sp,
101  TVector3 const& vertex,
102  TVector3 const& direction) const;
103 
104  double SpacePointPerpendicular(art::Ptr<recob::SpacePoint> const& sp,
105  TVector3 const& vertex,
106  TVector3 const& direction) const;
107 
108  double SpacePointPerpendicular(art::Ptr<recob::SpacePoint> const& sp,
109  TVector3 const& vertex,
110  TVector3 const& direction,
111  double proj) const;
112 
113  double RMSShowerGradient(std::vector<art::Ptr<recob::SpacePoint>>& sps,
114  const TVector3& ShowerCentre,
115  const TVector3& Direction,
116  const unsigned int nSegments) const;
117 
118  double CalculateRMS(const std::vector<float>& perps) const;
119 
120  // The SCE service requires thing in geo::Point/Vector form, so overload and be nice
121  double SCECorrectPitch(double const& pitch,
122  TVector3 const& pos,
123  TVector3 const& dir,
124  unsigned int const& TPC) const;
125  double SCECorrectPitch(double const& pitch,
126  geo::Point_t const& pos,
127  geo::Vector_t const& dir,
128  unsigned int const& TPC) const;
129 
130  double SCECorrectEField(double const& EField, TVector3 const& pos) const;
131  double SCECorrectEField(double const& EField, geo::Point_t const& pos) const;
132 
133  void DebugEVD(art::Ptr<recob::PFParticle> const& pfparticle,
134  art::Event const& Event,
135  const reco::shower::ShowerElementHolder& ShowerEleHolder,
136  std::string const& evd_disp_name_append = "") const;
137 
138 private:
141  bool fSCEXFlip; // If a (legacy) flip is needed in x componant of spatial SCE correction
142 
146 
151 };
152 
153 #endif
std::string string
Definition: nybbler.cc:12
art::ServiceHandle< geo::Geometry const > fGeom
struct vector vector
const std::string fInitialTrackInputLabel
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
string dir
art framework interface to geometry description
const std::string fInitialTrackSpacePointsInputLabel
const std::string fShowerDirectionInputLabel
General LArSoft Utilities.
const std::string fShowerStartPositionInputLabel
Detector simulation of raw signals on wires.
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
art::ServiceHandle< art::TFileService > tfs
Declaration of signal hit object.
Contains all timing reference information for the detector.
Definition: types.h:32
Provides recob::Track data product.
Direction
Definition: AssnsIter.h:13
spacecharge::SpaceCharge const * fSCE
vertex reconstruction