#include <Riostream.h>
#include <sstream>
-//
-//AMORE
-//
-#ifdef ALI_AMORE
-#include <AmoreDA.h>
-#include "TSystem.h"
-#endif
#define NFITPARAMS 4
+ Finalize();
+ MakeControlHistos();
if(fPrintLevel>0)
{
// compute and store mean DAC values (like pedestals)
- sprintf(flatFile,"%s_%d.ped",fprefixDA,fRunNumber);
+ sprintf(flatFile,"%s.ped",fprefixDA);
outputFile=flatFile;
cout << "\n" << fprefixDA << " : Flat file generated : " << flatFile << "\n";
- MakePedStore(outputFile);
+ if (!outputFile.IsNull())
+ {
+ ofstream out(outputFile.Data());
+ MakeASCIIoutput(out);
+ out.close();
+ }
}
- else
- MakePedStore("");
TString mode("UPDATE");
}
-//__________
+//_______________________________________________________________________________
void AliMUONGain::MakeGainStore(TString shuttleFile)
{
/// Store gains in ASCII files
FILE *pfilen = 0;
if(fPrintLevel>1)
{
- sprintf(filename,"%s_%d.param",fprefixDA,fRunNumber);
+ sprintf(filename,"%s.param",fprefixDA);
cout << " Second fit parameter file = " << filename << "\n";
pfilen = fopen (filename,"w");
}
-
-
- // Write Ascii file -> Shuttle
+ // file outputs for gain
ofstream pfilew;
pfilew.open(shuttleFile.Data());
+ // Write Header Data of the .par file
pfilew << WriteGainHeader(fnInit,nEntries,nbpf2,numrun,injCharge);
-#ifdef ALI_AMORE
- ostringstream stringout; // String to be sent to AMORE_DB
- stringout << WriteGainHeader(fnInit,nEntries,nbpf2,numrun,injCharge);
-#endif
// print mean and sigma values in file
FILE *pfilep = 0;
if(fPrintLevel>1)
{
- sprintf(filename,"%s_%d.peak",fprefixDA,fRunNumber);
+ sprintf(filename,"%s.peak",fprefixDA);
cout << " File containing Peak mean values = " << filename << "\n";
pfilep = fopen (filename,"w");
TTree* tg = 0x0;
if(fPlotLevel>0)
{
- sprintf(fHistoFileName,"%s_%d.root",fprefixDA,fRunNumber);
+ sprintf(fHistoFileName,"%s.root",fprefixDA);
gainFile = new TFile(fHistoFileName,"RECREATE","MUON Tracking gains");
tg = new TTree("tg","TTree avec class Manu_DiMu");
{
Int_t k = j + fnInit;
x[j] = pedMean[k];
- if(x[j]==0.)fitproceed=0;
+ if(x[j]==0. || x[j]== kADCMax)fitproceed=0;
xErr[j] = pedSigma[k];
y[j] = injCharge[k];
yErr[j] = injChargeErr[k];
}
- tempstring = WriteGainData(busPatchId,manuId,channelId,par[1],par[2],threshold,q);
- pfilew << tempstring;
-#ifdef ALI_AMORE
- stringout << tempstring;
-#endif
-
+ pfilew << WriteGainData(busPatchId,manuId,channelId,par[1],par[2],threshold,q);
}
nmanu++;
if(nmanu % 500 == 0)std::cout << " Nb manu = " << nmanu << std::endl;
<< " mV/fC (capa= " << capaManu << " pF)"
<< " Prob(chi2)> = " << meanProbChi2 << endl;
- // file outputs for gain
-
pfilew.close();
-#ifdef ALI_AMORE
- //
- //Send objects to the AMORE DB
- //
- const char *role=gSystem->Getenv("AMORE_DA_NAME");
- if ( role ){
- amore::da::AmoreDA amoreDA(amore::da::AmoreDA::kSender);
-// TObjString peddata(stringout.str().c_str());
- TObjString gaindata(stringout.str().c_str());
- Int_t status =0;
- status = amoreDA.Send("Pedestals",&gaindata);
- if ( status )
- cout << "Warning: Failed to write Pedestals in the AMORE database : " << status << endl;
- }
- else {
- cout << "Warning: environment variable 'AMORE_DA_NAME' not set. Cannot write to the AMORE database" << endl;
- }
-#endif
if(fPlotLevel>0){tg->Write();histoFile->Close();}
if(fPrintLevel>1){fclose(pfilep); fclose(pfilen);}