Hello,
for my analysis I run my code on some ntuples and I save the relevant elements of the good events in an output tree whose branches are TLorentzVector.
Here’s the declaration of my output tree:
// define the output tree
TTree *reduced_ntuple = new TTree("higgs", "higgs ntuple");
Int_t channel(-1);
TLorentzVector *Higgs = new TLorentzVector();
TLorentzVector *Z_had = new TLorentzVector();
TLorentzVector *Z_lep = new TLorentzVector();
TLorentzVector *jet_l = new TLorentzVector();
TLorentzVector *jet_nl = new TLorentzVector();
TLorentzVector *lep_l = new TLorentzVector();
TLorentzVector *lep_nl = new TLorentzVector();
TVector2 *met = new TVector2();
reduced_ntuple->Branch("last_cut_passed", &last_cut_passed);
reduced_ntuple->Branch("channel", &channel);
reduced_ntuple->Branch("Higgs", &Higgs);
reduced_ntuple->Branch("Z_had", &Z_had);
reduced_ntuple->Branch("Z_lep", &Z_lep);
reduced_ntuple->Branch("jet_l", &jet_l);
reduced_ntuple->Branch("jet_nl", &jet_nl);
reduced_ntuple->Branch("lep_l", &lep_l);
reduced_ntuple->Branch("lep_nl", &lep_nl);
reduced_ntuple->Branch("met", &met);
In my code I run the analysis, fill the variables and at the end there is the
command.
My output ntuple has indeed the TTree with the above structure. Now I have a lot of problems when I try to work with this output ntuple. I cannot make plots from command line:
root [1] higgs->Draw("jet_l.DeltaR(jet_nl)")
Error: Symbol jet_nl is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: class,struct,union or type (unknown) not defined (tmpfile):1:
Error: Symbol jet_nl is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: class,struct,union or type (unknown) not defined (tmpfile):1:
*** Interpreter error recovered ***
*** Break *** segmentation violation
(...)
So I tried to make a Selector from the TTree, and here’s the result (an example for the Higgs branch):
//TLorentzVector *Higgs;
UInt_t fUniqueID;
UInt_t fBits;
UInt_t fP_fUniqueID;
UInt_t fP_fBits;
Double_t fP_fX;
Double_t fP_fY;
Double_t fP_fZ;
Double_t fE;
and the same result for all the other TLorentzVector branches (these are the only variables listed for the Higgs branch).
What’s the problem? How can I work with the TLorentzVectors that I select in my analysis??
Thanks,
Francesco