]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/FMDBaseda.cxx
New version to use the AliRawReaderDateOnline for monitoring
[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   
56   TString fileNam(fileName);
57   if (fileNam.Contains("^") || fileNam.Contains("@"))
58     fileName = Form("mem://%s",fileName);
59     
60   AliRawReader *reader = AliRawReader::Create(fileName);
61   if (!reader) { 
62     std::cerr << "Don't know how to make reader for " << fileNam 
63               << std::endl;
64     return -2;
65   }
66   
67   TStopwatch timer;
68   timer.Start();
69   AliFMDBaseDA baseDA;
70   
71   baseDA.Run(reader);
72   
73   timer.Stop();
74   timer.Print();
75
76   Int_t  retval = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
77   if (retval != 0) std::cerr << "Base DA failed" << std::endl;
78   
79   return retval;
80 }