ATLAS Offline Software
Loading...
Searching...
No Matches
han_config_print.cxx File Reference
#include <iostream>
#include <string>
#include <cstdlib>
#include <TFile.h>
#include <TKey.h>
#include "CxxUtils/checker_macros.h"
#include "DataQualityInterfaces/HanConfigGroup.h"
#include "DataQualityInterfaces/HanConfigMetadata.h"
#include "DataQualityInterfaces/ConditionsSingleton.h"
Include dependency graph for han_config_print.cxx:

Go to the source code of this file.

Functions

int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[])

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

int main ATLAS_NOT_THREAD_SAFE ( int argc,
char * argv[] )

Definition at line 36 of file han_config_print.cxx.

37{
38 CmdLineArgs arg;
39 int rc = arg.parse( argc, argv );
40 if (rc!=0) return rc;
41
43 //std::cout<<__PRETTY_FUNCTION__<<"Input Conditions="<<dqi::ConditionsSingleton::getInstance().getCondition()
44 // <<std::endl;
45 std::string configName( arg.hconfig );
46 TFile* config = TFile::Open( configName.c_str() );
47 if( config == 0 ) {
48 std::cerr << "Cannot open file \"" << configName << "\"\n";
49 return 1;
50 }
51
52 TKey* key = config->FindKey("HanMetadata");
53 if (key) {
54 std::cout << "Metadata:\n";
55 TDirectory* metadatadir = dynamic_cast<TDirectory*>(key->ReadObj());
56 if (! metadatadir) {
57 std::cerr << "Metadata directory is malformed\n";
58 return 1;
59 }
60 dqi::HanConfigMetadata* hcm(0); TKey* mdkey(0);
61 TIter next(metadatadir->GetListOfKeys());
62 while ((mdkey = dynamic_cast<TKey*>(next()))) {
63 metadatadir->GetObject(mdkey->GetName(), hcm);
64 if (hcm) {
65 std::cout << *hcm << std::endl;
66 }
67 }
68 delete metadatadir;
69 }
70
71 key = config->FindKey("top_level");
72 if( key == 0 ) {
73 std::cerr << "Cannot find configuration in file \"" << configName << "\"\n";
74 return 1;
75 }
76
77 dqi::HanConfigGroup* g = dynamic_cast<dqi::HanConfigGroup*>( key->ReadObj() );
78 if( g == 0 ) {
79 std::cerr << "Cannot find configuration in file \"" << configName << "\"\n";
80 return 1;
81 }
82
83 std::cout << g;
84 return 0;
85}
static Double_t rc
static ConditionsSingleton & getInstance()
void setCondition(const std::string &c)