-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDPSelection.h
More file actions
executable file
·172 lines (138 loc) · 5.02 KB
/
Copy pathDPSelection.h
File metadata and controls
executable file
·172 lines (138 loc) · 5.02 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#ifndef DPSelection_H
#define DPSelection_H
#include "TObject.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <TFile.h>
#include <TTree.h>
#include "TLorentzVector.h"
#include "TH3.h"
#include "AnaInput.h"
#include "Rtuple.h"
/*
#define MAXPHO 10
#define MAXVTX 10
#define MAXJET 15
#define MAXMU 5
#define MAXELE 5
#define MAXGEN 20
typedef pair<int, TLorentzVector> objID ;
*/
//class DPSelection : public TObject {
class DPSelection {
public:
DPSelection( string datacardfile = "DataCard.txt");
~DPSelection();
//friend class Sync ;
void Init( TTree* tr ) ;
void Init( Rtuple& rt ) ;
void SetArray( int a[], int b[], int size ) ;
void SetArray( float a[], float b[], int size ) ;
bool HLTFilter();
bool L1Filter();
bool PhotonFilter() ;
bool JetMETFilter( bool usePFClean = false );
bool VertexFilter() ;
bool ElectronFilter() ;
bool MuonFilter() ;
bool CorrectMET() ;
double BR() ;
bool GetEventStat( string flagName ) ;
bool SignalSelection( bool isTightPhoton = false ) ;
uint32_t EventIdentification() ;
bool HaloTag( double cscdPhi, double sMaj, double sMin, double eta ) ;
bool SpikeTag( int nXtl, double sMaj, double sMin , double swissX, double eta ) ;
bool CosmicTag( double dtdEta , double dtdPhi ) ;
void ResetCuts( string cutName, vector<int>& cutId, vector<double>& newValue ) ;
void ResetCuts( string cutName, int cutId, double newValue ) ;
void ResetCuts( string cutName = "All" ) ; // set cuts to default values from datacard
void ResetCounter() ;
void GetCollection( string collName, vector<objID>& coll ) ;
void ResetCollection( string cutName = "All" ) ; // clean the storage containers
void PrintCutFlow() ;
inline int GetPhotonCutFlow() { return photonCutFlow ; }
// return background prediction , upward error, downward error
vector<double> ABCD_ABCD( vector<TH3D*>& hColls , vector<TH3D*>& hMIBs ) ;
vector<double> ABCD_Collision( TH3D* hA, TH3D* hB, TH3D* hC, TH3D* hD ) ;
vector<double> ABCD( TH3D* hA, TH3D* hB, TH3D* hC, TH3D* hD, TH3D* hE, TH3D* hF ) ;
double GetEstimation( TH3D* hCount, bool getQCD = true ) ;
vector<double> GetComponent( int eta_i, double B12, double h_B12, double s_B12, double c_B12 ) ;
vector<double> GetComponent( int eta_i, int B12, int h_B12, int s_B12, int c_B12 ) ;
// results
bool passL1 ;
bool passHLT ;
bool passTrigger ;
bool passVtx ;
bool passPho ;
bool passJet ;
bool passMET ;
TLorentzVector newMET ;
TLorentzVector noPhotMET ;
TLorentzVector theMET ;
private:
AnaInput* Input;
vector<objID> phoV ;
vector<objID> jetV ;
vector<objID> eleV ;
vector<objID> muV ;
vector<double> photonCuts ;
vector<double> photonIso ;
vector<double> photonPFIso ;
vector<double> vtxCuts ;
vector<double> jetCuts ;
vector<double> electronCuts ;
vector<double> muonCuts ;
vector<int> trigBits ;
unsigned int eventId ;
float phoPx[MAXPHO], phoPy[MAXPHO], phoPz[MAXPHO], phoE[MAXPHO] ;
float seedTime[MAXPHO], aveTime[MAXPHO], timeChi2[MAXPHO], dR_TrkPho[MAXPHO] ;
float phoHovE[MAXPHO], sMinPho[MAXPHO], sMajPho[MAXPHO], sigmaIeta[MAXPHO], seedSwissX[MAXPHO], seedE[MAXPHO] ;
float phoEcalIso[MAXPHO], phoHcalIso[MAXPHO], phoTrkIso[MAXPHO] ;
float photIso[MAXPHO], cHadIso[MAXPHO], nHadIso[MAXPHO] ;
float cscdPhi[MAXPHO] , cscRho[MAXPHO], cscTime[MAXPHO], dtdPhi[MAXPHO], dtdEta[MAXPHO] ;
int nXtals[MAXPHO] ;
//float vtxX[MAXVTX], vtxY[MAXVTX] ;
float vtxZ[MAXVTX], vtxChi2[MAXVTX], vtxNdof[MAXVTX];
float jetPx[MAXJET], jetPy[MAXJET], jetPz[MAXJET], jetE[MAXJET] ;
float jetNDau[MAXJET], jetCM[MAXJET], jetCEF[MAXJET], jetCHF[MAXJET], jetNHF[MAXJET], jetNEF[MAXJET];
float jecUnc[MAXJET], jerUnc[MAXJET], jetTime[MAXJET], jetTimeErr[MAXJET] ;
float muPx[MAXMU], muPy[MAXMU], muPz[MAXMU], muE[MAXMU] ;
//float muEcalIso[MAXOBJ], muHcalIso[MAXOBJ], muTrkIso[MAXOBJ] ;
float elePx[MAXELE], elePy[MAXELE], elePz[MAXELE], eleE[MAXELE] ;
float eleEcalIso[MAXELE], eleHcalIso[MAXELE], eleTrkIso[MAXELE] ;
int eleNLostHits[MAXELE] ;
float metPx, metPy, metE, met_dx1, met_dy1, met_dx2, met_dy2, met_dx3, met_dy3 ;
int nJets, nPhotons, nElectrons, nVertices, nMuons, triggered, L1a ;
int nGen ;
int pdgId[MAXGEN], momId[MAXGEN] ;
int isData ;
int UseL1 ;
int systType ;
int usePFIso ;
vector<int> trigCuts ;
// counters for cutflow
int counter[10] ;
int gCounter[10] ;
int photonCutFlow ;
// Efficiency and mis-tag rate for background taggers
vector<double> haloEff ;
vector<double> spikeEff ;
vector<double> cosEff ;
vector<double> haloMis ;
vector<double> spikeMis ;
vector<double> cosMis ;
int useInFlight ;
// For BR calculation
int nX0, nPho ;
// MET Correction
double met1x, met1y, met1E ;
double met2x, met2y, met2E ;
// Systematic
double metCorrX ;
double metCorrY ;
//ClassDef(DPSelection, 1);
};
//#if !defined(__CINT__)
// ClassImp(DPSelection);
#endif