38 template <
typename S,
typename T>
41 if(f.fileHasBeenClosed) {
42 os <<
"\n<State Value=\"closed\"/>";
44 os <<
"\n<State Value=\"open\"/>";
47 os <<
"\n<LFN>" << TiXmlText(f.logicalFileName) <<
"</LFN>";
48 os <<
"\n<PFN>" << TiXmlText(f.physicalFileName) <<
"</PFN>";
49 os <<
"\n<Catalog>" << TiXmlText(f.catalog) <<
"</Catalog>";
50 os <<
"\n<ModuleLabel>" << TiXmlText(f.moduleLabel) <<
"</ModuleLabel>";
51 os <<
"\n<GUID>" << f.guid <<
"</GUID>";
53 for(
auto const&
branch : f.branchNames) {
54 os <<
"\n <Branch>" << TiXmlText(
branch) <<
"</Branch>";
56 os <<
"\n</Branches>";
67 os <<
"\n<InputFile>";
69 os <<
"\n<InputType>" << f.
inputType <<
"</InputType>";
71 <<
"</InputSourceClass>";
79 os <<
"\n<OutputModuleClass>" 81 <<
"</OutputModuleClass>";
82 os <<
"\n<TotalEvents>" 84 <<
"</TotalEvents>\n";
88 os <<
"\n<BranchHash>" 103 os <<
" <LumiSection ID=\"" << il.first <<
"\"/>\n";
106 os <<
" <LumiSection ID=\"" << il.first <<
"\" NEvents=\""<<il.second<<
"\"/>\n";
129 <<
"Access reported for secondary source input file with token " 131 <<
" but no matching input file is found\n";
137 <<
"Access reported for input file with token " 139 <<
" but no matching input file is found\n";
145 <<
"Access reported for input file with token " 147 <<
" after this file has been closed.\n" 148 <<
"File record follows:\n" 158 <<
"Access reported for output file with token " 160 <<
" but no matching output file is found\n";
164 <<
"Access reported for output file with token " 166 <<
" after this file has been closed.\n" 167 <<
"File record follows:\n" 184 outputFile.contributingInputsSecSource.push_back(t);
201 for(
auto const& runReport : f.runReports) {
202 *
ost_ << runReport.second;
204 *
ost_ <<
"\n</Runs>\n";
205 *
ost_ <<
"</InputFile>\n";
230 for(
auto const& runReport : f.runReports) {
231 *
ost_ << runReport.second;
233 *
ost_ <<
"\n</Runs>\n";
235 *
ost_ <<
"\n<Inputs>";
236 for(
auto token : f.contributingInputs) {
238 *
ost_ <<
"\n<Input>";
242 *
ost_ <<
"\n</Input>";
244 for(
auto token : f.contributingInputsSecSource) {
246 *
ost_ <<
"\n<Input>";
250 *
ost_ <<
"\n</Input>";
252 *
ost_ <<
"\n</Inputs>";
253 *
ost_ <<
"\n</File>\n";
281 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
282 if(iter == theMap.end() || runNumber < iter->first) {
290 std::map<RunNumber, RunReport>& theMap =
inputFile.runReports;
291 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
292 if(iter == theMap.end() || runNumber < iter->first) {
301 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
302 if(iter == theMap.end() || runNumber < iter->first) {
305 iter->second.lumiSectionsToNEvents[lumiSect]+=
nEvents;
312 std::map<RunNumber, RunReport>& theMap =
inputFile.runReports;
313 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
314 if(iter == theMap.end() || runNumber < iter->first) {
326 *(
impl_->ost_) <<
"</FrameworkJobReport>\n" << std::flush;
336 *(
impl_->ost_) <<
"<FrameworkJobReport>\n";
348 std::vector<std::string>
const& branchNames) {
354 if (inputType ==
"mixingFiles") {
358 newToken = itr -
impl_->inputFilesSecSource_.begin();
360 if (inputType ==
"secondaryFiles") {
363 impl_->inputFiles_.emplace_back();
364 newFile = &
impl_->inputFiles_.back();
365 newToken =
impl_->inputFiles_.size() - 1;
369 impl_->lastOpenedPrimaryInputFile_ =
impl_->inputFiles_.size() - 1;
377 newFile->
guid = guid;
384 impl_->insertInputForOutputs(theInputType, newToken);
405 impl_->writeInputFile(f);
409 impl_->writeInputFile(f);
423 std::vector<std::string>
const& branchNames) {
424 auto itr =
impl_->outputFiles_.emplace_back();
442 if(!
impl_->inputFiles_[
i].fileHasBeenClosed) {
447 if(!
impl_->inputFilesSecSource_[
i].fileHasBeenClosed) {
451 return itr -
impl_->outputFiles_.begin();
464 impl_->writeOutputFile(f);
473 msg <<
"<SkippedEvent Run=\"" << run <<
"\"";
474 msg <<
" Event=\"" <<
event <<
"\" />\n";
488 impl_->associateLumiSection(token, run, lumiSectId,nEvents);
493 impl_->associateInputLumiSection(run, lumiSectId);
498 impl_->associateRun(token, run);
503 impl_->associateInputRun(run);
512 msg <<
"<AnalysisFile>\n" 513 <<
" <FileName>" << TiXmlText(fileName) <<
"</FileName>\n";
515 typedef std::map<std::string, std::string>::const_iterator const_iterator;
516 for(const_iterator
pos = fileData.begin(), posEnd = fileData.end();
pos != posEnd; ++
pos) {
517 msg <<
" <" <<
pos->first
518 <<
" Value=\"" <<
pos->second <<
"\" />" 521 msg <<
"</AnalysisFile>\n";
530 int const& exitCode) {
535 msg <<
"<FrameworkError ExitStatus=\""<< exitCode
536 <<
"\" Type=\"" << shortDesc <<
"\" >\n";
537 msg <<
"<![CDATA[\n" << longDesc <<
"\n]]>\n";
538 msg <<
"</FrameworkError>\n";
549 TiXmlElement
skipped(
"SkippedFile");
550 skipped.SetAttribute(
"Pfn", pfn);
551 skipped.SetAttribute(
"Lfn", lfn);
554 msg << skipped <<
"\n";
564 TiXmlElement
fallback(
"FallbackAttempt");
565 fallback.SetAttribute(
"Pfn", pfn);
566 fallback.SetAttribute(
"Lfn", lfn);
569 msg << fallback <<
"\n";
570 msg <<
"<![CDATA[\n" << err <<
"\n]]>\n";
580 msg <<
"<MemoryService>\n";
582 typedef std::vector<std::string>::const_iterator const_iterator;
583 for(const_iterator
pos = memoryData.begin(), posEnd = memoryData.end();
pos != posEnd; ++
pos) {
586 msg <<
"</MemoryService>\n";
595 msg <<
"<MessageSummary>\n";
596 typedef std::map<std::string, double>::const_iterator const_iterator;
597 for(const_iterator
pos = messageData.begin(), posEnd = messageData.end();
pos != posEnd; ++
pos) {
598 msg <<
" <" <<
pos->first
599 <<
" Value=\"" <<
pos->second <<
"\" />" 602 msg <<
"</MessageSummary>\n";
609 if(
impl_->printedReadBranches_)
return;
610 impl_->printedReadBranches_ =
true;
612 std::ostream& ost = *(
impl_->ost_);
613 ost <<
"<ReadBranches>\n";
614 for(
auto const& iBranch :
impl_->readBranches_) {
615 TiXmlElement
branch(
"Branch");
616 branch.SetAttribute(
"Name", iBranch.first);
617 branch.SetAttribute(
"ReadCount", iBranch.second);
618 ost << branch <<
"\n";
620 for(
auto const& iBranch :
impl_->readBranchesSecFile_) {
621 TiXmlElement
branch(
"Branch");
622 branch.SetAttribute(
"Name", iBranch.first);
623 branch.SetAttribute(
"ReadCount", iBranch.second);
624 ost << branch <<
"\n";
626 ost <<
"</ReadBranches>\n";
627 if(!
impl_->readBranchesSecSource_.empty()) {
628 ost <<
"<SecondarySourceReadBranches>\n";
629 for(
auto const& iBranch :
impl_->readBranchesSecSource_) {
630 TiXmlElement
branch(
"Branch");
631 branch.SetAttribute(
"Name", iBranch.first);
632 branch.SetAttribute(
"ReadCount", iBranch.second.value().load());
633 ost << branch <<
"\n";
635 ost <<
"</SecondarySourceReadBranches>\n";
645 std::set<std::string>
const& clonedBranches =
impl_->inputFiles_.at(
impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
646 if(clonedBranches.find(branchName) == clonedBranches.end()) {
647 ++
impl_->readBranches_[branchName];
650 ++
impl_->readBranchesSecFile_[branchName];
652 ++
impl_->readBranchesSecSource_[branchName].value();
658 std::set<std::string>& clonedBranches =
impl_->inputFiles_.at(
impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
659 for(std::set<std::string>::const_iterator it = fastClonedBranches.begin(), itEnd = fastClonedBranches.end();
661 if(clonedBranches.insert(*it).second) {
672 msg <<
"<RandomServiceStateFile>\n" 673 << TiXmlText(name) <<
"\n" 674 <<
"</RandomServiceStateFile>\n";
682 std::map<std::string, std::string>
const& metrics) {
685 msg <<
"<PerformanceReport>\n" 686 <<
" <PerformanceSummary Metric=\"" << metricClass <<
"\">\n";
688 typedef std::map<std::string, std::string>::const_iterator const_iterator;
689 for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
690 msg <<
" <Metric Name=\"" << iter->first <<
"\" " 691 <<
"Value=\"" << iter->second <<
"\"/>\n";
694 msg <<
" </PerformanceSummary>\n" 695 <<
"</PerformanceReport>\n";
704 std::map<std::string, std::string>
const& metrics) {
707 msg <<
"<PerformanceReport>\n" 708 <<
" <PerformanceModule Metric=\"" << metricClass <<
"\" " 709 <<
" Module=\"" << moduleName <<
"\" >\n";
711 typedef std::map<std::string, std::string>::const_iterator const_iterator;
712 for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
713 msg <<
" <Metric Name=\"" << iter->first <<
"\" " 714 <<
"Value=\"" << iter->second <<
"\"/>\n";
717 msg <<
" </PerformanceModule>\n" 718 <<
"</PerformanceReport>\n";
726 std::ostringstream
msg;
729 for(
auto const&
f :
impl_->outputFiles_) {
734 msg <<
"\n<LumiSections>";
736 typedef std::vector<JobReport::Token>::iterator iterator;
737 for(
auto const& iInput : f.contributingInputs) {
738 auto const& inpFile =
impl_->inputFiles_[iInput];
740 msg <<
"\n <LFN>" << TiXmlText(inpFile.logicalFileName) <<
"</LFN>";
741 msg <<
"\n <PFN>" << TiXmlText(inpFile.physicalFileName) <<
"</PFN>";
742 msg <<
"\n <FastCopying>" <<
findOrDefault(f.fastCopyingInputs, inpFile.physicalFileName) <<
"</FastCopying>";
745 msg <<
"\n</Inputs>";
void reportSkippedFile(std::string const &pfn, std::string const &lfn)
std::string outputModuleClassName
std::string physicalFileName
void associateRun(JobReport::Token token, unsigned int runNumber)
void reportMemoryInfo(std::vector< std::string > const &memoryData)
void reportInputRunNumber(unsigned int run)
void eventReadFromFile(InputType inputType, Token fileToken)
void reportFallbackAttempt(std::string const &pfn, std::string const &lfn, std::string const &err)
unsigned long long EventNumber_t
std::map< std::string, bool > fastCopyingInputs
std::string logicalFileName
void reportFastCopyingStatus(Token t, std::string const &inputFileName, bool fastCopying)
void reportRunNumber(JobReport::Token token, unsigned int run)
void reportRandomStateFile(std::string const &name)
S & print(S &os, JobReport::InputFile const &f)
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Token inputFileOpened(std::string const &physicalFileName, std::string const &logicalFileName, std::string const &catalog, std::string const &inputType, std::string const &inputSourceClassName, std::string const &moduleLabel, std::string const &guid, std::vector< std::string > const &branchNames)
std::vector< InputFile > inputFiles_
void reportPerformanceForModule(std::string const &metricClass, std::string const &moduleName, std::map< std::string, std::string > const &metrics)
std::vector< Token > contributingInputs
void reportSkippedEvent(RunNumber_t run, EventNumber_t event)
void insertInputForOutputs(InputType inputType, Token t)
std::string moduleName(Provenance const &provenance)
void writeInputFile(InputFile const &f)
void reportInputLumiSection(unsigned int run, unsigned int lumiSectId)
void reportPerformanceSummary(std::string const &metricClass, std::map< std::string, std::string > const &metrics)
Token outputFileOpened(std::string const &physicalFileName, std::string const &logicalFileName, std::string const &catalog, std::string const &outputModuleClassName, std::string const &moduleLabel, std::string const &guid, std::string const &dataType, std::string const &branchHash, std::vector< std::string > const &branchNames)
edm::propagate_const< std::ostream * > ost_
void reportError(std::string const &shortDesc, std::string const &longDesc, int const &exitCode)
void associateInputRun(unsigned int runNumber)
S & formatFile(T const &f, S &os)
void reportReadBranch(InputType inputType, std::string const &branchName)
Inform the job report that a branch has been read.
std::size_t numEventsWritten
void reportFastClonedBranches(std::set< std::string > const &fastClonedBranches, long long nEvents)
Inform the job report that branches have been fast Cloned.
Value const & findOrDefault(std::map< Key, Value > const &m, Key const &k, Value const &defaultValue)
void eventWrittenToFile(Token fileToken, RunNumber_t run, EventNumber_t event)
tbb::concurrent_vector< InputFile > inputFilesSecSource_
void reportMessageInfo(std::map< std::string, double > const &messageData)
double S(const TLorentzVector &, const TLorentzVector &)
void associateLumiSection(JobReport::Token token, unsigned int runNumber, unsigned int lumiSection, unsigned long nEvents)
std::string dumpFiles(void)
debug/test util
void reportAnalysisFile(std::string const &fileName, std::map< std::string, std::string > const &fileData)
void outputFileClosed(Token fileToken)
void writeOutputFile(OutputFile const &f)
std::map< unsigned int, unsigned long > lumiSectionsToNEvents
InputFile & getInputFileForToken(InputType inputType, Token t)
tbb::concurrent_vector< OutputFile > outputFiles_
void reportDataType(Token fileToken, std::string const &dataType)
tbb::concurrent_vector< Token > contributingInputsSecSource
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
void inputFileClosed(InputType inputType, Token fileToken)
void associateInputLumiSection(unsigned int runNumber, unsigned int lumiSection)
void reportReadBranches()
OutputFile & getOutputFileForToken(Token t)
void reportLumiSection(JobReport::Token token, unsigned int run, unsigned int lumiSectId, unsigned long nEvents=0)