dEdxCalculator.h
Go to the documentation of this file.
1 ///
2 /// \file dEdxCalculator.h
3 /// \brief Calculates dE/dx in cells passed through by a track.
4 ///
5 #ifndef BPFIT_DEDXCALCULATOR_H
6 #define BPFIT_DEDXCALCULATOR_H
7 
8 #include <vector>
9 #include "TVector3.h"
10 
14 
15 #include "Calibrator/Calibrator.h"
16 #include "Geometry/Geometry.h"
19 
20 namespace rb{ class Track; }
21 namespace rb{ class CellHit; }
22 
23 namespace bpfit
24 {
25 
27  public:
28  ///
29  /// \brief Constructor...
30  ///
32 
33  ///
34  /// \brief Compute dE/dx for all cells along this track and the fitsum object that went with it.
35  ///
36  void computeDEDX(art::Ptr<rb::Track> &track, int pdg = 13);
37 
38  ///
39  /// \brief Return the results of the dE/dx calculation.
40  ///
41  /// param: dE - empty vector to be filled with dE values
42  /// param: dx - empty vector to be filled with dx values
43  /// param: W - empty vector to be filled with track W values
44  /// param: BG - empty vector to be filled with corresponding values of beta*gamma
45  /// param: s - empty vector to be filled with corresponding values of s
46  /// param: dxTol - the path length through the cell must be greater than this,
47  /// to trust the computed dE/dx as good
48  ///
49  void getResults(std::vector<double> &dEtemp, std::vector<double> &dxtemp,
50  std::vector<double> &Wtemp, std::vector<double> &bgtemp,
51  std::vector<double> &stemp, double dxTol);
52 
53  ///
54  /// \brief ...can also get the individual results...
55  ///
56  void getDE(std::vector<double> &dEtemp, double dxTol);
57  void getDX(std::vector<double> &dxtemp, double dxTol);
58  void getW (std::vector<double> &Wtemp, double dxTol);
59  void getBG(std::vector<double> &bgtemp, double dxTol);
60  void getS (std::vector<double> &stemp, double dxTol);
61 
62 
63  ///
64  /// \brief Return the list of rb::CellHits used in the dE/dx calculation.
65  ///
66  /// param: dxTol - the path length through the cell must be greater than this,
67  /// to trust the computed dE/dx as good
68  art::PtrVector<rb::CellHit> getCellHits(double dxTol);
69 
70  private:
71  ///
72  /// \brief Clear all internally used vectors.
73  ///
74  void clearVectors();
75 
76  // Vectors used internally to store information.
77  std::vector<geo::OfflineChan> chan; ///< offline channel associated with a cell hit on a track
78  art::PtrVector<rb::CellHit> cells; ///< list of cell hits on the track
79  std::vector<double> dE; ///< computed value of energy for the cell hit
80  std::vector<double> dx; ///< computed value of the track path length through the cell hit
81  std::vector<double> W; ///< value of track W for the cell hit
82  std::vector<double> s; ///< total path length along the track to the middle of the cell hit
83  std::vector<double> bg; ///< value of beta*gamma for the tracked particle at s
84 
87  };
88 }
89 
90 #endif
91 ////////////////////////////////////////////////////////////////////////
std::vector< double > bg
value of beta*gamma for the tracked particle at s
Definition: event.h:19
A rb::Prong with full reconstructed trajectory.
Definition: Track.h:20
std::vector< double > dE
computed value of energy for the cell hit
Encapsulate the geometry of one entire detector (near, far, ndos)
std::vector< double > dx
computed value of the track path length through the cell hit
art::PtrVector< rb::CellHit > cells
list of cell hits on the track
art::ServiceHandle< calib::Calibrator > fCal
Perform a "2 point" Hough transform on a collection of hits.
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
std::vector< double > W
value of track W for the cell hit
art::ServiceHandle< geo::Geometry > fGeom
std::vector< geo::OfflineChan > chan
offline channel associated with a cell hit on a track
Simple object representing a (plane, cell) pair.
Encapsulate the geometry of one entire detector (near, far, ndos)
std::vector< double > s
total path length along the track to the middle of the cell hit