31 ATH_MSG_DEBUG(
"Copying objects matching pattern \"" << pattern
32 <<
"\" to the output");
35 std::set<std::string>
keys;
38 std::regex
re{pattern};
47 if (std::regex_match(key,
re) ==
false) {
51 if (key.ends_with(
"Aux.")) {
55 if (efe.parentName() !=
"") {
59 static const bool SILENT =
true;
75 if (std::regex_match(newname,
re) ==
false) {
79 static const bool SILENT =
true;
89 for (
const std::string& key :
keys) {
92 std::string keyToUse = key;
97 keyToUse = remap_itr->second;
101 static const bool SILENT =
false;
108 return StatusCode::FAILURE;
112 if (objMgr ==
nullptr) {
114 return StatusCode::FAILURE;
116 static const bool METADATA =
false;
118 SILENT, METADATA) ==
nullptr) {
120 return StatusCode::FAILURE;
124 static const bool OVERWRITE =
true;
125 static const bool IS_OWNER =
true;
127 key, OVERWRITE, METADATA, IS_OWNER));
131 const std::string auxKey = keyToUse +
"Aux.";
139 return StatusCode::SUCCESS;
155 bool metadata)
const {
161 auto itr = objects.find(key);
162 if (itr == objects.end()) {
168 if ((!store) || (!store->contains(key, ti)) || store->isConst(key, ti)) {
173 void*
result = store->getObject(key, ti);
182 if (itr->second->isSet() ==
false) {
189 if (mgr ==
nullptr) {
190 ATH_MSG_ERROR(
"Object of wrong type found for key \"" << key <<
"\"");
195 void*
result = mgr->holder()->getAs(ti);
219 const std::type_info& ti,
bool silent,
223 std::string keyToUse = key;
228 keyToUse = remap_itr->second;
234 if (store && store->contains(keyToUse, ti) && store->isConst(keyToUse, ti)) {
235 const void*
result = store->getConstObject(keyToUse, ti);
241 if (silent ==
false) {
250 if (
sc.isSuccess() ==
false) {
258 auto itr = objects.find(keyToUse);
259 if (itr == objects.end()) {
260 ATH_MSG_FATAL(
"There is an internal logic error in the code...");
267 if (mgr ==
nullptr) {
268 if (key == keyToUse) {
269 ATH_MSG_ERROR(
"Object of wrong type found for key \"" << key <<
"\"");
272 << key <<
"\"/\"" << keyToUse <<
"\"");
278 if (metadata ==
false) {
279 const Int_t readBytes = mgr->getEntry();
284 static const bool IS_METADATA =
false;
285 if (
setAuxStore(key, *mgr, IS_METADATA).isSuccess() ==
false) {
287 << mgr->holder()->getClass()->GetName() <<
"/"
291 }
else if (readBytes < 0) {
293 << mgr->holder()->getClass()->GetName() <<
"/" << keyToUse);
299 const void*
result = mgr->holder()->getAsConst(ti, silent);
303 << keyToUse <<
"\" as \""
322::Bool_t
Event::contains(
const std::string& key,
const std::type_info& ti,
325 static const bool SILENT =
true;
342 const std::type_info& ti,
343 ::Bool_t metadata)
const {
const boost::regex re(r_e)
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Manager for EDM objects created by ROOT.
const THolder * holder() const
Accessor to the Holder object.
virtual bool hasInput() const =0
Check if an input file is connected to the object.
EventFormat m_inputEventFormat
Format of the current input file.
bool transientContains(const std::string &key) const
Function checking if an object is already in memory.
virtual StatusCode recordAux(TVirtualManager &mgr, const std::string &key, bool metadata)=0
Record an auxiliary store into a connected output file.
bool contains(const std::string &key)
Function checking if an object is available from the store.
const void * getInputObject(SG::sgkey_t key, const std::type_info &ti, bool silent) override
Function for retrieving an input object in a non-template way.
virtual StatusCode connectObject(const std::string &key, bool silent)=0
Function setting up access to a particular object.
Object_t m_inputObjects
Collection of all the managed input objects.
StatusCode copy(const std::string &pattern=".*")
Copy an object directly from the input to the output.
std::unordered_map< std::string, std::unique_ptr< TVirtualManager > > Object_t
Definition of the internal data structure type.
void * getOutputObject(SG::sgkey_t key, const std::type_info &ti) override
Function for retrieving an output object in a non-template way.
virtual StatusCode connectMetaObject(const std::string &key, bool silent)=0
Function setting up access to a particular metadata object.
virtual StatusCode setAuxStore(const std::string &key, Details::IObjectManager &mgr, bool metadata)=0
Function connecting a DV object to its auxiliary store.
StatusCode record(T *obj, const std::string &key)
Add an output object to the event.
StatusCode keys(std::vector< std::string > &vkeys, bool metadata) const
Provide a list of all data object keys associated with a specific type.
std::unordered_map< std::string, std::string > m_nameRemapping
Container name re-mapping rules.
Object_t m_inputMetaObjects
Collection of all the managed input meta-objects.
Object_t m_outputObjects
Collection of all the managed output object.
Object_t m_outputMetaObjects
Collection of all the managed output meta-objects.
static TStore * store()
Access the currently active TStore object.
const ::TClass * getClass() const
A relatively simple transient store for objects created in analysis.
virtual const void * object() const =0
Function getting a const pointer to the object being handled.
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Convert a type_info to a normalized string representation (matching the names used in the root dictio...