3 FMD DA for online calibration of conditions
6 Link: fmd.nbi.dk/fmd/offline
9 Number of events needed: usually 102400
11 Output Files: gains.csv
12 Trigger types used: GAIN
14 #include <Riostream.h>
17 #include <AliFMDParameters.h>
18 #include <AliRawReader.h>
19 #include <TStopwatch.h>
20 #include <AliFMDGainDA.h>
21 #include <AliRawReaderDate.h>
22 #include <AliRawReaderRoot.h>
26 #include "TPluginManager.h"
34 int main(int argc, char **argv)
37 gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
42 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer", "Minuit",
45 "TMinuitMinimizer(const char *)");
46 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer",
48 "ROOT::Math::GSLMinimizer",
50 "GSLMinimizer(const char *)");
51 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer",
53 "ROOT::Math::GSLNLSMinimizer",
54 "MathMore", "GSLNLSMinimizer(int)");
55 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer",
57 "ROOT::Math::GSLSimAnMinimizer",
59 "GSLSimAnMinimizer(int)");
60 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer",
64 "TLinearMinimizer(const char *)");
65 gROOT->GetPluginManager()->AddHandler("ROOT::Math::Minimizer",
69 "TFumiliMinimizer(int)");
72 Bool_t diagnostics = kFALSE;
73 Char_t* fileName = argv[1];
74 TString secondArgument(argv[2]);
76 for (int i = 2; i < argc; i++) {
78 if (arg.Contains("--diagnostics=true")) diagnostics = kTRUE;
79 else if (arg.Contains("--help")) {
80 cout << "Usage: " << argv[0] << " FILENAME [OPTIONS]\n\n"
82 << " --diagnostics=BOOL Make diagnostics ROOT file\n"
87 cerr << "Unknown option: " << arg << "\n"
88 << "Try '" << argv[0] << " --help" << endl;
94 AliFMDParameters::Instance()->Init(kFALSE,0);
96 //This will only work for FDR 1 data. When newer data becomes available the ! must be removed!
97 AliFMDParameters::Instance()->UseCompleteHeader(old);
99 AliLog::EnableDebug(kFALSE);
101 AliRawReader *reader = 0;
102 TString fileNam(fileName);
103 if (fileNam.EndsWith(".root"))
104 reader = new AliRawReaderRoot(fileName);
105 else reader = new AliRawReaderDate(fileName);
107 cerr << "Don't know how to make reader for " << fileNam
116 gainDA.SetSaveDiagnostics(diagnostics);
118 gainDA.SetMakeSummaries(kTRUE);
125 Int_t retvalConditions =
126 daqDA_FES_storeFile("conditions.csv",
127 AliFMDParameters::Instance()->GetConditionsShuttleID());
129 daqDA_FES_storeFile("gains.csv",
130 AliFMDParameters::Instance()->GetGainShuttleID());
132 if(retvalConditions!=0 || retvalGain!=0)
133 cerr << "Pedestal DA failed" << endl;
137 amore::da::AmoreDA myAmore(amore::da::AmoreDA::kSender);
140 for (det = 1; det <= 3; det++)
141 if (gainDA.HasSeenDetector(det)) break;
142 if (det >= 1 && det <= 3) {
143 TObject* runNo = new TObject;
144 runNo->SetUniqueID(reader->GetRunNumber());
145 myAmore.Send(Form("gainRunNoFMD%d", det), runNo);
148 TIter next(&gainDA.GetSummaries());
150 while ((obj = next()))
151 myAmore.Send(obj->GetName(), obj);
154 catch (exception& e) {
155 cerr << "Failed to make AMORE instance: " << e.what() << endl;
160 if(retvalGain != 0) return retvalGain;
161 return retvalConditions;