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
16 #include <AliFMDParameters.h>
17 #include <AliRawReader.h>
18 #include <TStopwatch.h>
19 #include <AliFMDGainDA.h>
20 #include <AliRawReaderDate.h>
21 #include <AliRawReaderRoot.h>
25 #include "TPluginManager.h"
29 int main(int argc, char **argv)
32 gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
39 Bool_t diagnostics = kFALSE;
40 Char_t* fileName = argv[1];
41 TString secondArgument(argv[2]);
43 if(secondArgument.Contains("--diagnostics=true"))
45 if(secondArgument.Contains("--help")) {
46 std::cout<<"Usage: filename --diagnostics=true/false . --help this help"<<std::endl;
49 if(!secondArgument.IsWhitespace()&& !secondArgument.Contains("--help")
50 && !secondArgument.Contains("--diagnostics=true")) {
51 std::cout<<"Second argument wrong. Use --help"<<std::endl;
57 AliFMDParameters::Instance()->Init(kFALSE,0);
59 //This will only work for FDR 1 data. When newer data becomes available the ! must be removed!
60 AliFMDParameters::Instance()->UseCompleteHeader(old);
62 AliLog::EnableDebug(kFALSE);
64 AliRawReader *reader = 0;
65 TString fileNam(fileName);
66 if (fileNam.EndsWith(".root"))
67 reader = new AliRawReaderRoot(fileName);
68 else reader = new AliRawReaderDate(fileName);
70 std::cerr << "Don't know how to make reader for " << fileNam
79 gainDA.SetSaveDiagnostics(diagnostics);
85 Int_t retvalConditions = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
86 Int_t retvalGain = daqDA_FES_storeFile("gains.csv", AliFMDParameters::Instance()->GetGainShuttleID());
88 if(retvalConditions!=0 || retvalGain!=0)
89 std::cerr << "Pedestal DA failed" << std::endl;
91 if(retvalGain != 0) return retvalGain;
92 else return retvalConditions;