3 FMD DA for online calibration of conditions
6 Link: fmd.nbi.dk/fmd/offline
9 Number of events needed: 1000
11 Output Files: peds.csv
12 Trigger types used: PEDESTAL
17 #include <AliFMDParameters.h>
18 #include <AliRawReader.h>
19 #include <TStopwatch.h>
20 #include <AliFMDPedestalDA.h>
21 #include <AliRawReaderDate.h>
22 #include <AliRawReaderRoot.h>
25 #include "TPluginManager.h"
29 int main(int argc, char **argv)
31 /* magic line from Rene - for future reference! */
32 gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
37 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer", "Minuit",
40 "TMinuitMinimizer(const char *)");
41 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer",
43 "ROOT::Math::GSLMinimizer",
45 "GSLMinimizer(const char *)");
46 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer",
48 "ROOT::Math::GSLNLSMinimizer",
49 "MathMore", "GSLNLSMinimizer(int)");
50 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer",
52 "ROOT::Math::GSLSimAnMinimizer",
54 "GSLSimAnMinimizer(int)");
55 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer",
59 "TLinearMinimizer(const char *)");
60 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer",
64 "TFumiliMinimizer(int)");
69 Bool_t diagnostics = kFALSE;
71 std::cerr << "No input file given" << std::endl;
74 TString fileName(argv[1]);
75 if (fileName.Contains("--help")) {
76 std::cout << "Usage: " << argv[0] << " FILENAME [OPTIONS]\n\n"
78 << " --diagnostics=BOOL Make diagnostics ROOT file\n"
83 for (int i = 2; i < argc; i++) {
85 if (arg.Contains("--diagnostics=true")) diagnostics = kTRUE;
86 else if (arg.Contains("--help")) {
87 std::cout << "Usage: " << argv[0] << " FILENAME [OPTIONS]\n\n"
89 << " --diagnostics=BOOL Make diagnostics ROOT file\n"
94 std::cerr << "Unknown option: " << arg << "\n"
95 << "Try '" << argv[0] << " --help" << std::endl;
101 AliLog::EnableDebug(kFALSE);
102 AliFMDParameters::Instance()->Init(kFALSE,0);
103 AliFMDParameters::Instance()->UseCompleteHeader(old);
105 AliRawReader *reader = 0;
106 if (fileName.EndsWith(".root"))
107 reader = new AliRawReaderRoot(fileName.Data());
109 reader = new AliRawReaderDate(fileName.Data());
111 std::cerr << "Don't know how to make reader for " << fileName
117 AliFMDPedestalDA pedDA;
118 pedDA.SetSaveDiagnostics(diagnostics);
124 Int_t retvalConditions = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
125 Int_t retvalPeds = daqDA_FES_storeFile("peds.csv", AliFMDParameters::Instance()->GetPedestalShuttleID());
127 if(retvalConditions!=0 || retvalPeds!=0)
128 std::cerr << "Pedestal DA failed" << std::endl;
130 if(retvalPeds != 0) return retvalPeds;
131 else return retvalConditions;