TrackActivityRemover.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file: TrackActivityRemover.cxx
3 // \brief Remove hits associated with track activity, including track
4 // hits, hits surrounding all track bodies, and hits surrounding
5 // the end points of stopping tracks (Michels).
6 // \author Justin Vasel <justin.vasel@gmail.com>
7 // \date 2019-11-21
8 ////////////////////////////////////////////////////////////////////////
9 
10 #ifndef TRACKACTIVITYREMOVER_H
11 #define TRACKACTIVITYREMOVER_H
12 
13 #include <cstdint>
14 
19 #include "fhiclcpp/ParameterSet.h"
20 
21 #include "TVector3.h"
22 
23 #include "Geometry/Geometry.h"
24 #include "RawData/RawDigit.h"
25 #include "RecoBase/CellHit.h"
26 #include "RecoBase/Cluster.h"
27 #include "RecoBase/Track.h"
29 
30 
31 namespace sn {
32  enum TrackType {
33  kUnknown, ///< Track type is none of the below
34  kStopping, ///< Track enters the detector and stops inside
35  kThroughGoing, ///< Track enters and exits the detector
36  kExiting, ///< Track starts inside the detector and exits
37  kContained ///< Track starts and ends entirely inside the detector
38  };
39 
41  public:
43  fhicl::ParameterSet const & p,
45  art::FindOneP<rb::Cluster>& clusterFromTrack);
47 
48  void SetVetoRegion(int muonEndTimeCut, int muonBodyTimeCut, int muonEndSphereRadius, int muonBodyCylinderRadius);
49 
50  /**
51  * Return the distance between a cell hit and a point in space.
52  *
53  * @param[in] hit <code>rb::CellHit</code>
54  * @param[in] point TVector3
55  * @return distance between the hit and the point
56  */
57  double DistanceHitToPoint(const art::Ptr<rb::CellHit>& h, const TVector3& p);
58 
59  /**
60  * Return the perpendicular distance between a cell hit and a line defined by
61  * the end points of a track.
62  *
63  * @param[in] hit <code>rb::CellHit</code>
64  * @param[in] track <code>rb::Track</code>
65  * @return distance between the hit and the track
66  */
68 
69  /**
70  * Return a boolean that is true if the point p is within the fiducial
71  * volume.
72  *
73  * @param[in] p <code>TVector3</code>
74  * @return true if p is within the fiducial volume
75  */
76  bool PointIsContained(const TVector3& p);
77 
79 
83 
84  void remove(std::vector<art::Ptr<rb::CellHit>>& hits, art::Handle<std::vector<rb::Track>>& hdlTracks);
85 
86  private:
90 
91  int fMuonEndTimeCut; ///< Min. time difference between hit and track end to reject [ns]
92  int fMuonBodyTimeCut; ///< Min. time difference between hit and track to reject [ns]
93  int fMuonEndSphereRadius; ///< Min. distance of hit from track end to reject [cm]
94  int fMuonBodyCylinderRadius; ///< Min. distance of hit from track to reject [cm]
95 
97  int fFVMinX;
98  int fFVMaxX;
99  int fFVMinY;
100  int fFVMaxY;
101  int fFVMinZ;
102  int fFVMaxZ;
103 
107  };
108 }
109 
110 #endif
void SetVetoRegion(int muonEndTimeCut, int muonBodyTimeCut, int muonEndSphereRadius, int muonBodyCylinderRadius)
const char * p
Definition: xmltok.h:285
Definition: event.h:19
bool PointIsContained(const TVector3 &p)
Track enters the detector and stops inside.
TrackActivityRemover(sn::HitVetoMap &vetoMap, fhicl::ParameterSet const &p, art::ServiceHandle< geo::Geometry > &geom, art::FindOneP< rb::Cluster > &clusterFromTrack)
Track type is none of the below.
fhicl::ParameterSet fFiducialVolume
art::FindOneP< rb::Cluster > & fClusterFromTrack
int fMuonBodyTimeCut
Min. time difference between hit and track to reject [ns].
Track starts inside the detector and exits.
void hits()
Definition: readHits.C:15
Track enters and exits the detector.
double DistanceHitToTrackBody(const art::Ptr< rb::CellHit > &h, const art::Ptr< rb::Track > &t)
sn::TrackType GetTrackType(const art::Ptr< rb::Track > &track)
int fMuonEndSphereRadius
Min. distance of hit from track end to reject [cm].
Remove hits from hot and cold channels.
art::ServiceHandle< geo::Geometry > & fGeom
int fMuonBodyCylinderRadius
Min. distance of hit from track to reject [cm].
Track starts and ends entirely inside the detector.
int fMuonEndTimeCut
Min. time difference between hit and track end to reject [ns].
double DistanceHitToPoint(const art::Ptr< rb::CellHit > &h, const TVector3 &p)
void geom(int which=0)
Definition: geom.C:163
Encapsulate the geometry of one entire detector (near, far, ndos)