29 #define RESULT_FILE "EMCALLED.root" 30 #define FILE_ID "signal" 31 #define AliDebugLevel() -1 32 #define FILE_SIGClassName "emcCalibSignal" 48 #include <TPluginManager.h> 54 #include "AliRawReader.h" 55 #include "AliRawReaderDate.h" 56 #include "AliRawEventHeaderBase.h" 57 #include "AliCaloRawStreamV3.h" 58 #include "AliCaloAltroMapping.h" 72 int main(
int argc,
char **argv)
80 printf(
"Wrong number of arguments\n");
85 gROOT->GetPluginManager()->AddHandler(
"TVirtualStreamerInfo",
92 gROOT->GetPluginManager()->AddHandler(
"ROOT::Math::Minimizer",
96 "TMinuitMinimizer(const char*)");
101 printf(
"EMCAL DA started - %s\n",__FILE__);
106 status=monitorDeclareMp( __FILE__ );
109 printf(
"monitorDeclareMp() failed : %s\n",monitorDecodeError(status));
115 monitorSetNoWaitNetworkTimeout(1000);
118 const char* mapFiles[
kNRCU] = {
"RCU0A.data",
"RCU1A.data",
"RCU0C.data",
"RCU1C.data"};
120 for(Int_t iFile=0; iFile<
kNRCU; iFile++)
122 int failed = daqDA_DB_getFile(mapFiles[iFile], mapFiles[iFile]);
125 printf(
"Cannot retrieve file %d : %s from DAQ DB. Exit now..\n",
126 iFile, mapFiles[iFile]);
135 AliCaloAltroMapping *mapping[
kNRCU];
139 TString side[] = {
"A",
"C"};
140 for(Int_t j = 0; j < 2; j++)
142 for(Int_t i = 0; i < 2; i++)
148 mapping[j*2 + i] =
new AliCaloAltroMapping(path2.Data());
153 const char* parameterFile = {
"EMCALLEDda.dat"};
155 int failed = daqDA_DB_getFile(parameterFile, parameterFile);
158 printf(
"Cannot retrieve file : %s from DAQ DB. Exit now..\n",
171 AliRawReader *rawReader = NULL;
175 for ( i=1; i<argc; i++ ) {
178 printf(
"Processing file %s\n", argv[i]);
179 status=monitorSetDataSource( argv[i] );
181 printf(
"monitorSetDataSource() failed. Error=%s. Exiting ...\n", monitorDecodeError(status));
186 struct eventHeaderStruct *event;
187 eventTypeType eventT;
192 if (daqDA_checkShutdown()) {
break;}
195 status=monitorGetEventDynamic((
void **)&event);
196 if (status==MON_ERR_EOF) {
197 printf (
"End of File %d (%s) detected\n", i, argv[i]);
201 printf(
"monitorGetEventDynamic() failed : %s\n",monitorDecodeError(status));
210 eventT =
event->eventType;
212 if ( eventT != calibrationEvent )
219 if (! TEST_DETECTOR_IN_PATTERN(event->eventDetectorPattern, emcID) )
228 rawReader =
new AliRawReaderDate((
void*)event);
255 printf (
"%d calibration events processed.\n",nevents);
262 printf(
"Objects saved to file \"%s\" as \"%s\".\n",
266 printf(
"Could not save the object to file \"%s\".\n",
274 for(Int_t iFile=0; iFile<
kNRCU; iFile++)
276 if (mapping[iFile])
delete mapping[iFile];
Bool_t ProcessEvent(AliRawReader *rawReader)
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
void SetRunNumber(int runNo)
TTree * GetTreeLEDAmpVsTime() const
static void SetClassDebugLevel(const char *className, Int_t level)
void SetUseAverage(bool b)
static Int_t DetectorID(const char *detectorName)
class for signal monitoring and calibration tools
int main(int argc, char **argv)
void SetParametersFromFile(const char *parameterFile)
void SetAltroMapping(AliCaloAltroMapping **mapp)
static void SetModuleDebugLevel(const char *module, Int_t level)
TTree * GetTreeAmpVsTime() const
#define FILE_SIGClassName