Delphes root problem

Asked by Nico

Dear experts,

I just generate e- e+ > z h, (z > vl vl~), (h > b b~) process.
Then, I want to plot the invariant mass of bottom pairs and lepton pair, but my plot is empty.
There are some errors.
I use MG5_aMC_v2_5_4 and root6.08.

my root command is: root -l examples/HiggsInvMass.C'("ee_delphes.root")'
I attached 'HiggsInvMass.C' macro file.

/*
Simple macro showing how to access branches from the delphes output root file,
loop over events, and plot simple quantities such as the jet pt and the di-electron invariant
mass.

root -l examples/Example1.C'("delphes_output.root")'
*/

#ifdef __CLING__
R__LOAD_LIBRARY(libDelphes)
#include "classes/DelphesClasses.h"
#include "external/ExRootAnalysis/ExRootTreeReader.h"
#endif

//------------------------------------------------------------------------------

void top_NOfilter()
{
  gSystem->Load("libDelphes");

  // Create chain of root trees
  TChain chain("Delphes");
  chain.Add("ee_delphes.root");

  // Create object of class ExRootTreeReader
  ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
  Long64_t numberOfEntries = treeReader->GetEntries();

  // Get pointers to branches used in this analysis
  TClonesArray *branchJet = treeReader->UseBranch("Jet");
  TClonesArray *branchElectron = treeReader->UseBranch("Electron");

  // Book histograms
   TH1 *histMass = new TH1F("mass", "M_{inv}(e_{1}, e_{2})", 100, 40.0, 140.0);
  TH1 *h1 = new TH1F("h1", "Z boson invariant mass", 100, 50.0, 100.0);
  TH1 *h2 = new TH1F("h2", "B tagging", 100, 0.0, 50.0);
  TH1 *h3 = new TH1F("h3", "Higgs boson invariant mass", 100, 50.0, 250.0);

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

    // If event contains at least 1 jet
    if(branchJet->GetEntries() > 1)
    {
      // Take first jet
      Jet *jet0 = (Jet*) branchJet->At(0);
      Jet *jet1 = (Jet*) branchJet->At(1);

      // Plot jet transverse momentum

      InvMass = ((jet0->P4()) + (jet1->P4())).M();
      //if(InvMass < 65 | InvMass > 95) continue;
      h1 -> Fill(InvMass);

    }

  }

 // define the number of B-jets in the event
  int NofBs = 0;

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

    // set the number of B-jets in the event to 0
    NofBs = 0;

    // If event contains at least 1 jet
    for(unsigned int i = 0; i < branchJet->GetEntries(); i++)
    {
      // Take first jet
      Jet *jet = (Jet*) branchJet->At(i);

      if (jet->BTag == 1) NofBs++;

      InvMass1 = ((jet -> P4()).M());
      h2 -> Fill(InvMass1);
    }

      InvMass2 = ((jet -> P4()) + (jet0->P4()) + (jet1->P4())).M() ;
// if(((jet -> P4()) + (jet0->P4())).M() < 65 | ((jet -> P4()) + (jet0->P4())).M() > 95) continue;
      h3 -> Fill(InvMass2);

  }

  // Show resulting histograms

  h3->Draw();

  TFile * f1 = new TFile("top_NOfilter.root","NEW");
  f1 -> cd();
  h1 -> Write();
  h2 -> Write();
  h3 -> Write();
  f1 -> Close();
}

Please help me.

Thanks.

Best,
Nico

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi Nico,

I guess that you ask your question on the wrong forum. You should contact Delphes author on this topic.

Cheers,

Olivier

Can you help with this problem?

Provide an answer of your own, or ask Nico for more information if necessary.

To post a message you must log in.