12 #ifndef ROOT_TMultiGraph
13 #include "TMultiGraph.h"
15 #ifndef ROOT_TGraphErrors
16 #include "TGraphErrors.h"
41 const Int_t
MAXZ = 120;
const Int_t
MAXN = 200;
52 void Scan(
const char *fname)
67 TH2D *
Production2D(
const char *hname,
const char *fname,
const char *pathtofile =
"./",
bool fis =
false)
76 if ( pax.
GetId().FIS == fis ) {
88 h->Draw(
"col");
return h;
103 TMultiGraph *
Excitation(
const char *filebasename,
const char *pathtofile =
"./", Int_t istart = 1, Int_t iend = 10, Float_t threshold = 0.01)
109 const Short_t NBSTYLE = 11;
112 const Short_t colmarq_Z[NBSTYLE] = { 2, 3, 4, 6, 7, 8, 9,20,30,40,50};
const Short_t colmarq_FISSION = 1;
113 const Short_t stymarq_N[NBSTYLE] = {20,21,22,23,24,25,26,27,28,29,30};
const Short_t stymarq_FISSION = 5;
115 const Int_t nbin = 2000, min = 0, max = 200;
118 TObjArray ar(
MAXN*
MAXZ); ar.SetOwner(); TH1F *h; TString
tmp;
124 for (Int_t i = istart; i < iend; i++ ) {
128 if ( 10 <= i && i < 100 )
131 tmp += i; tmp +=
".pax";
136 if ( pax.
GetId().FIS == kTRUE ) {
137 if ( ar[0] == NULL ) {
138 tmp =
"Fission"; h =
new TH1F(tmp.Data(),filebasename,nbin,min,max); ar.AddAt(h,0);
141 h->SetMarkerColor(colmarq_FISSION); h->SetMarkerStyle(stymarq_FISSION); h->SetLineColor(colmarq_FISSION);
143 h = (TH1F *)(ar.At(0));
147 if ( pax.
GetId().N > 0 && pax.
GetId().Z > 0 ) {
149 tmp = pax.
GetId().Z; tmp +=
"-"; tmp += pax.
GetId().N;
150 h =
new TH1F(tmp.Data(),filebasename,nbin,min,max); ar.AddAt(h,pax.
GetId().Z *
MAXN + pax.
GetId().N);
153 if ( (firstN - pax.
GetId().N) > -1 && (firstN - pax.
GetId().N) < NBSTYLE
154 && (firstZ - pax.
GetId().Z) > -1 && (firstZ - pax.
GetId().Z) < NBSTYLE ) {
155 h->SetMarkerColor(colmarq_Z[firstZ - pax.
GetId().Z]);
156 h->SetMarkerStyle(stymarq_N[firstN - pax.
GetId().N]);
157 h->SetLineColor(colmarq_Z[firstZ - pax.
GetId().Z]);
160 h->SetMarkerColor(14);
161 h->SetMarkerStyle(2);
174 TMultiGraph *stack =
new TMultiGraph(filebasename,filebasename);
176 TLegend *leg =
new TLegend(0.8,0.8,0.99,0.99);
179 if ( ar.GetEntries() > 0 ) {
180 for (Int_t i = 0; i <
MAXN*
MAXZ; i++ ) {
183 h = (TH1F *)ar[i];
if ( h->GetMaximum() < threshold )
continue;
186 TGraphErrors *g =
new TGraphErrors();
190 g->SetMarkerColor(h->GetMarkerColor()); g->SetMarkerStyle(h->GetMarkerStyle());
191 g->SetLineColor(h->GetLineColor());
192 g->SetLineStyle(h->GetLineStyle());
194 g->SetNameTitle(h->GetName(),h->GetTitle());
197 if ( i == 0 ) tmp =
"Fission";
199 tmp =
"X ^{"; tmp += (i /
MAXN + i %
MAXN) ; tmp +=
"}_{"; tmp += i /
MAXN; tmp +=
"}";
201 leg->AddEntry(g,tmp.Data(),
"L P");
205 for (Int_t ibin = 1; ibin < nbin+1; ibin++ ) {
206 if ( h->GetBinContent(ibin) > threshold ) {
207 g->SetPoint(ipoint,h->GetBinCenter(ibin),h->GetBinContent(ibin));
208 g->SetPointError(ipoint,h->GetBinWidth(ibin),h->GetBinError(ibin));
216 stack->GetXaxis()->SetTitle(
"Excitation energy (MeV)"); stack->GetYaxis()->SetTitle(
"Cross section (mbarns)");
233 void Distribution(TH1F &
histo,
const char *filebasename,
const char *pathtofile =
"./", Int_t istart = 1, Int_t iend = 10)
241 for (Int_t i = istart; i < iend; i++ ) {
245 if ( 10 <= i && i < 100 )
248 tmp += i; tmp +=
".pax";
254 { cout <<
" Unknown distribution " << tmp.Data() <<
endl;
return; }
258 histo.Fill(x->GetValue(),w->GetValue());
267 TGraph *
Evolution1D(
const char *var,
const char *filebasename,
const char *pathtofile =
"./", Int_t istart = 1, Int_t iend = 10, Int_t which = 0)
275 for (Int_t i = istart; i < iend; i++ ) {
279 if ( 10 <= i && i < 100 )
282 tmp += i; tmp +=
".pax";
289 { cout <<
" Unknown variable " << tmp.Data() <<
endl;
return NULL; }
292 TGraph *gr =
new TGraph();
295 gr->SetPoint(i,i,x->GetValue()); i++;
309 void Distribution2D(TH2 &
histo,
const char *filebasename,
const char *pathtofile =
"./", Int_t istart = 1, Int_t iend = 10)
317 for (Int_t i = istart; i < iend; i++ ) {
321 if ( 10 <= i && i < 100 )
324 tmp += i; tmp +=
".pax";
329 TLeaf *x = NULL, *y = NULL, *w = pax.
GetLeaf(
"WT");
331 tmp = histo.GetTitle(); TObjArray *arr = tmp.Tokenize(
":");
332 if ( arr && arr->GetEntries() == 2 ) {
333 x = pax.
GetLeaf(arr->At(0)->GetName());
334 y = pax.
GetLeaf(arr->At(1)->GetName());
339 if ( x == NULL || y == NULL )
340 { cout <<
" Unknown distribution " << tmp.Data() <<
endl;
return; }
345 histo.Fill(x->GetValue(),y->GetValue(),w->GetValue());
353 void EPxTHETA(TH2 &
histo,
const char *filebasename,
const char *pathtofile =
"./", Int_t istart = 1, Int_t iend = 10, Int_t mode = 1)
361 for (Int_t i = istart; i < iend; i++ ) {
365 if ( 10 <= i && i < 100 )
368 tmp += i; tmp +=
".pax";
378 for( Short_t i = 0; i < pax.
GetId().NUM ; i++){
379 if ( pax.
GetData().MODE[i] == mode ) histo.Fill(x->GetValue(i)*180/TMath::Pi(),y->GetValue(i),w->GetValue());
390 void ShowCascades(
const char *filebasename,
const char *pathtofile =
"./", Int_t istart = 1, Int_t iend = 10)
392 TString
tmp; TLine line; line.SetLineWidth(2); TMarker mark; mark.SetMarkerStyle(23);
394 Short_t colors[11] = {0,1,30,28,2,4,6,8,9,10,11};
395 Short_t styles[11] = {0,2,1,1,1,1,1,8,9,10,11};
397 if ( gPad == NULL )
return;
403 for (Int_t i = istart; i < iend; i++ ) {
407 if ( 10 <= i && i < 100 )
410 tmp += i; tmp +=
".pax";
417 if ( pax.
GetId().FIS == kTRUE )
continue;
419 if ( refresh % 3 == 0 )
420 { refresh = 0 ; gPad->Clear(); gPad->DrawFrame(0,0,TMath::Max(1.1*pax.
GetId().L+5,10.),1.1*pax.
GetGlobal().ENER); }
423 mark.DrawMarker(pax.
GetId().JE,pax.
GetId().EE);
425 for( Int_t i = 0; i < pax.
GetId().NUM ; i++){
426 line.SetLineColor(colors[pax.
GetData().MODE[i]]);
427 line.SetLineStyle(styles[pax.
GetData().MODE[i]]);
428 if ( i == pax.
GetId().NUM - 1 )
433 gPad->Update(); TObject *obj = gPad->WaitPrimitive();
436 if ( gROOT->IsInterrupted() ) { cout <<
"loop stopped " <<
endl;
break; }
443 void Distribution(
const char *filebasename,
const char *pathtofile =
"./", Int_t istart = 1, Int_t iend = 10)
445 TH1F *
histo =
new TH1F(
"",
"",200,-100,100);
453 for (Int_t i = istart; i < iend; i++ ) {
457 if ( 10 <= i && i < 100 )
460 tmp += i; tmp +=
".pax";
void AddFile(const char *fname)
to add an input (pax) file
Interface to read/decode EvapOR List Mode Output Files (so-called .pax files)
void Scan(const char *fname)
Function to scan a pax file and display the content on the standard ouput.
TMultiGraph * Excitation(const char *filebasename, const char *pathtofile="./", Int_t istart=1, Int_t iend=10, Float_t threshold=0.01)
Function to plot Excitation function.
void ShowCascades(const char *filebasename, const char *pathtofile="./", Int_t istart=1, Int_t iend=10)
Function to show cascades in the E x I plan.
EvapLMOF & full(EvapLMOF &reader)
void ShowCurrentConditions(std::ostream &out=std::cout)
The current status is shown on the standard ouptut.
TLeaf * GetLeaf(const char *leafname="no")
To get a ROOT leaf corresponding to one of the variable.
TGraph * Evolution1D(const char *var, const char *filebasename, const char *pathtofile="./", Int_t istart=1, Int_t iend=10, Int_t which=0)
Function to draw a single distribution.
void SetPath(const char *path="./")
set the directory where to find the input files
void Scan(UInt_t start=0, UInt_t end=10)
To scan events and show them on the standard output.
const DATA & GetData()
To get the current data structure.
void Distribution(TH1F &histo, const char *filebasename, const char *pathtofile="./", Int_t istart=1, Int_t iend=10)
Function to draw a single distribution.
const GLOBAL & GetGlobal()
To get the current global structure.
void Distribution2D(TH2 &histo, const char *filebasename, const char *pathtofile="./", Int_t istart=1, Int_t iend=10)
Function to draw a 2D distribution.
const ID & GetId()
To get the current id structure.
ADF::LogMessage & endl(ADF::LogMessage &log)
TH2D * Production2D(const char *hname, const char *fname, const char *pathtofile="./", bool fis=false)
Function to plot a 2D plot of all the produced residus.
static Short_t VERBOSE
Set verbosity level.
const KINMAT & GetKin()
To get the current kinematic structure.
EvapLMOF & idonly(EvapLMOF &reader)
Bool_t NextEvent(UInt_t next=0)
To load the next event.
void EPxTHETA(TH2 &histo, const char *filebasename, const char *pathtofile="./", Int_t istart=1, Int_t iend=10, Int_t mode=1)
Function to draw the Energy of the particule as a function of the theta angle.