#include <EMShowerAlg.h>
Public Member Functions | |
EMShowerAlg (fhicl::ParameterSet const &pset, int debug=0) | |
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) const |
Map associated tracks and clusters together given their associated hits. More... | |
void | AssociateClustersAndTracks (std::vector< art::Ptr< recob::Cluster >> const &clusters, art::FindManyP< recob::Hit > const &fmh, art::FindManyP< recob::Track > const &fmt, std::vector< int > const &clustersToIgnore, std::map< int, std::vector< int >> &clusterToTracks, std::map< int, std::vector< int >> &trackToClusters) const |
Map associated tracks and clusters together given their associated hits, whilst ignoring certain clusters. More... | |
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) const |
Takes the initial showers found and tries to resolve issues where one bad view ruins the event. More... | |
std::unique_ptr< recob::Track > | ConstructTrack (detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> const &track1, std::vector< art::Ptr< recob::Hit >> const &track2, std::map< int, TVector2 > const &showerCentreMap) const |
std::unique_ptr< recob::Track > | ConstructTrack (detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> const &track1, std::vector< art::Ptr< recob::Hit >> const &track2) const |
void | FindInitialTrack (detinfo::DetectorPropertiesData const &detProp, std::map< int, std::vector< art::Ptr< recob::Hit >>> const &hits, std::unique_ptr< recob::Track > &initialTrack, std::map< int, std::vector< art::Ptr< recob::Hit >>> &initialTrackHits, int plane) const |
std::vector< std::vector< int > > | FindShowers (std::map< int, std::vector< int >> const &trackToClusters) const |
Makes showers given a map between tracks and all clusters associated with them. More... | |
recob::Shower | MakeShower (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, art::PtrVector< recob::Hit > const &hits, std::unique_ptr< recob::Track > const &initialTrack, std::map< int, std::vector< art::Ptr< recob::Hit >>> const &initialTrackHits) const |
Makes a recob::Shower object given the hits in the shower and the initial track-like part. More... | |
recob::Shower | MakeShower (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, art::PtrVector< recob::Hit > const &hits, art::Ptr< recob::Vertex > const &vertex, int &iok) const |
<Tingjun to="" document>=""> More... | |
std::vector< recob::SpacePoint > | MakeSpacePoints (detinfo::DetectorPropertiesData const &detProp, std::map< int, std::vector< art::Ptr< recob::Hit >>> const &hits, std::vector< std::vector< art::Ptr< recob::Hit >>> &hitAssns) const |
Makes space points from the shower hits in each plane. More... | |
std::map< int, std::vector< art::Ptr< recob::Hit > > > | OrderShowerHits (detinfo::DetectorPropertiesData const &detProp, art::PtrVector< recob::Hit > const &shower, int plane) const |
Takes the hits associated with a shower and orders them so they follow the direction of the shower. More... | |
void | FindInitialTrackHits (std::vector< art::Ptr< recob::Hit >> const &showerHits, art::Ptr< recob::Vertex > const &vertex, std::vector< art::Ptr< recob::Hit >> &trackHits) const |
<Tingjun to="" document>=""> More... | |
Int_t | WeightedFit (const Int_t n, const Double_t *x, const Double_t *y, const Double_t *w, Double_t *parm) const |
<Tingjun to="" document>=""> More... | |
bool | isCleanShower (std::vector< art::Ptr< recob::Hit >> const &hits) const |
<Tingjun to="" document>=""> More... | |
Public Attributes | |
int | fDebug |
Private Member Functions | |
void | CheckIsolatedHits_ (std::map< int, std::vector< art::Ptr< recob::Hit >>> &showerHitsMap) const |
bool | CheckShowerHits_ (detinfo::DetectorPropertiesData const &detProp, std::map< int, std::vector< art::Ptr< recob::Hit >>> const &showerHitsMap) const |
TVector3 | Construct3DPoint_ (detinfo::DetectorPropertiesData const &detProp, art::Ptr< recob::Hit > const &hit1, art::Ptr< recob::Hit > const &hit2) const |
Constructs a 3D point (in [cm]) to represent the hits given in two views. More... | |
double | FinddEdx_ (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> const &trackHits, std::unique_ptr< recob::Track > const &track) const |
Finds dE/dx for the track given a set of hits. More... | |
std::vector< art::Ptr< recob::Hit > > | FindOrderOfHits_ (detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> const &hits, bool perpendicular=false) const |
std::map< int, std::vector< art::Ptr< recob::Hit > > > | FindShowerStart_ (std::map< int, std::vector< art::Ptr< recob::Hit >>> const &orderedShowerMap) const |
std::map< int, std::map< int, bool > > | GetPlanePermutations_ (const detinfo::DetectorPropertiesData &detProp, const std::map< int, std::vector< art::Ptr< recob::Hit >>> &showerHitsMap) const |
double | GlobalWire_ (const geo::WireID &wireID) const |
Find the global wire position. More... | |
TVector2 | HitCoordinates_ (recob::Hit const &hit) const |
Return the coordinates of this hit in global wire/tick space. More... | |
TVector2 | HitPosition_ (detinfo::DetectorPropertiesData const &detProp, recob::Hit const &hit) const |
Return the coordinates of this hit in units of cm. More... | |
TVector2 | HitPosition_ (detinfo::DetectorPropertiesData const &detProp, TVector2 const &pos, geo::PlaneID planeID) const |
Return the coordinates of this hit in units of cm. More... | |
std::unique_ptr< recob::Track > | MakeInitialTrack_ (detinfo::DetectorPropertiesData const &detProp, std::map< int, std::vector< art::Ptr< recob::Hit >>> const &initialHitsMap, std::map< int, std::vector< art::Ptr< recob::Hit >>> const &showerHitsMap) const |
void | OrderShowerHits_ (detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> const &shower, std::vector< art::Ptr< recob::Hit >> &orderedShower, art::Ptr< recob::Vertex > const &vertex) const |
TVector2 | Project3DPointOntoPlane_ (detinfo::DetectorPropertiesData const &detProp, TVector3 const &point, int plane, int cryostat=0) const |
std::map< double, int > | RelativeWireWidth_ (const std::map< int, std::vector< art::Ptr< recob::Hit >>> &showerHitsMap) const |
TVector2 | ShowerCenter_ (detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> const &showerHits) const |
Returns the charge-weighted shower center. More... | |
TVector2 | ShowerDirection_ (detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit >> &showerHits) const |
double | ShowerHitRMS_ (detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> const &showerHits) const |
double | ShowerHitRMSGradient_ (detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit >> &showerHits) const |
Returns the gradient of the RMS vs shower segment graph. More... | |
int | WorstPlane_ (const std::map< int, std::vector< art::Ptr< recob::Hit >>> &showerHitsMap) const |
Returns the plane which is determined to be the least likely to be correct. More... | |
Private Attributes | |
double const | fMinTrackLength |
double const | fdEdxTrackLength |
double const | fSpacePointSize |
unsigned int const | fNfitpass |
std::vector< unsigned int > const | fNfithits |
std::vector< double > const | fToler |
art::ServiceHandle< geo::Geometry const > | fGeom |
shower::ShowerEnergyAlg const | fShowerEnergyAlg |
calo::CalorimetryAlg const | fCalorimetryAlg |
pma::ProjectionMatchingAlg const | fProjectionMatchingAlg |
std::string const | fDetector |
bool const | fMakeGradientPlot |
bool const | fMakeRMSGradientPlot |
int const | fNumShowerSegments |
Definition at line 58 of file EMShowerAlg.h.
shower::EMShowerAlg::EMShowerAlg | ( | fhicl::ParameterSet const & | pset, |
int | debug = 0 |
||
) |
Definition at line 37 of file EMShowerAlg.cxx.
void shower::EMShowerAlg::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 | ||
) | const |
Map associated tracks and clusters together given their associated hits.
Definition at line 60 of file EMShowerAlg.cxx.
void shower::EMShowerAlg::AssociateClustersAndTracks | ( | std::vector< art::Ptr< recob::Cluster >> const & | clusters, |
art::FindManyP< recob::Hit > const & | fmh, | ||
art::FindManyP< recob::Track > const & | fmt, | ||
std::vector< int > const & | clustersToIgnore, | ||
std::map< int, std::vector< int >> & | clusterToTracks, | ||
std::map< int, std::vector< int >> & | trackToClusters | ||
) | const |
Map associated tracks and clusters together given their associated hits, whilst ignoring certain clusters.
Definition at line 73 of file EMShowerAlg.cxx.
|
private |
Checks the hits across the views in a given shower to determine if there is one in the incorrect TPC
Definition at line 119 of file EMShowerAlg.cxx.
|
private |
Takes the shower hits in all views and ensure the ordering is consistent Returns bool, indicating whether or not everything makes sense!
Definition at line 201 of file EMShowerAlg.cxx.
std::vector< int > shower::EMShowerAlg::CheckShowerPlanes | ( | std::vector< std::vector< int >> const & | initialShowers, |
std::vector< art::Ptr< recob::Cluster >> const & | clusters, | ||
art::FindManyP< recob::Hit > const & | fmh | ||
) | const |
Takes the initial showers found and tries to resolve issues where one bad view ruins the event.
Definition at line 294 of file EMShowerAlg.cxx.
|
private |
Constructs a 3D point (in [cm]) to represent the hits given in two views.
Definition at line 394 of file EMShowerAlg.cxx.
std::unique_ptr< recob::Track > shower::EMShowerAlg::ConstructTrack | ( | detinfo::DetectorPropertiesData const & | detProp, |
std::vector< art::Ptr< recob::Hit >> const & | track1, | ||
std::vector< art::Ptr< recob::Hit >> const & | track2, | ||
std::map< int, TVector2 > const & | showerCentreMap | ||
) | const |
Constructs a recob::Track from sets of hits in two views. Intended to be used to construct the initial first part of a shower. All PMA methods taken from the pma tracking algorithm (R. Sulej and D. Stefan). This implementation also orients the track in the correct direction if a map of shower centres (units [cm]) in each view is provided.
Definition at line 412 of file EMShowerAlg.cxx.
std::unique_ptr< recob::Track > shower::EMShowerAlg::ConstructTrack | ( | detinfo::DetectorPropertiesData const & | detProp, |
std::vector< art::Ptr< recob::Hit >> const & | track1, | ||
std::vector< art::Ptr< recob::Hit >> const & | track2 | ||
) | const |
Constructs a recob::Track from sets of hits in two views. Intended to be used to construct the initial first part of a shower. All methods taken from the pma tracking algorithm (R. Sulej and D. Stefan).
Definition at line 561 of file EMShowerAlg.cxx.
|
private |
Finds dE/dx for the track given a set of hits.
Definition at line 570 of file EMShowerAlg.cxx.
void shower::EMShowerAlg::FindInitialTrack | ( | detinfo::DetectorPropertiesData const & | detProp, |
std::map< int, std::vector< art::Ptr< recob::Hit >>> const & | hits, | ||
std::unique_ptr< recob::Track > & | initialTrack, | ||
std::map< int, std::vector< art::Ptr< recob::Hit >>> & | initialTrackHits, | ||
int | plane | ||
) | const |
Finds the initial track-like part of the shower and the hits in all views associated with it
Finding the initial track requires three stages: – find the initial track-like hits in each view – use these to construct a track
Definition at line 612 of file EMShowerAlg.cxx.
void shower::EMShowerAlg::FindInitialTrackHits | ( | std::vector< art::Ptr< recob::Hit >> const & | showerHits, |
art::Ptr< recob::Vertex > const & | vertex, | ||
std::vector< art::Ptr< recob::Hit >> & | trackHits | ||
) | const |
<Tingjun to="" document>="">
Definition at line 1620 of file EMShowerAlg.cxx.
|
private |
Orders hits along the best fit line through the charge-weighted centre of the hits. Orders along the line perpendicular to the least squares line if perpendicular is set to true.
Definition at line 659 of file EMShowerAlg.cxx.
std::vector< std::vector< int > > shower::EMShowerAlg::FindShowers | ( | std::map< int, std::vector< int >> const & | trackToClusters | ) | const |
Makes showers given a map between tracks and all clusters associated with them.
Definition at line 717 of file EMShowerAlg.cxx.
|
private |
Takes a map of the shower hits on each plane (ordered from what has been decided to be the start) Returns a map of the initial track-like part of the shower on each plane
Definition at line 757 of file EMShowerAlg.cxx.
|
private |
Takes all the shower hits, ready ordered, and returns information to help with the orientation of the shower in each view Returns map of most likely permutations of reorientation Starts at 0,0,0 (i.e. don't need to reorient any plane) and ends with 1,1,1 (i.e. every plane needs reorienting) Every permutation inbetween represent increasing less likely changes to satisfy the correct orientation criteria
Definition at line 873 of file EMShowerAlg.cxx.
|
private |
Find the global wire position.
Definition at line 1705 of file EMShowerAlg.cxx.
|
private |
Return the coordinates of this hit in global wire/tick space.
Definition at line 1683 of file EMShowerAlg.cxx.
|
private |
Return the coordinates of this hit in units of cm.
Definition at line 1689 of file EMShowerAlg.cxx.
|
private |
Return the coordinates of this hit in units of cm.
Definition at line 1697 of file EMShowerAlg.cxx.
bool shower::EMShowerAlg::isCleanShower | ( | std::vector< art::Ptr< recob::Hit >> const & | hits | ) | const |
|
private |
Takes initial track hits from multiple views and forms a track object which best represents the start of the shower
Definition at line 960 of file EMShowerAlg.cxx.
recob::Shower shower::EMShowerAlg::MakeShower | ( | detinfo::DetectorClocksData const & | clockData, |
detinfo::DetectorPropertiesData const & | detProp, | ||
art::PtrVector< recob::Hit > const & | hits, | ||
std::unique_ptr< recob::Track > const & | initialTrack, | ||
std::map< int, std::vector< art::Ptr< recob::Hit >>> const & | initialTrackHits | ||
) | const |
Makes a recob::Shower object given the hits in the shower and the initial track-like part.
Definition at line 1010 of file EMShowerAlg.cxx.
recob::Shower shower::EMShowerAlg::MakeShower | ( | detinfo::DetectorClocksData const & | clockData, |
detinfo::DetectorPropertiesData const & | detProp, | ||
art::PtrVector< recob::Hit > const & | hits, | ||
art::Ptr< recob::Vertex > const & | vertex, | ||
int & | iok | ||
) | const |
<Tingjun to="" document>="">
Definition at line 1077 of file EMShowerAlg.cxx.
std::vector< recob::SpacePoint > shower::EMShowerAlg::MakeSpacePoints | ( | detinfo::DetectorPropertiesData const & | detProp, |
std::map< int, std::vector< art::Ptr< recob::Hit >>> const & | hits, | ||
std::vector< std::vector< art::Ptr< recob::Hit >>> & | hitAssns | ||
) | const |
Makes space points from the shower hits in each plane.
Definition at line 1230 of file EMShowerAlg.cxx.
std::map< int, std::vector< art::Ptr< recob::Hit > > > shower::EMShowerAlg::OrderShowerHits | ( | detinfo::DetectorPropertiesData const & | detProp, |
art::PtrVector< recob::Hit > const & | shower, | ||
int | plane | ||
) | const |
Takes the hits associated with a shower and orders them so they follow the direction of the shower.
Ordering the shower hits requires three stages: – putting all the hits in a given plane in some kind of order – use the properties of the hits in all three planes to check this order – orient the hits correctly using properties of the shower
Definition at line 1372 of file EMShowerAlg.cxx.
|
private |
Takes the hits associated with a shower and orders then so they follow the direction of the shower
Definition at line 1587 of file EMShowerAlg.cxx.
|
private |
Projects a 3D point (units [cm]) onto a 2D plane Returns 2D point (units [cm])
Definition at line 1947 of file EMShowerAlg.cxx.
|
private |
Determines the 'relative wire width', i.e. how spread a shower is across wires of each plane relative to the others If a shower travels along the wire directions in a particular view, it will have a smaller wire width in that view Returns a map relating these widths to each plane
Definition at line 1760 of file EMShowerAlg.cxx.
|
private |
Returns the charge-weighted shower center.
Definition at line 1826 of file EMShowerAlg.cxx.
|
private |
Returns a rough charge-weighted shower 'direction' given the hits in the shower
Definition at line 1800 of file EMShowerAlg.cxx.
|
private |
Returns the RMS of the hits from the central shower 'axis' along the length of the shower
Definition at line 1845 of file EMShowerAlg.cxx.
|
private |
Returns the gradient of the RMS vs shower segment graph.
Definition at line 1865 of file EMShowerAlg.cxx.
Int_t shower::EMShowerAlg::WeightedFit | ( | const Int_t | n, |
const Double_t * | x, | ||
const Double_t * | y, | ||
const Double_t * | w, | ||
Double_t * | parm | ||
) | const |
|
private |
Returns the plane which is determined to be the least likely to be correct.
Definition at line 1980 of file EMShowerAlg.cxx.
|
private |
Definition at line 278 of file EMShowerAlg.h.
int shower::EMShowerAlg::fDebug |
Definition at line 152 of file EMShowerAlg.h.
|
private |
Definition at line 265 of file EMShowerAlg.h.
|
private |
Definition at line 281 of file EMShowerAlg.h.
|
private |
Definition at line 274 of file EMShowerAlg.h.
|
private |
Definition at line 284 of file EMShowerAlg.h.
|
private |
Definition at line 285 of file EMShowerAlg.h.
|
private |
Definition at line 264 of file EMShowerAlg.h.
|
private |
Definition at line 270 of file EMShowerAlg.h.
|
private |
Definition at line 269 of file EMShowerAlg.h.
|
private |
Definition at line 286 of file EMShowerAlg.h.
|
private |
Definition at line 279 of file EMShowerAlg.h.
|
private |
Definition at line 277 of file EMShowerAlg.h.
|
private |
Definition at line 266 of file EMShowerAlg.h.
|
private |
Definition at line 271 of file EMShowerAlg.h.