ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
InDetRawDataFakeWriter Class Reference

Test Algorithm for POOL I/O, writes InDetRawData to transient store. More...

#include <InDetRawDataFakeWriter.h>

Inheritance diagram for InDetRawDataFakeWriter:
Collaboration diagram for InDetRawDataFakeWriter:

Public Member Functions

 InDetRawDataFakeWriter (const std::string &name, ISvcLocator *pSvcLocator)
 Algorithm constructor. More...
 
virtual StatusCode initialize ()
 Algorithm initialize at begin of job. More...
 
virtual StatusCode execute ()
 Algorithm execute once per event. More...
 
virtual StatusCode finalize ()
 Algorithm finalize at end of job. More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

 InDetRawDataFakeWriter ()
 Avoid use of default constructor. More...
 
 InDetRawDataFakeWriter (const InDetRawDataFakeWriter &)
 Avoid use of copy constructor. More...
 
InDetRawDataFakeWriteroperator= (const InDetRawDataFakeWriter &)
 Avoid use of copy operator. More...
 
StatusCode createPixels ()
 Create pixel collections. More...
 
StatusCode createSCTs ()
 Create sct collections. More...
 
StatusCode createTRTs ()
 Create trt collections. More...
 
StatusCode printRDOs () const
 Print out RDOs. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

PixelRDO_Containerm_pixCont
 Identifiable containers are created only once. More...
 
SCT_RDO_Containerm_sctCont
 Identifiable containers are created only once. More...
 
TRT_RDO_Containerm_trtCont
 Identifiable containers are created only once. More...
 
const PixelIDm_pixelId
 IDhelper needed for identifiable container. More...
 
const SCT_IDm_sctId
 IDhelper needed for identifiable container. More...
 
const TRT_IDm_trtId
 IDhelper needed for identifiable container. More...
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Test Algorithm for POOL I/O, writes InDetRawData to transient store.

Definition at line 37 of file InDetRawDataFakeWriter.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ InDetRawDataFakeWriter() [1/3]

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

Algorithm constructor.

Definition at line 42 of file InDetRawDataFakeWriter.cxx.

43  :
44  AthAlgorithm(name,pSvcLocator),
45  m_pixCont(nullptr),
46  m_sctCont(nullptr),
47  m_trtCont(nullptr),
48  m_pixelId(nullptr),
49  m_sctId(nullptr),
50  m_trtId(nullptr)
51 {}

◆ InDetRawDataFakeWriter() [2/3]

InDetRawDataFakeWriter::InDetRawDataFakeWriter ( )
private

Avoid use of default constructor.

◆ InDetRawDataFakeWriter() [3/3]

InDetRawDataFakeWriter::InDetRawDataFakeWriter ( const InDetRawDataFakeWriter )
private

Avoid use of copy constructor.

Member Function Documentation

◆ createPixels()

StatusCode InDetRawDataFakeWriter::createPixels ( )
private

Create pixel collections.

Definition at line 104 of file InDetRawDataFakeWriter.cxx.

105 {
106  ATH_MSG_DEBUG("InDetRawDataFakeWriter::createPixels()" );
107 
108 
109  // IDC creation and registration, done once per job:
110 
111  // the IDC is created in the initialize, must clear the IDC every event:
112  m_pixCont->cleanup();
113 
114  // register the Pixel IdentifiableContainer into StoreGate
115  ATH_CHECK( evtStore()->record(m_pixCont,"PixelRDOs") );
116 
117  // Create and record the element link vector
119  ATH_CHECK( evtStore()->record(linkVec,"PixelRDOELs") );
120 
121  // loop over 10 different pixel wafers
122  int deltaWafer = m_pixelId->wafer_hash_max()/15;
123  IdentifierHash waferHash = deltaWafer;
124 
125  InDetRawDataFakeCreator creator;
126 
128 
129  for (int i=0; i < 10; ++i, waferHash += deltaWafer) {
130 
131  // Print out contents of RDO
132  ATH_MSG_DEBUG("Creating RDO collection: "
133  << m_pixelId->show_to_string(m_pixelId->wafer_id(waferHash), &cntx) << " "
134  << MSG::hex << m_pixelId->wafer_id(waferHash) << MSG::dec << " "
135  << MSG::hex << (unsigned int)waferHash << MSG::dec );
136 
137  // create a new pixel RDO collection
138  MsgStream log(msgSvc(), name());
139  const InDetRawDataCollection<PixelRDORawData> *p_rdocoll =
140  creator.createPixelRawDataColl(waferHash, m_pixelId, log);
141 
142  // register the rdo collection in StoreGate
143  // add rdo collection to the container
144  IdentifierHash id_hash = p_rdocoll->identifyHash();
145  ATH_CHECK( m_pixCont->addCollection(p_rdocoll, id_hash) );
146 
147  // Loop over RDOs and add ELs to vector
148  for (unsigned int irdo = 0; irdo < p_rdocoll->size(); ++irdo) {
149  unsigned int itest = irdo % 3;
150  if (itest == 2) {
151  // Create el with element and container
152  ATH_MSG_VERBOSE("Pixel RDOs: create EL without index");
153  PixelRDOElemLinkVec::elem_type el((*p_rdocoll)[irdo], *m_pixCont);
154  linkVec->pixelRDOs().push_back(el);
155  }
156  else {
157  // Create el with hash and sometimes index
159  index.setCollHash(waferHash);
160  if (itest == 1) index.setObjIndex(irdo);
161  ATH_MSG_VERBOSE("Pixel RDOs: create EL - hash, index, hashAndIndex: "
162  << index.collHash() << " " << index.objIndex() << " "
163  << MSG::hex << index.hashAndIndex() << MSG::dec);
164  // Create el with element and index
166  el.setElement((*p_rdocoll)[irdo]);
167  linkVec->pixelRDOs().push_back(el);
168  }
169  }
170  }
171 
172  return StatusCode::SUCCESS;
173 }

◆ createSCTs()

StatusCode InDetRawDataFakeWriter::createSCTs ( )
private

Create sct collections.

Definition at line 175 of file InDetRawDataFakeWriter.cxx.

176 {
177  ATH_MSG_DEBUG("InDetRawDataFakeWriter::execute()" );
178 
179  // IDC creation and registration, done once per job:
180 
181  // the IDC is created in the initialize, must clear the IDC every event:
182  m_sctCont->cleanup();
183 
184 
185  ATH_CHECK( evtStore()->record(m_sctCont,"SCT_RDOs") );
186 
187  // loop over 10 different sct wafers
188  int deltaWafer = m_sctId->wafer_hash_max()/15;
189  IdentifierHash waferHash = deltaWafer;
190 
191  InDetRawDataFakeCreator creator;
192 
193  IdContext cntx = m_sctId->wafer_context();
194 
195  for (int i=0; i < 10; ++i, waferHash += deltaWafer) {
196 
197  // Print out contents of RDO
198  ATH_MSG_DEBUG("Creating RDO collection: "
199  << m_sctId->show_to_string(m_sctId->wafer_id(waferHash), &cntx) << " "
200  << MSG::hex << m_sctId->wafer_id(waferHash) << MSG::dec << " "
201  << MSG::hex << (unsigned int)waferHash << MSG::dec );
202 
203  // create a new sct RDO collection
204  MsgStream log(msgSvc(), name());
205  const InDetRawDataCollection<SCT_RDORawData> *p_rdocoll =
206  creator.createSCT_RawDataColl(waferHash, m_sctId, msg());
207 
208  // register the rdo collection in StoreGate
209  IdentifierHash id_hash = p_rdocoll->identifyHash();
210  ATH_CHECK( m_sctCont->addCollection(p_rdocoll, id_hash) );
211  }
212 
213  return StatusCode::SUCCESS;
214 }

◆ createTRTs()

StatusCode InDetRawDataFakeWriter::createTRTs ( )
private

Create trt collections.

Definition at line 216 of file InDetRawDataFakeWriter.cxx.

217 {
218  ATH_MSG_DEBUG("InDetRawDataFakeWriter::execute()" );
219 
220  // IDC creation and registration, done once per job:
221 
222  // the IDC is created in the initialize, must clear the IDC every event:
223  m_trtCont->cleanup();
224 
225 
226  // register the TRT_ IdentifiableContainer into StoreGate
227  ATH_CHECK( evtStore()->record(m_trtCont,"TRT_RDOs") );
228 
229  // loop over 10 different trt straw layers
230  int deltaStrLay = m_trtId->straw_layer_hash_max()/15;
231  IdentifierHash strLayHash = deltaStrLay;
232 
233  InDetRawDataFakeCreator creator;
234 
236 
237  for (int i=0; i < 10; ++i, strLayHash += deltaStrLay) {
238 
239  // Print out contents of RDO
240  ATH_MSG_DEBUG("Creating RDO collection: "
241  << m_trtId->show_to_string(m_trtId->layer_id(strLayHash), &cntx) << " "
242  << MSG::hex << m_trtId->layer_id(strLayHash) << MSG::dec << " "
243  << MSG::hex << (unsigned int)strLayHash << MSG::dec );
244 
245  // create a new trt RDO collection
246  const InDetRawDataCollection<TRT_RDORawData> *p_rdocoll =
247  creator.createTRT_RawDataColl(strLayHash, m_trtId, msg());
248 
249  // register the rdo collection in StoreGate
250  IdentifierHash id_hash = p_rdocoll->identifyHash();
251  ATH_CHECK( m_trtCont->addCollection(p_rdocoll, id_hash) );
252  }
253 
254  return StatusCode::SUCCESS;
255 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode InDetRawDataFakeWriter::execute ( )
virtual

Algorithm execute once per event.

Definition at line 93 of file InDetRawDataFakeWriter.cxx.

94 {
95  // Get the messaging service, print where you are
96  ATH_MSG_DEBUG( "InDetRawDataFakeWriter::execute()" );
98  ATH_CHECK( createSCTs() );
99  ATH_CHECK( createTRTs() );
100  ATH_CHECK( printRDOs() );
101  return StatusCode::SUCCESS;
102 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode InDetRawDataFakeWriter::finalize ( )
virtual

Algorithm finalize at end of job.

Definition at line 359 of file InDetRawDataFakeWriter.cxx.

360 {
361  ATH_MSG_INFO("InDetRawDataFakeWriter::finalize()" );
362  return StatusCode::SUCCESS;
363 }

◆ initialize()

StatusCode InDetRawDataFakeWriter::initialize ( )
virtual

Algorithm initialize at begin of job.

Definition at line 54 of file InDetRawDataFakeWriter.cxx.

55 {
56  ATH_MSG_INFO("InDetRawDataFakeWriter::initialize()" );
57 
58  ATH_CHECK( detStore()->retrieve(m_pixelId, "PixelID") );
59  ATH_CHECK( detStore()->retrieve(m_sctId, "SCT_ID") );
60  ATH_CHECK( detStore()->retrieve(m_trtId, "TRT_ID") );
61 
62  // create the IdentifiableContainers to contain the rdo collections
63  try {
65  } catch (const std::bad_alloc&) {
66  ATH_MSG_ERROR("Could not create a new Pixel RawDataContainer !");
67  return StatusCode::FAILURE;
68  }
69 
70  try {
72  } catch (const std::bad_alloc&) {
73  ATH_MSG_ERROR("Could not create a new SCT RawDataContainer !");
74  return StatusCode::FAILURE;
75  }
76 
77  try {
79  } catch (const std::bad_alloc&) {
80  ATH_MSG_ERROR("Could not create a new TRT RawDataContainer !");
81  return StatusCode::FAILURE;
82  }
83 
84  // preventing SG from deleting object:
85  m_pixCont->addRef();
86  m_sctCont->addRef();
87  m_trtCont->addRef();
88 
89  return StatusCode::SUCCESS;
90 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< 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.

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ operator=()

InDetRawDataFakeWriter& InDetRawDataFakeWriter::operator= ( const InDetRawDataFakeWriter )
private

Avoid use of copy operator.

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< 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.

◆ printRDOs()

StatusCode InDetRawDataFakeWriter::printRDOs ( ) const
private

Print out RDOs.

Definition at line 261 of file InDetRawDataFakeWriter.cxx.

262 {
263  ATH_MSG_INFO("InDetRawDataFakeWriter::printRDOs()" );
264 
265  // loop on all RDO collections
266 
267  // pixels
268 
270  it!=m_pixCont->end() ; ++it) {
271 
272  const InDetRawDataCollection< PixelRDORawData > *rdocoll=&(**it);
273 
274  ATH_MSG_DEBUG("PixelRDORawData collection found with id "
275  << m_pixelId->show_to_string(rdocoll->identify())
276  << " and " << rdocoll->size() << " RDOs" );
277 
278  // loop on all RDOs
280  for(rdo=rdocoll->begin() ;
281  rdo!=rdocoll->end() ; ++rdo) {
282 
283  ATH_MSG_DEBUG("RDO ID=" << m_pixelId->show_to_string((*rdo)->identify())
284  << "RDO ToT=" << (*rdo)->getToT() << " id:"
285  << (*rdo)->identify().getString() );
286 
287  }
288  }
289 
290  // pixel element links
291 
292  // Retrive the element link vector
293  const PixelRDOElemLinkVec* linkVec = nullptr;
294  ATH_CHECK( evtStore()->retrieve(linkVec, "PixelRDOELs") );
295 
296  ATH_MSG_DEBUG("PixelRDOElemLinkVec found with " << linkVec->pixelRDOs().size() << " RDOs " );
297  for(unsigned int i = 0; i < linkVec->pixelRDOs().size(); ++i) {
298  // Print out rdos from element link
299  PixelRDOElemLinkVec::elem_type rdo = linkVec->pixelRDOs()[i];
300  ATH_MSG_DEBUG("RDO ID=" << m_pixelId->show_to_string((*rdo)->identify())
301  << "RDO ToT=" << (*rdo)->getToT()
302  << " id:" << (*rdo)->identify().getString() );
303  }
304 
305 
306  // scts
307 
309  it!=m_sctCont->end() ; ++it) {
310 
311  const InDetRawDataCollection< SCT_RDORawData > *rdocoll=&(**it);
312 
313  ATH_MSG_DEBUG("SCT_RDORawData collection found with id "
314  << m_sctId->show_to_string(rdocoll->identify())
315  << " and " << rdocoll->size() << " RDOs" );
316 
317  // loop on all RDOs
319  for(rdo=rdocoll->begin() ;
320  rdo!=rdocoll->end() ; ++rdo) {
321 
322  ATH_MSG_DEBUG("RDO ID=" << m_sctId->show_to_string((*rdo)->identify())
323  << "RDO grp=" << (*rdo)->getGroupSize() );
324 
325  }
326  }
327 
328  // trts
329 
331  it!=m_trtCont->end() ; ++it) {
332 
333  const InDetRawDataCollection< TRT_RDORawData > *rdocoll=&(**it);
334 
335  ATH_MSG_DEBUG("TRT_RDORawData collection found with id "
336  << m_trtId->show_to_string(rdocoll->identify())
337  << " and " << rdocoll->size() << " RDOs" );
338 
339  // loop on all RDOs
341  for(rdo=rdocoll->begin() ;
342  rdo!=rdocoll->end() ; ++rdo) {
343 
344  ATH_MSG_DEBUG("RDO ID=" << m_trtId->show_to_string((*rdo)->identify())
345  << "RDO hilvl=" << (*rdo)->highLevel() << " ToT:"
346  << (*rdo)->timeOverThreshold() << " drift: " << (*rdo)->driftTimeBin());
347 
348  }
349  }
350 
351  ATH_MSG_DEBUG("InDetRawDataFakeWriter::printRDOs() end" );
352 
353  return StatusCode::SUCCESS;
354 
355 }

◆ 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< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< 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< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_pixCont

PixelRDO_Container* InDetRawDataFakeWriter::m_pixCont
private

Identifiable containers are created only once.

Definition at line 88 of file InDetRawDataFakeWriter.h.

◆ m_pixelId

const PixelID* InDetRawDataFakeWriter::m_pixelId
private

IDhelper needed for identifiable container.

Definition at line 97 of file InDetRawDataFakeWriter.h.

◆ m_sctCont

SCT_RDO_Container* InDetRawDataFakeWriter::m_sctCont
private

Identifiable containers are created only once.

Definition at line 91 of file InDetRawDataFakeWriter.h.

◆ m_sctId

const SCT_ID* InDetRawDataFakeWriter::m_sctId
private

IDhelper needed for identifiable container.

Definition at line 100 of file InDetRawDataFakeWriter.h.

◆ m_trtCont

TRT_RDO_Container* InDetRawDataFakeWriter::m_trtCont
private

Identifiable containers are created only once.

Definition at line 94 of file InDetRawDataFakeWriter.h.

◆ m_trtId

const TRT_ID* InDetRawDataFakeWriter::m_trtId
private

IDhelper needed for identifiable container.

Definition at line 103 of file InDetRawDataFakeWriter.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDetRawDataFakeCreator
Class which encapsulates the creation of an InDetRawDataCollection.
Definition: InDetRawDataFakeCreator.h:41
TRT_ID::layer_id
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
Definition: TRT_ID.h:500
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
PixelRDO_Container
InDetRawDataContainer< InDetRawDataCollection< PixelRDORawData > > PixelRDO_Container
Definition: PixelRDO_Container.h:25
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
IdentifiableContainerMT::addCollection
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
Definition: IdentifiableContainerMT.h:297
index
Definition: index.py:1
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TRT_ID::straw_layer_hash_max
size_type straw_layer_hash_max(void) const
Definition: TRT_ID.h:920
InDetRawDataFakeWriter::createTRTs
StatusCode createTRTs()
Create trt collections.
Definition: InDetRawDataFakeWriter.cxx:216
InDetRawDataCollection::identify
virtual Identifier identify() const override final
skel.it
it
Definition: skel.GENtoEVGEN.py:396
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
InDetRawDataFakeWriter::m_sctCont
SCT_RDO_Container * m_sctCont
Identifiable containers are created only once.
Definition: InDetRawDataFakeWriter.h:91
IdentContIndex
Identifiable container index to a contained object.
Definition: IdentContIndex.h:23
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:364
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
InDetRawDataCollection::identifyHash
virtual IdentifierHash identifyHash() const override final
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
PixelRDOElemLinkVec
vector containing element links to pixel RDOs
Definition: PixelRDOElemLinkVec.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
InDetRawDataFakeWriter::createPixels
StatusCode createPixels()
Create pixel collections.
Definition: InDetRawDataFakeWriter.cxx:104
lumiFormat.i
int i
Definition: lumiFormat.py:85
TRT_ID::straw_layer_context
IdContext straw_layer_context(void) const
straw_layer id
Definition: TRT_ID.h:713
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDetRawDataFakeCreator::createSCT_RawDataColl
const InDetRawDataCollection< SCT_RDORawData > * createSCT_RawDataColl(IdentifierHash hashId, const SCT_ID *sctId, MsgStream &log)
Create SCT_RawDataCollection.
Definition: InDetRawDataFakeCreator.h:141
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
InDetRawDataFakeCreator::createTRT_RawDataColl
const InDetRawDataCollection< TRT_RDORawData > * createTRT_RawDataColl(IdentifierHash hashId, const TRT_ID *trtId, MsgStream &log)
Create TRT_RawDataCollection.
Definition: InDetRawDataFakeCreator.h:189
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:239
SCT_ID::wafer_context
IdContext wafer_context(void) const
Definition: SCT_ID.h:705
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:79
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:233
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
InDetRawDataFakeWriter::m_pixelId
const PixelID * m_pixelId
IDhelper needed for identifiable container.
Definition: InDetRawDataFakeWriter.h:97
InDetRawDataFakeWriter::createSCTs
StatusCode createSCTs()
Create sct collections.
Definition: InDetRawDataFakeWriter.cxx:175
TRT_RDO_Container
InDetRawDataContainer< InDetRawDataCollection< TRT_RDORawData > > TRT_RDO_Container
Definition: TRT_RDO_Container.h:26
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SCT_ID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: SCT_ID.cxx:645
InDetRawDataFakeWriter::m_sctId
const SCT_ID * m_sctId
IDhelper needed for identifiable container.
Definition: InDetRawDataFakeWriter.h:100
PixelID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: PixelID.cxx:831
SCT_RDO_Container
InDetRawDataContainer< InDetRawDataCollection< SCT_RDORawData > > SCT_RDO_Container
Definition: SCT_RDO_Container.h:23
DataVector< RawDataT >::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
InDetRawDataFakeWriter::m_pixCont
PixelRDO_Container * m_pixCont
Identifiable containers are created only once.
Definition: InDetRawDataFakeWriter.h:88
InDetRawDataFakeWriter::m_trtCont
TRT_RDO_Container * m_trtCont
Identifiable containers are created only once.
Definition: InDetRawDataFakeWriter.h:94
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
DeMoScan.index
string index
Definition: DeMoScan.py:364
InDetRawDataFakeWriter::m_trtId
const TRT_ID * m_trtId
IDhelper needed for identifiable container.
Definition: InDetRawDataFakeWriter.h:103
a
TList * a
Definition: liststreamerinfos.cxx:10
h
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
PixelID::wafer_context
IdContext wafer_context(void) const
Definition: PixelID.h:590
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
InDetRawDataFakeWriter::printRDOs
StatusCode printRDOs() const
Print out RDOs.
Definition: InDetRawDataFakeWriter.cxx:261
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
PixelRDOElemLinkVec::pixelRDOs
const std::vector< elem_type > & pixelRDOs() const
Definition: PixelRDOElemLinkVec.h:79
SCT_ID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition: SCT_ID.h:464
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
DataVector< RawDataT >::size
size_type size() const noexcept
Returns the number of elements in the collection.
InDetRawDataFakeCreator::createPixelRawDataColl
const InDetRawDataCollection< PixelRDORawData > * createPixelRawDataColl(IdentifierHash hashId, const PixelID *pixelId, MsgStream &log)
Create PixelRawDataCollection.
Definition: InDetRawDataFakeCreator.h:76
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
IdentifiableContainerMT::cleanup
virtual void cleanup() override final
reset m_hashids and call IdentifiableCache's cleanup
Definition: IdentifiableContainerMT.h:309
DataVector< RawDataT >::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >