New version to use the AliRawReaderDateOnline for monitoring
[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>
64c49452 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
aa947269 42 const Char_t* tableSOD[] = {"ALL", "no", "SOD", "all", NULL, NULL};
c851f39a 43
c56bdf45 44
aa947269 45 monitorDeclareTable(const_cast<char**>(tableSOD));
c851f39a 46
c56bdf45 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
64c49452 55
f05d667d 56 TString fileNam(fileName);
64c49452 57 if (fileNam.Contains("^") || fileNam.Contains("@"))
58 fileName = Form("mem://%s",fileName);
59
60 AliRawReader *reader = AliRawReader::Create(fileName);
f05d667d 61 if (!reader) {
62 std::cerr << "Don't know how to make reader for " << fileNam
64c49452 63 << std::endl;
f05d667d 64 return -2;
65 }
66
cb45bad5 67 TStopwatch timer;
68 timer.Start();
69 AliFMDBaseDA baseDA;
70
71 baseDA.Run(reader);
72
73 timer.Stop();
74 timer.Print();
75
f05d667d 76 Int_t retval = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
77 if (retval != 0) std::cerr << "Base DA failed" << std::endl;
cb45bad5 78
f05d667d 79 return retval;
cb45bad5 80}