17 #include <sys/types.h> 23 std::string const& defPath,
std::string const defGroup,
bool strictChecking,
bool useSource,
bool useDefinition)
25 strictChecking_(strictChecking),
26 useSource_(useSource),
27 useDefinition_(useDefinition),
41 : strictChecking_(strictChecking), useSource_(useSource), useDefinition_(useDefinition), nStreams_(1), dpd_(dpd) {
69 unsigned int*
nBins) {
71 dp->trackMonitorable(newMonitorable, NAifZeroUpdates);
83 dp->trackMonitorable(newMonitorable,
false);
89 std::vector<unsigned int>*
inputs,
91 unsigned int*
nBins) {
102 std::vector<AtomicMonUInt*>*
inputs,
103 bool NAifZeroUpdates,
104 unsigned int*
nBins) {
109 dp->trackVectorUIntAtomic(
name,
inputs, NAifZeroUpdates);
117 std::vector<std::string>
const& jsonNames =
dpd_->
getNames();
122 std::map<unsigned int, bool> hasJson;
123 for (
unsigned int i = 0;
i < jsonNames.size();
i++) {
124 bool notFoundVar =
true;
152 std::map<unsigned int, bool> fhasJson;
153 for (
unsigned int i = 0;
i < fjsonNames.size();
i++) {
154 bool notFoundVar =
true;
166 bool notFoundVarSlow =
true;
171 notFoundVarSlow =
false;
178 if (notFoundVarSlow) {
217 std::stringstream
ss;
219 for (
unsigned int j = 0;
j < monSize;
j++) {
232 for (
const auto& csvString : csvs)
241 return dataPoints_[
it->second]->mergeAndRetrieveValue(forLumi);
246 <<
") in lumisection ";
264 dp->discardCollected(forLumi);
268 std::stringstream hpid;
269 int pid = (
int)getpid();
271 gethostname(hostname,
sizeof hostname);
272 hpid << hostname <<
"_" << pid;
void registerFastGlobalMonitorable(JsonMonitorable *newMonitorable)
void addFastPathDefinition(std::string const &defPathFast, std::string const defGroupFast, bool strict)
void registerStreamMonitorableUIntVecAtomic(std::string const &name, std::vector< AtomicMonUInt *> *inputs, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
DataPointDefinition const * dpd_
void trackDummy(std::string const &name, bool setNAifZeroUpdates)
void snapStreamAtomic(unsigned int ls, unsigned int streamID)
std::vector< DataPoint * > dataPointsFastOnly_
FastMonitor(std::string const &defPath, std::string const defGroup, bool strictChecking, bool useSource=true, bool useDefinition=true)
void registerGlobalMonitorable(JsonMonitorable *newMonitorable, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
std::vector< unsigned int > jsonDpIndex_
U second(std::pair< T, U > const &p)
unsigned int recentSnaps_
static bool getDataPointDefinitionFor(std::string &defFilePath, DataPointDefinition *dpd, const std::string *defaultGroup=nullptr)
std::vector< DataPoint * > dataPoints_
void registerStreamMonitorableUIntVec(std::string const &name, std::vector< unsigned int > *inputs, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
std::map< std::string, unsigned int > dpNameMap_
std::unordered_set< std::string > uids_
void outputCSV(std::string const &path, std::vector< std::string > const &csvString)
static void writeStringToFile(std::string const &filename, std::string &content)
void commit(std::vector< unsigned int > *streamLumisPtr)
virtual std::string const & getName() const
std::string getCSVString(int sid=-1)
std::vector< std::string > const & getNames() const
bool outputFullJSON(std::string const &path, unsigned int lumi, bool output=true)
std::vector< DataPoint * > jsonDpIndexFast_
DataPointDefinition const * dpdFast_
void snap(unsigned int ls)
unsigned int fregDpCount_
OperationType getOperationFor(unsigned int index) const
bool fastPathStrictChecking_
JsonMonitorable * getMergedIntJForLumi(std::string const &name, unsigned int forLumi)
std::string getName(const G4String &)
unsigned int recentSnapsTimer_
void getHostAndPID(std::string &sHPid)
Writes a Value in JSON format in a human friendly way.
void discardCollected(unsigned int forLumi)
void snapGlobal(unsigned int ls)