ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/Selection/src/Selection.cc
(Generate patch)

Comparing UserCode/MitHzz4l/Selection/src/Selection.cc (file contents):
Revision 1.14 by khahn, Tue Nov 1 19:15:53 2011 UTC vs.
Revision 1.15 by khahn, Sun Nov 6 15:56:02 2011 UTC

# Line 10 | Line 10
10   #include "EfficiencyWeightsInterface.h"
11  
12   RunLumiRangeMap rlrm;
13 + TH1D * hpu;
14 +
15  
16   // #include "TH2D.h"
17   // extern TH2D * h_mu_eff_idiso_2011a;
# Line 34 | Line 36 | void initRunLumiRangeMap() {
36    rlrm.AddJSONFile(std::string("./data/Cert_160404-178078_7TeV_PromptReco_Collisions11_JSON.txt"));
37    rlrm.AddJSONFile(std::string("./data/Cert_160404-163869_7TeV_May10ReReco_Collisions11_JSON_v3.txt"));  
38    rlrm.AddJSONFile(std::string("./data/Cert_170249-172619_7TeV_ReReco5Aug_Collisions11_JSON.txt"));  
39 +  TFile * puf = new TFile("data/PileupReweighting.Summer11DYmm_To_Run2011A.root");
40 +  hpu = (TH1D*)(puf->Get("puWeights"));
41   };
42  
43   void initRunLumiRangeMap(RunLumiRangeMap &rlrm) {
# Line 117 | Line 121 | unsigned fails_HZZ4L_selection(ControlFl
121           << endl;
122    }
123  
124 +  unsigned npu; double npuw;
125    if( !ctrl.mc ) {
126      // not accounting for overlap atm
127      RunLumiRangeMap::RunLumiPairType rl(info->runNum, info->lumiSec);      
# Line 125 | Line 130 | unsigned fails_HZZ4L_selection(ControlFl
130        evtfail |= (1<<EVTFAIL_JSON);
131        return evtfail;
132      }
133 +  } else {
134 +    npu = info->nPU;
135 +    npuw = hpu->GetBinContent(hpu->FindBin(npu));
136    }
137    
138    
# Line 839 | Line 847 | unsigned fails_HZZ4L_selection(ControlFl
847              passtuple->SetBranchAddress("werroff", &werr_offline );
848              passtuple->SetBranchAddress("won", &w_online );
849              passtuple->SetBranchAddress("werron", &werr_online );
850 +            passtuple->SetBranchAddress("npu", &npu );
851 +            passtuple->SetBranchAddress("npuw", &npuw );
852 +            passtuple->SetBranchAddress("gchannel",  &gchannel);
853            }
854            if( ctrl.btag ) {
855            passtuple->SetBranchAddress("l3tche",    &l3tche);
# Line 851 | Line 862 | unsigned fails_HZZ4L_selection(ControlFl
862            passtuple->SetBranchAddress("l4csvMva",  &l4csvMva);
863            }
864  
854          if( ctrl.mc )           passtuple->SetBranchAddress("gchannel",  &gchannel);
865            passtuple->Fill( );
856
866          }
867  
868          if( ctrl.debug ) cout  << "run: " << info->runNum  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines