[Gate-users] MACRO_TREE_COINCIDENCES_BRANCHES

LORENA VAZQUEZ CANELAS lorena.vazquez at usal.es
Thu Mar 5 14:48:29 CET 2015


Dear Gaters,

My version of GATE not allow me to use the output format in ascii, so I
have my data only in ROOT and then through a macro generate in ascii .
The following code passes a histogram to ascii:

void ascii(){
const Int_t foutPrecision=14;
int i;
// Make an ofstream object
ofstream fout ("OUTPUT_ASCII.txt");
//count << "Writing ascii file" << pAsciiFileName << "..."<<endl;
fout.precision(foutPrecision);
    for (i=0; i<<4092; i++){
    fout << NAME_HISTOGRAM->GetBinContent(i)<<"";
    }
fout.close();
}

My problem is that I need to use the histograms of the branches of the
tree-coincidences and if I change variable,it gives me an error.
I do not know if it would have to put, for example :
TTree *Coincidences = (TTree*)gDirectory->Get("Coincidences");
or
Coincidences->SETBranchAddress ("sourcePosX1",&sourcePosX1)

Any idea on what I can do?

Cheers,
Lorena

-- 

LORENA VÁZQUEZ CANELAS
-- 
LRI - Datación (Despacho Técnicos)
Calle Espejo, s/n, 37008 - Salamanca (Spain)
TEL: +34 923 294930 ext:4932 email: lorena.vazquez at usal.es
web: http://campus.usal.es/~lri/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20150305/4f2d3de8/attachment.html>


More information about the Gate-users mailing list