faca87
1
Hi everyone, I’ve an array Calo_Time[n], I’ like to plot the Graph of the diffences between some of them:
I can do it writing, for example:
t->Draw("Calo_Time[9]-Calo_Time[8]");
But I’d like
- To store the diffence in a variable,
I tried
diff=Calo_Time[9]-Calo_Time[8]
but it doesn’t work. Moreover,
- I’d like to define 2 variables a,b at the begin of the macro, and to write something like this
float a=9;
float b=8;
diff=Calo_Time[a]-Calo_Time[b]`
How to fix it?
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
faca87
3
Hi cuet, yes, it was what I wanted for the plots…but is it also possible to store the differences in a txt file?
couet
4
with root 6:
root [0] t->SetScanField(0);
root [1] .> a.txt
t->Scan("x-y");
.>
with root 5:
root [0] t->SetScanField(0);
root [1] t->Scan("x-y"); > a.txt
faca87
5
Hi couet, thank for your reply. By using the code (obviously by changing the variable names)
t->Scan("x-y"); a.txt
I get error, but I found another code, so I wrote:
lemma->SetScanField(0);
((TTreePlayer*)(t->GetPlayer()))->SetScanRedirect(true);
((TTreePlayer*)(t->GetPlayer()))->SetScanFileName(mydatavalueouta);
t->Scan(Form("Calo_Time[%d]",a));
and it worked!
Anyway thank you for your interest!
couet
6
This is wrong with ROOT 5. You missed the “>” character.
system
Closed
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.