#include <TFileMetadataICARUS.h>
Definition at line 34 of file TFileMetadataICARUS.h.
icarusutil::TFileMetadataICARUS::TFileMetadataICARUS |
( |
fhicl::ParameterSet const & |
pset, |
|
|
art::ActivityRegistry & |
reg |
|
) |
| |
void icarusutil::TFileMetadataICARUS::postBeginJob |
( |
| ) |
|
|
private |
Definition at line 99 of file TFileMetadataICARUS_service.cc.
101 std::cout <<
"TFileMetadataICARUS postBeginJob() begin" << std::endl;
106 art::ServiceHandle<art::FileCatalogMetadata> artmds;
108 art::FileCatalogMetadata::collection_type artmd;
109 artmds->getMetadata(artmd);
111 for(
auto const & d : artmd)
112 mdmap[d.first] = d.second;
114 std::map<std::string,std::string>::iterator it;
135 std::cout <<
"TFileMetadataICARUS postBeginJob() end" << std::endl;
then if[["$THISISATEST"==1]]
BEGIN_PROLOG could also be cout
void icarusutil::TFileMetadataICARUS::postBeginSubRun |
( |
art::SubRun const & |
subrun | ) |
|
|
private |
Definition at line 178 of file TFileMetadataICARUS_service.cc.
180 std::cout <<
"TFileMetadataICARUS postBeginSubRun() begin" << std::endl;
181 art::RunNumber_t run = sr.run();
182 art::SubRunNumber_t subrun = sr.subRun();
183 art::SubRunID srid = sr.id();
190 std::cout <<
"TFileMetadataICARUS postBeginSubRun() end" << std::endl;
BEGIN_PROLOG could also be cout
void icarusutil::TFileMetadataICARUS::postCloseInputFile |
( |
| ) |
|
|
private |
Definition at line 195 of file TFileMetadataICARUS_service.cc.
197 std::cout <<
"TFileMetadataICARUS postCloseInputFile() begin" << std::endl;
200 art::ServiceHandle<icarusutil::FileCatalogMetadataICARUS> paramhandle;
213 char endbuf[80], startbuf[80];
216 strftime(endbuf,
sizeof(endbuf),
"%Y-%m-%dT%H:%M:%S",&tstruct);
218 strftime(startbuf,
sizeof(startbuf),
"%Y-%m-%dT%H:%M:%S",&tstruct);
225 std::ofstream jsonfile;
227 jsonfile<<
"{\n \"application\": {\n \"family\": "<<std::get<0>(
md.
fapplication)<<
",\n \"name\": ";
234 jsonfile<<
"\"group\": "<<
md.
fgroup<<
",\n ";
239 jsonfile<<
"\"parents\": [\n";
241 std::cout<<
"Parent " << c <<
": " << parent << std::endl;
243 size_t n = parent.find_last_of(
'/');
244 size_t f1 = (n == std::string::npos ? 0 : n+1);
245 jsonfile<<
" {\n \"file_name\": \""<<parent.substr(f1)<<
"\"\n }";
247 else jsonfile<<
",\n";
252 jsonfile<<
"\"runs\": [\n";
255 jsonfile<<
" [\n "<<std::get<0>(t)<<
",\n "<<std::get<1>(t)<<
",\n "<<std::get<2>(t)<<
"\n ]";
257 else jsonfile<<
",\n";
270 jsonfile<<
"\"start_time\": \""<<startbuf<<
"\",\n";
271 jsonfile<<
"\"end_time\": \""<<endbuf<<
"\"\n";
280 std::cout <<
"TFileMetadataICARUS postCloseInputFile() end" << std::endl;
BEGIN_PROLOG could also be cout
void icarusutil::TFileMetadataICARUS::postEvent |
( |
art::Event const & |
ev, |
|
|
art::ScheduleContext |
|
|
) |
| |
|
private |
Definition at line 153 of file TFileMetadataICARUS_service.cc.
155 std::cout <<
"TFileMetadataICARUS postEvent() begin" << std::endl;
156 art::RunNumber_t run =
evt.
run();
157 art::SubRunNumber_t subrun =
evt.
subRun();
158 art::EventNumber_t
event =
evt.
event();
159 art::SubRunID srid =
evt.id().subRunID();
173 std::cout <<
"TFileMetadataICARUS postEvent() end" << std::endl;
BEGIN_PROLOG could also be cout
void icarusutil::TFileMetadataICARUS::postOpenInputFile |
( |
std::string const & |
fn | ) |
|
|
private |
art::FileStatsCollector icarusutil::TFileMetadataICARUS::fFileStats |
|
private |
bool icarusutil::TFileMetadataICARUS::fGenerateTFileMetadata |
|
private |
std::string icarusutil::TFileMetadataICARUS::fJSONFileName |
|
private |
std::string icarusutil::TFileMetadataICARUS::frunType |
|
private |
std::set<art::SubRunID> icarusutil::TFileMetadataICARUS::fSubRunNumbers |
metadata icarusutil::TFileMetadataICARUS::md |
std::map<std::string,std::string> icarusutil::TFileMetadataICARUS::mdmap |
The documentation for this class was generated from the following files: