77
88#include <TF1.h>
99#include <TMath.h>
10- #include <HTransformToCS.c>
1110#include <TMatrixF.h>
1211#include <TVectorF.h>
1312
@@ -40,19 +39,24 @@ TFile* SUSYLooperHists::Loop()
4039
4140 if (fChain == 0 ) return NULL ;
4241 Long64_t nentries = fChain -> GetEntriesFast ();
43- HTransformToCS mtCS ;
44- mtCS .SetCmsEnergy (8000 );
45-
46-
42+
4743 TFile * myFile = new TFile (outputFileName ,"recreate" );
44+ // checks the Mtt mass ++ simple plot example ++
4845 TH1D * LepTwoZmass = new TH1D ("LepTwoZmass" ,";approximate Z(#tau#tau) mass [GeV];" ,100 ,0 ,2000 );
46+ LepTwoZmass -> Sumw2 ();
47+
48+ // baseline plots +++++++++++++++++++++
49+ // allow to fill cutflow to sychronize to others
50+ TH1D * CutFlow = new TH1D ("CutFlow" ,";CutFlow [unweighted];" ,20 ,-0.5 ,19.5 );
51+ CutFlow -> Sumw2 ();
52+
53+ // a scan should be filled without weights before any cut to get the efficiency. The reason is that for a scan each points have different x-section, which are not accessable during the loop
4954 TH2D * scan = new TH2D ("scan" ,"scan" ,8 ,112.5 ,312.5 ,40 ,112.5 ,312.5 );
55+ // fill after some cuts the scans to get efficiency, i.e. ->Divide(scan) after the loop
5056 TH2D * scanA = new TH2D ("scanA" ,"scan" ,8 ,112.5 ,312.5 ,40 ,112.5 ,312.5 );
5157 TH2D * scanB = new TH2D ("scanB" ,"scan" ,8 ,112.5 ,312.5 ,40 ,112.5 ,312.5 );
5258 TH2D * scanC = new TH2D ("scanC" ,"scan" ,8 ,112.5 ,312.5 ,40 ,112.5 ,312.5 );
53- // baseline plots +++++++++++++++++++++
54- TH1D * CutFlowAntonis = new TH1D ("CutFlowAntonis" ,";P(l);" ,20 ,-0.5 ,19.5 );
55- CutFlowAntonis -> Sumw2 ();
59+
5660
5761 Long64_t nbytes = 0 , nb = 0 ;
5862 for (Long64_t jentry = 0 ; jentry < nentries ;jentry ++ ) {
@@ -61,7 +65,7 @@ TFile* SUSYLooperHists::Loop()
6165 if (ientry < 0 ) break ;
6266 nb = fChain -> GetEntry (jentry ); nbytes += nb ;
6367
64- if (jentry %10000 == 0 ) cout << "Event: " <<jentry << " weight: " << weight <<endl ;
68+ if (jentry %100000 == 0 ) cout << "Event: " <<jentry <<endl ;
6569 scan -> Fill (GenSusyMStop ,GenSusyMNeutralino );
6670 // select lepton and put it into TLorentzvector
6771
@@ -109,28 +113,28 @@ TFile* SUSYLooperHists::Loop()
109113
110114 // preselection syncronizd to Antonis ++++++++++++++++++++
111115 if ( nLepGood == 0 ) continue ;
112- CutFlowAntonis -> Fill (0. );
116+ CutFlow -> Fill (0. );
113117 if (met .Pt ()< 200 ) continue ;
114118 if (nLepGood < 2 ) continue ;
115119 if (nJet == 0 ) continue ;
116120 if (nTauGood != 0 ) continue ;
117- CutFlowAntonis -> Fill (1. );
121+ CutFlow -> Fill (1. );
118122 if (fabs (LepGood_pdgId [0 ]* LepGood_pdgId [1 ])< 122 ) continue ;
119- CutFlowAntonis -> Fill (2. );
123+ CutFlow -> Fill (2. );
120124 if (lep .Pt ()< 5 || fabs (lep .Eta ())> 1.5 || lep .Pt ()> 60 ) continue ;
121- CutFlowAntonis -> Fill (3. );
125+ CutFlow -> Fill (3. );
122126 if (fabs (LepGood_pdgId [0 ])== 11 && lep .Pt ()< 7 ) continue ;
123- CutFlowAntonis -> Fill (4. );
127+ CutFlow -> Fill (4. );
124128 // check that a cut was ahead in nLepton !!!!!!!!
125129 TLorentzVector secondLep ;
126130 secondLep .SetPtEtaPhiM (LepGood_pt [1 ], LepGood_eta [1 ], LepGood_phi [1 ],0.1 );
127131 if (secondLep .Pt ()< 3 || fabs (secondLep .Eta ())> 1.5 || secondLep .Pt ()> 60 ) continue ;
128- CutFlowAntonis -> Fill (5. );
132+ CutFlow -> Fill (5. );
129133 // lepton cuts
130134 if (LepGood_relIso [0 ]* lep .Pt ()> 10. ) continue ;
131135 if (LepGood_relIso [1 ]* secondLep .Pt ()> 5. ) continue ;
132136 if (LepGood_relIso [1 ]> .5 ) continue ;
133- CutFlowAntonis -> Fill (6. );
137+ CutFlow -> Fill (6. );
134138 // JET CUTS
135139 if (nJet > 0 ){
136140 if (Jet_pt [0 ] < 150 ) continue ;
@@ -139,28 +143,30 @@ TFile* SUSYLooperHists::Loop()
139143 if (nJet > 2 ){
140144 if (Jet_pt [2 ] > 60 ) continue ;
141145 }
142- CutFlowAntonis -> Fill (7. );
146+ CutFlow -> Fill (7. );
143147 if (met .Pt ()/HT30 < 2. /3. ) continue ;
144148 if (nb40 != 0 ) continue ;
145- CutFlowAntonis -> Fill (9. );
146- // preselection syncronizd to Antonis ++++++++++++++++++++
149+ CutFlow -> Fill (9. );
150+ // preselection syncronizd to ++++++++++++++++++++
147151
148152 if (MT > 60 && MT < 100 ) continue ;
149153
150154
151155 float pairmass = DiTau_InvMass (met ,lep ,secondLep ,0 );
152156 if (lep .Pt ()> 25 || secondLep .Pt ()> 15 ) continue ;
157+
158+ // define some over and underflow
153159 if (pairmass > 2000 ) pairmass = 1999. ;
154160 if (pairmass < 0 ) pairmass = 0. ;
155161
156- LepTwoZmass -> Fill (pairmass ,weight );
162+ LepTwoZmass -> Fill (pairmass ,weight * puWeight );
157163
158164
159165 if ((LepGood_pdgId [0 ]* LepGood_pdgId [1 ]< -121 ))
160166 {
161167
162168 if (pairmass > 160 || pairmass < 20 ){
163- CutFlowAntonis -> Fill (10. , weight * puWeight );
169+ CutFlow -> Fill (10. , weight * puWeight );
164170 scanB -> Fill (GenSusyMStop ,GenSusyMNeutralino );
165171
166172 if (nb30L == 0 )
@@ -191,7 +197,7 @@ TFile* SUSYLooperHists::Loop()
191197 scanB -> Divide (scan );
192198 scanC -> Divide (scan );
193199
194- CutFlowAntonis -> DrawCopy ();
200+ CutFlow -> DrawCopy ();
195201
196202 myFile -> Write ();
197203 return (myFile );
0 commit comments