13 #include <TApplication.h>
29 static std::atomic<size_t> sMessageSourceWidth = 25;
33 return Init( appname, 0, 0 );
41 if( ! sInitialised.test_and_set() ) {
44 ::SetErrorHandler( ErrorHandler );
52 static ::TApplication sApplication( appname,
argc,
argv );
54 ::TApplication::CreateApplication();
61 for (
const char *
name : {
62 "xAOD::TruthParticle_v1",
64 "xAOD::CaloCluster_v1",
65 "xAOD::TrackParticle_v1",
71 "xAOD::TrigElectron_v1",
72 "xAOD::L2CombinedMuon_v1",
73 "xAOD::Particle_v1"}) {
76 static constexpr Bool_t LOAD = kTRUE;
77 static constexpr Bool_t SILENT = kTRUE;
78 TClass::GetClass(
name, LOAD, SILENT );
82 ::Info( appname,
"Environment initialised for data access" );
86 return StatusCode::SUCCESS;
91 sMessageSourceWidth =
value;
114 static const char*
const DICT_WARNING_SOURCE =
"TClass::Init";
119 if( (
level == kWarning ) &&
120 ( ! strcmp( location, DICT_WARNING_SOURCE ) ) ) {
125 const char* msgLevel = 0;
126 if(
level >= kFatal ) {
130 }
else if(
level >= kWarning ) {
131 msgLevel =
"WARNING";
138 std::string
source( location );
139 if(
source.size() > sMessageSourceWidth ) {
140 source.resize( sMessageSourceWidth - 3 );
145 std::ostringstream
output;
146 output << std::setiosflags( std::ios::left )
147 << std::setw( sMessageSourceWidth ) <<
source <<
" " << msgLevel
149 std::cout <<
output.str() << std::endl;
157 std::cout << std::endl <<
"Aborting..." << std::endl;
159 gSystem->StackTrace();