ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
ReadRPCRun2DataFile.Decodes Class Reference
Inheritance diagram for ReadRPCRun2DataFile.Decodes:
Collaboration diagram for ReadRPCRun2DataFile.Decodes:

Public Member Functions

def __init__ (self, topocells=[])
 
def fromAllRois (cls, allrois)
 
def getTopoCellPosition (cls, etacode, phicode, rois)
 
def addTopoCell (self, topocell)
 
def getStats (self, stats)
 
def asXML (self, depth)
 

Public Attributes

 topocells
 

Detailed Description

Definition at line 91 of file ReadRPCRun2DataFile.py.

Constructor & Destructor Documentation

◆ __init__()

def ReadRPCRun2DataFile.Decodes.__init__ (   self,
  topocells = [] 
)

Definition at line 92 of file ReadRPCRun2DataFile.py.

92  def __init__(self, topocells=[]):
93  self.topocells = copy(topocells)
94 

Member Function Documentation

◆ addTopoCell()

def ReadRPCRun2DataFile.Decodes.addTopoCell (   self,
  topocell 
)

Definition at line 184 of file ReadRPCRun2DataFile.py.

184  def addTopoCell(self,topocell):
185  self.topocells += [ topocell ]

◆ asXML()

def ReadRPCRun2DataFile.Decodes.asXML (   self,
  depth 
)

Definition at line 189 of file ReadRPCRun2DataFile.py.

189  def asXML(self, depth):
190  s = ' '*depth + '<Decode>\n'
191  for tc in self.topocells:
192  s += tc.asXML(depth+4)
193  s += ' '*depth + '</Decode>\n'
194  return s
195 
196 

◆ fromAllRois()

def ReadRPCRun2DataFile.Decodes.fromAllRois (   cls,
  allrois 
)

Definition at line 96 of file ReadRPCRun2DataFile.py.

96  def fromAllRois(cls,allrois):
97  newDecodes = cls()
98  for (etacode,phicode), roisInCell in groupby( sorted(allrois, key=attrgetter('etacode','phicode')), key=attrgetter('etacode','phicode')):
99  # make a new cell
100  (eta, phi, ieta, iphi, etamin, etamax, phimin, phimax) = cls.getTopoCellPosition(etacode, phicode, roisInCell)
101  newDecodes.addTopoCell( TopoCell(etacode=etacode, phicode=phicode, eta=eta, phi=phi, ieta=ieta, iphi=iphi, etamin=etamin, etamax=etamax, phimin=phimin, phimax=phimax) )
102  return newDecodes
103 

◆ getStats()

def ReadRPCRun2DataFile.Decodes.getStats (   self,
  stats 
)

Definition at line 186 of file ReadRPCRun2DataFile.py.

186  def getStats(self,stats):
187  stats['decodes'] += 1
188  stats['topocells'] += len(self.topocells)

◆ getTopoCellPosition()

def ReadRPCRun2DataFile.Decodes.getTopoCellPosition (   cls,
  etacode,
  phicode,
  rois 
)

Definition at line 105 of file ReadRPCRun2DataFile.py.

105  def getTopoCellPosition(cls, etacode, phicode, rois):
106  rois = list(rois)
107 
108  # ETA
109 
110  # eta min and max are different in the RPC (barrel) and TGC (endcap and forward)
111  # in the RPC: abs(etamin)<abs(etamax)
112  # in the TGC: etamin<etamax
113  # we are going to use the TGC definition: etamin<etamax
114 
115  cellsEta = [(min(e.etamin,e.etamax), max(e.etamin,e.etamax)) for e in rois]
116  etamins, etamaxs = zip(*cellsEta) # transpose
117  etamin = min( [ min(e.etamin,e.etamax) for e in rois] )
118  etamax = max( [ max(e.etamin,e.etamax) for e in rois] )
119  eta = (etamin+etamax)/2
120 
121 
122  # PHI CONVENTION
123  cellsPhi = [(e.phimin, e.phimax) for e in rois]
124 
125  # check if there are cells on both sides of the PI boundary
126  upperedge = any([e.phi>6.2 for e in rois])
127  loweredge = any([e.phi<0.2 for e in rois])
128  splitTopoCell = upperedge and loweredge
129 
130 
131  if splitTopoCell:
132  maxAtLowerEdge = max([e.phimax for e in rois if e.phi<1])
133  minAtUpperEdge = min([e.phimin for e in rois if e.phi>5])
134  centerTopoCell = minAtUpperEdge + maxAtLowerEdge
135  if centerTopoCell>=2*PI: # shift down
136  phimin = minAtUpperEdge - 2 * PI
137  phimax = maxAtLowerEdge
138  else: # shift up
139  phimin = minAtUpperEdge
140  phimax = maxAtLowerEdge + 2 * PI
141  phi = (phimin+phimax)/2
142  else:
143 
144  phimins, phimaxs = zip(*cellsPhi) # transpose
145  phimin = min(phimins)
146  phimax = max(phimaxs)
147  phi = (phimin+phimax)/2
148 
149 
150  # IETA
151  ieta = round(eta*10)
152  if ieta== 12: ieta= 11
153  if ieta==-12: ieta=-11
154  if ieta== 9: ieta= 8
155  if ieta==-9: ieta=-8
156 
157  # IPHI
158  iphi = int(phi*10)
159  if abs(ieta) in [2,5]:
160  if phi>2.05 and phi<2.35: iphi += 1
161  if phi>2.75 and phi<3.25: iphi += 1
162  if phi>3.45: iphi += 1
163 
164  if abs(ieta) == 8:
165  if phi>2.05 and phi<2.35: iphi += 1
166  if phi>2.75 and phi<3.25: iphi += 1
167  if phi>3.45 and phi<4.95: iphi += 1
168  if phi>5.05: iphi += 1
169 
170  if abs(ieta) in [15,18]:
171  if phi>2.65: iphi += 1
172 
173  if abs(ieta) == 11:
174  if phi>2.15 and phi<2.35: iphi += 1
175  if phi>2.65 and phi<3.25: iphi += 1
176  if phi>3.35: iphi += 1
177 
178  if abs(ieta) == 22:
179  if phi>0.05 and phi<5.35: iphi += 1
180  if phi>5.35: iphi += 2
181 
182  return (eta, phi, ieta, iphi, etamin, etamax, phimin, phimax)
183 

Member Data Documentation

◆ topocells

ReadRPCRun2DataFile.Decodes.topocells

Definition at line 93 of file ReadRPCRun2DataFile.py.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
CaloClusterListBadChannel.cls
cls
Definition: CaloClusterListBadChannel.py:8
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
generateMioctEncodingFile.getTopoCellPosition
def getTopoCellPosition(rois)
Definition: generateMioctEncodingFile.py:120
calibdata.copy
bool copy
Definition: calibdata.py:27