Dear rooters,
we found that if we use the Draw function with a condition (CUTG or numerical) it seems to work properly. But if we copy the original ttree using CopyTree function with the same condition and then use Draw with the new ttree (without condition) it looks like the condition has been applied partially.
Maybe, the tricky point is that the condition is applied to a vector of the branch.
struct ImpData{
public:
ImpData();
~ImpData();
uint64_t TIME; // Calibrated time
uint64_t TFAST;
double EN; //
double EX;
double EY;
double X,Y,Z;
uint32_t NX,NY,NZ;
double ZET;
double AOQ;
uint8_t ID;
uint32_t CYCLE;
};
struct VetoData{
public:
VetoData();
~AncData();
uint64_t TIME; // Calibrated time
double EN; // Energy
uint16_t ID;
uint16_t INDEX1;
uint16_t INDEX2;
uint32_t CYCLE;
//** other stuff pending to define **//
//** other stuff pending to define **//
};
struct betaData2TTree{
public:
betaData2TTree();
~betaData2TTree();
uint64_t T; // Calibrated time
uint64_t TFast;
double E; // Energy
double Ex; // Energy
double Ey; // Energy
uint32_t Cycle;
uint32_t nx,ny,nz;
std::vector <ImpData> vectorOfImp;
std::vector <VetoData> vectorOfVeto;
int Clear();
};
The definitions of the constructors, destructors, and other functions are defined in other file (.cxx).
We have a TTree with several branches. The problematic one is filled with the structure betaData2TTree. So, if we type the following commands,
The definitions of the constructors, destructors, and other functions are defined in other file (.cxx).
We have a TTree with several branches. The problematic one is filled with the structure betaData2TTree. So, if we type the following commands,
[ul]
[0] .L myStructure.cxx++
[1] TFile * f = TFile::Open(“aFile.root”,“UPDATE”)
[2] TTree * oldTree = (TTree*)_file0->Get(“aTree”)
[3] oldTree->Draw(“beta.T-beta.vectorOfVeto.TIME”, “beta.T < beta.vectorOfVeto.TIME”) // This works ok
[4] newTTree = oldTree->CopyTree( “beta.T < beta.vectorOfVeto.TIME” )
[5] newTTree->Draw(“beta.T-beta.vectorOfVeto.TIME”) // This does not work
[/ul]
We would be glad if someone gives an idea.
Thank you for your time.
Regards,
Alvaro.