1 #include "TPCPIDSystematics.hxx" 2 #include "ND280AnalysisUtils.hxx" 3 #include "EventBoxTracker.hxx" 5 #include "Parameters.hxx" 14 _sigma[TPCPIDVariation::kMuon] =
new BinnedParams(
"TPCPIDMuonSigRatio", BinnedParams::k2D_SYMMETRIC, versionUtils::Extension());
15 _sigma[TPCPIDVariation::kElectron] =
new BinnedParams(
"TPCPIDEleSigRatio", BinnedParams::k2D_SYMMETRIC, versionUtils::Extension());
16 _sigma[TPCPIDVariation::kProton] =
new BinnedParams(
"TPCPIDProtonSigRatio", BinnedParams::k2D_SYMMETRIC, versionUtils::Extension());
18 _mean[TPCPIDVariation::kMuon] =
new BinnedParams(
"TPCPIDMuonMeanDiff", BinnedParams::k2D_SYMMETRIC, versionUtils::Extension());
19 _mean[TPCPIDVariation::kElectron] =
new BinnedParams(
"TPCPIDEleMeanDiff", BinnedParams::k2D_SYMMETRIC, versionUtils::Extension());
20 _mean[TPCPIDVariation::kProton] =
new BinnedParams(
"TPCPIDProtonMeanDiff", BinnedParams::k2D_SYMMETRIC, versionUtils::Extension());
27 for (UInt_t i = 0; i < TPCPIDVariation::kNPULLS; i++){
28 if (!
_mean[i] && !_sigma[i])
continue;
53 std::cout <<
"TPCPIDSystematics::ApplyVariation(): tracks size " << box->
nRelevantRecObjects << std::endl;
73 for (Int_t k = 0; k < static_cast<AnaTrackB*>(box->RelevantRecObjects[itrk])->nTPCSegments; k++) {
78 if (!original)
continue;
79 if (original->
dEdxMeas == -99999)
continue;
91 Float_t& mean_var, Float_t& sigma_var,
113 part = TPCPIDVariation::kMuon;
116 part = TPCPIDVariation::kMuon;
119 part = TPCPIDVariation::kElectron;
122 part = TPCPIDVariation::kProton;
129 if (!
_mean[part] || !_sigma[part])
return false;
132 Float_t mean_corr, sigma_corr;
135 if (!
_mean[part]->GetBinValues(track.
Momentum, (Float_t)tpc, mean_corr, mean_var, mean_index))
return false;
136 if (!_sigma[part]->GetBinValues(track.
Momentum, (Float_t)tpc, sigma_corr, sigma_var, sigma_index))
return false;
139 mean_index += _offset;
141 for (Int_t i = 0; i < part; i++){
145 sigma_index += _sigma[i]->
GetNBins();
157 sigma_var *= (sigma_corr != 0) ? 1. / sigma_corr : 0.;
181 if (abs(truePart->
PDG) == 211 )
return true;
182 else if (abs(truePart->
PDG) == 2212)
return true;
183 else if (abs(truePart->
PDG) == 13)
return true;
184 else if (abs(truePart->
PDG) == 11)
return true;
196 if (det == SubDetId::kFGD1 || det == SubDetId::kFGD){
197 IDs[ngroups++] = EventBoxTracker::kTracksWithTPCInFGD1FV;
199 if (det == SubDetId::kFGD2 || det == SubDetId::kFGD){
200 IDs[ngroups++] = EventBoxTracker::kTracksWithTPCInFGD2FV;
202 if (det == SubDetId::kFGD2 || det == SubDetId::kFGD){
203 IDs[ngroups++] = EventBoxTracker::kTracksWithTPCInP0DFV;
Int_t _index
The index of this systematic (needed by SystematicsManager);.
bool GetVariation(const AnaTPCParticleB &tpcTrack, Float_t &mean_var, Float_t &sigma_var, const AnaTrackB &track, const ToyExperiment &toy)
Get the variation for a given TPC object.
Float_t * Variations
the vector of Variations, one for each of the systematic parameters
int GetParameterI(std::string)
Get parameter. Value is returned as integer.
virtual void ApplyVariation(AnaTrackB *track, const ToyExperiment &exp)
Apply variation for a track, the most general case given a certain ToyExperiment. ...
SystBoxB * GetSystBox(const AnaEventC &event, Int_t isel=0, Int_t ibranch=0) const
Get the SystBox corresponding to a selection, branch and event.
void SetNParameters(int N)
Set the number of systematic parameters associated to this systematic.
AnaTrueObjectC * TrueObject
The link to the true oject that most likely generated this reconstructed object.
bool IsRelevantRecObject(const AnaEventC &event, const AnaRecObjectC &track) const
Is this track relevant for this systematic ?
BinnedParams * _mean[kNPULLS]
Int_t GetRelevantRecObjectGroups(const SelectionBase &sel, Int_t *IDs) const
Get the TrackGroup IDs array for this systematic.
HypEnum
Enum for particle hypothesis.
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
Representation of a true Monte Carlo trajectory/particle.
const AnaParticleB * Original
Int_t PDG
The PDG code of this particle.
bool UndoSystematic(AnaEventC &event)
Undo the systematic variations done by ApplyVariation. This is faster tha reseting the full Spill...
Float_t dEdxMeas
dE/dx as measured by the TPC.
Representation of a global track.
Representation of a TPC segment of a global track.
ToyVariations * GetToyVariations(UInt_t index) const
returns the variations for a given systematic (index)
virtual void Apply(const ToyExperiment &toy, AnaEventC &event)
Apply the systematic.
UInt_t GetNBranches() const
Return the number of branches.
bool _full_correlations
value of psycheSystematics.Tracker.FullCorrelations parameter
static int GetTPC(unsigned long BitField)
Int_t nRelevantRecObjects
----—— Relevant rec objects and true objects for each systematic ------------—— ...
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
Int_t GetNBins()
Get the number of bins.
SubDetId_h GetDetectorFV(Int_t ibranch=0) const
Get the detector in which the Fiducial Volume is defined.