-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEffCalc.h
93 lines (83 loc) · 3.13 KB
/
EffCalc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#pragma once
#define EFFCALC_H
#include "Reader.h"
//#include "Reader.cc"
#include "TEfficiency.h"
#include "ObjectTree.h"
#include "pset.h"
enum kDtype{
kMCmuLoose = (unsigned int) 4,
kMCmu = (unsigned int) 3,
kMCUp = (unsigned int) 2,
kMCJP = (unsigned int) 1,
kData = (unsigned int) 0,
};
using EffMap=std::map<std::string,TEfficiency*>;
using MatchData=std::map<std::pair<string,double>,EventData>;
class EffCalc : public readerHlt, readerOnia, objectTree
{
public :
objectTree objT;
readerHlt hltData;
readerOnia oniaData;
EffCalc() : hltData(), oniaData() {};
~EffCalc();
EffCalc( std::string name_file_hlt, std::string name_file_onia, unsigned int feedType = kMCJP );
void init( bool _getDimu, bool _isL1 );
void init( std::pair<bool, bool> dp );
void setTrigger( std::string name_trig, std::string name_base_trig = "" );
void setTriggerLvl(int lvl);
bool indexMatched( double iHlt, double iOnia);
void requestHist( std::string types );
void eval(int idx);
void evalHLT(int idx);
void eval(std::pair<long, long> indexes);
void eval(int idx, double cut);
void evalAll(int maxEvents);
void evalSegment(int startIdx, int endIdx);
void evalAllHLT(int maxEvents);
void evalAll(int maxEvents, std::vector<std::pair<long, long> > indexes);
void mapIndex();
std::pair<std::string, std::unordered_map<std::string, TEfficiency*> > getEfficiencies();
void setOniaCustomFilter( std::map<string, std::pair<double, double> > m );
void setHltCustomMassFilter( std::pair<double, double> m );
void setHltCustomPtFilter( std::pair<double, double> m );
// void check;
std::unordered_map<std::string, TEfficiency*> map_eff;
std::map<bool, std::unordered_map<std::string, TH1D*> >map_hist;
std::string registered_trigger;
std::vector<std::pair<long, long> >vec_idx;
// protected :
public :
std::vector<EventData> filterOniaData( std::vector<EventData> oniaCont );
std::vector<EventData> filterHltData( std::vector<EventData> hltCont, double cut );
std::vector<EventData> filterHltDataMass( std::vector<EventData> hltCont, double cut );
std::pair<std::vector<EventData>, std::vector<EventData> > matchedData( std::vector<EventData> onia, std::vector<EventData> hlt , bool sendParcel);
EffMap generateHist( std::string );
void fillProjHist( TEfficiency hist_eff, std::string type );
void fillHist( std::vector<EventData> oniaPass, std::vector<EventData> oniaTotal) ;
void fillHLTHist( std::vector<EventData> hlt) ;
void fillDerivedHist( std::vector<EventData> oniaPass, std::vector<EventData>, double cut );
void fillDerivedMassHist( std::vector<EventData> oniaPass, std::vector<EventData>, double cut );
// private :
public :
TFile* file_output;
// std::unordered_map<string, bool> map_hlt;
bool getDimu, isL1;
int level;
bool cuthltrange;
unsigned int dataType;
double dRcut, dPtcut;
double hlt_m_low, hlt_m_high;
double hlt_pt_1 = -1.;
double hlt_pt_2 = -1.;
std::string rap;
std::map<std::string, std::pair<double, double> > map_oniafilter_limit{
{"m", {0., 999.}},
{"pt", {0., 999.}},
{"pt1", {0., 999.}},
{"pt2", {0., 999.}},
{"rap", {-2.5, 2.5}},
};
friend objectTree;
};