/* This program reads the DAQ data files passed as argument using the monitoring library. It computes the average event size and populates local "./result.txt" file with the result. The program reports about its processing progress. Messages on stdout are exported to DAQ log system. DA to write mapping for the ZDC ADCs Contact: Chiara.Oppedisano@to.infn.it Link: Run Type: PHYSICS, STANDALONE_BC, STANDALONE_COSMIC, STANDALONE_CENTRAL, STANDALONE_MB, STANDALONE_SEMICENTRAL DA Type: MON Number of events needed: 1 (SOD is read) Input Files: none Output Files: ZDCChMapping.dat Trigger Types Used: different trigger types are used */ #define MAPDATA_FILE "ZDCChMapping.dat" #include #include #include // DATE #include #include #include //ROOT #include //AliRoot #include #include #include int main(int argc, char **argv) { const Char_t* tableSOD[] = {"ALL", "no", "SOD", "all", NULL, NULL}; monitorDeclareTable(const_cast(tableSOD)); int status = 0; /* log start of process */ printf("\nZDC MAPPING program started\n"); /* check that we got some arguments = list of files */ if (argc<2) { printf("Wrong number of arguments\n"); return -1; } FILE *mapFile4Shuttle; /* read the data files */ int n; for(n=1;nGetType(); //printf("\n\t ZDCPEDESTALda -> ev. type %d\n",evtype); //printf("\t ZDCPEDESTALda -> run # %d\n",reader->GetRunNumber()); // AliZDCRawStream *rawStreamZDC = new AliZDCRawStream(reader); /* use event - here, just write event id to result file */ eventT=event->eventType; Int_t ich=0, adcMod[48], adcCh[48], sigCode[48], det[48], sec[48]; if(eventT==START_OF_DATA){ sodRead = kTRUE; if(!rawStreamZDC->Next()) printf(" \t No raw data found!! \n"); else{ while(rawStreamZDC->Next()){ if(rawStreamZDC->IsChMapping()){ adcMod[ich] = rawStreamZDC->GetADCModFromMap(ich); adcCh[ich] = rawStreamZDC->GetADCChFromMap(ich); sigCode[ich] = rawStreamZDC->GetADCSignFromMap(ich); det[ich] = rawStreamZDC->GetDetectorFromMap(ich); sec[ich] = rawStreamZDC->GetTowerFromMap(ich); ich++; } } } // -------------------------------------------------------- // --- Writing ascii data file for the Shuttle preprocessor mapFile4Shuttle = fopen(MAPDATA_FILE,"w"); for(Int_t i=0; i mod %d ch %d, ch %d, code %d det %d, sec %d\n", // i,adcMod[i],adcCh[i],sigCode[i],det[i],sec[i]); } fclose(mapFile4Shuttle); } // SOD event else{ if(sodRead){ printf("\t SOR read -> exiting from DA\n"); break; } else continue; } iev++; } /* free resources */ free(event); } /* store the result files on FES */ status = daqDA_FES_storeFile(MAPDATA_FILE, MAPDATA_FILE); if(status){ printf("Failed to export file : %d\n",status); return -1; } return status; }