]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/FMDBaseda.cxx
New version to recon the coming of the SOD event
[u/mrichter/AliRoot.git] / FMD / FMDBaseda.cxx
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
8   DA Type:                 MON
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 */
14 #include "monitor.h"
15 #include <TSystem.h>
16 #include <TString.h>
17 #include <AliFMDParameters.h>
18 #include <AliRawReader.h>
19 #include <TStopwatch.h>
20 #include <AliFMDBaseDA.h>
21 #include <AliRawReaderDate.h>
22 #include <AliRawReaderRoot.h>
23 #include "daqDA.h"
24 #include "TROOT.h"
25 #include "TPluginManager.h"
26
27
28
29 int 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   
42   const Char_t* tableSOD[]  = {"ALL", "no", "SOD", "all", NULL, NULL};
43
44
45   monitorDeclareTable(const_cast<char**>(tableSOD));
46
47   
48   Char_t* fileName = argv[1];
49   
50   Bool_t old = kTRUE;
51   
52   AliFMDParameters::Instance()->Init(kFALSE,0);
53   AliFMDParameters::Instance()->UseCompleteHeader(!old);
54   
55   AliRawReader *reader = 0;
56   TString fileNam(fileName);
57   if (fileNam.EndsWith(".root")) reader = new AliRawReaderRoot(fileName);
58   else reader = new AliRawReaderDate(fileName);
59   if (!reader) { 
60     std::cerr << "Don't know how to make reader for " << fileNam 
61               << std::endl;
62     return -2;
63   }
64   
65   TStopwatch timer;
66   timer.Start();
67   AliFMDBaseDA baseDA;
68   
69   baseDA.Run(reader);
70   
71   timer.Stop();
72   timer.Print();
73
74   Int_t  retval = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
75   if (retval != 0) std::cerr << "Base DA failed" << std::endl;
76   
77   return retval;
78 }