]>
Commit | Line | Data |
---|---|---|
c4d90345 | 1 | /************************************************************************** |
2 | - "Contact": - Oleksandr Borysov, aborysov@ts.infnf.it | |
3 | - "Link:" - link to test files: /afs/infn.it/ts/user/aborysov/public/C23_run387.000.raw | |
4 | - "Run Type:" - run type (exactly as defined in the ECS) | |
5 | - "DA Type:" - LDC | |
6 | - "Number of events needed:" at least 500 | |
f67db810 | 7 | |
c4d90345 | 8 | - "Input Files:" - config file: ssdpeddaconfig |
9 | previous result files: | |
10 | data source: raw data file on LDC | |
11 | ||
12 | - "Output Files:" - local names $DA_TEST_DIR/ssddaldc_<LDCID>_<RunID>.root | |
13 | FXS name: ITSSSDda_<LDCID>_<RunID>.root, | |
14 | local files are persistent over runs: data source | |
15 | - "Trigger types used:" | |
16 | **************************************************************************/ | |
17 | ||
18 | ||
19 | #include <iostream> | |
20 | #include "TString.h" | |
f67db810 | 21 | #include "TFile.h" |
22 | #include "daqDA.h" | |
f67db810 | 23 | #include "AliITSHandleDaSSD.h" |
24 | ||
25 | using namespace std; | |
26 | ||
f67db810 | 27 | |
28 | int main( int argc, char** argv ) | |
29 | { | |
30 | AliITSHandleDaSSD *ssddaldc; | |
c4d90345 | 31 | TString feefname, cmddbsave; |
f67db810 | 32 | Int_t status; |
c4d90345 | 33 | Char_t *dafname = NULL, *dadaqdir = NULL; |
f67db810 | 34 | |
35 | /* check that we got some arguments = list of files */ | |
36 | if (argc<2) { | |
37 | printf("Wrong number of arguments\n"); | |
38 | return -1; | |
39 | } | |
40 | ||
41 | char *datafilename = argv[1]; | |
42 | ||
c4d90345 | 43 | ssddaldc = new AliITSHandleDaSSD(datafilename); |
44 | if (ssddaldc->IsZombie()) return -1; | |
45 | if (!ssddaldc->ProcessRawData()) | |
f67db810 | 46 | { |
c4d90345 | 47 | cout << "Error !ssddaldc->ProcessRawData()" << endl; |
f67db810 | 48 | delete ssddaldc; |
49 | return -1; | |
50 | } | |
f67db810 | 51 | daqDA_progressReport(90); |
c4d90345 | 52 | |
53 | if (!system(NULL)) { | |
54 | cout << "Error: the call system(NULL) in main() returned NULL!" << endl; | |
55 | return -1; | |
56 | } | |
57 | dadaqdir = getenv ("DA_TEST_DIR"); | |
f67db810 | 58 | if (dadaqdir) { |
59 | dafname = dadaqdir; | |
60 | if (!(ssddaldc->SaveCalibrationSSDLDC(dafname))) | |
c4d90345 | 61 | cout << "Error saving DA data to the file! Probably $DA_TEST_DIR defined incorrectly!" << endl; |
f67db810 | 62 | else cout << "SSDDA data are saved in " << dafname << endl; |
c4d90345 | 63 | feefname = Form("%s/ssddaldc_%i_%i.root", dadaqdir, ssddaldc->GetLdcId(), ssddaldc->GetRunId()); |
64 | cout << "Saving feessdda data in " << feefname << endl; | |
65 | TFile *fileRun = new TFile (feefname.Data(),"RECREATE"); | |
f67db810 | 66 | ssddaldc->Write(); |
67 | fileRun->Close(); | |
68 | delete fileRun; | |
c4d90345 | 69 | status = daqDA_FES_storeFile(dafname, "DASSD_DB_results"); |
f67db810 | 70 | if (status) printf("Failed to export file : %d\n",status); |
c4d90345 | 71 | |
72 | if (getenv("DATE_DB_DIR")) { | |
73 | cmddbsave = Form("$DATE_DB_DIR/daqDetDB_store ssddaldc.root %s", feefname.Data()); | |
74 | status = system(cmddbsave.Data()); | |
75 | if (status) printf("Failed to export file to the detector db: %d\n",status); | |
76 | } else cout << "Error main(): $DATE_DB_DIR is not defined!" << endl; | |
f67db810 | 77 | } |
c4d90345 | 78 | else cout << "Error: DA_TEST_DIR is not defined, DA data are not saved!" << endl; |
f67db810 | 79 | delete ssddaldc; |
80 | daqDA_progressReport(100); | |
81 | return 0; | |
c4d90345 | 82 | } |