2 #include "MomResolMCCorrection.hxx" 3 #include "HighlandAnalysisUtils.hxx" 4 #include "VersioningUtils.hxx" 5 #include "Parameters.hxx" 10 MomResolMCCorrection::MomResolMCCorrection(){
13 std::string(getenv(
"PSYCHESYSTEMATICSROOT")) +
"/data",
15 BinnedParams::k1D_SYMMETRIC,
16 versionUtils::Extension()
20 _tpc_based_var = (bool)ND::params().GetParameterI(
"psycheSystematics.MomResol.UseTPCBased");
27 std::cout <<
" MomentumResolMCCorrection::Apply(): IsMC " << spill.GetIsMC() << std::endl;
37 for (
unsigned int i = 0; i < spill.
Bunches.size(); i++) {
44 for (Int_t j = 0; j < nTPC; j++){
54 std::cout <<
"MomentumResolMCCorrection::Apply() end " << std::endl;
71 Float_t value1, value2;
74 if (versionUtils::prod6_systematics){
77 if (!
GetXBinnedValues(track, value1, value2, index1, index2, MomentumResolVariation::kCorr))
return false;
87 variation = 0.5 * (value1 + value2);
102 Float_t value1, value2;
103 Int_t index1, index2;
105 if (versionUtils::prod6_systematics){
108 if (!
GetXBinnedValues(track, value1, value2, index1, index2, MomentumResolVariation::kCorr))
return false;
118 variation = 0.5 * (value1 + value2);
126 if (!
object)
return false;
ToyExperiment _exp
Some default toy experiment, not used at the moment.
virtual void ApplyVariation(AnaTrackB *track, const ToyExperiment &exp)
void Apply(AnaSpillC &spill)
Apply the momentum correction to all the relevant objects: AnaTrack and corresponding.
bool GetVariationTPC(AnaTPCParticleB *track, Float_t &variation)
Get the variation given a track.
std::vector< AnaBunchC * > Bunches
The reconstructed objects, split into timing bunches.
bool GetBinValues(Float_t value, Float_t &mean, Float_t &sigma)
Gets the bin values for a 1D source.
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
virtual void ApplyVariationTPCBased(AnaTrackB *track, const ToyExperiment &exp)
bool GetIsMC() const
Return whether this spill is from Monte Carlo or not.
Representation of a global track.
bool GetVariation(AnaTrackB *track, Float_t &variation)
Get the variation given a track.
bool IsRelevantObject(const AnaRecObjectC *object)
Representation of a TPC segment of a global track.
bool GetXBinnedValues(AnaTrackB *track, Float_t &value1, Float_t &value2, Int_t &index1, Int_t &index2, ModeEnum mode)
Get parameters for this global track assumed one uses X bins.
int GetAllTracksUsingDet(const AnaBunchB &bunch, SubDetId::SubDetEnum det, AnaTrackB *selTracks[])
BinnedParams * _params
Binned data to read the parameters.