11 #ifndef EMShowerAlg_hxx 12 #define EMShowerAlg_hxx 57 #include "TMultiGraph.h" 66 #include "TPrincipal.h" 83 std::map<
int,std::vector<int> >& clusterToTracks,
84 std::map<
int,std::vector<int> >& trackToClusters);
90 std::vector<int>
const& clustersToIgnore,
91 std::map<
int,std::vector<int> >& clusterToTracks,
92 std::map<
int,std::vector<int> >& trackToClusters);
104 std::map<int,TVector2>
const& showerCentreMap);
113 std::unique_ptr<recob::Track>& initialTrack,
117 std::vector<std::vector<int> >
FindShowers(std::map<
int,std::vector<int> >
const& trackToClusters);
121 std::unique_ptr<recob::Track>
const& initialTrack,
142 Int_t
WeightedFit(
const Int_t
n,
const Double_t *
x,
const Double_t *
y,
const Double_t *
w, Double_t *parm);
274 Cm = ConvertWireTickToCm(wiretick, planeID);
double GlobalWire(const geo::WireID &wireID)
Find the global wire position.
std::vector< double > fToler
art::ServiceHandle< cheat::BackTrackerService > bt_serv
Int_t WeightedFit(const Int_t n, const Double_t *x, const Double_t *y, const Double_t *w, Double_t *parm)
<Tingjun to="" document>="">
void FindInitialTrackHits(std::vector< art::Ptr< recob::Hit > >const &showerHits, art::Ptr< recob::Vertex > const &vertex, std::vector< art::Ptr< recob::Hit > > &trackHits)
<Tingjun to="" document>="">
Encapsulate the construction of a single cyostat.
EMShowerAlg(fhicl::ParameterSet const &pset)
Implementation of the Projection Matching Algorithm.
std::vector< recob::SpacePoint > MakeSpacePoints(std::map< int, std::vector< art::Ptr< recob::Hit > > > hits, std::vector< std::vector< art::Ptr< recob::Hit > > > &hitAssns)
Makes space points from the shower hits in each plane.
std::map< int, std::vector< art::Ptr< recob::Hit > > > FindShowerStart(std::map< int, std::vector< art::Ptr< recob::Hit > > > const &orderedShowerMap)
Declaration of signal hit object.
TVector3 Construct3DPoint(art::Ptr< recob::Hit > const &hit1, art::Ptr< recob::Hit > const &hit2)
Constructs a 3D point (in [cm]) to represent the hits given in two views.
The data type to uniquely identify a Plane.
TVector2 Project3DPointOntoPlane(TVector3 const &point, int plane, int cryostat=0)
bool CheckShowerHits(std::map< int, std::vector< art::Ptr< recob::Hit > > > const &showerHitsMap)
std::map< int, std::vector< art::Ptr< recob::Hit > > > OrderShowerHits(const art::PtrVector< recob::Hit > &shower, int plane)
Takes the hits associated with a shower and orders them so they follow the direction of the shower...
TVector2 HitPosition(art::Ptr< recob::Hit > const &hit)
Return the coordinates of this hit in units of cm.
int FindParticleID(const art::Ptr< recob::Hit > &hit)
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
TVector2 ShowerDirection(const std::vector< art::Ptr< recob::Hit > > &showerHits)
Returns a rough charge-weighted shower 'direction' given the hits in the shower.
bool isCleanShower(std::vector< art::Ptr< recob::Hit > > const &hits)
<Tingjun to="" document>="">
calo::CalorimetryAlg fCalorimetryAlg
TVector2 ShowerCentre(const std::vector< art::Ptr< recob::Hit > > &showerHits)
Returns the charge-weighted shower centre.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::unique_ptr< recob::Track > MakeInitialTrack(std::map< int, std::vector< art::Ptr< recob::Hit > > > const &initialHitsMap, std::map< int, std::vector< art::Ptr< recob::Hit > > > const &showerHitsMap)
Takes initial track hits from multiple views and forms a track object which best represents the start...
Access the description of detector geometry.
HitPosition(TVector2 wiretick, TVector2 cm)
std::vector< std::vector< int > > FindShowers(std::map< int, std::vector< int > > const &trackToClusters)
Makes showers given a map between tracks and all clusters associated with them.
HitPosition(TVector2 wiretick, geo::PlaneID planeID)
bool fMakeRMSGradientPlot
int WorstPlane(const std::map< int, std::vector< art::Ptr< recob::Hit > > > &showerHitsMap)
Returns the plane which is determined to be the least likely to be correct.
void AssociateClustersAndTracks(std::vector< art::Ptr< recob::Cluster > > const &clusters, art::FindManyP< recob::Hit > const &fmh, art::FindManyP< recob::Track > const &fmt, std::map< int, std::vector< int > > &clusterToTracks, std::map< int, std::vector< int > > &trackToClusters)
Map associated tracks and clusters together given their associated hits.
shower::ShowerEnergyAlg fShowerEnergyAlg
TVector2 ConvertWireTickToCm(TVector2 wiretick, geo::PlaneID planeID)
pma::ProjectionMatchingAlg fProjectionMatchingAlg
std::map< int, std::map< int, bool > > GetPlanePermutations(const std::map< int, std::vector< art::Ptr< recob::Hit > > > &showerHitsMap)
double ShowerHitRMS(const std::vector< art::Ptr< recob::Hit > > &showerHits)
Returns the RMS of the hits from the central shower 'axis' along the length of the shower...
Description of geometry of one entire detector.
Declaration of cluster object.
art::ServiceHandle< geo::Geometry > fGeom
Provides recob::Track data product.
std::unique_ptr< recob::Track > ConstructTrack(std::vector< art::Ptr< recob::Hit > > const &track1, std::vector< art::Ptr< recob::Hit > > const &track2, std::map< int, TVector2 > const &showerCentreMap)
double FinddEdx(std::vector< art::Ptr< recob::Hit > > const &trackHits, std::unique_ptr< recob::Track > const &track)
Finds dE/dx for the track given a set of hits.
Detector simulation of raw signals on wires.
double ShowerHitRMSGradient(const std::vector< art::Ptr< recob::Hit > > &showerHits, TVector2 trueStart=TVector2(0, 0))
Returns the gradient of the RMS vs shower segment graph.
void FindInitialTrack(const std::map< int, std::vector< art::Ptr< recob::Hit > > > &hits, std::unique_ptr< recob::Track > &initialTrack, std::map< int, std::vector< art::Ptr< recob::Hit > > > &initialTrackHits, int plane)
Finds the initial track-like part of the shower and the hits in all views associated with it...
Encapsulate the geometry of a wire.
void CheckIsolatedHits(std::map< int, std::vector< art::Ptr< recob::Hit > > > &showerHitsMap)
Checks the hits across the views in a given shower to determine if there is one in the incorrect TPC...
virtual double ConvertTicksToX(double ticks, int p, int t, int c) const =0
Implementation of the Projection Matching Algorithm.
Encapsulate the construction of a single detector plane.
art::ServiceHandle< art::TFileService > tfs
TProfile * hNumHitsInSegment
std::vector< art::Ptr< recob::Hit > > FindOrderOfHits(std::vector< art::Ptr< recob::Hit > > const &hits, bool perpendicular=false)
detinfo::DetectorProperties const * fDetProp
recob::Shower MakeShower(art::PtrVector< recob::Hit > const &hits, std::unique_ptr< recob::Track > const &initialTrack, std::map< int, std::vector< art::Ptr< recob::Hit > > > const &initialTrackHits)
Makes a recob::Shower object given the hits in the shower and the initial track-like part...
std::vector< int > CheckShowerPlanes(std::vector< std::vector< int > > const &initialShowers, std::vector< art::Ptr< recob::Cluster > > const &clusters, art::FindManyP< recob::Hit > const &fmh)
Takes the initial showers found and tries to resolve issues where one bad view ruins the event...
TVector2 HitCoordinates(art::Ptr< recob::Hit > const &hit)
Return the coordinates of this hit in global wire/tick space.
std::vector< unsigned int > fNfithits
Utility functions to extract information from recob::Track.
art framework interface to geometry description
std::map< double, int > RelativeWireWidth(const std::map< int, std::vector< art::Ptr< recob::Hit > > > &showerHitsMap)
Encapsulate the construction of a single detector plane.
int FindTrueParticle(const std::vector< art::Ptr< recob::Hit > > &showerHits)