<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Dear Lorena,
<div><br>
</div>
<div>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: <a href="http://www.opengatecollaboration.org/sites/opengatecollaboration.org/files/Bin_GATE_v1.0.c" target="_blank">http://www.opengatecollaboration.org/sites/opengatecollaboration.org/files/Bin_GATE_v1.0.c</a><br>
Maybe you can take this code as example for your own.</div>
<div><br>
</div>
<div>With kind regards,<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><b style="font-family:Arial,sans-serif; font-size:13.3333330154419px">Jasper J.M. Kouwenberg<br>
</b><font face="Arial, sans-serif"><span style="font-size:13.3333330154419px"><i>Medical Physics Graduate student</i></span></font>
<div><span style="font-family:Arial,sans-serif; font-size:13.3333330154419px">Nuclear Medicine</span></div>
<div><span style="font-family:Arial,sans-serif; font-size:13.3333330154419px"><br>
</span></div>
<div><img alt="Beschrijving: Erasmus MC"><br>
<br>
<font face="Arial,sans-serif" size="1" color="#0C2074"><span style="font-size:8pt">E-mail j.kouwenberg@erasmusmc.nl </span></font><font face="Arial,sans-serif" size="1" color="#0C2074"><span style="font-size:8pt">| Phone +316 2532 9809</span></font></div>
</div>
</div>
</div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF157237" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> gate-users-bounces@lists.opengatecollaboration.org [gate-users-bounces@lists.opengatecollaboration.org] on behalf of LORENA VAZQUEZ CANELAS [lorena.vazquez@usal.es]<br>
<b>Sent:</b> 05 March 2015 14:48<br>
<b>To:</b> gate-users<br>
<b>Subject:</b> [Gate-users] MACRO_TREE_COINCIDENCES_BRANCHES<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-family:comic sans ms,sans-serif; font-size:small">
Dear Gaters,<br>
<br>
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 .<br>
The following code passes a histogram to ascii:<br>
<br>
void ascii(){<br>
const Int_t foutPrecision=14;<br>
int i;<br>
// Make an ofstream object<br>
ofstream fout ("OUTPUT_ASCII.txt");<br>
//count << "Writing ascii file" << pAsciiFileName << "..."<<endl;<br>
fout.precision(foutPrecision);<br>
for (i=0; i<<4092; i++){<br>
fout << NAME_HISTOGRAM->GetBinContent(i)<<"";<br>
}<br>
fout.close();<br>
}<br>
<br>
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.
<br>
I do not know if it would have to put, for example :<br>
TTree *Coincidences = (TTree*)gDirectory->Get("Coincidences");<br>
or<br>
Coincidences->SETBranchAddress ("sourcePosX1",&sourcePosX1)<br>
<br>
Any idea on what I can do?<br>
<br>
Cheers, <br>
Lorena<br clear="all">
</div>
<br>
-- <br>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<pre>LORENA VÁZQUEZ CANELAS<br>-- <br>LRI - Datación (Despacho Técnicos)<br>Calle Espejo, s/n, 37008 - Salamanca (Spain)<br>TEL: +34 923 294930 ext:4932 email: <a href="mailto:lorena.vazquez@usal.es" target="_blank">lorena.vazquez@usal.es</a><br>web: <a href="http://campus.usal.es/%7Elri/" target="_blank">http://campus.usal.es/~lri/</a></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>