1 |
kkotov |
1.1 |
#define tree_cxx
|
2 |
|
|
#include "tree.h"
|
3 |
|
|
#include <TH2.h>
|
4 |
|
|
#include <iostream>
|
5 |
|
|
#include <TStyle.h>
|
6 |
|
|
#include <TCanvas.h>
|
7 |
|
|
|
8 |
|
|
bool isLoose(tree::_MuonInfo& muon) {
|
9 |
|
|
bool isLoose=false;
|
10 |
|
|
|
11 |
|
|
// kinematic cuts
|
12 |
|
|
if (muon.pt < 20 ) return isLoose; // pt cut
|
13 |
|
|
if (fabs(muon.eta) > 2.4) return isLoose; // eta cut
|
14 |
|
|
if (muon.numValidTrackerHits < 10) return isLoose; // # hits in tracker
|
15 |
|
|
// iso cut
|
16 |
|
|
if (muon.trackIsoSumPt>10) return isLoose;
|
17 |
|
|
// beam spot cut
|
18 |
|
|
if (fabs(muon.d0) > 0.2) return isLoose;
|
19 |
|
|
// if all the cuts are passed
|
20 |
|
|
isLoose=true;
|
21 |
|
|
return isLoose;
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
bool isKinTight(tree::_MuonInfo& muon) {
|
25 |
|
|
bool isKinTight=false;
|
26 |
|
|
// minimum requirement to start investigating: to be loose
|
27 |
|
|
if ( !isLoose(muon) ) return isKinTight;
|
28 |
|
|
if ( muon.eta > 2.1 ) return isKinTight;
|
29 |
|
|
if ( muon.numValidMuonHits < 1 ) return isKinTight;
|
30 |
|
|
if ( muon.numValidPixelHits < 1 ) return isKinTight;
|
31 |
|
|
if ( muon.numSegmentMatches < 2 ) return isKinTight;
|
32 |
|
|
if ( muon.normChiSquare > 10) return isKinTight;
|
33 |
|
|
isKinTight=true;
|
34 |
|
|
return isKinTight;
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
void tree::Loop(){
|
38 |
|
|
using namespace std;
|
39 |
|
|
TFile f("boostedZnewMC.root","RECREATE");
|
40 |
|
|
TTree skim("skim","skim");
|
41 |
|
|
skim.Branch("qT",&recoCandPtCktl,"qT/F");
|
42 |
|
|
const int entries = fChain->GetEntries();
|
43 |
|
|
for(int event=0,cnt=0; /*event<10 &&*/ fChain->GetEntry(event); event++){
|
44 |
|
|
reco1.charge = cocktail1_charge;
|
45 |
|
|
reco2.charge = cocktail2_charge;
|
46 |
|
|
reco1.pt = cocktail1_pt;
|
47 |
|
|
reco2.pt = cocktail2_pt;
|
48 |
|
|
reco1.eta = cocktail1_eta;
|
49 |
|
|
reco2.eta = cocktail2_eta;
|
50 |
|
|
|
51 |
|
|
const double mLow = 60., mHigh = 120.;
|
52 |
|
|
|
53 |
|
|
if (reco1.charge*reco2.charge>0) continue;
|
54 |
|
|
if (recoCandMassCktl < mLow) continue;
|
55 |
|
|
if (recoCandMassCktl > mHigh) continue;
|
56 |
|
|
|
57 |
|
|
if( !isLoose(reco1) || !isLoose(reco2) ) continue; // both loose
|
58 |
|
|
if( !isKinTight(reco1) && !isKinTight(reco2) ) continue; // at least one tight
|
59 |
|
|
|
60 |
|
|
if(recoCandPtCktl>30) skim.Fill();
|
61 |
|
|
|
62 |
|
|
}
|
63 |
|
|
f.Write();
|
64 |
|
|
f.Close();
|
65 |
|
|
}
|