Some more overlaps
[u/mrichter/AliRoot.git] / FMD / FMDBaseda.cxx
CommitLineData
cb45bad5 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: PHYSICS
c56bdf45 8 DA Type: MON
cb45bad5 9 Number of events needed: depending on the run, being run-level
10 Input Files: raw data
11 Output Files: conditions.csv
12 Trigger types used: PHYSICS_EVENT
13*/
c56bdf45 14#include "monitor.h"
cb45bad5 15#include <TSystem.h>
f05d667d 16#include <TString.h>
cb45bad5 17#include <AliFMDParameters.h>
18#include <AliRawReader.h>
19#include <TStopwatch.h>
20#include <AliFMDBaseDA.h>
21#include <AliRawReaderDate.h>
f05d667d 22#include <AliRawReaderRoot.h>
23#include "daqDA.h"
cb45bad5 24#include "TROOT.h"
25#include "TPluginManager.h"
26
27
28
29int main(int argc, char **argv)
30{
31
32#if 0
33 /* magic line from Rene - for future reference! */
34 gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
35 "*",
36 "TStreamerInfo",
37 "RIO",
38 "TStreamerInfo()");
39#endif
40
41
c56bdf45 42 Char_t* tableSOD[] = {"SOD","all",NULL};
43 Char_t* tablePHYS[] = {"PHY","no",NULL};
44
45 monitorDeclareTable(tableSOD);
46 monitorDeclareTable(tablePHYS);
47
cb45bad5 48 Char_t* fileName = argv[1];
49
50 Bool_t old = kTRUE;
51
cb45bad5 52 AliFMDParameters::Instance()->Init(kFALSE,0);
cb45bad5 53 AliFMDParameters::Instance()->UseCompleteHeader(!old);
54
f05d667d 55 AliRawReader *reader = 0;
56 TString fileNam(fileName);
57 if (fileNam.EndsWith(".root")) reader = new AliRawReaderRoot(fileName);
6d237bb1 58 else reader = new AliRawReaderDate(fileName);
f05d667d 59 if (!reader) {
60 std::cerr << "Don't know how to make reader for " << fileNam
61 << std::endl;
62 return -2;
63 }
64
cb45bad5 65 TStopwatch timer;
66 timer.Start();
67 AliFMDBaseDA baseDA;
68
69 baseDA.Run(reader);
70
71 timer.Stop();
72 timer.Print();
73
f05d667d 74 Int_t retval = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
75 if (retval != 0) std::cerr << "Base DA failed" << std::endl;
cb45bad5 76
f05d667d 77 return retval;
cb45bad5 78}