AliRoot Core  edcc906 (edcc906)
FMDGainda.cxx
Go to the documentation of this file.
1 /*
2 
3  FMD DA for online calibration of conditions
4 
5  Contact: canute@nbi.dk
6  Link: fmd.nbi.dk/fmd/offline
7  Run Type: GAIN
8  DA Type: LDC
9  Number of events needed: usually 102400
10  Input Files: raw data
11  Output Files: gains.csv
12  Trigger types used: GAIN
13 */
14 #include <AliFMDGainDA.h>
15 #include <AliFMDParameters.h>
16 #include "FMDUtilda.h"
17 #include <TROOT.h>
18 #include <iostream>
19 #include <unistd.h>
20 
21 int main(int argc, char **argv)
22 {
24 
25  Int_t ret = r.Init(argc, argv);
26  if (ret < 0) return -ret;
27  if (ret > 0) return 0;
28 
29  AliFMDGainDA gainDA;
30 #ifdef ALI_AMORE
31  gainDA.SetMakeSummaries(kTRUE);
32 #endif
33  std::cout << "Running Gain DA" << std::endl;
34  Bool_t success = r.Exec(gainDA);
35  if (!success) {
36  std::cout << "Failed to execute Gain DA"
37  << std::endl;
38  ret = 1;
39  }
40 
41  if (success && r.fUpload) {
42  const char* files[] = { "conditions.csv",
43  "gains.csv",
44  0 };
45  const char* ids[] = { AliFMDParameters::Instance()->GetConditionsShuttleID(),
47  0 };
48  ret = UploadFiles(files, ids, r.fOwnUpload);
49  if (ret > 0) std::cerr << "Upload of gains failed" << std::endl;
50  }
51 
52  if (success)
53  PostSummaries(gainDA, "gain", r.RunNumber());
54 
55 
56  gROOT->SetMustClean(false);
57  if (r.fFast) {
58  std::cout << "Sleep 1 second before getting out" << std::endl;
59  gSystem->Sleep(1000);
60  std::cout << "Now calling _exit(" << ret << ") to finish NOW!" << std::endl;
61  _exit(ret);
62  }
63 
64  std::cout << "End of FMD-Gain, return " << ret << std::endl;
65  return ret;
66 }
67 //
68 // EOF
69 //
70 
Bool_t Exec(AliFMDBaseDA &da)
Manager of FMD parameters.
Int_t UploadFiles(const char **files, const char **ids, bool useOwn, bool verb=true)
Definition: FMDUtilda.h:179
TROOT * gROOT
void SetMakeSummaries(Bool_t save)
Definition: AliFMDBaseDA.h:108
Int_t Init(int argc, char **argv, Bool_t reader=true)
int main(int argc, char **argv)
Definition: FMDGainda.cxx:21
Int_t RunNumber() const
Bool_t PostSummaries(AliFMDBaseDA &da, const char *prefix, Int_t runNumber, bool verb=true)
Definition: FMDUtilda.h:16
static const char * GetGainShuttleID()
static const char * GetConditionsShuttleID()
static AliFMDParameters * Instance()