]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/FMDBaseda.cxx
tpc_clusters.C - return null pointer if tree can be obtained from run-loader.
[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 <TSystem.h>
15 #include <TString.h>
16 #include <AliFMDParameters.h>
17 #include <AliRawReader.h>
18 #include <TStopwatch.h>
19 #include <AliFMDBaseDA.h>
20 #include <AliRawReaderDate.h>
21 #include <AliRawReaderRoot.h>
22 #include "daqDA.h"
23 #include "TROOT.h"
24 #include "TPluginManager.h"
25
26
27
28 int main(int argc, char **argv) 
29 {
30
31 #if 0
32   /* magic line from Rene - for future reference! */
33   gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
34                                         "*",
35                                         "TStreamerInfo",
36                                         "RIO",
37                                         "TStreamerInfo()");
38 #endif
39   
40   
41   Char_t* fileName = argv[1];
42   
43   Bool_t old = kTRUE;
44   
45   AliFMDParameters::Instance()->Init(kFALSE,0);
46   AliFMDParameters::Instance()->UseCompleteHeader(!old);
47   
48   AliRawReader *reader = 0;
49   TString fileNam(fileName);
50   if (fileNam.EndsWith(".root")) reader = new AliRawReaderRoot(fileName);
51   else if (fileNam.EndsWith(".raw")) reader = new AliRawReaderDate(fileName);
52   if (!reader) { 
53     std::cerr << "Don't know how to make reader for " << fileNam 
54               << std::endl;
55     return -2;
56   }
57   
58   TStopwatch timer;
59   timer.Start();
60   AliFMDBaseDA baseDA;
61   
62   baseDA.Run(reader);
63   
64   timer.Stop();
65   timer.Print();
66
67   Int_t  retval = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
68   if (retval != 0) std::cerr << "Base DA failed" << std::endl;
69   
70   return retval;
71 }