but not (!) with
ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D >
-> Then myvector is not filled. If I skip
fChain->SetBranchStatus("*",0);
it also works fine. So the crutial point is to reset the BranchStatus to “1”. Can someone help, please? Thank you!
Cheers, Matthias
NB: the Star * is important for (2) - it includes all branches root can find which begin with “myvector”
p.s.: The full code with a small input file can be found at desy.de/~mstein/mysusy/. Run it with root make.C. You might have to load FW-Lite beforehand. In my case, the variable in question is metP4AK5 - search for it in mysusy.h
The issue is that since the branch metP4AK5 was not created with a trailing dot at the end of its name, its sub-branches are not related name-wise. Namely, we have: root [8] tree->GetBranch("metP4AK5")->Print()
*Branch :metP4AK5 *
*Entries : 20 : BranchElement (see below) *
*............................................................................*
*Br 0 :fCoordinates : *
*Entries : 20 : Total Size= 4217 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
*Br 1 :fCoordinates.fX : *
*Entries : 20 : Total Size= 1100 bytes File Size = 242 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
*Br 2 :fCoordinates.fY : *
*Entries : 20 : Total Size= 1100 bytes File Size = 242 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
*Br 3 :fCoordinates.fZ : *
*Entries : 20 : Total Size= 1100 bytes File Size = 103 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 2.35 *
*............................................................................*
*Br 4 :fCoordinates.fT : *
*Entries : 20 : Total Size= 1100 bytes File Size = 222 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.09 *
*............................................................................*and thus
fChain->SetBranchStatus("metP4AK5*", 1); only enables the top level branches and not the sub-branches.
To also enable the sub-branches you need to also use:fChain->SetBranchStatus("fCoordinates*", 1);