// Tree Branches : /* ****************************************************************************** *Tree :LHEF : Analysis tree * *Entries : 10000 : Total = 11802875 bytes File Size = 4317913 * * : : Tree compression factor = 2.73 * ****************************************************************************** *Br 0 :Event : Int_t Event_ * *Entries : 10000 : Total Size= 86496 bytes File Size = 12506 * *Baskets : 2 : Basket Size= 64000 bytes Compression= 6.41 * *............................................................................* *Br 1 :Event.fUniqueID : UInt_t fUniqueID[Event_] * *Entries : 10000 : Total Size= 80785 bytes File Size = 12516 * *Baskets : 2 : Basket Size= 64000 bytes Compression= 6.41 * *............................................................................* *Br 2 :Event.fBits : UInt_t fBits[Event_] * *Entries : 10000 : Total Size= 80761 bytes File Size = 12508 * *Baskets : 2 : Basket Size= 64000 bytes Compression= 6.41 * *............................................................................* *Br 3 :Event.Number : Long64_t Number[Event_] * *Entries : 10000 : Total Size= 120854 bytes File Size = 32118 * *Baskets : 3 : Basket Size= 64000 bytes Compression= 3.74 * *............................................................................* *Br 4 :Event.Nparticles : Int_t Nparticles[Event_] * *Entries : 10000 : Total Size= 80791 bytes File Size = 12543 * *Baskets : 2 : Basket Size= 64000 bytes Compression= 6.39 * *............................................................................* *Br 5 :Event.ProcessID : Int_t ProcessID[Event_] * *Entries : 10000 : Total Size= 80785 bytes File Size = 12536 * *Baskets : 2 : Basket Size= 64000 bytes Compression= 6.40 * *............................................................................* *Br 6 :Event.Weight : Double_t Weight[Event_] * *Entries : 10000 : Total Size= 120854 bytes File Size = 12311 * *Baskets : 3 : Basket Size= 64000 bytes Compression= 9.77 * *............................................................................* *Br 7 :Event.ScalePDF : Double_t ScalePDF[Event_] * *Entries : 10000 : Total Size= 120868 bytes File Size = 12286 * *Baskets : 3 : Basket Size= 64000 bytes Compression= 9.79 * *............................................................................* *Br 8 :Event.CouplingQED : Double_t CouplingQED[Event_] * *Entries : 10000 : Total Size= 120889 bytes File Size = 12320 * *Baskets : 3 : Basket Size= 64000 bytes Compression= 9.76 * *............................................................................* *Br 9 :Event.CouplingQCD : Double_t CouplingQCD[Event_] * *Entries : 10000 : Total Size= 120889 bytes File Size = 12327 * *Baskets : 3 : Basket Size= 64000 bytes Compression= 9.76 * *............................................................................* *Br 10 :Event_size : Event_size/I * *Entries : 10000 : Total Size= 40659 bytes File Size = 420 * *Baskets : 2 : Basket Size= 32000 bytes Compression= 95.60 * *............................................................................* *Br 11 :Rwgt : Int_t Rwgt_ * *Entries : 10000 : Total Size= 82863 bytes File Size = 12496 * *Baskets : 2 : Basket Size= 64000 bytes Compression= 6.41 * *............................................................................* *Br 12 :Rwgt.fUniqueID : UInt_t fUniqueID[Rwgt_] * *Entries : 10000 : Total Size= 40777 bytes File Size = 438 * *Baskets : 2 : Basket Size= 64000 bytes Compression= 91.73 * *............................................................................* *Br 13 :Rwgt.fBits : UInt_t fBits[Rwgt_] * *Entries : 10000 : Total Size= 40753 bytes File Size = 431 * *Baskets : 2 : Basket Size= 64000 bytes Compression= 93.20 * *............................................................................* *Br 14 :Rwgt.Weight : Double_t Weight[Rwgt_] * *Entries : 10000 : Total Size= 40759 bytes File Size = 433 * *Baskets : 2 : Basket Size= 64000 bytes Compression= 92.78 * *............................................................................* *Br 15 :Rwgt_size : Rwgt_size/I * *Entries : 10000 : Total Size= 40653 bytes File Size = 392 * *Baskets : 2 : Basket Size= 32000 bytes Compression= 102.43 * *............................................................................* *Br 16 :Particle : Int_t Particle_ * *Entries : 10000 : Total Size= 93221 bytes File Size = 12527 * *Baskets : 2 : Basket Size= 64000 bytes Compression= 6.40 * *............................................................................* *Br 17 :Particle.fUniqueID : UInt_t fUniqueID[Particle_] * *Entries : 10000 : Total Size= 361274 bytes File Size = 14213 * *Baskets : 7 : Basket Size= 64000 bytes Compression= 25.37 * *............................................................................* *Br 18 :Particle.fBits : UInt_t fBits[Particle_] * *Entries : 10000 : Total Size= 361230 bytes File Size = 14173 * *Baskets : 7 : Basket Size= 64000 bytes Compression= 25.44 * *............................................................................* *Br 19 :Particle.PID : Int_t PID[Particle_] * *Entries : 10000 : Total Size= 361208 bytes File Size = 15077 * *Baskets : 7 : Basket Size= 64000 bytes Compression= 23.92 * *............................................................................* *Br 20 :Particle.Status : Int_t Status[Particle_] * *Entries : 10000 : Total Size= 361241 bytes File Size = 15838 * *Baskets : 7 : Basket Size= 64000 bytes Compression= 22.77 * *............................................................................* *Br 21 :Particle.Mother1 : Int_t Mother1[Particle_] * *Entries : 10000 : Total Size= 361252 bytes File Size = 15399 * *Baskets : 7 : Basket Size= 64000 bytes Compression= 23.42 * *............................................................................* *Br 22 :Particle.Mother2 : Int_t Mother2[Particle_] * *Entries : 10000 : Total Size= 361252 bytes File Size = 15160 * *Baskets : 7 : Basket Size= 64000 bytes Compression= 23.79 * *............................................................................* *Br 23 :Particle.ColorLine1 : Int_t ColorLine1[Particle_] * *Entries : 10000 : Total Size= 361285 bytes File Size = 14203 * *Baskets : 7 : Basket Size= 64000 bytes Compression= 25.39 * *............................................................................* *Br 24 :Particle.ColorLine2 : Int_t ColorLine2[Particle_] * *Entries : 10000 : Total Size= 361285 bytes File Size = 14203 * *Baskets : 7 : Basket Size= 64000 bytes Compression= 25.39 * *............................................................................* *Br 25 :Particle.Px : Double_t Px[Particle_] * *Entries : 10000 : Total Size= 681687 bytes File Size = 444877 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 1.53 * *............................................................................* *Br 26 :Particle.Py : Double_t Py[Particle_] * *Entries : 10000 : Total Size= 681687 bytes File Size = 444807 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 1.53 * *............................................................................* *Br 27 :Particle.Pz : Double_t Pz[Particle_] * *Entries : 10000 : Total Size= 681687 bytes File Size = 444723 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 1.53 * *............................................................................* *Br 28 :Particle.E : Double_t E[Particle_] * *Entries : 10000 : Total Size= 681671 bytes File Size = 489150 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 1.39 * *............................................................................* *Br 29 :Particle.M : Double_t M[Particle_] * *Entries : 10000 : Total Size= 681671 bytes File Size = 205893 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 3.31 * *............................................................................* *Br 30 :Particle.PT : Double_t PT[Particle_] * *Entries : 10000 : Total Size= 681687 bytes File Size = 435009 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 1.57 * *............................................................................* *Br 31 :Particle.Eta : Double_t Eta[Particle_] * *Entries : 10000 : Total Size= 681703 bytes File Size = 451208 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 1.51 * *............................................................................* *Br 32 :Particle.Phi : Double_t Phi[Particle_] * *Entries : 10000 : Total Size= 681703 bytes File Size = 505827 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 1.35 * *............................................................................* *Br 33 :Particle.Rapidity : Double_t Rapidity[Particle_] * *Entries : 10000 : Total Size= 681783 bytes File Size = 501682 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 1.36 * *............................................................................* *Br 34 :Particle.LifeTime : Double_t LifeTime[Particle_] * *Entries : 10000 : Total Size= 681783 bytes File Size = 21982 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 30.98 * *............................................................................* *Br 35 :Particle.Spin : Double_t Spin[Particle_] * *Entries : 10000 : Total Size= 681719 bytes File Size = 77773 * *Baskets : 12 : Basket Size= 64000 bytes Compression= 8.76 * *............................................................................* *Br 36 :Particle_size : Particle_size/I * *Entries : 10000 : Total Size= 40677 bytes File Size = 427 * *Baskets : 2 : Basket Size= 32000 bytes Compression= 94.05 * */ #include #include #include "TFile.h" #include "TTree.h" #include "TCanvas.h" #include "TH1F.h" #include "/scratchfs/cepc/mustapha12/Madrgrah/MG5_aMC_v3_5_6/ExRootAnalysis/ExRootAnalysis/ExRootTreeReader.h" #include "/scratchfs/cepc/mustapha12/Madrgrah/MG5_aMC_v3_5_6/ExRootAnalysis/ExRootAnalysis/ExRootTreeBranch.h" #include "TClonesArray.h" class Particle_Class { public: UInt_t fUniqueID; Double_t E; Int_t PID; Double_t Pz; Double_t Py; Double_t Px; Particle_Class(UInt_t id, Double_t energy ,Int_t pid, Double_t pz, Double_t py, Double_t px) : fUniqueID(id), E(energy),PID(pid), Pz(pz), Py(py), Px(px) {} }; void Lepton_Theta() { gSystem->Load("libExRootAnalysis.so"); gSystem->Load("libPhysics.so"); TChain chain("LHEF"); chain.Add("Decays.root"); ExRootTreeReader *treeReader = new ExRootTreeReader(&chain); Long64_t numberOfEntries = treeReader->GetEntries(); TClonesArray *branch = treeReader->UseBranch("Particle"); TH1 *histo = new TH1F("histo","Momentum",100,-100,100); double thetaCosine; for (Long64_t i = 0; i < numberOfEntries; i++) { treeReader->ReadEntry(i); TVector3 Elec; if (branch) { for (int j = 0; j < branch->GetEntries(); j++) { Particle_Class *p = (Particle_Class*)branch->At(j); if (p) { // electron : if (p->PID == 11) { // cout <<"The py value :"<Py<Fill(p->Pz); } } } } } histo->Draw(); delete treeReader; }