Functions | |
| template<typename T > | |
| std::enable_if_t< std::is_base_of_v< TObject, T >, std::variant< T **, TString > > | GetInputObject (TEventCollection *col, const TString &name, const TString &expectedTypeName, const TString &elementTypeName="TObject") |
| Retrieve an object from TEventCollection with type validation. | |
| template<typename T > | |
| std::enable_if_t< std::is_base_of_v< TObject, T >, std::variant< T *, TString > > | GetParameterObject (TEventCollection *col, const TString &name, const TString &expectedTypeName, const TString &elementTypeName="art::TParameterObject") |
| Retrieves a parameter object from a TEventCollection. | |
| std::enable_if_t< std::is_base_of_v< TObject, T >, std::variant< T **, TString > > art::crib::util::GetInputObject | ( | TEventCollection * | col, |
| const TString & | name, | ||
| const TString & | expectedTypeName, | ||
| const TString & | elementTypeName = "TObject" ) |
Retrieve an object from TEventCollection with type validation.
This function checks if the specified object exists in the TEventCollection and verifies that its type matches the expected ROOT class type. If the object is of type TClonesArray, it further checks that the elements of the array match the specified element type.
col->GetObjectRef(name) is used to retrieve the object reference.expectedTypeName, an error message is returned.TClonesArray, the element type is verified using GetClass.| T | Expected type of the object, must derive from TObject. |
| col | Pointer to the TEventCollection. |
| name | Name of the object in the collection. |
| expectedTypeName | Expected ROOT class name of the object. |
| elementTypeName | (Optional) Expected type of elements if T is TClonesArray. |
Definition at line 44 of file TProcessorUtil.h.
| std::enable_if_t< std::is_base_of_v< TObject, T >, std::variant< T *, TString > > art::crib::util::GetParameterObject | ( | TEventCollection * | col, |
| const TString & | name, | ||
| const TString & | expectedTypeName, | ||
| const TString & | elementTypeName = "art::TParameterObject" ) |
Retrieves a parameter object from a TEventCollection.
| T | The type of the parameter object to retrieve. Must be derived from TObject. When T is TClonesArray, the element type is additionally validated. |
| col | Pointer to the TEventCollection from which the parameter object is obtained. |
| name | Name of the parameter object. |
| expectedTypeName | The expected type name for the parameter object. |
| elementTypeName | (Optional) For TClonesArray types, the expected type name for its elements (default is "art::TParameterObject"). |
The function retrieves the parameter object via col->GetInfo(name) and performs several checks:
Definition at line 98 of file TProcessorUtil.h.