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

Comparing UserCode/MitHzz4l/NonMCBackground/src/applyEMU.cc (file contents):
Revision 1.1 by dkralph, Tue Jun 12 23:07:36 2012 UTC vs.
Revision 1.3 by khahn, Wed Jun 20 19:17:19 2012 UTC

# Line 80 | Line 80 | using namespace mithep;
80   //
81   // globals
82   //----------------------------------------------------------------------------
83 < TH1D * hpu;
83 > TH1D *hpu_2011, *hpu_2012;
84   mithep::RunLumiRangeMap rlrm;
85   vector<SimpleLepton> failingLeptons ; // for fake estimation
86   vector<SimpleLepton> passingLeptons;      // for fake estimation
# Line 96 | Line 96 | vector<bool>   PFnoPUflag;;
96   // prototypes
97   //----------------------------------------------------------------------------
98   void initRunLumiRangeMap();
99 < void initPUWeights();
100 < double getPUWeight(unsigned npu);
99 >
100  
101   //
102   // MAIN
# Line 109 | Line 108 | int main(int argc, char** argv)
108    string cmsswpath(CMSSW_BASE);
109    cmsswpath.append("/src");
110    std::bitset<1024> triggerBits;
112  vector<vector<string> > inputFiles;
113  inputFiles.push_back(vector<string>());
111    map<string,unsigned> entrymap; // number of unskimmed entries in each file
112  
113    //
# Line 225 | Line 222 | int main(int argc, char** argv)
222    //
223    // Setup tree I/O
224    //--------------------------------------------------------------------------------------------------------------
228  TFile *inputFile=0;
229  TTree *eventTree=0;  
225    string currentFile("");
226  
227    mithep::EventHeader *info    = new mithep::EventHeader();
# Line 361 | Line 356 | int main(int argc, char** argv)
356        foTree.Fill();
357          
358        if( ctrl.mc)
359 <        setEffiencyWeights(ret4l, weights);
359 >        setEffiencyWeights(ctrl.era, ret4l, weights);
360          
361        nt.Fill();
362      }
# Line 389 | Line 384 | void initRunLumiRangeMap()
384    rlrm.AddJSONFile(std::string("./data/Cert_190456-194479_8TeV_PromptReco_Collisions12_JSON.txt"));  
385  
386   };
392
393
394 //----------------------------------------------------------------------------
395 void initPUWeights()
396 //----------------------------------------------------------------------------
397 {
398  TFile * puf = new TFile("data/PileupReweighting.Summer11DYmm_To_Full2011.root");
399  hpu = (TH1D*)(puf->Get("puWeights"));
400 }
401
402 //----------------------------------------------------------------------------
403 double getPUWeight(unsigned npu)
404 //----------------------------------------------------------------------------
405 {
406  return hpu->GetBinContent(hpu->FindBin(npu));
407 }
408

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines