BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnParticleEqualizer2D Class Reference

#include <BmnParticleEqualizer2D.h>

Inheritance diagram for BmnParticleEqualizer2D:
Collaboration diagram for BmnParticleEqualizer2D:

Classes

struct  stParticleInfo

Public Types

enum  { kAddedParticleBit = BIT(14) }
 Status bit the generator sets on every particle it adds. More...
enum  { kAddedParticleBit = BIT(14) }
 Status bit the generator sets on every particle it adds. More...

Public Member Functions

 BmnParticleEqualizer2D (TString hist_file_name)
 Constructor with input histograms.
 BmnParticleEqualizer2D (TString hist_file_name, vector< Int_t > pdg_codes, Double_t min_p=0.0, Double_t max_p=4.0, Int_t intervals=20)
 Constructor with given PDG codes for particles to be equalized.
virtual ~BmnParticleEqualizer2D ()
 Destructor.
Bool_t Init ()
 Initializer.
virtual Bool_t ReadEvent (FairPrimaryGenerator *primGen)
 Creates an event with equal number of particles at all momentum intervals.
void SetTargetPerInterval (Double_t target)
 Set the target number of the particles of every type to be reached in every momentum interval of an event.
Bool_t SetSampleStatisticsCutRebin (Int_t factor)
 Set how much the two dimensional sample histograms are rebinned for the filtering of the event particles by the sample statistics (see SetSampleStatisticsCut).
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 by default).
void SetSampleStatisticsCut (Bool_t is_used)
 Switch the filtering of the event particles by the sample statistics on or off (on by default).
 BmnParticleEqualizer2D (TString hist_file_name)
 Constructor with input histograms.
 BmnParticleEqualizer2D (TString hist_file_name, vector< Int_t > pdg_codes, Double_t min_p=0.0, Double_t max_p=4.0, Int_t intervals=20)
 Constructor with given PDG codes for particles to be equalized.
virtual ~BmnParticleEqualizer2D ()
 Destructor.
Bool_t Init ()
 Initializer.
virtual Bool_t ReadEvent (FairPrimaryGenerator *primGen)
 Creates an event with equal number of particles at all momentum intervals.
void SetTargetPerInterval (Double_t target)
 Set the target number of the particles of every type to be reached in every momentum interval of an event.
Bool_t SetSampleStatisticsCutRebin (Int_t factor)
 Set how much the two dimensional sample histograms are rebinned for the filtering of the event particles by the sample statistics (see SetSampleStatisticsCut).
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 by default).
void SetSampleStatisticsCut (Bool_t is_used)
 Switch the filtering of the event particles by the sample statistics on or off (on by default).

Static Public Member Functions

static void SetSampleTrackCut (Int_t track_cut)
 Set the cut applied to the tracks of the sample while producing the sample histograms (and while drawing the resulting distributions by ShowResultDistributions): 0 - all the primary particles are taken, 1 - the tracks without points in Silicon and GEM detectors are excluded, 2 (default) - the tracks without points in Silicon, GEM and ToF detectors are excluded.
static int ProduceEfficiencyMap (TString input_list_file, TString histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
static int ProduceAcceptanceMap (TString input_list_file, TString histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
static int ProduceSampleHistograms (TString input_list_file, TString output_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
static int FitPHistogram (unique_ptr< TH1D > &hP, int pdg_key, Double_t p_min, Double_t p_max)
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)
static int FitYHistogram (unique_ptr< TH1D > &hY, int pdg_key, Double_t &y0_output, Double_t &sigma_putput)
static int FitEtaHistogram (unique_ptr< TH1D > &hEta, int pdg_key, Double_t eta_min, Double_t eta_max)
static void FitSampleHistograms (TString input_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
 additional functions to check results of fitting and particle equalizing
static int ShowSampleHistograms (TString input_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
static int ShowResultDistributions (TString input_list_file)
static void SetSampleTrackCut (Int_t track_cut)
 Set the cut applied to the tracks of the sample while producing the sample histograms (and while drawing the resulting distributions by ShowResultDistributions): 0 - all the primary particles are taken, 1 - the tracks without points in Silicon and GEM detectors are excluded, 2 (default) - the tracks without points in Silicon, GEM and ToF detectors are excluded.
static int ProduceEfficiencyMap (TString input_list_file, TString histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
static int ProduceAcceptanceMap (TString input_list_file, TString histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
static int ProduceSampleHistograms (TString input_list_file, TString output_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
static int FitPHistogram (unique_ptr< TH1D > &hP, int pdg_key, Double_t p_min, Double_t p_max)
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)
static int FitYHistogram (unique_ptr< TH1D > &hY, int pdg_key, Double_t &y0_output, Double_t &sigma_putput)
static int FitEtaHistogram (unique_ptr< TH1D > &hEta, int pdg_key, Double_t eta_min, Double_t eta_max)
static void FitSampleHistograms (TString input_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
 additional functions to check results of fitting and particle equalizing
static int ShowSampleHistograms (TString input_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
static int ShowResultDistributions (TString input_list_file)

Private Member Functions

Bool_t ReadSampleHistograms (TString input_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
Bool_t BuildStatisticsCutHistograms ()
Bool_t ReadSampleHistograms (TString input_histo_file="$VMCWORKDIR/macro/recotools/particle_hists.root")
Bool_t BuildStatisticsCutHistograms ()

Static Private Member Functions

static Bool_t CheckMomentumGrid (TFile *hist_file)
static Bool_t GetConditionalRandomY (const TH2D *hist, Double_t x, Double_t &y)
static Int_t GetPDGCodeByMass (Double_t mass, Double_t tolerance=1.e-6, const vector< int > &vecParticlePDG={})
static Int_t GetGlobalTrackPDG (BmnGlobalTrack *global_track, BmnTrackMatch *global_match, TClonesArray *mc_tracks, Double_t &tof_mass)
static Bool_t CheckMomentumGrid (TFile *hist_file)
static Bool_t GetConditionalRandomY (const TH2D *hist, Double_t x, Double_t &y)
static Int_t GetPDGCodeByMass (Double_t mass, Double_t tolerance=1.e-6, const vector< int > &vecParticlePDG={})
static Int_t GetGlobalTrackPDG (BmnGlobalTrack *global_track, BmnTrackMatch *global_match, TClonesArray *mc_tracks, Double_t &tof_mass)

Private Attributes

Double_t fTargetPerInterval
Bool_t fUseEfficiencyCorrection
 Target particle number per interval, 0 = maximum of the event (see the setter).
Double_t fMinEfficiency
 Whether the added particle number is corrected by the efficiency.
Int_t fSampleStatisticsCutRebin
 Lower limit of the efficiency used for the correction.
Bool_t fIsEfficiencyMapRead
 Rebin factor of the histograms used to filter the particles of an event.
Bool_t fUseSampleStatisticsCut
 Whether the efficiency map has been found in the sample histogram file.
Double_t fIntervalStep
Bool_t isActive
 Interval step.
map< Int_t, unique_ptr< stParticleInfo > > fParticleInfos
vector< int > fMaxParticles

Static Private Attributes

static Int_t fSampleTrackCut = 2
 Cut applied to the tracks of the sample (see SetSampleTrackCut).
static Double_t fPMin = 0.4
 Min value of momentum.
static Double_t fPMax = 5.4
 Max value of momentum.
static Int_t fIntervalCount = 25
 Interval count for momentum to equalize particles at all the intervals.
static vector< Int_t > fParticles

Detailed Description

Definition at line 39 of file BmnParticleEqualizer2D.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

TObject keeps the bits 0-13 of fBits for itself, so 14 is the first one free for the user. CbmMCTrack copies these bits from TParticle, so the mark reaches the reconstructed (DST) data and the added particles can be told there from the ones of the physics generators: mc_track->TestBit(kAddedParticleBit)

Enumerator
kAddedParticleBit BIT(14) 

Definition at line 130 of file BmnParticleEqualizer2D.h.

◆ anonymous enum

anonymous enum

TObject keeps the bits 0-13 of fBits for itself, so 14 is the first one free for the user. CbmMCTrack copies these bits from TParticle, so the mark reaches the reconstructed (DST) data and the added particles can be told there from the ones of the physics generators: mc_track->TestBit(kAddedParticleBit)

Enumerator
kAddedParticleBit BIT(14) 

Definition at line 130 of file BmnParticleEqualizer2D.h.

Constructor & Destructor Documentation

◆ BmnParticleEqualizer2D() [1/4]

BmnParticleEqualizer2D::BmnParticleEqualizer2D ( TString hist_file_name)

Definition at line 105 of file BmnParticleEqualizer2D.cxx.

References fIntervalCount, fIntervalStep, fIsEfficiencyMapRead, fMaxParticles, fMinEfficiency, fParticleInfos, fParticles, fPMax, fPMin, fSampleStatisticsCutRebin, fTargetPerInterval, fUseEfficiencyCorrection, fUseSampleStatisticsCut, isActive, kSampleStatisticsCutRebin, and ReadSampleHistograms().

Referenced by GetGlobalTrackPDG().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BmnParticleEqualizer2D() [2/4]

BmnParticleEqualizer2D::BmnParticleEqualizer2D ( TString hist_file_name,
vector< Int_t > pdg_codes,
Double_t min_p = 0.0,
Double_t max_p = 4.0,
Int_t intervals = 20 )
Parameters
pdg_codesParticles to be equalized (PDG codes)
min_pMin value of momentum value
max_pMax value of momentum value
intervalsInterval count for momentum values to equalize particles at all the intervals independently

Definition at line 130 of file BmnParticleEqualizer2D.cxx.

References fIntervalCount, fIntervalStep, fIsEfficiencyMapRead, fMaxParticles, fMinEfficiency, fParticleInfos, fParticles, fPMax, fPMin, fSampleStatisticsCutRebin, fTargetPerInterval, fUseEfficiencyCorrection, fUseSampleStatisticsCut, isActive, kSampleStatisticsCutRebin, and ReadSampleHistograms().

Here is the call graph for this function:

◆ ~BmnParticleEqualizer2D() [1/2]

virtual BmnParticleEqualizer2D::~BmnParticleEqualizer2D ( )
inlinevirtual

Definition at line 57 of file BmnParticleEqualizer2D.h.

◆ BmnParticleEqualizer2D() [3/4]

BmnParticleEqualizer2D::BmnParticleEqualizer2D ( TString hist_file_name)

◆ BmnParticleEqualizer2D() [4/4]

BmnParticleEqualizer2D::BmnParticleEqualizer2D ( TString hist_file_name,
vector< Int_t > pdg_codes,
Double_t min_p = 0.0,
Double_t max_p = 4.0,
Int_t intervals = 20 )
Parameters
pdg_codesParticles to be equalized (PDG codes)
min_pMin value of momentum value
max_pMax value of momentum value
intervalsInterval count for momentum values to equalize particles at all the intervals independently

◆ ~BmnParticleEqualizer2D() [2/2]

virtual BmnParticleEqualizer2D::~BmnParticleEqualizer2D ( )
inlinevirtual

Definition at line 57 of file BmnParticleEqualizer2D.h.

Member Function Documentation

◆ BuildStatisticsCutHistograms() [1/2]

Bool_t BmnParticleEqualizer2D::BuildStatisticsCutHistograms ( )
private

Definition at line 777 of file BmnParticleEqualizer2D.cxx.

References fIntervalCount, TString::Format(), fParticleInfos, fParticles, and fSampleStatisticsCutRebin.

Referenced by ReadSampleHistograms(), and SetSampleStatisticsCutRebin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildStatisticsCutHistograms() [2/2]

Bool_t BmnParticleEqualizer2D::BuildStatisticsCutHistograms ( )
private

◆ CheckMomentumGrid() [1/2]

Bool_t BmnParticleEqualizer2D::CheckMomentumGrid ( TFile * hist_file)
staticprivate

Definition at line 826 of file BmnParticleEqualizer2D.cxx.

References TMath::AreEqualAbs(), fIntervalCount, TString::Format(), fPMax, fPMin, TDirectoryFile::Get(), TNamed::GetName(), TFile::IsOpen(), kMomentumGridName, kMomentumGridSize, and TMath::Nint().

Referenced by ProduceAcceptanceMap(), ProduceEfficiencyMap(), and ReadSampleHistograms().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckMomentumGrid() [2/2]

Bool_t BmnParticleEqualizer2D::CheckMomentumGrid ( TFile * hist_file)
staticprivate

◆ FitEtaHistogram() [1/2]

int BmnParticleEqualizer2D::FitEtaHistogram ( unique_ptr< TH1D > & hEta,
int pdg_key,
Double_t eta_min,
Double_t eta_max )
static

Definition at line 384 of file BmnParticleEqualizer2D.cxx.

References TString::Format(), ROOT::Fit::FitResult::IsValid(), TF1::SetParameter(), and TF1::SetParLimits().

Here is the call graph for this function:

◆ FitEtaHistogram() [2/2]

int BmnParticleEqualizer2D::FitEtaHistogram ( unique_ptr< TH1D > & hEta,
int pdg_key,
Double_t eta_min,
Double_t eta_max )
static

◆ FitPHistogram() [1/2]

int BmnParticleEqualizer2D::FitPHistogram ( unique_ptr< TH1D > & hP,
int pdg_key,
Double_t p_min,
Double_t p_max )
static

Definition at line 270 of file BmnParticleEqualizer2D.cxx.

References FitMomentumFunction(), and TString::Format().

Referenced by ProduceSampleHistograms(), and ReadSampleHistograms().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FitPHistogram() [2/2]

int BmnParticleEqualizer2D::FitPHistogram ( unique_ptr< TH1D > & hP,
int pdg_key,
Double_t p_min,
Double_t p_max )
static

◆ FitPtHistogram() [1/2]

int BmnParticleEqualizer2D::FitPtHistogram ( unique_ptr< TH1D > & hPt,
int pdg_key,
Double_t pdg_mass,
Double_t pt_min,
Double_t pt_max,
Double_t & t_output )
static

Definition at line 287 of file BmnParticleEqualizer2D.cxx.

References TString::Format(), ROOT::Fit::FitResult::IsValid(), ROOT::Fit::FitResult::Parameter(), TF1::SetParameter(), and TF1::SetParLimits().

Referenced by ProduceSampleHistograms().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FitPtHistogram() [2/2]

int BmnParticleEqualizer2D::FitPtHistogram ( unique_ptr< TH1D > & hPt,
int pdg_key,
Double_t pdg_mass,
Double_t pt_min,
Double_t pt_max,
Double_t & t_output )
static

◆ FitSampleHistograms() [1/2]

void BmnParticleEqualizer2D::FitSampleHistograms ( TString input_histo_file = "$VMCWORKDIR/macro/recotools/particle_hists.root")
static

Definition at line 1651 of file BmnParticleEqualizer2D.cxx.

References TH1::Draw(), f, FitMomentumFunction(), TString::Format(), fParticles, fPMax, fPMin, TAxis::GetBinCenter(), TH1::GetBinContent(), TH1::GetFunction(), TH1::GetMaximumBin(), TH1::GetXaxis(), TF1::kNotDraw, TFile::Open(), and TObject::ResetBit().

Here is the call graph for this function:

◆ FitSampleHistograms() [2/2]

void BmnParticleEqualizer2D::FitSampleHistograms ( TString input_histo_file = "$VMCWORKDIR/macro/recotools/particle_hists.root")
static

◆ FitYHistogram() [1/2]

int BmnParticleEqualizer2D::FitYHistogram ( unique_ptr< TH1D > & hY,
int pdg_key,
Double_t & y0_output,
Double_t & sigma_putput )
static

Definition at line 323 of file BmnParticleEqualizer2D.cxx.

References ROOT::Math::MinimizerOptions::DefaultMinimizerType(), TString::Format(), ROOT::Fit::FitResult::Index(), ROOT::Fit::FitResult::Parameter(), and ROOT::Math::MinimizerOptions::SetDefaultMinimizer().

Referenced by ProduceSampleHistograms().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FitYHistogram() [2/2]

int BmnParticleEqualizer2D::FitYHistogram ( unique_ptr< TH1D > & hY,
int pdg_key,
Double_t & y0_output,
Double_t & sigma_putput )
static

◆ GetConditionalRandomY() [1/2]

Bool_t BmnParticleEqualizer2D::GetConditionalRandomY ( const TH2D * hist,
Double_t x,
Double_t & y )
staticprivate

Definition at line 1607 of file BmnParticleEqualizer2D.cxx.

References TAxis::FindBin(), TH2::GetBinContent(), TAxis::GetBinLowEdge(), TAxis::GetBinUpEdge(), TAxis::GetBinWidth(), TH1::GetNbinsX(), TH1::GetNbinsY(), TH1::GetXaxis(), TH1::GetYaxis(), TMath::Max(), TMath::Min(), x, and y.

Referenced by ReadEvent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetConditionalRandomY() [2/2]

Bool_t BmnParticleEqualizer2D::GetConditionalRandomY ( const TH2D * hist,
Double_t x,
Double_t & y )
staticprivate

References x, and y.

◆ GetGlobalTrackPDG() [1/2]

Int_t BmnParticleEqualizer2D::GetGlobalTrackPDG ( BmnGlobalTrack * global_track,
BmnTrackMatch * global_match,
TClonesArray * mc_tracks,
Double_t & tof_mass )
staticprivate

Definition at line 1750 of file BmnParticleEqualizer2D.cxx.

References TParticlePDG::Charge(), fParticles, TObjArray::GetEntriesFast(), BmnLink::GetIndex(), BmnGlobalTrack::GetMass2(), BmnMatch::GetMatchedLink(), BmnMatch::GetNofLinks(), BmnTrack::GetParamFirst(), TDatabasePDG::GetParticle(), CbmMCTrack::GetPdgCode(), GetPDGCodeByMass(), BmnGlobalTrack::GetRefIndex(), TDatabasePDG::Instance(), TMath::Sqrt(), and TObjArray::UncheckedAt().

Referenced by ProduceEfficiencyMap(), and ShowResultDistributions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGlobalTrackPDG() [2/2]

Int_t BmnParticleEqualizer2D::GetGlobalTrackPDG ( BmnGlobalTrack * global_track,
BmnTrackMatch * global_match,
TClonesArray * mc_tracks,
Double_t & tof_mass )
staticprivate

References BmnParticleEqualizer2D().

Here is the call graph for this function:

◆ GetPDGCodeByMass() [1/2]

Int_t BmnParticleEqualizer2D::GetPDGCodeByMass ( Double_t mass,
Double_t tolerance = 1.e-6,
const vector< int > & vecParticlePDG = {} )
staticprivate

Definition at line 1719 of file BmnParticleEqualizer2D.cxx.

References TMath::Abs(), TDatabasePDG::GetParticle(), TDatabasePDG::Instance(), TParticlePDG::Mass(), TDatabasePDG::ParticleList(), and TParticlePDG::PdgCode().

Referenced by GetGlobalTrackPDG().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPDGCodeByMass() [2/2]

Int_t BmnParticleEqualizer2D::GetPDGCodeByMass ( Double_t mass,
Double_t tolerance = 1.e-6,
const vector< int > & vecParticlePDG = {} )
staticprivate

◆ Init() [1/2]

Bool_t BmnParticleEqualizer2D::Init ( )

Definition at line 177 of file BmnParticleEqualizer2D.cxx.

◆ Init() [2/2]

Bool_t BmnParticleEqualizer2D::Init ( )

◆ ProduceAcceptanceMap() [1/2]

◆ ProduceAcceptanceMap() [2/2]

int BmnParticleEqualizer2D::ProduceAcceptanceMap ( TString input_list_file,
TString histo_file = "$VMCWORKDIR/macro/recotools/particle_hists.root" )
static

◆ ProduceEfficiencyMap() [1/2]

int BmnParticleEqualizer2D::ProduceEfficiencyMap ( TString input_list_file,
TString histo_file = "$VMCWORKDIR/macro/recotools/particle_hists.root" )
static

◆ ProduceEfficiencyMap() [2/2]

int BmnParticleEqualizer2D::ProduceEfficiencyMap ( TString input_list_file,
TString histo_file = "$VMCWORKDIR/macro/recotools/particle_hists.root" )
static

◆ ProduceSampleHistograms() [1/2]

◆ ProduceSampleHistograms() [2/2]

int BmnParticleEqualizer2D::ProduceSampleHistograms ( TString input_list_file,
TString output_histo_file = "$VMCWORKDIR/macro/recotools/particle_hists.root" )
static

◆ ReadEvent() [1/2]

◆ ReadEvent() [2/2]

virtual Bool_t BmnParticleEqualizer2D::ReadEvent ( FairPrimaryGenerator * primGen)
virtual
Parameters
primGenpointer to the FairPrimaryGenerator

◆ ReadSampleHistograms() [1/2]

Bool_t BmnParticleEqualizer2D::ReadSampleHistograms ( TString input_histo_file = "$VMCWORKDIR/macro/recotools/particle_hists.root")
private

Definition at line 1153 of file BmnParticleEqualizer2D.cxx.

References BuildStatisticsCutHistograms(), CheckMomentumGrid(), TFile::Close(), efficiency(), fIntervalCount, fIntervalStep, fIsEfficiencyMapRead, FitPHistogram(), TString::Format(), fParticleInfos, fParticles, fPMax, fPMin, TDirectoryFile::Get(), TF1::GetMaximum(), TF1::GetNpx(), TDatabasePDG::Instance(), TObject::IsZombie(), kEfficiencyNamePrefix, BmnParticleEqualizer2D::stParticleInfo::kFitFunction, BmnParticleEqualizer2D::stParticleInfo::kIntervalHist, BmnParticleEqualizer2D::stParticleInfo::kNone, TMath::Max(), TFile::Open(), and TF1::SetNpx().

Referenced by BmnParticleEqualizer2D(), and BmnParticleEqualizer2D().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadSampleHistograms() [2/2]

Bool_t BmnParticleEqualizer2D::ReadSampleHistograms ( TString input_histo_file = "$VMCWORKDIR/macro/recotools/particle_hists.root")
private

◆ SetEfficiencyCorrection() [1/2]

Bool_t BmnParticleEqualizer2D::SetEfficiencyCorrection ( Bool_t is_used,
Double_t min_efficiency = 0.05 )

The efficiency map has to be present in the file with the sample histograms, see ProduceEfficiencyMap. When it is on, the number of the particles added to an interval is divided by the relative efficiency of that interval, compensating for the added particles lost at the reconstruction. 'min_efficiency' limits the resulting factor: the intervals with a lower efficiency are corrected as if it were equal to it

Definition at line 736 of file BmnParticleEqualizer2D.cxx.

References fIsEfficiencyMapRead, fMinEfficiency, and fUseEfficiencyCorrection.

◆ SetEfficiencyCorrection() [2/2]

Bool_t BmnParticleEqualizer2D::SetEfficiencyCorrection ( Bool_t is_used,
Double_t min_efficiency = 0.05 )

The efficiency map has to be present in the file with the sample histograms, see ProduceEfficiencyMap. When it is on, the number of the particles added to an interval is divided by the relative efficiency of that interval, compensating for the added particles lost at the reconstruction. 'min_efficiency' limits the resulting factor: the intervals with a lower efficiency are corrected as if it were equal to it

◆ SetSampleStatisticsCut() [1/2]

void BmnParticleEqualizer2D::SetSampleStatisticsCut ( Bool_t is_used)
inline

When it is on, the particles of the event lying in the phase space regions where the sample histograms are empty are not counted: the generator cannot add such particles back, so counting them would leave the numbers unequalized

Definition at line 171 of file BmnParticleEqualizer2D.h.

References fUseSampleStatisticsCut.

◆ SetSampleStatisticsCut() [2/2]

void BmnParticleEqualizer2D::SetSampleStatisticsCut ( Bool_t is_used)
inline

When it is on, the particles of the event lying in the phase space regions where the sample histograms are empty are not counted: the generator cannot add such particles back, so counting them would leave the numbers unequalized

Definition at line 171 of file BmnParticleEqualizer2D.h.

References fUseSampleStatisticsCut.

◆ SetSampleStatisticsCutRebin() [1/2]

Bool_t BmnParticleEqualizer2D::SetSampleStatisticsCutRebin ( Int_t factor)

The filtering asks whether the sample has at least one entry in the cell a particle of the event falls into, so with the fine binning needed for a good sampling it becomes the more severe the smaller the sample is: measured on a sample of 100 tracks per momentum interval it discards about a half of the particles. The rebinned copies decouple the granularity of the filtering from the one of the sampling: the particles are still sampled from the full histograms, only the filtering uses the coarse ones. The factor has to divide the number of the bins of both axes; 1 makes the filtering use the full binning. Returns kFALSE (and keeps the previous value) if the factor cannot be applied

Definition at line 756 of file BmnParticleEqualizer2D.cxx.

References BuildStatisticsCutHistograms(), and fSampleStatisticsCutRebin.

Here is the call graph for this function:

◆ SetSampleStatisticsCutRebin() [2/2]

Bool_t BmnParticleEqualizer2D::SetSampleStatisticsCutRebin ( Int_t factor)

The filtering asks whether the sample has at least one entry in the cell a particle of the event falls into, so with the fine binning needed for a good sampling it becomes the more severe the smaller the sample is: measured on a sample of 100 tracks per momentum interval it discards about a half of the particles. The rebinned copies decouple the granularity of the filtering from the one of the sampling: the particles are still sampled from the full histograms, only the filtering uses the coarse ones. The factor has to divide the number of the bins of both axes; 1 makes the filtering use the full binning. Returns kFALSE (and keeps the previous value) if the factor cannot be applied

◆ SetSampleTrackCut() [1/2]

void BmnParticleEqualizer2D::SetSampleTrackCut ( Int_t track_cut)
inlinestatic

It defines the acceptance the sample histograms correspond to, so it has to be set before ProduceSampleHistograms() and cannot be changed for an already produced file. The reconstructed tracks counted by ShowResultDistributions and ProduceEfficiencyMap are selected in the same acceptance: the cut 2 requires a ToF hit matched to the track

Definition at line 167 of file BmnParticleEqualizer2D.h.

References fSampleTrackCut.

◆ SetSampleTrackCut() [2/2]

void BmnParticleEqualizer2D::SetSampleTrackCut ( Int_t track_cut)
inlinestatic

It defines the acceptance the sample histograms correspond to, so it has to be set before ProduceSampleHistograms() and cannot be changed for an already produced file. The reconstructed tracks counted by ShowResultDistributions and ProduceEfficiencyMap are selected in the same acceptance: the cut 2 requires a ToF hit matched to the track

Definition at line 167 of file BmnParticleEqualizer2D.h.

References fSampleTrackCut.

◆ SetTargetPerInterval() [1/2]

void BmnParticleEqualizer2D::SetTargetPerInterval ( Double_t target)
inline

Zero (default) keeps the original behaviour: the target of an interval is the maximum number among the particle types found in that interval of that event, so the numbers are equalized between the types but the momentum spectrum stays the one of the input events. A positive value makes the target the same for all the intervals and all the types, which gives a flat distribution both in the particle type and in the momentum - what is usually needed to train a PID. The value may be fractional (and normally is: it is the number of particles per event per interval, i.e. the wanted sample size divided by the number of events and by the number of intervals), the parts below one particle are accumulated between the events

Definition at line 143 of file BmnParticleEqualizer2D.h.

References fTargetPerInterval.

◆ SetTargetPerInterval() [2/2]

void BmnParticleEqualizer2D::SetTargetPerInterval ( Double_t target)
inline

Zero (default) keeps the original behaviour: the target of an interval is the maximum number among the particle types found in that interval of that event, so the numbers are equalized between the types but the momentum spectrum stays the one of the input events. A positive value makes the target the same for all the intervals and all the types, which gives a flat distribution both in the particle type and in the momentum - what is usually needed to train a PID. The value may be fractional (and normally is: it is the number of particles per event per interval, i.e. the wanted sample size divided by the number of events and by the number of intervals), the parts below one particle are accumulated between the events

Definition at line 143 of file BmnParticleEqualizer2D.h.

References fTargetPerInterval.

◆ ShowResultDistributions() [1/2]

int BmnParticleEqualizer2D::ShowResultDistributions ( TString input_list_file)
static

Definition at line 1808 of file BmnParticleEqualizer2D.cxx.

References TMath::Abs(), TChain::Add(), TLegend::AddEntry(), TObjArray::At(), TMath::ATan(), TMath::ATan2(), TCanvas::cd(), TAxis::CenterTitle(), TString::Data(), TPad::Divide(), TLegend::Draw(), TVirtualPad::Draw(), fEtaMax, fEtaMin, fIntervalCount, TString::Format(), fParticles, fPhiMax, fPhiMin, fPMax, fPMin, fPtMax, fPtMin, fSampleTrackCut, fThetaMax, fThetaMin, fYMax, fYMin, TChain::GetBranch(), TChain::GetEntries(), TObjArray::GetEntries(), TChain::GetEntry(), GetGlobalTrackPDG(), BmnMCInfoDst::GetMCTracks(), CbmMCTrack::GetMotherId(), CbmMCTrack::GetNPoints(), CbmMCTrack::GetP(), BmnTrack::GetParamFirst(), TDatabasePDG::GetParticle(), CbmMCTrack::GetPdgCode(), CbmMCTrack::GetPt(), CbmMCTrack::GetPx(), CbmMCTrack::GetPy(), CbmMCTrack::GetPz(), CbmMCTrack::GetRapidity(), BmnGlobalTrack::GetTof1HitIndex(), BmnGlobalTrack::GetTof2HitIndex(), TH1::GetXaxis(), TH1::GetYaxis(), TDatabasePDG::Instance(), kGEM, kSILICON, kTOF, kTOF1, TH1::LabelsDeflate(), TMath::Log(), TParticlePDG::Mass(), TH1::SetBarOffset(), TH1::SetBarWidth(), TChain::SetBranchAddress(), TAttFill::SetFillColor(), TH1::SetLabelFont(), TAttAxis::SetLabelSize(), TAttMarker::SetMarkerSize(), TAttAxis::SetNdivisions(), TH1::SetStats(), TH1::SetTitle(), TNamed::SetTitle(), TAttAxis::SetTitleSize(), TMath::Sqrt(), TVector3::x(), TVector3::y(), and TVector3::z().

Here is the call graph for this function:

◆ ShowResultDistributions() [2/2]

◆ ShowSampleHistograms() [1/2]

int BmnParticleEqualizer2D::ShowSampleHistograms ( TString input_histo_file = "$VMCWORKDIR/macro/recotools/particle_hists.root")
static

Definition at line 1686 of file BmnParticleEqualizer2D.cxx.

References TF1::Draw(), TH1::Draw(), f, TString::Format(), fParticles, TH1::GetFunction(), and TFile::Open().

Here is the call graph for this function:

◆ ShowSampleHistograms() [2/2]

int BmnParticleEqualizer2D::ShowSampleHistograms ( TString input_histo_file = "$VMCWORKDIR/macro/recotools/particle_hists.root")
static

Member Data Documentation

◆ fIntervalCount

◆ fIntervalStep

Double_t BmnParticleEqualizer2D::fIntervalStep
private

◆ fIsEfficiencyMapRead

Bool_t BmnParticleEqualizer2D::fIsEfficiencyMapRead
private

◆ fMaxParticles

vector< int > BmnParticleEqualizer2D::fMaxParticles
private

◆ fMinEfficiency

Double_t BmnParticleEqualizer2D::fMinEfficiency
private

◆ fParticleInfos

map< Int_t, unique_ptr< stParticleInfo > > BmnParticleEqualizer2D::fParticleInfos
private

◆ fParticles

◆ fPMax

Double_t BmnParticleEqualizer2D::fPMax = 5.4
staticprivate

◆ fPMin

◆ fSampleStatisticsCutRebin

Int_t BmnParticleEqualizer2D::fSampleStatisticsCutRebin
private

◆ fSampleTrackCut

Int_t BmnParticleEqualizer2D::fSampleTrackCut = 2
staticprivate

◆ fTargetPerInterval

Double_t BmnParticleEqualizer2D::fTargetPerInterval
private

◆ fUseEfficiencyCorrection

Bool_t BmnParticleEqualizer2D::fUseEfficiencyCorrection
private

◆ fUseSampleStatisticsCut

Bool_t BmnParticleEqualizer2D::fUseSampleStatisticsCut
private

Whether the particles of the event are filtered by the sample statistics (see SetSampleStatisticsCut)

Definition at line 234 of file BmnParticleEqualizer2D.h.

Referenced by BmnParticleEqualizer2D(), BmnParticleEqualizer2D(), ReadEvent(), SetSampleStatisticsCut(), and ShowResultDistributions().

◆ isActive

Bool_t BmnParticleEqualizer2D::isActive
private

The documentation for this class was generated from the following files: