19 std::cerr <<
"AMORE not found - nothing posted" << std::endl;
23 std::cout <<
"Posting " << prefix <<
" data to AMORE" << std::endl;
25 TString daName(gSystem->Getenv(
"AMORE_DA_NAME"));
26 if (daName.IsNull()) {
27 daName = gSystem->Getenv(
"DATE_ROLE_NAME");
29 gSystem->Setenv(
"AMORE_DA_NAME",
"FMD");
31 amore::da::AmoreDA myAmore(amore::da::AmoreDA::kSender);
33 for (UShort_t det = 1; det <= 3; det++) {
35 TObject* runNo =
new TObject;
36 runNo->SetUniqueID(runNumber);
38 std::cout <<
" Posting " << prefix <<
"RuNoFMD" << det <<
" ... " 40 myAmore.Send(Form(
"%sRunNoFMD%d", prefix, det), runNo);
42 std::cout <<
"done" << std::endl;
47 std::cout <<
" Will post summaries: " << std::endl;
51 while ((obj = next())) {
53 std::cout <<
" Posting " << obj->GetName()
54 <<
" ... " << std::flush;
55 myAmore.Send(obj->GetName(), obj);
57 std::cout <<
"done" << std::endl;
61 catch (std::exception& e) {
62 std::cerr <<
"Failed to make AMORE instance: " << e.what() << std::endl;
66 std::cout <<
"All objects posted to AMORE" << std::endl;
71 #include <sys/types.h> 83 waitpid(pid, &status, 0);
89 std::cout <<
"Execute \"" << pgm <<
"\"";
90 for (
int i = 0; argv[i]; i++)
91 std::cout <<
" \"" << argv[i] <<
"\"";
92 std::cout << std::endl;
93 int status = execv(pgm, argv);
95 std::cout <<
"Failed to exec " << errno
96 <<
" (" << strerror(errno) <<
")" << std::endl;
102 std::cout <<
"Failed to for fork " << errno
103 <<
" (" << strerror(errno) <<
")" << std::endl;
108 Int_t
myFesStore2(
const char* file,
const char*
id,
bool verb=
true)
110 TString
path(gSystem->Getenv(
"DAQDALIB_PATH"));
112 std::cout <<
"DAQDALIB_PATH undefined" << std::endl;
116 cmd.Append(
"/daqFES_store");
117 std::cout <<
"Will Execute \"" << cmd
118 <<
"\",\"" << file <<
"\",\"" <<
id 119 <<
"\"" << std::endl;
120 char*
const args[] = {
121 const_cast<char*
>(cmd.Data()),
122 const_cast<char*>(file),
123 const_cast<char*
>(id),
126 if (WIFEXITED(ret)) {
127 ret = WEXITSTATUS(ret);
129 std::cout <<
"Failed to execute \"" << cmd <<
"\" -> " 132 else if (WIFSIGNALED(ret)) {
133 int sig = WTERMSIG(ret);
134 std::cout <<
"Process \"" << cmd <<
"\" received signal " 135 << sig <<
" (" << strsignal(sig) <<
")" << std::endl;
141 Int_t
myFesStore(
const char* file,
const char*
id,
bool verb=
true)
143 TString
path(gSystem->Getenv(
"DAQDALIB_PATH"));
145 std::cout <<
"DAQDALIB_PATH undefined" << std::endl;
149 Int_t ret = system(NULL);
151 std::cout <<
"Cannot spawn a shell" << std::endl;
156 cmd.Append(
"/daqDetDB_store ");
161 std::cout <<
"Will now execute \"" << cmd <<
"\"" << std::endl;
162 ret = system(cmd.Data());
163 if (WIFEXITED(ret)) {
164 ret = WEXITSTATUS(ret);
166 std::cout <<
"Failed to execute \"" << cmd <<
"\" -> " 169 else if (WIFSIGNALED(ret)) {
170 int sig = WTERMSIG(ret);
171 std::cout <<
"Process \"" << cmd <<
"\" received signal " 172 << sig <<
" (" << strsignal(sig) <<
")" << std::endl;
179 UploadFiles(
const char** files,
const char** ids,
bool useOwn,
bool verb=
true)
181 const char** pFile = files;
182 const char** pId = ids;
185 std::cout <<
"Uploading files to FXS" << std::endl;
187 while (*pFile && *pId) {
189 std::cout <<
" Upload " << *pFile <<
" (" << *pId <<
") ... " << std::flush;
192 else lret = daqDA_FES_storeFile(*pFile, *pId);
196 std::cout <<
"failed (" << lret <<
")" << std::endl;
197 std::cerr <<
"Failed to upload " << *pFile <<
" to FES id " 198 << *pId <<
" - exit " << lret << std::endl;
202 if (verb) std::cout <<
"done" << std::endl;
203 std::ofstream touch(Form(
"%s.upload", *pFile));
204 touch <<
"Done" << std::endl;
211 std::cout <<
"Done uploading with " << ret
212 <<
" errors" << std::endl;
218 #endif // FMDUTILDA_H
Int_t myFesStore2(const char *file, const char *id, bool verb=true)
Int_t myFesStore(const char *file, const char *id, bool verb=true)
Int_t UploadFiles(const char **files, const char **ids, bool useOwn, bool verb=true)
Bool_t HasSeenDetector(UShort_t d) const
int system_alternative(const char *pgm, char *const argv[])
Bool_t PostSummaries(AliFMDBaseDA &da, const char *prefix, Int_t runNumber, bool verb=true)
const Array & GetSummaries() const