ATLAS Offline Software
Loading...
Searching...
No Matches
python.BeamSpotData.BeamSpotGraph Class Reference
Collaboration diagram for python.BeamSpotData.BeamSpotGraph:

Public Member Functions

 __init__ (self, timeAxis=False, bcidAxis=False, separationAxis=False)
 add (self, bs, what, arescale=1.)
 getTGraph (self, name='')

Public Attributes

 timeAxis = timeAxis
 bcidAxis = bcidAxis
 separationAxis = separationAxis
 x = array('d')
 y = array('d')
 ex = array('d')
 ey = array('d')
int xmin = 1E10
int xmax = -1E10
int ymin = 1E10
int ymax = -1E10
int xoffset = 0
 what = None

Detailed Description

A utility class for accumulating beam spot data into TGraphErrors.

Definition at line 688 of file BeamSpotData.py.

Constructor & Destructor Documentation

◆ __init__()

python.BeamSpotData.BeamSpotGraph.__init__ ( self,
timeAxis = False,
bcidAxis = False,
separationAxis = False )

Definition at line 691 of file BeamSpotData.py.

691 def __init__(self, timeAxis = False, bcidAxis = False, separationAxis = False):
692 self.timeAxis = timeAxis
693 self.bcidAxis = bcidAxis
694 self.separationAxis = separationAxis
695 self.x = array('d')
696 self.y = array('d')
697 self.ex = array('d')
698 self.ey = array('d')
699 self.xmin = 1E10
700 self.xmax = -1E10
701 self.ymin = 1E10
702 self.ymax = -1E10
703 self.xoffset = 0
704 self.what = None
705
STL class.

Member Function Documentation

◆ add()

python.BeamSpotData.BeamSpotGraph.add ( self,
bs,
what,
arescale = 1. )
Add element what of BeamSpotValue bs to the graph.

Definition at line 706 of file BeamSpotData.py.

706 def add(self,bs,what,arescale=1.):
707 """Add element what of BeamSpotValue bs to the graph."""
708 self.what = what
709 y = arescale*getattr(bs,what) # Raise exception if not attribute what
710 ey = arescale*getattr(bs,what+'Err',0)
711 ex = (bs.lbEnd - bs.lbStart)/2.
712 x = self.xoffset + bs.lbStart + ex
713
714 if self.timeAxis:
715 ex = (bs.timeEnd - bs.timeStart)/2.
716 x = self.xoffset + bs.timeStart + ex
717 if self.bcidAxis:
718 ex = 0
719 x = bs.bcid
720 if self.separationAxis:
721 ex = 0
722 x = bs.separation
723
724 self.x.append(x)
725 self.ex.append(ex)
726 self.y.append(y)
727 self.ey.append(ey)
728 self.xmin = min(x-ex,self.xmin)
729 self.xmax = max(x+ex,self.xmax)
730 self.ymin = min(y-ey,self.ymin)
731 self.ymax = max(y+ey,self.ymax)
732
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55

◆ getTGraph()

python.BeamSpotData.BeamSpotGraph.getTGraph ( self,
name = '' )

Definition at line 733 of file BeamSpotData.py.

733 def getTGraph(self,name=''):
734 if len(self.x)>0:
735 gr = ROOT.TGraphErrors(len(self.x),self.x,self.y,self.ex,self.ey)
736 if not name:
737 name = self.what
738 gr.SetName(name)
739 gr.SetTitle(name)
740 else:
741 gr = None
742 return gr
743
744

Member Data Documentation

◆ bcidAxis

python.BeamSpotData.BeamSpotGraph.bcidAxis = bcidAxis

Definition at line 693 of file BeamSpotData.py.

◆ ex

python.BeamSpotData.BeamSpotGraph.ex = array('d')

Definition at line 697 of file BeamSpotData.py.

◆ ey

python.BeamSpotData.BeamSpotGraph.ey = array('d')

Definition at line 698 of file BeamSpotData.py.

◆ separationAxis

python.BeamSpotData.BeamSpotGraph.separationAxis = separationAxis

Definition at line 694 of file BeamSpotData.py.

◆ timeAxis

python.BeamSpotData.BeamSpotGraph.timeAxis = timeAxis

Definition at line 692 of file BeamSpotData.py.

◆ what

python.BeamSpotData.BeamSpotGraph.what = None

Definition at line 704 of file BeamSpotData.py.

◆ x

python.BeamSpotData.BeamSpotGraph.x = array('d')

Definition at line 695 of file BeamSpotData.py.

◆ xmax

int python.BeamSpotData.BeamSpotGraph.xmax = -1E10

Definition at line 700 of file BeamSpotData.py.

◆ xmin

int python.BeamSpotData.BeamSpotGraph.xmin = 1E10

Definition at line 699 of file BeamSpotData.py.

◆ xoffset

int python.BeamSpotData.BeamSpotGraph.xoffset = 0

Definition at line 703 of file BeamSpotData.py.

◆ y

python.BeamSpotData.BeamSpotGraph.y = array('d')

Definition at line 696 of file BeamSpotData.py.

◆ ymax

int python.BeamSpotData.BeamSpotGraph.ymax = -1E10

Definition at line 702 of file BeamSpotData.py.

◆ ymin

int python.BeamSpotData.BeamSpotGraph.ymin = 1E10

Definition at line 701 of file BeamSpotData.py.


The documentation for this class was generated from the following file: