From bcaf50eb513dc4fb62269d9f302ce014ed80a04a Mon Sep 17 00:00:00 2001 From: auras Date: Tue, 3 Apr 2012 00:42:18 +0000 Subject: [PATCH] OCDB details added in runSimulation.C and runReconstruction.C --- MFT/AliMFT.cxx | 55 +++++++++++++- MFT/AliMFTClusterQA.cxx | 55 ++++++++++---- MFT/AliMFTClusterQA.h | 4 +- MFT/AliMFTConstants.h | 2 +- MFT/AliMFTDigit.h | 2 +- MFT/AliMFTPlane.cxx | 51 +++++++------ MFT/AliMFTPlane.h | 6 +- MFT/AliMFTSegmentation.cxx | 32 +++++++- MFT/AliMFTSegmentation.h | 2 + MFT/AliMuonForwardTrackAnalysis.C | 10 +-- MFT/AliMuonForwardTrackPair.cxx | 118 +++++++++++++++++------------- MFT/AliMuonForwardTrackPair.h | 9 ++- MFT/SetMFTGeometry.C | 7 +- MFT/runReconstruction.C | 5 +- MFT/runSimulation.C | 5 +- 15 files changed, 253 insertions(+), 110 deletions(-) diff --git a/MFT/AliMFT.cxx b/MFT/AliMFT.cxx index f4b9a4c7ef3..1a6ae165f24 100644 --- a/MFT/AliMFT.cxx +++ b/MFT/AliMFT.cxx @@ -499,13 +499,62 @@ void AliMFT::Hits2SDigitsLocal(TClonesArray *hits, const TObjArray *pSDig, Int_t } for (Int_t iSideDigit=0; iSideDigitGetEntries(); iSideDigit++) { - AliMFTDigit *newDigit = (AliMFTDigit*) fSideDigits->At(iSideDigit); - new ((*pSDigList[sDigit.GetPlane()])[pSDigList[sDigit.GetPlane()]->GetEntries()]) AliMFTDigit(*newDigit); + AliMFTDigit *newSDigit = (AliMFTDigit*) fSideDigits->At(iSideDigit); + new ((*pSDigList[sDigit.GetPlane()])[pSDigList[sDigit.GetPlane()]->GetEntries()]) AliMFTDigit(*newSDigit); } - fSideDigits->Clear(); + fSideDigits->Delete(); } + + // ------------ In case we should simulate a rectangular pattern of pixel... + + for (Int_t iPlane=0; iPlaneGetPlane(iPlane)->HasPixelRectangularPatternAlongY()) { + Int_t nSDigits = pSDigList[iPlane]->GetEntries(); + for (Int_t iSDigit=0; iSDigitAt(iSDigit)); + if (mySDig->GetPixelX()%2 == mySDig->GetPixelY()%2) { // both pair or both odd + Int_t xPixelNew = mySDig->GetPixelX(); + Int_t yPixelNew = mySDig->GetPixelY()+1; + if (fSegmentation->DoesPixelExist(mySDig->GetDetElemID(), xPixelNew, yPixelNew)) { + AliMFTDigit newSDigit; + newSDigit.SetEloss(0.); + newSDigit.SetDetElemID(mySDig->GetDetElemID()); + newSDigit.SetPlane(iPlane); + newSDigit.SetPixID(xPixelNew, yPixelNew, 0); + newSDigit.SetPixWidth(fSegmentation->GetPixelSizeX(newSDigit.GetDetElemID()), + fSegmentation->GetPixelSizeY(newSDigit.GetDetElemID()), + fSegmentation->GetPixelSizeZ(newSDigit.GetDetElemID())); + newSDigit.SetPixCenter(fSegmentation->GetPixelCenterX(newSDigit.GetDetElemID(), xPixelNew), + fSegmentation->GetPixelCenterY(newSDigit.GetDetElemID(), yPixelNew), + fSegmentation->GetPixelCenterZ(newSDigit.GetDetElemID(), 0)); + new ((*pSDigList[iPlane])[pSDigList[iPlane]->GetEntries()]) AliMFTDigit(newSDigit); + } + } + else { // pair-odd + Int_t xPixelNew = mySDig->GetPixelX(); + Int_t yPixelNew = mySDig->GetPixelY()-1; + if (fSegmentation->DoesPixelExist(mySDig->GetDetElemID(), xPixelNew, yPixelNew)) { + AliMFTDigit newSDigit; + newSDigit.SetEloss(0.); + newSDigit.SetDetElemID(mySDig->GetDetElemID()); + newSDigit.SetPlane(iPlane); + newSDigit.SetPixID(xPixelNew, yPixelNew, 0); + newSDigit.SetPixWidth(fSegmentation->GetPixelSizeX(newSDigit.GetDetElemID()), + fSegmentation->GetPixelSizeY(newSDigit.GetDetElemID()), + fSegmentation->GetPixelSizeZ(newSDigit.GetDetElemID())); + newSDigit.SetPixCenter(fSegmentation->GetPixelCenterX(newSDigit.GetDetElemID(), xPixelNew), + fSegmentation->GetPixelCenterY(newSDigit.GetDetElemID(), yPixelNew), + fSegmentation->GetPixelCenterZ(newSDigit.GetDetElemID(), 0)); + new ((*pSDigList[iPlane])[pSDigList[iPlane]->GetEntries()]) AliMFTDigit(newSDigit); + } + } + } + } + } + + //------------------------------------------------------------------------ AliDebug(1,"Stop Hits2SDigitsLocal"); diff --git a/MFT/AliMFTClusterQA.cxx b/MFT/AliMFTClusterQA.cxx index 26bb99a714e..6168b979b1f 100644 --- a/MFT/AliMFTClusterQA.cxx +++ b/MFT/AliMFTClusterQA.cxx @@ -42,11 +42,12 @@ AliMFTClusterQA::AliMFTClusterQA(): // default constructor for (Int_t iPlane=0; iPlane Fill(cluster->GetSize()); fHistClusterSizeX[iPlane] -> Fill(cluster->GetErrX()*1.e4); // converted in microns fHistClusterSizeY[iPlane] -> Fill(cluster->GetErrY()*1.e4); // converted in microns - fClusterScatterPlotXY[iPlane] -> Fill(cluster->GetX(), cluster->GetY()); + fHistClusterRadialPosition[iPlane] -> Fill(TMath::Sqrt(cluster->GetX()*cluster->GetX()+cluster->GetY()*cluster->GetY())); + fClusterScatterPlotXY[iPlane] -> Fill(cluster->GetX(), cluster->GetY()); } } @@ -140,12 +142,22 @@ void AliMFTClusterQA::BookHistos() { //------------------------------------------------------------ - Int_t rMax = Int_t(10.*(fMFT->GetSegmentation()->GetPlane(iPlane)->GetRMaxSupport())); + Int_t rMax = Int_t(10.*(fMFT->GetSegmentation()->GetPlane(iPlane)->GetRMaxSupport())); // expressed in mm + + fHistClusterRadialPosition[iPlane] = new TH1D(Form("fHistClusterRadialPosition_Pl%02d",iPlane), + Form("Cluster radial position (Plane%02d)",iPlane), + rMax, 0, Double_t(rMax)/10.); + fClusterScatterPlotXY[iPlane] = new TH2D(Form("fClusterScatterPlotXY_Pl%02d",iPlane), Form("Cluster scatter plot (Plane%02d)",iPlane), 2*rMax+1, (-rMax-0.5)/10., (rMax+0.5)/10., 2*rMax+1, (-rMax-0.5)/10., (rMax+0.5)/10.); - fClusterScatterPlotXY[iPlane] -> Sumw2(); + fHistClusterRadialPosition[iPlane] -> SetXTitle("R [cm]"); + fClusterScatterPlotXY[iPlane] -> SetXTitle("X [cm]"); + fClusterScatterPlotXY[iPlane] -> SetYTitle("Y [cm]"); + + fHistClusterRadialPosition[iPlane] -> Sumw2(); + fClusterScatterPlotXY[iPlane] -> Sumw2(); } @@ -157,14 +169,31 @@ void AliMFTClusterQA::Terminate() { AliInfo("Writing QA histos..."); + // ---- equalize radial clusters distribution ---------------------- + + for (Int_t iPlane=0; iPlaneGetNbinsX(); iBin++) { + Double_t rMin = fHistClusterRadialPosition[iPlane]->GetBinLowEdge(iBin); // in cm + Double_t rMax = fHistClusterRadialPosition[iPlane]->GetBinWidth(iBin) + rMin; // in cm + Double_t area = 100.*TMath::Pi()*(rMax*rMax - rMin*rMin); // in mm^2 + Double_t density = fHistClusterRadialPosition[iPlane]->GetBinContent(iBin)/area; + fHistClusterRadialPosition[iPlane]->SetBinContent(iBin, density); + fHistClusterRadialPosition[iPlane]->SetBinError(iBin, fHistClusterRadialPosition[iPlane]->GetBinError(iBin)/area); + } + fHistClusterRadialPosition[iPlane] -> SetBinContent(1, fEv); // "scaler" bin + } + + // ----------------------------------------------------------------- + fFileOut->cd(); for (Int_t iPlane=0; iPlane Write(); - fHistNPixelsPerCluster[iPlane] -> Write(); - fHistClusterSizeX[iPlane] -> Write(); - fHistClusterSizeY[iPlane] -> Write(); - fClusterScatterPlotXY[iPlane] -> Write(); + fHistNClustersPerEvent[iPlane] -> Write(); + fHistNPixelsPerCluster[iPlane] -> Write(); + fHistClusterSizeX[iPlane] -> Write(); + fHistClusterSizeY[iPlane] -> Write(); + fHistClusterRadialPosition[iPlane] -> Write(); + fClusterScatterPlotXY[iPlane] -> Write(); } fFileOut -> Close(); diff --git a/MFT/AliMFTClusterQA.h b/MFT/AliMFTClusterQA.h index b1cb3a5bc2f..cc0f9fa30d3 100644 --- a/MFT/AliMFTClusterQA.h +++ b/MFT/AliMFTClusterQA.h @@ -45,7 +45,7 @@ protected: static const Int_t fNMaxPlanes = AliMFTConstants::fNMaxPlanes; TH1D *fHistNClustersPerEvent[fNMaxPlanes], *fHistNPixelsPerCluster[fNMaxPlanes]; - TH1D *fHistClusterSizeX[fNMaxPlanes], *fHistClusterSizeY[fNMaxPlanes]; + TH1D *fHistClusterSizeX[fNMaxPlanes], *fHistClusterSizeY[fNMaxPlanes], *fHistClusterRadialPosition[fNMaxPlanes]; TH2D *fClusterScatterPlotXY[fNMaxPlanes]; AliLoader *fMFTLoader; @@ -62,7 +62,7 @@ protected: }; -//====================================================================================================== +//==================================================================================================================================================== #endif diff --git a/MFT/AliMFTConstants.h b/MFT/AliMFTConstants.h index 524c38174db..91dea82f52f 100644 --- a/MFT/AliMFTConstants.h +++ b/MFT/AliMFTConstants.h @@ -20,7 +20,7 @@ public: static const Int_t fNMaxPlanes = 20; - static const Int_t fNMaxDigitsPerCluster = 12; ///< max number of digits per cluster + static const Int_t fNMaxDigitsPerCluster = 50; ///< max number of digits per cluster static const Double_t fCutForAvailableDigits; ///< static const Double_t fCutForAttachingDigits; ///< diff --git a/MFT/AliMFTDigit.h b/MFT/AliMFTDigit.h index 715e45a1cb2..26db39346a0 100644 --- a/MFT/AliMFTDigit.h +++ b/MFT/AliMFTDigit.h @@ -60,7 +60,7 @@ public: Double_t GetPixelWidthX() const { return fPixelWidthX; } Double_t GetPixelWidthY() const { return fPixelWidthY; } Double_t GetPixelWidthZ() const { return fPixelWidthZ; } - + protected: static const Double_t fElossPerElectron; diff --git a/MFT/AliMFTPlane.cxx b/MFT/AliMFTPlane.cxx index 2212f810f02..419744775a9 100644 --- a/MFT/AliMFTPlane.cxx +++ b/MFT/AliMFTPlane.cxx @@ -63,7 +63,8 @@ AliMFTPlane::AliMFTPlane(): fEquivalentSiliconBeforeBack(0), fActiveElements(0), fReadoutElements(0), - fSupportElements(0) + fSupportElements(0), + fHasPixelRectangularPatternAlongY(kFALSE) { // default constructor @@ -91,7 +92,8 @@ AliMFTPlane::AliMFTPlane(const Char_t *name, const Char_t *title): fEquivalentSiliconBeforeBack(0), fActiveElements(new TClonesArray("THnSparseC")), fReadoutElements(new TClonesArray("THnSparseC")), - fSupportElements(new TClonesArray("THnSparseC")) + fSupportElements(new TClonesArray("THnSparseC")), + fHasPixelRectangularPatternAlongY(kFALSE) { // constructor @@ -119,7 +121,8 @@ AliMFTPlane::AliMFTPlane(const AliMFTPlane& plane): fEquivalentSiliconBeforeBack(plane.fEquivalentSiliconBeforeBack), fActiveElements(new TClonesArray("THnSparseC")), fReadoutElements(new TClonesArray("THnSparseC")), - fSupportElements(new TClonesArray("THnSparseC")) + fSupportElements(new TClonesArray("THnSparseC")), + fHasPixelRectangularPatternAlongY(plane.fHasPixelRectangularPatternAlongY) { // copy constructor @@ -142,24 +145,25 @@ AliMFTPlane& AliMFTPlane::operator=(const AliMFTPlane& plane) { // base class assignement TNamed::operator=(plane); - fPlaneNumber = plane.fPlaneNumber; - fZCenter = plane.fZCenter; - fRMinSupport = plane.fRMinSupport; - fRMax = plane.fRMax; - fRMaxSupport = plane.fRMaxSupport; - fPixelSizeX = plane.fPixelSizeX; - fPixelSizeY = plane.fPixelSizeY; - fThicknessActive = plane.fThicknessActive; - fThicknessSupport = plane.fThicknessSupport; - fThicknessReadout = plane.fThicknessReadout; - fZCenterActiveFront = plane.fZCenterActiveFront; - fZCenterActiveBack = plane.fZCenterActiveBack; - fEquivalentSilicon = plane.fEquivalentSilicon; - fEquivalentSiliconBeforeFront = plane.fEquivalentSiliconBeforeFront; - fEquivalentSiliconBeforeBack = plane.fEquivalentSiliconBeforeBack; - *fActiveElements = *plane.fActiveElements; - *fReadoutElements = *plane.fReadoutElements; - *fSupportElements = *plane.fSupportElements; + fPlaneNumber = plane.fPlaneNumber; + fZCenter = plane.fZCenter; + fRMinSupport = plane.fRMinSupport; + fRMax = plane.fRMax; + fRMaxSupport = plane.fRMaxSupport; + fPixelSizeX = plane.fPixelSizeX; + fPixelSizeY = plane.fPixelSizeY; + fThicknessActive = plane.fThicknessActive; + fThicknessSupport = plane.fThicknessSupport; + fThicknessReadout = plane.fThicknessReadout; + fZCenterActiveFront = plane.fZCenterActiveFront; + fZCenterActiveBack = plane.fZCenterActiveBack; + fEquivalentSilicon = plane.fEquivalentSilicon; + fEquivalentSiliconBeforeFront = plane.fEquivalentSiliconBeforeFront; + fEquivalentSiliconBeforeBack = plane.fEquivalentSiliconBeforeBack; + *fActiveElements = *plane.fActiveElements; + *fReadoutElements = *plane.fReadoutElements; + *fSupportElements = *plane.fSupportElements; + fHasPixelRectangularPatternAlongY = plane.fHasPixelRectangularPatternAlongY; } return *this; @@ -176,7 +180,8 @@ Bool_t AliMFTPlane::Init(Int_t planeNumber, Double_t pixelSizeY, Double_t thicknessActive, Double_t thicknessSupport, - Double_t thicknessReadout) { + Double_t thicknessReadout, + Bool_t hasPixelRectangularPatternAlongY) { AliDebug(1, Form("Initializing Plane Structure for Plane %s", GetName())); @@ -190,6 +195,8 @@ Bool_t AliMFTPlane::Init(Int_t planeNumber, fThicknessSupport = thicknessSupport; fThicknessReadout = thicknessReadout; + fHasPixelRectangularPatternAlongY = hasPixelRectangularPatternAlongY; + fZCenterActiveFront = fZCenter - 0.5*fThicknessSupport - 0.5*fThicknessActive; fZCenterActiveBack = fZCenter + 0.5*fThicknessSupport + 0.5*fThicknessActive; diff --git a/MFT/AliMFTPlane.h b/MFT/AliMFTPlane.h index 274f945286c..fc2384de553 100644 --- a/MFT/AliMFTPlane.h +++ b/MFT/AliMFTPlane.h @@ -44,7 +44,8 @@ public: Double_t pixelSizeY, Double_t thicknessActive, Double_t thicknessSupport, - Double_t thicknessReadout); + Double_t thicknessReadout, + Bool_t hasPixelRectangularPatternAlongY); Bool_t CreateStructure(); @@ -80,6 +81,7 @@ public: Double_t GetEquivalentSiliconBeforeBack() const { return fEquivalentSiliconBeforeBack; } Int_t GetNumberOfChips(Option_t *opt); + Bool_t HasPixelRectangularPatternAlongY() { return fHasPixelRectangularPatternAlongY; } private: @@ -101,6 +103,8 @@ private: TClonesArray *fActiveElements, *fReadoutElements, *fSupportElements; + Bool_t fHasPixelRectangularPatternAlongY; + ClassDef(AliMFTPlane, 1) }; diff --git a/MFT/AliMFTSegmentation.cxx b/MFT/AliMFTSegmentation.cxx index fc8986607a7..675fbc598e0 100644 --- a/MFT/AliMFTSegmentation.cxx +++ b/MFT/AliMFTSegmentation.cxx @@ -51,7 +51,7 @@ AliMFTSegmentation::AliMFTSegmentation(const Char_t *nameGeomFile): // constructor Float_t zCenter, rMin, rMax, pixelSizeX, pixelSizeY, thicknessActive, thicknessSupport, thicknessReadout; - Float_t equivalentSilicon, equivalentSiliconBeforeFront, equivalentSiliconBeforeBack; + Float_t equivalentSilicon, equivalentSiliconBeforeFront, equivalentSiliconBeforeBack, hasPixelRectangularPatternAlongY; TFile *geomFile = new TFile(nameGeomFile); TNtuple *geomNtuple = (TNtuple*) geomFile->Get("AliMFTGeometry"); @@ -67,6 +67,10 @@ AliMFTSegmentation::AliMFTSegmentation(const Char_t *nameGeomFile): geomNtuple -> SetBranchAddress("equivalentSilicon", &equivalentSilicon); geomNtuple -> SetBranchAddress("equivalentSiliconBeforeFront", &equivalentSiliconBeforeFront); geomNtuple -> SetBranchAddress("equivalentSiliconBeforeBack", &equivalentSiliconBeforeBack); + if (geomNtuple -> GetBranch("hasPixelRectangularPatternAlongY")) { + geomNtuple -> SetBranchAddress("hasPixelRectangularPatternAlongY", &hasPixelRectangularPatternAlongY); + } + else hasPixelRectangularPatternAlongY = 0.; Int_t nPlanes = geomNtuple->GetEntries(); @@ -80,7 +84,18 @@ AliMFTSegmentation::AliMFTSegmentation(const Char_t *nameGeomFile): zCenter = TMath::Abs(zCenter); AliMFTPlane *plane = new AliMFTPlane(Form("MFTPlane_%02d", iPlane), Form("MFTPlane_%02d", iPlane)); - plane -> Init(iPlane, zCenter, rMin, rMax, pixelSizeX, pixelSizeY, thicknessActive, thicknessSupport, thicknessReadout); + + plane -> Init(iPlane, + zCenter, + rMin, + rMax, + pixelSizeX, + pixelSizeY, + thicknessActive, + thicknessSupport, + thicknessReadout, + (hasPixelRectangularPatternAlongY>0.5)); + plane -> SetEquivalentSilicon(equivalentSilicon); plane -> SetEquivalentSiliconBeforeFront(equivalentSiliconBeforeFront); plane -> SetEquivalentSiliconBeforeBack(equivalentSiliconBeforeBack); @@ -115,6 +130,8 @@ THnSparseC* AliMFTSegmentation::GetDetElem(Int_t detElemID) const { Bool_t AliMFTSegmentation::Hit2PixelID(Double_t xHit, Double_t yHit, Int_t detElemID, Int_t &xPixel, Int_t &yPixel) { + // xPixel and yPixel start from 0 + THnSparseC *detElem = GetDetElem(detElemID); if ( xHitGetAxis(0)->GetXmin() || @@ -131,3 +148,14 @@ Bool_t AliMFTSegmentation::Hit2PixelID(Double_t xHit, Double_t yHit, Int_t detEl //==================================================================================================================================================== +Bool_t AliMFTSegmentation::DoesPixelExist(Int_t detElemID, Int_t xPixel, Int_t yPixel) { + + THnSparseC *detElem = GetDetElem(detElemID); + + if (xPixel>=0 && xPixelGetAxis(0)->GetNbins() && yPixel>=0 && yPixelGetAxis(1)->GetNbins()) return kTRUE; + else return kFALSE; + +} + +//==================================================================================================================================================== + diff --git a/MFT/AliMFTSegmentation.h b/MFT/AliMFTSegmentation.h index 9600a3d24ef..5072bae6e8b 100644 --- a/MFT/AliMFTSegmentation.h +++ b/MFT/AliMFTSegmentation.h @@ -48,6 +48,8 @@ public: Int_t GetNPlanes() const { return fMFTPlanes->GetEntries(); } AliMFTPlane* GetPlane(Int_t iPlane) const { if (iPlane>=0 && iPlaneGetEntries()) return (AliMFTPlane*) fMFTPlanes->At(iPlane); else return NULL; } + + Bool_t DoesPixelExist(Int_t detElemID, Int_t xPixel, Int_t yPixel); protected: diff --git a/MFT/AliMuonForwardTrackAnalysis.C b/MFT/AliMuonForwardTrackAnalysis.C index b81217564c5..74be60695c9 100644 --- a/MFT/AliMuonForwardTrackAnalysis.C +++ b/MFT/AliMuonForwardTrackAnalysis.C @@ -7,13 +7,14 @@ void AliMuonForwardTrackAnalysis(const Char_t *readDir= ".", Int_t nMassBin = 100, Double_t massMin = 0., Double_t massMax = 10., + Bool_t useCutOnOffsetChi2 = kFALSE, + Int_t maxNWrongClusters = 999, const Char_t *outDir = ".", Bool_t singleMuonAnalysis = kTRUE, Bool_t muonPairAnalysis = kTRUE, Int_t firstEvent = -1, Int_t lastEvent = -1, Int_t myRandom = 0, - Int_t maxNWrongClusters = 999, Double_t ptMinSingleMuons = 0.0) { gROOT -> LoadMacro("./AliMuonForwardTrackAnalysis.cxx+"); @@ -29,16 +30,15 @@ void AliMuonForwardTrackAnalysis(const Char_t *readDir= ".", myAnalysis->SetInputDir(readDir); myAnalysis->SetOutputDir(outDir); myAnalysis->SetMassRange(nMassBin, massMin, massMax); - myAnalysis->SetPtDimuRange(10, 0., 5.); myAnalysis->SetSingleMuonAnalysis(singleMuonAnalysis); myAnalysis->SetMuonPairAnalysis(muonPairAnalysis); myAnalysis->SetOption(option); - myAnalysis->SetMatchTrigger(kTRUE); myAnalysis->SetMaxNWrongClustersMC(maxNWrongClusters); myAnalysis->SetPtMinSingleMuons(ptMinSingleMuons); + myAnalysis->UseCutOnOffsetChi2(useCutOnOffsetChi2); - myAnalysis->UseCutOnOffsetChi2(kFALSE); // cut on the single muons - + myAnalysis->SetPtDimuRange(10, 0., 5.); + myAnalysis->SetMatchTrigger(kTRUE); myAnalysis->UseBransonForCut(kFALSE); myAnalysis->UseBransonForKinematics(kFALSE); diff --git a/MFT/AliMuonForwardTrackPair.cxx b/MFT/AliMuonForwardTrackPair.cxx index 474c52c5ba1..b56cf66d22e 100644 --- a/MFT/AliMuonForwardTrackPair.cxx +++ b/MFT/AliMuonForwardTrackPair.cxx @@ -39,7 +39,9 @@ ClassImp(AliMuonForwardTrackPair) AliMuonForwardTrackPair::AliMuonForwardTrackPair(): TObject(), fMuonForwardTracks(0), - fKinemMC(0,0,0,0) + fKinemMC(0,0,0,0), + fKinem(0,0,0,0), + fIsKinemSet(kFALSE) { // default constructor @@ -53,7 +55,9 @@ AliMuonForwardTrackPair::AliMuonForwardTrackPair(): AliMuonForwardTrackPair::AliMuonForwardTrackPair(AliMuonForwardTrack *track0, AliMuonForwardTrack *track1): TObject(), fMuonForwardTracks(0), - fKinemMC(0,0,0,0) + fKinemMC(0,0,0,0), + fKinem(0,0,0,0), + fIsKinemSet(kFALSE) { fMuonForwardTracks = new TClonesArray("AliMuonForwardTrack", 2); @@ -70,7 +74,9 @@ AliMuonForwardTrackPair::AliMuonForwardTrackPair(AliMuonForwardTrack *track0, Al AliMuonForwardTrackPair::AliMuonForwardTrackPair(const AliMuonForwardTrackPair& trackPair): TObject(trackPair), fMuonForwardTracks(trackPair.fMuonForwardTracks), - fKinemMC(trackPair.fKinemMC) + fKinemMC(trackPair.fKinemMC), + fKinem(trackPair.fKinem), + fIsKinemSet(trackPair.fIsKinemSet) { // copy constructor @@ -93,6 +99,9 @@ AliMuonForwardTrackPair& AliMuonForwardTrackPair::operator=(const AliMuonForward Clear(); fMuonForwardTracks = trackPair.fMuonForwardTracks; + fKinemMC = trackPair.fKinemMC; + fKinem = trackPair.fKinem; + fIsKinemSet = trackPair.fIsKinemSet; return *this; @@ -125,55 +134,6 @@ Double_t AliMuonForwardTrackPair::GetWeightedOffset(Double_t x, Double_t y, Doub //==================================================================================================================================================== -Double_t AliMuonForwardTrackPair::GetMass(Double_t z, Int_t nClusters) { - - Int_t idCluster[2] = {0}; - if (nClusters>0) { - idCluster[0] = ((AliMuonForwardTrack*) fMuonForwardTracks->At(0))->GetNMFTClusters() - nClusters; - idCluster[1] = ((AliMuonForwardTrack*) fMuonForwardTracks->At(1))->GetNMFTClusters() - nClusters; - } - if (idCluster[0]<0) idCluster[0] = 0; - if (idCluster[1]<0) idCluster[1] = 0; - - Double_t momentum[2] = {0}; - - AliMUONTrackParam *param0 = ((AliMuonForwardTrack*) fMuonForwardTracks->At(0))->GetTrackParamAtMFTCluster(idCluster[0]); - AliMUONTrackParam *param1 = ((AliMuonForwardTrack*) fMuonForwardTracks->At(1))->GetTrackParamAtMFTCluster(idCluster[1]); - - AliDebug(2, Form("MFT before extrap: 1st muon = (%f, %f, %f) 2nd muon = (%f, %f, %f)", - param0->Px(), param0->Py(), param0->Pz(), - param1->Px(), param1->Py(), param1->Pz())); - - if (TMath::Abs(z)<1e6) { - AliDebug(2, Form("Extrapolating 1st muon from z = %f to z = %f", param0->GetZ(), z)); - AliMUONTrackExtrap::ExtrapToZCov(param0, z); - AliDebug(2, Form("Extrapolating 2nd muon from z = %f to z = %f", param1->GetZ(), z)); - AliMUONTrackExtrap::ExtrapToZCov(param1, z); - } - - AliDebug(2, Form("MFT after extrap: 1st muon = (%f, %f, %f) 2nd muon = (%f, %f, %f)", - param0->Px(), param0->Py(), param0->Pz(), - param1->Px(), param1->Py(), param1->Pz())); - - momentum[0] = (param0->P()); - momentum[1] = (param1->P()); - - Double_t mMu = TDatabasePDG::Instance()->GetParticle("mu-")->Mass(); - - TLorentzVector dimu; - - dimu.SetE(TMath::Sqrt(mMu*mMu + momentum[0]*momentum[0]) + TMath::Sqrt(mMu*mMu + momentum[1]*momentum[1])); - - dimu.SetPx(param0->Px() + param1->Px()); - dimu.SetPy(param0->Py() + param1->Py()); - dimu.SetPz(param0->Pz() + param1->Pz()); - - return dimu.M(); - -} - -//==================================================================================================================================================== - Double_t AliMuonForwardTrackPair::GetMassWithoutMFT(Double_t x, Double_t y, Double_t z, Int_t nClusters) { Int_t idCluster[2] = {0}; @@ -223,6 +183,9 @@ Double_t AliMuonForwardTrackPair::GetMassWithoutMFT(Double_t x, Double_t y, Doub void AliMuonForwardTrackPair::SetKinemMC() { + if ( !(((AliMuonForwardTrack*) fMuonForwardTracks->At(0))->GetMCTrackRef()) || + !(((AliMuonForwardTrack*) fMuonForwardTracks->At(1))->GetMCTrackRef()) ) return; + AliDebug(2, Form("MC: 1st muon = (%f, %f, %f) 2nd muon = (%f, %f, %f)", ((AliMuonForwardTrack*) fMuonForwardTracks->At(0))->GetMCTrackRef()->Px(), ((AliMuonForwardTrack*) fMuonForwardTracks->At(0))->GetMCTrackRef()->Py(), @@ -247,6 +210,57 @@ void AliMuonForwardTrackPair::SetKinemMC() { //==================================================================================================================================================== +void AliMuonForwardTrackPair::SetKinem(Double_t z, Int_t nClusters) { + +// if (!fMuonForwardTracks) return kFALSE; +// if (!fMuonForwardTracks->At(0) || !fMuonForwardTracks->At(1)) return kFALSE; + + Int_t idCluster[2] = {0}; + if (nClusters>0) { + idCluster[0] = ((AliMuonForwardTrack*) fMuonForwardTracks->At(0))->GetNMFTClusters() - nClusters; + idCluster[1] = ((AliMuonForwardTrack*) fMuonForwardTracks->At(1))->GetNMFTClusters() - nClusters; + } + if (idCluster[0]<0) idCluster[0] = 0; + if (idCluster[1]<0) idCluster[1] = 0; + + Double_t momentum[2] = {0}; + + AliMUONTrackParam *param0 = ((AliMuonForwardTrack*) fMuonForwardTracks->At(0))->GetTrackParamAtMFTCluster(idCluster[0]); + AliMUONTrackParam *param1 = ((AliMuonForwardTrack*) fMuonForwardTracks->At(1))->GetTrackParamAtMFTCluster(idCluster[1]); + + AliDebug(2, Form("MFT before extrap: 1st muon = (%f, %f, %f) 2nd muon = (%f, %f, %f)", + param0->Px(), param0->Py(), param0->Pz(), + param1->Px(), param1->Py(), param1->Pz())); + + if (TMath::Abs(z)<1e6) { + AliDebug(2, Form("Extrapolating 1st muon from z = %f to z = %f", param0->GetZ(), z)); + AliMUONTrackExtrap::ExtrapToZCov(param0, z); + AliDebug(2, Form("Extrapolating 2nd muon from z = %f to z = %f", param1->GetZ(), z)); + AliMUONTrackExtrap::ExtrapToZCov(param1, z); + } + + AliDebug(2, Form("MFT after extrap: 1st muon = (%f, %f, %f) 2nd muon = (%f, %f, %f)", + param0->Px(), param0->Py(), param0->Pz(), + param1->Px(), param1->Py(), param1->Pz())); + + momentum[0] = (param0->P()); + momentum[1] = (param1->P()); + + Double_t mMu = TDatabasePDG::Instance()->GetParticle("mu-")->Mass(); + + fKinem.SetE(TMath::Sqrt(mMu*mMu + momentum[0]*momentum[0]) + TMath::Sqrt(mMu*mMu + momentum[1]*momentum[1])); + fKinem.SetPx(param0->Px() + param1->Px()); + fKinem.SetPy(param0->Py() + param1->Py()); + fKinem.SetPz(param0->Pz() + param1->Pz()); + + fIsKinemSet = kTRUE; + + // return fKinem.M(); + +} + +//==================================================================================================================================================== + Bool_t AliMuonForwardTrackPair::IsResonance() { Bool_t result = kFALSE; diff --git a/MFT/AliMuonForwardTrackPair.h b/MFT/AliMuonForwardTrackPair.h index 9e39a5f5094..7a69e631005 100644 --- a/MFT/AliMuonForwardTrackPair.h +++ b/MFT/AliMuonForwardTrackPair.h @@ -42,20 +42,25 @@ public: } void SetKinemMC(); + void SetKinem(Double_t z, Int_t nClusters=-1); + Bool_t IsKinemSet() { return fIsKinemSet; } Double_t GetWeightedOffset(Double_t x, Double_t y, Double_t z); - Double_t GetMass(Double_t z, Int_t nClusters=-1); Double_t GetMassWithoutMFT(Double_t x, Double_t y, Double_t z, Int_t nClusters=-1); Double_t GetMassMC() { return fKinemMC.M(); } Double_t GetRapidityMC() { return fKinemMC.Rapidity(); } Double_t GetPtMC() { return fKinemMC.Pt(); } + Double_t GetMass() { return fKinem.M(); } + Double_t GetRapidity() { return fKinem.Rapidity(); } + Double_t GetPt() { return fKinem.Pt(); } Bool_t IsResonance(); protected: TClonesArray *fMuonForwardTracks; - TLorentzVector fKinemMC; + TLorentzVector fKinemMC, fKinem; + Bool_t fIsKinemSet; ClassDef(AliMuonForwardTrackPair,1) diff --git a/MFT/SetMFTGeometry.C b/MFT/SetMFTGeometry.C index a86e6f9aa96..15ff8834c88 100644 --- a/MFT/SetMFTGeometry.C +++ b/MFT/SetMFTGeometry.C @@ -26,7 +26,9 @@ void SetMFTGeometry() { const Float_t equivalentSiliconBeforeFront[nPlanes] = { 0.e-4, 0.e-4, 0.e-4, 0.e-4, 0.e-4}; // expressed in cm const Float_t equivalentSiliconBeforeBack[nPlanes] = { 250.e-4, 250.e-4, 250.e-4, 250.e-4, 250.e-4}; // expressed in cm - TNtuple *geomMFT = new TNtuple("AliMFTGeometry", "ALICE MFT Geometry", "zCenter:rMin:rMax:pixelSizeX:pixelSizeY:thicknessActive:thicknessSupport:thicknessReadout:equivalentSilicon:equivalentSiliconBeforeFront:equivalentSiliconBeforeBack"); + const Float_t hasPixelRectangularPatternAlongY[nPlanes] = {0., 0., 0., 0., 0.}; + + TNtuple *geomMFT = new TNtuple("AliMFTGeometry", "ALICE MFT Geometry", "zCenter:rMin:rMax:pixelSizeX:pixelSizeY:thicknessActive:thicknessSupport:thicknessReadout:equivalentSilicon:equivalentSiliconBeforeFront:equivalentSiliconBeforeBack:hasPixelRectangularPatternAlongY"); for (Int_t iPlane=0; iPlane Fill(zCenter[iPlane], rMin[iPlane], @@ -38,7 +40,8 @@ void SetMFTGeometry() { thicknessReadout[iPlane], equivalentSilicon[iPlane], equivalentSiliconBeforeFront[iPlane], - equivalentSiliconBeforeBack[iPlane]); + equivalentSiliconBeforeBack[iPlane], + hasPixelRectangularPatternAlongY[iPlane]); TFile *fileGeomMFT = new TFile("AliMFTGeometry.root", "recreate"); geomMFT -> Write(); diff --git a/MFT/runReconstruction.C b/MFT/runReconstruction.C index 6c528482a37..f8bf6f1f9ed 100644 --- a/MFT/runReconstruction.C +++ b/MFT/runReconstruction.C @@ -10,8 +10,9 @@ void runReconstruction(Int_t seed, const Char_t *recOptions) { // GRP from local OCDB reco->SetSpecificStorage("GRP/GRP/Data",Form("local://%s",gSystem->pwd())); - // MUON Tracker - // reco->SetSpecificStorage("MUON/Align/Data","local:///$OCDB/simulation/2008/v4-15-Release/Residual"); + // MUON Tracker -> local:///$OCDB should reflect the content of alien://folder=/alice + reco->SetSpecificStorage("MUON/Align/Data", "local:///$OCDB/simulation/2008/v4-15-Release/Residual"); + reco->SetSpecificStorage("MUON/Calib/RecoParam", "local:///$OCDB/simulation/2008/v4-15-Release/Full"); reco->SetRunReconstruction("MUON MFT"); reco->SetRunLocalReconstruction("MUON MFT"); diff --git a/MFT/runSimulation.C b/MFT/runSimulation.C index 46eb45b5ecc..70eab84b914 100644 --- a/MFT/runSimulation.C +++ b/MFT/runSimulation.C @@ -13,8 +13,9 @@ void runSimulation(Int_t seed, simulator->SetRunQA("ALL"); simulator->SetRunHLT(""); - // MUON Tracker - // simulator->SetSpecificStorage("MUON/Align/Data", "local:///$OCDB/simulation/2008/v4-15-Release/Ideal"); + // MUON Tracker -> local:///$OCDB should reflect the content of alien://folder=/alice + simulator->SetSpecificStorage("MUON/Align/Data", "local:///$OCDB/simulation/2008/v4-15-Release/Ideal"); + simulator->SetSpecificStorage("MUON/Calib/Gains","local:///$OCDB/simulation/2008/v4-15-Release/Ideal"); // The rest TStopwatch timer; -- 2.43.0