9 #include "Utilities/AssociationUtil.h" 28 #include <curl/curl.h> 32 struct LEMClientParams
39 Atom<std::string> inputLabel{
41 Comment(
"Where to find LEMInput objects")
44 Atom<std::string> releaseOverride{
45 Name(
"ReleaseOverride"),
46 Comment(
"Specify this release to the server. Empty string for current release.")
78 produces<std::vector<lem::PIDDetails>>();
79 produces<art::Assns<lem::PIDDetails, rb::Cluster>>();
83 gethostname(host, 1023);
86 if(!user) user =
"(unknown)";
88 user, host, getpid(),
time(0)).Data();
90 curl_global_init(CURL_GLOBAL_ALL);
96 curl_global_cleanup();
109 std::unique_ptr<std::vector<lem::PIDDetails> > pidcol(
new std::vector<lem::PIDDetails>);
125 const int inputMax = inputs->size();
126 for(
int inputIdx = 0; inputIdx < inputMax; ++inputIdx){
127 const LEMInput& input = (*inputs)[inputIdx];
147 std::cerr <<
"No response from server after many retries. Aborting" 155 const std::vector<art::Ptr<rb::Cluster> > slices =
fmt.at(inputIdx);
156 assert(slices.size() == 1);
160 evt.
put(std::move(pidcol));
161 evt.
put(std::move(assns));
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
Fetch LEM PID result from remote server.
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)
std::string post_query(const std::string &host, const std::string &query, const std::string &postdata, int minPort, int maxPort, int queryTimeout, int retryTimeout, bool &ok)
Make an HTTP POST query.
std::string get_release()
Figure out the current release. TODO: does this belong somewhere else?
static PIDDetails FromString(const std::string &s)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
assert(nhit_max >=nhit_nbins)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Compressed hit info, basic component of LEM events.
virtual void produce(art::Event &evt)