hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
Loading...
Searching...
No Matches
ApOptimizationProcessor Class Reference

Cutflow optimization tool for A'. More...

#include <ApOptimizationProcessor.h>

Inheritance diagram for ApOptimizationProcessor:
OptimizationProcessor Processor

Public Member Functions

 ApOptimizationProcessor (const std::string &name, Process &process)
 ~ApOptimizationProcessor ()
virtual void configure (const ParameterSet &parameters)
 description
virtual void initialize (TTree *tree)
 description
virtual bool process (IEvent *event)
 description
virtual void finalize ()
 description
virtual bool process ()
 description
virtual void initialize (std::string inFilename, std::string outFilename)
 description
void determineSignalVertexEfficiencyXi ()
double computeTruthSignalShape (double z, double EAp)
double computePromptYield ()
double computeDisplacedYield (TH1 *h_chi_eff, double EAp)
std::vector< double > fitZBkgTail (TH1 *h_bkg_vtxz, std::string fitname)
double * getBinsAndLimits (json histo_cfg, std::string varname)
double getMassResolution (double mass)
std::string getHitCategoryCut ()
void initializeTestCutPDF (std::string cut_name, std::string cut_var, std::string persistent_cuts)
void initializeGraphs (std::string cut_name)
std::vector< std::pair< double, double > > getZoffsetAlpha (TH2F *h_y0_vs_z, int n_quantiles, int nbins)
double * getQuantileArray (std::pair< double, double > range, int n_quantiles, double initial_cut_frac=-999.9)
std::vector< double > findZcut (TH1 *h_bkg_vtxz_cut, bool fromTailFit, int iteration=0)
Public Member Functions inherited from OptimizationProcessor
 OptimizationProcessor (const std::string &name, Process &process)
 ~OptimizationProcessor ()
double calculateZBi (double n_on, double n_off, double tau)
 description
void writeGraph (TFile *outF, std::string folder, TGraph *g)
 description
void writeTH1F (TFile *outF, std::string folder, TH1F *h)
 description
Public Member Functions inherited from Processor
 Processor (const std::string &name, Process &process)
 Class constructor.
virtual ~Processor ()
virtual void setFile (TFile *outFile)
 Set output TFile for AnaProcessors.

Private Types

typedef std::map< std::string, std::pair< std::pair< double, double >, int > >::iterator cut_iter_

Private Attributes

std::string outFileName_ {"zbi_out.root"}
std::string variableHistCfgFilename_ {""}
bool scan_zcut_ = false
double min_ztail_events_ = 1
double fixed_zcut_ = -1.0
std::string signalVtxMCSelection_ {""}
TTree * signal_tree_ {nullptr}
TTree * signal_pretrig_sim_tree_ {nullptr}
TTree * bkg_tree_ {nullptr}
double radFrac_ = 0.05
double ztarget_ = -0.5
double psum_cut_ = 3.0
TreeCutSelector * testCutsSelector_ {nullptr}
TreeCutSelector * persistentCutsSelector_ {nullptr}
std::map< std::string, std::string > persistentCutStrings_
std::map< std::string, std::pair< std::pair< double, double >, int > > * persistentCutsPtr_ {nullptr}
std::map< std::string, std::pair< std::pair< double, double >, int > > * testCutsPtr_ {nullptr}
std::map< std::string, TH1F * > testVarPDFs_
std::map< std::string, TH1F * > testVarCDFs_
std::map< std::string, double * > testVarQuantiles_
std::map< std::string, double * > testVarQuantilePos_
std::map< std::string, std::vector< std::pair< double, double > > > testZoffsetAlpha_
TH1D * h_pretrig_signal_vtxz_
TH1D * h_signal_vtxz_rad_
TH1D * h_data_mass_rad_
TF1 * f_xi_eff_
std::string hit_category_ {""}
std::string massWindow_ {""}
std::string initialCuts_ {""}
double zbins_ [3] {400., -10., 140.}
std::string zbin_str_
double z_bin_width_ = (zbins_[2] - zbins_[1]) / zbins_[0]
int n_zbins_bundled_ = 10
double massbins_ [3] {400., 0., 0.4}
double mass_bin_width_ = (massbins_[2] - massbins_[1]) / massbins_[0]

Additional Inherited Members

Static Public Member Functions inherited from Processor
static void declare (const std::string &classname, ProcessorMaker *)
 Internal function which is part of the ProcessorFactory machinery.
Protected Types inherited from OptimizationProcessor
typedef std::map< std::string, std::pair< double, int > >::iterator cut_iter_
Protected Attributes inherited from OptimizationProcessor
int debug_ {0}
int year_ = 2021
std::string cuts_cfgFile_ {""}
std::string outFileName_ {""}
TFile * outFile_ {nullptr}
std::vector< std::string > cutVariables_
std::vector< std::string > new_variables_
std::vector< double > new_variable_params_
std::string variableHistCfgFilename_ {""}
std::string bkgVtxAnaFilename_ {""}
std::string bkgVtxAnaTreename_ {""}
TFile * bkgVtxAnaFile_ {nullptr}
double background_sf_
std::string signalVtxAnaFilename_ {""}
std::string signalVtxAnaTreename_ {""}
TFile * signalVtxAnaFile_ {nullptr}
double signal_sf_ = 1.0
std::string signalMCAnaFilename_ {""}
std::string signalMCAnaTreename_ {""}
TFile * signalMCAnaFile_ {nullptr}
std::string signal_pdgid_ {""}
double signal_mass_
double eps_
double massResolution_
double mass_window_nsigma_
double lowMass_
double highMass_
std::shared_ptr< ZBiHistos > signalHistos_
std::shared_ptr< ZBiHistos > bkgHistos_
std::shared_ptr< ZBiHistos > testCutHistos_
std::shared_ptr< ZBiHistos > processorHistos_
BaseSelector * testCutsSelector_ {nullptr}
std::map< std::string, std::pair< double, int > > * testCutsPtr_
BaseSelector * persistentCutsSelector_ {nullptr}
std::map< std::string, std::pair< double, int > > * persistentCutsPtr_
double step_size_ = 0.01
int max_iteration_ = 75
Protected Attributes inherited from Processor
Process & process_
TFile * outF_ {nullptr}
std::string name_

Detailed Description

Cutflow optimization tool for A'.

Definition at line 36 of file ApOptimizationProcessor.h.

Member Typedef Documentation

◆ cut_iter_

typedef std::map<std::string,std::pair<std::pair<double,double>,int>>::iterator cut_iter_
private

Definition at line 122 of file ApOptimizationProcessor.h.

Constructor & Destructor Documentation

◆ ApOptimizationProcessor()

ApOptimizationProcessor ( const std::string & name,
Process & process )

Definition at line 8 of file ApOptimizationProcessor.cxx.

◆ ~ApOptimizationProcessor()

Definition at line 11 of file ApOptimizationProcessor.cxx.

Member Function Documentation

◆ computeDisplacedYield()

double computeDisplacedYield ( TH1 * h_chi_eff,
double EAp )

Definition at line 363 of file ApOptimizationProcessor.cxx.

◆ computePromptYield()

double computePromptYield ( )

Definition at line 354 of file ApOptimizationProcessor.cxx.

◆ computeTruthSignalShape()

double computeTruthSignalShape ( double z,
double EAp )

Definition at line 346 of file ApOptimizationProcessor.cxx.

◆ configure()

void configure ( const ParameterSet & parameters)
virtual

description

Reimplemented from OptimizationProcessor.

Definition at line 13 of file ApOptimizationProcessor.cxx.

◆ determineSignalVertexEfficiencyXi()

void determineSignalVertexEfficiencyXi ( )

Definition at line 516 of file ApOptimizationProcessor.cxx.

◆ finalize()

void finalize ( )
virtual

description

Reimplemented from OptimizationProcessor.

Definition at line 331 of file ApOptimizationProcessor.cxx.

◆ findZcut()

std::vector< double > findZcut ( TH1 * h_bkg_vtxz_cut,
bool fromTailFit,
int iteration = 0 )

Definition at line 388 of file ApOptimizationProcessor.cxx.

◆ fitZBkgTail()

std::vector< double > fitZBkgTail ( TH1 * h_bkg_vtxz,
std::string fitname )

Definition at line 377 of file ApOptimizationProcessor.cxx.

◆ getBinsAndLimits()

double * getBinsAndLimits ( json histo_cfg,
std::string varname )

Definition at line 450 of file ApOptimizationProcessor.cxx.

◆ getHitCategoryCut()

std::string getHitCategoryCut ( )

Definition at line 438 of file ApOptimizationProcessor.cxx.

◆ getMassResolution()

double getMassResolution ( double mass)

Definition at line 427 of file ApOptimizationProcessor.cxx.

◆ getQuantileArray()

double * getQuantileArray ( std::pair< double, double > range,
int n_quantiles,
double initial_cut_frac = -999.9 )

Definition at line 552 of file ApOptimizationProcessor.cxx.

◆ getZoffsetAlpha()

std::vector< std::pair< double, double > > getZoffsetAlpha ( TH2F * h_y0_vs_z,
int n_quantiles,
int nbins )

Definition at line 592 of file ApOptimizationProcessor.cxx.

◆ initialize() [1/2]

void initialize ( std::string inFilename,
std::string outFilename )
virtual

description

Reimplemented from OptimizationProcessor.

Definition at line 59 of file ApOptimizationProcessor.cxx.

◆ initialize() [2/2]

virtual void initialize ( TTree * tree)
inlinevirtual

description

Reimplemented from OptimizationProcessor.

Definition at line 50 of file ApOptimizationProcessor.h.

◆ initializeGraphs()

void initializeGraphs ( std::string cut_name)

Definition at line 488 of file ApOptimizationProcessor.cxx.

◆ initializeTestCutPDF()

void initializeTestCutPDF ( std::string cut_name,
std::string cut_var,
std::string persistent_cuts )

Definition at line 463 of file ApOptimizationProcessor.cxx.

◆ process() [1/2]

bool process ( )
virtual

description

Reimplemented from OptimizationProcessor.

Definition at line 206 of file ApOptimizationProcessor.cxx.

◆ process() [2/2]

virtual bool process ( IEvent * event)
inlinevirtual

description

Reimplemented from OptimizationProcessor.

Definition at line 55 of file ApOptimizationProcessor.h.

Member Data Documentation

◆ bkg_tree_

TTree* bkg_tree_ {nullptr}
private

Definition at line 113 of file ApOptimizationProcessor.h.

◆ f_xi_eff_

TF1* f_xi_eff_
private

Definition at line 145 of file ApOptimizationProcessor.h.

◆ fixed_zcut_

double fixed_zcut_ = -1.0
private

Definition at line 104 of file ApOptimizationProcessor.h.

◆ h_data_mass_rad_

TH1D* h_data_mass_rad_
private

Definition at line 142 of file ApOptimizationProcessor.h.

◆ h_pretrig_signal_vtxz_

TH1D* h_pretrig_signal_vtxz_
private

Definition at line 139 of file ApOptimizationProcessor.h.

◆ h_signal_vtxz_rad_

TH1D* h_signal_vtxz_rad_
private

Definition at line 141 of file ApOptimizationProcessor.h.

◆ hit_category_

std::string hit_category_ {""}
private

Definition at line 147 of file ApOptimizationProcessor.h.

◆ initialCuts_

std::string initialCuts_ {""}
private

Definition at line 149 of file ApOptimizationProcessor.h.

◆ mass_bin_width_

double mass_bin_width_ = (massbins_[2] - massbins_[1]) / massbins_[0]
private

Definition at line 157 of file ApOptimizationProcessor.h.

◆ massbins_

double massbins_[3] {400., 0., 0.4}
private

Definition at line 156 of file ApOptimizationProcessor.h.

◆ massWindow_

std::string massWindow_ {""}
private

Definition at line 148 of file ApOptimizationProcessor.h.

◆ min_ztail_events_

double min_ztail_events_ = 1
private

Definition at line 103 of file ApOptimizationProcessor.h.

◆ n_zbins_bundled_

int n_zbins_bundled_ = 10
private

Definition at line 155 of file ApOptimizationProcessor.h.

◆ outFileName_

std::string outFileName_ {"zbi_out.root"}
private

Definition at line 99 of file ApOptimizationProcessor.h.

◆ persistentCutsPtr_

std::map<std::string, std::pair<std::pair<double, double>, int> >* persistentCutsPtr_ {nullptr}
private

Definition at line 129 of file ApOptimizationProcessor.h.

◆ persistentCutsSelector_

TreeCutSelector* persistentCutsSelector_ {nullptr}
private

Definition at line 125 of file ApOptimizationProcessor.h.

◆ persistentCutStrings_

std::map<std::string, std::string> persistentCutStrings_
private

Definition at line 127 of file ApOptimizationProcessor.h.

◆ psum_cut_

double psum_cut_ = 3.0
private

Definition at line 119 of file ApOptimizationProcessor.h.

◆ radFrac_

double radFrac_ = 0.05
private

Definition at line 116 of file ApOptimizationProcessor.h.

◆ scan_zcut_

bool scan_zcut_ = false
private

Definition at line 102 of file ApOptimizationProcessor.h.

◆ signal_pretrig_sim_tree_

TTree* signal_pretrig_sim_tree_ {nullptr}
private

Definition at line 110 of file ApOptimizationProcessor.h.

◆ signal_tree_

TTree* signal_tree_ {nullptr}
private

Definition at line 109 of file ApOptimizationProcessor.h.

◆ signalVtxMCSelection_

std::string signalVtxMCSelection_ {""}
private

Definition at line 108 of file ApOptimizationProcessor.h.

◆ testCutsPtr_

std::map<std::string, std::pair<std::pair<double, double>, int> >* testCutsPtr_ {nullptr}
private

Definition at line 130 of file ApOptimizationProcessor.h.

◆ testCutsSelector_

TreeCutSelector* testCutsSelector_ {nullptr}
private

Definition at line 124 of file ApOptimizationProcessor.h.

◆ testVarCDFs_

std::map<std::string, TH1F*> testVarCDFs_
private

Definition at line 133 of file ApOptimizationProcessor.h.

◆ testVarPDFs_

std::map<std::string, TH1F*> testVarPDFs_
private

Definition at line 132 of file ApOptimizationProcessor.h.

◆ testVarQuantilePos_

std::map<std::string, double*> testVarQuantilePos_
private

Definition at line 135 of file ApOptimizationProcessor.h.

◆ testVarQuantiles_

std::map<std::string, double*> testVarQuantiles_
private

Definition at line 134 of file ApOptimizationProcessor.h.

◆ testZoffsetAlpha_

std::map<std::string, std::vector<std::pair<double, double> > > testZoffsetAlpha_
private

Definition at line 137 of file ApOptimizationProcessor.h.

◆ variableHistCfgFilename_

std::string variableHistCfgFilename_ {""}
private

Definition at line 101 of file ApOptimizationProcessor.h.

◆ z_bin_width_

double z_bin_width_ = (zbins_[2] - zbins_[1]) / zbins_[0]
private

Definition at line 154 of file ApOptimizationProcessor.h.

◆ zbin_str_

std::string zbin_str_
private
Initial value:
=
"(" + std::to_string((int)zbins_[0]) + "," + std::to_string(zbins_[1]) + "," + std::to_string(zbins_[2]) + ")"

Definition at line 152 of file ApOptimizationProcessor.h.

◆ zbins_

double zbins_[3] {400., -10., 140.}
private

Definition at line 151 of file ApOptimizationProcessor.h.

◆ ztarget_

double ztarget_ = -0.5
private

Definition at line 118 of file ApOptimizationProcessor.h.


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