A utility class for accumulating beam spot data into TGraphErrors.
Definition at line 688 of file BeamSpotData.py.
◆ __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
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
◆ 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)
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
bool add(const std::string &hname, TKey *tobj)
◆ 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
◆ bcidAxis
| python.BeamSpotData.BeamSpotGraph.bcidAxis = bcidAxis |
◆ ex
| python.BeamSpotData.BeamSpotGraph.ex = array('d') |
◆ ey
| python.BeamSpotData.BeamSpotGraph.ey = array('d') |
◆ separationAxis
| python.BeamSpotData.BeamSpotGraph.separationAxis = separationAxis |
◆ timeAxis
| python.BeamSpotData.BeamSpotGraph.timeAxis = timeAxis |
◆ what
| python.BeamSpotData.BeamSpotGraph.what = None |
| python.BeamSpotData.BeamSpotGraph.x = array('d') |
◆ xmax
| int python.BeamSpotData.BeamSpotGraph.xmax = -1E10 |
◆ xmin
| int python.BeamSpotData.BeamSpotGraph.xmin = 1E10 |
◆ xoffset
| int python.BeamSpotData.BeamSpotGraph.xoffset = 0 |
| python.BeamSpotData.BeamSpotGraph.y = array('d') |
◆ ymax
| int python.BeamSpotData.BeamSpotGraph.ymax = -1E10 |
◆ ymin
| int python.BeamSpotData.BeamSpotGraph.ymin = 1E10 |
The documentation for this class was generated from the following file: