 |
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include <TVirtualCollectionProxy.h>
32 namespace Experimental {
35 static std::map< SG::auxid_t, ::TClass* > s_dictCache =
36 std::map< SG::auxid_t, ::TClass* >();
39 : ::TObject(), m_stopOnError( kFALSE ), m_ignoredVariables(),
40 m_orpannedContainers() {
53 return StatusCode::SUCCESS;
58 XAOD_MESSAGE(
"Couldn't load event 0 from the input" ) );
59 return StatusCode::FAILURE;
63 std::set< std::string > containerNames;
70 for( ; ef_itr != ef_end; ++ef_itr ) {
73 if( ef_itr->first.find(
"Aux." ) == ( ef_itr->first.size() - 4 ) ) {
76 if( ef_itr->second.parentName() !=
"" ) {
86 containerNames.insert( ef_itr->first );
90 const ::Long64_t
entries =
event.getEntries();
96 XAOD_MESSAGE(
"Failed to load event %i from the input" ),
97 static_cast< int >(
entry ) );
98 return StatusCode::FAILURE;
102 if( ! (
entry % 100 ) ) {
103 Info(
"check",
"Now validating entry %i / %i",
104 static_cast< int >(
entry ),
static_cast< int >(
entries ) );
108 for(
const std::string& cname : containerNames ) {
124 cname.c_str(),
static_cast< int >(
entry ) );
131 return StatusCode::SUCCESS;
164 const std::string&
name ) {
176 Error(
"checkContainer",
181 return StatusCode::FAILURE;
183 return StatusCode::SUCCESS;
190 return StatusCode::SUCCESS;
195 const size_t size =
vec.size_v();
206 const void* vecPtr = ioStore->
getIOData( auxid );
208 Error(
"checkContainer",
211 return StatusCode::FAILURE;
216 auto itr = s_dictCache.find( auxid );
217 if( itr != s_dictCache.end() ) {
220 const std::type_info* typeId = reg.
getVecType( auxid );
222 Error(
"checkContainer",
225 reg.
getName( auxid ).c_str() );
226 return StatusCode::FAILURE;
228 cl = ::TClass::GetClass( *typeId );
229 s_dictCache[ auxid ] =
cl;
232 Error(
"checkContainer",
233 XAOD_MESSAGE(
"Couldn't get dictionary for variable %s" ),
234 reg.
getName( auxid ).c_str() );
235 return StatusCode::FAILURE;
239 ::TVirtualCollectionProxy*
proxy =
cl->GetCollectionProxy();
241 Error(
"checkContainer",
244 reg.
getName( auxid ).c_str() );
245 return StatusCode::FAILURE;
249 proxy->PushProxy( (
void* ) vecPtr );
250 const size_t varSize =
static_cast< size_t >(
proxy->Size() );
254 if( (
size != varSize ) &&
257 Error(
"checkContainer",
258 XAOD_MESSAGE(
"%s.size() (%i) != %sAux.%s.size() (%i)" ),
259 name.c_str(),
static_cast< int >(
size ),
261 static_cast< int >( varSize ) );
262 return StatusCode::FAILURE;
267 return StatusCode::SUCCESS;
void setStopOnError(::Bool_t value)
Set whether the validation should stop when an error is found.
#define RETURN_CHECK(CONTEXT, EXP)
Helper macro for checking return codes in a compact form in the code.
::Bool_t stopOnError() const
Check whether the validation will stop when an error is found.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
void addIgnoredVariable(const std::string &name)
Add a variable to be ignored in the test.
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
std::vector< size_t > vec
Manage index tracking and synchronization of auxiliary data.
StatusCode check(REvent &event)
Execute all sanity checks on a given file.
Manage index tracking and synchronization of auxiliary data.
Interface providing I/O for a generic auxiliary store.
Handle mappings between names and auxid_t.
const std::set< std::string > & ignoredVariables() const
Get the list of variables which are ignored in the test.
PyObject * contains(PyObject *tp, PyObject *pykey)
size_t auxid_t
Identifier for a particular aux data item.
POOL::TEvent event(POOL::TEvent::kClassAccess)
StatusCode checkContainer(const SG::AuxVectorBase &vec, const std::string &name)
Check the health of a container.
Interface providing I/O for a generic auxiliary store.
::StatusCode StatusCode
StatusCode definition for legacy code.
void setIgnoredVariables(const std::set< std::string > &value)
Set the list of variables to be ignored in the test.
std::set< std::string > m_orpannedContainers
List of containers without an auxiliary store.
const std::type_info * getVecType(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
::Bool_t m_stopOnError
Stop the validation when an issue is found?
RFileChecker()
Default constructor.
ClassImp(xAOD::Experimental::RFileChecker) namespace xAOD
std::set< std::string > m_ignoredVariables
List of variables to ignore in the test.
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
StatusCode retrieve(const T *&obj)
EventFormat_v1 EventFormat
Definition of the current event format version.
Handle mappings between names and auxid_t.
A set of aux data identifiers.
Tool for running sanity checks on xAOD files.
Interface for const operations on an auxiliary store.
Interface for const operations on an auxiliary store.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]