From b9bd355cb3b2bfee9ede9f6bff3db12c26e2cf5d Mon Sep 17 00:00:00 2001 From: laphecet Date: Thu, 8 Oct 2009 13:54:38 +0000 Subject: [PATCH] Updating the RecPoints QA to detect more easily illegitimate mono-cathode clusters --- MUON/AliMUONDigitCalibrator.cxx | 58 ++- MUON/AliMUONDigitCalibrator.h | 5 +- MUON/AliMUONPadStatusMapMaker.cxx | 15 +- MUON/AliMUONPadStatusMapMaker.h | 1 + MUON/AliMUONQADataMakerRec.cxx | 662 +++++++++++++++++------------- MUON/AliMUONQADataMakerRec.h | 27 +- MUON/MUONrecLinkDef.h | 2 + MUON/libMUONrec.pkg | 3 +- 8 files changed, 467 insertions(+), 306 deletions(-) diff --git a/MUON/AliMUONDigitCalibrator.cxx b/MUON/AliMUONDigitCalibrator.cxx index 0566086a353..41c3ceecbc6 100644 --- a/MUON/AliMUONDigitCalibrator.cxx +++ b/MUON/AliMUONDigitCalibrator.cxx @@ -17,6 +17,8 @@ #include "AliMUONDigitCalibrator.h" +#include "AliCDBEntry.h" +#include "AliCDBManager.h" #include "AliLog.h" #include "AliMUONCalibrationData.h" #include "AliMUONLogger.h" @@ -64,6 +66,57 @@ const Int_t AliMUONDigitCalibrator::fgkGainConstantCapa(1); const Int_t AliMUONDigitCalibrator::fgkGain(2); const Int_t AliMUONDigitCalibrator::fgkInjectionGain(3); +//_____________________________________________________________________________ +AliMUONDigitCalibrator::AliMUONDigitCalibrator(Int_t runNumber, const char* calibMode) +: TObject(), +fLogger(new AliMUONLogger(20000)), +fStatusMaker(0x0), +fStatusMapMaker(0x0), +fPedestals(0x0), +fGains(0x0), +fApplyGains(0), +fCapacitances(0x0), +fNumberOfBadPads(0), +fNumberOfPads(0), +fChargeSigmaCut(0), +fMask(0) +{ + /// ctor + + AliMUONRecoParam* recoParam(0x0); + + AliCDBEntry* e = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam",runNumber); + if (e) + { + TObject* o = e->GetObject(); + if ( o->IsA() == TObjArray::Class() ) + { + TObjArray* a = static_cast(o); + TIter next(a); + AliMUONRecoParam* p; + while ( ( p = static_cast(next()) )) + { + if ( p->IsDefault()) recoParam = p; + } + } + else + { + recoParam = static_cast(o); + } + } + if (!recoParam) + { + AliError("Cannot get the recoParam. Failing"); + return; + } + + // OK. Now get all we need and work... + + AliMUONCalibrationData calib(runNumber); + + Ctor(calibMode,calib,recoParam,kFALSE); +} + //_____________________________________________________________________________ AliMUONDigitCalibrator::AliMUONDigitCalibrator(const AliMUONCalibrationData& calib, const AliMUONRecoParam* recoParams, @@ -111,7 +164,8 @@ fMask(0) void AliMUONDigitCalibrator::Ctor(const char* calibMode, const AliMUONCalibrationData& calib, - const AliMUONRecoParam* recoParams) + const AliMUONRecoParam* recoParams, + Bool_t deferredInitialization) { /// designated ctor @@ -175,8 +229,6 @@ AliMUONDigitCalibrator::Ctor(const char* calibMode, fLogger->Log(Form("SigmaCut=%e",fChargeSigmaCut)); } - Bool_t deferredInitialization = kTRUE; - fStatusMapMaker = new AliMUONPadStatusMapMaker(*fStatusMaker,fMask,deferredInitialization); fPedestals = calib.Pedestals(); diff --git a/MUON/AliMUONDigitCalibrator.h b/MUON/AliMUONDigitCalibrator.h index bd570ff4dc6..d55b09902db 100644 --- a/MUON/AliMUONDigitCalibrator.h +++ b/MUON/AliMUONDigitCalibrator.h @@ -30,6 +30,8 @@ class AliMUONDigitCalibrator : public TObject { public: + AliMUONDigitCalibrator(Int_t runNumber, const char* calibMode="NOGAIN"); + AliMUONDigitCalibrator(const AliMUONCalibrationData& calib, const AliMUONRecoParam* recoParams, const char* calibMode="NOGAIN"); @@ -61,7 +63,8 @@ private: void Ctor(const char* calibMode, const AliMUONCalibrationData& calib, - const AliMUONRecoParam* recoParams); + const AliMUONRecoParam* recoParams, + Bool_t deferredInitialization=kTRUE); private: AliMUONLogger* fLogger; //!< to log repeated messages diff --git a/MUON/AliMUONPadStatusMapMaker.cxx b/MUON/AliMUONPadStatusMapMaker.cxx index 52132567d41..fe89dd55f16 100644 --- a/MUON/AliMUONPadStatusMapMaker.cxx +++ b/MUON/AliMUONPadStatusMapMaker.cxx @@ -89,7 +89,8 @@ fkStatusMaker(padStatusMaker), fMask(mask), fStatusMap(new AliMUON2DMap(true)), fRejectProbabilities(new AliMUON2DMap(true)), -fRejectList(0x0) +fRejectList(0x0), +fComputeOnDemand(deferredInitialization) { /// ctor if (!deferredInitialization) @@ -309,8 +310,16 @@ AliMUONPadStatusMapMaker::StatusMap(Int_t detElemId, Int_t manuId, AliMUONVCalibParam* param = static_cast(fStatusMap->FindObject(detElemId,manuId)); if (!param) { - // not yet computed, so do it now - param = ComputeStatusMap(detElemId,manuId); + if ( fComputeOnDemand ) + { + // not yet computed, so do it now + param = ComputeStatusMap(detElemId,manuId); + } + else + { + // we're locked. probably a bad manuId ? + return fgkSelfDead; + } } Int_t statusMap = param->ValueAsInt(manuChannel); diff --git a/MUON/AliMUONPadStatusMapMaker.h b/MUON/AliMUONPadStatusMapMaker.h index edf3f9ec932..3a516425bae 100644 --- a/MUON/AliMUONPadStatusMapMaker.h +++ b/MUON/AliMUONPadStatusMapMaker.h @@ -74,6 +74,7 @@ private: mutable AliMUONVStore* fStatusMap; //!< status map AliMUONVStore* fRejectProbabilities; //!< reject probabilities (channel based, computed once per run) AliMUONVStore* fRejectList; //!< reject list (which channels should be rejected, might change event-by-event for simulations) + Bool_t fComputeOnDemand; //!< whether we authorize to compute things on demand or not ClassDef(AliMUONPadStatusMapMaker,0) // Pad status map maker }; diff --git a/MUON/AliMUONQADataMakerRec.cxx b/MUON/AliMUONQADataMakerRec.cxx index 470273f0582..55c26a217bb 100644 --- a/MUON/AliMUONQADataMakerRec.cxx +++ b/MUON/AliMUONQADataMakerRec.cxx @@ -24,6 +24,7 @@ #include "AliMUONDDLTrigger.h" #include "AliMUONDarcHeader.h" #include "AliMUONDigitMaker.h" +#include "AliMUONQAMappingCheck.h" #include "AliMUONLocalStruct.h" #include "AliMUONLocalTrigger.h" #include "AliMUONRawStreamTracker.h" @@ -187,7 +188,8 @@ fDigitStore(0x0), fTriggerStore(0x0), fDigitMaker(0x0), fClusterStore(0x0), -fTrackerDataMaker(0x0) +fTrackerDataMaker(0x0), +fMappingCheckRecPoints(0x0) { /// ctor @@ -201,6 +203,7 @@ void AliMUONQADataMakerRec::Ctor() { /// Init some members + AliCodeTimerAuto(""); fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1"); fDigitMaker = new AliMUONDigitMaker(kTRUE); } @@ -212,7 +215,8 @@ fDigitStore(0x0), fTriggerStore(0x0), fDigitMaker(0x0), fClusterStore(0x0), -fTrackerDataMaker(0x0) +fTrackerDataMaker(0x0), +fMappingCheckRecPoints(0x0) { ///copy ctor @@ -257,292 +261,338 @@ AliMUONQADataMakerRec::~AliMUONQADataMakerRec() delete fDigitMaker; delete fClusterStore; delete fTrackerDataMaker; + delete fMappingCheckRecPoints; } //____________________________________________________________________________ void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list) { - ///Detector specific actions at end of cycle + /// Detector specific actions at end of cycle AliCodeTimerAuto(""); for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - if (! IsValidEventSpecie(specie, list) ) - continue ; - SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ; - if ( task == AliQAv1::kRAWS && fTrackerDataMaker ) - { - if ( !GetRawsData(kTrackerBusPatchOccupancy) ) continue; + if (! IsValidEventSpecie(specie, list) ) continue; + + SetEventSpecie(AliRecoParam::ConvertIndex(specie)); - TIter next(list[specie]); - TObject* o; - Bool_t alreadyThere(kFALSE); - while ( ( o = next() ) && !alreadyThere ) - { - TString classname(o->ClassName()); - if ( classname.Contains("TrackerData") ) alreadyThere = kTRUE; - } - if (!alreadyThere && fTrackerDataMaker) - { - AliDebug(AliQAv1::GetQADebugLevel(), "Adding fTrackerData to the list of qa objects"); - list[specie]->AddAt(fTrackerDataMaker->Data(),(Int_t)kTrackerData); - } - if ( fTrackerDataMaker ) - { - TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy); - hbp->Reset(); - TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator()); - AliMpBusPatch* bp(0x0); - AliMUONVTrackerData* data = fTrackerDataMaker->Data(); - Int_t occDim = 2; - - while ( ( bp = static_cast(nextBP())) ) - { - Int_t busPatchId = bp->GetId(); - Int_t bin = hbp->FindBin(busPatchId); - hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim)*100.0); // occupancy, in percent - } - - BeautifyTrackerBusPatchOccupancy(*hbp); - } - } + if ( task == AliQAv1::kRAWS && fTrackerDataMaker ) + { + // export trackerdata as is, and also make a summarized version (buspatchoccupancy) + EndOfDetectorCycleRaws(specie,list); + } + + if ( task == AliQAv1::kRECPOINTS ) + { + // normalize recpoints histograms + EndOfDetectorCycleRecPoints(specie,list); + } + + if ( task == AliQAv1::kESDS ) + { + // normalize esds histograms + EndOfDetectorCycleESDs(); + } + + // Display trigger histos in a more user friendly way + DisplayTriggerInfo(task); + + } // loop on specie + + // do the QA checking + AliQAChecker::Instance()->Run(AliQAv1::kMUON,task,list); +} + +//____________________________________________________________________________ +void AliMUONQADataMakerRec::InsertTrackerData(Int_t specie, TObjArray** list, + TObject* object, Int_t indexNumber, + Bool_t replace) +{ + /// Insert an object to a given list + + TIter next(list[specie]); + TObject* o; + TObject* old(0x0); + Bool_t alreadyThere(kFALSE); + while ( ( o = next() ) && !alreadyThere ) + { + TString classname(o->ClassName()); + if ( classname.Contains("TrackerData") ) + { + alreadyThere = kTRUE; + old = o; + } + } + if ( (!alreadyThere && object) || (alreadyThere && replace) ) + { + delete old; + AliDebug(AliQAv1::GetQADebugLevel(), Form("Adding %s to the list of qa objects",object->GetName())); + list[specie]->AddAt(object,indexNumber); + } +} + +//____________________________________________________________________________ +void AliMUONQADataMakerRec::EndOfDetectorCycleESDs() +{ + /// Normalize ESD histograms + + if (!GetESDsData(kESDnClustersPerTrack)) return; + + Double_t nTracks = GetESDsData(kESDnClustersPerTrack)->GetEntries(); + if (nTracks <= 0) return; + + TH1* hESDnClustersPerCh = GetESDsData(kESDnClustersPerCh); + TH1* hESDnClustersPerDE = GetESDsData(kESDnClustersPerDE); + TH1* hESDClusterChargePerChMean = GetESDsData(kESDClusterChargePerChMean); + TH1* hESDClusterChargePerChSigma = GetESDsData(kESDClusterChargePerChSigma); + TH1* hESDClusterSizePerChMean = GetESDsData(kESDClusterSizePerChMean); + TH1* hESDClusterSizePerChSigma = GetESDsData(kESDClusterSizePerChSigma); + TH1* hESDResidualXPerChMean = GetESDsData(kESDResidualXPerChMean); + TH1* hESDResidualXPerChSigma = GetESDsData(kESDResidualXPerChSigma); + TH1* hESDResidualYPerChMean = GetESDsData(kESDResidualYPerChMean); + TH1* hESDResidualYPerChSigma = GetESDsData(kESDResidualYPerChSigma); + TH1* hESDLocalChi2XPerChMean = GetESDsData(kESDLocalChi2XPerChMean); + TH1* hESDLocalChi2YPerChMean = GetESDsData(kESDLocalChi2YPerChMean); + TH1* hESDLocalChi2PerChMean = GetESDsData(kESDLocalChi2PerChMean); + TH1* hESDClusterChargePerDE = GetESDsData(kESDClusterChargePerDE); + TH1* hESDClusterSizePerDE = GetESDsData(kESDClusterSizePerDE); + TH1* hESDResidualXPerDEMean = GetESDsData(kESDResidualXPerDEMean); + TH1* hESDResidualXPerDESigma = GetESDsData(kESDResidualXPerDESigma); + TH1* hESDResidualYPerDEMean = GetESDsData(kESDResidualYPerDEMean); + TH1* hESDResidualYPerDESigma = GetESDsData(kESDResidualYPerDESigma); + TH1* hESDLocalChi2XPerDEMean = GetESDsData(kESDLocalChi2XPerDEMean); + TH1* hESDLocalChi2YPerDEMean = GetESDsData(kESDLocalChi2YPerDEMean); + TH1* hESDLocalChi2PerDEMean = GetESDsData(kESDLocalChi2PerDEMean); + TH1* hESDnTotClustersPerCh = GetESDsData(kESDnTotClustersPerCh); + TH1* hESDnTotClustersPerDE = GetESDsData(kESDnTotClustersPerDE); + TH1* hESDnTotFullClustersPerDE = GetESDsData(kESDnTotFullClustersPerDE); + TH1* hESDSumClusterChargePerDE = GetESDsData(kESDSumClusterChargePerDE); + TH1* hESDSumClusterSizePerDE = GetESDsData(kESDSumClusterSizePerDE); + TH1* hESDSumResidualXPerDE = GetESDsData(kESDSumResidualXPerDE); + TH1* hESDSumResidualYPerDE = GetESDsData(kESDSumResidualYPerDE); + TH1* hESDSumResidualX2PerDE = GetESDsData(kESDSumResidualX2PerDE); + TH1* hESDSumResidualY2PerDE = GetESDsData(kESDSumResidualY2PerDE); + TH1* hESDSumLocalChi2XPerDE = GetESDsData(kESDSumLocalChi2XPerDE); + TH1* hESDSumLocalChi2YPerDE = GetESDsData(kESDSumLocalChi2YPerDE); + TH1* hESDSumLocalChi2PerDE = GetESDsData(kESDSumLocalChi2PerDE); + + hESDnClustersPerCh->Reset(); + hESDnClustersPerDE->Reset(); + hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks); + hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks); + + // loop over chambers + for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) { + + TH1* hESDClusterChargeInCh = GetESDsData(kESDClusterChargeInCh+iCh); + Double_t sigmaCharge = hESDClusterChargeInCh->GetRMS(); + hESDClusterChargePerChMean->SetBinContent(iCh+1, hESDClusterChargeInCh->GetMean()); + hESDClusterChargePerChMean->SetBinError(iCh+1, hESDClusterChargeInCh->GetMeanError()); + hESDClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge); + hESDClusterChargePerChSigma->SetBinError(iCh+1, hESDClusterChargeInCh->GetRMSError()); + + TH1* hESDClusterSizeInCh = GetESDsData(kESDClusterSizeInCh+iCh); + Double_t sigmaSize = hESDClusterSizeInCh->GetRMS(); + hESDClusterSizePerChMean->SetBinContent(iCh+1, hESDClusterSizeInCh->GetMean()); + hESDClusterSizePerChMean->SetBinError(iCh+1, hESDClusterSizeInCh->GetMeanError()); + hESDClusterSizePerChSigma->SetBinContent(iCh+1, sigmaSize); + hESDClusterSizePerChSigma->SetBinError(iCh+1, hESDClusterSizeInCh->GetRMSError()); - // Normalize RecPoints histos - if ( task == AliQAv1::kRECPOINTS ) { + TH1* hESDResidualXInCh = GetESDsData(kESDResidualXInCh+iCh); + Double_t sigmaResidualX = hESDResidualXInCh->GetRMS(); + hESDResidualXPerChMean->SetBinContent(iCh+1, hESDResidualXInCh->GetMean()); + hESDResidualXPerChMean->SetBinError(iCh+1, hESDResidualXInCh->GetMeanError()); + hESDResidualXPerChSigma->SetBinContent(iCh+1, sigmaResidualX); + hESDResidualXPerChSigma->SetBinError(iCh+1, hESDResidualXInCh->GetRMSError()); + + TH1* hESDResidualYInCh = GetESDsData(kESDResidualYInCh+iCh); + Double_t sigmaResidualY = hESDResidualYInCh->GetRMS(); + hESDResidualYPerChMean->SetBinContent(iCh+1, hESDResidualYInCh->GetMean()); + hESDResidualYPerChMean->SetBinError(iCh+1, hESDResidualYInCh->GetMeanError()); + hESDResidualYPerChSigma->SetBinContent(iCh+1, sigmaResidualY); + hESDResidualYPerChSigma->SetBinError(iCh+1, hESDResidualYInCh->GetRMSError()); + + TH1* hESDLocalChi2XInCh = GetESDsData(kESDLocalChi2XInCh+iCh); + Double_t sigmaLocalChi2X = hESDLocalChi2XInCh->GetRMS(); + hESDLocalChi2XPerChMean->SetBinContent(iCh+1, hESDLocalChi2XInCh->GetMean()); + hESDLocalChi2XPerChMean->SetBinError(iCh+1, hESDLocalChi2XInCh->GetMeanError()); + + TH1* hESDLocalChi2YInCh = GetESDsData(kESDLocalChi2YInCh+iCh); + Double_t sigmaLocalChi2Y = hESDLocalChi2YInCh->GetRMS(); + hESDLocalChi2YPerChMean->SetBinContent(iCh+1, hESDLocalChi2YInCh->GetMean()); + hESDLocalChi2YPerChMean->SetBinError(iCh+1, hESDLocalChi2YInCh->GetMeanError()); + + TH1* hESDLocalChi2InCh = GetESDsData(kESDLocalChi2InCh+iCh); + Double_t sigmaLocalChi2 = hESDLocalChi2InCh->GetRMS(); + hESDLocalChi2PerChMean->SetBinContent(iCh+1, hESDLocalChi2InCh->GetMean()); + hESDLocalChi2PerChMean->SetBinError(iCh+1, hESDLocalChi2InCh->GetMeanError()); + + // loop over DE into chamber iCh + AliMpDEIterator it; + it.First(iCh); + while ( !it.IsDone()) { - if (!GetRecPointsData(kTrackerClusterChargePerChMean)) continue; - - TH1* hTrackerClusterChargePerChMean = GetRecPointsData(kTrackerClusterChargePerChMean); - TH1* hTrackerClusterChargePerChSigma = GetRecPointsData(kTrackerClusterChargePerChSigma); - TH1* hTrackerClusterMultiplicityPerChMean = GetRecPointsData(kTrackerClusterMultiplicityPerChMean); - TH1* hTrackerClusterMultiplicityPerChSigma = GetRecPointsData(kTrackerClusterMultiplicityPerChSigma); - TH1* hTrackerClusterChargePerDEMean = GetRecPointsData(kTrackerClusterChargePerDEMean); - TH1* hTrackerClusterMultiplicityPerDEMean = GetRecPointsData(kTrackerClusterMultiplicityPerDEMean); + Int_t iDE = it.CurrentDEId(); - // loop over chambers - for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) { - - TH1* hTrackerClusterChargePerChamber = GetRecPointsData(kTrackerClusterChargePerChamber+iCh); - Double_t sigmaCharge = hTrackerClusterChargePerChamber->GetRMS(); - hTrackerClusterChargePerChMean->SetBinContent(iCh+1, hTrackerClusterChargePerChamber->GetMean()); - hTrackerClusterChargePerChMean->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetMeanError()); - hTrackerClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge); - hTrackerClusterChargePerChSigma->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetRMSError()); + Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1); + if (nClusters > 1) { - TH1* hTrackerClusterMultiplicityPerChamber = GetRecPointsData(kTrackerClusterMultiplicityPerChamber+iCh); - Double_t sigmaSize = hTrackerClusterMultiplicityPerChamber->GetRMS(); - hTrackerClusterMultiplicityPerChMean->SetBinContent(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMean()); - hTrackerClusterMultiplicityPerChMean->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMeanError()); - hTrackerClusterMultiplicityPerChSigma->SetBinContent(iCh+1, sigmaSize); - hTrackerClusterMultiplicityPerChSigma->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetRMSError()); + hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters); + hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters)); - // loop over DE into chamber iCh - AliMpDEIterator it; - it.First(iCh); - while ( !it.IsDone()) { - - Int_t iDE = it.CurrentDEId(); - - TH1* hTrackerClusterChargePerDE = GetRecPointsData(kTrackerClusterChargePerDE+iDE); - hTrackerClusterChargePerDEMean->SetBinContent(iDE+1, hTrackerClusterChargePerDE->GetMean()); - Double_t nClusters = hTrackerClusterChargePerDE->GetEntries(); - if (nClusters > 1) hTrackerClusterChargePerDEMean->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters)); - else hTrackerClusterChargePerDEMean->SetBinError(iDE+1, hTrackerClusterChargePerChamber->GetXaxis()->GetXmax()); - - TH1* hTrackerClusterMultiplicityPerDE = GetRecPointsData(kTrackerClusterMultiplicityPerDE+iDE); - hTrackerClusterMultiplicityPerDEMean->SetBinContent(iDE+1, hTrackerClusterMultiplicityPerDE->GetMean()); - nClusters = hTrackerClusterMultiplicityPerDE->GetEntries(); - if (nClusters > 1) hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nClusters)); - else hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, hTrackerClusterMultiplicityPerChamber->GetXaxis()->GetXmax()); - - it.Next(); - } + 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->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->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters)); + + hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters); + hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters)); + + hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters); + hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters)); + + hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)/nClusters); + hESDLocalChi2PerDEMean->SetBinError(iDE+1, sigmaLocalChi2/TMath::Sqrt(nClusters)); + + } else { + + hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)); + hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax()); + + hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1)); + hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax()); + hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.); + hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax()); + + hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1)); + hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax()); + hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.); + hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax()); + + hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)); + hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax()); + + hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)); + hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax()); + + hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)); + hESDLocalChi2PerDEMean->SetBinError(iDE+1, hESDLocalChi2InCh->GetXaxis()->GetXmax()); + + } + + Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1); + if (nFullClusters > 1) { + + hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters); + hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters)); + + } else { + + hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)); + hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax()); } + it.Next(); } + + } + +} + +//____________________________________________________________________________ +void AliMUONQADataMakerRec::EndOfDetectorCycleRecPoints(Int_t specie, TObjArray** list) +{ + /// Normalize RecPoints histograms + + if (!GetRecPointsData(kTrackerClusterChargePerChMean)) return; + + TH1* hTrackerClusterChargePerChMean = GetRecPointsData(kTrackerClusterChargePerChMean); + TH1* hTrackerClusterChargePerChSigma = GetRecPointsData(kTrackerClusterChargePerChSigma); + TH1* hTrackerClusterMultiplicityPerChMean = GetRecPointsData(kTrackerClusterMultiplicityPerChMean); + TH1* hTrackerClusterMultiplicityPerChSigma = GetRecPointsData(kTrackerClusterMultiplicityPerChSigma); + TH1* hTrackerClusterChargePerDEMean = GetRecPointsData(kTrackerClusterChargePerDEMean); + TH1* hTrackerClusterMultiplicityPerDEMean = GetRecPointsData(kTrackerClusterMultiplicityPerDEMean); + + // loop over chambers + for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) { - // Normalize ESD histos - if ( task == AliQAv1::kESDS ) { - - if (!GetESDsData(kESDnClustersPerTrack)) continue; - - Double_t nTracks = GetESDsData(kESDnClustersPerTrack)->GetEntries(); - if (nTracks <= 0) continue; + TH1* hTrackerClusterChargePerChamber = GetRecPointsData(kTrackerClusterChargePerChamber+iCh); + Double_t sigmaCharge = hTrackerClusterChargePerChamber->GetRMS(); + hTrackerClusterChargePerChMean->SetBinContent(iCh+1, hTrackerClusterChargePerChamber->GetMean()); + hTrackerClusterChargePerChMean->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetMeanError()); + hTrackerClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge); + hTrackerClusterChargePerChSigma->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetRMSError()); + + TH1* hTrackerClusterMultiplicityPerChamber = GetRecPointsData(kTrackerClusterMultiplicityPerChamber+iCh); + Double_t sigmaSize = hTrackerClusterMultiplicityPerChamber->GetRMS(); + hTrackerClusterMultiplicityPerChMean->SetBinContent(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMean()); + hTrackerClusterMultiplicityPerChMean->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMeanError()); + hTrackerClusterMultiplicityPerChSigma->SetBinContent(iCh+1, sigmaSize); + hTrackerClusterMultiplicityPerChSigma->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetRMSError()); + + // loop over DE into chamber iCh + AliMpDEIterator it; + it.First(iCh); + while ( !it.IsDone()) { - TH1* hESDnClustersPerCh = GetESDsData(kESDnClustersPerCh); - TH1* hESDnClustersPerDE = GetESDsData(kESDnClustersPerDE); - TH1* hESDClusterChargePerChMean = GetESDsData(kESDClusterChargePerChMean); - TH1* hESDClusterChargePerChSigma = GetESDsData(kESDClusterChargePerChSigma); - TH1* hESDClusterSizePerChMean = GetESDsData(kESDClusterSizePerChMean); - TH1* hESDClusterSizePerChSigma = GetESDsData(kESDClusterSizePerChSigma); - TH1* hESDResidualXPerChMean = GetESDsData(kESDResidualXPerChMean); - TH1* hESDResidualXPerChSigma = GetESDsData(kESDResidualXPerChSigma); - TH1* hESDResidualYPerChMean = GetESDsData(kESDResidualYPerChMean); - TH1* hESDResidualYPerChSigma = GetESDsData(kESDResidualYPerChSigma); - TH1* hESDLocalChi2XPerChMean = GetESDsData(kESDLocalChi2XPerChMean); - TH1* hESDLocalChi2YPerChMean = GetESDsData(kESDLocalChi2YPerChMean); - TH1* hESDLocalChi2PerChMean = GetESDsData(kESDLocalChi2PerChMean); - TH1* hESDClusterChargePerDE = GetESDsData(kESDClusterChargePerDE); - TH1* hESDClusterSizePerDE = GetESDsData(kESDClusterSizePerDE); - TH1* hESDResidualXPerDEMean = GetESDsData(kESDResidualXPerDEMean); - TH1* hESDResidualXPerDESigma = GetESDsData(kESDResidualXPerDESigma); - TH1* hESDResidualYPerDEMean = GetESDsData(kESDResidualYPerDEMean); - TH1* hESDResidualYPerDESigma = GetESDsData(kESDResidualYPerDESigma); - TH1* hESDLocalChi2XPerDEMean = GetESDsData(kESDLocalChi2XPerDEMean); - TH1* hESDLocalChi2YPerDEMean = GetESDsData(kESDLocalChi2YPerDEMean); - TH1* hESDLocalChi2PerDEMean = GetESDsData(kESDLocalChi2PerDEMean); - TH1* hESDnTotClustersPerCh = GetESDsData(kESDnTotClustersPerCh); - TH1* hESDnTotClustersPerDE = GetESDsData(kESDnTotClustersPerDE); - TH1* hESDnTotFullClustersPerDE = GetESDsData(kESDnTotFullClustersPerDE); - TH1* hESDSumClusterChargePerDE = GetESDsData(kESDSumClusterChargePerDE); - TH1* hESDSumClusterSizePerDE = GetESDsData(kESDSumClusterSizePerDE); - TH1* hESDSumResidualXPerDE = GetESDsData(kESDSumResidualXPerDE); - TH1* hESDSumResidualYPerDE = GetESDsData(kESDSumResidualYPerDE); - TH1* hESDSumResidualX2PerDE = GetESDsData(kESDSumResidualX2PerDE); - TH1* hESDSumResidualY2PerDE = GetESDsData(kESDSumResidualY2PerDE); - TH1* hESDSumLocalChi2XPerDE = GetESDsData(kESDSumLocalChi2XPerDE); - TH1* hESDSumLocalChi2YPerDE = GetESDsData(kESDSumLocalChi2YPerDE); - TH1* hESDSumLocalChi2PerDE = GetESDsData(kESDSumLocalChi2PerDE); + Int_t iDE = it.CurrentDEId(); - hESDnClustersPerCh->Reset(); - hESDnClustersPerDE->Reset(); - hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks); - hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks); + TH1* hTrackerClusterChargePerDE = GetRecPointsData(kTrackerClusterChargePerDE+iDE); + hTrackerClusterChargePerDEMean->SetBinContent(iDE+1, hTrackerClusterChargePerDE->GetMean()); + Double_t nClusters = hTrackerClusterChargePerDE->GetEntries(); + if (nClusters > 1) hTrackerClusterChargePerDEMean->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters)); + else hTrackerClusterChargePerDEMean->SetBinError(iDE+1, hTrackerClusterChargePerChamber->GetXaxis()->GetXmax()); - // loop over chambers - for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) { - - TH1* hESDClusterChargeInCh = GetESDsData(kESDClusterChargeInCh+iCh); - Double_t sigmaCharge = hESDClusterChargeInCh->GetRMS(); - hESDClusterChargePerChMean->SetBinContent(iCh+1, hESDClusterChargeInCh->GetMean()); - hESDClusterChargePerChMean->SetBinError(iCh+1, hESDClusterChargeInCh->GetMeanError()); - hESDClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge); - hESDClusterChargePerChSigma->SetBinError(iCh+1, hESDClusterChargeInCh->GetRMSError()); - - TH1* hESDClusterSizeInCh = GetESDsData(kESDClusterSizeInCh+iCh); - Double_t sigmaSize = hESDClusterSizeInCh->GetRMS(); - hESDClusterSizePerChMean->SetBinContent(iCh+1, hESDClusterSizeInCh->GetMean()); - hESDClusterSizePerChMean->SetBinError(iCh+1, hESDClusterSizeInCh->GetMeanError()); - hESDClusterSizePerChSigma->SetBinContent(iCh+1, sigmaSize); - hESDClusterSizePerChSigma->SetBinError(iCh+1, hESDClusterSizeInCh->GetRMSError()); - - TH1* hESDResidualXInCh = GetESDsData(kESDResidualXInCh+iCh); - Double_t sigmaResidualX = hESDResidualXInCh->GetRMS(); - hESDResidualXPerChMean->SetBinContent(iCh+1, hESDResidualXInCh->GetMean()); - hESDResidualXPerChMean->SetBinError(iCh+1, hESDResidualXInCh->GetMeanError()); - hESDResidualXPerChSigma->SetBinContent(iCh+1, sigmaResidualX); - hESDResidualXPerChSigma->SetBinError(iCh+1, hESDResidualXInCh->GetRMSError()); - - TH1* hESDResidualYInCh = GetESDsData(kESDResidualYInCh+iCh); - Double_t sigmaResidualY = hESDResidualYInCh->GetRMS(); - hESDResidualYPerChMean->SetBinContent(iCh+1, hESDResidualYInCh->GetMean()); - hESDResidualYPerChMean->SetBinError(iCh+1, hESDResidualYInCh->GetMeanError()); - hESDResidualYPerChSigma->SetBinContent(iCh+1, sigmaResidualY); - hESDResidualYPerChSigma->SetBinError(iCh+1, hESDResidualYInCh->GetRMSError()); - - TH1* hESDLocalChi2XInCh = GetESDsData(kESDLocalChi2XInCh+iCh); - Double_t sigmaLocalChi2X = hESDLocalChi2XInCh->GetRMS(); - hESDLocalChi2XPerChMean->SetBinContent(iCh+1, hESDLocalChi2XInCh->GetMean()); - hESDLocalChi2XPerChMean->SetBinError(iCh+1, hESDLocalChi2XInCh->GetMeanError()); - - TH1* hESDLocalChi2YInCh = GetESDsData(kESDLocalChi2YInCh+iCh); - Double_t sigmaLocalChi2Y = hESDLocalChi2YInCh->GetRMS(); - hESDLocalChi2YPerChMean->SetBinContent(iCh+1, hESDLocalChi2YInCh->GetMean()); - hESDLocalChi2YPerChMean->SetBinError(iCh+1, hESDLocalChi2YInCh->GetMeanError()); - - TH1* hESDLocalChi2InCh = GetESDsData(kESDLocalChi2InCh+iCh); - Double_t sigmaLocalChi2 = hESDLocalChi2InCh->GetRMS(); - hESDLocalChi2PerChMean->SetBinContent(iCh+1, hESDLocalChi2InCh->GetMean()); - hESDLocalChi2PerChMean->SetBinError(iCh+1, hESDLocalChi2InCh->GetMeanError()); - - // loop over DE into chamber iCh - AliMpDEIterator it; - it.First(iCh); - while ( !it.IsDone()) { - - Int_t iDE = it.CurrentDEId(); - - Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1); - if (nClusters > 1) { - - hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters); - hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters)); - - 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->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->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters)); - - hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters); - hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters)); - - hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters); - hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters)); - - hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)/nClusters); - hESDLocalChi2PerDEMean->SetBinError(iDE+1, sigmaLocalChi2/TMath::Sqrt(nClusters)); - - } else { - - hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)); - hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax()); - - hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1)); - hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax()); - hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.); - hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax()); - - hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1)); - hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax()); - hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.); - hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax()); - - hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)); - hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax()); - - hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)); - hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax()); - - hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)); - hESDLocalChi2PerDEMean->SetBinError(iDE+1, hESDLocalChi2InCh->GetXaxis()->GetXmax()); - - } - - Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1); - if (nFullClusters > 1) { - - hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters); - hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters)); - - } else { - - hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)); - hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax()); - - } - - it.Next(); - } - - } + TH1* hTrackerClusterMultiplicityPerDE = GetRecPointsData(kTrackerClusterMultiplicityPerDE+iDE); + hTrackerClusterMultiplicityPerDEMean->SetBinContent(iDE+1, hTrackerClusterMultiplicityPerDE->GetMean()); + nClusters = hTrackerClusterMultiplicityPerDE->GetEntries(); + if (nClusters > 1) hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nClusters)); + else hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, hTrackerClusterMultiplicityPerChamber->GetXaxis()->GetXmax()); + it.Next(); } + } + + if ( fMappingCheckRecPoints ) InsertTrackerData(specie,list,fMappingCheckRecPoints->CreateData("RecPoints"),kTrackerRecPoints,kTRUE); +} + + +//____________________________________________________________________________ +void AliMUONQADataMakerRec::EndOfDetectorCycleRaws(Int_t specie, TObjArray** list) +{ + /// create Raws histograms in Raws subdir + + if ( !GetRawsData(kTrackerBusPatchOccupancy) ) return; + + if ( fTrackerDataMaker ) + { + InsertTrackerData(specie,list,fTrackerDataMaker->Data(),kTrackerData); + + TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy); + hbp->Reset(); + TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator()); + AliMpBusPatch* bp(0x0); + AliMUONVTrackerData* data = fTrackerDataMaker->Data(); + Int_t occDim = 2; - // Display trigger histos in a more user friendly way - DisplayTriggerInfo(task); - } // loop on specie + while ( ( bp = static_cast(nextBP())) ) + { + Int_t busPatchId = bp->GetId(); + Int_t bin = hbp->FindBin(busPatchId); + hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim)*100.0); // occupancy, in percent + } - // do the QA checking - AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ; + BeautifyTrackerBusPatchOccupancy(*hbp); + } } //____________________________________________________________________________ @@ -619,16 +669,19 @@ void AliMUONQADataMakerRec::InitRaws() const Bool_t histogram(kFALSE); - if(!fTrackerDataMaker) fTrackerDataMaker = new AliMUONTrackerDataMaker(GetMUONRecoParam(), - AliCDBManager::Instance()->GetRun(), - 0x0, - "", - "NOGAIN", - histogram, - 0.0,0.0); - + if(!fTrackerDataMaker) + { + fTrackerDataMaker = new AliMUONTrackerDataMaker(GetMUONRecoParam(), + AliCDBManager::Instance()->GetRun(), + 0x0, + "", + "NOGAIN", + histogram, + 0.0,0.0); + } + fTrackerDataMaker->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level - + fTrackerDataMaker->SetRunning(kTRUE); } @@ -751,6 +804,8 @@ void AliMUONQADataMakerRec::InitRecPointsTracker() h1F->SetMarkerStyle(kFullDotMedium); h1F->SetMarkerColor(kRed); Add2RecPointsList(h1F, kTrackerClusterChargePerDEMean, !expert, image); + + if (!fMappingCheckRecPoints) fMappingCheckRecPoints = new AliMUONQAMappingCheck(fRun); } //____________________________________________________________________________ @@ -1194,6 +1249,8 @@ void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree) MakeRecPointsTrigger(clustersTree); } + + //____________________________________________________________________________ void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree) { @@ -1206,6 +1263,11 @@ void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree) // then we have clusters in TreeR, so let's take that opportunity // to QA them... + AliCodeTimerAuto(""); + + // Do nothing in case of calibration event + if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return; + if (!fClusterStore) { AliCodeTimerAuto("ClusterStore creation"); @@ -1216,14 +1278,14 @@ void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree) } } - AliCodeTimerAuto(""); - fClusterStore->Connect(*clustersTree,kFALSE); clustersTree->GetEvent(0); TIter next(fClusterStore->CreateIterator()); AliMUONVCluster* cluster; + if ( fMappingCheckRecPoints ) fMappingCheckRecPoints->NewEvent(); + while ( ( cluster = static_cast(next()) ) ) { Int_t detElemId = cluster->GetDetElemId(); @@ -1238,6 +1300,8 @@ void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree) GetRecPointsData(kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits()); GetRecPointsData(kTrackerClusterHitMapPerChamber+chamberId)->Fill(cluster->GetX(),cluster->GetY()); + if ( fMappingCheckRecPoints ) fMappingCheckRecPoints->Store(*cluster); + } fClusterStore->Clear(); @@ -1247,7 +1311,9 @@ void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree) void AliMUONQADataMakerRec::MakeRecPointsTrigger(TTree* clustersTree) { /// makes data from trigger response - + + AliCodeTimerAuto(""); + // Fired pads info fDigitStore->Clear(); @@ -1299,6 +1365,8 @@ void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd) { /// make QA data from ESDs + AliCodeTimerAuto(""); + // Do nothing in case of calibration event if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return; @@ -1378,10 +1446,11 @@ void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd) GetESDsData(kESDSumLocalChi2PerDE)->Fill(deID, localChi2); trackParam = static_cast(track->GetTrackParamAtCluster()->After(trackParam)); + } } - + GetESDsData(kESDMatchTrig)->Fill(nTrackMatchTrig); } @@ -1667,32 +1736,39 @@ AliMUONQADataMakerRec::BeautifyTrackerBusPatchOccupancy(TH1& hbp) next.Reset(); - Double_t* x = new Double_t[nBusPatches]; + Int_t ok(-1); Int_t n(0); Int_t nBusPatchesAboveLimit(0); + Double_t alpha(0.1); // trim 10% of data + Double_t tmean(0.0),tvar(0.0); + Double_t ymin(0.0),ymax(0.0); - while ( ( bp = static_cast(next())) ) + + if ( nBusPatches ) { - Int_t bin = hbp.FindBin(bp->GetId()); - if ( hbp.GetBinContent(bin) > 0 ) - { - x[n] = hbp.GetBinContent(bin); - ++n; - } - if ( hbp.GetBinContent(bin) > occError ) + Double_t* x = new Double_t[nBusPatches]; + + while ( ( bp = static_cast(next())) ) { - ++nBusPatchesAboveLimit; + Int_t bin = hbp.FindBin(bp->GetId()); + if ( hbp.GetBinContent(bin) > 0 ) + { + x[n] = hbp.GetBinContent(bin); + ++n; + } + if ( hbp.GetBinContent(bin) > occError ) + { + ++nBusPatchesAboveLimit; + } } - } - - Double_t alpha(0.1); // trim 10% of data - Double_t tmean,tvar; - Double_t ymin,ymax; - // computed the truncated mean of the occupancy values, in order to get a - // reasonable y-range for the histogram (without giant peaks to the roof - // for misbehaving buspatches). - Int_t ok = trim(nBusPatches,x,alpha,tmean,tvar,ymin,ymax); + // computed the truncated mean of the occupancy values, in order to get a + // reasonable y-range for the histogram (without giant peaks to the roof + // for misbehaving buspatches). + ok = trim(nBusPatches,x,alpha,tmean,tvar,ymin,ymax); + + delete[] x; + } if ( ok < 0 ) { @@ -1741,3 +1817,5 @@ AliMUONQADataMakerRec::BeautifyTrackerBusPatchOccupancy(TH1& hbp) hbp.GetListOfFunctions()->Add(text); } + + diff --git a/MUON/AliMUONQADataMakerRec.h b/MUON/AliMUONQADataMakerRec.h index 424edf2260f..5d57cb96aa7 100644 --- a/MUON/AliMUONQADataMakerRec.h +++ b/MUON/AliMUONQADataMakerRec.h @@ -15,11 +15,14 @@ #include "AliMUONRecoParam.h" class AliMUONDigitMaker; -class AliMUONVDigitStore; -class AliMUONVTriggerStore; class AliMUONVClusterStore; +class AliMUONVDigitStore; +class AliMUONVStore; class AliMUONVTrackerData; class AliMUONVTrackerDataMaker; +class AliMUONVTriggerStore; + +class AliMUONQAMappingCheck; class AliMUONQADataMakerRec: public AliQADataMakerRec { @@ -79,7 +82,9 @@ private: kTrackerClusterMultiplicityPerChSigma = 102, ///< cluster size per Ch: dispersion kTrackerClusterChargePerChMean = 103, ///< cluster charge per Ch: mean kTrackerClusterChargePerChSigma = 104, ///< cluster charge per Ch: dispersion - + + kTrackerRecPoints = 105, ///< Tracker : tracker data of clusters (all and mono-cathode ones) + kTrackerClusterMultiplicityPerChamber = 200, ///< Tracker: cluster multiplicity per chamber kTrackerClusterChargePerChamber = 300, ///< Tracker: cluster charge per chamber kTrackerClusterHitMapPerChamber = 400, ///< Tracker: cluster position distribution per chamber @@ -90,6 +95,7 @@ private: kTrackerClusterMultiplicityPerDE = 3000, ///< Tracker : cluster multiplicity per DE kTrackerClusterChargePerDE = 5000 ///< Tracker : cluster charge per DE + }; /// ESD histograms indices @@ -149,12 +155,19 @@ private: kESDSumResidualY2PerDE = 1008, ///< sum of cluster-track residual-Y**2 per DE kESDSumLocalChi2XPerDE = 1009, ///< sum of local chi2-X per DE kESDSumLocalChi2YPerDE = 1010, ///< sum of local chi2-Y per DE - kESDSumLocalChi2PerDE = 1011 ///< sum of local chi2 per DE + kESDSumLocalChi2PerDE = 1011, ///< sum of local chi2 per DE }; private: void BeautifyTrackerBusPatchOccupancy(TH1& hbp); + void EndOfDetectorCycleRaws(Int_t specie, TObjArray** list); + void EndOfDetectorCycleRecPoints(Int_t specie, TObjArray** list); + void EndOfDetectorCycleESDs(); + + void InsertTrackerData(Int_t specie, TObjArray** list, TObject* object, + Int_t indexNumber, Bool_t replace=kFALSE); + private: void Ctor(); @@ -175,9 +188,11 @@ private: AliMUONDigitMaker* fDigitMaker; //!< pointer to digit maker AliMUONVClusterStore* fClusterStore; //!< pointer to cluster store - AliMUONVTrackerDataMaker* fTrackerDataMaker; //!< tracker data accumulation + AliMUONVTrackerDataMaker* fTrackerDataMaker; //!< tracker data accumulation (Raw) + + AliMUONQAMappingCheck* fMappingCheckRecPoints; //!< mapping cross-checker (RecPoints) - ClassDef(AliMUONQADataMakerRec,7) // MUON Quality assurance data maker + ClassDef(AliMUONQADataMakerRec,8) // MUON Quality assurance data maker }; #endif diff --git a/MUON/MUONrecLinkDef.h b/MUON/MUONrecLinkDef.h index 542782b445d..c73bc233915 100644 --- a/MUON/MUONrecLinkDef.h +++ b/MUON/MUONrecLinkDef.h @@ -67,4 +67,6 @@ #pragma link C++ class AliMUONVTrackerDataMaker+; #pragma link C++ class AliMUONTrackerDataMaker+; +#pragma link C++ class AliMUONQAMappingCheck+; + #endif diff --git a/MUON/libMUONrec.pkg b/MUON/libMUONrec.pkg index 37649b62331..83fff4a3667 100644 --- a/MUON/libMUONrec.pkg +++ b/MUON/libMUONrec.pkg @@ -45,7 +45,8 @@ SRCS:= AliMUONReconstructor.cxx \ AliMUONLegacyClusterServer.cxx \ AliMUONTriggerTrackToTrackerClusters.cxx \ AliMUONVTrackerDataMaker.cxx \ - AliMUONTrackerDataMaker.cxx + AliMUONTrackerDataMaker.cxx \ + AliMUONQAMappingCheck.cxx HDRS:= $(SRCS:.cxx=.h) -- 2.43.0