GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UtilLevelScheme.C
Go to the documentation of this file.
1 
7 using namespace Gw;
8 
15 void ShowGamma(TH1 *histo, LevelScheme *lev, Color_t col = 2, Style_t st = 23)
16 //void ShowGamma(TAttMarker mark = TAttMarker(1,23,2))
17 {
18  TObject *obj; GammaLink *gamma;
19 
20  // marker use to display peaks position
21  TMarker mark;
22  //mark->SetMarkerSize(attmark->GetMarkerSize());
23  //mark->SetMarkerColor(attmark->GetMarkerColor());
24  mark.SetMarkerColor(col); mark.SetMarkerStyle(st);
25 
26  // check out few things
27  if ( histo == NULL || lev == NULL ) return;
28 
29  // now loop on gammas to display them on the spectrum
30  TIter links(&lev->GetLinks());
31  while ( (obj = links()) != NULL ) {
32  if ( obj->InheritsFrom("GammaLink") ) {
33  gamma = (GammaLink *)obj;
34  Float_t e = gamma->GetEnergy().GetValue();
35  mark.DrawMarker(e,histo->GetBinContent(histo->FindBin(e)));
36  }
37  }
38 }
39 
41 //void ShowGamma(TAttMarker mark = TAttMarker(1,23,2))
42 {
43  TObject *obj; GammaLink *gamma; Level *ini, *fin;
44 
45  // marker use to display peaks position
46  TMarker mark; TArrow ar;
47  ar.SetFillColor(15); ar.SetLineColor(15); ar.SetAngle(30);
48  // ar.SetOption("->-");
49  //mark->SetMarkerSize(attmark->GetMarkerSize());
50  //mark->SetMarkerColor(attmark->GetMarkerColor());
51  mark.SetMarkerColor(1); mark.SetMarkerStyle(8);
52 
53  // check out few things
54  if ( lev == NULL ) return;
55 
56  // now loop on gammas to display them on the spectrum
57  TIter links(&lev->GetLinks());
58  while ( (obj = links()) != NULL ) {
59  if ( obj->InheritsFrom("GammaLink") ) {
60  gamma = (GammaLink *)obj;
61  ini = gamma->GetIL(); fin = gamma->GetFL();
62 
63  // mark.DrawMarker((ini->GetX1()+ini->GetX2())/2,ini->GetY1());
64  ar.DrawArrow((ini->GetX1()+ini->GetX2())/2,ini->GetY1(),
65  (fin->GetX1()+fin->GetX2())/2,fin->GetY1(),0.01);
66  }
67  }
68 }
69 
A level Scheme.
Definition: LevelScheme.h:82
TH1F * histo[MaxValue]
Definition: ReadDaqAlone.C:31
const TList & GetLinks()
to get the list of links
Definition: LevelScheme.h:295
void ShowGamma(TH1 *histo, LevelScheme *lev, Color_t col=2, Style_t st=23)
Data_T GetValue() const
get the value, cannot be overloaded
Definition: Data.h:114
Base class describing a general level.
Definition: Level.h:53