3 - "Contact: r.bailhache@gsi.de"
4 - "Link: http://www-linux.gsi.de/~bailhach/PEDESTAL/raw.root.date"
5 - "Run Type: dedicated pedestals run"
7 - "Number of events needed: 100"
8 - "Input Files: no config files, no previous result files, RAW DATA files from DDL = 1024 to DDL = 1041 included"
9 - "Output Files: trdCalibration.root, trdCalibration.root, no persitent file over runs"
10 - "Trigger types used: PEDESTAL_RUN"
14 #define RESULT_FILE "trdCalibration.root"
29 #include <TStopwatch.h>
34 #include "AliRawReader.h"
35 #include "AliRawReaderDate.h"
36 #include "AliTRDRawStreamTB.h"
37 #include "AliCDBManager.h"
39 // AliRoot TRD calib classes
41 #include "AliTRDCalibPadStatus.h"
45 Arguments: list of DATE raw data files
47 int main(int argc, char **argv) {
52 /* log start of process */
53 printf("TRD DA PEDESTAL started\n");
56 /* check that we got some arguments = list of files */
58 printf("Wrong number of arguments\n");
63 /* copy locally a file from daq detector config db */
64 //status=daqDA_DB_getFile("myconfig","./myconfig.txt");
66 // printf("Failed to get config file : %d\n",status);
69 /* and possibly use it */
72 /* init some counters */
76 //Instance of AliCDBManager: needed by AliTRDRawStream
77 AliCDBManager *man = AliCDBManager::Instance();
78 man->SetDefaultStorage("local://$ALICE_ROOT");
80 // AliTRDCalibPadStatus object
81 AliTRDCalibPadStatus calipad = AliTRDCalibPadStatus();
82 Bool_t passpadstatus = kTRUE;
89 /* some warning less */
90 AliTRDRawStreamTB::SupressWarnings(kTRUE);
92 /* read the data files */
94 for (n=1;n<argc;n++) {
96 /* define data source : this is argument i */
97 printf("Processing file %s\n",argv[n]);
98 status=monitorSetDataSource( argv[n] );
100 printf("monitorSetDataSource() failed : %s\n",monitorDecodeError(status));
104 /* read the file until EOF */
106 struct eventHeaderStruct *event;
109 status=monitorGetEventDynamic((void **)&event);
110 if (status==MON_ERR_EOF) {
111 printf("End of File %d detected\n",n);
112 break; /* end of monitoring file has been reached */
115 printf("monitorGetEventDynamic() failed : %s\n",monitorDecodeError(status));
119 /* retry if got no event */
126 AliRawReader *rawReader = new AliRawReaderDate((void*)event);
127 rawReader->Select("TRD");
128 AliTRDRawStreamTB *trdRawStream = new AliTRDRawStreamTB((AliRawReader *)rawReader);
129 //trdRawStream->Init();
130 if(!calipad.ProcessEvent(trdRawStream,(Bool_t)nevents_total)) passpadstatus = kFALSE;
145 /* report progress */
146 printf("%d events processed and %d used\n",nevents_total,nevents);
152 /* write file in any case to see what happens in case of problems*/
156 TFile *fileTRD = new TFile(RESULT_FILE,"recreate");
157 calipad.AnalyseHisto();
158 calipad.Write("calibpadstatus");
160 printf("Wrote local file %s\n",RESULT_FILE);
165 /* store the result file on FES */
166 status=daqDA_FES_storeFile(RESULT_FILE,RESULT_FILE);
168 printf("Failed to export file : %d\n",status);
173 /* report progress */
174 daqDA_progressReport(100);