25 #ifndef ROOT_TGraphErrors
26 #include "TGraphErrors.h"
49 #ifndef Gw_NuclearLevel
58 const Int_t Cascade::fgkMaxColor = 2;
59 const Int_t Cascade::fgkMaxStyle = 2;
60 Float_t Cascade::fgDefaultLabelSize = 0.03;
61 Style_t Cascade::fgDefaultStyle[fgkMaxStyle] = {1, 2};
62 Color_t Cascade::fgDefaultColor[fgkMaxColor] = {1, 4};
69 fDefaultStyle(kKnown),
70 fDefaultColor(kDefault),
78 fName.SetTextAlign(22);
79 fName.SetTextColor(1);
80 fName.SetTextSize(fgDefaultLabelSize);
81 fType.SetTextAlign(22);
94 if ( o.Contains(
"name") )
return fName;
101 fType.SetTitle(type);
102 if (x != 0 && y != 0)
103 fName.SetText(x, y, name);
105 fName.SetTitle(name);
131 while ( (link = (
Link*)next()) ){
147 Int_t d =
fName.DistancetoPrimitive(px, py);
155 fName.ExecuteEvent(event, px, py);
162 for (Int_t i = 0; i < GetEntries(); ++i) {
163 cout << Form(
"Link # %d", i) <<
endl;
164 Link* link =
static_cast<Link*
> ( At(i) );
175 Float_t j1[GetEntries()];
176 Float_t deltaJ1[GetEntries()];
177 Float_t omega[GetEntries()];
178 Float_t deltaOmega[GetEntries()];
181 for (Int_t i = 0; i < GetEntries(); ++i ) {
182 Link* link1 =
static_cast<Link*
> ( At(i) );
186 if (level1 == 0x0 || level2 == 0x0) {
187 fLog <<
error <<
"Energy and/or Spin not defined for these levels " <<
dolog;
197 Float_t deltaE = TMath::Abs( E2 - E1);
215 j1[nPoints] = deltaI/deltaE*level1->
GetSpin().
Get();
216 omega[nPoints] = TMath::Abs( E2 - E1 )/deltaI;
218 deltaJ1[nPoints] = TMath::Sqrt( (deltaE1/E1)*(deltaE1/E1) + (deltaE2/E2)*(deltaE2/E2) );
220 deltaOmega[nPoints] = TMath::Sqrt( (deltaE1/E1)*(deltaE1/E1) + (deltaE2/E2)*(deltaE2/E2) );
227 return new TGraphErrors(nPoints, omega, j1, deltaOmega, deltaJ1);
239 Float_t j2[GetEntries()-1];
240 Float_t deltaJ2[GetEntries()-1];
241 Float_t omega[GetEntries()-1];
242 Float_t deltaOmega[GetEntries()-1];
245 for (Int_t i = 0; i < GetEntries() - 1; ++i ) {
246 Link* link1 =
static_cast<Link*
> ( At(i) );
247 Link* link2 =
static_cast<Link*
> ( At(i+1) );
252 if (level1 == 0x0 || level2 == 0x0 || level3 == 0x0) {
253 fLog <<
error <<
"Energy and/or Spin not defined for these levels " <<
dolog;
265 Float_t deltaE = TMath::Abs( E1 - 2*E2 + E3);
283 j2[nPoints] = deltaI/deltaE;
284 omega[nPoints] = TMath::Abs( E1 - E3 )/deltaI;
286 deltaJ2[nPoints] = TMath::Sqrt( (deltaE1/E1)*(deltaE1/E1) + 4*(deltaE2/E2)*(deltaE2/E2)
287 + (deltaE3/E3)*(deltaE3/E3) );
289 deltaOmega[nPoints] = TMath::Sqrt( (deltaE1/E1)*(deltaE1/E1) + (deltaE3/E3)*(deltaE3/E3) );
296 return new TGraphErrors(nPoints, omega, j2, deltaOmega, deltaJ2);
virtual Data_T GetError() const
return the error on the measured value
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance to object.
TGraphErrors * DoJ2() const
Compute J2.
A cascade is a list of links.
LogMessage & error(LogMessage &)
LogMessage & warning(LogMessage &)
header file for a NuclearLevel
Float_t Get() const
To get the spin as a float.
virtual Level * GetIL()
to get the initial level
LogMessage & nline(LogMessage &)
virtual void ls(Option_t *="") const
ls on link
virtual Level * GetFL()
to get the final level
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
to execute an event for this cascade
virtual void SetVisible()
Set link visible.
A link between two levels.
virtual Data_T Get() const
get the value, can be overloaded
virtual void SetUnvisible()
Set link unvisble.
Measure< Float_t > & GetEnergy()
void ls(Option_t *opt="") const
Print out.
LogMessage & dolog(LogMessage &)
header file for a Cascade
virtual void Draw(Option_t *opt="")
virtual void SetLabels(const Char_t *name, const Char_t *type="ND", Double_t x=0, Double_t y=0)
set cascade label
ADF::LogMessage & endl(ADF::LogMessage &log)
virtual void SetVisible()
Set link visible.
Spin & GetSpin()
to get the spin and modify it if it is needed
virtual void SetVisible(Bool_t visu)
Set cascade (un)visible, do not delete the objects, still present, just not drawn ! ...
virtual void SetUnvisible()
Set link unvisble.
virtual void SetProcessMethod(const char *)
To set the current method.
virtual TLatex & GetLatex(Option_t *opt="name")
to get and modify the displayed properties of name and type
virtual void Paint(Option_t *opt="")
Draw/Paint methods.
TGraphErrors * DoJ1() const
Compute J1.
virtual Bool_t IsVisible()
return visible