TTree Scan()/Draw() are not consistent for std::vector<string>


ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


I want to use slice of a vector, things work for vector<double> but not for vector<string>. e.g. in the attached file, I have a tree named primaryParticle, there are two types of branches, vector<double> and vector<string>. I can do primaryParticle->Draw(“particleE[0]”) or primaryParticle->Draw(“particleE[1]”) which works perfectly due to the branch is vector<double>, but it doesn’t work for primaryParticle->Draw(“particleName[1]”) since the branch is vector<string>. While primaryParticle->Scan(“particleName[1]”) works correctly.

My original goal is to use some slices of the vector as selections. For example, fmsPoint->Draw(">>elist",“pointSourceName[0]==“gamma”&&pointSourceName[1]==“gamma””) which doesn’t work properly since the branch pointSourceName is a vector<string> type. You can do fmsPoint->Draw(">>elist",“pointE[0]>10&&pointE[1]<10”) since the branch pointE is a vector<double> type.

Any help how to read slice of a vector<string>.test_pythia6_rngSeed123456.root (39.0 KB)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.