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 "AthenaKernel/ClassID_traits.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...
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

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

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