Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/Example7.C

    rb03c0d0 rf8e61b2  
    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
Note: See TracChangeset for help on using the changeset viewer.