SimG4Core
Application
src
CustomUIsessionThreadPrefix.cc
Go to the documentation of this file.
1
#include "
SimG4Core/Application/interface/CustomUIsessionThreadPrefix.h
"
2
3
CustomUIsessionThreadPrefix::CustomUIsessionThreadPrefix
(
const
std::string
& threadPrefix,
int
threadId)
4
:
CustomUIsession
(), m_threadPrefix(threadPrefix +
std
::to_string(threadId) +
">> "
) {}
5
6
CustomUIsessionThreadPrefix::~CustomUIsessionThreadPrefix
() {}
7
8
namespace
{
9
std::string
addThreadPrefix(
const
std::string
& threadPrefix,
const
std::string
str
) {
10
// Add thread prefix to each line beginning
11
std::string
ret
;
12
std::string::size_type
beg = 0;
13
std::string::size_type
end
=
str
.find(
'\n'
);
14
while
(
end
!= std::string::npos) {
15
ret
+= threadPrefix +
str
.substr(beg,
end
- beg) +
"\n"
;
16
beg =
end
+ 1;
17
end
=
str
.find(
'\n'
, beg);
18
}
19
ret
+= threadPrefix +
str
.substr(beg,
end
);
20
return
ret
;
21
}
22
}
// namespace
23
24
G4int
CustomUIsessionThreadPrefix::ReceiveG4cout
(
const
G4String& coutString) {
25
//edm::LogInfo("G4cout") << addThreadPrefix(m_threadPrefix, trim(coutString));
26
edm::LogVerbatim
(
"G4cout"
) << addThreadPrefix(
m_threadPrefix
,
trim
(coutString));
27
return
0;
28
}
29
30
G4int
CustomUIsessionThreadPrefix::ReceiveG4cerr
(
const
G4String& cerrString) {
31
edm::LogWarning
(
"G4cerr"
) << addThreadPrefix(
m_threadPrefix
,
trim
(cerrString));
32
return
0;
33
}
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition:
runTheMatrix.py:355
CustomUIsessionThreadPrefix::CustomUIsessionThreadPrefix
CustomUIsessionThreadPrefix(const std::string &threadPrefix, int threadId)
Definition:
CustomUIsessionThreadPrefix.cc:3
CustomUIsession::trim
std::string trim(const std::string &str)
Definition:
CustomUIsession.cc:29
CustomUIsessionThreadPrefix::m_threadPrefix
const std::string m_threadPrefix
Definition:
CustomUIsessionThreadPrefix.h:22
end
#define end
Definition:
vmac.h:39
trigger::size_type
uint16_t size_type
Definition:
TriggerTypeDefs.h:18
str
#define str(s)
Definition:
TestProcessor.cc:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition:
MessageLogger.h:141
CustomUIsessionThreadPrefix::ReceiveG4cerr
G4int ReceiveG4cerr(const G4String &cerrString) override
Definition:
CustomUIsessionThreadPrefix.cc:30
edm::LogVerbatim
Definition:
MessageLogger.h:297
std
Definition:
JetResolutionObject.h:76
CustomUIsession
Definition:
CustomUIsession.h:13
CustomUIsessionThreadPrefix.h
CustomUIsessionThreadPrefix::~CustomUIsessionThreadPrefix
~CustomUIsessionThreadPrefix() override
Definition:
CustomUIsessionThreadPrefix.cc:6
CustomUIsessionThreadPrefix::ReceiveG4cout
G4int ReceiveG4cout(const G4String &coutString) override
Definition:
CustomUIsessionThreadPrefix.cc:24
Generated for CMSSW Reference Manual by
1.8.16