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

Public Member Functions

def __init__ (self, name="LArCellConditionsAlg", **kw)
 
def initialize (self)
 
def execute (self)
 
def printChannelInfo (self, id, chid)
 
def finalize (self)
 
def output (self, out, file=None)
 
def readInput (self)
 
def IdentifiersToString (self, chid, id)
 
def getOfflineIDFromString (self, input)
 
def getOnlineIDFromString (self, input)
 
def search (self, input)
 
def printHelp (self)
 
virtual StatusCode initialize () override
 
virtual StatusCode reinitialize () override
 
virtual StatusCode start () override
 
virtual StatusCode execute () override
 
virtual StatusCode stop () override
 
virtual StatusCode finalize () override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const char * typeName () const override
 return the std::type_info name of the underlying py-component This is used by concrete implementations to connect a python component to its C++ counter-part More...
 
virtual PyObjectself () override
 return associated python object. More...
 
 DeclareInterfaceID (IPyComponent, 1, 0)
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Public Attributes

 includeConditions
 init the base class More...
 
 includeLocation
 
 includeDSPTh
 
 nLinesPrinted
 
 nEvts
 
 onlineID
 
 offlineID
 
 bc_packing
 
 noisepattern
 
 deadpattern
 
 noid
 
 larPedestal
 
 larMphysOverMcal
 
 larRamp
 
 larDAC2uA
 
 laruA2MeV
 
 larhvScaleCorr
 
 larDSPThr
 
 larCabling
 
 badChannels
 
 caloDDM
 

Protected Member Functions

virtual bool setPyAttr (PyObject *pyobj) override
 attach the C++ component to its python cousin More...
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Protected Attributes

PyObjectm_self
 Pointer to self (from the python world) More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

 _detStore
 note that we are using the python logging service and that the PyAthena.Alg base class has already initialized it for us More...
 
 _condStore
 
 _oflErrStr
 print ("offline id input=[%s]" % input) More...
 
 _onlErrStr
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

This class is an Athena algorithm although it doesn't quite behave like one.
It's purpose is to interactivly convert LAr Online/Offline identifiers and
prints the bad channel status and optionally some calibration constants for
the given channel identifier.

Definition at line 26 of file LArCellConditionsAlg.py.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ __init__()

def python.LArCellConditionsAlg.LArCellConditionsAlg.__init__ (   self,
  name = "LArCellConditionsAlg",
**  kw 
)

Definition at line 34 of file LArCellConditionsAlg.py.

34  def __init__(self, name="LArCellConditionsAlg", **kw):
35 
36  kw['name'] = name
37  super(LArCellConditionsAlg,self).__init__(**kw)
38 
39  self.includeConditions=kw.get('printConditions',False)
40  self.includeLocation=kw.get('printLocation',False)
41  self.includeDSPTh=kw.get('printDSPTh',False)
42  self.nLinesPrinted=0
43  self.nEvts=0
44 
45  return
46 
47 

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ DeclareInterfaceID()

IPyComponent::DeclareInterfaceID ( IPyComponent  ,
,
 
)
inherited

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute() [1/2]

StatusCode PyAthena::Alg::execute ( )
overridevirtualinherited

Definition at line 93 of file PyAthenaAlg.cxx.

94 {
95 // ATH_MSG_DEBUG("Executing " << name() << "...");
97  PyObject* pycontext = PyCapsule_New ( const_cast<EventContext*>(&getContext()), nullptr, nullptr);
98 
99  StatusCode sc = PyAthena::callPyMethod( m_self, "sysExecute", pycontext );
100  Py_DECREF (pycontext);
101  return sc;
102 }

◆ execute() [2/2]

def python.LArCellConditionsAlg.LArCellConditionsAlg.execute (   self)

Definition at line 106 of file LArCellConditionsAlg.py.

106  def execute(self):
107  #self.msg.info('running execute...')
108 
109  #for debugging purposes:
110  #sgdump = open("sgdump.txt", 'w')
111  #self._condStore.dump(sgdump)
112  #sgdump.close()
113 
114  eid=ROOT.Gaudi.Hive.currentContext().eventID()
115 
116  try:
117  condCont=self._condStore.retrieve("CondCont<LArOnOffIdMapping>","LArOnOffIdMap")
118  self.larCabling=condCont.find(eid)
119  except Exception:
120  print("ERROR, failed to get LArCabling")
121  return StatusCode.Failure
122 
123 
124  try:
125  condCont=self._condStore.retrieve("CondCont<LArBadChannelCont>","LArBadChannel")
126  self.badChannels=condCont.find(eid)
127  except Exception:
128  print("ERROR, failed to get LArBadChannels")
129  return StatusCode.Failure
130 
131  if self.includeConditions:
132  try:
133  condCont=self._condStore.retrieve("CondCont<ILArPedestal>","LArPedestal")
134  self.larPedestal=condCont.find(eid)
135  except Exception:
136  print ("WARNING: Failed to retrieve Pedestal from DetStore")
137  import traceback
138  traceback.print_exc()
139  self.larPedestal=None
140 
141  try:
142  condCont=self._condStore.retrieve("CondCont<ILArMphysOverMcal>","LArMphysOverMcal")
143  self.larMphysOverMcal=condCont.find(eid)
144  except Exception:
145  print ("WARNING: Failed to retrieve MphysOverMcal from DetStore")
146  import traceback
147  traceback.print_exc()
148  self.larMphysOverMcal=None
149 
150  try:
151  condCont=self._condStore.retrieve("CondCont<ILArRamp>","LArRamp")
152  self.larRamp=condCont.find(eid)
153  except Exception:
154  print ("WARNING: Failed to retrieve LArRamp from DetStore")
155  import traceback
156  traceback.print_exc()
157  self.larRamp=None
158 
159  try:
160  condCont=self._condStore.retrieve("CondCont<ILArDAC2uA>","LArDAC2uA")
161  self.larDAC2uA=condCont.find(eid)
162  except Exception:
163  print ("WARNING: Failed to retrieve LArDAC2uA from DetStore")
164  import traceback
165  traceback.print_exc()
166  self.larDAC2uA=None
167 
168  try:
169  condCont=self._condStore.retrieve("CondCont<ILAruA2MeV>","LAruA2MeV")
170  self.laruA2MeV=condCont.find(eid)
171  except Exception:
172  print ("WARNING: Failed to retrieve LAruA2MeV from DetStore")
173  import traceback
174  traceback.print_exc()
175  self.laruA2MeV=None
176 
177  try:
178  condCont=self._condStore.retrieve("CondCont<ILArHVScaleCorr>","LArHVScaleCorr")
179  self.larhvScaleCorr=condCont.find(eid)
180  except Exception:
181  print ("WARNING: Failed to retrieve LArHVScaleCorr from DetStore")
182  import traceback
183  traceback.print_exc()
184  self.larhvScaleCorr=None
185 
186  if self.includeDSPTh:
187  try:
188  self.larDSPThr=self._detStore.retrieve("LArDSPThresholdsComplete","LArDSPThresholds")
189  except Exception:
190  print ("WARNING: Failed to retrieve LArDPSThresholds from DetStore")
191  import traceback
192  traceback.print_exc()
193  self.larDSPThr=None
194 
195 
196  if self.includeLocation:
197  try:
198  condCont=self._condStore.retrieve("CondCont<CaloDetDescrManager>","CaloDetDescrManager")
199  self.caloDDM = condCont.find(eid)
200  except Exception:
201  print("Failed to retrieve CaloDDM")
202  return StatusCode.Failure
203 
204  if self.nEvts==0:
205  self.nEvts+=1
206  #Process one 'dummy' event to make sure all DB connections get closed
207  #print ("Dummy event...")
208  return StatusCode.Success
209 
210  self.onlineID.set_do_checks(True)
211  self.offlineID.set_do_checks(True)
212 
213  while (1):
214  id=None
215  chid=None
216  rep_in=self.readInput() #"Enter Id >").upper().strip()
217  #rep_in="EMBA 0 0 60 2"
218  rep=rep_in.upper()
219 
220  #Quit
221  if len(rep)==0 or rep=="QUIT" or rep=="EXIT" or rep==".Q": break
222 
223 
224  if rep.startswith("SEARCH"):
225  inp=rep_in[6:].strip()
226  starttime=time.time()
227  self.search(inp)
228  print("seach time %.1f sec" % (time.time()-starttime))
229  continue
230 
231  #Help
232  if rep=="HELP":
233  self.printHelp()
234  continue
235 
236 
237 
238  try:
239  t_int=int(rep,10)
240  t=Identifier(c_uint(t_int))
241  if self.onlineID.is_lar(t):
242  print(t.get_identifier32().get_compact()," IsLAr (online)")
243  if self.offlineID.is_lar(t):
244  print(t.get_identifier32().getCompact()," isLAr (offline)")
245  except Exception:
246  pass
247 
248 
249 
250 
251 
252  if rep.startswith("ON"):
253  s=rep.find(" ")
254  if s==-1:s=0
255  chid=self.getOnlineIDFromString(rep[s:])
256  if chid is not None and self.onlineID.is_lar(chid):
257  id=self.larCabling.cnvToIdentifier(chid)
258  if id is None: id=self.noid
259  self.printChannelInfo(id,chid)
260  else:
261  print("ERROR: Could not interpret input.")
262  print("Interpretation as online ID gave:",self._onlErrStr)
263  continue
264 
265  if rep.startswith("OF"):
266  s=rep.find(" ")
267  if s==-1:s=0
268  id=self.getOfflineIDFromString(rep[s:])
269  if id is not None and self.offlineID.is_lar(id):
270  chid=self.larCabling.createSignalChannelID(id)
271  self.printChannelInfo(id,chid)
272  else:
273  print("ERROR: Could not interpret input.")
274  print("Interpretation as offline ID gave:",self._oflErrStr)
275  continue
276 
277  #Try to interpet input as identifiers
278  chid=self.getOnlineIDFromString(rep)
279  if chid is not None and self.onlineID.is_lar(chid):
280  id=self.larCabling.cnvToIdentifier(chid)
281  else: #try interpret at offline ID
282  id=self.getOfflineIDFromString(rep)
283  if id is not None and self.offlineID.is_lar(id):
284  chid=self.larCabling.createSignalChannelID(id)
285 
286  if chid is None or id is None:
287  print( "ERROR: Could not interpret input.")
288  print( "Interpretation as online ID gave:",self._onlErrStr)
289  print( "Interpretation as offline ID gave:",self._oflErrStr)
290  continue
291 
292  self.printChannelInfo(id,chid)
293  #break
294  return StatusCode.Success
295 

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize() [1/2]

StatusCode PyAthena::Alg::finalize ( )
overridevirtualinherited

Definition at line 86 of file PyAthenaAlg.cxx.

87 {
88  ATH_MSG_INFO("Finalizing " << name() << "...");
89  return PyAthena::callPyMethod( m_self, "sysFinalize" );
90 }

◆ finalize() [2/2]

def python.LArCellConditionsAlg.LArCellConditionsAlg.finalize (   self)

Definition at line 362 of file LArCellConditionsAlg.py.

362  def finalize(self):
363  self.msg.info('finalizing...')
364  return StatusCode.Success
365 
366 

◆ getOfflineIDFromString()

def python.LArCellConditionsAlg.LArCellConditionsAlg.getOfflineIDFromString (   self,
  input 
)

Definition at line 465 of file LArCellConditionsAlg.py.

465  def getOfflineIDFromString(self,input):
466  self._oflErrStr=""
467 
468  upInput=input.upper().strip()
469  if upInput.startswith('0X'):
470  #hex-input
471  try:
472  id_int=int(upInput,16)
473  except Exception:
474  self._oflErrStr="Can't interpret hexadecimal identifier, got " + upInput
475  return None
476  id=Identifier(id_int << 32)
477  if not self.offlineID.is_lar(id):
478  self._oflErrStr="Not a LAR identifier: " + upInput
479  return None
480 
481  elif upInput.isdigit():
482  try:
483  id_int=int(upInput,10)
484  except Exception:
485  self._oflErrStr="Can't interpret decimal identifier, got "+upInput
486  return None
487  id=Identifier(id_int << 32)
488 
489  if not self.offlineID.is_lar(id):
490  self._oflErrStr="Not a LAR identifier: " + upInput
491  return None
492 
493  else: #given as expanded ID
494  tbl=str.maketrans(r",:;/\#"," ")
495  fields=[]
496  for f in upInput.translate(tbl).split():
497  if len(f):
498  fields+=[f]
499  if len(fields)<5:
500  self._oflErrStr="Not enough fields to build offline id"
501  return None
502 
503  #Format: Subdet/Side/Layer/Region/Eta/Phi
504  if fields[0].startswith("EMB"):
505  subcalo=self.offlineID.LAREM
506  bepn=1
507  elif fields[0].startswith("EMECOW"):
508  subcalo=self.offlineID.LAREM
509  bepn=2
510  elif fields[0].startswith("EMECIW"):
511  subcalo=self.offlineID.LAREM
512  bepn=3
513  elif fields[0].startswith("HE"):
514  subcalo=self.offlineID.LARHEC
515  bepn=2
516  elif fields[0].startswith("F"):
517  subcalo=self.offlineID.LARFCAL
518  bepn=2
519  else:
520  self._oflErrStr="Can't interpret subcalo field, got "+fields[0]
521  return None
522 
523  if len(fields)==6:
524  sidefield=fields[1]
525  elif len(fields)==5:
526  sidefield=fields[0]
527  else:
528  self._oflErrStr="Can't interpret input: Expected 5 or 6 sub-fields, found "+str(len(fields))
529  return None
530 
531  if sidefield.endswith("A") or sidefield.endswith("P") or sidefield.endswith("POS") or sidefield == '1':
532  side=1
533  elif sidefield.endswith("C") or sidefield.endswith("N") or sidefield.endswith("NEG") or sidefield == '0':
534  side=-1
535  else:
536  self._oflErrStr="Can't interpret field for detector side, got "+ sidefield
537  return None
538 
539  bepn=bepn*side
540 
541 
542  if fields[-4].isdigit():
543  layer=int(fields[-4])
544  else:
545  ls=fields[-4]
546  if (ls=="PS" or ls.startswith("PRES")): layer=0
547  elif (ls=="FRONT" or ls.startswith("STRIP")): layer=1
548  elif ls.startswith("MID"): layer=2
549  elif ls=="BACK": layer=3
550  else:
551  self._oflErrStr="Can't interpet textual value for layer, got " + ls
552  return None
553  try:
554  region=int(fields[-3])
555  eta=int(fields[-2])
556  phi=int(fields[-1])
557  except Exception:
558  self._oflErrStr="Not-numerical input for region, eta or phi"
559  return None
560 
561  #print ("Got",subcalo,bepn,layer,region,eta,phi)
562  #self.offlineID.set_do_checks(True)
563  try: #Build Region ID
564  regid=self.offlineID.region_id(subcalo,bepn,layer,region)
565  except Exception:
566  self._oflErrStr="Failed to build offline region identifier. Layer/region values inconsistent?"
567  return None
568 
569  etamin=self.offlineID.eta_min(regid)
570  etamax=self.offlineID.eta_max(regid)
571 
572  if (eta<etamin or eta>etamax):
573  self._oflErrStr="Eta must be between %i and %i for this region, got %i" % (etamin,etamax,eta)
574  return None
575 
576  phimin=self.offlineID.phi_min(regid)
577  phimax=self.offlineID.phi_max(regid)
578  if (phi<phimin or phi>phimax):
579  self._oflErrStr="Phi must be between %i and %i for this region, got %i" % (phimin,phimax,phi)
580  return None
581 
582  id=None
583  try:
584  id=self.offlineID.cell_id(regid,eta,phi)
585  #id=self.offlineID.cell_id(subcalo,bepn,layer,region,eta,phi)
586  except Exception:
587  self._oflErrStr="Failed to build offline identifier. One or more values out-of-range?"
588  id=None
589 
590  #self.offlineID.set_do_checks(False)
591  return id
592 
593 

◆ getOnlineIDFromString()

def python.LArCellConditionsAlg.LArCellConditionsAlg.getOnlineIDFromString (   self,
  input 
)

Definition at line 594 of file LArCellConditionsAlg.py.

594  def getOnlineIDFromString(self,input):
595  #print ("onfline id input=[%s]" % input)
596  self._onlErrStr=""
597  upInput=input.upper().strip()
598  if upInput.startswith('0X'):
599  #hex-input
600  try:
601  id_int=int(upInput,16)
602  except Exception:
603  self._onlErrStr="Can't interpret hexadecimal online identifier, got "+input
604  return None
605 
606  if (id_int < 0x38000000 or id_int > 0x3bc68000):
607  self._onlErrStr="Outside of numerical range of online identifiers"
608  return None
609 
610 
611  id=HWIdentifier(id_int<<32)
612  if not self.onlineID.is_lar(id):
613  self._onlErrStr="Not a LAR identifier:" + input
614  return None
615 
616  elif upInput.isdigit():
617  try:
618  id_int=int(upInput,10)
619  except Exception:
620  self._onlErrStr="Can't interpret decimal online identifier, got "+input
621  return None
622 
623  if (id_int < 0x38000000 or id_int > 0x3bc68000):
624  self._onlErrStr="Outside of numerical range of online identifiers"
625  return None
626 
627  id=HWIdentifier(id_int<<32)
628  if not self.onlineID.is_lar(id):
629  self._onlErrStr="Not a LAR identifier:" + input
630  return None
631 
632  else: #given as expanded ID
633  tbl=str.maketrans(r",:;/\#"," ")
634  fields=[]
635  for f in upInput.translate(tbl).split():
636  if len(f):
637  fields+=[f]
638 
639  #fields is now a 'clean array' of input
640  #Format: B/EC Side FT Slot Chan
641  if len(fields)==4:
642  sideField=fields[0]
643  elif len(fields)==5: # and len(fields[1])==1:
644  sideField=fields[1]
645  else:
646  self._onlErrStr="Expected 4 or 5 fields, found "+str(len(fields))
647  return None
648 
649  if "BARREL".find(fields[0][0:6])==0:
650  bec=0
651  elif "ENDCAP".find(fields[0][0:6])==0:
652  bec=1
653  elif "EC".find(fields[0][0:2])==0:
654  bec=1
655  else:
656  self._onlErrStr="Can't interpret field for Barrel/Endcap, got "+fields[0]
657  return None
658 
659  if sideField.endswith("A") or sideField=="1" or sideField.startswith("P"):
660  side=1
661  elif sideField.endswith("C") or sideField=="0" or sideField.startswith("N"):
662  side=0
663  else:
664  self._onlErrStr="Can't interpret field for detector side, got " + sideField
665  return None
666  try:
667  chan=int(fields[-1])
668  slot=int(fields[-2])
669  ft=int(fields[-3])
670  except Exception:
671  self._onlErrStr="Not-numerical input for FT slot or channel"
672  return None
673 
674  if bec==0:
675  if ft<0 or ft>31:
676  self._onlErrStr="Barrel feedthrough number must be between 0 and 31, got "+str(slot)
677  return None
678  else:
679  if ft<0 or ft>24:
680  self._onlErrStr="Endcap feedthrough number must be between 0 and 24, got "+str(slot)
681  return None
682 
683  if slot<1 or slot>15:
684  self._onlErrStr="Slot number must be between 1 and 15, got "+str(slot)
685  return None
686 
687  if chan<0 or chan>127:
688  self._onlErrStr="Channel number must be between 0 and 127, got "+str(chan)
689  return None
690 
691 
692  id=None
693  #self.onlineID.set_do_checks(True)
694  try:
695  id=self.onlineID.channel_Id(bec,side,ft,slot,chan)
696  except Exception:
697  self._onlErrStr="Failed to build online identifier. One or more values out-of-range?"
698  id=None
699  #self.onlineID.set_do_checks(False)
700  return id
701 
702 

◆ IdentifiersToString()

def python.LArCellConditionsAlg.LArCellConditionsAlg.IdentifiersToString (   self,
  chid,
  id 
)

Definition at line 389 of file LArCellConditionsAlg.py.

389  def IdentifiersToString(self,chid,id):
390  onlName="None"
391  oflName="None"
392  if chid is not None:
393  onlName=str(chid.get_identifier32().get_compact())+" " #+str(chid.get_compact())+" "
394  #onlName=self.onlineID.channel_name(chid)
395  bec=self.onlineID.barrel_ec(chid)
396  side=self.onlineID.pos_neg(chid)
397  ft=self.onlineID.feedthrough(chid)
398  slot=self.onlineID.slot(chid)
399  chan=self.onlineID.channel(chid)
400  ftname=self.onlineID.feedthrough_name(chid)
401 
402  if bec==0:
403  onlName+="[BARREL/"
404  else:
405  onlName+="[ENDCAP/"
406 
407  if side==0:
408  onlName+="C/"
409  else:
410  onlName+="A/"
411 
412  onlName+="FT "+str(ft)+"("+ftname+")/Slot "+str(slot)+"/Chan "+str(chan)
413 
414  try:
415  calibLines=self.larCabling.calibSlotLine(chid)
416  if (len(calibLines)):
417  onlName+="/CL"
418  for calib_chid in calibLines:
419  onlName+=" "+str(self.onlineID.channel(calib_chid))
420  except Exception:
421  pass
422 
423  onlName+=']'
424 
425  if id is not None:
426 
427  oflName=str(id.get_identifier32().get_compact()) + " "# +str(id.get_compact())+" "
428 
429  if (id==self.noid):#0xFFFFFFFF):
430  oflName += "[disconnected]"
431  else:
432  subcalo=self.offlineID.sub_calo(id)
433  side=self.offlineID.pos_neg(id)
434  layer=self.offlineID.sampling(id)
435  region=self.offlineID.region(id)
436  eta=self.offlineID.eta(id)
437  phi=self.offlineID.phi(id)
438 
439  if subcalo is self.offlineID.LAREM:
440  if abs(side)==1:
441  oflName+="[EMB"
442  elif abs(side)==2:
443  oflName+="[EMECOW"
444  elif abs(side)==3:
445  oflName+="[EMECIW"
446  else:
447  oflName+="[UNKNOWN"
448  elif subcalo is self.offlineID.LARHEC:
449  oflName+="[HEC"
450  elif subcalo is self.offlineID.LARFCAL:
451  oflName+="[FCAL"
452  else:
453  oflName+="[UNKNOWN"
454 
455  oflName+="/"
456  if side>0:
457  oflName+="A/"
458  else:
459  oflName+="C/"
460 
461  oflName+="Lay "+str(layer)+"/Reg "+str(region)+"/Eta "+str(eta)+"/Phi "+str(phi) +"]"
462  return onlName+" = "+oflName
463 
464 

◆ initialize() [1/2]

StatusCode PyAthena::Alg::initialize ( )
overridevirtualinherited

Definition at line 60 of file PyAthenaAlg.cxx.

61 {
62  ATH_MSG_INFO("Initializing " << name() << "...");
63  return PyAthena::callPyMethod( m_self, "sysInitialize" );
64 }

◆ initialize() [2/2]

def python.LArCellConditionsAlg.LArCellConditionsAlg.initialize (   self)

Definition at line 48 of file LArCellConditionsAlg.py.

48  def initialize(self):
49 
52 
53  # Get DetectorStore...
54 
55  self._detStore = PyAthena.py_svc('StoreGateSvc/DetectorStore')
56  if self._detStore is None:
57  self.msg.error("Failed to get DetectorStore")
58  return StatusCode.Failure
59 
60  self._condStore = PyAthena.py_svc('StoreGateSvc/ConditionStore')
61  if (self._condStore is None):
62  self.msg.error("Failed to get ConditionStore")
63  return StatusCode.Failure
64 
65  # Get LArOnlineID helper class
66  self.onlineID=self._detStore.retrieve("LArOnlineID","LArOnlineID")
67  if self.onlineID is None:
68  self.msg.error("Failed to get LArOnlineID")
69  return StatusCode.Failure
70 
71  # Get CaloCell_ID
72  self.offlineID=self._detStore.retrieve("CaloCell_ID","CaloCell_ID")
73  if self.offlineID is None:
74  self.msg.error("Failed to get CaloCell_ID")
75  return StatusCode.Failure
76 
77  self.bc_packing=LArBadChanBitPacking()
78 
79  self.noisepattern=0
80  for n in ("lowNoiseHG","highNoiseHG","unstableNoiseHG","lowNoiseMG","highNoiseMG","unstableNoiseMG","lowNoiseLG","highNoiseLG","unstableNoiseLG","sporadicBurstNoise"):
81  stat=self.bc_packing.enumName(n)
82  if stat[0]:
83  self.noisepattern |= 1<<stat[1]
84 
85  self.deadpattern=0
86  for n in ("deadReadout","deadPhys","almostDead"):
87  stat=self.bc_packing.enumName(n)
88  if stat[0]:
89  self.deadpattern |= 1<<stat[1]
90 
91  self.noid=Identifier()
92 
93 
94 
95  self.larPedestal=None
96  self.larMphysOverMcal=None
97  self.larRamp=None
98  self.larDAC2uA=None
99  self.laruA2MeV=None
100  self.larhvScaleCorr=None
101  self.larDSPThr=None
102 
103  return StatusCode.Success
104 
105 

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ output()

def python.LArCellConditionsAlg.LArCellConditionsAlg.output (   self,
  out,
  file = None 
)

Definition at line 367 of file LArCellConditionsAlg.py.

367  def output(self,out,file=None):
368  if file is not None: file.write(out+"\n")
369  print(out)
370  self.nLinesPrinted=self.nLinesPrinted+1
371  if self.nLinesPrinted%40 == 0:
372  c=input("Press 'q' to quit, 'a' for all ...")
373  if c.upper().startswith("Q"):
374  return True
375  if c.upper().startswith("A"):
376  self.nLinesPrinted=0xFFFFFFFF
377  return False
378 
379 

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ printChannelInfo()

def python.LArCellConditionsAlg.LArCellConditionsAlg.printChannelInfo (   self,
  id,
  chid 
)

Definition at line 296 of file LArCellConditionsAlg.py.

296  def printChannelInfo(self,id,chid):
297  bc=self.badChannels.status(chid)
298  print(self.IdentifiersToString(chid,id)+ " " + self.bc_packing.stringStatus(bc))
299  if id!=self.noid: #Don't try to show anything more for disconnected channels
300  if self.includeLocation:
301  try:
302  #idHash=self.offlineID.calo_cell_hash(id)
303  theDDE=self.caloDDM.get_element(id)
304  print("raw Eta= %.3f, Phi=%.3f r=%.3f" % (theDDE.eta_raw(),theDDE.phi_raw(),theDDE.r_raw()))
305  print("raw x=%.3f, y=%.3f, z=%.3f" % (theDDE.x(),theDDE.y(),theDDE.z_raw()))
306  except Exception as e:
307  print(e)
308 
309  if self.includeConditions:
310  if self.larDAC2uA is not None:
311  print("DAC2uA: %.3f" % self.larDAC2uA.DAC2UA(chid), end="")
312  else:
313  print("DAC2uA: None",end="")
314 
315  if self.laruA2MeV is not None:
316  print(" uA2MeV: %.3f" % self.laruA2MeV.UA2MEV(chid),end="")
317  else:
318  print(" uA2MeV: None",end="")
319 
320  if self.larhvScaleCorr is not None:
321  print(" HVScaleCorr: %.3f" % self.larhvScaleCorr.HVScaleCorr(chid))
322  else:
323  print(" HVScaleCorr: None")
324 
325  for gain,gainname in ((0,"HG"),(1,"MG"),(2,"LG")):
326  print(gainname,end="")
327  if self.larPedestal is not None:
328  ped=self.larPedestal.pedestal(chid,gain)
329  pedRMS=self.larPedestal.pedestalRMS(chid,gain)
330  else:
331  ped=-9999
332  pedRMS=-9999
333 
334  print (" Ped: %.3f " % ped,end="")
335  print (" PedRMS: %.3f" % pedRMS,end="")
336 
337  if self.larRamp is not None:
338  ramp=self.larRamp.ADC2DAC(chid,gain)
339  if len(ramp)>1:
340  print(" Ramp: %.3f" % ramp[1],end="")
341  else:
342  print(" Ramp: Empty",end="")
343  else:
344  print(" Ramp: None",end="")
345 
346  if self.larMphysOverMcal is not None:
347  mpmc=self.larMphysOverMcal.MphysOverMcal(chid,gain)
348  print (" MphysOverMcal: %.5f" % mpmc,end="")
349  else:
350  print (" MphysOverMcal: None",end="")
351  print ("")
352  if self.includeDSPTh:
353  if self.larDSPThr is not None:
354  tQThr=self.larDSPThr.tQThr(chid)
355  samThr=self.larDSPThr.samplesThr(chid)
356  trgSumTrh=self.larDSPThr.trigSumThr(chid)
357  print("DSP Thresholds: tQ:%f, samples:%f, trigSum:%f" % (tQThr,samThr,trgSumTrh))
358  else:
359  print("DSP Thresholds: None")
360 
361 

◆ printHelp()

def python.LArCellConditionsAlg.LArCellConditionsAlg.printHelp (   self)

Definition at line 911 of file LArCellConditionsAlg.py.

911  def printHelp(self):
912  print( "First mode of operation:")
913  print( "Enter a channel identifier (online or offline). Allowed forms are:")
914  print( " Decimal or hexadecimal compact identifier, eg. 'online 0x39000000'")
915  print( " Expanded identifer like")
916  print( " 'online Bar C 1 1 1' (Barrel C FT 1, Slot 1 channel 1)")
917  print( " 'offline FCAL A 1 0 1 1' (FCAL A, Layer 1, Region 0, Eta 1 Phi 1)")
918  print( " Offline ids must start with one of the following subdetectors names:")
919  print( " EMB, EMECIW, EMECOW, HEC, FCAL")
920  print( " Online ids must start with either 'BAR' or 'END'")
921  print( " If the prefix 'online' or 'offline' is omitted both are tried.")
922  print( "\nSecond mode of operation:")
923  print( "Search <keyword> <keyword> ..")
924  print( " Keywords are: 'barrel', 'endcap', A', 'C', or any bad-channel type")
925  print( " Keywords with arguments are: 'eta', 'phi', 'layer', 'FT', 'Slot' and 'CL'")
926  print( "\nType 'quit' to terminate'")
927 
928 

◆ readInput()

def python.LArCellConditionsAlg.LArCellConditionsAlg.readInput (   self)

Definition at line 380 of file LArCellConditionsAlg.py.

380  def readInput(self):
381  self.nLinesPrinted=0
382  try:
383  rep=input("Enter Id >")
384  except Exception:
385  return ""
386 
387  return rep.strip()
388 

◆ reinitialize()

StatusCode PyAthena::Alg::reinitialize ( )
overridevirtualinherited

Definition at line 67 of file PyAthenaAlg.cxx.

68 {
69  ATH_MSG_INFO("Re-Initializing " << name() << "...");
70  return PyAthena::callPyMethod( m_self, "sysReinitialize" );
71 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ search()

def python.LArCellConditionsAlg.LArCellConditionsAlg.search (   self,
  input 
)

Definition at line 703 of file LArCellConditionsAlg.py.

703  def search(self,input):
704 
705  subcalo=None
706  eta=None
707  phi=None
708  bec=None
709  side=None
710  ft=None
711  slot=None
712  bctypes=0
713  outname=None
714  outfile=None
715  layer=None
716  cl=None
717  tbl=str.maketrans(",:;#="," ")
718  tokens=[]
719  for t in input.translate(tbl).split():
720  if len(t):
721  if (len(tokens)>0) and not tokens[-1].isalpha() and not t[0].isalpha():
722  tokens[-1]+=t
723  else:
724  tokens+=[t]
725 
726  def interpretToken(input):
727  pos=input[1:].find("+-")
728  if pos==-1:
729  pos=input[1:].find("-")
730  if pos==-1:
731  uplow=None
732  pos=len(input)-1
733  else:
734  uplow=True
735  else:
736  uplow=False
737 
738 
739  pos=pos+1
740  try:
741  e1=float(input[:pos])
742  except Exception:
743  print("Expected numerical value, got",input[:pos] )
744  return None
745 
746  if uplow is not None:
747  try:
748  e2=float(input[pos+1:])
749  except Exception:
750  print("Expected numerical value after '+-', got",input[pos+1:])
751  return None
752 
753 
754  if uplow:
755  ret=[e1,e2]
756  else:
757  ret=[e1-e2,e1+e2]
758  else:
759  ret=[e1-0.025,e1+0.025]
760  ret.sort()
761  return ret
762 
763  i=0
764  while (i<len(tokens)):
765  if tokens[i].upper()=="OUT" and i+1<len(tokens):
766  outname=tokens[i+1]
767  i=i+1
768  elif tokens[i].upper()=="ETA" and i+1<len(tokens):
769  eta=interpretToken(tokens[i+1])
770  i=i+1
771  elif tokens[i].upper()=="LAYER" and i+1<len(tokens):
772  layer=interpretToken(tokens[i+1])
773  i=i+1
774  elif tokens[i].upper()=="PHI" and i+1<len(tokens):
775  phi=interpretToken(tokens[i+1])
776  i=i+1
777  elif tokens[i].upper()=="FT" and i+1<len(tokens):
778  ft=interpretToken(tokens[i+1])
779  i=i+1
780  elif tokens[i].upper()=="SLOT" and i+1<len(tokens):
781  slot=interpretToken(tokens[i+1])
782  i=i+1
783  elif tokens[i].upper()=="BAD":
784  bctypes=0xFFFFFFFF
785  elif tokens[i].upper()=="NOISE" or tokens[i].upper()=="NOISY":
786  bctypes |= self.noisepattern
787  elif tokens[i].upper()=="DEAD":
788  bctypes |= self.deadpattern
789  elif tokens[i].upper().startswith("BAR"):
790  bec=0
791  elif tokens[i].upper().startswith("END"):
792  bec=1
793  elif tokens[i].upper()=="EM":
794  subcalo=self.offlineID.LAREM
795  elif tokens[i].upper()=="HEC":
796  subcalo=self.offlineID.LARHEC
797  elif tokens[i].upper()=="FCAL":
798  subcalo=self.offlineID.LARFCAL
799  elif tokens[i].upper()=="A" or tokens[i]=="P":
800  side=1
801  elif tokens[i].upper()=="C" or tokens[i]=="N":
802  side=0
803  elif tokens[i].upper()=="CL" and tokens[i+1].isdigit():
804  cl=int(tokens[i+1])
805  i=i+1
806  else:
807  stat=self.bc_packing.enumName(tokens[i])
808  if stat[0]:
809  bctypes |= 1<<stat[1]
810  else:
811  print("Unknown Keyword",tokens[i] )
812  i=i+1
813 
814  print("Searching for cells with ",end="")
815  if eta is not None: print(" %.3f <= eta <= %.3f" % (eta[0],eta[1]),end="")
816  if phi is not None: print(" %.3f <= phi <= %.3f" % (phi[0],phi[1]),end="")
817  if layer is not None: print(" %.0f <= layer <= %.0f" % (layer[0],layer[1]),end="")
818 
819  if bec==0: print(" Barrel",end="")
820  if bec==1: print(" Endcap",end="")
821 
822  if side==1: print(" A Side",end="")
823  if side==0: print(" C Side",end="")
824 
825  if ft is not None: print(" %.0f <= FT <= %.0f" % (ft[0],ft[1]),end="")
826  if slot is not None: print(" %.0f <= Slot <= %.0f" % (slot[0],slot[1]),end="")
827 
828  if bctypes!=0:
829  print (" "+self.bc_packing.stringStatus(LArBadChannel(bctypes)),end="")
830 
831  if phi is None and eta is None and bctypes==0 and ft is None and side is None and bec is None and slot is None and layer and subcalo is None:
832  print ("No search criteria set!")
833  return
834 
835 
836  if cl is not None: print(" CL:",cl,end="")
837 
838  print(os.linesep)
839 
840  if not self.includeLocation and (eta is not None or phi is not None):
841  print("ERROR: GeoModel not activated, run with -g option")
842  return
843 
844  if outname is not None:
845  try:
846  outfile=open(outname,"w")
847  except IOError:
848  print ("ERROR failed to open file",outname)
849  import traceback
850  traceback.print_exc()
851  outfile=None
852  outname=None
853 
854 
855  #for idH in range(self.offlineID.calo_cell_hash_max()): //This one includes also tile cells
856  for idH in range(182468):
857  idHash=IdentifierHash(idH)
858  chid=self.larCabling.createSignalChannelIDFromHash(idHash)
859 
860  #print ("Loop hash=%i , on: %x , off: %x" % (idH, chid.get_identifier32().get_compact(), self.offlineID.cell_id(idHash).get_identifier32().get_compact()))
861  #Check Bad-Channel Status
862  bcstat=self.badChannels.status(chid)
863  if bctypes!=0:
864  bcw=bcstat.packedData()
865  if bcw & bctypes == 0: continue
866 
867 
868  #Check Online Id
869  if bec is not None and bec!=self.onlineID.barrel_ec(chid): continue
870  if side is not None and side!=self.onlineID.pos_neg(chid): continue
871  if ft is not None and (self.onlineID.feedthrough(chid)<ft[0] or self.onlineID.feedthrough(chid)>ft[1]): continue
872  if slot is not None and (self.onlineID.slot(chid)<slot[0] or self.onlineID.slot(chid)>slot[1]): continue
873 
874  if cl is not None:
875  try:
876  calibLines=self.larCabling.calibSlotLine(chid)
877  keep=False
878  for foundCLs in calibLines:
879  if self.onlineID.channel(foundCLs) == cl:
880  keep=True
881  break
882 
883  if not keep: continue
884 
885  except Exception:
886  print ("Failed to get calib line:")
887  import traceback
888  traceback.print_exc()
889  continue
890 
891  #Check geometrical location
892  ep=""
893  if eta is not None or phi is not None:
894  theDDE=self.caloDDM.get_element(idHash)
895  e=theDDE.eta()
896  p=theDDE.phi()
897  if eta is not None and (e<eta[0] or e>eta[1]): continue
898  if phi is not None and (p<phi[0] or p>phi[1]): continue
899  ep=" eta=%.3f phi=%.3f " % (e,p)
900 
901  id=self.offlineID.cell_id(idHash)
902  if subcalo is not None and subcalo!=self.offlineID.sub_calo(id): continue
903  if layer is not None and (self.offlineID.sampling(id)<layer[0] or self.offlineID.sampling(id)>layer[1]): continue
904 
905  br=self.output(self.IdentifiersToString(chid,id) + " " +ep+self.bc_packing.stringStatus(bcstat),outfile)
906  if br: break
907 
908  if outfile is not None: outfile.close()
909  return
910 

◆ self()

virtual PyObject* PyAthena::Alg::self ( )
inlineoverridevirtualinherited

return associated python object.

BORROWED reference.

Implements IPyComponent.

Definition at line 71 of file PyAthenaAlg.h.

71 { return m_self; }

◆ setPyAttr()

bool PyAthena::Alg::setPyAttr ( PyObject pyobj)
overrideprotectedvirtualinherited

attach the C++ component to its python cousin

Implements IPyComponent.

Definition at line 143 of file PyAthenaAlg.cxx.

144 {
145  // now we tell the PyObject which C++ object it is the cousin of.
147  PyObject* pyobj = TPython::CPPInstance_FromVoidPtr
148  ( (void*)this, this->typeName() );
149  if ( !pyobj ) {
150  PyErr_Clear();
151  // try PyAthena::Alg
152  pyobj = TPython::CPPInstance_FromVoidPtr ((void*)this, "PyAthena::Alg");
154  ("could not dyncast component [" << name() << "] to a python "
155  << "object of type [" << this->typeName() << "] (probably a missing "
156  << "dictionary)" << endmsg
157  << "fallback to [PyAthena::Alg]...");
158  }
159  if ( !pyobj ) {
160  PyErr_Clear();
161  ATH_MSG_WARNING("Could not dyncast component ["
162  << name() << "] to a pyobject of type ["
163  << this->typeName() << "]");
164  } else {
165  if ( -1 == PyObject_SetAttrString(o, "_cppHandle", pyobj) ) {
166  PyErr_Clear();
168  ("Could not attach C++ handle [" << name() << "] to its python "
169  << "cousin !");
170  if ( -1 == PyObject_SetAttrString(o, "_cppHandle", Py_None) ) {
171  PyErr_Clear();
173  ("could not attach a dummy C++ handle [" << name() << "] to its "
174  "python cousin !");
175  }
176  } else {
177  return true;
178  }
179  }
180  return false;
181 }

◆ start()

StatusCode PyAthena::Alg::start ( )
overridevirtualinherited

Definition at line 74 of file PyAthenaAlg.cxx.

75 {
76  return PyAthena::callPyMethod( m_self, "sysStart" );
77 }

◆ stop()

StatusCode PyAthena::Alg::stop ( )
overridevirtualinherited

Definition at line 80 of file PyAthenaAlg.cxx.

81 {
82  return PyAthena::callPyMethod( m_self, "sysStop" );
83 }

◆ sysInitialize()

StatusCode PyAthena::Alg::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthAlgorithm.

Definition at line 105 of file PyAthenaAlg.cxx.

106 {
108  ( "PyAthena::PyComponentMgr/PyComponentMgr", name() );
109  if ( !pyMgr.retrieve().isSuccess() ) {
110  ATH_MSG_ERROR("Could not retrieve service [" << pyMgr.typeAndName()
111  << "] !!");
112  return StatusCode::FAILURE;
113  }
114 
115  // first retrieve our python object cousin...
116  m_self = pyMgr->pyObject( this );
117 
118  if ( m_self == Py_None ) {
119  ATH_MSG_ERROR("Wrapped PyObject is NONE !");
120  return StatusCode::FAILURE;
121  }
122 
123  // re-route to usual sysInit...
124  return AlgBase_t::sysInitialize();
125 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ typeName()

const char * PyAthena::Alg::typeName ( ) const
overridevirtualinherited

return the std::type_info name of the underlying py-component This is used by concrete implementations to connect a python component to its C++ counter-part

Implements IPyComponent.

Definition at line 132 of file PyAthenaAlg.cxx.

133 {
134  static const std::string tname = System::typeinfoName(typeid(*this));
135  return tname.c_str();
136 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ _condStore

python.LArCellConditionsAlg.LArCellConditionsAlg._condStore
private

Definition at line 60 of file LArCellConditionsAlg.py.

◆ _detStore

python.LArCellConditionsAlg.LArCellConditionsAlg._detStore
private

note that we are using the python logging service and that the PyAthena.Alg base class has already initialized it for us

Definition at line 55 of file LArCellConditionsAlg.py.

◆ _oflErrStr

python.LArCellConditionsAlg.LArCellConditionsAlg._oflErrStr
private

print ("offline id input=[%s]" % input)

Definition at line 466 of file LArCellConditionsAlg.py.

◆ _onlErrStr

python.LArCellConditionsAlg.LArCellConditionsAlg._onlErrStr
private

Definition at line 596 of file LArCellConditionsAlg.py.

◆ badChannels

python.LArCellConditionsAlg.LArCellConditionsAlg.badChannels

Definition at line 126 of file LArCellConditionsAlg.py.

◆ bc_packing

python.LArCellConditionsAlg.LArCellConditionsAlg.bc_packing

Definition at line 77 of file LArCellConditionsAlg.py.

◆ caloDDM

python.LArCellConditionsAlg.LArCellConditionsAlg.caloDDM

Definition at line 199 of file LArCellConditionsAlg.py.

◆ deadpattern

python.LArCellConditionsAlg.LArCellConditionsAlg.deadpattern

Definition at line 85 of file LArCellConditionsAlg.py.

◆ includeConditions

python.LArCellConditionsAlg.LArCellConditionsAlg.includeConditions

init the base class

Definition at line 39 of file LArCellConditionsAlg.py.

◆ includeDSPTh

python.LArCellConditionsAlg.LArCellConditionsAlg.includeDSPTh

Definition at line 41 of file LArCellConditionsAlg.py.

◆ includeLocation

python.LArCellConditionsAlg.LArCellConditionsAlg.includeLocation

Definition at line 40 of file LArCellConditionsAlg.py.

◆ larCabling

python.LArCellConditionsAlg.LArCellConditionsAlg.larCabling

Definition at line 118 of file LArCellConditionsAlg.py.

◆ larDAC2uA

python.LArCellConditionsAlg.LArCellConditionsAlg.larDAC2uA

Definition at line 98 of file LArCellConditionsAlg.py.

◆ larDSPThr

python.LArCellConditionsAlg.LArCellConditionsAlg.larDSPThr

Definition at line 101 of file LArCellConditionsAlg.py.

◆ larhvScaleCorr

python.LArCellConditionsAlg.LArCellConditionsAlg.larhvScaleCorr

Definition at line 100 of file LArCellConditionsAlg.py.

◆ larMphysOverMcal

python.LArCellConditionsAlg.LArCellConditionsAlg.larMphysOverMcal

Definition at line 96 of file LArCellConditionsAlg.py.

◆ larPedestal

python.LArCellConditionsAlg.LArCellConditionsAlg.larPedestal

Definition at line 95 of file LArCellConditionsAlg.py.

◆ larRamp

python.LArCellConditionsAlg.LArCellConditionsAlg.larRamp

Definition at line 97 of file LArCellConditionsAlg.py.

◆ laruA2MeV

python.LArCellConditionsAlg.LArCellConditionsAlg.laruA2MeV

Definition at line 99 of file LArCellConditionsAlg.py.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_self

PyObject* PyAthena::Alg::m_self
protectedinherited

Pointer to self (from the python world)

Definition at line 96 of file PyAthenaAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ nEvts

python.LArCellConditionsAlg.LArCellConditionsAlg.nEvts

Definition at line 43 of file LArCellConditionsAlg.py.

◆ nLinesPrinted

python.LArCellConditionsAlg.LArCellConditionsAlg.nLinesPrinted

Definition at line 42 of file LArCellConditionsAlg.py.

◆ noid

python.LArCellConditionsAlg.LArCellConditionsAlg.noid

Definition at line 91 of file LArCellConditionsAlg.py.

◆ noisepattern

python.LArCellConditionsAlg.LArCellConditionsAlg.noisepattern

Definition at line 79 of file LArCellConditionsAlg.py.

◆ offlineID

python.LArCellConditionsAlg.LArCellConditionsAlg.offlineID

Definition at line 72 of file LArCellConditionsAlg.py.

◆ onlineID

python.LArCellConditionsAlg.LArCellConditionsAlg.onlineID

Definition at line 66 of file LArCellConditionsAlg.py.


The documentation for this class was generated from the following file:
grepfile.info
info
Definition: grepfile.py:38
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
PyAthena::Alg::m_self
PyObject * m_self
Pointer to self (from the python world)
Definition: PyAthenaAlg.h:96
LArBadChanBitPacking
Definition: LArBadChanBitPacking.h:13
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
PyAthena::Alg::typeName
virtual const char * typeName() const override
return the std::type_info name of the underlying py-component This is used by concrete implementation...
Definition: PyAthenaAlg.cxx:132
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
initialize
void initialize()
Definition: run_EoverP.cxx:894
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
upper
int upper(int c)
Definition: LArBadChannelParser.cxx:49
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HWIdentifier
Definition: HWIdentifier.h:13
search
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
Definition: hcg.cxx:738
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:68
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
RootUtils::PyGILStateEnsure
Definition: PyAthenaGILStateEnsure.h:20
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:23
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
LArBadChannel
Definition: LArBadChannel.h:10
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge.output
output
Definition: merge.py:17
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
printHelp
void printHelp()
Definition: AtlCoolCopy.cxx:3346
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Trk::open
@ open
Definition: BinningType.h:40
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
merge.status
status
Definition: merge.py:17
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
readCCLHist.readInput
def readInput(filename, nCellsList=20, bcfile=None, cutoff=0.1)
Definition: readCCLHist.py:10
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
error
Definition: IImpactPoint3dEstimator.h:70
PyObject
_object PyObject
Definition: IPyComponent.h:26
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
readCCLHist.float
float
Definition: readCCLHist.py:83
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
fitman.k
k
Definition: fitman.py:528
ServiceHandle
Definition: ClusterMakerTool.h:37