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 "SGTools/DataProxy.h"

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 150 of file TRT_DetectorTool.cxx.

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

◆ ATLAS_NOT_THREAD_SAFE() [2/2]

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

Definition at line 255 of file TRT_DetectorTool.cxx.

257 {
258  MsgStream log(msgSvc(), name());
259  if (!m_manager) {
260  msg(MSG::WARNING) << "Manager does not exist" << endmsg;
261  return StatusCode::FAILURE;
262  }
263  if (m_alignable) {
264  return const_cast<InDetDD::TRT_DetectorManager*>(m_manager)->align(I,keys);
265  } else {
266  msg(MSG::DEBUG) << "Alignment disabled. No alignments applied" << endmsg;
267  return StatusCode::SUCCESS;
268  }
269 }
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