[Gate-users] MACRO_TREE_COINCIDENCES_BRANCHES
J.J.M. Kouwenberg
j.kouwenberg at erasmusmc.nl
Thu Mar 5 14:56:53 CET 2015
Dear Lorena,
A code written to convert ROOT to STIR projection files does something very similar to what you are doing. You can download the code here: http://www.opengatecollaboration.org/sites/opengatecollaboration.org/files/Bin_GATE_v1.0.c
Maybe you can take this code as example for your own.
With kind regards,
Jasper J.M. Kouwenberg
Medical Physics Graduate student
Nuclear Medicine
[Beschrijving: Erasmus MC]
E-mail j.kouwenberg at erasmusmc.nl | Phone +316 2532 9809
________________________________
From: gate-users-bounces at lists.opengatecollaboration.org [gate-users-bounces at lists.opengatecollaboration.org] on behalf of LORENA VAZQUEZ CANELAS [lorena.vazquez at usal.es]
Sent: 05 March 2015 14:48
To: gate-users
Subject: [Gate-users] MACRO_TREE_COINCIDENCES_BRANCHES
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<mailto:lorena.vazquez at usal.es>
web: http://campus.usal.es/~lri/<http://campus.usal.es/%7Elri/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20150305/fbb08af5/attachment.html>
More information about the Gate-users
mailing list