CosmicTrackUtilities.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////
2 /// \brief Cosmic track utility code
3 /// \author Brian Rebel - brebel@fnal.gov
4 /// \date
5 //////////////////////////////////////////////////////////////////////////
6 #ifndef TRACKFIT_COSMICTRACKUTILITIES_H
7 #define TRACKFIT_COSMICTRACKUTILITIES_H
8 
11 
13 #include "Geometry/LiveGeometry.h"
14 #include "Geometry/Geometry.h"
15 
16 class TVector3;
17 
18 namespace rb{
19  class Track;
20  class RecoHit;
21 }
22 namespace simb{
23  class MCParticle;
24 }
25 namespace sim{
26  class FLSHit;
27 }
28 
29 namespace trk{
30 
31  typedef std::pair<TVector3, TVector3> zBounds;
32  typedef std::map<double, zBounds> zBoundMap;
33 
34  // A class to select cosmic ray muons for analysis
36 
37  public:
38 
39  explicit CosmicTrackUtilities();
40  virtual ~CosmicTrackUtilities();
41 
42  void reconfigure(fhicl::ParameterSet const& pset);
43 
44  float RangeMomentum (rb::Track const& track);
45  float LengthCorrection(float const& length);
46  float CosTheta (float const& dcosY,
47  float const& magnitude);
48  float Azimuth (float const& dcosX,
49  float const& dcosZ,
50  float const& magnitude);
51 
52  std::pair<std::pair<float, float>, std::pair<TVector3, TVector3> > TrueLengthEndPoints(simb::MCParticle const& part);
53 
54  std::map<geo::CellUniqueId, float> TruePathLengthInCell(simb::MCParticle const& part,
55  std::vector<sim::FLSHit> const& flsHits);
56 
57  void FindTriCells(rb::Track const& track,
58  std::map<std::pair<uint32_t, uint32_t>,bool> & planeCellMap);
59  float TriCellPathLength(rb::Track const& track,
60  uint32_t const& plane,
61  double const& cellWidth,
62  geo::View_t const& view);
63 
64  float PathLengthInCell(zBoundMap const& zBounds,
65  TVector3 const& recoHitLoc,
66  std::pair<uint32_t, uint32_t> const& pc);
67 
68  zBoundMap MakeZBoundaryMap(std::vector<TVector3> const& trajectory);
69  zBounds ZBounds(zBoundMap const& bounds,
70  double const& hitZ);
71  std::vector<float> TrackResiduals(rb::Track const& track);
72 
73  bool PointInDetector(TVector3 const& point);
74 
75  private:
76 
77  void FindZBoundaries();
78 
79  double fEffectivedEdx; ///< effective dE/dx in MeV/cm
80  std::vector<double> fPolCoeff; ///< the coefficients in an 8th degree polynomial
81  std::set<double> fPlaneZBounds; ///< boundaries of each plane in the z direction
82  double fPlaneZDepth; ///< extent of one plane (cell) in the z direction
83 
86 
87  };
88 
89 }
90 
91 #endif // TRACKFIT_COSMICTRACKSELECTION_H
double fPlaneZDepth
extent of one plane (cell) in the z direction
art::ServiceHandle< geo::Geometry > fGeom
zBounds ZBounds(zBoundMap const &bounds, double const &hitZ)
Return the bounding points for a given z position along a track.
Definition: CalibUtil.cxx:462
::xsd::cxx::tree::bounds< char > bounds
Definition: Database.h:226
zBoundMap MakeZBoundaryMap(std::set< double > const &planeZBounds, std::vector< TVector3 > const &trajectory)
Return a map of the z position of each trajectory point on a track to the bounding positions of where...
Definition: CalibUtil.cxx:354
std::map< double, zBounds > zBoundMap
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
art::ServiceHandle< geo::LiveGeometry > fLiveGeom
Definition: event.h:19
A rb::Prong with full reconstructed trajectory.
Definition: Track.h:20
Give every cell in the geometry a unique ID number based on the TGeo path to the node.
Track finder for cosmic rays.
TString part[npart]
Definition: Style.C:32
std::vector< double > fPolCoeff
the coefficients in an 8th degree polynomial
length
Definition: demo0.py:21
std::pair< TVector3, TVector3 > zBounds
Perform a "2 point" Hough transform on a collection of hits.
Example routine for calculating the "ultimate e-m mother" of a particle in a simulated event...
Definition: FillTruth.h:16
This class describes a particle created in the detector Monte Carlo simulation.
void FindZBoundaries(std::set< double > &planeZBounds)
Find the boundaries in the z direction of planes in the detector.
Definition: CalibUtil.cxx:332
double fEffectivedEdx
effective dE/dx in MeV/cm
std::set< double > fPlaneZBounds
boundaries of each plane in the z direction
Encapsulate the geometry of one entire detector (near, far, ndos)
float PathLengthInCell(zBoundMap const &zBounds, TVector3 const &recoHitLoc, std::pair< uint32_t, uint32_t > const &pc)
Return the path length of a track in the cell in question.
Definition: CalibUtil.cxx:498