HighLAND
TPCPIDVariation.hxx
1 #ifndef TPCPIDVariation_h
2 #define TPCPIDVariation_h
3 
4 #include "BinnedParams.hxx"
5 #include "BaseDataClasses.hxx"
6 
7 class ToyExperiment;
8 
9 
10 /// This variation that smears that the measured dEdXMeas (CT) for the TPC segments of the track
11 /// The smearing is done assuming the variation based on pull parameters
13 public:
14 
15  /// Enum for particle hypothesis
16  enum HypEnum{
17  kMuon = 0,
18  kElectron,
19  kProton,
20  kPion,
21  kKaon,
22  kNPULLS
23  };
24 
25 
26 
27  /// Instantiate the PID variation,
29  for (unsigned int i = 0; i < kNPULLS; i++){
30  _mean[i] = NULL;
31  _sigma[i] = NULL;
32  }
33  };
34 
35  virtual ~TPCPIDVariation() {
36  for (unsigned int i = 0; i < kNPULLS; i++){
37  if (_mean[i]) delete _mean[i]; _mean[i] = NULL;
38  if (_sigma[i]) delete _sigma[i]; _sigma[i] = NULL;
39  }
40  }
41 
42  /// Apply variation for a track, the most general case given a certain ToyExperiment
43  virtual void ApplyVariation(AnaTrackB* track, const ToyExperiment& exp);
44 
45  /// Get the variation, two params: one for mean and one for sigma
46  /// Sigma_var: is the param to control how one wants to scale the pull sigma: (pull_sigma_new/pull_sigma_old)
47  /// Mean_var: the shift one wants to apply to pull mean: pull_mean_new - pull_mean_old
48  /// In principle should be enough to have it for the TPC segment but in the "regular"
49  /// TPC PID syst code the corresponding truth track and momentum are retrived from the global track
50  /// so keep it as a parameter as well
51  /// Toy experiment is used to retrieve the variation
52  virtual bool GetVariation(const AnaTPCParticleB& tpcTrack,
53  Float_t& mean_var, Float_t& sigma_var,
54  const AnaTrackB& track, const ToyExperiment& exp) = 0;
55 
56  /// Get the expected dEdX and error, keep it virtual so that one can easily add new hypothesis, e.g. kaons
57  /// Global track is also provided so that one can use it for example to retrieve the PID info
58  virtual bool GetPIDParams(const AnaTPCParticleB& tpcTrack,
59  Float_t& dEdxExp, Float_t& dEdxSigma,
60  const AnaTrackB& track);
61 
62 protected:
63 
64  /// Expect that the derived classes should use some data to store the params for the variations
65  /// so keep the data-storage here
66  BinnedParams* _mean[kNPULLS]; // data for pull mean: a correction (shift) or its error
67  BinnedParams* _sigma[kNPULLS]; // data for pull simga: a correction (scaling ) or its error
68 };
69 
70 #endif
virtual void ApplyVariation(AnaTrackB *track, const ToyExperiment &exp)
Apply variation for a track, the most general case given a certain ToyExperiment. ...
BinnedParams * _mean[kNPULLS]
HypEnum
Enum for particle hypothesis.
Representation of a global track.
virtual bool GetVariation(const AnaTPCParticleB &tpcTrack, Float_t &mean_var, Float_t &sigma_var, const AnaTrackB &track, const ToyExperiment &exp)=0
Representation of a TPC segment of a global track.
TPCPIDVariation()
Instantiate the PID variation,.
virtual bool GetPIDParams(const AnaTPCParticleB &tpcTrack, Float_t &dEdxExp, Float_t &dEdxSigma, const AnaTrackB &track)