1 |
peiffer |
1.1 |
#include "../include/Cleaner.h"
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
Cleaner::Cleaner( BaseCycleContainer* input_){
|
5 |
|
|
|
6 |
|
|
bcc = input_;
|
7 |
|
|
|
8 |
|
|
}
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
//tight ele ID from https://twiki.cern.ch/twiki/bin/view/CMS/EgammaCutBasedIdentification
|
12 |
|
|
bool Cleaner::eleID(Electron ele){
|
13 |
|
|
|
14 |
|
|
bool pass=false;
|
15 |
|
|
|
16 |
|
|
if(fabs(ele.supercluster_eta)<1.4442){
|
17 |
|
|
if(ele.dEtaIn<0.004 && ele.dPhiIn<0.03 && ele.sigmaIEtaIEta<0.01 && ele.HoverE<0.12 && fabs(1./ele.EcalEnergy-1./ele.v4().P())<0.05) pass=true;
|
18 |
|
|
}
|
19 |
|
|
else if( fabs(ele.supercluster_eta)>1.5660){
|
20 |
|
|
if(ele.dEtaIn<0.005 && ele.dPhiIn<0.02 && ele.sigmaIEtaIEta<0.03 && ele.HoverE<0.10 && fabs(1./ele.EcalEnergy-1./ele.v4().P())<0.05) pass=true;
|
21 |
|
|
}
|
22 |
|
|
|
23 |
|
|
return pass;
|
24 |
|
|
|
25 |
|
|
}
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
std::vector<Electron>* Cleaner::ElectronCleaner(double ptmin, double etamax){
|
29 |
|
|
|
30 |
|
|
std::vector<Electron>* good_eles = new std::vector<Electron>;
|
31 |
|
|
for(unsigned int i=0; i<bcc->electrons->size(); ++i){
|
32 |
|
|
Electron ele = bcc->electrons->at(i);
|
33 |
|
|
if(ele.pt>ptmin){
|
34 |
|
|
if(fabs(ele.eta)<etamax){
|
35 |
|
|
if(fabs(ele.supercluster_eta)<1.4442 || fabs(ele.supercluster_eta)>1.5660){
|
36 |
|
|
if(bcc->pvs->size()>0){
|
37 |
|
|
if(ele.gsfTrack_dxy_vertex(bcc->pvs->at(0).x, bcc->pvs->at(0).y)<0.02){
|
38 |
|
|
if(ele.passconversionveto){
|
39 |
|
|
//if(ele.mvaTrigV0>0.0){
|
40 |
|
|
if(eleID(ele)){
|
41 |
|
|
if(ele.relIso()<0.1){
|
42 |
|
|
good_eles->push_back(ele);
|
43 |
|
|
}
|
44 |
|
|
}
|
45 |
|
|
//}
|
46 |
|
|
}
|
47 |
|
|
}
|
48 |
|
|
}
|
49 |
|
|
}
|
50 |
|
|
}
|
51 |
|
|
}
|
52 |
|
|
}
|
53 |
|
|
|
54 |
|
|
return good_eles;
|
55 |
|
|
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
std::vector<Muon>* Cleaner::MuonCleaner(double ptmin, double etamax){
|
59 |
|
|
|
60 |
|
|
std::vector<Muon>* good_mus = new std::vector<Muon>;
|
61 |
|
|
for(unsigned int i=0; i<bcc->muons->size(); ++i){
|
62 |
|
|
Muon mu = bcc->muons->at(i);
|
63 |
|
|
if(mu.pt>ptmin){
|
64 |
|
|
if(fabs(mu.eta)>etamax){
|
65 |
|
|
if(mu.isGlobalMuon){
|
66 |
|
|
if(mu.globalTrack_chi2/mu.globalTrack_ndof<10){
|
67 |
|
|
if(mu.innerTrack_trackerLayersWithMeasurement>8){
|
68 |
|
|
if(mu.dB<0.02){
|
69 |
|
|
if(mu.relIso()<0.0125){
|
70 |
|
|
if(fabs(mu.vertex_z-bcc->pvs->at(0).z)<1){
|
71 |
|
|
if(mu.innerTrack_numberOfValidPixelHits>0){
|
72 |
|
|
if(mu.numberOfMatchedStations>1){
|
73 |
|
|
good_mus->push_back(mu);
|
74 |
|
|
}
|
75 |
|
|
}
|
76 |
|
|
}
|
77 |
|
|
}
|
78 |
|
|
}
|
79 |
|
|
}
|
80 |
|
|
}
|
81 |
|
|
}
|
82 |
|
|
}
|
83 |
|
|
}
|
84 |
|
|
}
|
85 |
|
|
|
86 |
|
|
return good_mus;
|
87 |
|
|
|
88 |
|
|
}
|