ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/src/cutFlow.cxx
Revision: 1.3
Committed: Mon Jun 11 12:32:19 2012 UTC (12 years, 11 months ago) by bortigno
Content type: text/plain
Branch: MAIN
CVS Tags: lhcp_UnblindFix, hcp_Unblind, lhcp_11April, LHCP_PreAppFixAfterFreeze, LHCP_PreAppFreeze, workingVersionAfterHCP, hcpApproval, hcpPreApp, ICHEP8TeV, ichep8TeV, HEAD
Changes since 1.2: +10 -13 lines
Log Message:
preliminayr fixes. Now it compiles and runs

File Contents

# User Rev Content
1 bortigno 1.1 #include <TROOT.h>
2     #include <TCanvas.h>
3     #include <TGraph.h>
4     #include <TGraphErrors.h>
5     #include <TLegend.h>
6     #include <iostream>
7 bortigno 1.2 #include "../interface/CutsAndHistos.h"
8 bortigno 1.3 #include "../plugins/Histos.h"
9     #include "../plugins/Cuts/Cuts.hpp"
10 bortigno 1.1 #include "TF1.h"
11     #include "TH1.h"
12 bortigno 1.2 #include "../interface/samples.hpp"
13     #include "../interface/ntupleReader.hpp"
14 bortigno 1.3 #include "../test/SideBandAnalysis-Pt50To100/sampleSideBand.h"
15 bortigno 1.1 #include "Riostream.h"
16     #include "TMatrixD.h"
17     #include "TVectorD.h"
18     #include "TDecompChol.h"
19     #include "TDecompSVD.h"
20 bortigno 1.3 #include "../plugins/setTDRStyle.C"
21     #include "../interface/controlRegions.h"
22 bortigno 1.1
23     #define ZeeL 4683.5
24     #define fA 0.46502
25     #define fB 0.53498
26    
27     int main(int argc, char **argv)
28     {
29    
30 bortigno 1.3 typedef std::vector<Sample> sampleCollection;
31 bortigno 1.1 setTDRStyle();
32     bool verbose_ = true;
33     TCanvas * c1 = new TCanvas("c1","c1", 600,600);
34     TH1D * h = new TH1D("h","h",30,0,300);
35     CutSample *PreSelZee = new PreSelectionZee;
36     PCutSet signalRegionCutFlow;
37    
38     signalRegionCutFlow.add( new EmptyCut );
39     signalRegionCutFlow.add( new VMassCutMin(75.) );
40     signalRegionCutFlow.add( new VMassCutMax(105.) );
41     signalRegionCutFlow.add( new JetPtCut(20.) );
42     signalRegionCutFlow.add( new VPtCut(100.) );
43 bortigno 1.3 signalRegionCutFlow.add( new JetBtagCut(0.244, 0.244) );
44     signalRegionCutFlow.add( new HMassCut(80.) );
45     signalRegionCutFlow.add( new HMassCutMax(120.) );
46 bortigno 1.1
47 bortigno 1.3 sampleCollection samples = trees();
48 bortigno 1.1 std::vector< controlRegion > cutFlowCR;
49    
50     for(int i=0; i<signalRegionCutFlow.size(); ++i){
51     cutFlowCR.push_back( controlRegion(ZeeL,fA,fB) );
52     cutFlowCR.at(i).init();
53     }
54    
55     for(size_t iS = 0; iS < samples.size(); ++iS ){
56    
57     samples.at(iS).dump(1);
58    
59     TFile* f = samples.at(iS).file();
60     if(f==0){
61     std::cerr << "File not found " << std::endl;
62     std::cerr << "Please check the path of this file " << samples.at(iS).filename << std::endl;
63     return -1;
64     }
65    
66     ntupleReader event(samples.at(iS).filename.c_str());
67     bool trigger = true;
68     Long64_t entries = event.fChain->GetEntriesFast();
69     //Loop on all events of this file
70     for (unsigned int iEvent = 0; iEvent < entries; ++iEvent){
71     event.GetEntry(iEvent);
72    
73     //to speed up the loop
74     if( event.Vtype != 1 )
75     continue;
76    
77     //cut flow loop
78     for(int i=0; i<signalRegionCutFlow.size(); ++i){
79     cutFlowCR.at(i).fill( samples.at(iS), *PreSelZee, signalRegionCutFlow , i+1 , event );
80     }
81    
82     }
83    
84     }
85    
86     for(int i=0; i<signalRegionCutFlow.size(); ++i){
87     std::string cutFlowName = "";
88     cutFlowName += signalRegionCutFlow.getCut(i)->name() + " " ;
89     std::cout << " --- Cut Flow " << cutFlowName << " --- " << std::endl;
90     std::cout << "DYL = " << cutFlowCR.at(i).cDYL() << " +- " << cutFlowCR.at(i).eDYL() << std::endl;
91     std::cout << "DYB = " << cutFlowCR.at(i).cDYB() << " +- " << cutFlowCR.at(i).eDYB() << std::endl;
92     std::cout << "TTbar = " << cutFlowCR.at(i).cTTbar() << " +- " << cutFlowCR.at(i).eTTbar() << std::endl;
93     std::cout << "VV = " << cutFlowCR.at(i).cVV() << " +- " << cutFlowCR.at(i).eVV() << std::endl;
94     std::cout << "ST = " << cutFlowCR.at(i).cST() << " +- " << cutFlowCR.at(i).eST() << std::endl;
95     std::cout << "WJETS = " << cutFlowCR.at(i).cWJETS() << " +- " << cutFlowCR.at(i).eWJETS() << std::endl;
96     std::cout << "Others = " << cutFlowCR.at(i).cOthers() << " +- " << cutFlowCR.at(i).eOthers() << std::endl;
97     std::cout << "Signal = " << cutFlowCR.at(i).cSignal() << " +- " << cutFlowCR.at(i).eSignal() << std::endl;
98     std::cout << "Total = " << cutFlowCR.at(i).cTotal() << " +- " << cutFlowCR.at(i).eTotal() << std::endl;
99     std::cout << "Data = " << cutFlowCR.at(i).cData() << " +- " << cutFlowCR.at(i).eData() << std::endl;
100    
101     }
102    
103    
104     return 0;
105     }