//______________________________________________________________________________
TString AliMUONGain::WriteGainHeader(Int_t nInit, Int_t nEntries, Int_t nbpf2, Int_t *numrun, Double_t *injCharge)
{
-///
+/// Header of the calibration output file
ostringstream stream;
- stream<<"//================================================" << endl;
- stream<<"// Calibration file calculated by MUONTRKda" << endl;
- stream<<"//=================================================" << endl;
+ stream<<"//=======================================================" << endl;
+ stream<<"// Calibration file calculated by " << fprefixDA <<endl;
+ stream<<"//=======================================================" << endl;
stream<<"// * Run : " << fRunNumber << endl;
stream<<"// * Date : " << fDate->AsString("l") <<endl;
stream<<"// * Statictics : " << fNEvents << endl;
- stream<<"// * # of MANUS : " << fNManu << endl;
+ if(fConfig)
+ stream<<"// * # of MANUS : " << fNManu_config << " read in the Det. config. " << endl;
+ stream<<"// * # of MANUS : " << fNManu << " read in raw data " << endl;
+ stream<<"// * # of MANUS : " << fNChannel/64 << " written in calibration file " << endl;
stream<<"// * # of channels : " << fNChannel << endl;
- stream<<"//-------------------------------------------------" << endl;
+ stream<<"//-------------------------------------------------------" << endl;
if(nInit==0)
stream<<"// "<< nEntries <<" DAC values fit: "<< fnbpf1 << " pts (1st order) " << nbpf2 << " pts (2nd order)" << endl;
//______________________________________________________________________________
TString AliMUONGain::WriteGainData(Int_t BP, Int_t Manu, Int_t ch, Double_t p1, Double_t p2, Int_t threshold, Int_t q)
{
-///
+/// Write calibration parameters per channel
ostringstream stream("");
stream << Form("%4i %5i %2i %7.4f %10.3e %4i %2x\n",BP,Manu,ch,p1,p2,threshold,q);
// Fit with a polynomial fct
// store the result in a flat file.
+ if(fIndex==0)cout << " Root data file = " << fRootDataFileName << endl;
TFile* histoFile = new TFile(fRootDataFileName);
AliMUON2DMap* map[11];
{
Int_t k = j + fnInit;
x[j] = pedMean[k];
- if(x[j]==0. || x[j]== kADCMax)fitproceed=0;
+ if(x[j]<=0. || x[j]== kADCMax)fitproceed=0;
xErr[j] = pedSigma[k];
y[j] = injCharge[k];
yErr[j] = injChargeErr[k];
fRunNumber(0),
fNChannel(0),
fNManu(0),
+fNManu_config(0),
fErrorBuspatchTable(new AliMUON2DMap(kFALSE)),
fManuBuspatchTable(new AliMUON2DMap(kFALSE)),
+fManuBPoutofconfigTable(new AliMUON2DMap(kFALSE)),
fDate(new TTimeStamp()),
fFilcout(0),
fPedestalStore(new AliMUON2DMap(kTRUE)),
-fIndex(-1)
+fIndex(-1),
+fConfig(1)
{
/// Default constructor
sprintf(fHistoFileName," ");
delete fErrorBuspatchTable;
delete fManuBuspatchTable;
delete fPedestalStore;
+ delete fManuBPoutofconfigTable;
}
+//______________________________________________________________________________
+void AliMUONPedestal::Load_config(char* dbfile)
+{
+ /// Load MUONTRK configuration from ascii file "dbfile" (in DetDB)
+
+ Int_t manuId;
+ Int_t busPatchId;
+
+ ifstream fileinit(dbfile,ios::in);
+ while (!fileinit.eof())
+ {
+ fileinit >> busPatchId >> manuId;
+
+ AliMUONErrorCounter* manuCounter;
+ AliMUONVCalibParam* ped =
+ static_cast<AliMUONVCalibParam*>(fPedestalStore ->FindObject(busPatchId, manuId));
+
+ if (!ped) {
+ fNManu_config++;
+ fNChannel+=64;
+ ped = new AliMUONCalibParamND(2, kNChannels,busPatchId, manuId, -1.); // put default wise -1, not connected channel
+ fPedestalStore ->Add(ped);
+
+ if (!(manuCounter = static_cast<AliMUONErrorCounter*>(fManuBuspatchTable->FindObject(busPatchId,manuId))))
+ {
+ // New (buspatch,manu)
+ manuCounter = new AliMUONErrorCounter(busPatchId,manuId);
+ fManuBuspatchTable->Add(manuCounter);
+ }
+ }
+ }
+}
//______________________________________________________________________________
void AliMUONPedestal::MakePed(Int_t busPatchId, Int_t manuId, Int_t channelId, Int_t charge)
{
AliMUONVCalibParam* ped =
static_cast<AliMUONVCalibParam*>(fPedestalStore ->FindObject(busPatchId, manuId));
- if (!ped) {
- fNManu++;
- ped = new AliMUONCalibParamND(2, kNChannels,busPatchId, manuId, -1.); // put default wise -1, not connected channel
- fPedestalStore ->Add(ped);
- }
+ if (!ped)
+ {
+ if(fConfig)
+ { // Fill out_of_config (buspatch,manu) table
+ if (!(static_cast<AliMUONErrorCounter*>(fManuBPoutofconfigTable->FindObject(busPatchId,manuId))))
+ fManuBPoutofconfigTable->Add(new AliMUONErrorCounter(busPatchId,manuId));
+ cout << " !!! WARNING : busPatchId = " << busPatchId << " manuId = " << manuId << " not in the Detector configuration " << endl;
+ }
+ else {fNManu++;}
+ fNChannel+=64;
+ // put default wise -1, not connected channel
+ ped = new AliMUONCalibParamND(2, kNChannels,busPatchId, manuId, -1.);
+ fPedestalStore ->Add(ped);
+ }
// Initialization for the first value
- if (ped->ValueAsDouble(channelId, 0) == -1) ped->SetValueAsDouble(channelId, 0, 0.);
+ if (ped->ValueAsDouble(channelId, 0) == -1)
+ {
+ if(fConfig && channelId == 0){fNManu++;}
+ ped->SetValueAsDouble(channelId, 0, 0.);
+ }
if (ped->ValueAsDouble(channelId, 1) == -1) ped->SetValueAsDouble(channelId, 1, 0.);
Double_t pedMean = ped->ValueAsDouble(channelId, 0) + (Double_t) charge;
manuCounter->Increment();
}
}
-
//______________________________________________________________________________
void AliMUONPedestal::Finalize()
{
// print in logfile
if (fErrorBuspatchTable->GetSize())
- {
- cout<<"\n* Buspatches with less statistics (due to parity errors)"<<endl;
- (*fFilcout)<<"\n* Buspatches with less statistics (due to parity errors)"<<endl;
- TIter nextParityError(fErrorBuspatchTable->CreateIterator());
- AliMUONErrorCounter* parityerror;
- while((parityerror = static_cast<AliMUONErrorCounter*>(nextParityError())))
{
- cout<<" bp "<<parityerror->BusPatch()<<": events used = "<<fNEvents-parityerror->Events()<<endl;
- (*fFilcout)<<" bp "<<parityerror->BusPatch()<<": events used = "<<fNEvents-parityerror->Events()<<endl;
+ cout<<"\n* Buspatches with less statistics (due to parity errors)"<<endl;
+ (*fFilcout)<<"\n* Buspatches with less statistics (due to parity errors)"<<endl;
+ TIter nextParityError(fErrorBuspatchTable->CreateIterator());
+ AliMUONErrorCounter* parityerror;
+ while((parityerror = static_cast<AliMUONErrorCounter*>(nextParityError())))
+ {
+ cout<<" bp "<<parityerror->BusPatch()<<": events used = "<<fNEvents-parityerror->Events()<<endl;
+ (*fFilcout)<<" bp "<<parityerror->BusPatch()<<": events used = "<<fNEvents-parityerror->Events()<<endl;
+ }
}
- }
-// iterator over pedestal
+ // iterator over pedestal
TIter next(fPedestalStore ->CreateIterator());
AliMUONVCalibParam* ped;
while ( ( ped = dynamic_cast<AliMUONVCalibParam*>(next() ) ) )
- {
- busPatchId = ped->ID0();
- manuId = ped->ID1();
- if(manuId==0)
- {
- cout << " !!! BIG WARNING: ManuId = " << manuId << " !!! in BP = " << busPatchId << endl;
- (*fFilcout) << " !!! BIG WARNING: ManuId = " << manuId << " !!! in BP = " << busPatchId << endl;
- }
- Int_t eventCounter;
- // Correct the number of events for buspatch with errors
- AliMUONErrorCounter* errorCounter;
- if ((errorCounter = (AliMUONErrorCounter*)fErrorBuspatchTable->FindObject(busPatchId)))
- {
- eventCounter = fNEvents - errorCounter->Events();
- }
- else
{
- eventCounter = fNEvents;
- }
-
- Int_t occupancy;
- // value of (buspatch, manu) occupancy
- AliMUONErrorCounter* manuCounter;
- manuCounter = static_cast<AliMUONErrorCounter*>(fManuBuspatchTable->FindObject(busPatchId,manuId));
- occupancy = manuCounter->Events()/64/eventCounter;
- if(occupancy>1)
- {
- cout << " !!! BIG WARNING: ManuId = " << manuId << " !!! in BP = " << busPatchId << " occupancy (>1) = " << occupancy << endl;
- (*fFilcout) << " !!! BIG WARNING: ManuId = " << manuId << " !!! in BP = " << busPatchId << " occupancy (>1) = " << occupancy <<endl;
- }
-
- for (channelId = 0; channelId < ped->Size() ; ++channelId)
- {
- pedMean = ped->ValueAsDouble(channelId, 0);
-
- if (pedMean > 0) // connected channels
- {
- ped->SetValueAsDouble(channelId, 0, pedMean/(Double_t)eventCounter);
+ busPatchId = ped->ID0();
+ manuId = ped->ID1();
+ if(manuId==0)
+ {
+ cout << " !!! BIG WARNING: ManuId = " << manuId << " !!! in BP = " << busPatchId << endl;
+ (*fFilcout) << " !!! BIG WARNING: ManuId = " << manuId << " !!! in BP = " << busPatchId << endl;
+ }
+ Int_t eventCounter;
+ // Correct the number of events for buspatch with errors
+ AliMUONErrorCounter* errorCounter;
+ if ((errorCounter = (AliMUONErrorCounter*)fErrorBuspatchTable->FindObject(busPatchId)))
+ {
+ eventCounter = fNEvents - errorCounter->Events();
+ }
+ else
+ {
+ eventCounter = fNEvents;
+ }
+
+ Int_t occupancy=0; // channel missing in raw data or read but rejected (case of parity error)
+ // value of (buspatch, manu) occupancy
+ AliMUONErrorCounter* manuCounter;
+ manuCounter = static_cast<AliMUONErrorCounter*>(fManuBuspatchTable->FindObject(busPatchId,manuId));
+ if(eventCounter>0)occupancy = manuCounter->Events()/64/eventCounter;
+ if(occupancy>1)
+ {
+ cout << " !!! BIG WARNING: ManuId = " << manuId << " !!! in BP = " << busPatchId << " occupancy (>1) = " << occupancy << endl;
+ (*fFilcout) << " !!! BIG WARNING: ManuId = " << manuId << " !!! in BP = " << busPatchId << " occupancy (>1) = " << occupancy <<endl;
+ }
+
+ for (channelId = 0; channelId < ped->Size() ; ++channelId)
+ {
pedMean = ped->ValueAsDouble(channelId, 0);
- pedSigma = ped->ValueAsDouble(channelId, 1);
- ped->SetValueAsDouble(channelId, 1, TMath::Sqrt(TMath::Abs(pedSigma/(Double_t)eventCounter - pedMean*pedMean)));
- if(manuId == 0 || occupancy>1)
- {
+
+ if (pedMean > 0) // connected channels
+ {
+ ped->SetValueAsDouble(channelId, 0, pedMean/(Double_t)eventCounter);
+ pedMean = ped->ValueAsDouble(channelId, 0);
+ pedSigma = ped->ValueAsDouble(channelId, 1);
+ ped->SetValueAsDouble(channelId, 1, TMath::Sqrt(TMath::Abs(pedSigma/(Double_t)eventCounter - pedMean*pedMean)));
+ if(manuId == 0)
+ {
+ ped->SetValueAsDouble(channelId, 0, kADCMax);
+ ped->SetValueAsDouble(channelId, 1, kADCMax);
+ }
+ if(occupancy>1)
+ {
+ ped->SetValueAsDouble(channelId, 0, kADCMax);
+ ped->SetValueAsDouble(channelId, 1, kADCMax);
+ if(channelId==0)ped->SetValueAsDouble(channelId, 0, kADCMax+occupancy);
+ }
+ }
+ else
+ {
ped->SetValueAsDouble(channelId, 0, kADCMax);
ped->SetValueAsDouble(channelId, 1, kADCMax);
- }
- }
- else
- {
- ped->SetValueAsDouble(channelId, 0, kADCMax);
- ped->SetValueAsDouble(channelId, 1, kADCMax);
- }
+ }
+ }
}
- }
}
-
//______________________________________________________________________________
void AliMUONPedestal::MakeASCIIoutput(ostream& out) const
{
-/// put pedestal store in the output stream
+ /// put pedestal store in the output stream
out<<"//===========================================================================" << endl;
- out<<"// Pedestal file calculated by MUONTRKda"<<endl;
+ out<<"// Pedestal file calculated by "<< fprefixDA << endl;
out<<"//===========================================================================" << endl;
out<<"// * Run : " << fRunNumber << endl;
out<<"// * Date : " << fDate->AsString("l") <<endl;
out<<"// * Statictics : " << fNEvents << endl;
- out<<"// * # of MANUS : " << fNManu << endl;
+ if(fConfig)
+ out<<"// * # of MANUS : " << fNManu_config << " read in the Det. config. " << endl;
+ out<<"// * # of MANUS : " << fNManu << " read in raw data " << endl;
+ out<<"// * # of MANUS : " << fNChannel/64 << " written in pedestal file " << endl;
out<<"// * # of channels : " << fNChannel << endl;
if (fErrorBuspatchTable->GetSize())
- {
- out<<"//"<<endl;
- out<<"// * Buspatches with less statistics (due to parity errors)"<<endl;
- TIter next(fErrorBuspatchTable->CreateIterator());
- AliMUONErrorCounter* parityerror;
- while((parityerror = static_cast<AliMUONErrorCounter*>(next())))
{
- out<<"// bp "<<parityerror->BusPatch()<<" events used "<<fNEvents-parityerror->Events()<<endl;
+ out<<"//"<<endl;
+ out<<"// * Buspatches with less statistics (due to parity errors)"<<endl;
+ TIter next(fErrorBuspatchTable->CreateIterator());
+ AliMUONErrorCounter* parityerror;
+ while((parityerror = static_cast<AliMUONErrorCounter*>(next())))
+ {
+ out<<"// BusPatch = "<<parityerror->BusPatch()<<"\t Nevents used = "<<fNEvents-parityerror->Events()<<endl;
+ }
+ }
+
+ out<<"//"<<endl;
+ out<<"// * Puzzling (Buspatch,Manu) read in raw data ?"<<endl;
+ Int_t occupancy=1;
+ if(occupancy){
+ TIter next(fPedestalStore ->CreateIterator());
+ AliMUONVCalibParam* ped;
+ while ( ( ped = dynamic_cast<AliMUONVCalibParam*>(next() ) ) )
+ {
+ Int_t busPatchId = ped->ID0();
+ Int_t manuId = ped->ID1();
+ Double_t pedMean = ped->ValueAsDouble(0, 0); // check pedestal value for channelId=0
+
+ if(pedMean>kADCMax)
+ {
+ occupancy=pedMean-kADCMax;
+ ped->SetValueAsDouble(0, 0, kADCMax);
+ out<<"// BusPatch = "<< busPatchId <<"\t ManuId = "<< manuId << "\t occupancy = " << occupancy <<endl;
+ }
+
+ if (manuId==0 || (fConfig && static_cast<AliMUONErrorCounter*>(fManuBPoutofconfigTable->FindObject(busPatchId,manuId))))
+ {
+ out<<"// BusPatch = "<< busPatchId <<"\t ManuId = "<< manuId << "\t missing in the mapping" << endl;
+ }
}
- }
+}
+
+
out<<"//"<<endl;
out<<"//---------------------------------------------------------------------------" << endl;
out<<"//---------------------------------------------------------------------------" << endl;
AliMUONVCalibParam* ped;
while ( ( ped = dynamic_cast<AliMUONVCalibParam*>(next() ) ) )
- {
- Int_t busPatchId = ped->ID0();
- Int_t manuId = ped->ID1();
-
- for ( Int_t channelId = 0; channelId < ped->Size(); ++channelId )
{
- Double_t pedMean = ped->ValueAsDouble(channelId, 0);
- Double_t pedSigma = ped->ValueAsDouble(channelId, 1);
-
- out << "\t" << busPatchId << "\t" << manuId <<"\t"<< channelId << "\t" << pedMean <<"\t"<< pedSigma << endl;
+ Int_t busPatchId = ped->ID0();
+ Int_t manuId = ped->ID1();
+
+ for ( Int_t channelId = 0; channelId < ped->Size(); ++channelId )
+ {
+ Double_t pedMean = ped->ValueAsDouble(channelId, 0);
+ Double_t pedSigma = ped->ValueAsDouble(channelId, 1);
+
+ out << "\t" << busPatchId << "\t" << manuId <<"\t"<< channelId << "\t" << pedMean <<"\t"<< pedSigma << endl;
+ }
}
- }
}
//______________________________________________________________________________
AliMUONVStore* GetErrorBuspatchTable() {return fErrorBuspatchTable;}
/// return the name of DAPedestal .root file
Char_t* GetHistoFileName() {return fHistoFileName;}
+ /// load MuonTrk configuration from ascii dbfile
+ void Load_config(char* dbfile);
+ /// sum pedestal values for mean and sigma determination
void MakePed(Int_t bp,Int_t manu,Int_t ch,Int_t charge);
+ /// set config flag
+ void SetconfigDA(Int_t ind) {fConfig = ind;}
/// set specific DA prefixname
void SetprefixDA(char* folder) {sprintf(fprefixDA,"%s",folder);}
/// set the index of calibration runs
Int_t fRunNumber; ///< run number
Int_t fNChannel; ///< Nb of channels (pads)
Int_t fNManu; ///< Nb of Manu
+ Int_t fNManu_config; ///< Nb of Manu in the current detector configuration
+ Int_t fConfig; ///< flag 1(0) for reading(or not) configuration ascii file
AliMUONVStore* fErrorBuspatchTable; ///< Table for buspatches with parity errors
AliMUONVStore* fManuBuspatchTable; ///< Occupancy rate for each (buspatch, manu)
+ AliMUONVStore* fManuBPoutofconfigTable; ///< (buspatch, manu) out of config
TTimeStamp* fDate; ///< date
ofstream* fFilcout; ///< .log output file
/*
-------------------------------------------------------------------------
- 2009-05-18 New version: MUONTRKGAINda.cxx,v 1.1
+ 2009-10-06 New version: MUONTRKGAINda.cxx,v 1.3
-------------------------------------------------------------------------
Version for MUONTRKGAINda MUON tracking
Int_t nEventsRecovered = 0;
Int_t nEvents = 0;
UInt_t runNumber = 0;
- Int_t nChannel = 0;
ofstream filcout;
Int_t nIndex = -1;
i++;
shuttleFile = argv[i];
break;
-// case 'd' :
-// i++;
-// printLevel=atoi(argv[i]);
-// break;
-// case 'g' :
-// i++;
-// plotLevel=atoi(argv[i]);
-// break;
-// case 'i' :
-// i++;
-// nbpf1=atoi(argv[i]);
-// break;
-// case 'j' :
-// i++;
-// nInit=atoi(argv[i]);
-// break;
case 's' :
i++;
skipEvents=atoi(argv[i]);
printf("\n-a <Flat ASCII file> (default = %s)",shuttleFile.Data());
printf("\n");
printf("\n Options");
-// printf("\n-d <print level> (default = %d)",printLevel);
-// printf("\n-g <plot level> (default = %d)",plotLevel);
-// printf("\n-i <nb linear points> (default = %d)",nbpf1);
-// printf("\n-j start point of fit (default = %d)",nInit);
printf("\n-m <max date events> (default = %d)",maxDateEvents);
printf("\n-s <skip events> (default = %d)",skipEvents);
printf("\n-n <max events> (default = %d)",maxEvents);
//Gain object
AliMUONGain* muonGain = new AliMUONGain();
muonGain->SetprefixDA(prefixDA);
- muonGain->SetAliRootDataFileName(); // MUONTRKGAINda_data.root
+ muonGain->SetAliRootDataFileName(); // MUONTRKGAINda_data.root
+ // Char_t* RootDataFileName=muonGain->GetRootDataFileName();// MUONTRKGAINda_data.root
+ // cout << " Root data file = " << RootDataFileName << endl;
// Reading current iteration
nIndex = daqDA_ECS_getCurrentIteration();
- if(nIndex<0)nIndex=0; // compute gain directly from existing root data file
+ if(nIndex<0)nIndex=0; // compute gain directly from existing root data file (OFFLINE only)
-
-
-
- if(nIndex==0) // compute gain from existing root data file: MUONTRKGAINda_data.root
+ if(nIndex==0) // compute gain from existing root data file: MUONTRKGAINda_data.root (OFFLINE only)
{
sprintf(flatFile,"%s_data.log",prefixDA);
logOutputFile=flatFile;
muonGain->SetAliInit(nInit); // fnInit
muonGain->SetAliNbpf1(nbpf1); // fnbpf1
muonGain->MakeGainStore(shuttleFile);
-#ifdef ALI_AMORE
- std::ifstream in(shuttleFile.Data());
- ostringstream stringout;
- char line[1024];
- while ( in.getline(line,1024) )
- stringout << line << "\n";
- in.close();
-
- amore::da::AmoreDA amoreDA(amore::da::AmoreDA::kSender);
- TObjString gaindata(stringout.str().c_str());
- status = amoreDA.Send("Gains",&gaindata);
- if ( status )
- cout << "Warning: Failed to write Pedestals in the AMORE database : " << status << endl;
- else
- cout << "amoreDA.Send(Gains) ok" << endl;
-#else
- cout << "Warning: MCH DA not compiled with AMORE support" << endl;
-#endif
+ // ALI_AMORE instructions below are commented (not used OFFLINE) JLC 30/09/09
+ // #ifdef ALI_AMORE
+ // std::ifstream in(shuttleFile.Data());
+ // ostringstream stringout;
+ // char line[1024];
+ // while ( in.getline(line,1024) )
+ // stringout << line << "\n";
+ // in.close();
+
+ // amore::da::AmoreDA amoreDA(amore::da::AmoreDA::kSender);
+ // TObjString gaindata(stringout.str().c_str());
+ // status = amoreDA.Send("Gains",&gaindata);
+ // if ( status )
+ // cout << "Warning: Failed to write Pedestals in the AMORE database : " << status << endl;
+ // else
+ // cout << "amoreDA.Send(Gains) ok" << endl;
+ // #else
+ // cout << "Warning: MCH DA not compiled with AMORE support" << endl;
+ // #endif
}
-
-
- if(nIndex>0) // normal case: reading calibration runs before computing gains
+ if(nIndex>0) // normal case: reading calibration runs before computing gains (ONLINE or OFFLINE)
{
UShort_t manuId;
UChar_t channelId;
UShort_t charge;
// DAC values stored in array vDAC (reading dbfile in DETDB)
- // Int_t vDAC[11] = {0,200,400,800,1200,1600,2000,2500,3000,3500,4000}; // DAC values
+ // Int_t vDAC[11] = {0,200,400,800,1200,1600,2000,2500,3000,3500,4000}
+ Int_t nConfig = 1; // flag to read or not configuration ascii file in detDB
Int_t vDAC[11]; // DAC values
Char_t *dbfile;
dbfile="mutrkcalibvalues";
status=daqDA_DB_getFile(dbfile,dbfile);
ifstream filein(dbfile,ios::in); Int_t k=0, kk;
while (k<nEntries ) { filein >> kk >> vDAC[k] ; k++; }
+ injCharge=vDAC[nIndex-1];
+
+
filein >> nInit; // = 0 all DAC values fitted ; = 1 DAC=0 excluded (default=1)
filein >> nbpf1; // nb of points for linear fit (default=6)
filein >> printLevel; // printout (default=0, =1 =>.ped /run, =2 => .peak & .param)
filein >> plotLevel; // plotout (default=1 => tree , =2 tree+Tgraph+fit)
- cout << "nInit=" << nInit << " Nb linear pts=" << nbpf1 << " Print level=" << printLevel << " Plot Level=" << plotLevel << endl;
+ filein >> nConfig; //nConfig (default=1 => read config in DetDB, otherwise =0)
+
+ cout << "nInit=" << nInit << " Nb linear pts=" << nbpf1 << " Print level=" << printLevel << " Plot Level=" << plotLevel << " Config= " << nConfig << endl;
+
muonGain->SetAliPrintLevel(printLevel);
muonGain->SetAliPlotLevel(plotLevel);
+ muonGain->SetconfigDA(nConfig);
+
+ if(nConfig)
+ {
+ // Laod configuration ascii file from DetDB
+ Char_t dbfil[256]="";
+ sprintf(dbfil,"config_%s",getenv("DATE_ROLE_NAME"));
+ cout << "\n *** Copy ascii config file: " << dbfil << " from DetDB to working directory and reading ...*** \n" << endl;
+ status=daqDA_DB_getFile(dbfil,dbfil);
+ muonGain->Load_config(dbfil);
+ }
- injCharge=vDAC[nIndex-1];
// Rawdeader, RawStreamHP
AliRawReader* rawReader = AliRawReader::Create(inputFile);
{
for(int i = 0; i < busPatch->GetLength(); ++i)
{
- if (nEvents == 0) nChannel++;
busPatch->GetData(i, manuId, channelId, charge);
muonGain->MakePed(busPatch->GetBusPatchId(), (Int_t)manuId, (Int_t)channelId, (Int_t)charge);
}
// Good buspatch
for(int i = 0; i < busPatch->GetLength(); ++i)
{
- if (nEvents == 0) nChannel++;
busPatch->GetData(i, manuId, channelId, charge);
- // if (busPatch->GetBusPatchId()==1719 && manuId == 1 && channelId == 0) cout <<"Recovered charge "<<charge<<endl;
muonGain->MakePed(busPatch->GetBusPatchId(), (Int_t)manuId, (Int_t)channelId, (Int_t)charge);
}
}
muonGain->SetAliInjCharge(injCharge);
muonGain->SetAliNEvents(nEvents);
muonGain->SetAliRunNumber(runNumber);
- muonGain->SetAliNChannel(nChannel);
muonGain->MakePedStoreForGain(shuttleFile);
// Copying files to local DB folder defined by DAQ_DETDB_LOCAL
Char_t *dir;
dir= getenv("DAQ_DETDB_LOCAL");
- unsigned int nLastVersions = 99;
+ unsigned int nLastVersions = 90;
cout << "\n *** Local DataBase: " << dir << " (Max= " << nLastVersions << ") ***" << endl;
status = daqDA_localDB_storeFile(logOutputFile.Data(),nLastVersions);
printf(" Store file : %s status = %d\n",logOutputFile.Data(),status);
/*
-------------------------------------------------------------------------
- 2009-06-18 New version: MUONTRKPEDda.cxx,v 1.2
+ 2009-10-06 New version: MUONTRKPEDda.cxx,v 1.3
-------------------------------------------------------------------------
Version for MUONTRKPEDda MUON tracking
Rem: AliMUON2DMap stores all channels, even those which are not connected
if pedMean == -1, channel not connected to a pad
+&
*/
extern "C" {
Int_t nEventsRecovered = 0;
Int_t nEvents = 0;
UInt_t runNumber = 0;
- Int_t nChannel = 0;
ofstream filcout;
-// Int_t nIndex = -1;
// decode the input line
for (Int_t i = 1; i < argc; i++) // argument 0 is the executable name
i++;
sscanf(argv[i],"%d",&maxEvents);
break;
-// case 'p' :
-// i++;
-// sscanf(argv[i],"%d",&recoverParityErrors);
-// break;
case 'h' :
i++;
printf("\n******************* %s usage **********************",argv[0]);
printf("\n-m <max date events> (default = %d)",maxDateEvents);
printf("\n-s <skip events> (default = %d)",skipEvents);
printf("\n-n <max events> (default = %d)",maxEvents);
-// printf("\n-p <Recover parity errors> (default = %d)",recoverParityErrors);
printf("\n\n");
exit(-1);
AliMUONPedestal* muonPedestal = new AliMUONPedestal();
muonPedestal->SetprefixDA(prefixDA);
+ // Reading configuration status via "mutrkpedvalues" file located in DetDB
+ // config=1: config ascii file read from DetDB, otherwise: config=0
+ Int_t nConfig = 1;
+ Char_t *dbfile;
+ dbfile="mutrkpedvalues";
+ cout << "\n *** Copy: " << dbfile << " from DetDB to working directory *** \n" << endl;
+ status=daqDA_DB_getFile(dbfile,dbfile);
+ ifstream filein(dbfile,ios::in);
+ filein >> nConfig;
+ cout << " Config= " << nConfig << endl;
+ muonPedestal->SetconfigDA(nConfig);
+
+ if(nConfig)
+ {
+ // MuonTrk Configuration ascii file (initCROCUS.dat -> ascii file = mutrkconfig)
+ Char_t dbfil[256]="";
+ sprintf(dbfil,"config_%s",getenv("DATE_ROLE_NAME"));
+ cout << "\n *** Copy ascii config file: " << dbfil << " from DetDB to working directory and reading ...*** \n" << endl;
+ status=daqDA_DB_getFile(dbfil,dbfil);
+ muonPedestal->Load_config(dbfil);
+ }
+
// Rawdeader, RawStreamHP
AliRawReader* rawReader = AliRawReader::Create(inputFile);
AliMUONRawStreamTrackerHP* rawStream = new AliMUONRawStreamTrackerHP(rawReader);
{
for(int i = 0; i < busPatch->GetLength(); ++i)
{
- if (nEvents == 0) nChannel++;
busPatch->GetData(i, manuId, channelId, charge);
muonPedestal->MakePed(busPatch->GetBusPatchId(), (Int_t)manuId, (Int_t)channelId, (Int_t)charge);
}
// Good buspatch
for(int i = 0; i < busPatch->GetLength(); ++i)
{
- if (nEvents == 0) nChannel++;
busPatch->GetData(i, manuId, channelId, charge);
- // if (busPatch->GetBusPatchId()==1719 && manuId == 1 && channelId == 0) cout <<"Recovered charge "<<charge<<endl;
muonPedestal->MakePed(busPatch->GetBusPatchId(), (Int_t)manuId, (Int_t)channelId, (Int_t)charge);
}
}
if(shuttleFile.IsNull())shuttleFile=flatFile;
muonPedestal->SetAliNEvents(nEvents);
muonPedestal->SetAliRunNumber(runNumber);
- muonPedestal->SetAliNChannel(nChannel);
muonPedestal->Finalize();
muonPedestal->MakeControlHistos();
unsigned int nLastVersions=90;
cout << "\n *** Local DataBase: " << dir << " (Max= " << nLastVersions << ") ***" << endl;
status = daqDA_localDB_storeFile(muonPedestal->GetHistoFileName(),nLastVersions);
- // if (!status) printf(" Failed to store file : %s status = %d\n",muonPedestal->GetHistoFileName(),status);
printf(" Store file : %s status = %d\n",muonPedestal->GetHistoFileName(),status);
status = daqDA_localDB_storeFile(shuttleFile.Data(),nLastVersions);
- // if (!status) printf(" Failed to store file : %s status = %d\n",shuttleFile.Data(),status);
printf(" Store file : %s status = %d\n",shuttleFile.Data(),status);
status = daqDA_localDB_storeFile(logOutputFile.Data(),nLastVersions);
- // if (!status) printf(" Failed to store file : %s status = %d\n",logOutputFile.Data(),status);
printf(" Store file : %s status = %d\n",logOutputFile.Data(),status);
// Transferring to OCDB via the SHUTTLE