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

read calibration constants from text file and publish them in ConditionsStore More...

#include <TRTCondWrite.h>

Inheritance diagram for TRTCondWrite:
Collaboration diagram for TRTCondWrite:

Public Types

typedef TRTCond::RtRelationMultChanContainer RtRelationContainer
typedef TRTCond::StrawT0MultChanContainer StrawT0Container

Public Member Functions

 TRTCondWrite (const std::string &name, ISvcLocator *pSvcLocator)
 constructor
virtual ~TRTCondWrite () override=default
 destructor
virtual StatusCode initialize (void) override
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode finalize (void) override
virtual TRTCond::ExpandedIdentifier trtcondid (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const
 create an TRTCond::ExpandedIdentifier from a TRTID identifier
virtual StatusCode checkTextFile (const std::string &file, int &format)
 read calibration from text file into TDS
virtual StatusCode readTextFile (const EventContext &ctx, const std::string &file, int &format) const
virtual StatusCode readTextFile_Format1 (const EventContext &, std::istream &) const
virtual EventIDRange IOVInfRange () const
virtual bool isReEntrant () const override
 Avoid scheduling algorithm multiple times.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const TRT_IDm_trtid {}
 trt id helper
ServiceHandle< ICondSvc > m_condSvc {this, "CondSvc", "CondSvc"}
Gaudi::Property< std::string > m_par_caltextfile {this, "CalibInputFile", "dummy_TRTCondWrite.txt", ""}
SG::WriteCondHandleKey< RtRelationContainerm_rtWriteKey {this, "RtWriteKeyName", "/TRT/Calib/RT", "r-t relation out-key"}
SG::WriteCondHandleKey< StrawT0Containerm_t0WriteKey {this, "T0WriteKeyName", "/TRT/Calib/T0", "t0 out-key"}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

read calibration constants from text file and publish them in ConditionsStore

Definition at line 32 of file TRTCondWrite.h.

Member Typedef Documentation

◆ RtRelationContainer

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ StrawT0Container

Constructor & Destructor Documentation

◆ TRTCondWrite()

TRTCondWrite::TRTCondWrite ( const std::string & name,
ISvcLocator * pSvcLocator )

constructor

Definition at line 22 of file TRTCondWrite.cxx.

23 : AthCondAlgorithm(name, pSvcLocator) {}

◆ ~TRTCondWrite()

virtual TRTCondWrite::~TRTCondWrite ( )
overridevirtualdefault

destructor

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ checkTextFile()

StatusCode TRTCondWrite::checkTextFile ( const std::string & file,
int & format )
virtual

read calibration from text file into TDS

Definition at line 106 of file TRTCondWrite.cxx.

107{
108
109 StatusCode sc = StatusCode::SUCCESS;
110 std::ifstream infile(filename.c_str());
111 if (!infile)
112 {
113 sc = StatusCode::FAILURE;
114 }
115 else
116 {
117 // read the format tag. if none, default to 0
118 format = 0;
119 char line[512];
120 infile.getline(line, 512);
121 std::string linestring(line);
122 size_t pos = linestring.find("Fileformat");
123 if (pos != std::string::npos)
124 {
125 sscanf(line, "# Fileformat=%d", &format);
126 }
127 else
128 {
129 ATH_MSG_WARNING("Input file has no Fileformat identifier. Assuming format=0.");
130 // 'rewind' the file
131
132 infile.close();
133 infile.open(filename.c_str());
134 }
135 }
136 infile.close();
137 return sc;
138}
#define ATH_MSG_WARNING(x)
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TRTCondWrite::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 67 of file TRTCondWrite.cxx.

68{
69
70 // Read from text file?
71 if (!m_par_caltextfile.empty())
72 {
73 std::ifstream infile(m_par_caltextfile.value().c_str());
74 if (infile)
75 {
76 ATH_MSG_INFO(" Read calibration constants from text file " << m_par_caltextfile);
77 int format = 0;
78 if (StatusCode::SUCCESS != readTextFile(ctx, m_par_caltextfile, format))
79 {
80 ATH_MSG_FATAL("Could not read calibration objects from text file " << m_par_caltextfile);
81 return StatusCode::FAILURE;
82 }
83 }
84 else
85 {
86 ATH_MSG_ERROR("Input file does not exist " << m_par_caltextfile.value().c_str());
87 return StatusCode::FAILURE;
88 }
89 infile.close();
90 }
91 else
92 {
93 ATH_MSG_ERROR("No input filename supplied ");
94 return StatusCode::FAILURE;
95 }
96
97 return StatusCode::SUCCESS;
98 ;
99}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
Gaudi::Property< std::string > m_par_caltextfile
virtual StatusCode readTextFile(const EventContext &ctx, const std::string &file, int &format) const

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode TRTCondWrite::finalize ( void )
overridevirtual

Definition at line 101 of file TRTCondWrite.cxx.

102{
103 return StatusCode::SUCCESS;
104}

◆ initialize()

StatusCode TRTCondWrite::initialize ( void )
overridevirtual

Definition at line 25 of file TRTCondWrite.cxx.

26{
27
28 ATH_MSG_DEBUG("TRTCondWrite::initialize() called");
29
30 // Get ID helper
31 ATH_CHECK(detStore()->retrieve(m_trtid, "TRT_ID"));
32
33 // Get condSvc
34 ATH_CHECK(m_condSvc.retrieve());
35
36 // Format of input text file
37 int format = 0;
38 if (m_par_caltextfile != "")
39 {
40 ATH_MSG_INFO(" input text file supplied " << m_par_caltextfile);
41 if (StatusCode::SUCCESS != checkTextFile(m_par_caltextfile, format))
42 {
43 ATH_MSG_INFO("Could not find or could not read text file" << m_par_caltextfile);
44 return StatusCode::SUCCESS;
45 }
46 ATH_MSG_INFO(" Found format " << format << " in text file " << m_par_caltextfile);
47 }
48 else
49 {
50 ATH_MSG_ERROR(" No input text file supplied. Initialization done. ");
51 return StatusCode::FAILURE;
52 }
53
54 // Write keys
55 // If an input text file is specified, initialize write keys. The corresponding folders must be blocked.
56
57 if (m_par_caltextfile != "" && format > 0)
58 {
59 ATH_CHECK(m_rtWriteKey.initialize());
60 ATH_CHECK(m_t0WriteKey.initialize());
61 }
62 ATH_MSG_INFO(" Initilization done with WriteKey Registraton ");
63
64 return StatusCode::SUCCESS;
65}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
const ServiceHandle< StoreGateSvc > & detStore() const
virtual StatusCode checkTextFile(const std::string &file, int &format)
read calibration from text file into TDS
SG::WriteCondHandleKey< StrawT0Container > m_t0WriteKey
const TRT_ID * m_trtid
trt id helper
ServiceHandle< ICondSvc > m_condSvc
SG::WriteCondHandleKey< RtRelationContainer > m_rtWriteKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ IOVInfRange()

EventIDRange TRTCondWrite::IOVInfRange ( ) const
virtual

Definition at line 309 of file TRTCondWrite.cxx.

310{
311 const EventIDBase start{1, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM, 0};
312 const EventIDBase stop{EventIDBase::UNDEFNUM - 1, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM - 1};
313 return EventIDRange{start, stop};
314}

◆ isClonable()

◆ isReEntrant()

virtual bool AthCondAlgorithm::isReEntrant ( ) const
inlineoverridevirtualinherited

Avoid scheduling algorithm multiple times.

With multiple concurrent events, conditions objects often expire simultaneously for all slots. To avoid that the scheduler runs the CondAlg in each slot, we declare it as "non-reentrant". This ensures that the conditions objects are only created once.

In case a particular CondAlg should behave differently, it can override this method again and return true.

See also
ATEAM-836

Definition at line 39 of file AthCondAlgorithm.h.

39{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ readTextFile()

StatusCode TRTCondWrite::readTextFile ( const EventContext & ctx,
const std::string & file,
int & format ) const
virtual

Definition at line 140 of file TRTCondWrite.cxx.

141{
142
143 StatusCode sc = StatusCode::SUCCESS;
144 std::ifstream infile(filename.c_str());
145 if (!infile)
146 {
147 ATH_MSG_ERROR("Cannot find input file " << filename);
148 sc = StatusCode::FAILURE;
149 }
150 else
151 {
152 // read the format tag. if none, default to 0
153 format = 0;
154 char line[512];
155 infile.getline(line, 512);
156 std::string linestring(line);
157 size_t pos = linestring.find("Fileformat");
158 if (pos != std::string::npos)
159 {
160 sscanf(line, "# Fileformat=%d", &format);
161 }
162 else
163 {
164 ATH_MSG_WARNING("Input file has no Fileformat identifier. Assuming format=1");
165 // 'rewind' the file
166
167 infile.close();
168 infile.open(filename.c_str());
169 }
170 ATH_MSG_INFO("Reading calibration data from text file " << filename << " format " << format);
171 // force format 1 here
172 sc = readTextFile_Format1(ctx, infile);
173 }
174 infile.close();
175 return sc;
176}
virtual StatusCode readTextFile_Format1(const EventContext &, std::istream &) const

◆ readTextFile_Format1()

StatusCode TRTCondWrite::readTextFile_Format1 ( const EventContext & ctx,
std::istream & infile ) const
virtual

Definition at line 178 of file TRTCondWrite.cxx.

179{
180
181 enum ReadMode
182 {
183 ReadingRtRelation,
184 ReadingStrawT0,
185 ReadingGarbage
186 };
187 ReadMode readmode = ReadingGarbage;
188
189 // Make containers for access via ReadCondHandle for the reconstruction.
190 std::unique_ptr<RtRelationContainer> rtCdo{std::make_unique<RtRelationContainer>()};
191 std::unique_ptr<StrawT0Container> t0Cdo{std::make_unique<StrawT0Container>()};
192
193 char line[512];
194 int nrtrelations(0), nstrawt0(0);
195 while (infile.getline(line, 512))
196 {
197 if (line[0] == '#')
198 {
199 // line with tag
200 std::string linestring(line);
201 if (linestring.find("RtRelation") != std::string::npos)
202 {
203 readmode = ReadingRtRelation;
204 ATH_MSG_INFO(" Found line with Rt tag ");
205 }
206 else if (linestring.find("StrawT0") != std::string::npos)
207 {
208 readmode = ReadingStrawT0;
209 ATH_MSG_INFO(" Found line with T0 tag ");
210 }
211 else
212 readmode = ReadingGarbage;
213 }
214 else if (readmode != ReadingGarbage)
215 {
216 std::istringstream is(line);
217 // read the id
218 TRTCond::ExpandedIdentifier id;
219 is >> id;
220 // read the semicolon that end the id
221 char dummy;
222 is >> dummy;
223
224 // read the object
225 if (readmode == ReadingRtRelation)
226 {
227
228 TRTCond::RtRelation *rt = TRTCond::RtRelationFactory::readFromFile(is);
229 //Values read in should have their values checked against sensible limits.
230 //We assume the input is trusted however.
231 //coverity[TAINTED_SCALAR]
232 rtCdo->set(id, rt);
233 delete rt;
234 ++nrtrelations;
235 }
236 else if (readmode == ReadingStrawT0)
237 {
238
239 float t0(0), t0err(0);
240 is >> t0 >> t0err;
241 if (t0 > 0)
242 {
243 //Values read in should have their values checked against sensible limits.
244 //We assume the input is trusted however.
245 //coverity[TAINTED_SCALAR]
246 t0Cdo->setT0(id, t0, t0err);
247 ++nstrawt0;
248 }
249 }
250 }
251 }
252
253 // Check that containers were filled
254
255 size_t t0footprint = t0Cdo->footprint();
256 size_t rtfootprint = rtCdo->footprint();
257
258 ATH_MSG_INFO("read " << nstrawt0 << " t0 and " << nrtrelations << " rt from file. "
259 << " t0/rt footprints " << t0footprint << " / " << rtfootprint << " t0 footprint after crunch " << t0Cdo->footprint());
260
261 // Record the containers for access via ReadCondHandle during reconstruction
262 const EventIDRange rangeW = IOVInfRange();
263 SG::WriteCondHandle<RtRelationContainer> rtWriteHandle{m_rtWriteKey, ctx};
264 if (rtWriteHandle.isValid())
265 {
266 ATH_MSG_DEBUG(" RtRelationContainer already available ");
267 return StatusCode::SUCCESS;
268 }
269
270 if (rtWriteHandle.record(rangeW, std::move(rtCdo)).isFailure())
271 {
272 ATH_MSG_ERROR("Could not record RT Container for key " << m_rtWriteKey.fullKey() << " with WriteHandle ");
273 return StatusCode::FAILURE;
274 }
275 else
276 {
277 ATH_MSG_INFO("Recorded RT Container for key " << m_rtWriteKey.fullKey() << " with range " << rtWriteHandle.getRange());
278 }
279
280 SG::WriteCondHandle<StrawT0Container> t0WriteHandle{m_t0WriteKey, ctx};
281 if (t0WriteHandle.isValid())
282 {
283 ATH_MSG_DEBUG(" StrawT0Container already available ");
284 return StatusCode::SUCCESS;
285 }
286
287 if (t0Cdo->initialize().isFailure())
288 ATH_MSG_WARNING("Could not initialize T0 Container for key " << m_t0WriteKey.fullKey());
289
290 if (t0WriteHandle.record(rangeW, std::move(t0Cdo)).isFailure())
291 {
292 ATH_MSG_ERROR("Could not record T0 Container for key " << m_t0WriteKey.fullKey() << " with WriteHandle ");
293 return StatusCode::FAILURE;
294 }
295 else
296 {
297 ATH_MSG_INFO("Recorded T0 Container for key " << m_t0WriteKey.fullKey() << " with range " << t0WriteHandle.getRange());
298 }
299
300 return StatusCode::SUCCESS;
301}
static Double_t t0
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
virtual EventIDRange IOVInfRange() const
static RtRelation * readFromFile(std::istream &is)
read method

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ trtcondid()

TRTCond::ExpandedIdentifier TRTCondWrite::trtcondid ( const Identifier & id,
int level = TRTCond::ExpandedIdentifier::STRAW ) const
virtual

create an TRTCond::ExpandedIdentifier from a TRTID identifier

Definition at line 303 of file TRTCondWrite.cxx.

304{
305 return TRTCond::ExpandedIdentifier(m_trtid->barrel_ec(id), m_trtid->layer_or_wheel(id),
306 m_trtid->phi_module(id), m_trtid->straw_layer(id),
307 m_trtid->straw(id), level);
308}

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_condSvc

ServiceHandle<ICondSvc> TRTCondWrite::m_condSvc {this, "CondSvc", "CondSvc"}
private

Definition at line 59 of file TRTCondWrite.h.

59{this, "CondSvc", "CondSvc"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_par_caltextfile

Gaudi::Property<std::string> TRTCondWrite::m_par_caltextfile {this, "CalibInputFile", "dummy_TRTCondWrite.txt", ""}
private

Definition at line 60 of file TRTCondWrite.h.

60{this, "CalibInputFile", "dummy_TRTCondWrite.txt", ""};

◆ m_rtWriteKey

SG::WriteCondHandleKey<RtRelationContainer> TRTCondWrite::m_rtWriteKey {this, "RtWriteKeyName", "/TRT/Calib/RT", "r-t relation out-key"}
private

Definition at line 63 of file TRTCondWrite.h.

63{this, "RtWriteKeyName", "/TRT/Calib/RT", "r-t relation out-key"};

◆ m_t0WriteKey

SG::WriteCondHandleKey<StrawT0Container> TRTCondWrite::m_t0WriteKey {this, "T0WriteKeyName", "/TRT/Calib/T0", "t0 out-key"}
private

Definition at line 64 of file TRTCondWrite.h.

64{this, "T0WriteKeyName", "/TRT/Calib/T0", "t0 out-key"};

◆ m_trtid

const TRT_ID* TRTCondWrite::m_trtid {}
private

trt id helper

Definition at line 58 of file TRTCondWrite.h.

58{};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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