if(nInit==1)
stream<<"// "<< nEntries <<" DAC values fit: "<< fnbpf1 << " pts (1st order) " << nbpf2 << " pts (2nd order) DAC=0 excluded" << endl;
stream<<"// * nInit = " << nInit << " * f1nbp = " << fnbpf1 << " * f2nbp = " << nbpf2 << endl;
- stream<<"//" << endl;
stream<<"// RUN DAC " << endl;
stream<<"//-----------------" << endl;
Double_t xp[11], xpErr[11], yp[11], ypErr[11];
Int_t uncalcountertotal=0 ;
+ Int_t unparabolicfit=0;
while ( ( p = dynamic_cast<AliMUONVCalibParam*>(next() ) ) )
{
ped[0] = p;
+ unparabolicfit=0;
busPatchId = p->ID0();
manuId = p->ID1();
n++;
}
-
// print_peak_mean_values
if(fPrintLevel>1)
{
Int_t k = j + fnInit;
x[j] = pedMean[k];
if(x[j]<=0.){fitproceed=0; break;}
- if(x[j]== ADCMax())
+ if(x[j]>= ADCMax())
{
if(j < nbs-1){fitproceed=0; break;}
else nbpf2Dynamic=nbpf2-1;
a1 = par[1];
// 2. - Translation : new origin (xLim, yLim) + parabolic fit over nbf2 points
-
- if(nbpf2Dynamic > 1)
+ //checking: if(busPatchId ==1841 && manuId==4)nbpf2Dynamic=2;
+ if(nbpf2Dynamic > 2)
{
for (Int_t j = 0; j < nbpf2Dynamic; j++)
{
prChi2P2 = TMath::Prob(chi2P2, nbpf2Dynamic-1);
a2 = par[0];
}
+ else
+ {
+ unparabolicfit++;
+ (*fFilcout) << " Warning : BP = " << busPatchId << " Manu = " << manuId << " Channel = " << channelId <<": parabolic fit not possible (nbpf2=" << nbpf2Dynamic << ") => a2=0 and linear fit OK" << std::endl;
+ if(unparabolicfit==1) std::cout << " Warning : BP = " << busPatchId << " Manu = " << manuId << ": no parabolic fit for some channels (nbpf2=" << nbpf2Dynamic << "), linear fit is OK (see .log for details)" << std::endl;
+ a2=0. ; prChi2P2=0. ;
+ }
par[0] = a0;
par[1] = a1;
delete f2Calib;
}
}
-
-
tg->Fill();
}
-
-
pfilew << WriteGainData(busPatchId,manuId,channelId,par[1],par[2],threshold,q);
}
nmanu++;
- if(nmanu % 500 == 0)std::cout << " Nb manu = " << nmanu << std::endl;
+ Int_t step=500;
+ if(nmanu % step == 0)std::cout << " Nb manu = " << nmanu << std::endl;
}
// print in logfile
Int_t* runs(0x0);
Int_t* dac(0x0);
Int_t nDAC(0);
+ Int_t nInit(0),f1nbp(0),f2nbp(0);
while ( in.getline(line,1024) )
{
AliDebugClass(1,Form("runNumber is %d",runNumber));
}
}
+ if ( sline.Contains("* nInit =") )
+ {
+ sscanf(line,"// * nInit = %d * f1nbp = %d * f2nbp = %d",&nInit,&f1nbp,&f2nbp);
+ AliDebugClass(1,Form("nInit = %d",nInit));
+ AliDebugClass(1,Form("f1nbp = %d",f1nbp));
+ AliDebugClass(1,Form("f2nbp = %d",f2nbp));
+ }
if ( sline.Contains("DAC values") )
{
nDAC = TString(sline(2,sline.Length()-2)).Atoi();
{
comment += Form(";(RUN %d = DAC %d)",runs[i],dac[i]);
}
+ comment += Form(";(nDAC = %d)",nDAC);
+ comment += Form(";(nInit = %d)",nInit);
+ comment += Form(";(f1nbp = %d)",f1nbp);
+ comment += Form(";(f2nbp = %d)",f2nbp);
delete[] runs;
delete[] dac;
/*
Contact: Jean-Luc Charvet <jean-luc.charvet@cern.ch>
Link: http://aliceinfo.cern.ch/static/Offline/dimuon/muon_html/README_mchda.html
- Reference Run:
+ Reference Run: 104540
Run Type: PEDESTAL
DA Type: LDC
Number of events needed: 400 events for pedestal run
- Input Files: mutrkpedvalues and config_ldc-MTRK-S3-0
+ Input Files: /alice/cern.ch/user/j/jcharvet/mutrkpedvalues and /alice/cern.ch/user/j/jcharvet/config_ldc-MTRK-S0-0
Output Files: local dir (not persistent) -> MUONTRKPEDda.ped FXS -> run<#>_MCH_<ldc>_PEDESTALS
Trigger types used:
*/
/*
-------------------------------------------------------------------------
- 2009-11-05 New version: MUONTRKPEDda.cxx,v 1.4
+ 2010-01-13 New version: MUONTRKPEDda.cxx,v 1.5
-------------------------------------------------------------------------
Version for MUONTRKPEDda MUON tracking
Int_t nEventsRecovered = 0;
Int_t nEvents = 0;
UInt_t runNumber = 0;
- Int_t nConfig = 1;
+ Int_t nConfig = 1, writeConfig=0;
ofstream filcout;
// decode the input line
// nConfig=1 : Reading configuration (or not) status via "mutrkpedvalues" file located in DetDB
if(nConfig)
{
- sprintf(dbfile,"mutrkpedvalues");
- status=daqDA_DB_getFile(dbfile,dbfile);
- if(status) {printf(" Failed : input file %s is missing, status = %d\n",dbfile,status); return -1; }
- ifstream filein(dbfile,ios::in);
- filein >> nConfig;
- printf(" *** Copy: %s from DetDB to working directory *** Config= %d\n",dbfile,nConfig);
- }
- else
- {
- printf(" *** Config= %d: no configuration ascii file is used \n",nConfig);
+ sprintf(dbfile,"mutrkpedvalues");
+ status=daqDA_DB_getFile(dbfile,dbfile);
+ if(status) {printf(" !!! Failed : input file %s is missing, status = %d\n",dbfile,status); return -1; }
+ ifstream filein(dbfile,ios::in);
+ filein >> nConfig;
+ filein >> writeConfig; // default=0, if 1 : current configuration file written in the Det.DataBase at the end of the DA
+ printf(" *** Copy: %s from DetDB to working directory *** Config= %d writeConfig=%d\n",dbfile,nConfig,writeConfig);
}
+ else printf(" *** Config= %d: no configuration ascii file is used \n",nConfig);
muonPedestal->SetconfigDA(nConfig);
// nConfig=1: configuration ascii file read from DetDB
if(nConfig)
{
- // MuonTrk Configuration ascii file (initCROCUS.dat -> ascii file = config_$DATE_ROLE_NAME)
- sprintf(dbfile,"config_%s",getenv("DATE_ROLE_NAME"));
- status=daqDA_DB_getFile(dbfile,dbfile);
- if(status) {printf(" Failed : Configuration file %s is missing, status = %d\n",dbfile,status); return -1; }
- else printf(" *** Copy ascii config file: %s from DetDB to working directory and reading ...*** \n",dbfile);
- muonPedestal->LoadConfig(dbfile);
+ // MuonTrk Configuration ascii file (initCROCUS.dat -> ascii file = config_$DATE_ROLE_NAME)
+ sprintf(dbfile,"config_%s",getenv("DATE_ROLE_NAME"));
+ status=daqDA_DB_getFile(dbfile,dbfile);
+ if(status) {printf(" !!! Failed : Configuration file %s is missing, status = %d\n",dbfile,status); return -1; }
+ else printf(" *** Copy ascii config file: %s from DetDB to working directory and reading ...*** \n",dbfile);
+ muonPedestal->LoadConfig(dbfile);
}
// Rawdeader, RawStreamHP
// Copying files to local DB folder defined by DAQ_DETDB_LOCAL
Char_t *dir;
dir= getenv("DAQ_DETDB_LOCAL");
- unsigned int nLastVersions=90;
+ unsigned int nLastVersions=50;
cout << "\n *** Local DataBase: " << dir << " (Max= " << nLastVersions << ") ***" << endl;
status = daqDA_localDB_storeFile(muonPedestal->GetHistoFileName(),nLastVersions);
if(status)printf(" Store file : %s status = %d\n",muonPedestal->GetHistoFileName(),status);
// Transferring to OCDB via the SHUTTLE (be sure that env variable DAQDALIB_PATH is set)
printf("\n ***** STORE FILE in FES ****** \n");
status = daqDA_FES_storeFile(shuttleFile.Data(),"PEDESTALS");
- if (status) { printf(" Failed to export file : %s , status = %d\n",shuttleFile.Data(),status); return -1; }
+ if (status) { printf(" !!! Failed to export file : %s , status = %d\n",shuttleFile.Data(),status); return -1; }
else printf(" %s successfully exported to FES \n",shuttleFile.Data());
+ // Transferring to DetectorDataBase the configuration file if changed
+ if(writeConfig)
+ {
+ printf("\n ***** New detector configuration : STORE Config FILE in Detector DataBase ****** \n");
+ Char_t DAdbfile[256]="";
+ // TString DAdbfile=Form("DA_config_%s",getenv("DATE_ROLE_NAME")) ;
+ sprintf(DAdbfile,"DA_config_%s",getenv("DATE_ROLE_NAME"));
+ status=daqDA_DB_storeFile(dbfile,DAdbfile);
+ if(status) {printf(" !!! Failed : Pb to store config. file %s in DetDB (%s), status = %d\n",dbfile,DAdbfile,status); return -1; }
+ else printf(" Copy ascii current config file: %s to %s in DetDB \n",dbfile,DAdbfile);
+ }
+
printf("\n ######## End execution : %s ######## \n",prefixDA);
timers.Stop();
printf("\nExecution time : R:%7.2fs C:%7.2fs\n", timers.RealTime(), timers.CpuTime());