ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping Class Reference
Collaboration diagram for python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping:

Public Member Functions

def __init__ (self)
 
def setWithCorr (self, val)
 
def Print (self)
 
def getChannelList (self, partitions, gains=[0])
 
def makeRange (self, chans)
 
def getChannelSelection (self, partitions, gains)
 
def getChannelSelectionAllGains (self, partitions)
 
def getGain (self, c)
 
def channelsPerPartition (self, chans, show=True)
 

Public Attributes

 size
 
 name
 
 counts
 

Private Attributes

 _EMBC
 
 _EMBA
 
 _EMBCPS
 
 _EMBAPS
 
 _EMECC
 
 _EMECA
 
 _EMECCPS
 
 _EMECAPS
 
 _HECC
 
 _HECA
 
 _FCALC
 
 _FCALA
 
 _emptyC
 
 _emptyA
 
 _empty
 
 _withCorr
 
 _partitions
 
 _corr
 
 _revLookup
 

Detailed Description

Definition at line 3 of file LArExtendedSubDetGrouping.py.

Constructor & Destructor Documentation

◆ __init__()

def python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.__init__ (   self)

Definition at line 4 of file LArExtendedSubDetGrouping.py.

4  def __init__(self):
5  self._EMBC=()
6  self._EMBA=()
7  self._EMBCPS=()
8  self._EMBAPS=()
9  self._EMECC=()
10  self._EMECA=()
11  self._EMECCPS=()
12  self._EMECAPS=()
13  self._HECC=()
14  self._HECA=()
15  self._FCALC=()
16  self._FCALA=()
17  for gain in range(0,3):
18  self._EMBC+=(3+gain*12,)
19  self._EMBA+=(9+gain*12,)
20 
21  self._EMBCPS+=(4+gain*12,)
22  self._EMBAPS+=(10+gain*12,)
23 
24  self._EMECC+=(5+gain*12,)
25  self._EMECA+=(11+gain*12,)
26 
27  self._EMECCPS+=(6+gain*12,)
28  self._EMECAPS+=(12+gain*12,)
29 
30  self._HECC+=(7+gain*12,)
31  self._HECA+=(13+gain*12,)
32 
33  self._FCALC+=(8+gain*12,)
34  self._FCALA+=(14+gain*12,)
35 
36  self._emptyC=()
37  self._emptyA=()
38  self._empty=self._emptyC + self._emptyA
39 
40  self._withCorr=True
41 
42  #Build dictionary:
43  self._partitions=dict()
44  self._partitions['EMBAPS'] = self._EMBAPS
45  self._partitions['EMBCPS'] = self._EMBCPS
46  self._partitions['EMECAPS'] = self._EMECAPS
47  self._partitions['EMECCPS'] = self._EMECCPS
48  self._partitions['EMBA'] = self._EMBA
49  self._partitions['EMBC'] = self._EMBC
50  self._partitions['EMECA']= self._EMECA
51  self._partitions['EMECC'] = self._EMECC
52  self._partitions['HECA'] = self._HECA
53  self._partitions['HECC'] = self._HECC
54  self._partitions['FCALA'] = self._FCALA
55  self._partitions['FCALC'] = self._FCALC
56  self._partitions['EMPTYA'] = self._emptyA
57  self._partitions['EMPTYC'] = self._emptyC
58 
59  #Correction Channels:
60  self._corr=dict()
61  self._corr['EMBAPS'] = 1001
62  self._corr['EMBCPS'] = 1002
63  self._corr['EMECAPS'] = 1003
64  self._corr['EMECCPS'] = 1004
65  self._corr['EMBA'] = 1005
66  self._corr['EMBC'] = 1006
67  self._corr['EMECA'] = 1007
68  self._corr['EMECC'] = 1008
69  self._corr['HECA'] = 1009
70  self._corr['HECC'] = 1010
71  self._corr['FCALA'] = 1011
72  self._corr['FCALC'] = 1012
73 
74  #Lookup-dict indexed by channel (partition is the payload)
75  self._revLookup=dict()
76  for (p, chs) in self._partitions.items():
77  for c in chs:
78  self._revLookup[c]=p
79 
80 

Member Function Documentation

◆ channelsPerPartition()

def python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.channelsPerPartition (   self,
  chans,
  show = True 
)

Definition at line 181 of file LArExtendedSubDetGrouping.py.

181  def channelsPerPartition(self,chans,show=True):
182  class counterElem:
183  def __init__(self,l,n):
184  self.size=l
185  self.name=n
186  self.counts=[0,0,0]
187  def inc(self,g):
188  self.counts[g]=1+self.counts[g]
189 
190  def show(self):
191  print( "%7s: " % self.name,end="")
192  print( "HIGH:%2i/%2i" % (self.counts[0],self.size),)
193  if self.counts[0] != self.size:
194  print( "* ",end="")
195  else:
196  print( " ",end="")
197  print( "MED:%2i/%2i" % (self.counts[1],self.size),)
198  if self.counts[1] != self.size:
199  print( "* ",end="")
200  else:
201  print( " ",end="")
202  print( "LOW:%2i/%2i" % (self.counts[2],self.size),)
203  if self.counts[2] != self.size:
204  print( "* ")
205  else:
206  print( " ")
207 
208  partCounter=dict()
209  for (p, chs) in self._partitions.items():
210  partCounter[p]=counterElem(len(chs),p)
211 
212  for c in chans:
213  (gain,cs)=self.getGain(c)
214  if cs is None:
215  print( "ERROR: Unkown channel",c )
216  else:
217  if (c<39):
218  #p=self._revLookup[cs]
219  p=self._revLookup[c]
220  partCounter[p].inc(gain)
221 
222  return partCounter
223 
224 

◆ getChannelList()

def python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.getChannelList (   self,
  partitions,
  gains = [0] 
)

Definition at line 89 of file LArExtendedSubDetGrouping.py.

89  def getChannelList(self,partitions,gains=[0]):
90  chans=list()
91  for g in gains:
92  if g<0 or g>2:
93  print ("ERROR: Unkown gain",g)
94  return None
95 
96  extPart=list()
97  for partition in partitions:
98  p=partition.upper()
99  if (p=="ECC"):
100  extPart+=["EMECCPS","EMECC","HECC","FCALC"]
101  elif (p=="ECA"):
102  extPart+=["EMECAPS","EMECA","HECA","FCALA"]
103  elif (p=="EC"):
104  extPart+=["EMECAPS","EMECA","HECA","FCALA",
105  "EMECCPS","EMECC","HECC","FCALC"]
106  elif (p=="EMB"):
107  extPart+=["EMBA","EMBAPS","EMBC","EMBCPS"]
108  else:
109  extPart+=[p]
110 
111  for p in extPart:
112  if p in self._partitions:
113  for g in gains:
114  print (self._partitions[p])
115  chans+=[self._partitions[p][g]]
116  if (self._withCorr):
117  for g in gains:
118  chans+=[self._corr[p]+g*12]
119  else:
120  print ("ERROR: Unkown partition '",partition,"'")
121 
122  return chans
123 

◆ getChannelSelection()

def python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.getChannelSelection (   self,
  partitions,
  gains 
)

Definition at line 151 of file LArExtendedSubDetGrouping.py.

151  def getChannelSelection(self,partitions,gains):
152  return self.makeRange(self.getChannelList(partitions,gains))
153 

◆ getChannelSelectionAllGains()

def python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.getChannelSelectionAllGains (   self,
  partitions 
)

Definition at line 154 of file LArExtendedSubDetGrouping.py.

154  def getChannelSelectionAllGains(self,partitions):
155  chans=list()
156  for p in partitions:
157  chans+=self.getChannelList([p],[0,1,2])
158  return self.makeRange(chans)
159 
160 

◆ getGain()

def python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.getGain (   self,
  c 
)

Definition at line 161 of file LArExtendedSubDetGrouping.py.

161  def getGain(self,c):
162  if c<2:
163  return (0,None)
164  if c<15:
165  return (0,c)
166  if c<27:
167  return (1,c-12)
168  if c<39:
169  return (2,c-24)
170  if c<1001:
171  return (0,None)
172  if c<1013:
173  return (0,c)
174  if c<1025:
175  return (1,c-12)
176  if c<1037:
177  return (2,c-24)
178  return (0,None)
179 
180 

◆ makeRange()

def python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.makeRange (   self,
  chans 
)

Definition at line 124 of file LArExtendedSubDetGrouping.py.

124  def makeRange(self,chans):
125  chans.sort()
126  retVal=""
127  if (len(chans)==0):
128  return retVal
129  retVal=str(chans[0])
130  c1=chans[0]
131  series=False
132  for c2 in chans[1:]:
133  if c1 == c2:
134  print ("Duplicated entry",c2)
135  continue
136  if c2-1 == c1 or c2-1 in self._empty:
137  series=True
138  else:
139  if series:
140  retVal+=":"+str(c1)+","+str(c2)
141  series=False
142  else:
143  retVal+=","+str(c2)
144 # print ("c1=",c1,"c2=",c2,"sep=",sep)
145  c1=c2
146  if series: retVal+=":"+str(c1)
147  return retVal
148 
149 
150 

◆ Print()

def python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.Print (   self)

Definition at line 84 of file LArExtendedSubDetGrouping.py.

84  def Print(self):
85  print (self._EMBC)
86  print (self._EMBA)
87 
88 

◆ setWithCorr()

def python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.setWithCorr (   self,
  val 
)

Definition at line 81 of file LArExtendedSubDetGrouping.py.

81  def setWithCorr(self,val):
82  self._withCorr=val
83 

Member Data Documentation

◆ _corr

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._corr
private

Definition at line 60 of file LArExtendedSubDetGrouping.py.

◆ _EMBA

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._EMBA
private

Definition at line 6 of file LArExtendedSubDetGrouping.py.

◆ _EMBAPS

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._EMBAPS
private

Definition at line 8 of file LArExtendedSubDetGrouping.py.

◆ _EMBC

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._EMBC
private

Definition at line 5 of file LArExtendedSubDetGrouping.py.

◆ _EMBCPS

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._EMBCPS
private

Definition at line 7 of file LArExtendedSubDetGrouping.py.

◆ _EMECA

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._EMECA
private

Definition at line 10 of file LArExtendedSubDetGrouping.py.

◆ _EMECAPS

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._EMECAPS
private

Definition at line 12 of file LArExtendedSubDetGrouping.py.

◆ _EMECC

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._EMECC
private

Definition at line 9 of file LArExtendedSubDetGrouping.py.

◆ _EMECCPS

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._EMECCPS
private

Definition at line 11 of file LArExtendedSubDetGrouping.py.

◆ _empty

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._empty
private

Definition at line 38 of file LArExtendedSubDetGrouping.py.

◆ _emptyA

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._emptyA
private

Definition at line 37 of file LArExtendedSubDetGrouping.py.

◆ _emptyC

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._emptyC
private

Definition at line 36 of file LArExtendedSubDetGrouping.py.

◆ _FCALA

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._FCALA
private

Definition at line 16 of file LArExtendedSubDetGrouping.py.

◆ _FCALC

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._FCALC
private

Definition at line 15 of file LArExtendedSubDetGrouping.py.

◆ _HECA

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._HECA
private

Definition at line 14 of file LArExtendedSubDetGrouping.py.

◆ _HECC

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._HECC
private

Definition at line 13 of file LArExtendedSubDetGrouping.py.

◆ _partitions

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._partitions
private

Definition at line 43 of file LArExtendedSubDetGrouping.py.

◆ _revLookup

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._revLookup
private

Definition at line 75 of file LArExtendedSubDetGrouping.py.

◆ _withCorr

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping._withCorr
private

Definition at line 40 of file LArExtendedSubDetGrouping.py.

◆ counts

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.counts

Definition at line 186 of file LArExtendedSubDetGrouping.py.

◆ name

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.name

Definition at line 185 of file LArExtendedSubDetGrouping.py.

◆ size

python.LArExtendedSubDetGrouping.LArExtendedSubDetGrouping.size

Definition at line 184 of file LArExtendedSubDetGrouping.py.


The documentation for this class was generated from the following file:
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
IOVDbNamespace::makeRange
IOVRange makeRange(const cool::ValidityKey since, const cool::ValidityKey until, const bool timeIsEpoch)
Make an IOVRange from two validity keys.
Definition: IOVDbCoolFunctions.cxx:113
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
dqm_persistency::Print
void Print(const PParameter *param, TDirectory *topdir, Option_t *opt="")
Definition: dqm_persistency_impl.cxx:161
str
Definition: BTagTrackIpAccessor.cxx:11