ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/algomez/FourTop/TreeAnalyzer/test/Analyzer.h
Revision: 1.5
Committed: Mon Apr 23 15:55:42 2012 UTC (13 years ago) by algomez
Content type: text/plain
Branch: MAIN
Changes since 1.4: +7 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 algomez 1.1 //////////////////////////////////////////////////////////
2     // This class has been automatically generated on
3     // Wed May 25 13:10:09 2011 by ROOT version 5.27/06b
4     // from TTree top/top
5     // found on file: /uscms_data/d3/ttmuj/Documents/NtupleMaker/Data/2011/41x/v2/SingleMu2011A_v1.root
6     //////////////////////////////////////////////////////////
7    
8     #ifndef Analyzer_h
9     #define Analyzer_h
10    
11 algomez 1.2 #define STANDALONE
12    
13 algomez 1.1 #include <TROOT.h>
14     #include <TH1F.h>
15     #include <TH1D.h>
16 algomez 1.4 #include <TH2D.h>
17     #include <TH2.h>
18     #include <TH3.h>
19     #include <TProofOutputFile.h>
20 algomez 1.1 #include <TChain.h>
21     #include <TFile.h>
22 algomez 1.4 #include <TString.h>
23 algomez 1.1 #include <TSelector.h>
24 algomez 1.4 #include <TSystem.h>
25     #include <TProfile.h>
26     #include <fstream>
27     #include <iostream>
28     #include "BTagSFUtil_lite.h"
29 algomez 1.1
30     #include "Yumiceva/Top7TeV/interface/TopEventNtuple.h"
31     #include "Yumiceva/TreeAnalyzer/interface/MuonSelector.h"
32     #include "Yumiceva/TreeAnalyzer/interface/ElectronSelector.h"
33     #include "Yumiceva/TreeAnalyzer/interface/StoreTreeVariable.h"
34     #include "Yumiceva/TreeAnalyzer/interface/METzCalculator.h"
35     #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
36 algomez 1.2 #include "PhysicsTools/Utilities/interface/Lumi3DReWeighting.h"
37 algomez 1.3
38 algomez 1.1
39     #include <map>
40     #include <string>
41     #include <vector>
42    
43 algomez 1.2 #include "LOTable.h"
44    
45 algomez 1.1 class Analyzer : public TSelector {
46    
47     private:
48     void ParseInput();
49     TString fMyOpt;
50     int fChannel;
51     bool fVerbose;
52     bool fIsMC;
53     bool fdoQCD1SideBand;
54     bool fdoQCD2SideBand;
55     bool fdoJECunc;
56     bool fdoJECup;
57     bool fdoMtopCut;
58 algomez 1.2 bool fdoJERunc;
59     bool fdoJERup;
60     bool fdoJERdown;
61 algomez 1.5 bool fdodiLepton;
62 algomez 1.2 bool fpu_up;
63     bool fpu_down;
64 algomez 1.5 bool fbtag_up;
65     bool fbtag_down;
66 algomez 1.2
67 algomez 1.1 //HistoManager *fHist;
68     TString fSample;
69     TString fOutdir;
70     TH1F *h1test;
71     TH1D *hcutflow;
72     map< string, TH1*> hmuons;
73 algomez 1.4 map< string, TH1*> hbtageff;
74 algomez 1.1 map< string, TH1*> helectrons;
75     map< string, TH1*> hjets;
76     map< string, TH1*> hPVs;
77     map< string, TH1*> hMET;
78     map< string, TH1*> hM;
79     vector< string > fCutLabels;
80     vector< double > fpu_weights_vec;
81 algomez 1.2 edm::Lumi3DReWeighting LumiWeights_;
82     edm::Lumi3DReWeighting LumiWeightsdown_;
83     edm::Lumi3DReWeighting LumiWeightsup_;
84 algomez 1.4
85     TFile* scfactorfile;
86     TH2D* f2Delecsc;
87     TH2D* f2Djetsc;
88     TH2D* f2Djetasysc;
89     TH1D* f1Dpfmhtsc;
90     TFile* efffile;
91     TH2D* f2Djetdataeff;
92     TH2D* f2Djetmceff;
93     TFile* btagefffile;
94     TH2D* f2Dttbarbtag;
95     TH2D* f2Dttbarctag;
96     TH2D* f2Dttbarlighttag;
97     TH2D* f2Dwprimebtag;
98     TH2D* f2Dwprimectag;
99     TH2D* f2Dwprimelighttag;
100     //Medium
101     LOTable bSF_table;
102     LOTable bSF_table_error;
103     LOTable lSF_table;
104     LOTable lSF_table_error_down;
105     LOTable lSF_table_error_up;
106     LOTable leff_table;
107     //Loose
108     LOTable bSF_table_loose;
109     LOTable bSF_table_error_loose;
110     LOTable lSF_table_loose;
111     LOTable lSF_table_error_down_loose;
112     LOTable lSF_table_error_up_loose;
113     LOTable leff_table_loose;
114     //Tight
115     LOTable bSF_table_tight;
116     LOTable bSF_table_error_tight;
117     LOTable lSF_table_tight;
118     LOTable lSF_table_error_down_tight;
119     LOTable lSF_table_error_up_tight;
120     LOTable leff_table_tight;
121     //LOTableHeavy bSF_table_loose;
122     //LOTableHeavy bSF_table_medium;
123     //LOTableHeavy bSF_table_tight;
124     //LOTableLight leff_SF_table_loose;
125     //LOTableLight leff_SF_table_medium;
126     //LOTableLight leff_SF_table_tight;
127    
128     map<string, TH1*> jethist;
129     map<string, TH2*> btageff;
130 algomez 1.1
131     public :
132    
133 algomez 1.4 JetCorrectionUncertainty *fJECunc;
134 algomez 1.1 TTree *fChain; //!pointer to the analyzed TTree or TChain
135     TopEventNtuple *ntuple;
136     StoreTreeVariable *MyStoreTree; // My Storing Tree
137     TFile *fFile;
138     TProofOutputFile *fProofFile; // For optimized merging of the ntuple
139     MuonSelector fMuSelector;
140     ElectronSelector fEleSelector;
141 algomez 1.4 METzCalculator fzCalculator;
142 algomez 1.1 map< string, double > cutmap;
143    
144 algomez 1.2 Analyzer(TTree * /*tree*/ =0):h1test(0),fChain(0),ntuple(),fFile(0),fProofFile(0),fMuSelector(),fEleSelector()
145 algomez 1.1 {
146     fChannel = 1; //default mu+jets
147     fVerbose = false;
148     fIsMC = true;
149     fSample = "";
150     fOutdir = "";
151     fdoQCD1SideBand = false;
152     fdoQCD2SideBand = false;
153     fdoJECunc = false;
154     fdoJECup = true;
155 algomez 1.5 fdoJERunc = true;//false;
156 algomez 1.2 fdoJERup = false;
157     fdoJERdown = false;
158 algomez 1.5 fdodiLepton = false;
159 algomez 1.1 fdoMtopCut = true;
160 algomez 1.2 fpu_up = false;
161     fpu_down = false;
162 algomez 1.5 fbtag_up = false;
163     fbtag_down = false;
164 algomez 1.1 }
165     virtual ~Analyzer() { }
166     virtual Int_t Version() const { return 2; }
167     virtual void Begin(TTree *tree);
168     virtual void SlaveBegin(TTree *tree);
169     virtual void Init(TTree *tree);
170     virtual Bool_t Notify();
171     virtual Bool_t Process(Long64_t entry);
172     virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0) { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; }
173     virtual void SetOption(const char *option) { fOption = option; }
174     virtual void SetObject(TObject *obj) { fObject = obj; }
175     virtual void SetInputList(TList *input) { fInput = input; }
176     virtual TList *GetOutputList() const { return fOutput; }
177     virtual void SlaveTerminate();
178     virtual void Terminate();
179    
180     ClassDef(Analyzer,0);
181     };
182    
183     #endif
184    
185    
186     //#ifdef Analyzer_cxx
187     void Analyzer::Init(TTree *tree)
188     {
189     // The Init() function is called when the selector needs to initialize
190     // a new tree or chain. Typically here the branch addresses and branch
191     // pointers of the tree will be set.
192     // It is normally not necessary to make changes to the generated
193     // code, but the routine can be extended by the user if needed.
194     // Init() will be called many times when running on PROOF
195     // (once per file to be processed).
196    
197     Info("Init","tree: %p", tree);
198    
199     // Set branch addresses and branch pointers
200     if (!tree) return;
201    
202     fChain = tree;
203     fChain->SetBranchAddress("top.", &ntuple);
204     }
205    
206     Bool_t Analyzer::Notify()
207     {
208     // The Notify() function is called when a new file is opened. This
209     // can be either for a new TTree in a TChain or when when a new TTree
210     // is started when using PROOF. It is normally not necessary to make changes
211     // to the generated code, but the routine can be extended by the
212     // user if needed. The return value is currently not used.
213    
214     return kTRUE;
215     }
216    
217     //#endif // #ifdef Analyzer_cxx