ATLAS Offline Software
Loading...
Searching...
No Matches
ReadRPCRun2DataFile.Decodes Class Reference
Inheritance diagram for ReadRPCRun2DataFile.Decodes:
Collaboration diagram for ReadRPCRun2DataFile.Decodes:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

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

Public Attributes

 topocells = copy(topocells)

Detailed Description

Definition at line 91 of file ReadRPCRun2DataFile.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

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()

ReadRPCRun2DataFile.Decodes.addTopoCell ( self,
topocell )

Definition at line 184 of file ReadRPCRun2DataFile.py.

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

◆ asXML()

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()

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()

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()

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
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41

Member Data Documentation

◆ topocells

ReadRPCRun2DataFile.Decodes.topocells = copy(topocells)

Definition at line 93 of file ReadRPCRun2DataFile.py.


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