  | 
  
    ATLAS Offline Software
    
   | 
 
 
 
 
Go to the documentation of this file.
   14 #include <TVirtualCollectionProxy.h> 
   33    static std::map< SG::auxid_t, ::TClass* > s_dictCache =
 
   34       std::map< SG::auxid_t, ::TClass* >();
 
   37    : ::TObject(), m_stopOnError( kFALSE ), m_ignoredVariables(),
 
   38      m_orpannedContainers() {
 
   48       if( ! 
event.getEntries() ) {
 
   49          return StatusCode::SUCCESS;
 
   53       if( 
event.getEntry( 0 ) < 0 ) {
 
   55                 XAOD_MESSAGE( 
"Couldn't load event 0 from the input" ) );
 
   56          return StatusCode::FAILURE;
 
   60       std::set< std::string > containerNames;
 
   64       for( ; ef_itr != ef_end; ++ef_itr ) {
 
   67          if( ef_itr->first.find( 
"Aux." ) == ( ef_itr->first.size() - 4 ) ) {
 
   70          if( ef_itr->second.parentName() != 
"" ) {
 
   80          containerNames.insert( ef_itr->first );
 
   84       const ::Long64_t 
entries = 
event.getEntries();
 
   90                    XAOD_MESSAGE( 
"Failed to load event %i from the input" ),
 
   91                    static_cast< int >( 
entry ) );
 
   92             return StatusCode::FAILURE;
 
   96          if( ! ( 
entry % 100 ) ) {
 
   97             Info( 
"check", 
"Now validating entry %i / %i",
 
   98                   static_cast< int >( 
entry ), 
static_cast< int >( 
entries ) );
 
  102          for( 
const std::string& cname : containerNames ) {
 
  118                          cname.c_str(), 
static_cast< int >( 
entry ) );
 
  125       return StatusCode::SUCCESS;
 
  158                                              const std::string& 
name ) {
 
  170                Error( 
"checkContainer",
 
  175                return StatusCode::FAILURE;
 
  177             return StatusCode::SUCCESS;
 
  184             return StatusCode::SUCCESS;
 
  189       const size_t size = 
vec.size_v();
 
  200          const void* vecPtr = ioStore->
getIOData( auxid );
 
  202             Error( 
"checkContainer",
 
  205             return StatusCode::FAILURE;
 
  210          auto itr = s_dictCache.find( auxid );
 
  211          if( itr != s_dictCache.end() ) {
 
  214             const std::type_info* typeId = reg.
getVecType( auxid );
 
  216                Error( 
"checkContainer",
 
  219                       reg.
getName( auxid ).c_str() );
 
  220                return StatusCode::FAILURE;
 
  222             cl = ::TClass::GetClass( *typeId );
 
  223             s_dictCache[ auxid ] = 
cl;
 
  226             Error( 
"checkContainer",
 
  227                    XAOD_MESSAGE( 
"Couldn't get dictionary for variable %s" ),
 
  228                    reg.
getName( auxid ).c_str() );
 
  229             return StatusCode::FAILURE;
 
  233          ::TVirtualCollectionProxy* 
proxy = 
cl->GetCollectionProxy();
 
  235             Error( 
"checkContainer",
 
  238                    reg.
getName( auxid ).c_str() );
 
  239             return StatusCode::FAILURE;
 
  243          proxy->PushProxy( ( 
void* ) vecPtr );
 
  244          const size_t varSize = 
static_cast< size_t >( 
proxy->Size() );
 
  248          if( ( 
size != varSize ) &&
 
  251             Error( 
"checkContainer",
 
  252                    XAOD_MESSAGE( 
"%s.size() (%i) != %sAux.%s.size() (%i)" ),
 
  253                    name.c_str(), 
static_cast< int >( 
size ),
 
  255                    static_cast< int >( varSize ) );
 
  256             return StatusCode::FAILURE;
 
  261       return StatusCode::SUCCESS;
 
  
#define RETURN_CHECK(CONTEXT, EXP)
Helper macro for checking return codes in a compact form in the code.
 
void setIgnoredVariables(const std::set< std::string > &value)
Set the list of variables to be ignored in the test.
 
static AuxTypeRegistry & instance()
Return the singleton registry instance.
 
::Bool_t stopOnError() const
Check whether the validation will stop when an error is found.
 
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
 
std::set< std::string > m_orpannedContainers
List of containers without an auxiliary store.
 
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
 
std::vector< size_t > vec
 
const std::set< std::string > & ignoredVariables() const
Get the list of variables which are ignored in the test.
 
Manage index tracking and synchronization of auxiliary data.
 
Manage index tracking and synchronization of auxiliary data.
 
Interface providing I/O for a generic auxiliary store.
 
Handle mappings between names and auxid_t.
 
ClassImp(xAOD::TFileChecker) namespace xAOD
 
size_t auxid_t
Identifier for a particular aux data item.
 
Interface providing I/O for a generic auxiliary store.
 
::StatusCode StatusCode
StatusCode definition for legacy code.
 
Tool for running sanity checks on xAOD files.
 
TFileChecker()
Default constructor.
 
const std::type_info * getVecType(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
 
void setStopOnError(::Bool_t value)
Set whether the validation should stop when an error is found.
 
void addIgnoredVariable(const std::string &name)
Add a variable to be ignored in the test.
 
StatusCode checkContainer(const SG::AuxVectorBase &vec, const std::string &name)
Check the health of a container.
 
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
 
std::set< std::string > m_ignoredVariables
List of variables to ignore in the test.
 
::Bool_t m_stopOnError
Stop the validation when an issue is found?
 
EventFormat_v1 EventFormat
Definition of the current event format version.
 
Handle mappings between names and auxid_t.
 
A set of aux data identifiers.
 
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()) ]
 
StatusCode check(TEvent &event)
Execute all sanity checks on a given file.