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 "AliTRDRawStreamV2.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;
90 /* read the data files */
92 for (n=1;n<argc;n++) {
94 /* define data source : this is argument i */
95 printf("Processing file %s\n",argv[n]);
96 status=monitorSetDataSource( argv[n] );
98 printf("monitorSetDataSource() failed : %s\n",monitorDecodeError(status));
102 /* read the file until EOF */
104 struct eventHeaderStruct *event;
107 status=monitorGetEventDynamic((void **)&event);
108 if (status==MON_ERR_EOF) {
109 printf("End of File %d detected\n",n);
110 break; /* end of monitoring file has been reached */
113 printf("monitorGetEventDynamic() failed : %s\n",monitorDecodeError(status));
117 /* retry if got no event */
124 AliRawReader *rawReader = new AliRawReaderDate((void*)event);
125 AliTRDRawStreamV2 *trdRawStream = new AliTRDRawStreamV2((AliRawReader *)rawReader);
126 if(!calipad.ProcessEvent(trdRawStream,(Bool_t)nevents_total)) passpadstatus = kFALSE;
141 /* report progress */
142 printf("%d events processed and %d used\n",nevents_total,nevents);
148 /* write file in any case to see what happens in case of problems*/
152 TFile *fileTRD = new TFile(RESULT_FILE,"recreate");
153 calipad.AnalyseHisto();
154 calipad.Write("calibpadstatus");
156 printf("Wrote local file %s\n",RESULT_FILE);
161 /* store the result file on FES */
162 status=daqDA_FES_storeFile(RESULT_FILE,RESULT_FILE);
164 printf("Failed to export file : %d\n",status);
169 /* report progress */
170 daqDA_progressReport(100);