Delphes root problem
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/
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/
*/
#ifdef __CLING__
R__LOAD_
#include "classes/
#include "external/
#endif
//-----
void top_NOfilter()
{
gSystem-
// Create chain of root trees
TChain chain("Delphes");
chain.
// Create object of class ExRootTreeReader
ExRootTreeReader *treeReader = new ExRootTreeReade
Long64_t numberOfEntries = treeReader-
// Get pointers to branches used in this analysis
TClonesArray *branchJet = treeReader-
TClonesArray *branchElectron = treeReader-
// 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-
// If event contains at least 1 jet
if(
{
// 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-
// 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-
{
// 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("
f1 -> cd();
h1 -> Write();
h2 -> Write();
h3 -> Write();
f1 -> Close();
}
Please help me.
Thanks.
Best,
Nico
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Nico for more information if necessary.