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
SimpZBiOptimizationProcessor.h
Go to the documentation of this file.
1#ifndef __SIMPZBI_ANAPROCESSOR_H__
2#define __SIMPZBI_ANAPROCESSOR_H__
3
4// HPSTR
7#include "Processor.h"
8#include "SimpAnaTTree.h"
9#include "SimpEquations.h"
10#include "ZBiHistos.h"
11
12// ROOT
13#include "TBranch.h"
14#include "TEfficiency.h"
15#include "TF1.h"
16#include "TFile.h"
17#include "TGraph.h"
18#include "TH1F.h"
19#include "TH2F.h"
20#include "TLorentzVector.h"
21#include "TRefArray.h"
22#include "TTree.h"
23#include "TVector3.h"
24
25// C++
26#include <memory>
27
31
33 public:
34 SimpZBiOptimizationProcessor(const std::string& name, Process& process);
35
37
41 virtual void configure(const ParameterSet& parameters);
42
46 virtual void initialize(TTree* tree) {};
47
51 virtual bool process(IEvent* event) {};
52
56 virtual void finalize();
57
61 virtual bool process();
62
66 virtual void initialize(std::string inFilename, std::string outFilename);
67
72
76 bool failTestCut(std::string cutname, SimpAnaTTree* MTT);
77
81 double round(double var);
82
86 void getSignalMCAnaVtxZ_h(std::string signalMCAnaFilename, std::string signal_pdgid);
87
91 double countControlRegionBackgroundRate(std::string inFilename, std::string tree_name, double m_Ap,
92 double Mbin = 30.0, double dNdm_sf = 1.0);
93
97 void addNewVariables(SimpAnaTTree* MTT, std::string variable, double param);
98
102 void fillEventHistograms(std::shared_ptr<ZBiHistos> histos, SimpAnaTTree* MTT);
103
104 private:
105 // Configuration parameters
106 int year_ = 2016; //<! description
107 std::string outFileName_{"zbi_out.root"}; //<! description
108
109 std::string eq_cfgFile_{""}; //<! equations config file
110 std::string variableHistCfgFilename_{""}; //<! histogram config file
111 bool scan_zcut_ = false; //<! use zBi to optimize zcut
112 double min_ztail_events_ = 0.5; //<! number of events (from fit) past zcut
113 std::map<std::string, double> initialIntegrals_; //<! description
114
115 // Signal config
116 std::string signalVtxMCSelection_{""}; //<! description
117 TH1F* signalSimZ_h_{nullptr}; //<! truth z distribution of signal vertex
118 SimpAnaTTree* signalMTT_{nullptr}; //<! description
119
120 double logEps2_; //<! log10(eps^2)
121 double E_Vd_ = 1.35; //<! mean truth signal energy...default is 1.35 GeV
122
123 // SIMP equations
124 SimpEquations* simpEqs_{nullptr}; //<! description
125
126 // Background config
127 SimpAnaTTree* bkgMTT_{nullptr}; //<! description
128 std::string tritrigFilename_{""}; //<! description
129 std::map<std::string, double*> tritrig_tuple_; //<! description
130 TTree* tritrigTree_{nullptr}; //<! description
131
132 // Total A' Rate terms
133 double radFrac_ = 0.0; //<! radiative fraction (rad/(tritrig+wab))
134 double radAcc_ = 0.0;
135 double dNdm_ = 0.0;
136 double dNdm_sf_ = 1.0;
139
140 // Cuts
141 IterativeCutSelector* testCutsSelector_{nullptr}; //<! cuts to be optimized
142 IterativeCutSelector* persistentCutsSelector_{nullptr}; //<! cuts that are always
143};
144
145#endif
Base classes for all user event processing components to extend.
Definition IEvent.h:7
OptimizationProcessor(const std::string &name, Process &process)
description
Read in flat TTree and create new cut variables for SIMP analysis.
All SIMP Equations for calculating expected signal.
void fillEventHistograms(std::shared_ptr< ZBiHistos > histos, SimpAnaTTree *MTT)
description
virtual void configure(const ParameterSet &parameters)
description
double countControlRegionBackgroundRate(std::string inFilename, std::string tree_name, double m_Ap, double Mbin=30.0, double dNdm_sf=1.0)
description
void getSignalMCAnaVtxZ_h(std::string signalMCAnaFilename, std::string signal_pdgid)
description
bool failTestCut(std::string cutname, SimpAnaTTree *MTT)
description
virtual void initialize(TTree *tree)
description
bool failPersistentCuts(SimpAnaTTree *MTT)
description
std::map< std::string, double * > tritrig_tuple_
void addNewVariables(SimpAnaTTree *MTT, std::string variable, double param)
description
SimpZBiOptimizationProcessor(const std::string &name, Process &process)
virtual bool process(IEvent *event)
description
std::map< std::string, double > initialIntegrals_