Fork me on GitHub

Opened 8 years ago

Last modified 8 years ago

#1004 new How to

How to retreive information on weights from CMS GEN-SIM file

Reported by: sarah malik Owned by:
Priority: minor Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:

Description

Hi,

I'm running Delphes (v3.3.2) on a CMS GEN-SIM file. I wanted to know how to retrieve the information in LHEEventProduct, in particular I need to access the event weights associated with varying the renormalisation/factorisation scales. The Delphes output root file does not seem to contain this.

Thanks!
Sarah

Change History (1)

comment:1 by Michele Selvaggi, 8 years ago

See the code below. Be aware that Delphes simply transcribes there weight vector from CMS input files:

  TClonesArray *branchWeight = treeReader->UseBranch("Rwgt");
  Weight *weight;

  // Loop over all events
  for(Int_t entry = 0; entry < numberOfEntries; ++entry)
  {
    // Load selected branches with data from specified event
    treeReader->ReadEntry(entry);

    cout<<"--------- New Event ---------" <<endl;
    cout<<"" <<endl;

    for(Int_t i=0; i < branchWeight->GetEntriesFast(); i++)
    {
      Weight *weight = (Weight*) branchWeight->At(i);
      cout<<i<<"  "<<weight->Weight<<endl;
    }

  }
Note: See TracTickets for help on using tickets.