1 #include "P0DELossResolSystematics.hxx" 2 #include "ND280AnalysisUtils.hxx" 3 #include "BaseDataClasses.hxx" 4 #include "EventBoxTracker.hxx" 7 const bool debug =
false;
18 sprintf(dirname,
"%s/data",getenv(
"PSYCHESYSTEMATICSROOT"));
23 for (
int i = 0 ; i <
GetNBins(); i++)
27 std::cout<<
"Mean, sigma = "<<mean<<
" "<<sigma<<std::endl;
48 std::cout <<
"P0DELossResolsystematics::Apply()"<<std::endl;
55 std::cout <<
"Track "<< itrk << std::endl;
69 Float_t p0dlength = p0d->Length;
70 Float_t p0dEloss = p0d->ELoss;
76 Float_t trueP0dEloss = trueMomentum - postP0DMomentum;
78 Float_t scale, scaleError;
81 if (p0dEloss > p)
continue;
86 std::cout <<
"p0 = " << p << std::endl;
88 std::cout <<
"P0D Length: "<<p0dlength<<std::endl;
89 std::cout <<
"True P0D loss: "<<trueP0dEloss<<std::endl;
90 std::cout <<
"P0D Loss: "<<p0dEloss<<std::endl;
99 std::cout <<
"Bin values retrieved"<<std::endl;
100 std::cout <<
"Scale = "<<scale<<
" Scale Err = " <<scaleError<<std::endl;
106 std::cout <<
"p = " << p << std::endl;
138 if (det == SubDetId::kP0D){
139 IDs[0] = EventBoxTracker::kTracksWithTPCInP0DFV;
Int_t _index
The index of this systematic (needed by SystematicsManager);.
virtual void Apply(const ToyExperiment &toy, AnaEventC &event)
Apply the systematic.
int nP0DSegments
How many P0D tracks are associated with this track.
const AnaTrackB * GetOriginalTrack() const
Return a casted version of the original AnaParticleB associated.
AnaP0DParticleB * P0DSegments[NMAXP0DS]
The P0D segments that contributed to this global track.
Float_t * Variations
the vector of Variations, one for each of the systematic parameters
int nDetCrossings
The number of DetCrossing objects.
Int_t GetRelevantRecObjectGroups(const SelectionBase &sel, Int_t *IDs) const
Get the TrackGroup IDs array for this systematic.
P0DELossResolSystematics()
void SetType(TypeEnum type)
Set the type.
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 SetName(const std::string &name)
Set the name.
Float_t Momentum
The initial momentum of the true particle.
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.
const AnaParticleB * Original
Float_t EntrancePosition[4]
for each subdetector tell the entrance position
AnaDetCrossingB ** DetCrossings
Representation of a detector crossing info for a true particle (G4 trajectory).
void Read(const std::string &inputDirName, const std::string &extension="")
Read from a file the systematic source values.
Representation of a global track.
virtual bool UndoSystematic(AnaEventC &event)
Undo the systematic variations done by ApplyVariation. This is faster than resetting the full Spill...
ToyVariations * GetToyVariations(UInt_t index) const
returns the variations for a given systematic (index)
bool InDetVolume(SubDetId::SubDetEnum det, const Float_t *pos)
Int_t nRelevantRecObjects
----—— Relevant rec objects and true objects for each systematic ------------—— ...
bool GetParametersForBin(Int_t index, Float_t &mean, Float_t &sigma)
Gets the bin values for a source provided the bin index.
Representation of a P0D segment of a global track.
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.
Float_t EntranceMomentum[3]
for each subdetector tell the entrance momentum