#include "TObject.h" #include "AliRunLoader.h" #include "AliRun.h" #include "AliLoader.h" #include "AliMFT.h" #include "TClonesArray.h" #include "AliMFTCluster.h" #include "AliMFTSegmentation.h" #include "TFile.h" #include "TH1D.h" #include "AliLog.h" #include "TString.h" #include "AliMFTClusterQA.h" //==================================================================================================================================================== // // Class for the analysis of the MFT clusters (a.k.a. rec points). Few QA histograms are created // // Contact author: antonio.uras@cern.ch // //==================================================================================================================================================== ClassImp(AliMFTClusterQA) //==================================================================================================================================================== AliMFTClusterQA::AliMFTClusterQA(): TObject(), fMFTLoader(0), fRunLoader(0), fMFT(0), fNPlanes(0), fNEvents(0), fEv(0), fFileOut(0), fReadDir(0), fOutDir(0) { // default constructor for (Int_t iPlane=0; iPlaneGetAliRun(); if (!gAlice) fRunLoader->LoadgAlice(); fNEvents = fRunLoader->GetNumberOfEvents(); if (nEventsToAnalyze>0) fNEvents = TMath::Min(fNEvents, nEventsToAnalyze); fMFT = (AliMFT*) gAlice->GetDetector("MFT"); fNPlanes = fMFT->GetSegmentation()->GetNPlanes(); BookHistos(); fMFTLoader = fRunLoader->GetDetectorLoader("MFT"); fMFTLoader -> LoadRecPoints("READ"); } //==================================================================================================================================================== Bool_t AliMFTClusterQA::LoadNextEvent() { if (fEv>=fNEvents) return kFALSE; AliDebug(1, Form("event %5d",fEv)); fRunLoader->GetEvent(fEv); fEv++; if (!fMFTLoader->TreeR()->GetEvent()) return kTRUE; for (Int_t iPlane=0; iPlaneGetRecPointsList(iPlane)->GetEntries(); fHistNClustersPerEvent[iPlane] -> Fill(nClusters); AliDebug(1,Form("nClusters = %5d", nClusters)); for (Int_t iCluster=0; iClusterGetRecPointsList(iPlane))->At(iCluster); fHistNPixelsPerCluster[iPlane] -> Fill(cluster->GetSize()); fHistClusterSizeX[iPlane] -> Fill(cluster->GetErrX()*1.e4); // converted in microns fHistClusterSizeY[iPlane] -> Fill(cluster->GetErrY()*1.e4); // converted in microns } } return kTRUE; } //==================================================================================================================================================== void AliMFTClusterQA::BookHistos() { fFileOut = new TFile(Form("%s/MFT.RecPoints.QA.root",fOutDir.Data()), "recreate"); for (Int_t iPlane=0; iPlane SetXTitle("N_{clusters} per Event"); fHistNPixelsPerCluster[iPlane] -> SetXTitle("N_{pixels} per Cluster"); fHistClusterSizeX[iPlane] -> SetXTitle("#Deltax [#mum]"); fHistClusterSizeY[iPlane] -> SetXTitle("#Deltay [#mum]"); fHistNClustersPerEvent[iPlane] -> Sumw2(); fHistNPixelsPerCluster[iPlane] -> Sumw2(); fHistClusterSizeX[iPlane] -> Sumw2(); fHistClusterSizeY[iPlane] -> Sumw2(); } } //==================================================================================================================================================== void AliMFTClusterQA::Terminate() { AliInfo("Writing QA histos..."); fFileOut->cd(); for (Int_t iPlane=0; iPlane Write(); fHistNPixelsPerCluster[iPlane] -> Write(); fHistClusterSizeX[iPlane] -> Write(); fHistClusterSizeY[iPlane] -> Write(); } fFileOut -> Close(); } //====================================================================================================================================================