I can run the code inside the macro but I can’t run the macro.
(Thank you for your help)
I am getting an error message:
error: unknown type name ‘Jet’
Jet jet = (Jet) branchJet->At(0); //only take leading jet
Here is my macro code:
#include "/home/bmondal/Delphes-3.4.1/external/ExRootAnalysis/ExRootTreeReader.h"
#include "/home/bmondal/root/include/TROOT.h"
void trim(){
gSystem->Load("~/Delphes-3.4.1/libDelphes");
TChain chain("Delphes");
chain.Add("/media/bmondal/PROJECT/DELPHES/outputpp.root");
ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
Long64_t numberOfEntries = treeReader->GetEntries();
TClonesArray *branchJet = treeReader->UseBranch("FatJet");
//Follow exroottree reader example
//Here is one code i have used for analysis
for(Int_t entry = 0; entry<numberOfEntries; ++entry){
treeReader->ReadEntry(entry);
if(branchJet->GetEntries()>0) {
Jet *jet = (Jet*) branchJet->At(0); //only take leading jet
cout<<entry<<",";
for(int i = 0; i<5; i++){
for(int j = 0; j<4; j++){
cout<<jet->TrimmedP4[i][j]<<",";
}
}
}
}
cout<<endl;
}
ROOT Version: 6.12
Platform: Ubuntu 18.04
Compiler: Not Provided