HighLAND
TPCdEdxDataCorrection.hxx
1 #ifndef TPCdEdxDataCorrection_h
2 #define TPCdEdxDataCorrection_h
3 
4 #include "CorrectionBase.hxx"
5 #include "DataClasses.hxx"
6 
7 /// This class defines a correction that affects the measured dE/dx of an
8 /// AnaTpcSegment. This in turn affects the computed pulls (how electron-like a
9 /// track is, for example).
10 ///
11 /// This correction is applied to data, and is based on the run/subrun of this
12 /// spill.
13 ///
14 /// The corrections are defined in the baseAnalysis/data/TPCdEdxCorrection.dat.
15 /// The format of this file is
16 ///
17 /// run subrun corr_tpc1 err_tpc1 corr_tpc2 err_tpc2 corr_tpc3 err_tpc3
18 ///
19 /// where corr_tpcN is the CT correction to apply to TPC N, and err_tpcN is the
20 /// error on that correction.
22  public:
23 
24  /// Constructor, which reads the corrections from the text file, and fills
25  /// the member variables with the details.
27 
28  virtual ~TPCdEdxDataCorrection() {}
29 
30  /// Apply the dE/dx correction to all the AnaTpcSegment members of all
31  /// tracks in the spill. See TPCdEdxDataCorrection class documentation for
32  /// details.
33  void Apply(AnaSpillC& spill);
34 
35  private:
36 
37  /// Get the correction for the given run, subrun and TPC combination.
38  double GetCorrection(int run, int subrun, unsigned long det);
39 
40  /// Current run-subrun pair.
41  std::pair<int, int> comb;
42 
43  /// Temporary run-subrun pair.
44  std::pair<int, int> comb0;
45 
46  /// Corrections read for TPC1. (run, subrun)->correction.
47  std::map<std::pair<int, int>, double> corrTPC1;
48 
49  /// Corrections read for TPC2. (run, subrun)->correction.
50  std::map<std::pair<int, int>, double> corrTPC2;
51 
52  /// Corrections read for TPC3. (run, subrun)->correction.
53  std::map<std::pair<int, int>, double> corrTPC3;
54 
55  /// Iterator for looping over the data that was read in.
56  std::map<std::pair<int, int>, double>::iterator itr;
57 
58 };
59 
60 #endif
All corrections should be registered with the CorrectionManager.
void Apply(AnaSpillC &spill)