]>
Commit | Line | Data |
---|---|---|
4a243071 | 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: PEDESTAL | |
8bd95799 | 8 | DA Type: LDC |
4a243071 | 9 | Number of events needed: 1000 |
10 | Input Files: raw data | |
11 | Output Files: peds.csv | |
12 | Trigger types used: PEDESTAL | |
13 | */ | |
14 | #include <TSystem.h> | |
5dd86feb | 15 | #include <TString.h> |
4a243071 | 16 | #include <AliFMDParameters.h> |
17 | #include <AliRawReader.h> | |
18 | #include <TStopwatch.h> | |
19 | #include <AliFMDPedestalDA.h> | |
20 | #include <AliRawReaderDate.h> | |
5dd86feb | 21 | #include <AliRawReaderRoot.h> |
22 | #include "daqDA.h" | |
4a243071 | 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 | ||
5dd86feb | 40 | Bool_t diagnostics = kFALSE; |
4a243071 | 41 | Char_t* fileName = argv[1]; |
5dd86feb | 42 | TString secondArgument(argv[2]); |
43 | ||
44 | if(secondArgument.Contains("--diagnostics=true")) | |
45 | diagnostics = kTRUE; | |
46 | if(secondArgument.Contains("--help")) { | |
47 | std::cout<<"Usage: filename --diagnostics=true/false . --help this help"<<std::endl; | |
48 | return 0; | |
49 | } | |
4a243071 | 50 | |
bbafbf2e | 51 | if(!secondArgument.IsWhitespace() && !secondArgument.Contains("--help") |
52 | && !secondArgument.Contains("--diagnostics=true")) { | |
5dd86feb | 53 | std::cout<<"Second argument wrong. Use --help"<<std::endl; |
54 | return -1; | |
55 | } | |
4a243071 | 56 | Bool_t old = kTRUE; |
57 | ||
58 | ||
59 | AliFMDParameters::Instance()->Init(kFALSE,0); | |
4a243071 | 60 | AliFMDParameters::Instance()->UseCompleteHeader(old); |
61 | ||
5dd86feb | 62 | AliRawReader *reader = 0; |
63 | TString fileNam(fileName); | |
64 | if (fileNam.EndsWith(".root")) reader = new AliRawReaderRoot(fileName); | |
6d237bb1 | 65 | else reader = new AliRawReaderDate(fileName); |
5dd86feb | 66 | if (!reader) { |
67 | std::cerr << "Don't know how to make reader for " << fileNam | |
68 | << std::endl; | |
69 | return -2; | |
70 | } | |
4a243071 | 71 | TStopwatch timer; |
72 | timer.Start(); | |
73 | AliFMDPedestalDA pedDA; | |
5dd86feb | 74 | pedDA.SetSaveDiagnostics(diagnostics); |
4a243071 | 75 | pedDA.Run(reader); |
76 | ||
77 | timer.Stop(); | |
78 | timer.Print(); | |
5dd86feb | 79 | |
80 | Int_t retvalConditions = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID()); | |
81 | Int_t retvalPeds = daqDA_FES_storeFile("peds.csv", AliFMDParameters::Instance()->GetPedestalShuttleID()); | |
4a243071 | 82 | |
5dd86feb | 83 | if(retvalConditions!=0 || retvalPeds!=0) |
84 | std::cerr << "Pedestal DA failed" << std::endl; | |
4a243071 | 85 | |
5dd86feb | 86 | if(retvalPeds != 0) return retvalPeds; |
87 | else return retvalConditions; | |
4a243071 | 88 | |
89 | } |