Trigger Types Used: Standalone Trigger
*/
+#define PEDDATA_FILE "ZDCPedestal.dat"
+#define MAPDATA_FILE "ZDCChMapping.dat"
+#define EMDDATA_FILE "ZDCEMDCalib.dat"
#include <stdio.h>
#include <Riostream.h>
}
FILE *mapFile4Shuttle;
- const char *mapfName = "ZDCChMapping.dat";
- /* define data source : this is argument 1 */
- status = monitorSetDataSource( argv[1] );
- if(status!=0) {
- printf("monitorSetDataSource() failed : %s\n",monitorDecodeError(status));
+ // *** To analyze LASER events you MUST have a pedestal data file!!!
+ // *** -> check if a pedestal run has been analyzied
+ int read = 0;
+ read = daqDA_DB_getFile(PEDDATA_FILE,PEDDATA_FILE);
+ if(read){
+ printf("\t ERROR!!! ZDCPedestal.dat file NOT FOUND in DAQ db!!!\n");
return -1;
}
-
-
- /* declare monitoring program */
- status = monitorDeclareMp( __FILE__ );
- if (status!=0) {
- printf("monitorDeclareMp() failed : %s\n",monitorDecodeError(status));
+ else printf("\t ZDCPedestal.dat file retrieved from DAQ db\n");
+
+ FILE *filePed = fopen(PEDDATA_FILE,"r");
+ if (filePed==NULL) {
+ printf("\t ERROR!!! Can't open ZDCPedestal.dat file!!!\n");
return -1;
}
+ // 144 = 48 in-time + 48 out-of-time + 48 correlations
+ Float_t readValues[2][144], MeanPed[44], MeanPedWidth[44],
+ MeanPedOOT[44], MeanPedWidthOOT[44];
+ // ***************************************************
+ // Unless we have a narrow correlation to fit we
+ // don't fit and store in-time vs. out-of-time
+ // histograms -> mean pedstal subtracted!!!!!!
+ // ***************************************************
+ //Float_t CorrCoeff0[44], CorrCoeff1[44];
+ //
+ for(int jj=0; jj<144; jj++){
+ for(int ii=0; ii<2; ii++){
+ fscanf(filePed,"%f",&readValues[ii][jj]);
+ }
+ if(jj<48){
+ MeanPed[jj] = readValues[0][jj];
+ MeanPedWidth[jj] = readValues[1][jj];
+ //printf("\t MeanPed[%d] = %1.1f\n",jj, MeanPed[jj]);
+ }
+ else if(jj>48 && jj<96){
+ MeanPedOOT[jj-48] = readValues[0][jj];
+ MeanPedWidthOOT[jj-48] = readValues[1][jj];
+ }
+ /*else if(jj>144){
+ CorrCoeff0[jj-96] = readValues[0][jj];
+ CorrCoeff1[jj-96] = readValues[1][jj];;
+ }
+ */
+ }
- /* define wait event timeout - 1s max */
- monitorSetNowait();
- monitorSetNoWaitNetworkTimeout(1000);
-
-
- /* log start of process */
- printf("ZDC EMD monitoring program started\n");
-
/* report progress */
daqDA_progressReport(10);
Int_t ich=0, adcMod[48], adcCh[48], sigCode[48], det[48], sec[48];
if(eventT==START_OF_DATA){
+
+ rawStreamZDC->SetSODReading(kTRUE);
if(!rawStreamZDC->Next()) printf(" \t No raw data found!! \n");
else{
}
// --------------------------------------------------------
// --- Writing ascii data file for the Shuttle preprocessor
- mapFile4Shuttle = fopen(mapfName,"w");
+ mapFile4Shuttle = fopen(MAPDATA_FILE,"w");
for(Int_t i=0; i<ich; i++){
fprintf(mapFile4Shuttle,"\t%d\t%d\t%d\t%d\t%d\t%d\n",i,
adcMod[i],adcCh[i],sigCode[i],det[i],sec[i]);
}
if(eventT==PHYSICS_EVENT){
- //
- // *** To analyze EMD events you MUST have a pedestal data file!!!
- // *** -> check if a pedestal run has been analyzied
- FILE *filePed=NULL;
- filePed=fopen("./ZDCPedestal.dat","r");
- if (filePed==NULL) {
- printf("\t ERROR!!! You MUST have a ZDCPedestal.dat file!!!\n");
- return -1;
- }
- // 144 = 48 in-time + 48 out-of-time + 48 correlations
- Float_t readValues[2][144], MeanPed[44], MeanPedWidth[44],
- MeanPedOOT[44], MeanPedWidthOOT[44],
- CorrCoeff0[44], CorrCoeff1[44];
- //
- for(int jj=0; jj<144; jj++){
- for(int ii=0; ii<2; ii++){
- fscanf(filePed,"%f",&readValues[ii][jj]);
- }
- if(jj<48){
- MeanPed[jj] = readValues[0][jj];
- MeanPedWidth[jj] = readValues[1][jj];
- }
- else if(jj>48 && jj<96){
- MeanPedOOT[jj-48] = readValues[0][jj];
- MeanPedWidthOOT[jj-48] = readValues[1][jj];
- }
- else if(jj>144){
- CorrCoeff0[jj-96] = readValues[0][jj];
- CorrCoeff1[jj-96] = readValues[1][jj];;
- }
- }
- //
-
- // --- Reading data header
- reader->ReadHeader();
+ // --- Reading data header
+ reader->ReadHeader();
const AliRawDataHeader* header = reader->GetDataHeader();
if(header){
UChar_t message = header->GetAttributes();
printf("\t ATTENTION! No Raw Data Header found!!!\n");
return -1;
}
+
+ rawStreamZDC->SetSODReading(kTRUE);
if (!rawStreamZDC->Next()) printf(" \t No raw data found!! ");
//
/* Analysis of the histograms */
//
FILE *fileShuttle;
- const char *fName = "ZDCPedestal.dat";
- fileShuttle = fopen(fName,"w");
+ fileShuttle = fopen(EMDDATA_FILE,"w");
//
Int_t BinMax[4];
Float_t YMax[4];
//printf("\n\t Mean Value from gaussian fit = %f\n", MeanFitVal[k]);
}
//
- Float_t CalibCoeff[6];
- /*for(Int_t j=0; j<6; j++){
- if(j<4) CalibCoeff[j] = MeanFitVal[j];
- else CalibCoeff[j] = 1.;
- fprintf(fileShuttle,"\t%f\n",CalibCoeff[j]);
- }
- */
- // --- For the moment we have sim data only for ZN1!!!
- for(Int_t j=0; j<6; j++){
- if(j==0) CalibCoeff[j] = MeanFitVal[j];
- else if(j>0 && j<4) CalibCoeff[j] = CalibCoeff[0];
- else CalibCoeff[j] = 1.;
- fprintf(fileShuttle,"\t%f\n",CalibCoeff[j]);
+ Float_t CalibCoeff[6];
+ Float_t icoeff[5];
+ //
+ for(Int_t j=0; j<10; j++){
+ if(j<4){
+ CalibCoeff[j] = MeanFitVal[j];
+ fprintf(fileShuttle,"\t%f\n",CalibCoeff[j]);
+ }
+ // ZEM calib. coeff. = 1
+ else if(j==4 || j==5){
+ CalibCoeff[j] = 1.;
+ fprintf(fileShuttle,"\t%f\n",CalibCoeff[j]);
+ }
+ // Note -> For the moment the inter-calibration
+ // coefficients are set to 1
+ else if(j>5){
+ for(Int_t k=0; k<5; k++){
+ icoeff[k] = 1.;
+ fprintf(fileShuttle,"\t%f",icoeff[k]);
+ if(k==4) fprintf(fileShuttle,"\n");
+ }
+ }
}
//
fclose(fileShuttle);
daqDA_progressReport(90);
/* store the result file on FES */
- status = daqDA_FES_storeFile(mapfName,"ZDCCHMAPPING_data");
+ status = daqDA_FES_storeFile(MAPDATA_FILE, MAPDATA_FILE);
if(status){
printf("Failed to export file : %d\n",status);
return -1;
}
//
- status = daqDA_FES_storeFile(fName,"ZDCEMD_data");
+ status = daqDA_FES_storeFile(EMDDATA_FILE, EMDDATA_FILE);
if(status){
printf("Failed to export file : %d\n",status);
return -1;