Fork me on GitHub

Changes in / [c1780a5:b4786d3] in git


Ignore:
Location:
examples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • examples/Example7.C

    rc1780a5 rb4786d3  
    3030  TClonesArray *branchElectron = treeReader->UseBranch("ElectronMedium");
    3131  TClonesArray *branchWeight = treeReader->UseBranch("Weight");
    32   TClonesArray *branchEvent = treeReader->UseBranch("Event");
    3332
    3433  // Book histograms
     
    4140    // Load selected branches with data from specified event
    4241    treeReader->ReadEntry(entry);
    43    
    44     // main MC event weight
    45     HepMCEvent *event = (HepMCEvent*) branchEvent -> At(0);
    46     Double_t w = event->Weight;
    47    
    48     // read lhe event weights
     42
     43    Double_t w =1.0;
     44    // read MC event weight
    4945    if(branchWeight->GetEntries() > 0)
    5046    {
    5147      Weight *weight = (Weight*) branchWeight -> At(0);
    52       Double_t lhe_weight = weight->Weight;
    53      
    54       //cout<<lhe_weight<<endl;
    55       // do stuff ...
     48      w = weight->Weight;
    5649    }
    57 
     50   
    5851    // If event contains at least 1 jet
    5952    if(branchJet->GetEntries() > 0)
     
    7366        histJetPT->Fill(jet->PT, w);
    7467    }
     68
    7569
    7670    // If event contains at least 1 jet
  • examples/Example7.py

    rc1780a5 rb4786d3  
    3333
    3434# Get pointers to branches used in this analysis
    35 branchJet      = treeReader.UseBranch("JetPUPPITight")
     35branchJet = treeReader.UseBranch("JetPUPPITight")
    3636branchElectron = treeReader.UseBranch("ElectronMedium")
    37 branchWeight   = treeReader.UseBranch("Weight")
    38 branchEvent    = treeReader.UseBranch("Event")
     37branchWeight = treeReader.UseBranch("Weight")
    3938
    4039# Book histograms
     
    4746  treeReader.ReadEntry(entry)
    4847
    49   ## main MC event weight
    50   w =  branchEvent[0].Weight
     48  w = 1.0 
     49  ## read MC event weight
     50  if branchWeight.GetEntries() > 0: 
     51    weight = branchWeight.At(0).Weight
    5152
    52   ## read lhe event weight
    53   for weight in branchWeight: 
    54     lhe_weight = weight.Weight
    55     ## do stuff ...
    56     ## print lhe_weight
    57    
    5853  # If event contains at least 1 jet
    5954  if branchJet.GetEntries() > 0:
     
    8176    eta = abs(electron.Eta)
    8277
    83     ## looseCut = 0.3, mediumCut = 0.2, tightCut = 0.1
    8478    IsoCut = 0.2
    8579    IsoOk = electron.IsolationVar < IsoCut
Note: See TracChangeset for help on using the changeset viewer.