28#ifndef BMNPARTICLEEQUALIZER1D_H
29#define BMNPARTICLEEQUALIZER1D_H
31#include "BmnGlobalTrack.h"
32#include "BmnTrackMatch.h"
33#include "FairGenerator.h"
34#include "FairPrimaryGenerator.h"
57 vector<Int_t> pdg_codes,
60 Int_t intervals = 20);
94 vector<unique_ptr<TH1D>>
96 vector<unique_ptr<TH1D>>
98 vector<unique_ptr<TH1D>>
169 TString histo_file =
"$VMCWORKDIR/macro/recotools/particle_hists.root");
174 TString output_histo_file =
"$VMCWORKDIR/macro/recotools/particle_hists.root");
#define ClassDef(name, id)
void SetSampleStatisticsCut(Bool_t is_used)
Switch the filtering of the event particles by the sample statistics on or off (on by default).
static int FitPHistogram(unique_ptr< TH1D > &hP, int pdg_key, Double_t p_min, Double_t p_max)
static void SetSampleTrackCut(Int_t track_cut)
Set the cut applied to the tracks of the sample while producing the sample histograms (and while draw...
static int ProduceEfficiencyMap(TString input_list_file, TString histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
Bool_t fUseSampleStatisticsCut
Whether the efficiency map has been found in the sample histogram file.
static Int_t GetPDGCodeByMass(Double_t mass, Double_t tolerance=1.e-6, const vector< int > &vecParticlePDG={})
static Int_t fSampleTrackCut
Cut applied to the tracks of the sample (see SetSampleTrackCut).
static int FitYHistogram(unique_ptr< TH1D > &hY, int pdg_key, Double_t &y0_output, Double_t &sigma_putput)
vector< int > fMaxParticles
Double_t fMinEfficiency
Whether the added particle number is corrected by the efficiency.
void SetTargetPerInterval(Double_t target)
Set the target number of the particles of every type to be reached in every momentum interval of an e...
static int ShowSampleHistograms(TString input_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
static Int_t GetGlobalTrackPDG(BmnGlobalTrack *global_track, BmnTrackMatch *global_match, TClonesArray *mc_tracks, Double_t &tof_mass)
static int ShowResultDistributions(TString input_list_file)
static Double_t fPMin
Min value of momentum.
Bool_t fUseEfficiencyCorrection
Target particle number per interval, 0 = maximum of the event (see the setter).
static Bool_t CheckMomentumGrid(TFile *hist_file)
Bool_t fIsEfficiencyMapRead
Lower limit of the efficiency used for the correction.
static void FitSampleHistograms(TString input_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
additional functions to check results of fitting and particle equalizing
static void DefineNearestFilledIntervals(const vector< unique_ptr< TH1D > > &hist_vector, vector< Int_t > &index_vector)
Double_t fTargetPerInterval
static int ProduceSampleHistograms(TString input_list_file, TString output_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
Bool_t ReadSampleHistograms(TString input_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
Bool_t SetEfficiencyCorrection(Bool_t is_used, Double_t min_efficiency=0.05)
Switch on the correction of the number of the added particles by the reconstruction efficiency (off b...
static int FitEtaHistogram(unique_ptr< TH1D > &hEta, int pdg_key, Double_t eta_min, Double_t eta_max)
static Int_t fIntervalCount
Interval count for momentum to equalize particles at all the intervals.
virtual ~BmnParticleEqualizer1D()
Destructor.
static Double_t fPMax
Max value of momentum.
static vector< Int_t > fParticles
Bool_t isActive
Interval step.
map< Int_t, unique_ptr< stParticleInfo > > fParticleInfos
Bool_t Init()
Initializer.
static int FitPtHistogram(unique_ptr< TH1D > &hPt, int pdg_key, Double_t pdg_mass, Double_t pt_min, Double_t pt_max, Double_t &t_output)
BmnParticleEqualizer1D(TString hist_file_name)
Constructor with input histograms.
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
Creates an event with equal number of particles at all momentum intervals.
vector< Double_t > fEfficiency
Relative reconstruction efficiency of the particle type, 1 for all the intervals if the efficiency ma...
unique_ptr< TH1D > fPhiHist
PDG -> Phi (azimuth angle) histogram (TH1D) for the particle type.
unique_ptr< TH1D > fThetaHist
PDG -> Theta (polar angle) histogram (TH1D) for the particle type.
Double_t fY0
Mean rapidity.
unique_ptr< TH1D > fEtaHist
PDG -> Eta (pseudorapidity) histogram (TH1D) for the particle type.
vector< EPSampling > fPSampling
Momentum sampling way for the particle type (divided by momentum intervals -> vector).
vector< Double_t > fParticleDebt
Part of the target number of the particles that has not been added yet, kept between the events so th...
stParticleInfo(int pdg_key, Double_t min_p, Double_t max_p, Int_t interval_count)
vector< unique_ptr< TH1D > > fEtaHistVector
Eta histograms for the particle type (divided by momentum intervals -> vector).
Double_t fT
Temperature in the P distribution.
unique_ptr< TH1D > fPtHist
PDG -> Pt histogram (TH1D) for the particle type.
vector< Int_t > fParticleNumber
PDG -> Particle Count (divided by momentum intervals -> vector).
Double_t fSigma
Sigma in the rapidity distribution.
vector< Int_t > fEtaHistIndex
Index of the momentum interval whose Eta histogram is used to sample the pseudorapidity for a given i...
EPSampling
Way the momentum of a new particle is sampled in a momentum interval.
@ kIntervalHist
from the P histogram of the interval itself (there is enough sample statistics)
@ kFitFunction
from the fitted function of the full P histogram (too little sample statistics)
unique_ptr< TH1D > fPHist
PDG -> P histogram (TH1D) for the particle type.
unique_ptr< TH1D > fYHist
PDG -> Y (rapidity) histogram (TH1D) for the particle type.
vector< unique_ptr< TH1D > > fPHistVector
P histograms for the particle type (divided by momentum intervals -> vector).
vector< Int_t > fPhiHistIndex
The same for the azimuth angle: index of the momentum interval whose Phi histogram is used.
vector< unique_ptr< TH1D > > fPhiHistVector
Phi histograms for the particle type (divided by momentum intervals -> vector).