9 #include "Utilities/AssociationUtil.h" 25 #include <curl/curl.h> 29 struct LEMWorkerParams
36 Atom<std::string> releaseOverride{
37 Name(
"ReleaseOverride"),
38 Comment(
"Specify this release to the server. Empty string for current release.")
71 produces<std::vector<LEMInput>>();
79 gethostname(host, 1023);
82 if(!user) user =
"(unknown)";
84 user, host, getpid(),
time(0)).Data();
86 curl_global_init(CURL_GLOBAL_ALL);
92 curl_global_cleanup();
114 std::cerr <<
"No response from server after many retries. " 115 <<
"Maybe there's no work for us. Aborting" 132 static bool once =
true;
133 static pthread_t thread;
158 pthread_join(thread, &ret);
176 char workstr[work.size()+1];
177 strcpy(workstr, work.c_str());
181 input.
tag = &strtok(workstr,
"\n")[4];
183 char* estr = strtok(0,
"\n");
185 int n = sscanf(estr,
"E=%lf", &input.totalGeV);
188 while(
char* chanqstr = strtok(0,
"\n")){
192 input.hits.push_back(hit);
195 std::unique_ptr<std::vector<LEMInput>> sumcol(
new std::vector<LEMInput>(1, input));
196 evt.
put(std::move(sumcol));
std::string GetWork() const
DEFINE_ART_MODULE(TestTMapFile)
::xsd::cxx::tree::time< char, simple_type > time
ProductID put(std::unique_ptr< PROD > &&product)
std::string getenv(std::string const &name)
void * GetWorkThreadFunc(void *x)
std::string get_release()
Figure out the current release. TODO: does this belong somewhere else?
assert(nhit_max >=nhit_nbins)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
std::string get_query(const std::string &host, const std::string &query, int minPort, int maxPort, int queryTimeout, int retryTimeout, bool &ok)
Make an HTTP GET query.
Compressed hit info, basic component of LEM events.
virtual void produce(art::Event &evt)
This runs on a high-mem node and reconstitutes LEMSummary events.