//___________________________________________________
// Get parameters from V00DAEqualFactors.config file
+ Int_t neventsMin = 2000;
Int_t kStartClock = 9; // First clock in the search for max adc
Int_t kEndClock = 11; // Last clock in the search for max adc
} else {
/* open the config file and retrieve cuts */
FILE *fpConfig = fopen("V00DAEqualFactors.config","r");
- int res = fscanf(fpConfig,"%d %d %d %d %hhu %d %f",
- &kStartClock,&kEndClock,&kNPreClocks,&kNPostClocks,&kNFlagsCut,&kNBins,&kRange);
- if(res!=7) {
- printf("Failed to get values from Config file (V00DAEqualFactors.config): wrong file format - 6 integers and 1 float are expected - \n");
+ int res = fscanf(fpConfig,"%d %d %d %d %d %hhu %d %f",
+ &neventsMin,&kStartClock,&kEndClock,&kNPreClocks,&kNPostClocks,&kNFlagsCut,&kNBins,&kRange);
+ if(res!=8) {
+ printf("Failed to get values from Config file (V00DAEqualFactors.config): wrong file format - 7 integers and 1 float are expected - \n");
}
fclose(fpConfig);
}
- printf("First LHC Clock = %d; Last LHC Clock = %d; N Pre Clock = %d ; N Post Clock = %d; Minimum number of TDC flags = %hhu; Number of histogram bins = %d; Histogram range = %.3f\n",
- kStartClock, kEndClock, kNPreClocks, kNPostClocks, kNFlagsCut, kNBins, kRange);
+ printf("Minimum number of events to process = %d; First LHC Clock = %d; Last LHC Clock = %d; N Pre Clock = %d; N Post Clock = %d; Minimum number of TDC flags = %hhu; Number of histogram bins = %d; Histogram range = %.3f\n",
+ neventsMin,kStartClock, kEndClock, kNPreClocks, kNPostClocks, kNFlagsCut, kNBins, kRange);
TH1D *fMedian[64];
for(Int_t j = 0; j < 64; ++j) fMedian[j] = new TH1D(Form("fMedian_%d",j),"Slopes weighted median, channel par channel",kNBins,0,kRange);
monitorSetNoWaitNetworkTimeout(1000);
/* init counters on events */
+ int neventsPhysicsAll=0;
int neventsPhysics=0;
int neventsTotal=0;
AliVZERORawStream* rawStream = new AliVZERORawStream(rawReader);
if (rawStream->Next()) {
+ neventsPhysicsAll++;
UShort_t triggers = rawStream->GetTriggerInputs();
UChar_t nFlags = 0;
for(Int_t i = 0; i < 64; ++i) {
} // loop over events
- printf("%d physics events processed\n",neventsPhysics);
+ printf("%d physics events processed (out of %d physics and %d total events)\n",neventsPhysics,neventsPhysicsAll,neventsTotal);
//___________________________________________________________________________
// Computes regression parameters
// charge_i = p0 + charge_tot * p1
- if(neventsPhysics>2000){
+ if(neventsPhysics>neventsMin){
/* open result file to be exported to FES */
FILE *fp=NULL;
fp=fopen("./V0_EqualizationFactors.dat","w");
for(int i = 0; i < 64; ++i) fMedian[i]->GetQuantiles(1,&beta[i],&q);
for(Int_t i=0; i<64; i++) {
- fprintf(fp," %d %.3f\n",GetOfflineChannel(i), beta[i]*64.);
- printf(" %d %.3f\n",GetOfflineChannel(i), beta[i]*64.);
+ fprintf(fp," %d %.5f\n",GetOfflineChannel(i), beta[i]*64.);
+ printf(" %d %.5f\n",GetOfflineChannel(i), beta[i]*64.);
}
/* close local result file and FXS result file*/
fclose(fp);
- }
-
-//________________________________________________________________________
- /* export result file to FES */
- status=daqDA_FES_storeFile("./V0_EqualizationFactors.dat","V00DAEqualFactors");
- if (status) {
- printf("Failed to export file : %d\n",status);
- return -1; }
-
- /* store result file into Online DB */
- status=daqDA_DB_storeFile("./V0_EqualizationFactors.dat","V00DAEqualFactors");
- if (status) {
- printf("Failed to store file into Online DB: %d\n",status);
- return -1; }
+ /* export result file to FES */
+ status=daqDA_FES_storeFile("./V0_EqualizationFactors.dat","V00DAEqualFactors");
+ if (status) {
+ printf("Failed to export file : %d\n",status);
+ return -1; }
+
+ /* store result file into Online DB */
+ status=daqDA_DB_storeFile("./V0_EqualizationFactors.dat","V00DAEqualFactors");
+ if (status) {
+ printf("Failed to store file into Online DB: %d\n",status);
+ return -1; }
+ }
+ else {
+ // Take the last run's file from the DB
+ status=daqDA_DB_getFile("V00DAEqualFactors","./V0_EqualizationFactors.dat");
+ if (status) {
+ printf("Failed to get file from Online DB: %d\n",status);
+ return -1; }
+
+ /* export result file to FES */
+ status=daqDA_FES_storeFile("./V0_EqualizationFactors.dat","V00DAEqualFactors");
+ if (status) {
+ printf("Failed to export file : %d\n",status);
+ return -1; }
+ }
return status;
}