ATLAS Offline Software
Functions
TrigSORFromPtreeHelper.cxx File Reference
#include "TrigSORFromPtreeHelper.h"
#include "AthenaKernel/IIOVDbSvc.h"
#include "AthenaKernel/IAddressProvider.h"
#include "AthenaBaseComps/AthCheckMacros.h"
#include "CxxUtils/checker_macros.h"
#include <ctime>
#include <eformat/DetectorMask.h>
Include dependency graph for TrigSORFromPtreeHelper.cxx:

Go to the source code of this file.

Functions

StatusCode TrigSORFromPtreeHelper::createSOR ATLAS_NOT_THREAD_SAFE () const
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

StatusCode TrigSORFromPtreeHelper::createSOR ATLAS_NOT_THREAD_SAFE ( ) const

Definition at line 91 of file TrigSORFromPtreeHelper.cxx.

92 {
93  // obtain SOR contents from ptree
94  auto attrList = getAttrList();
95 
96  // Validity
97  IOVTime iovTimeStart(attrList["RunNumber"].data<unsigned int>(),0);
98  IOVTime iovTimeStop(attrList["RunNumber"].data<unsigned int>()+1,0);
99  IOVRange iovRange(iovTimeStart, iovTimeStop);
100 
101  auto sor = new SOR(/*hasRunLumiBlockTime*/true);
102  sor->add(SOR::ChanNum{0}, attrList);
103  sor->add(SOR::ChanNum{0}, iovRange);
104  sor->resetMinRange();
105  sor->addNewStart(iovTimeStart);
106  sor->addNewStop(iovTimeStop);
107 
108  // Record or overwrite existing SOR
109  if ( m_detStore->transientContains<SOR>(m_sorpath) ) {
110  const SOR * oldsor = m_detStore->retrieve<const SOR>(m_sorpath);
111  ATH_MSG_INFO("Overwriting SOR contents (a dump of the old one follows):");
112  oldsor->dump();
113  ATH_CHECK( m_detStore->overwrite(sor, m_sorpath, true) );
114  }
115  else {
116  ATH_MSG_DEBUG("Recording new SOR");
117  ATH_CHECK( m_detStore->record(sor, m_sorpath, true) );
118  }
119 
120  ATH_CHECK( setIOVRange(iovRange) );
121  ATH_CHECK( updateProxy(sor) );
122 
123  ATH_MSG_INFO("Successfully setup SOR:");
124  sor->dump();
125 
126  return StatusCode::SUCCESS;
127 }
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40