#include "event.h"
#include "monitor.h"
+extern "C" {
#include "daqDA.h"
+}
#include <stdio.h>
#include <stdlib.h>
-// #include "AliRawReader.h"
-// #include "AliRawReaderDate.h"
+#include <TSystem.h>
+
+#include "AliRawReader.h"
+#include "AliRawReaderDate.h"
+#include "AliPHOSCalibHistoProducer.h"
+#include "AliPHOSRawDecoder.h"
+#include "AliCaloAltroMapping.h"
/* Main routine
return -1;
}
-// AliRawReader* rawReader = new AliRawReaderDate(argv[1]);
/* open result file */
FILE *fp=NULL;
printf("Failed to open file\n");
return -1;
}
+
+ /* Open mapping files */
+ AliAltroMapping *mapping[4];
+ TString path = gSystem->Getenv("ALICE_ROOT");
+ path += "/PHOS/mapping/RCU";
+ TString path2;
+ for(Int_t i = 0; i < 4; i++) {
+ path2 = path;
+ path2 += i;
+ path2 += ".data";
+ mapping[i] = new AliCaloAltroMapping(path2.Data());
+ }
/* define data source : this is argument 1 */
int nevents_physics=0;
int nevents_total=0;
+ AliRawReader *rawReader = NULL;
+
+ AliPHOSCalibHistoProducer hp(200,0.,200.);
+ hp.SetOldRCUFormat(kTRUE);
+ hp.SetUpdatingRate(200000);
/* main loop (infinite) */
for(;;) {
EVENT_ID_GET_ORBIT(event->eventId),
EVENT_ID_GET_PERIOD(event->eventId)
);
+
+ rawReader = new AliRawReaderDate((void*)event);
+ AliPHOSRawDecoder dc(rawReader,mapping);
+ dc.SubtractPedestals(kTRUE);
+ hp.SetRawDecoder(&dc);
+ hp.Run();
+
+ delete rawReader;
+
nevents_physics++;
}
nevents_total++;
-
/* free resources */
free(event);
}
}
+ for(Int_t i = 0; i < 4; i++) delete mapping[i];
/* write report */
fprintf(fp,"Run #%s, received %d physics events out of %d\n",getenv("DATE_RUN_NUMBER"),nevents_physics,nevents_total);