ATLAS Offline Software
Loading...
Searching...
No Matches
IdDictDetDescrCnv Class Reference

Converter for the DetDescrCnvSvc which parses the identifier xml dictionaries and creates an IdDictManager in the DetectorStore. More...

#include <IdDictDetDescrCnv.h>

Inheritance diagram for IdDictDetDescrCnv:
Collaboration diagram for IdDictDetDescrCnv:

Public Member Functions

virtual long int repSvcType () const override
virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj) override
 IdDictDetDescrCnv (ISvcLocator *svcloc)
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&pAddr)
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
const ServiceHandle< StoreGateSvc > & detStore () const
 Handle to DetectorStore.
void addTrack (TIDA::Track *t)
const std::vector< TIDA::Track * > & tracks () const
void clear ()
void selectTracks (const TrigInDetTrackCollection *trigtracks)
void selectTracks (const Rec::TrackParticleContainer *trigtracks)
void selectTracks (const Analysis::MuonContainer *muontracks)
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Static Public Member Functions

static long int storageType ()
 Storage type and class ID (used by CnvFactory)
static const CLIDclassID ()

Protected Member Functions

double phiCorr (double phi)
void ipCorr (double d0, double z0, double &d0c, double &z0c, double phi0, double eta, double pt)

Protected Attributes

double m_beamX
double m_beamY
double m_beamZ
std::vector< TIDA::Track * > m_tracks

Private Member Functions

template<class dType>
StatusCode loadProperty (const std::string &propertyName, dType &pipeTo)
 Loads the property from the DetDecrCnvSvc and pipes its value Returns failure if either the service, the property don't exist or the data type is wrong.
template<class dType>
StatusCode loadPropertyWithParse (const std::string &propertyName, dType &pipeTo)
 Same as loadProperty but additionally m_doParsing is set to true if the input value does not match the set property value.
StatusCode getFileNamesFromProperties ()
 Get file names from properties.
StatusCode getFileNamesFromTags ()
 Get file names from properties.
StatusCode registerFilesWithParser ()
 Register the requested files with the xml parser.
StatusCode registerInfoWithDicts ()
 Register the requested files and tag with the created id dicts.
void printDicts (const IdDictManager *dictMgr)
 Print out the contained dictionaries and version.
StatusCode parseXMLDescription ()
 Create and (re)initialize the IdDictManager - only create the first time.
void collectCaloNeighbors (IRDBRecordset_ptr recordset)
 A helper function for collecting calo neighbor file names from the database.
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

ServiceHandle< IGeoDbTagSvcm_geoDbTagSvc {"GeoDbTagSvc/GeoDbTagSvc", "IdDictDetDescrCnv"}
ServiceHandle< IRDBAccessSvcm_rdbAccessSvc {"RDBAccessSvc/RDBAccessSvc", "IdDictDetDescrCnv"}
SmartIF< IProperty > m_detDescrProxy
 Propxy to the DetDescrCnvSvc.
std::unique_ptr< IdDictParserm_parser {}
 The xml parser for the dictionary descriptions.
bool m_doChecks {false}
 Flag to tell helpers to do Checks.
bool m_doNeighbours {true}
 Flag to generate neighbor information - for calos.
std::string m_idDictName {}
 Name of top-level xml dict file.
bool m_idDictFromRDB {false}
 Flag to get dict parameters from Relational DetDescr DB.
bool m_doParsing {true}
 Flag to which determines whether the xml files are parsed or not.
std::string m_atlasIDFileName {}
 File to be read for top-level subsystem ids values.
std::string m_inDetIDFileName {}
 File to be read for InDet ids.
std::string m_larIDFileName {}
 File to be read for LAr ids.
std::string m_tileIDFileName {}
 File to be read for Tile ids.
std::string m_caloIDFileName {}
 File to be read for Calo ids.
std::string m_fullAtlasNeighborsName {}
 Files for Calo Neighbors.
std::string m_fcal2dNeighborsName {}
std::string m_fcal3dNeighborsNextName {}
std::string m_fcal3dNeighborsPrevName {}
std::string m_tileNeighborsName {}
std::string m_muonIDFileName {}
 File to be read for Muon ids.
std::string m_forwardIDFileName {}
 File to be read for Forward det ids.
std::string m_atlasIdDictTag {}
 Tag of RDB record for Atlas top-level ids.
std::string m_inDetIdDictTag {}
 Tag of RDB record for InDet ids.
std::string m_larIdDictTag {}
 Tag of RDB record for LAr ids.
std::string m_tileIdDictTag {}
 Tag of RDB record for Tile ids.
std::string m_caloIdDictTag {}
 Tag of RDB record for Calo ids.
std::string m_muonIdDictTag {}
 Tag of RDB record for Muon ids.
std::string m_forwardIdDictTag {}
 Tag of RDB record for forwards det ids.
std::string m_inDetIDTag {}
 Internal InDet id tag.
bool m_useGeomDB_InDet {false}
ServiceHandle< StoreGateSvcm_detStore
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Converter for the DetDescrCnvSvc which parses the identifier xml dictionaries and creates an IdDictManager in the DetectorStore.

This is used by the IdHelpers to initialize themselves.

Definition at line 42 of file IdDictDetDescrCnv.h.

Constructor & Destructor Documentation

◆ IdDictDetDescrCnv()

IdDictDetDescrCnv::IdDictDetDescrCnv ( ISvcLocator * svcloc)

Definition at line 263 of file IdDictDetDescrCnv.cxx.

264 : DetDescrConverter(ClassID_traits<IdDictManager>::ID(), svcloc, "IdDictDetDescrCnv")
265{}
DetDescrConverter(const CLID &myCLID, ISvcLocator *svcloc, const char *name=nullptr)

Member Function Documentation

◆ addTrack()

void Converter::addTrack ( TIDA::Track * t)
inlineinherited

Definition at line 45 of file Converter.h.

45 {
46 m_tracks.push_back(t);
47 }
std::vector< TIDA::Track * > m_tracks
Definition Converter.h:321

◆ classID()

const CLID & IdDictDetDescrCnv::classID ( )
static

Definition at line 258 of file IdDictDetDescrCnv.cxx.

258 {
260}

◆ clear()

void Converter::clear ( )
inlineinherited

Definition at line 53 of file Converter.h.

53{m_tracks.clear();}

◆ collectCaloNeighbors()

void IdDictDetDescrCnv::collectCaloNeighbors ( IRDBRecordset_ptr recordset)
private

A helper function for collecting calo neighbor file names from the database.

Definition at line 234 of file IdDictDetDescrCnv.cxx.

235{
236 const IRDBRecord *neighborTable = (*recordset)[0];
237 m_fullAtlasNeighborsName = neighborTable->getString("FULLATLASNEIGHBORS");
238 m_fcal2dNeighborsName = neighborTable->getString("FCAL2DNEIGHBORS");
239 m_fcal3dNeighborsNextName = neighborTable->getString("FCAL3DNEIGHBORSNEXT");
240 m_fcal3dNeighborsPrevName = neighborTable->getString("FCAL3DNEIGHBORSPREV");
241 m_tileNeighborsName = neighborTable->getString("TILENEIGHBORS");
242 ATH_MSG_DEBUG(" using neighbor files: ");
243 ATH_MSG_DEBUG(" FullAtlasNeighborsFileName: " << m_fullAtlasNeighborsName);
244 ATH_MSG_DEBUG(" FCAL2DNeighborsFileName: " << m_fcal2dNeighborsName);
245 ATH_MSG_DEBUG(" FCAL3DNeighborsNextFileName: " << m_fcal3dNeighborsNextName);
246 ATH_MSG_DEBUG(" FCAL3DNeighborsPrevFileName: " << m_fcal3dNeighborsPrevName);
247 ATH_MSG_DEBUG(" TileNeighborsFileName: " << m_tileNeighborsName);
248 return;
249}
#define ATH_MSG_DEBUG(x)
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
std::string m_fcal2dNeighborsName
std::string m_tileNeighborsName
std::string m_fullAtlasNeighborsName
Files for Calo Neighbors.
std::string m_fcal3dNeighborsNextName
std::string m_fcal3dNeighborsPrevName

◆ createObj()

StatusCode IdDictDetDescrCnv::createObj ( IOpaqueAddress * pAddr,
DataObject *& pObj )
overridevirtual

Implements DetDescrConverter.

Definition at line 52 of file IdDictDetDescrCnv.cxx.

53 {
54 //
55 // Here we create an IdDictManager and provide it with an
56 // IdDictMgr which has been filled by an IdDictParser. This mgr
57 // is used by each IdHelper to initialize itself.
58 //
59 // Lifetime management:
60 //
61 // IdDictDetDescrCnv holds onto ONE IdDictParser, which in
62 // turn holds the same IdDictMgr.
63 //
64 // Multiple initializations are possible. parseXMLDescription
65 // will look for a new set of xml files, clear any
66 // pre-existing IdDictMgr help by the parser and then parse
67 // the new xml files, filling the IdDictMgr.
68 //
69 // Since the parser "refills" the same IdDictMgr, one has the
70 // option to delete and recreate the IdDictManager, or just
71 // keep the same one which will be refreshed with the new
72 // description.
73 //
75 "in createObj: creating a IdDictManager object in the detector store");
76 DetDescrAddress *ddAddr = dynamic_cast<DetDescrAddress *>(pAddr);
77 if (!ddAddr) {
78 ATH_MSG_ERROR("Could not cast to DetDescrAddress.");
79 return StatusCode::FAILURE;
80 }
81
82 // Get the StoreGate key of this container.
83 std::string mgrKey = *(ddAddr->par());
84 if (mgrKey.empty())
85 ATH_MSG_DEBUG("No Manager key ");
86 else
87 ATH_MSG_DEBUG("Manager key is " << mgrKey);
88
90
91 // Create the manager - only once
92 IdDictManager *dictMgr = new IdDictManager(m_parser->m_idd);
93
94 ATH_MSG_DEBUG("Created IdDictManager ");
95
96 // Print out the dictionary names
97 printDicts(dictMgr);
98
99 // Pass a pointer to the container to the Persistency service
100 // by reference.
101 pObj = SG::asStorable(dictMgr);
102
103 return StatusCode::SUCCESS;
104}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
void printDicts(const IdDictManager *dictMgr)
Print out the contained dictionaries and version.
std::unique_ptr< IdDictParser > m_parser
The xml parser for the dictionary descriptions.
StatusCode parseXMLDescription()
Create and (re)initialize the IdDictManager - only create the first time.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)

◆ createRep()

StatusCode DetDescrConverter::createRep ( DataObject * pObj,
IOpaqueAddress *& pAddr )
virtualinherited

Definition at line 20 of file DetDescrConverter.cxx.

21 {
22 return StatusCode::SUCCESS;
23}

◆ detStore()

const ServiceHandle< StoreGateSvc > & DetDescrConverter::detStore ( ) const
inlineinherited

Handle to DetectorStore.

Definition at line 33 of file DetDescrConverter.h.

33{ return m_detStore; }
ServiceHandle< StoreGateSvc > m_detStore

◆ fillObjRefs()

StatusCode DetDescrConverter::fillObjRefs ( IOpaqueAddress * pAddr,
DataObject * pObj )
virtualinherited

Definition at line 15 of file DetDescrConverter.cxx.

16 {
17 return StatusCode::SUCCESS;
18}

◆ fillRepRefs()

StatusCode DetDescrConverter::fillRepRefs ( IOpaqueAddress * pAddr,
DataObject * pObj )
virtualinherited

Definition at line 25 of file DetDescrConverter.cxx.

26 {
27 return StatusCode::SUCCESS;
28}

◆ finalize()

StatusCode IdDictDetDescrCnv::finalize ( )
overridevirtual

Definition at line 46 of file IdDictDetDescrCnv.cxx.

46 {
47 ATH_MSG_INFO("in finalize");
48 return StatusCode::SUCCESS;
49}

◆ getFileNamesFromProperties()

StatusCode IdDictDetDescrCnv::getFileNamesFromProperties ( )
private

Get file names from properties.

Definition at line 303 of file IdDictDetDescrCnv.cxx.

303 {
304 // Check whether non-default names have been specified for the
305 // IdDict files of the subsystems
306
307 // Atlas IDs
308 ATH_CHECK(loadProperty("AtlasIDFileName", m_atlasIDFileName));
309 // InDet Ids
310 ATH_CHECK(loadProperty("InDetIDFileName", m_inDetIDFileName));
311 // LAr ids
312 ATH_CHECK(loadProperty("LArIDFileName", m_larIDFileName));
313 // Tile ids
314 ATH_CHECK(loadProperty("TileIDFileName", m_tileIDFileName));
315 // Calo ids
316 ATH_CHECK(loadProperty("CaloIDFileName", m_caloIDFileName));
317 // Calo neighbor files
318 ATH_CHECK(loadProperty("FullAtlasNeighborsFileName", m_fullAtlasNeighborsName));
319 ATH_CHECK(loadProperty("FCAL2DNeighborsFileName", m_fcal2dNeighborsName));
320 ATH_CHECK(loadProperty("FCAL3DNeighborsNextFileName", m_fcal3dNeighborsNextName));
321 ATH_CHECK(loadProperty("FCAL3DNeighborsPrevFileName", m_fcal3dNeighborsPrevName));
322
323 ATH_CHECK(loadProperty("TileNeighborsFileName", m_tileNeighborsName));
324 // Muon ids
325 ATH_CHECK(loadProperty("MuonIDFileName", m_muonIDFileName));
326 // ForwardDetectors ids
327 ATH_CHECK(loadProperty("ForwardIDFileName", m_forwardIDFileName));
328 return StatusCode::SUCCESS;
329}
std::string m_atlasIDFileName
File to be read for top-level subsystem ids values.
std::string m_caloIDFileName
File to be read for Calo ids.
std::string m_muonIDFileName
File to be read for Muon ids.
std::string m_inDetIDFileName
File to be read for InDet ids.
std::string m_forwardIDFileName
File to be read for Forward det ids.
std::string m_tileIDFileName
File to be read for Tile ids.
StatusCode loadProperty(const std::string &propertyName, dType &pipeTo)
Loads the property from the DetDecrCnvSvc and pipes its value Returns failure if either the service,...
std::string m_larIDFileName
File to be read for LAr ids.

◆ getFileNamesFromTags()

StatusCode IdDictDetDescrCnv::getFileNamesFromTags ( )
private

Get file names from properties.

Definition at line 332 of file IdDictDetDescrCnv.cxx.

332 {
333 // Fetch file names and tags from the RDB
334 ATH_CHECK(m_geoDbTagSvc.retrieve());
335 bool skipDbDictAccess = m_geoDbTagSvc->getParamSvcName().empty();
336 std::string paramSvcName = skipDbDictAccess ? "RDBAccessSvc" : m_geoDbTagSvc->getParamSvcName();
337 ATH_MSG_DEBUG("Accessed " << paramSvcName);
338 m_rdbAccessSvc.setName(paramSvcName);
339 ATH_CHECK(m_rdbAccessSvc.retrieve());
340
341 if(skipDbDictAccess) {
342 ATH_MSG_WARNING("Unable to determine RDBAccessSvc backend. Using default dictionaries");
343 // Get Calo Neighbor tables from Oracle and return
344 IRDBRecordset_ptr caloNeighborTable = m_rdbAccessSvc->getRecordsetPtr("CaloNeighborTable", "CaloNeighborTable-00");
345 collectCaloNeighbors(std::move(caloNeighborTable));
346 return StatusCode::SUCCESS;
347 }
348
349 auto assignTagAndName = [this](const IRDBRecordset_ptr &idDictSet,
350 std::string &fileName,
351 std::string &dictTag) {
352 if (idDictSet->size()) {
353 const IRDBRecord *idDictTable = (*idDictSet)[0];
354 const std::string dictName = idDictTable->getString("DICT_NAME");
355 fileName = idDictTable->getString("DICT_FILENAME");
356 dictTag = idDictSet->tagName();
357 // NOTE: the internal tag for IdDict is global, but is
358 // only used for InDet and thus is defined by InDet
359 if (!idDictTable->isFieldNull("DICT_TAG")) {
360 m_inDetIDTag = idDictTable->getString("DICT_TAG");
361 }
362 ATH_MSG_DEBUG(" using dictionary: "
363 << dictName << ", file: " << fileName
364 << ", with internal tag: " << m_inDetIDTag
365 << ", dictionary tag: " << dictTag);
366
367 } else {
368 ATH_MSG_WARNING(" no record set found for dictionary"<<idDictSet->nodeName()<< " - using default dictionary ");
369 }
370 };
371
372 // Function for reading ID dictionary as a BLOB from SQLite
373 // and writing it on the disk in the run directory
374 auto getEmbeddedDict = [this](const std::string& dictName,
375 std::string &fileName,
376 std::string &dictTag) -> bool
377 {
378 ATH_MSG_DEBUG("Try to access "<<dictName);
379 IRDBRecordset_ptr rec = m_rdbAccessSvc->getRecordsetPtr(dictName,"","");
380 if(rec->size()>0) {
381 const IRDBRecord *dictRecord = (*rec)[0];
382 std::string dictString = dictRecord->getString("CONTENTS");
383 // write to the temporary file
384 std::string dictFileName = dictName+"-fromSQLite.xml";
385 std::ofstream dictFile;
386 dictFile.open(dictFileName);
387 dictFile << dictString;
388 dictFile.close();
389
390 fileName = std::move(dictFileName);
391 dictTag.clear(); // This may change in the future if we also write dict tags into SQLite
392
393 ATH_MSG_DEBUG(dictName << " read from the SQLite database as a BLOB");
394 return true;
395 }
396 return false;
397 };
398
399 bool useGeomDB = (m_geoDbTagSvc->getSqliteReader() == nullptr);
400
401 std::string detTag{""}, detNode{""}, dictName{""};
402 DecodeVersionKey detectorKey("ATLAS");
403 IRDBRecordset_ptr idDictSet{};
404
405 bool embeddedDict{false};
406
407 // Get InDet
408 if (m_useGeomDB_InDet) {
409 // Get Innner Detector xml and write to the temporary file
410 // InDetIdDict.xml
411 detectorKey = DecodeVersionKey(m_geoDbTagSvc.get(), "InnerDetector");
412 ATH_MSG_DEBUG("From Version Tag: " << detectorKey.tag() << " at Node: "
413 << detectorKey.node());
414 detTag = detectorKey.tag();
415 detNode = detectorKey.node();
416 idDictSet = m_rdbAccessSvc->getRecordsetPtr("DICTXDD", detTag, detNode);
417
418 // Size == 0 if not found
419 if (idDictSet->size()) {
420 const IRDBRecord *recordInDet = (*idDictSet)[0];
421 std::string InDetString = recordInDet->getString("XMLCLOB");
422
423 // write to the temporary file
424 std::ofstream blobFile;
425 blobFile.open("InDetIdDict.xml");
426 blobFile << InDetString << std::endl;
427 blobFile.close();
428 } else {
429 ATH_MSG_WARNING(" no record set found for InDetIdentifier - using default dictionary ");
430 }
431 } else {
432 // Attempt to read the embedded disctionary from SQLite
433 embeddedDict = !useGeomDB && getEmbeddedDict("IdDictInnerDetector",m_inDetIDFileName,m_inDetIdDictTag);
434 if(!embeddedDict) {
435 // Fall back on getting file names from the database
436 if (useGeomDB) {
437 detectorKey = DecodeVersionKey(m_geoDbTagSvc.get(), "InnerDetector");
438 ATH_MSG_DEBUG("From Version Tag: " << detectorKey.tag() << " at Node: " << detectorKey.node());
439 detTag = detectorKey.tag();
440 detNode = detectorKey.node();
441 }
442 idDictSet = m_rdbAccessSvc->getRecordsetPtr("InDetIdentifier", detTag, detNode);
443 assignTagAndName(idDictSet, m_inDetIDFileName, m_inDetIdDictTag);
444 }
445 }
446
447 // Get LAr
448 // Attempt to read the embedded disctionary from SQLite
449 embeddedDict = !useGeomDB && getEmbeddedDict("IdDictLArCalorimeter",m_larIDFileName,m_larIdDictTag);
450 if(!embeddedDict) {
451 // Fall back on getting file names from the database
452 if (useGeomDB) {
453 detectorKey = DecodeVersionKey(m_geoDbTagSvc.get(), "LAr");
454 ATH_MSG_DEBUG( "From Version Tag: " << detectorKey.tag() << " at Node: " << detectorKey.node() );
455 detTag = detectorKey.tag();
456 detNode = detectorKey.node();
457 }
458 idDictSet = m_rdbAccessSvc->getRecordsetPtr("LArIdentifier", detTag, detNode);
459 assignTagAndName(idDictSet, m_larIDFileName, m_larIdDictTag);
460 }
461
462 // Get Tile
463 // Attempt to read the embedded disctionary from SQLite
464 embeddedDict = !useGeomDB && getEmbeddedDict("IdDictTileCalorimeter",m_tileIDFileName,m_tileIdDictTag);
465 if(!embeddedDict) {
466 // Fall back on getting file names from the database
467 if (useGeomDB) {
468 detectorKey = DecodeVersionKey(m_geoDbTagSvc.get(), "TileCal");
469 ATH_MSG_DEBUG( "From Version Tag: " << detectorKey.tag() << " at Node: " << detectorKey.node() );
470 detTag = detectorKey.tag();
471 detNode = detectorKey.node();
472 }
473 idDictSet = m_rdbAccessSvc->getRecordsetPtr("TileIdentifier", detTag, detNode);
474 assignTagAndName(idDictSet, m_tileIDFileName, m_tileIdDictTag);
475 }
476
477 // Get Calo
478 // Attempt to read the embedded disctionary from SQLite
479 embeddedDict = !useGeomDB && getEmbeddedDict("IdDictCalorimeter",m_caloIDFileName,m_caloIdDictTag);
480 if(!embeddedDict) {
481 // Fall back on getting file names from the database
482 if (useGeomDB) {
483 detectorKey = DecodeVersionKey(m_geoDbTagSvc.get(), "Calorimeter");
484 ATH_MSG_DEBUG( "From Version Tag: " << detectorKey.tag()<< " at Node: " << detectorKey.node() );
485 detTag = detectorKey.tag();
486 detNode = detectorKey.node();
487 }
488 idDictSet = m_rdbAccessSvc->getRecordsetPtr("CaloIdentifier", detTag, detNode);
489 assignTagAndName(idDictSet, m_caloIDFileName, m_caloIdDictTag);
490 }
491 // Calo neighbor files:
492 IRDBRecordset_ptr caloNeighborTable = m_rdbAccessSvc->getRecordsetPtr("CaloNeighborTable", detTag, detNode);
493
494 if (caloNeighborTable->size() == 0 && useGeomDB) {
495 caloNeighborTable = m_rdbAccessSvc->getRecordsetPtr("CaloNeighborTable", "CaloNeighborTable-00");
496 }
497 // Size == 0 if not found
498 if (caloNeighborTable->size()) {
499 collectCaloNeighbors(std::move(caloNeighborTable));
500 }
501
502 // Get Muon
503 // Attempt to read the embedded disctionary from SQLite
504 embeddedDict = !useGeomDB && getEmbeddedDict("IdDictMuonSpectrometer", m_muonIDFileName, m_muonIdDictTag);
505 if(!embeddedDict) {
506 // Fall back on getting file names from the database
507 if (useGeomDB) {
508 detectorKey = DecodeVersionKey(m_geoDbTagSvc.get(), "MuonSpectrometer");
509 ATH_MSG_DEBUG( "From Version Tag: " << detectorKey.tag()<< " at Node: " << detectorKey.node() );
510 detTag = detectorKey.tag();
511 detNode = detectorKey.node();
512 }
513 idDictSet = m_rdbAccessSvc->getRecordsetPtr("MuonIdentifier", detTag, detNode);
514 assignTagAndName(idDictSet, m_muonIDFileName, m_muonIdDictTag);
515 }
516
517 // Get Forward
518 // Attempt to read the embedded disctionary from SQLite
519 embeddedDict = !useGeomDB && getEmbeddedDict("IdDictForwardDetectors",m_forwardIDFileName,m_forwardIdDictTag);
520 if(!embeddedDict) {
521 // Fall back on getting file names from the database
522 if (useGeomDB) {
523 detectorKey = DecodeVersionKey(m_geoDbTagSvc.get(), "ForwardDetectors");
524 ATH_MSG_DEBUG( "From Version Tag: " << detectorKey.tag() << " at Node: " << detectorKey.node() );
525 detTag = detectorKey.tag();
526 detNode = detectorKey.node();
527 }
528 idDictSet = m_rdbAccessSvc->getRecordsetPtr("ForDetIdentifier", detTag, detNode);
529
530 // For older datasets use ForDetIdentifier-00 as fallback
531 if (idDictSet->size() == 0 && useGeomDB) {
532 idDictSet = m_rdbAccessSvc->getRecordsetPtr("ForDetIdentifier",
533 "ForDetIdentifier-00");
534 ATH_MSG_DEBUG(" explicitly requesting ForDetIdentifier-00 tag for pre-forward "
535 "detector data ");
536 }
537 // Size == 0 if not found
538 assignTagAndName(idDictSet, m_forwardIDFileName, m_forwardIdDictTag);
539 }
540 ATH_MSG_DEBUG("End access to RDB for id dictionary info ");
541 return StatusCode::SUCCESS;
542}
#define ATH_MSG_WARNING(x)
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
virtual bool isFieldNull(const std::string &fieldName) const =0
Check if the field value is NULL.
virtual std::string tagName() const =0
virtual std::string nodeName() const =0
virtual unsigned int size() const =0
std::string m_muonIdDictTag
Tag of RDB record for Muon ids.
std::string m_tileIdDictTag
Tag of RDB record for Tile ids.
std::string m_forwardIdDictTag
Tag of RDB record for forwards det ids.
void collectCaloNeighbors(IRDBRecordset_ptr recordset)
A helper function for collecting calo neighbor file names from the database.
ServiceHandle< IRDBAccessSvc > m_rdbAccessSvc
std::string m_inDetIdDictTag
Tag of RDB record for InDet ids.
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
std::string m_larIdDictTag
Tag of RDB record for LAr ids.
std::string m_caloIdDictTag
Tag of RDB record for Calo ids.
std::string m_inDetIDTag
Internal InDet id tag.

◆ initialize()

StatusCode IdDictDetDescrCnv::initialize ( )
overridevirtual

Definition at line 34 of file IdDictDetDescrCnv.cxx.

34 {
35 // First call parent init
36 ATH_CHECK(DetDescrConverter::initialize());
37 ATH_MSG_INFO("in initialize");
38 // Must set indet tag to EMPTY
39 m_inDetIDTag = "EMPTY";
40
41 m_detDescrProxy = serviceLocator()->service("DetDescrCnvSvc");
42 ATH_CHECK(m_detDescrProxy.isValid());
43
44 return StatusCode::SUCCESS;
45}
SmartIF< IProperty > m_detDescrProxy
Propxy to the DetDescrCnvSvc.

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ ipCorr()

void Converter::ipCorr ( double d0,
double z0,
double & d0c,
double & z0c,
double phi0,
double eta,
double pt )
inlineprotectedinherited

Definition at line 257 of file Converter.h.

257 {
258
259 double sn = sin(phi0);
260 double cs = cos(phi0);
261 double sd0 = (d0 != 0 ? d0/fabs(d0) : 1);
262 double spt = (pt != 0 ? pt/fabs(pt) : 1);
263
264 if (fabs(pt) >= 1*CLHEP::TeV) {
265
266 d0c = d0 + m_beamX*sn - m_beamY*cs;
267
268 } else {
269
270 double rc = fabs(pt)*15.0/(9.0*1.042);
271
272 double xc = (fabs(d0)-spt*sd0*rc)*cos(phi0+M_PI/2*sd0) - m_beamX;
273 double yc = (fabs(d0)-spt*sd0*rc)*sin(phi0+M_PI/2*sd0) - m_beamY;
274
275 double newphi;
276 double xd01,yd01,xd02,yd02;
277
278 if (xc == 0) {
279 xd01 = 0; yd01 = rc+yc;
280 xd02 = 0; yd02 = -rc+yc;
281 } else {
282 xd01 = xc+yc/xc*yc+sqrt(pow((xc+yc/xc*yc),2)-xc*xc-yc*yc+rc*rc); yd01 = yc/xc*xd01;
283 xd02 = xc+yc/xc*yc-sqrt(pow((xc+yc/xc*yc),2)-xc*xc-yc*yc+rc*rc); yd02 = yc/xc*xd02;
284 }
285
286 double r1 = sqrt(xd01*xd01+yd01*yd01);
287 double r2 = sqrt(xd02*xd02+yd02*yd02);
288
289 double phiV;
290
291 if (r1 < r2)
292 phiV = atan2(yd01,xd01);
293 else
294 phiV = atan2(yd02,xd02);
295
296 double phi1 = phiCorr(phiV+M_PI/2);
297 double phi2 = phiCorr(phiV-M_PI/2);
298
299 if (fabs(phiCorr(phi1-phi0))<=fabs(phiCorr(phi2-phi0)))
300 newphi = phi1;
301 else
302 newphi = phi2;
303
304 d0c = fabs(sqrt(xc*xc+yc*yc)-rc)*sin(phiV-newphi);
305
306 double theta=2*atan2(exp(-eta),1);
307 double theta_save=theta;
308 theta = theta - (1+spt)/2*M_PI;
309 if (theta>0) theta = theta_save;
310
311 double deltaz0= -spt*rc/tan(theta)*phiCorr(phiCorr(newphi)-phiCorr(phi0));
312 z0c = z0 + deltaz0;
313
314 }
315 }
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar theta() const
theta method
static Double_t rc
constexpr int pow(int base, int exp) noexcept
double m_beamX
Definition Converter.h:320
double phiCorr(double phi)
Definition Converter.h:248
double m_beamY
Definition Converter.h:320

◆ loadProperty()

template<class dType>
StatusCode IdDictDetDescrCnv::loadProperty ( const std::string & propertyName,
dType & pipeTo )
private

Loads the property from the DetDecrCnvSvc and pipes its value Returns failure if either the service, the property don't exist or the data type is wrong.

Definition at line 648 of file IdDictDetDescrCnv.cxx.

649 {
650
651 if (!m_detDescrProxy->hasProperty(propertyName)) {
652 ATH_MSG_FATAL("DetDescrSvc does not have the property "
653 << propertyName);
654 return StatusCode::FAILURE;
655 }
656 const Gaudi::Details::PropertyBase &prop =
657 m_detDescrProxy->getProperty(propertyName);
658 const Gaudi::Property<dType> *propPtr{
659 dynamic_cast<const Gaudi::Property<dType> *>(&prop)};
660 if (!propPtr) {
661 ATH_MSG_ERROR("Property " << propertyName << " is not of type"
662 << typeid(dType).name() << " but of "
663 << typeid(prop).name());
664 return StatusCode::FAILURE;
665 }
666 pipeTo = propPtr->value();
667 ATH_MSG_DEBUG("Flag " << propertyName << " is: " << pipeTo);
668 return StatusCode::SUCCESS;
669}
#define ATH_MSG_FATAL(x)

◆ loadPropertyWithParse()

template<class dType>
StatusCode IdDictDetDescrCnv::loadPropertyWithParse ( const std::string & propertyName,
dType & pipeTo )
private

Same as loadProperty but additionally m_doParsing is set to true if the input value does not match the set property value.

Definition at line 674 of file IdDictDetDescrCnv.cxx.

675 {
676 dType cache{};
677 ATH_CHECK(loadProperty(propertyName, cache));
678 m_doParsing |= cache != pipeTo;
679 pipeTo = std::move(cache);
680 return StatusCode::SUCCESS;
681}
bool m_doParsing
Flag to which determines whether the xml files are parsed or not.

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ parseXMLDescription()

StatusCode IdDictDetDescrCnv::parseXMLDescription ( )
private

Create and (re)initialize the IdDictManager - only create the first time.

Definition at line 108 of file IdDictDetDescrCnv.cxx.

108 {
109 ATH_MSG_DEBUG("in parseXMLDescription()");
110
111 // Parse the xml files to obtain the iddict dictionaries
112 //
113 // Parsing of the xml files may not be needed. So we check. The
114 // conditions to reparse are:
115 //
116 // - first pass, i.e. creating a new IdDictParser
117 // - a change in an input xml file
118 // - a change in one of the "options" such as doIdChecks,
119 // doInitNeighbors, etc.
120 //
121
122 m_doParsing = false; // Preset to no parsing
123
124 if (!m_parser) {
125 // Create parser
126 m_parser = std::make_unique<IdDictParser>();
127 m_doParsing = true;
128 }
129
130 // We access the properties on each pass
131
132 // Set flag for doing checks of ids
134
135 // Set flag for initializing neighbours
136 ATH_CHECK(loadPropertyWithParse("DoInitNeighbours", m_doNeighbours));
137
138 // Name of IdDict file
140 ATH_MSG_INFO("IdDictName: " << m_idDictName);
141
142 // Get the file names: two options - either from jobOpt
143 // properties of the DetDescrCnvSvc or from RDB tags
144
145 // Determine if Dict filename comes from DD database or
146 // if properties from JobOptions should be used.
147 ATH_CHECK(loadProperty("IdDictFromRDB", m_idDictFromRDB));
148
149 // Determine if the dictionary content comes from DD database or
150 // if properties from JobOptions should be used.
151 ATH_CHECK(loadProperty("useGeomDB_InDet", m_useGeomDB_InDet));
152
153 if (m_idDictFromRDB)
154 ATH_MSG_DEBUG("Dictonary file name from DD database");
155 else
157 "Dictonary file name from job options or using defaults.");
158
159 // Get the file name to parse:
160 //
161 // 1) From Relational DB
162 // 2) Via jobOptions
163 // 3) default name in the xml files
164 //
165 // Currently the logic is 1) or 2) and 3) covers the case where
166 // no file name is found.
167 //
168 if (m_idDictFromRDB) {
169 // Get file names from RDB
171 ATH_MSG_DEBUG("Looked for ID file name from RDB ");
172 } else {
173 // Get file names from properties
175 ATH_MSG_DEBUG("Looked for ID file name from properties ");
176 }
177
178 // Only parse if necessary
179 if (m_doParsing) {
180 // Register the requested files with the xml parser
182 ATH_MSG_DEBUG("Registered file names ");
183
184 // Check whether a tag is needed for dictionary initialization
185
186 // NOTE: the internal tag for IdDict is global, but is only
187 // used for InDet and thus is defined by InDet
188 std::string tag{};
189 if (m_inDetIDTag == "EMPTY")
190 ATH_CHECK(loadProperty("IdDictGlobalTag", tag));
191 else
193
194 // Parse the dictionaries
195 m_parser->parse(m_idDictName, tag);
196 if (tag.empty())
197 tag = "default";
198 ATH_MSG_DEBUG("Read dict: " << m_idDictName << " with tag " << tag);
199
200 // Set flag to check ids
201 IdDictMgr &mgr = m_parser->m_idd;
202
203 mgr.set_do_checks(m_doChecks);
204 ATH_MSG_DEBUG("Set IdDictManager doChecks flag to"
205 << (m_doChecks ? "true" : "false"));
206
207 // Set flag to initialize neighbours
208 mgr.set_do_neighbours(m_doNeighbours);
209 ATH_MSG_DEBUG("Set IdDictManager doNeighbours flag to "
210 << (m_doNeighbours ? "true" : "false"));
211
212 // Do some checks
213 size_t ndict = mgr.get_dictionaries().size();
214 if (ndict == 0) {
215 ATH_MSG_ERROR("No dictionaries found!");
216 return StatusCode::FAILURE;
217 }
218 ATH_MSG_DEBUG("Found " << ndict << " dictionaries.");
219
220 // Register the requested files and tags with the id dicts
222 ATH_MSG_DEBUG("Registered info with id dicts ");
223 } else {
225 "NOTE: ** parseXMLDescription called, but parsing was deemed "
226 "unnecessary ** ");
227 }
228 ATH_MSG_DEBUG("parseXMLDescription: Finished parsing and setting options ");
229 return StatusCode::SUCCESS;
230}
StatusCode getFileNamesFromTags()
Get file names from properties.
StatusCode registerInfoWithDicts()
Register the requested files and tag with the created id dicts.
bool m_idDictFromRDB
Flag to get dict parameters from Relational DetDescr DB.
StatusCode getFileNamesFromProperties()
Get file names from properties.
bool m_doNeighbours
Flag to generate neighbor information - for calos.
std::string m_idDictName
Name of top-level xml dict file.
StatusCode registerFilesWithParser()
Register the requested files with the xml parser.
StatusCode loadPropertyWithParse(const std::string &propertyName, dType &pipeTo)
Same as loadProperty but additionally m_doParsing is set to true if the input value does not match th...
bool m_doChecks
Flag to tell helpers to do Checks.

◆ phiCorr()

double Converter::phiCorr ( double phi)
inlineprotectedinherited

Definition at line 248 of file Converter.h.

248 {
249
250 if (phi < -TMath::Pi()) phi += 2*TMath::Pi();
251 if (phi > TMath::Pi()) phi -= 2*TMath::Pi();
252
253 return phi;
254 }
Scalar phi() const
phi method

◆ printDicts()

void IdDictDetDescrCnv::printDicts ( const IdDictManager * dictMgr)
private

Print out the contained dictionaries and version.

Definition at line 267 of file IdDictDetDescrCnv.cxx.

267 {
268
269 ATH_MSG_INFO("Found id dicts:");
270 if (!dictMgr)
271 return;
272
273 std::string tag = dictMgr->manager()->tag();
274 ATH_MSG_INFO("Using dictionary tag: " << (tag.empty() ? "<no tag>" : tag));
275
276 for (const IdDictDictionary* dictionary : dictMgr->manager()->get_dictionaries()) {
277 std::string version =
278 ("" != dictionary->version()) ? dictionary->version() : "default";
279 msg(MSG::INFO) << "Dictionary " << dictionary->name();
280 if (dictionary->name().size() < 20) {
281 std::string space(20 - dictionary->name().size(), ' ');
282 msg(MSG::INFO) << space;
283 }
284 msg(MSG::INFO) << " version " << version;
285 if (version.size() < 20) {
286 std::string space(20 - version.size(), ' ');
287 msg(MSG::INFO) << space;
288 }
289 if (dictionary->dict_tag().size()) {
290 msg(MSG::INFO) << " DetDescr tag " << dictionary->dict_tag();
291 if (dictionary->dict_tag().size() < 20) {
292 std::string space(25 - dictionary->dict_tag().size(), ' ');
293 msg(MSG::INFO) << space;
294 }
295 } else {
296 msg(MSG::INFO) << " DetDescr tag (using default)";
297 }
298 ATH_MSG_INFO(" file " << dictionary->file_name());
299 }
300}
const IdDictMgr * manager(void) const
const std::string & tag() const
Version tag.
Definition IdDictMgr.cxx:54
dictionary_vec get_dictionaries() const
Access to all dictionaries.
dictionary
Definition master.py:47

◆ registerFilesWithParser()

StatusCode IdDictDetDescrCnv::registerFilesWithParser ( )
private

Register the requested files with the xml parser.

Definition at line 545 of file IdDictDetDescrCnv.cxx.

545 {
546 // If InDetIdDict.xml exists set InDetFileName set to it's name
547 if (m_useGeomDB_InDet) {
548 std::ifstream ifile;
549 ifile.open("InDetIdDict.xml");
550 if (ifile)
551 m_inDetIDFileName = "InDetIdDict.xml";
552 else
553 ATH_MSG_WARNING(" no temp. file InDetIdDict.xml found - using file "
555 }
556
557 if (!m_atlasIDFileName.empty()) {
558 m_parser->register_external_entity("ATLAS", m_atlasIDFileName);
559 ATH_MSG_INFO("Reading ATLAS IdDict file "
561 }
562 if (!m_inDetIDFileName.empty()) {
563 m_parser->register_external_entity("InnerDetector", m_inDetIDFileName);
564 ATH_MSG_INFO("Reading InnerDetector IdDict file "
566 }
567 if (!m_larIDFileName.empty()) {
568 m_parser->register_external_entity("LArCalorimeter", m_larIDFileName);
569 ATH_MSG_INFO("Reading LArCalorimeter IdDict file "
570 << m_larIDFileName);
571 }
572 if (!m_tileIDFileName.empty()) {
573 m_parser->register_external_entity("TileCalorimeter", m_tileIDFileName);
574 ATH_MSG_INFO("Reading TileCalorimeter IdDict file "
576 }
577 if (!m_caloIDFileName.empty()) {
578 m_parser->register_external_entity("Calorimeter", m_caloIDFileName);
579 ATH_MSG_INFO("Reading Calorimeter IdDict file "
581 }
582 if (!m_muonIDFileName.empty()) {
583 m_parser->register_external_entity("MuonSpectrometer",
585 ATH_MSG_INFO("Reading MuonSpectrometer IdDict file "
587 }
588 if (!m_forwardIDFileName.empty()) {
589 m_parser->register_external_entity("ForwardDetectors",
591 ATH_MSG_INFO("Reading ForwardDetectors IdDict file "
593 }
594 return StatusCode::SUCCESS;
595}

◆ registerInfoWithDicts()

StatusCode IdDictDetDescrCnv::registerInfoWithDicts ( )
private

Register the requested files and tag with the created id dicts.

Definition at line 598 of file IdDictDetDescrCnv.cxx.

598 {
599 // Save the file name and tag in each of the dictionaries
600 IdDictMgr &mgr = m_parser->m_idd;
601
602 auto setDictPaths = [this, &mgr](const std::string &dict_name,
603 const std::string &file_name,
604 const std::string &dict_tag) {
605 if (file_name.empty()) {
606 ATH_MSG_DEBUG("No idDict will be loaded for " << dict_name);
607 return StatusCode::SUCCESS;
608 }
609 IdDictDictionary *dict = mgr.find_dictionary(dict_name);
610 if (!dict) {
611 ATH_MSG_ERROR("unable to find idDict for " << dict_name);
612 return StatusCode::FAILURE;
613 }
614 dict->set_file_name(file_name);
615 dict->set_dict_tag(dict_tag);
616 ATH_MSG_DEBUG("For " << dict_name << " idDict, setting file/tag: "
617 << file_name << " " << dict_tag);
618 return StatusCode::SUCCESS;
619 };
620 ATH_CHECK(setDictPaths("ATLAS", m_atlasIDFileName, m_atlasIdDictTag));
621 ATH_CHECK(setDictPaths("InnerDetector", m_inDetIDFileName, m_inDetIdDictTag));
622 ATH_CHECK(setDictPaths("LArCalorimeter", m_larIDFileName, m_larIdDictTag));
623 ATH_CHECK(setDictPaths("TileCalorimeter", m_tileIDFileName, m_tileIdDictTag));
624 ATH_CHECK(setDictPaths("Calorimeter", m_caloIDFileName, m_caloIdDictTag));
625 ATH_CHECK(setDictPaths("MuonSpectrometer", m_muonIDFileName, m_muonIdDictTag));
626 ATH_CHECK(setDictPaths("ForwardDetectors", m_forwardIDFileName, m_forwardIdDictTag));
627
628 auto addMetaData = [&mgr, this](const std::string &key,
629 const std::string &value) {
630 if (value.empty()) {
631 ATH_MSG_DEBUG("No value given for key " << key);
632 } else {
633 mgr.add_metadata(key, value);
634 ATH_MSG_DEBUG("Added to dict mgr meta data: <" << key << ","
635 << value << ">");
636 }
637 };
638 addMetaData("FULLATLASNEIGHBORS", m_fullAtlasNeighborsName);
639 addMetaData("FCAL2DNEIGHBORS", m_fcal2dNeighborsName);
640 addMetaData("FCAL3DNEIGHBORSNEXT", m_fcal3dNeighborsNextName);
641 addMetaData("FCAL3DNEIGHBORSPREV", m_fcal3dNeighborsPrevName);
642 addMetaData("TILENEIGHBORS", m_tileNeighborsName);
643
644 return StatusCode::SUCCESS;
645}
std::string m_atlasIdDictTag
Tag of RDB record for Atlas top-level ids.
void set_file_name(const std::string &name)
Set file name.
void set_dict_tag(const std::string &tag)
Set the dictionary tag.

◆ repSvcType()

long int IdDictDetDescrCnv::repSvcType ( ) const
overridevirtual

Definition at line 28 of file IdDictDetDescrCnv.cxx.

28 {
29 return (storageType());
30}
static long int storageType()
Storage type and class ID (used by CnvFactory)

◆ selectTracks() [1/3]

void Converter::selectTracks ( const Analysis::MuonContainer * muontracks)
inlineinherited

Definition at line 177 of file Converter.h.

177 {
178
179 static int hpmap[20] = { 0, 1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
180
181 Analysis::MuonContainer::const_iterator muonitr = muontracks->begin();
182 Analysis::MuonContainer::const_iterator muonend = muontracks->end();
183
184 while(muonitr!=muonend) {
185
186 bool hasInDet = (*muonitr)->hasInDetTrackParticle();
187 const Rec::TrackParticle *trackitr=NULL;
188 if(hasInDet) trackitr=(*muonitr)->inDetTrackParticle();
189 muonitr++;
190 if(!hasInDet) continue;
191
192 const Trk::MeasuredPerigee* measPer = trackitr->measuredPerigee();
193
194 CLHEP::HepVector perigeeParams = measPer->parameters();
195 double pT = measPer->pT();
196 double eta = measPer->eta();
197 double phi = perigeeParams[Trk::phi0];
198 double z0 = perigeeParams[Trk::z0];
199 double d0 = perigeeParams[Trk::d0];
200 //double theta = perigeeParams[Trk::theta];
201
202 double deta = 1;
203 double dphi = 1;
204 double dz0 = 1;
205 double dd0 = 1;
206 double dpT = 1;
207
208 // Check number of hits
209 // NB: a spacepoint is two offline "hits", so a pixel spacepoint is really
210 // 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersetcting
211 // stereo clusters making a spacepoint are two "hits"
212 const Trk::TrackSummary *summary = trackitr->trackSummary();
213 int nBlayerHits = 2*summary->get(Trk::numberOfBLayerHits);
215 int nSctHits = summary->get(Trk::numberOfSCTHits);
216 int nStrawHits = summary->get(Trk::numberOfTRTHits);
217 int nTrHits = summary->get(Trk::numberOfTRTHighThresholdHits);
218
219 int nSiHits = nPixelHits + nSctHits;
220
221 const Trk::FitQuality *quality = trackitr->fitQuality();
222 double chi2 = quality->chiSquared();
223 double dof = quality->quality->numberDoF();
224
225 unsigned bitmap = 0;
226
227 for ( int ih=0 ; ih<20 ; ih++ ) {
228 if ( summary->isHit(Trk::DetectorType(ih)) ) bitmap |= ( 1<<hpmap[ih] );
229 }
230
231 // Shift d0 and z0 according to beam position
232 ipCorr(d0, z0, d0, z0, phi, eta, pT);
233
234 // Create and save Track
235 TIDA::Track* t = new TIDA::Track(eta, phi, z0, d0, pT, chi2, dof,
236 deta, dphi, dz0, dd0, dpT,
237 nBlayerHits, nPixelHits, nSctHits, nSiHits,
238 nStrawHits, nTrHits, bitmap, 0,
239 -1) ;
240
241 addTrack(t);
242 }
243
244 }
void addTrack(TIDA::Track *t)
Definition Converter.h:45
void ipCorr(double d0, double z0, double &d0c, double &z0c, double phi0, double eta, double pt)
Definition Converter.h:257
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const Trk::Perigee * measuredPerigee() const
Accessor method for Perigee.
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition FitQuality.h:60
double chiSquared() const
returns the of the overall track fit
Definition FitQuality.h:56
double eta() const
Access method for pseudorapidity - from momentum.
double pT() const
Access method for transverse momentum.
const FitQuality * fitQuality() const
accessor function for FitQuality.
const TrackSummary * trackSummary() const
accessor function for TrackSummary.
double chi2(TH1 *h0, TH1 *h1)
float nSiHits(const U &p)
float nPixelHits(const U &p)
@ phi0
Definition ParamDefs.h:65
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64
DetectorType
enumerates the various detector types currently accessible from the isHit() method.
@ numberOfPixelHits
number of pixel layers on track with absence of hits
@ numberOfBLayerHits
these are the hits in the 0th pixel layer?
@ numberOfTRTHighThresholdHits
total number of TRT hits which pass the high threshold
Perigee MeasuredPerigee

◆ selectTracks() [2/3]

void Converter::selectTracks ( const Rec::TrackParticleContainer * trigtracks)
inlineinherited

Definition at line 111 of file Converter.h.

111 {
112
113 Rec::TrackParticleContainer::const_iterator trackitr = trigtracks->begin();
114 Rec::TrackParticleContainer::const_iterator trackend = trigtracks->end();
115
116 static int hpmap[20] = { 0, 1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
117
118 while ( trackitr!=trackend ) {
119
120 const Trk::MeasuredPerigee* measPer = (*trackitr)->measuredPerigee();
121
122 CLHEP::HepVector perigeeParams = measPer->parameters();
123 double pT = measPer->pT();
124 double eta = measPer->eta();
125 double phi = perigeeParams[Trk::phi0];
126 double z0 = perigeeParams[Trk::z0];
127 double d0 = perigeeParams[Trk::d0];
128 //double theta = perigeeParams[Trk::theta];
129
130 double deta = 1;
131 double dphi = 1;
132 double dz0 = 1;
133 double dd0 = 1;
134 double dpT = 1;
135
136 // Check number of hits
137 // NB: a spacepoint is two offline "hits", so a pixel spacepoint is really
138 // 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersetcting
139 // stereo clusters making a spacepoint are two "hits"
140 const Trk::TrackSummary *summary = (*trackitr)->trackSummary();
141 int nBlayerHits = 2*summary->get(Trk::numberOfBLayerHits);
143 int nSctHits = summary->get(Trk::numberOfSCTHits);
144 int nStrawHits = summary->get(Trk::numberOfTRTHits);
145 int nTrHits = summary->get(Trk::numberOfTRTHighThresholdHits);
146 int nSiHits = nPixelHits + nSctHits;
147 bool expectBL = false; // Not stored for Rec::TrackParticle
148
149 const Trk::FitQuality *quality = (*trackitr)->fitQuality();
150 double chi2 = quality->chiSquared();
151 double dof = quality->numberDoF();
152
153 unsigned bitmap = 0;
154
155 for ( int ih=0 ; ih<20 ; ih++ ) {
156 if ( summary->isHit(Trk::DetectorType(ih)) ) bitmap |= ( 1<<hpmap[ih] );
157 }
158
159 // Shift d0 and z0 according to beam position
160 ipCorr(d0, z0, d0, z0, phi, eta, pT);
161
162 // Create and save Track
163 TIDA::Track* t = new TIDA::Track(eta, phi, z0, d0, pT, chi2, dof,
164 deta, dphi, dz0, dd0, dpT,
165 nBlayerHits, nPixelHits, nSctHits, nSiHits,
166 nStrawHits, nTrHits, bitmap, 0,
167 -1,
168 expectBL) ;
169
170 addTrack(t);
171 trackitr++;
172 }
173
174 }

◆ selectTracks() [3/3]

void Converter::selectTracks ( const TrigInDetTrackCollection * trigtracks)
inlineinherited

Definition at line 56 of file Converter.h.

56 {
57
58 TrigInDetTrackCollection::const_iterator trackitr = trigtracks->begin();
59 TrigInDetTrackCollection::const_iterator trackend = trigtracks->end();
60
61 while ( trackitr!=trackend ) {
62
63 double eta = (*trackitr)->param()->eta();
64 double phi = (*trackitr)->param()->phi0();
65 double z0 = (*trackitr)->param()->z0();
66 double pT = (*trackitr)->param()->pT();
67 double d0 = (*trackitr)->param()->a0();
68 //double theta = 2*atan2(exp(-(*trackitr)->param()->eta()),1);
69
70 double deta = (*trackitr)->param()->eeta();
71 double dphi = (*trackitr)->param()->ephi0();
72 double dz0 = (*trackitr)->param()->ez0();
73 double dpT = (*trackitr)->param()->epT();
74 double dd0 = (*trackitr)->param()->ea0();
75
76 int algoid = (*trackitr)->algorithmId();
77
78 int nBlayerHits = ((*trackitr)->HitPattern() & 0x1);
79 int nPixelHits = 2*(*trackitr)->NPixelSpacePoints(); // NB: for comparison with offline
80 int nSctHits = 2*(*trackitr)->NSCT_SpacePoints(); // a spacepoint is 2 "hits"
81 int nStrawHits = (*trackitr)->NStrawHits();
82 int nTrHits = (*trackitr)->NTRHits();
83
84 int nSiHits = nPixelHits + nSctHits;
85 bool expectBL = false; //not available with TrigInDetTrack
86
87 unsigned hitPattern = (*trackitr)->HitPattern();
88 unsigned multiPattern = 0;
89
90 double chi2 = (*trackitr)->chi2();
91 double dof = 0;
92
93 // Shift d0 and z0 according to beam position
94 ipCorr(d0, z0, d0, z0, phi, eta, pT);
95
96 // Create and save Track
97 TIDA::Track* t = new TIDA::Track(eta, phi, z0, d0, pT, chi2, dof,
98 deta, dphi, dz0, dd0, dpT,
99 nBlayerHits, nPixelHits, nSctHits, nSiHits,
100 nStrawHits, nTrHits, hitPattern, multiPattern,
101 algoid,
102 expectBL ) ;
103
104 addTrack(t);
105 trackitr++;
106 }
107 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ storageType()

long int IdDictDetDescrCnv::storageType ( )
static

Storage type and class ID (used by CnvFactory)

Definition at line 253 of file IdDictDetDescrCnv.cxx.

253 {
255}
const long DetDescr_StorageType

◆ tracks()

const std::vector< TIDA::Track * > & Converter::tracks ( ) const
inlineinherited

Definition at line 50 of file Converter.h.

50{return m_tracks;}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_atlasIdDictTag

std::string IdDictDetDescrCnv::m_atlasIdDictTag {}
private

Tag of RDB record for Atlas top-level ids.

Definition at line 146 of file IdDictDetDescrCnv.h.

146{};

◆ m_atlasIDFileName

std::string IdDictDetDescrCnv::m_atlasIDFileName {}
private

File to be read for top-level subsystem ids values.

Definition at line 118 of file IdDictDetDescrCnv.h.

118{};

◆ m_beamX

double Converter::m_beamX
protectedinherited

Definition at line 320 of file Converter.h.

◆ m_beamY

double Converter::m_beamY
protectedinherited

Definition at line 320 of file Converter.h.

◆ m_beamZ

double Converter::m_beamZ
protectedinherited

Definition at line 320 of file Converter.h.

◆ m_caloIdDictTag

std::string IdDictDetDescrCnv::m_caloIdDictTag {}
private

Tag of RDB record for Calo ids.

Definition at line 158 of file IdDictDetDescrCnv.h.

158{};

◆ m_caloIDFileName

std::string IdDictDetDescrCnv::m_caloIDFileName {}
private

File to be read for Calo ids.

Definition at line 130 of file IdDictDetDescrCnv.h.

130{};

◆ m_detDescrProxy

SmartIF<IProperty> IdDictDetDescrCnv::m_detDescrProxy
private

Propxy to the DetDescrCnvSvc.

Definition at line 62 of file IdDictDetDescrCnv.h.

◆ m_detStore

ServiceHandle<StoreGateSvc> DetDescrConverter::m_detStore
privateinherited

Definition at line 42 of file DetDescrConverter.h.

◆ m_doChecks

bool IdDictDetDescrCnv::m_doChecks {false}
private

Flag to tell helpers to do Checks.

Definition at line 102 of file IdDictDetDescrCnv.h.

102{false};

◆ m_doNeighbours

bool IdDictDetDescrCnv::m_doNeighbours {true}
private

Flag to generate neighbor information - for calos.

Definition at line 105 of file IdDictDetDescrCnv.h.

105{true};

◆ m_doParsing

bool IdDictDetDescrCnv::m_doParsing {true}
private

Flag to which determines whether the xml files are parsed or not.

Definition at line 115 of file IdDictDetDescrCnv.h.

115{true};

◆ m_fcal2dNeighborsName

std::string IdDictDetDescrCnv::m_fcal2dNeighborsName {}
private

Definition at line 134 of file IdDictDetDescrCnv.h.

134{};

◆ m_fcal3dNeighborsNextName

std::string IdDictDetDescrCnv::m_fcal3dNeighborsNextName {}
private

Definition at line 135 of file IdDictDetDescrCnv.h.

135{};

◆ m_fcal3dNeighborsPrevName

std::string IdDictDetDescrCnv::m_fcal3dNeighborsPrevName {}
private

Definition at line 136 of file IdDictDetDescrCnv.h.

136{};

◆ m_forwardIdDictTag

std::string IdDictDetDescrCnv::m_forwardIdDictTag {}
private

Tag of RDB record for forwards det ids.

Definition at line 164 of file IdDictDetDescrCnv.h.

164{};

◆ m_forwardIDFileName

std::string IdDictDetDescrCnv::m_forwardIDFileName {}
private

File to be read for Forward det ids.

Definition at line 143 of file IdDictDetDescrCnv.h.

143{};

◆ m_fullAtlasNeighborsName

std::string IdDictDetDescrCnv::m_fullAtlasNeighborsName {}
private

Files for Calo Neighbors.

Definition at line 133 of file IdDictDetDescrCnv.h.

133{};

◆ m_geoDbTagSvc

ServiceHandle<IGeoDbTagSvc> IdDictDetDescrCnv::m_geoDbTagSvc {"GeoDbTagSvc/GeoDbTagSvc", "IdDictDetDescrCnv"}
private

Definition at line 58 of file IdDictDetDescrCnv.h.

58{"GeoDbTagSvc/GeoDbTagSvc", "IdDictDetDescrCnv"};

◆ m_idDictFromRDB

bool IdDictDetDescrCnv::m_idDictFromRDB {false}
private

Flag to get dict parameters from Relational DetDescr DB.

Definition at line 111 of file IdDictDetDescrCnv.h.

111{false};

◆ m_idDictName

std::string IdDictDetDescrCnv::m_idDictName {}
private

Name of top-level xml dict file.

Definition at line 108 of file IdDictDetDescrCnv.h.

108{};

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_inDetIdDictTag

std::string IdDictDetDescrCnv::m_inDetIdDictTag {}
private

Tag of RDB record for InDet ids.

Definition at line 149 of file IdDictDetDescrCnv.h.

149{};

◆ m_inDetIDFileName

std::string IdDictDetDescrCnv::m_inDetIDFileName {}
private

File to be read for InDet ids.

Definition at line 121 of file IdDictDetDescrCnv.h.

121{};

◆ m_inDetIDTag

std::string IdDictDetDescrCnv::m_inDetIDTag {}
private

Internal InDet id tag.

Definition at line 167 of file IdDictDetDescrCnv.h.

167{};

◆ m_larIdDictTag

std::string IdDictDetDescrCnv::m_larIdDictTag {}
private

Tag of RDB record for LAr ids.

Definition at line 152 of file IdDictDetDescrCnv.h.

152{};

◆ m_larIDFileName

std::string IdDictDetDescrCnv::m_larIDFileName {}
private

File to be read for LAr ids.

Definition at line 124 of file IdDictDetDescrCnv.h.

124{};

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_muonIdDictTag

std::string IdDictDetDescrCnv::m_muonIdDictTag {}
private

Tag of RDB record for Muon ids.

Definition at line 161 of file IdDictDetDescrCnv.h.

161{};

◆ m_muonIDFileName

std::string IdDictDetDescrCnv::m_muonIDFileName {}
private

File to be read for Muon ids.

Definition at line 140 of file IdDictDetDescrCnv.h.

140{};

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_parser

std::unique_ptr<IdDictParser> IdDictDetDescrCnv::m_parser {}
private

The xml parser for the dictionary descriptions.

Definition at line 99 of file IdDictDetDescrCnv.h.

99{};

◆ m_rdbAccessSvc

ServiceHandle<IRDBAccessSvc> IdDictDetDescrCnv::m_rdbAccessSvc {"RDBAccessSvc/RDBAccessSvc", "IdDictDetDescrCnv"}
private

Definition at line 59 of file IdDictDetDescrCnv.h.

59{"RDBAccessSvc/RDBAccessSvc", "IdDictDetDescrCnv"};

◆ m_tileIdDictTag

std::string IdDictDetDescrCnv::m_tileIdDictTag {}
private

Tag of RDB record for Tile ids.

Definition at line 155 of file IdDictDetDescrCnv.h.

155{};

◆ m_tileIDFileName

std::string IdDictDetDescrCnv::m_tileIDFileName {}
private

File to be read for Tile ids.

Definition at line 127 of file IdDictDetDescrCnv.h.

127{};

◆ m_tileNeighborsName

std::string IdDictDetDescrCnv::m_tileNeighborsName {}
private

Definition at line 137 of file IdDictDetDescrCnv.h.

137{};

◆ m_tracks

std::vector<TIDA::Track*> Converter::m_tracks
protectedinherited

Definition at line 321 of file Converter.h.

◆ m_useGeomDB_InDet

bool IdDictDetDescrCnv::m_useGeomDB_InDet {false}
private

Definition at line 170 of file IdDictDetDescrCnv.h.

170{false};

The documentation for this class was generated from the following files: