|
ATLAS Offline Software
|
#include <AANTupleStream.h>
|
| AANTupleStream (const std::string &name, ISvcLocator *pSvcLocator) |
| Standard AANTupleStream Constructor. More...
|
|
virtual | ~AANTupleStream () |
| Standard Destructor. More...
|
|
virtual StatusCode | initialize () |
| Initialize AANTupleStream. More...
|
|
virtual StatusCode | finalize () |
| Terminate AANTupleStream. More...
|
|
virtual StatusCode | execute () |
| Working entry point. More...
|
|
const EventContext & | getContext () const |
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
|
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 | sysInitialize () override |
| Perform system initialization for an algorithm. 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 |
|
|
StatusCode | initCollection () |
| Initialize the output collection. More...
|
|
StatusCode | getRef (CLID id, const std::string &key, std::string &ref) |
| Get ref from a proxy. More...
|
|
StatusCode | splitAddress (const std::string &address, const std::string &match, std::string &address_header, std::string &address_data) const |
| Split the address to get pool token. More...
|
|
StatusCode | initialize_subAlgos () |
| initialize sub-algos More...
|
|
StatusCode | execute_subAlgos () |
| execute sub-algos More...
|
|
void | writeAttributeListSpecification () |
| write schema of AttributeList More...
|
|
void | setupTree () |
| setup Tree More...
|
|
bool | writeTokenAttrList (const std::string &token, const coral::AttributeList &attributeList) |
| write Token and AttributeList More...
|
|
StatusCode | getFilters () |
| get filter alogs More...
|
|
bool | isEventAccepted () const |
| check filters passed More...
|
|
StatusCode | initSchema () |
|
StatusCode | io_reinit () |
| callback method to reinitialize the internal state of the component for I/O purposes (e.g. 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...
|
|
Definition at line 33 of file AANTupleStream.h.
◆ StoreGateSvc_t
◆ AANTupleStream()
AANTupleStream::AANTupleStream |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~AANTupleStream()
AANTupleStream::~AANTupleStream |
( |
| ) |
|
|
virtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode AANTupleStream::execute |
( |
| ) |
|
|
virtual |
Working entry point.
Implements AthLegacySequence.
Definition at line 173 of file AANTupleStream.cxx.
185 if (
sc.isFailure() )
191 std::map<std::string,std::string> inputRefs;
204 return StatusCode::FAILURE;
208 for (;
beg != ending; ++
beg)
214 return StatusCode::FAILURE;
224 return StatusCode::FAILURE;
234 std::vector<DataHeaderElement>::const_iterator
it =
235 (
const_cast<DataHeader*
>(hdr)->beginProvenance());
236 std::vector<DataHeaderElement>::const_iterator
itE =
237 (
const_cast<DataHeader*
>(hdr)->endProvenance());
241 std::string tmpRef = (*it).getToken() != NULL
242 ? (*it).getToken()->toString()
244 inputRefs.insert(std::make_pair(
it->getKey(),tmpRef));
246 <<
", Ref=" << tmpRef);
278 newAttr[ name_RunNumber ].setValue(
runNumber );
279 newAttr[ name_EventNumber ].setValue(
eventNumber );
286 for (; itRef != itRefE; ++itRef)
288 std::string
name = itRef->first +
"_ref";
289 if (extraRefs.end() !=
std::find(extraRefs.begin(),extraRefs.end(),itRef->first))
291 newAttr[
name].setValue(std::string(itRef->second));
292 ATH_MSG_DEBUG (
" Added extra ref to new attribute list - name: "
293 <<
name <<
" " << itRef->second);
310 (
"Caught exception from collection add of Pool attributes. "
311 "Message: " <<
e.what());
312 return StatusCode::FAILURE;
318 return StatusCode::SUCCESS;
◆ execute_subAlgos()
StatusCode AANTupleStream::execute_subAlgos |
( |
| ) |
|
|
private |
execute sub-algos
Definition at line 559 of file AANTupleStream.cxx.
565 const EventContext& ctx = Gaudi::Hive::currentContext();
572 if (! (*(this->subAlgorithms()))[
i]->isEnabled()) continue ;
574 sc = (*(this->subAlgorithms()))[
i]->execute(ctx);
579 return StatusCode::FAILURE;
◆ extraDeps_update_handler()
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 & Athena::details::AthLegacySequenceAdapter::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
◆ finalize()
StatusCode AANTupleStream::finalize |
( |
| ) |
|
|
virtual |
◆ getContext()
const EventContext& Athena::details::AthLegacySequenceAdapter::getContext |
( |
| ) |
const |
|
inlineinherited |
◆ getFilters()
StatusCode AANTupleStream::getFilters |
( |
| ) |
|
|
private |
get filter alogs
Definition at line 587 of file AANTupleStream.cxx.
593 return StatusCode::SUCCESS;
595 ServiceHandle<IAlgManager> theAlgMgr(
"ApplicationMgr", this->
name());
601 SmartIF<IAlgorithm> ialg{theAlgMgr->algorithm(
name)};
605 return StatusCode::FAILURE;
611 return StatusCode::SUCCESS;
◆ getRef()
StatusCode AANTupleStream::getRef |
( |
CLID |
id, |
|
|
const std::string & |
key, |
|
|
std::string & |
ref |
|
) |
| |
|
private |
Get ref from a proxy.
Definition at line 385 of file AANTupleStream.cxx.
394 return(StatusCode::FAILURE);
404 return(StatusCode::FAILURE);
408 IOpaqueAddress* addr = itemProxy->
address();
412 << itemProxy->
clID() <<
" " << itemProxy->
name());
413 return( StatusCode::FAILURE);
424 (
"Could not get string from IOpaqueAddress for clid " <<
id
426 <<
" is BAD_STORAGE_TYPE: "<< (
sc == IConversionSvc::Status::BAD_STORAGE_TYPE));
427 return( StatusCode::FAILURE);
437 ATH_MSG_ERROR (
"Could not get split off token. string address " << saddr);
438 return( StatusCode::FAILURE);
443 return StatusCode::SUCCESS;
◆ initCollection()
StatusCode AANTupleStream::initCollection |
( |
| ) |
|
|
private |
Initialize the output collection.
Definition at line 132 of file AANTupleStream.cxx.
144 return StatusCode::SUCCESS;
◆ initialize()
StatusCode AANTupleStream::initialize |
( |
| ) |
|
|
virtual |
◆ initialize_subAlgos()
StatusCode AANTupleStream::initialize_subAlgos |
( |
| ) |
|
|
private |
initialize sub-algos
Definition at line 529 of file AANTupleStream.cxx.
542 Gaudi::Utils::TypeNameString tn(
name);
546 sc = createSubAlgorithm( tn.type(), tn.name(), algo );
550 return StatusCode::FAILURE;
◆ initSchema()
StatusCode AANTupleStream::initSchema |
( |
| ) |
|
|
private |
◆ inputHandles()
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.
◆ io_reinit()
StatusCode AANTupleStream::io_reinit |
( |
| ) |
|
|
private |
callback method to reinitialize the internal state of the component for I/O purposes (e.g.
upon fork(2)
)
Definition at line 658 of file AANTupleStream.cxx.
667 if ( !iomgr->io_hasitem (
this) ) {
668 ATH_MSG_ERROR (
"I/O component mgr does not know about ourselves !");
669 return StatusCode::FAILURE;
673 if ( !iomgr->io_contains (
this,
m_fileName) ) {
675 (
"I/O component mgr does not have any entry about ["<<
m_fileName<<
"]");
676 return StatusCode::SUCCESS;
679 if ( !iomgr->io_retrieve (
this,
m_fileName).isSuccess() ) {
681 return StatusCode::FAILURE;
685 std::vector<std::string> outvec = {
"AANT DATAFILE='" +
m_fileName +
"' OPT='RECREATE'"};
695 return StatusCode::SUCCESS;
◆ isEventAccepted()
bool AANTupleStream::isEventAccepted |
( |
| ) |
const |
|
private |
check filters passed
Definition at line 619 of file AANTupleStream.cxx.
625 const EventContext& ctx = Gaudi::Hive::currentContext();
630 if (
alg->execState(ctx).state() == AlgExecState::State::Done &&
631 ( !
alg->execState(ctx).filterPassed() ) )
◆ isReEntrant()
bool Athena::details::AthLegacySequenceAdapter::isReEntrant |
( |
| ) |
const |
|
inlinefinaloverrideprotectedinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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.
◆ renounce()
◆ renounceArray()
◆ setupTree()
void AANTupleStream::setupTree |
( |
| ) |
|
|
private |
setup Tree
Definition at line 339 of file AANTupleStream.cxx.
341 static const std::map<std::string,char> typeDict = {
343 {
"long double",
'D'},
346 {
"unsigned int",
'I'},
348 {
"unsigned long",
'I'},
350 {
"unsigned short",
'S'},
352 {
"unsigned char",
'B'},
359 TDirectory::TContext
save;
366 for(coral::AttributeListSpecification::const_iterator iter=
m_attribSpec->begin(); iter!=
m_attribSpec->end(); ++iter)
368 std::string
type =
"/?";
369 type[1] = typeDict.at(iter->typeName());
370 std::string leaflist = iter->name() +
type;
371 m_tree->Branch(iter->name().c_str(),0,leaflist.c_str());
375 std::string leaflist = c_tokenBranchName;
377 m_tree->Branch(c_tokenBranchName,0,leaflist.c_str());
◆ splitAddress()
StatusCode AANTupleStream::splitAddress |
( |
const std::string & |
address, |
|
|
const std::string & |
match, |
|
|
std::string & |
address_header, |
|
|
std::string & |
address_data |
|
) |
| const |
|
private |
Split the address to get pool token.
Definition at line 449 of file AANTupleStream.cxx.
456 <<
" match : " <<
match);
458 std::string::size_type
p1;
461 if (
p1 != std::string::npos)
469 return StatusCode::FAILURE;
474 <<
" address_data : " << address_data);
476 return StatusCode::SUCCESS;
◆ sysInitialize()
Perform system initialization for an algorithm.
We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ writeAttributeListSpecification()
void AANTupleStream::writeAttributeListSpecification |
( |
| ) |
|
|
private |
write schema of AttributeList
Definition at line 322 of file AANTupleStream.cxx.
325 TDirectory::TContext
save;
330 for( coral::AttributeListSpecification::const_iterator iter =
m_attribSpec->begin();
332 all.m_layout.push_back( make_pair( iter->name(), iter->typeName() ) );
335 all.Write(c_attributeListLayoutName);
◆ writeTokenAttrList()
bool AANTupleStream::writeTokenAttrList |
( |
const std::string & |
token, |
|
|
const coral::AttributeList & |
attributeList |
|
) |
| |
|
private |
write Token and AttributeList
Definition at line 481 of file AANTupleStream.cxx.
484 coral::AttributeList::const_iterator attIter = attributeList.begin();
486 std::vector<std::string> tokenStringDump;
488 for (
unsigned int i=0;
i<attributeList.size(); ++
i)
492 if (attIter->specification().type() ==
typeid(std::string))
494 const std::string&
str = attIter->data<std::string>();
497 throw std::runtime_error(
"String is too long : RootCollection::pool2Root<std::string>");
499 branch->SetAddress( (
void*)
str.c_str() );
502 else if(attIter->specification().typeName() ==
"Token")
504 tokenStringDump.push_back( attIter->data<std::string>() );
505 branch->SetAddress( (
void*) tokenStringDump.back().c_str() );
510 branch->SetAddress( (
void*)attIter->addressOfData() );
◆ m_acceptAlgs
std::vector<IAlgorithm*> AANTupleStream::m_acceptAlgs |
|
private |
Vector of Algorithms that this stream accepts.
Definition at line 133 of file AANTupleStream.h.
◆ m_acceptNames
std::vector<std::string> AANTupleStream::m_acceptNames |
|
private |
Vector of names of Algorithms that this stream accepts.
Definition at line 130 of file AANTupleStream.h.
◆ m_attribSpec
coral::AttributeListSpecification* AANTupleStream::m_attribSpec |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_existDH
BooleanProperty AANTupleStream::m_existDH |
|
private |
◆ m_extendedExtraObjects
DataObjIDColl Athena::details::AthLegacySequenceAdapter::m_extendedExtraObjects |
|
privateinherited |
◆ m_extraRefNames
StringArrayProperty AANTupleStream::m_extraRefNames |
|
private |
Vector of extra parent ref names to register in collection.
Definition at line 106 of file AANTupleStream.h.
◆ m_fileName
std::string AANTupleStream::m_fileName |
|
private |
◆ m_lateSchema
BooleanProperty AANTupleStream::m_lateSchema |
|
private |
◆ m_macro
std::string AANTupleStream::m_macro |
|
private |
◆ m_membersNames
std::vector<std::string> AANTupleStream::m_membersNames |
|
private |
◆ m_persSvc
◆ m_schemaDone
bool AANTupleStream::m_schemaDone |
|
private |
◆ m_streamName
std::string AANTupleStream::m_streamName |
|
private |
◆ m_tHistSvc
◆ m_tokenBranch
TBranch* AANTupleStream::m_tokenBranch |
|
private |
◆ m_tokenCString
◆ m_tree
TTree* AANTupleStream::m_tree |
|
private |
◆ m_treeName
std::string AANTupleStream::m_treeName |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeInputDH
BooleanProperty AANTupleStream::m_writeInputDH |
|
private |
Flag to signal whether or not to write input data header.
Definition at line 109 of file AANTupleStream.h.
◆ s_maxLengthOfStrings
const unsigned int AANTupleStream::s_maxLengthOfStrings = 5000 |
|
staticprivate |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
std::string find(const std::string &s)
return a remapped string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool writeTokenAttrList(const std::string &token, const coral::AttributeList &attributeList)
write Token and AttributeList
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)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
void setupTree()
setup Tree
StatusCode getRef(CLID id, const std::string &key, std::string &ref)
Get ref from a proxy.
std::vector< IAlgorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
DataObjIDColl m_extendedExtraObjects
virtual void setOwner(IDataHandleHolder *o)=0
std::vector< std::string > m_membersNames
StatusCode splitAddress(const std::string &address, const std::string &match, std::string &address_header, std::string &address_data) const
Split the address to get pool token.
ServiceHandle< IAddressCreator > m_persSvc
Persistency service.
void writeAttributeListSpecification()
write schema of AttributeList
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
TBranch * m_tokenBranch
TBranch which contains Token info.
def save(self, fileName="./columbo.out")
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
virtual IOpaqueAddress * address() const override final
Retrieve IOpaqueAddress.
bool isEventAccepted() const
check filters passed
Alias for backward compatibility.
::StatusCode StatusCode
StatusCode definition for legacy code.
EventID * event_ID()
the unique identification of the event.
Default, invalid implementation of ClassID_traits.
StatusCode getFilters()
get filter alogs
bool m_schemaDone
first event
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::string m_treeName
Name of the output tree.
CLID clID() const
Retrieve clid.
std::string m_streamName
Name of Stream.
virtual void renounce()=0
char m_tokenCString[s_maxLengthOfStrings]
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
coral::AttributeListSpecification * m_attribSpec
Collection attribute specification.
static const unsigned int s_maxLengthOfStrings
for string branches
StatusCode initCollection()
Initialize the output collection.
StringArrayProperty m_extraRefNames
Vector of extra parent ref names to register in collection.
This class provides general information about an event. Event information is provided by the accessor...
virtual const name_type & name() const override final
Retrieve data object key == string.
Class describing the basic event information.
BooleanProperty m_lateSchema
write schema in execute()
#define ATH_MSG_WARNING(x)
const boost::regex ref(r_ef)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
StatusCode execute_subAlgos()
execute sub-algos
ServiceHandle< ITHistSvc > m_tHistSvc
THistSvc.
std::vector< std::string > m_acceptNames
Vector of names of Algorithms that this stream accepts.
static void setTree(const std::string &stream, TTree *tree)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
BooleanProperty m_writeInputDH
Flag to signal whether or not to write input data header.
StatusCode initialize_subAlgos()
initialize sub-algos
bool match(std::string s1, std::string s2)
match the individual directories of two strings
BooleanProperty m_existDH
Flag to signal whether data header exists.
std::string m_fileName
Name of the output collection.