Hello, I am trying to iterate over the data from a ROOT file produced by Delphes to access the muons from each event and find the invariant mass of a W’ boson. I found it difficult to understand exactly what I am supposed to do to access the leaves of the muon branch of the tree, but based on another post (I am not allowed to include the link as I am a new user) I found an idea of what I may be able to do. I want to print the value to ensure that I have successfully accessed the leaf. However, whether or not I include an integer argument for “GetValue,” if I call
print(tree.GetBranch("Muon").GetLeaf("PT"))
I get “<cppyy.gbl.TLeaf object at 0x(nil)>” for each loop, and if I call
tree.GetBranch("Muon").GetLeaf("PT").Print()
I get “ReferenceError: attempt to access a null-pointer”
get the error “ReferenceError: attempt to access a null-pointer” My code is as follows:
rootfile = TFile.Open("tag_1_delphes_events.root")
tree = rootfile.Get("Delphes")
for eventnumber in range(tree.GetEntries()):
tree.GetEntry(eventnumber)
tree.GetBranch("Muon").GetLeaf("PT").Print()
I would like to know if I am misunderstanding how to access the values stored in these leaves, or if I have otherwise done something wrong. Thank you!
ROOT Version: 6.32.04
Platform: Ubuntu
Compiler: Not Provided
Hello, as an update, I have found that the code
tree.GetLeaf("Muon.Phi").GetValue(0)
Produces a float. However, if the argument to GetValue is any integer other than 0, a value of “0.0” is returned. I was expecting multiple phi values per leaf, as I need to make lorentz vectors out of all of the muons from each event. How can I found the values for the other muons?
pcanal
October 15, 2024, 9:55pm
3
What is the result of tree.GetBranch("Muon").Print()
?
Hello, this code returns “OBJ: TLeafElement Muon.Eta Eta[Muon_]” for every loop.
pcanal
October 15, 2024, 9:59pm
5
You only need to print this information once right after retrieving the tree.
That said, it is odd as I would expects more values that just ‘Eta’.
Ok, If I enter what you said right after retrieving the tree, I get the exact same thing, except only one time of course. Is that supposed to happen?
pcanal
October 15, 2024, 10:29pm
7
Is that supposed to happen?
Yes but there should be more than one line. There should be one for Phi
, Eta
and PT
(according to you expectations)
pcanal
October 15, 2024, 10:31pm
8
Actually it is very surprising that tree.GetBranch("Muon").Print()
prints anything that says TLeafElement
. Either there is a typo in your copy/pasting or your file and/or your installation of ROOT is corrupted.
Hello, I think my expectations of the content of the leaf may have been inaccurate. However, I would still like to make sure nothing is corrupted. Is there any way I can be sure my installation is intact?
pcanal
October 16, 2024, 6:41am
10
On the shell (bash) prompt type:
root.exe -b -l tag_1_delphes_events.root
on the root prompt that appears type:
Delphes->GetBranch("Muon")->Print();
Delphes->Print();
and copy/paste the entire result here.
Hello, this is as much as my terminal will show, and as much as I can paste in
*Br 166 :EFlowTrack.Particle : TRef Particle[EFlowTrack_] *
*Entries : 10000 : Total Size= 3992624 bytes File Size = 878613 *
*Baskets : 21 : Basket Size= 544256 bytes Compression= 4.54 *
*............................................................................*
*Br 167 :EFlowTrack.VertexIndex : Int_t VertexIndex[EFlowTrack_] *
*Entries : 10000 : Total Size= 1359315 bytes File Size = 34377 *
*Baskets : 19 : Basket Size= 188416 bytes Compression= 39.52 *
*............................................................................*
*Br 168 :EFlowTrack_size : EFlowTrack_size/I *
*Entries : 10000 : Total Size= 42235 bytes File Size = 16302 *
*Baskets : 18 : Basket Size= 3831 bytes Compression= 2.55 *
*............................................................................*
*Br 169 :EFlowPhoton : Int_t EFlowPhoton_ *
*Entries : 10000 : Total Size= 92303 bytes File Size = 30745 *
*Baskets : 18 : Basket Size= 64000 bytes Compression= 2.65 *
*............................................................................*
*Br 170 :EFlowPhoton.fUniqueID : UInt_t fUniqueID[EFlowPhoton_] *
*Entries : 10000 : Total Size= 733511 bytes File Size = 354248 *
*Baskets : 18 : Basket Size= 102400 bytes Compression= 2.07 *
*............................................................................*
*Br 171 :EFlowPhoton.fBits : UInt_t fBits[EFlowPhoton_] *
*Entries : 10000 : Total Size= 1078877 bytes File Size = 32291 *
*Baskets : 18 : Basket Size= 148992 bytes Compression= 33.39 *
*............................................................................*
*Br 172 :EFlowPhoton.ET : Float_t ET[EFlowPhoton_] *
*Entries : 10000 : Total Size= 733357 bytes File Size = 642646 *
*Baskets : 18 : Basket Size= 102400 bytes Compression= 1.14 *
*............................................................................*
*Br 173 :EFlowPhoton.Eta : Float_t Eta[EFlowPhoton_] *
*Entries : 10000 : Total Size= 733379 bytes File Size = 664417 *
*Baskets : 18 : Basket Size= 102400 bytes Compression= 1.10 *
*............................................................................*
*Br 174 :EFlowPhoton.Phi : Float_t Phi[EFlowPhoton_] *
*Entries : 10000 : Total Size= 733379 bytes File Size = 667299 *
*Baskets : 18 : Basket Size= 102400 bytes Compression= 1.10 *
*............................................................................*
*Br 175 :EFlowPhoton.E : Float_t E[EFlowPhoton_] *
*Entries : 10000 : Total Size= 733335 bytes File Size = 657596 *
*Baskets : 18 : Basket Size= 102400 bytes Compression= 1.11 *
*............................................................................*
*Br 176 :EFlowPhoton.T : Float_t T[EFlowPhoton_] *
*Entries : 10000 : Total Size= 733335 bytes File Size = 590484 *
*Baskets : 18 : Basket Size= 102400 bytes Compression= 1.24 *
*............................................................................*
*Br 177 :EFlowPhoton.NTimeHits : Int_t NTimeHits[EFlowPhoton_] *
*Entries : 10000 : Total Size= 733511 bytes File Size = 28220 *
*Baskets : 18 : Basket Size= 102400 bytes Compression= 25.96 *
*............................................................................*
*Br 178 :EFlowPhoton.Eem : Float_t Eem[EFlowPhoton_] *
*Entries : 10000 : Total Size= 733379 bytes File Size = 657648 *
*Baskets : 18 : Basket Size= 102400 bytes Compression= 1.11 *
*............................................................................*
*Br 179 :EFlowPhoton.Ehad : Float_t Ehad[EFlowPhoton_] *
*Entries : 10000 : Total Size= 733401 bytes File Size = 28134 *
*Baskets : 18 : Basket Size= 102400 bytes Compression= 26.04 *
*............................................................................*
*Br 180 :EFlowPhoton.Edges[4] : Float_t Edges[EFlowPhoton_] *
*Entries : 10000 : Total Size= 2806440 bytes File Size = 952352 *
*Baskets : 20 : Basket Size= 380416 bytes Compression= 2.95 *
*............................................................................*
*Br 181 :EFlowPhoton.Particles : TRefArray Particles[EFlowPhoton_] *
*Entries : 10000 : Total Size= 5440088 bytes File Size = 585175 *
*Baskets : 22 : Basket Size= 732672 bytes Compression= 9.29 *
*............................................................................*
*Br 182 :EFlowPhoton_size : EFlowPhoton_size/I *
*Entries : 10000 : Total Size= 42257 bytes File Size = 14806 *
*Baskets : 18 : Basket Size= 3831 bytes Compression= 2.81 *
*............................................................................*
*Br 183 :EFlowNeutralHadron : Int_t EFlowNeutralHadron_ *
*Entries : 10000 : Total Size= 93287 bytes File Size = 32439 *
*Baskets : 18 : Basket Size= 64000 bytes Compression= 2.52 *
*............................................................................*
*Br 184 :EFlowNeutralHadron.fUniqueID : *
* | UInt_t fUniqueID[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 1928381 bytes File Size = 888703 *
*Baskets : 19 : Basket Size= 262144 bytes Compression= 2.17 *
*............................................................................*
*Br 185 :EFlowNeutralHadron.fBits : UInt_t fBits[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 2871153 bytes File Size = 45898 *
*Baskets : 20 : Basket Size= 388096 bytes Compression= 62.54 *
*............................................................................*
*Br 186 :EFlowNeutralHadron.ET : Float_t ET[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 1928220 bytes File Size = 1728646 *
*Baskets : 19 : Basket Size= 262144 bytes Compression= 1.11 *
*............................................................................*
*Br 187 :EFlowNeutralHadron.Eta : Float_t Eta[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 1928243 bytes File Size = 1721930 *
*Baskets : 19 : Basket Size= 262144 bytes Compression= 1.12 *
*............................................................................*
*Br 188 :EFlowNeutralHadron.Phi : Float_t Phi[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 1928243 bytes File Size = 1777890 *
*Baskets : 19 : Basket Size= 262144 bytes Compression= 1.08 *
*............................................................................*
*Br 189 :EFlowNeutralHadron.E : Float_t E[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 1928197 bytes File Size = 1732828 *
*Baskets : 19 : Basket Size= 262144 bytes Compression= 1.11 *
*............................................................................*
*Br 190 :EFlowNeutralHadron.T : Float_t T[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 1928197 bytes File Size = 1456072 *
*Baskets : 19 : Basket Size= 262144 bytes Compression= 1.32 *
*............................................................................*
*Br 191 :EFlowNeutralHadron.NTimeHits : Int_t NTimeHits[EFlowNeutralHadron_]*
*Entries : 10000 : Total Size= 1928381 bytes File Size = 39106 *
*Baskets : 19 : Basket Size= 262144 bytes Compression= 49.29 *
*............................................................................*
*Br 192 :EFlowNeutralHadron.Eem : Float_t Eem[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 1928243 bytes File Size = 38875 *
*Baskets : 19 : Basket Size= 262144 bytes Compression= 49.58 *
*............................................................................*
*Br 193 :EFlowNeutralHadron.Ehad : Float_t Ehad[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 1928266 bytes File Size = 1732885 *
*Baskets : 19 : Basket Size= 262144 bytes Compression= 1.11 *
*............................................................................*
*Br 194 :EFlowNeutralHadron.Edges[4] : Float_t Edges[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 7585426 bytes File Size = 2103668 *
*Baskets : 24 : Basket Size= 1017856 bytes Compression= 3.61 *
*............................................................................*
*Br 195 :EFlowNeutralHadron.Particles : *
* | TRefArray Particles[EFlowNeutralHadron_] *
*Entries : 10000 : Total Size= 14900106 bytes File Size = 1725016 *
*Baskets : 31 : Basket Size= 1920512 bytes Compression= 8.64 *
*............................................................................*
*Br 196 :EFlowNeutralHadron_size : EFlowNeutralHadron_size/I *
*Entries : 10000 : Total Size= 42411 bytes File Size = 17175 *
*Baskets : 18 : Basket Size= 3831 bytes Compression= 2.43 *
*............................................................................*
*Br 197 :GenJet : Int_t GenJet_ *
*Entries : 10000 : Total Size= 117346 bytes File Size = 23271 *
*Baskets : 18 : Basket Size= 64000 bytes Compression= 3.50 *
*............................................................................*
*Br 198 :GenJet.fUniqueID : UInt_t fUniqueID[GenJet_] *
*Entries : 10000 : Total Size= 91699 bytes File Size = 16226 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.60 *
*............................................................................*
*Br 199 :GenJet.fBits : UInt_t fBits[GenJet_] *
*Entries : 10000 : Total Size= 91611 bytes File Size = 16149 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.62 *
*............................................................................*
*Br 200 :GenJet.PT : Float_t PT[GenJet_] *
*Entries : 10000 : Total Size= 91545 bytes File Size = 63143 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 1.44 *
*............................................................................*
*Br 201 :GenJet.Eta : Float_t Eta[GenJet_] *
*Entries : 10000 : Total Size= 91567 bytes File Size = 65128 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 1.39 *
*............................................................................*
*Br 202 :GenJet.Phi : Float_t Phi[GenJet_] *
*Entries : 10000 : Total Size= 91567 bytes File Size = 65118 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 1.39 *
*............................................................................*
*Br 203 :GenJet.T : Float_t T[GenJet_] *
*Entries : 10000 : Total Size= 91523 bytes File Size = 62631 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 1.45 *
*............................................................................*
*Br 204 :GenJet.Mass : Float_t Mass[GenJet_] *
*Entries : 10000 : Total Size= 91589 bytes File Size = 62757 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 1.45 *
*............................................................................*
*Br 205 :GenJet.DeltaEta : Float_t DeltaEta[GenJet_] *
*Entries : 10000 : Total Size= 91677 bytes File Size = 57895 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 1.57 *
*............................................................................*
*Br 206 :GenJet.DeltaPhi : Float_t DeltaPhi[GenJet_] *
*Entries : 10000 : Total Size= 91677 bytes File Size = 56689 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 1.60 *
*............................................................................*
*Br 207 :GenJet.Flavor : UInt_t Flavor[GenJet_] *
*Entries : 10000 : Total Size= 91633 bytes File Size = 16167 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.62 *
*............................................................................*
*Br 208 :GenJet.FlavorAlgo : UInt_t FlavorAlgo[GenJet_] *
*Entries : 10000 : Total Size= 91721 bytes File Size = 16238 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.60 *
*............................................................................*
*Br 209 :GenJet.FlavorPhys : UInt_t FlavorPhys[GenJet_] *
*Entries : 10000 : Total Size= 91721 bytes File Size = 16238 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.60 *
*............................................................................*
*Br 210 :GenJet.BTag : UInt_t BTag[GenJet_] *
*Entries : 10000 : Total Size= 91589 bytes File Size = 16109 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.64 *
*............................................................................*
*Br 211 :GenJet.BTagAlgo : UInt_t BTagAlgo[GenJet_] *
*Entries : 10000 : Total Size= 91677 bytes File Size = 16186 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.62 *
*............................................................................*
*Br 212 :GenJet.BTagPhys : UInt_t BTagPhys[GenJet_] *
*Entries : 10000 : Total Size= 91677 bytes File Size = 16186 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.62 *
*............................................................................*
*Br 213 :GenJet.TauTag : UInt_t TauTag[GenJet_] *
*Entries : 10000 : Total Size= 91633 bytes File Size = 16167 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.62 *
*............................................................................*
*Br 214 :GenJet.TauWeight : Float_t TauWeight[GenJet_] *
*Entries : 10000 : Total Size= 91699 bytes File Size = 16226 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.60 *
*............................................................................*
*Br 215 :GenJet.Charge : Int_t Charge[GenJet_] *
*Entries : 10000 : Total Size= 91633 bytes File Size = 30123 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 3.02 *
*............................................................................*
*Br 216 :GenJet.EhadOverEem : Float_t EhadOverEem[GenJet_] *
*Entries : 10000 : Total Size= 91743 bytes File Size = 16321 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.57 *
*............................................................................*
*Br 217 :GenJet.NCharged : Int_t NCharged[GenJet_] *
*Entries : 10000 : Total Size= 91677 bytes File Size = 30293 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 3.00 *
*............................................................................*
*Br 218 :GenJet.NNeutrals : Int_t NNeutrals[GenJet_] *
*Entries : 10000 : Total Size= 91699 bytes File Size = 31079 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 2.93 *
*............................................................................*
*Br 219 :GenJet.NeutralEnergyFraction : *
* | Float_t NeutralEnergyFraction[GenJet_] *
*Entries : 10000 : Total Size= 91963 bytes File Size = 63391 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 1.44 *
*............................................................................*
*Br 220 :GenJet.ChargedEnergyFraction : *
* | Float_t ChargedEnergyFraction[GenJet_] *
*Entries : 10000 : Total Size= 91963 bytes File Size = 59203 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 1.54 *
*............................................................................*
*Br 221 :GenJet.Beta : Float_t Beta[GenJet_] *
*Entries : 10000 : Total Size= 91589 bytes File Size = 16109 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.64 *
*............................................................................*
*Br 222 :GenJet.BetaStar : Float_t BetaStar[GenJet_] *
*Entries : 10000 : Total Size= 91677 bytes File Size = 16186 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.62 *
*............................................................................*
*Br 223 :GenJet.MeanSqDeltaR : Float_t MeanSqDeltaR[GenJet_] *
*Entries : 10000 : Total Size= 91765 bytes File Size = 16267 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.59 *
*............................................................................*
*Br 224 :GenJet.PTD : Float_t PTD[GenJet_] *
*Entries : 10000 : Total Size= 91567 bytes File Size = 16018 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.67 *
*............................................................................*
*Br 225 :GenJet.FracPt[5] : Float_t FracPt[GenJet_] *
*Entries : 10000 : Total Size= 288554 bytes File Size = 19418 *
*Baskets : 18 : Basket Size= 41472 bytes Compression= 14.82 *
*............................................................................*
*Br 226 :GenJet.Tau[5] : Float_t Tau[GenJet_] *
*Entries : 10000 : Total Size= 288488 bytes File Size = 19365 *
*Baskets : 18 : Basket Size= 41472 bytes Compression= 14.86 *
*............................................................................*
*Br 227 :GenJet.SoftDroppedJet : TLorentzVector SoftDroppedJet[GenJet_] *
*Entries : 10000 : Total Size= 830049 bytes File Size = 29483 *
*Baskets : 18 : Basket Size= 111104 bytes Compression= 28.13 *
*............................................................................*
*Br 228 :GenJet.SoftDroppedSubJet1 : *
* | TLorentzVector SoftDroppedSubJet1[GenJet_] *
*Entries : 10000 : Total Size= 830137 bytes File Size = 29547 *
*Baskets : 18 : Basket Size= 111104 bytes Compression= 28.07 *
*............................................................................*
*Br 229 :GenJet.SoftDroppedSubJet2 : *
* | TLorentzVector SoftDroppedSubJet2[GenJet_] *
*Entries : 10000 : Total Size= 830137 bytes File Size = 29547 *
*Baskets : 18 : Basket Size= 111104 bytes Compression= 28.07 *
*............................................................................*
*Br 230 :GenJet.TrimmedP4[5] : TLorentzVector TrimmedP4[GenJet_] *
*Entries : 10000 : Total Size= 3980171 bytes File Size = 64601 *
*Baskets : 21 : Basket Size= 514048 bytes Compression= 61.60 *
*............................................................................*
*Br 231 :GenJet.PrunedP4[5] : TLorentzVector PrunedP4[GenJet_] *
*Entries : 10000 : Total Size= 3980146 bytes File Size = 64579 *
*Baskets : 21 : Basket Size= 514048 bytes Compression= 61.62 *
*............................................................................*
*Br 232 :GenJet.SoftDroppedP4[5] : TLorentzVector SoftDroppedP4[GenJet_] *
*Entries : 10000 : Total Size= 3980271 bytes File Size = 64683 *
*Baskets : 21 : Basket Size= 514560 bytes Compression= 61.52 *
*............................................................................*
*Br 233 :GenJet.NSubJetsTrimmed : Int_t NSubJetsTrimmed[GenJet_] *
*Entries : 10000 : Total Size= 91831 bytes File Size = 16229 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.61 *
*............................................................................*
*Br 234 :GenJet.NSubJetsPruned : Int_t NSubJetsPruned[GenJet_] *
*Entries : 10000 : Total Size= 91809 bytes File Size = 16322 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.58 *
*............................................................................*
*Br 235 :GenJet.NSubJetsSoftDropped : Int_t NSubJetsSoftDropped[GenJet_] *
*Entries : 10000 : Total Size= 91919 bytes File Size = 16305 *
*Baskets : 18 : Basket Size= 16384 bytes Compression= 5.59 *
*............................................................................*
*Br 236 :GenJet.ExclYmerge23 : Double_t ExclYmerge23[GenJet_] *
*Entries : 10000 : Total Size= 140981 bytes File Size = 15779 *
*Baskets : 18 : Basket Size= 22528 bytes Compression= 8.88 *
*............................................................................*
*Br 237 :GenJet.ExclYmerge34 : Double_t ExclYmerge34[GenJet_] *
*Entries : 10000 : Total Size= 140981 bytes File Size = 15779 *
*Baskets : 18 : Basket Size= 22528 bytes Compression= 8.88 *
*............................................................................*
*Br 238 :GenJet.ExclYmerge45 : Double_t ExclYmerge45[GenJet_] *
*Entries : 10000 : Total Size= 140981 bytes File Size = 15779 *
*Baskets : 18 : Basket Size= 22528 bytes Compression= 8.88 *
*............................................................................*
*Br 239 :GenJet.ExclYmerge56 : Double_t ExclYmerge56[GenJet_] *
*Entries : 10000 : Total Size= 140981 bytes File Size = 15779 *
*Baskets : 18 : Basket Size= 22528 bytes Compression= 8.88 *
*............................................................................*
*Br 240 :GenJet.Constituents : TRefArray Constituents[GenJet_] *
*Entries : 10000 : Total Size= 833945 bytes File Size = 331671 *
*Baskets : 18 : Basket Size= 114176 bytes Compression= 2.51 *
*............................................................................*
*Br 241 :GenJet.Particles : TRefArray Particles[GenJet_] *
*Entries : 10000 : Total Size= 833879 bytes File Size = 331607 *
*Baskets : 18 : Basket Size= 114176 bytes Compression= 2.51 *
*............................................................................*
*Br 242 :GenJet.Area : TLorentzVector Area[GenJet_] *
*Entries : 10000 : Total Size= 829829 bytes File Size = 29287 *
*Baskets : 18 : Basket Size= 111104 bytes Compression= 28.31 *
*............................................................................*
*Br 243 :GenJet_size : GenJet_size/I *
*Entries : 10000 : Total Size= 42147 bytes File Size = 7769 *
*Baskets : 18 : Basket Size= 3831 bytes Compression= 5.34 *
*............................................................................*
*Br 244 :GenMissingET : Int_t GenMissingET_ *
*Entries : 10000 : Total Size= 86893 bytes File Size = 15416 *
*Baskets : 18 : Basket Size= 64000 bytes Compression= 5.29 *
*............................................................................*
*Br 245 :GenMissingET.fUniqueID : UInt_t fUniqueID[GenMissingET_] *
*Entries : 10000 : Total Size= 82627 bytes File Size = 15592 *
*Baskets : 18 : Basket Size= 15360 bytes Compression= 5.25 *
*............................................................................*
*Br 246 :GenMissingET.fBits : UInt_t fBits[GenMissingET_] *
*Entries : 10000 : Total Size= 82539 bytes File Size = 15503 *
*Baskets : 18 : Basket Size= 15360 bytes Compression= 5.27 *
*............................................................................*
*Br 247 :GenMissingET.MET : Float_t MET[GenMissingET_] *
*Entries : 10000 : Total Size= 82495 bytes File Size = 54873 *
*Baskets : 18 : Basket Size= 15360 bytes Compression= 1.49 *
*............................................................................*
*Br 248 :GenMissingET.Eta : Float_t Eta[GenMissingET_] *
*Entries : 10000 : Total Size= 82495 bytes File Size = 56261 *
*Baskets : 18 : Basket Size= 15360 bytes Compression= 1.45 *
*............................................................................*
*Br 249 :GenMissingET.Phi : Float_t Phi[GenMissingET_] *
*Entries : 10000 : Total Size= 82495 bytes File Size = 56461 *
*Baskets : 18 : Basket Size= 15360 bytes Compression= 1.45 *
*............................................................................*
*Br 250 :GenMissingET_size : GenMissingET_size/I *
*Entries : 10000 : Total Size= 42279 bytes File Size = 2373 *
*Baskets : 18 : Basket Size= 3831 bytes Compression= 17.52 *
*............................................................................*
*Br 251 :Jet : Int_t Jet_ *
*Entries : 10000 : Total Size= 116614 bytes File Size = 22265 *
*Baskets : 18 : Basket Size= 64000 bytes Compression= 3.66 *
*............................................................................*
*Br 252 :Jet.fUniqueID : UInt_t fUniqueID[Jet_] *
*Entries : 10000 : Total Size= 59551 bytes File Size = 10576 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 5.56 *
*............................................................................*
*Br 253 :Jet.fBits : UInt_t fBits[Jet_] *
*Entries : 10000 : Total Size= 59463 bytes File Size = 10506 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 5.59 *
*............................................................................*
*Br 254 :Jet.PT : Float_t PT[Jet_] *
*Entries : 10000 : Total Size= 59397 bytes File Size = 27115 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.16 *
*............................................................................*
*Br 255 :Jet.Eta : Float_t Eta[Jet_] *
*Entries : 10000 : Total Size= 59419 bytes File Size = 27906 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.10 *
*............................................................................*
*Br 256 :Jet.Phi : Float_t Phi[Jet_] *
*Entries : 10000 : Total Size= 59419 bytes File Size = 27869 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.11 *
*............................................................................*
*Br 257 :Jet.T : Float_t T[Jet_] *
*Entries : 10000 : Total Size= 59375 bytes File Size = 26685 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.20 *
*............................................................................*
*Br 258 :Jet.Mass : Float_t Mass[Jet_] *
*Entries : 10000 : Total Size= 59441 bytes File Size = 27275 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.15 *
*............................................................................*
*Br 259 :Jet.DeltaEta : Float_t DeltaEta[Jet_] *
*Entries : 10000 : Total Size= 59529 bytes File Size = 24783 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.37 *
*............................................................................*
*Br 260 :Jet.DeltaPhi : Float_t DeltaPhi[Jet_] *
*Entries : 10000 : Total Size= 59529 bytes File Size = 24679 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.38 *
*............................................................................*
*Br 261 :Jet.Flavor : UInt_t Flavor[Jet_] *
*Entries : 10000 : Total Size= 59485 bytes File Size = 14503 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 4.05 *
*............................................................................*
*Br 262 :Jet.FlavorAlgo : UInt_t FlavorAlgo[Jet_] *
*Entries : 10000 : Total Size= 59573 bytes File Size = 10551 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 5.57 *
pcanal
October 16, 2024, 7:52pm
12
As you can see it is a totally different format. So now let’s try just:
On the shell (bash) prompt type:
root.exe -b -l tag_1_delphes_events.root
on the root prompt that appears type:
Delphes->GetBranch("Muon")->Print();
Hello, here is the output
*Br 0 :Muon : Int_t Muon_ *
*Entries : 10000 : Total Size= 96267 bytes File Size = 21846 *
*Baskets : 18 : Basket Size= 64000 bytes Compression= 3.73 *
*............................................................................*
*Br 1 :Muon.fUniqueID : UInt_t fUniqueID[Muon_] *
*Entries : 10000 : Total Size= 64227 bytes File Size = 26900 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.36 *
*............................................................................*
*Br 2 :Muon.fBits : UInt_t fBits[Muon_] *
*Entries : 10000 : Total Size= 75035 bytes File Size = 13774 *
*Baskets : 18 : Basket Size= 14336 bytes Compression= 5.39 *
*............................................................................*
*Br 3 :Muon.PT : Float_t PT[Muon_] *
*Entries : 10000 : Total Size= 64073 bytes File Size = 34421 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 1.84 *
*............................................................................*
*Br 4 :Muon.Eta : Float_t Eta[Muon_] *
*Entries : 10000 : Total Size= 64095 bytes File Size = 35263 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 1.80 *
*............................................................................*
*Br 5 :Muon.Phi : Float_t Phi[Muon_] *
*Entries : 10000 : Total Size= 64095 bytes File Size = 35316 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 1.79 *
*............................................................................*
*Br 6 :Muon.T : Float_t T[Muon_] *
*Entries : 10000 : Total Size= 64051 bytes File Size = 33917 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 1.87 *
*............................................................................*
*Br 7 :Muon.Charge : Int_t Charge[Muon_] *
*Entries : 10000 : Total Size= 64161 bytes File Size = 12855 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 4.93 *
*............................................................................*
*Br 8 :Muon.Particle : TRef Particle[Muon_] *
*Entries : 10000 : Total Size= 107789 bytes File Size = 29468 *
*Baskets : 18 : Basket Size= 18432 bytes Compression= 3.63 *
*............................................................................*
*Br 9 :Muon.IsolationVar : Float_t IsolationVar[Muon_] *
*Entries : 10000 : Total Size= 64293 bytes File Size = 26881 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.36 *
*............................................................................*
*Br 10 :Muon.IsolationVarRhoCorr : Float_t IsolationVarRhoCorr[Muon_] *
*Entries : 10000 : Total Size= 64447 bytes File Size = 26997 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.36 *
*............................................................................*
*Br 11 :Muon.SumPtCharged : Float_t SumPtCharged[Muon_] *
*Entries : 10000 : Total Size= 64293 bytes File Size = 23372 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.72 *
*............................................................................*
*Br 12 :Muon.SumPtNeutral : Float_t SumPtNeutral[Muon_] *
*Entries : 10000 : Total Size= 64293 bytes File Size = 22529 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.82 *
*............................................................................*
*Br 13 :Muon.SumPtChargedPU : Float_t SumPtChargedPU[Muon_] *
*Entries : 10000 : Total Size= 64337 bytes File Size = 12945 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 4.91 *
*............................................................................*
*Br 14 :Muon.SumPt : Float_t SumPt[Muon_] *
*Entries : 10000 : Total Size= 64139 bytes File Size = 26554 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 2.39 *
*............................................................................*
*Br 15 :Muon.D0 : Float_t D0[Muon_] *
*Entries : 10000 : Total Size= 64073 bytes File Size = 17547 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 3.61 *
*............................................................................*
*Br 16 :Muon.DZ : Float_t DZ[Muon_] *
*Entries : 10000 : Total Size= 64073 bytes File Size = 15251 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 4.15 *
*............................................................................*
*Br 17 :Muon.ErrorD0 : Float_t ErrorD0[Muon_] *
*Entries : 10000 : Total Size= 64183 bytes File Size = 12857 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 4.93 *
*............................................................................*
*Br 18 :Muon.ErrorDZ : Float_t ErrorDZ[Muon_] *
*Entries : 10000 : Total Size= 64183 bytes File Size = 12857 *
*Baskets : 18 : Basket Size= 12800 bytes Compression= 4.93 *
*............................................................................*
pcanal
October 17, 2024, 6:36am
14
So you file and installation seem fine.
Next let’s try:
Delphes->Scan("Muon.PT:Muon.Phi:Muon.Eta");
to see if the values are as expected.
Hello, here is the output. I can also type “CR” to continue. By the way, thank you so much for your help so far.
***********************************************************
* Row * Instance * Muon.PT * Muon.Phi * Muon.Eta *
***********************************************************
* 0 * 0 * 39.696361 * -0.155881 * -0.102892 *
* 1 * 0 * * * *
* 2 * 0 * * * *
* 3 * 0 * 35.982986 * -0.862355 * 2.0969297 *
* 4 * 0 * 44.925849 * 2.1534700 * -1.319775 *
* 5 * 0 * 42.285682 * 2.5955460 * 2.1354951 *
* 6 * 0 * 38.849365 * -2.638298 * -1.319055 *
* 7 * 0 * 12.602761 * 0.9293479 * 2.1619093 *
* 8 * 0 * 15.537632 * 2.0701789 * 2.3520808 *
* 9 * 0 * 29.646698 * 2.4929325 * 1.1274005 *
* 10 * 0 * 60.044815 * 1.5655405 * -2.397201 *
* 11 * 0 * 49.321197 * 0.2703219 * 0.1996777 *
* 12 * 0 * 29.067380 * -1.803938 * -0.203558 *
* 13 * 0 * * * *
* 14 * 0 * 49.492897 * -2.851774 * 2.2867436 *
* 15 * 0 * * * *
* 16 * 0 * 46.235496 * -0.031460 * -1.934332 *
* 17 * 0 * * * *
* 18 * 0 * 21.869148 * -1.888595 * -2.097748 *
* 19 * 0 * 25.905805 * -1.082460 * 0.9844084 *
* 20 * 0 * * * *
* 21 * 0 * * * *
* 22 * 0 * 37.931583 * -0.184949 * 0.1010477 *
* 23 * 0 * * * *
* 24 * 0 * * * *
pcanal
October 17, 2024, 9:55pm
16
This confirms that for the first 24 entries there is only zero or one Muon per entries.
pcanal
October 18, 2024, 9:36am
17
To get the number element try:
countval = int()
tree.GetLeaf("Muon.Phi").GetLeafCount(countval);
Hello, everything is actually working now. I generated another collision with madgraph just to make sure, and this time, there are as many muons as I would expect. I’m not sure why it worked, but thank you so, so much for all your help.