ATLAS Offline Software
Functions
TRT_DetectorTool.cxx File Reference
#include "TRT_DetectorTool.h"
#include "TRTDetectorFactory_Full.h"
#include "TRTDetectorFactory_Lite.h"
#include "GeoModelUtilities/GeoModelExperiment.h"
#include "GeoModelUtilities/DecodeVersionKey.h"
#include "RDBAccessSvc/IRDBAccessSvc.h"
#include "RDBAccessSvc/IRDBRecord.h"
#include "RDBAccessSvc/IRDBRecordset.h"
#include "DetDescrConditions/AlignableTransformContainer.h"
#include "TRT_ConditionsData/StrawDxContainer.h"
#include "PathResolver/PathResolver.h"
#include "SGTools/DataProxy.h"
#include <memory>

Go to the source code of this file.

Functions

StatusCode TRT_DetectorTool::registerCallback ATLAS_NOT_THREAD_SAFE ()
 Install fatal handler with default options. More...
 
StatusCode TRT_DetectorTool::align ATLAS_NOT_THREAD_SAFE (IOVSVC_CALLBACK_ARGS_P(I, keys))
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/2]

StatusCode TRT_DetectorTool::registerCallback ATLAS_NOT_THREAD_SAFE ( )
inline

Install fatal handler with default options.

This is meant to be easy to call from python via ctypes.

Install fatal handler with default options.

getLorentzAngle() Read LorentzAngle from HIST and write out into local DB

getBSErrors() Read BSErrors from Monitoring HIST and write out into local DB

getEfficiency() Read Efficiency from Monitoring HIST and write out into local DB

getRawOccupancy() Read RawOccupancy from Monitoring HIST and write out into local DB

getNoiseOccupancy() Read NoiseOccupancy from HIST and write out into local DB

getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats

Definition at line 164 of file TRT_DetectorTool.cxx.

165 {
166  // This callback is kept because the folder never changes.
167 
168  MsgStream log(msgSvc(), name());
169 
170  // If we fail to register any callbacks we return FAILURE. This just tells GeoModelSvc that
171  // no callbacks were registered. It will continue normally but without any alignments.
172  StatusCode sc = StatusCode::FAILURE;
173 
174  if (m_alignable) {
175 
176 
177  if (m_useDynamicAlignFolders){ // Regular alignment new schema
178  std::string folderName = "/TRT/AlignL1/TRT";
179  if (detStore()->contains<CondAttrListCollection>(folderName)) {
180  msg(MSG::DEBUG) << "Registering callback on global Container with folder " << folderName << endmsg;
182  StatusCode trttmp = detStore()->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool*>(this), calc, folderName);
183  // We don't expect this to fail as we have already checked that the detstore contains the object.
184  if (trttmp.isFailure()) {
185  msg(MSG::ERROR) << "Problem when register callback on global Container with folder " << folderName <<endmsg;
186  } else {
187  sc = StatusCode::SUCCESS;
188  }
189  } else {
190  msg(MSG::WARNING) << "Unable to register callback on global Container with folder " << folderName <<endmsg;
191  return StatusCode::FAILURE;
192  }
193 
194  folderName = "/TRT/AlignL2";
195  if (detStore()->contains<AlignableTransformContainer>(folderName)) {
196  if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Registering callback on AlignableTransformContainer with folder " << folderName << endmsg;
198  StatusCode sctmp = detStore()->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool *>(this), atc, folderName);
199  if(sctmp.isFailure()) {
200  msg(MSG::ERROR) << "Problem when register callback on AlignableTransformContainer with folder " << folderName <<endmsg;
201  } else {
202  sc = StatusCode::SUCCESS;
203  }
204  }
205  else {
206  msg(MSG::WARNING) << "Unable to register callback on AlignableTransformContainer with folder "
207  << folderName << endmsg;
208  return StatusCode::FAILURE;
209  }
210  }
211  else { // Regular alignment old schema
212  std::string folderName = "/TRT/Align";
213  if (detStore()->contains<AlignableTransformContainer>(folderName)) {
214  msg(MSG::DEBUG) << "Registering callback on AlignableTransformContainer with folder " << folderName << endmsg;
216  StatusCode sctmp = detStore()->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool *>(this), atc, folderName);
217  // We don't expect this to fail as we have already checked that the detstore contains the object.
218  if (sctmp.isFailure()) {
219  msg(MSG::ERROR) << "Problem when register callback on AlignableTransformContainer with folder " << folderName <<endmsg;
220  } else {
221  sc = StatusCode::SUCCESS;
222  }
223  } else {
224  msg(MSG::WARNING) << "Unable to register callback on AlignableTransformContainer with folder "
225  << folderName << ", Alignments disabled! (Only if no Run2 schema is loaded)" << endmsg;
226  }
227  }
228 
229 
230  // Fine alignment
231  {
232  std::string folderName = "/TRT/Calib/DX";
233  if (detStore()->contains<TRTCond::StrawDxContainer>(folderName)) {
234  msg(MSG::DEBUG) << "Registering callback on StrawDxContainer with folder " << folderName << endmsg;
236  StatusCode sctmp = detStore()->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool*>(this), sdc, folderName);
237  // We don't expect this to fail as we have already checked that the detstore contains the object.
238  if (sctmp.isFailure()) {
239  msg(MSG::ERROR) << "Problem when register callback on StrawDxContainer with folder " << folderName <<endmsg;
240  } else {
241  sc = StatusCode::SUCCESS;
242  }
243  } else {
244  msg(MSG::DEBUG) << "Unable to register callback on StrawDxContainer with folder " << folderName <<endmsg;
245  }
246  }
247 
248  } else {
249  msg(MSG::INFO) << "Alignment disabled. No callback registered" << endmsg;
250  // We return failure otherwise it will try and register
251  // a GeoModelSvc callback associated with this callback.
252  }
253 
254  return sc;
255 }

◆ ATLAS_NOT_THREAD_SAFE() [2/2]

StatusCode TRT_DetectorTool::align ATLAS_NOT_THREAD_SAFE ( IOVSVC_CALLBACK_ARGS_P(I, keys)  )

Definition at line 269 of file TRT_DetectorTool.cxx.

271 {
272  MsgStream log(msgSvc(), name());
273  if (!m_manager) {
274  msg(MSG::WARNING) << "Manager does not exist" << endmsg;
275  return StatusCode::FAILURE;
276  }
277  if (m_alignable) {
278  return const_cast<InDetDD::TRT_DetectorManager*>(m_manager)->align(I,keys);
279  } else {
280  msg(MSG::DEBUG) << "Alignment disabled. No alignments applied" << endmsg;
281  return StatusCode::SUCCESS;
282  }
283 }
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
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
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
CaloCellTimeCorrFiller.folderName
string folderName
Definition: CaloCellTimeCorrFiller.py:19
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DataHandle
an iterator over instances of a given type in StoreGateSvc. It d-casts and caches locally the pointed...
Definition: DataHandle.h:43
InDetDD::TRT_DetectorManager
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
Definition: TRT_DetectorManager.h:63
IGeoModelTool
Definition: IGeoModelTool.h:12
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
I
#define I(x, y, z)
Definition: MD5.cxx:116
beamspotnt.calc
calc
Definition: bin/beamspotnt.py:1251
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7