// --- MUON header files ---
#include "AliMUONTrackerQADataMakerRec.h"
+#include "AliDAQ.h"
#include "AliQAv1.h"
+#include "AliMpDDL.h"
#include "AliMUONConstants.h"
#include "AliMUONDigitMaker.h"
#include "AliMUONQAIndices.h"
ClassImp(AliMUONTrackerQADataMakerRec)
/// \endcond
-Double_t AliMUONTrackerQADataMakerRec::fgkRawNofGlitchErrors(0.0);
-Double_t AliMUONTrackerQADataMakerRec::fgkRawNofTokenLostErrors(1.0);
-Double_t AliMUONTrackerQADataMakerRec::fgkRawNofParityErrors(2.0);
-Double_t AliMUONTrackerQADataMakerRec::fgkRawNofPaddingErrors(3.0);
-
+namespace
+{
+ Double_t ProtectedSqrt(Double_t x)
+ {
+ return ( x > 0.0 ? TMath::Sqrt(x) : 0.0 );
+ }
+}
//____________________________________________________________________________
AliMUONTrackerQADataMakerRec::AliMUONTrackerQADataMakerRec(AliQADataMakerRec* master) :
AliMUONVQADataMakerRec(master),
Double_t meanResX = hESDSumResidualXPerDE->GetBinContent(iDE+1)/nClusters;
hESDResidualXPerDEMean->SetBinContent(iDE+1, meanResX);
hESDResidualXPerDEMean->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(nClusters));
- hESDResidualXPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
+ hESDResidualXPerDESigma->SetBinContent(iDE+1, ProtectedSqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
hESDResidualXPerDESigma->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(2.*nClusters));
Double_t meanResY = hESDSumResidualYPerDE->GetBinContent(iDE+1)/nClusters;
hESDResidualYPerDEMean->SetBinContent(iDE+1, meanResY);
hESDResidualYPerDEMean->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(nClusters));
- hESDResidualYPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
+ hESDResidualYPerDESigma->SetBinContent(iDE+1, ProtectedSqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
hESDResidualYPerDESigma->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters));
hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters);
if ( fTrackerDataMaker )
{
+ /// put the trackerdata in the pipeline
InsertTrackerData(specie,list,fTrackerDataMaker->Data(),AliMUONQAIndices::kTrackerData);
+ /// project the tracerdata into buspatch occupancies (for the experts)
TH1* hbp = GetRawsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
hbp->Reset();
TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim)*100.0); // occupancy, in percent
}
+ /// log the readout errors (for the shifter)
TH1* hnevents = GetRawsData(AliMUONQAIndices::kTrackerNofRawEventSeen);
hnevents->Reset();
hnevents->Fill(0.0,fTrackerDataMaker->Data()->NumberOfEvents(-1));
FillErrors(*fLogger);
fLogger->Clear();
}
+
+ /// project tracker data into DDL occupancies (for the shifter)
+ TH1* hddl = GetRawsData(AliMUONQAIndices::kTrackerDDLOccupancy);
+ hddl->Reset();
+ TH1* hddlevents = GetRawsData(AliMUONQAIndices::kTrackerDDLNofEvents);
+ hddlevents->Reset();
+
+ const Int_t nddls = AliDAQ::NumberOfDdls("MUONTRK");
+ const Int_t offset = AliDAQ::DdlIDOffset("MUONTRK");
+
+ for ( Int_t iddl = 0; iddl < nddls; ++iddl )
+ {
+ AliMpDDL* ddl = AliMpDDLStore::Instance()->GetDDL(iddl);
+
+ Int_t ddlId = offset + ddl->GetId();
+ Int_t npads = 0;
+
+ Int_t nevents = data->NumberOfEvents(iddl);
+
+ hddlevents->Fill(ddlId,nevents);
+
+ Double_t occ(0.0);
+
+ for ( Int_t ide = 0; ide < ddl->GetNofDEs(); ++ide )
+ {
+ Int_t de = ddl->GetDEId(ide);
+
+ npads += TMath::Nint(data->DetectionElement(de,3));
+
+ occ += data->DetectionElement(de,4);
+ }
+
+ if ( nevents > 0 && npads > 0 )
+ {
+ occ = occ/npads/nevents;
+ }
+
+ hddl->Fill(ddlId,100.0*occ); // occ in percent
+ }
}
}
if ( msg.Contains("token") )
{
- Int_t dsp(-1),ddl(-1),ecode(-1);
+ Int_t dsp(-1),iddl(-1),ecode(-1);
- sscanf(msg.Data(),"Lost token error detected in DSP 0x%X of DDL %d and code %d.",
- &dsp,&ddl,&ecode);
+ sscanf(msg.Data(),"Lost token error detected with address 0x%X of DDL %d and code %d.",
+ &dsp,&iddl,&ecode);
Int_t localBP = ((dsp >> 16)- 4)*5 + 1;
- Int_t buspatch = localBP + ddl*100;
- htoken->Fill(buspatch,occurence);
- hroe->Fill(fgkRawNofTokenLostErrors,occurence);
- AliDebug(1,Form("DDL %d DSP %d busPatch %d",ddl,dsp,buspatch));
+ Int_t buspatch = localBP + iddl*100;
+
+ // Let's try to get all the suspected bus patches (i.e. one full FRT, as currently
+ // we don't have more precise information to locate the faulty bus patch(es)).
+
+ AliMpBusPatch* bp = AliMpDDLStore::Instance()->GetBusPatch(buspatch);
+ Int_t frt = bp->GetFrtId();
+ AliMpDDL* ddl = AliMpDDLStore::Instance()->GetDDL(bp->GetDdlId());
+ Int_t* b = new Int_t[ddl->GetMaxDsp()];
+ ddl->GetBusPerDsp(b);
+ Int_t nbus(0);
+ for ( Int_t i = 0; i < ddl->GetNofFrts() && !nbus; ++i )
+ {
+ if ( ddl->GetFrtId(i) == frt )
+ {
+ nbus = b[i];
+ }
+ }
+ if (nbus<=0)
+ {
+ AliError("GOT NBUS<=0 ! THAT IS BAD ! CHECK !");
+ nbus=1;
+ }
+
+ delete[] b;
+
+ while (nbus) {
+ htoken->Fill(buspatch+nbus-1,occurence);
+ --nbus;
+ }
+
+ hroe->Fill(1.0*AliMUONQAIndices::kTrackerRawNofTokenLostErrors,occurence);
}
if ( msg.Contains("Parity") )
Int_t buspatch;
sscanf(msg.Data(),"Parity error in buspatch %d (0x%X).",&buspatch,&buspatch);
hparity->Fill(buspatch,occurence);
- hroe->Fill(fgkRawNofParityErrors,occurence);
+ hroe->Fill(1.0*AliMUONQAIndices::kTrackerRawNofParityErrors,occurence);
}
if ( msg.Contains("Glitch") )
{
- hroe->Fill(fgkRawNofGlitchErrors,occurence);
+ hroe->Fill(1.0*AliMUONQAIndices::kTrackerRawNofGlitchErrors,occurence);
}
if ( msg.Contains("Padding") )
Int_t block, dsp, buspatch;
sscanf(msg.Data(),"Padding word error for iBlock %d, iDsp %d, iBus %d.",&block,&dsp,&buspatch);
hpadding->Fill(buspatch,occurence);
- hroe->Fill(fgkRawNofPaddingErrors,occurence);
+ hroe->Fill(1.0*AliMUONQAIndices::kTrackerRawNofPaddingErrors,occurence);
}
}
TH1* hbpnmanus = new TH1F("hTrackerBusPatchNofManus","Number of manus per bus patch",nbins,xmin,xmax);
- Add2RawsList(hbp,AliMUONQAIndices::kTrackerBusPatchOccupancy, !expert, image, !saveCorr);
+ Add2RawsList(hbp,AliMUONQAIndices::kTrackerBusPatchOccupancy, expert, image, !saveCorr);
Add2RawsList(hbpnpads,AliMUONQAIndices::kTrackerBusPatchNofPads, expert, !image, !saveCorr);
Add2RawsList(hbpnmanus,AliMUONQAIndices::kTrackerBusPatchNofManus, expert, !image, !saveCorr);
// The QA shifter will only see the summary plot below
TAxis* a = h->GetXaxis();
- a->SetBinLabel(h->FindBin(fgkRawNofGlitchErrors),"Glitch errors");
- a->SetBinLabel(h->FindBin(fgkRawNofTokenLostErrors),"Token lost errors");
- a->SetBinLabel(h->FindBin(fgkRawNofParityErrors),"Parity errors");
- a->SetBinLabel(h->FindBin(fgkRawNofPaddingErrors),"Padding errors");
+ a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofGlitchErrors),"Glitch errors");
+ a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofTokenLostErrors),"Token lost errors");
+ a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofParityErrors),"Parity errors");
+ a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofPaddingErrors),"Padding errors");
Add2RawsList(h,AliMUONQAIndices::kTrackerReadoutErrors,!expert,image,!saveCorr);
hbpconfig->Fill(bp->GetId());
}
}
+
+ nbins = AliDAQ::NumberOfDdls("MUONTRK");
+ const Int_t offset = AliDAQ::DdlIDOffset("MUONTRK");
+
+ xmin = offset - 0.5;
+ xmax = offset + nbins - 0.5;
+
+ Add2RawsList(new TH1F("hTrackerDDLOccupancy",";DDLId;DDL Occupancy in %",nbins,xmin,xmax),
+ AliMUONQAIndices::kTrackerDDLOccupancy,!expert,image,!saveCorr);
+ Add2RawsList(new TH1F("hTrackerDDLNofEvents","Number of events seen by DDL;DDLId",nbins,xmin,xmax),
+ AliMUONQAIndices::kTrackerDDLNofEvents,expert,!image,!saveCorr);
+
}
//__________________________________________________________________
if ( hn.Contains("Tracker") )
{
- if ( hn != "hTrackerBusPatchNofPads" &&
- hn != "hTrackerBusPatchNofManus" &&
- hn != "hTrackerBusPatchConfig" )
+ if ( !hn.Contains("hTrackerBusPatchNofPads") &&
+ !hn.Contains("hTrackerBusPatchNofManus") &&
+ !hn.Contains("hTrackerBusPatchConfig" ) )
{
AliDebug(1,Form("Resetting %s",hn.Data()));
h->Reset();
}
}
}
-}
\ No newline at end of file
+}