Apply the variation to the track, the variation is assumed to be an additional factor one adds to the true-rec difference of pt_inv pt_inv_var = (1 + var)(pt_inv_rec - pt_inv_true) + pt_inv_true the variation is calculated on the fly
28 std::cout <<
" MomentumResolVariation::ApplyVariation() - start " << std::endl;
38 std::cout <<
" MomentumResolVariation::ApplyVariation() p0, p0_true = " << p <<
" " << p0_true << std::endl;
44 Float_t pt0_inv_flip = anaUtils::ComputeInversePTFlip(*track);
46 if (pt0_inv < 0)
return;
52 std::cout <<
" MomentumResolVariation::ApplyVariation() 1/pt0, 1/pt0_true = " << pt0_inv <<
" " << pt0_inv_true << std::endl;
53 std::cout <<
" MomentumResolVariation::ApplyVariation() 1/pt0_flip = " << pt0_inv_flip << std::endl;
54 std::cout <<
" MomentumResolVariation::ApplyVariation() var = " << variation << std::endl;
58 Float_t pt_inv = (1 + variation) * (pt0_inv - pt0_inv_true) + pt0_inv_true;
61 Float_t pt_inv_flip = (1 + variation) * (pt0_inv_flip - pt0_inv_true) + pt0_inv_true;
84 Float_t smearingFact = (p - p0_true)/(p0 - p0_true);
85 Float_t smearingFactMom = p / p0;
91 Float_t tpcmom = tpcTrackOrig->
Momentum;
94 tpcTrack->
Momentum = tpcmom * smearingFactMom;
98 std::cout <<
" MomentumResolVariation::ApplyVariation() p0 new = " << track->
Momentum << std::endl;
99 std::cout <<
" MomentumResolVariation::ApplyVariation() p0flip new = " << track->
MomentumFlip << std::endl;
const AnaTrackB * GetOriginalTrack() const
Return a casted version of the original AnaParticleB associated.
AnaTPCParticleB * TPCSegments[NMAXTPCS]
The TPC segments that contributed to this global track.
Float_t ComputeMomentumFromInversePT(const AnaParticleB &part, Float_t PTinv)
compute the total momentum given the part and the inverse transverse momentum
AnaTrueObjectC * TrueObject
The link to the true oject that most likely generated this reconstructed object.
Float_t Momentum
The initial momentum of the true particle.
Float_t MomentumError
Error of the momentum at the start of the segment.
Float_t MomentumFlip
Momentum for the main PID hypothesis and reverse sense.
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
int nTPCSegments
How many TPC tracks are associated with this track.
Float_t ComputeInversePT(const AnaDetCrossingB &cross, bool entrance=true)
Compute inverse PT given an AnaDetCrossing.
const AnaParticleB * Original
Float_t ComputeMomentumFromInversePTFlip(const AnaParticleB &part, Float_t PTinv)
Compute the total momentum (flip) given the part and the inverse transverse momentum.
Representation of a global track.
Representation of a TPC segment of a global track.
virtual bool GetVariation(AnaTrackB *track, Float_t &variation, const ToyExperiment &exp)=0
Abstract class to get the variation given a track.
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.