X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MFT%2FAliMFTSegmentation.cxx;h=5eeecc5a3f98e98ae21fb93fc582193907306cf8;hb=475afe2ca56106b400794f0946c4597f355565df;hp=fc8986607a7729cc4cc64ca23b41ed72decd4205;hpb=d4643a10c730d7d802b7cc1bb80b22fc71ba9690;p=u%2Fmrichter%2FAliRoot.git diff --git a/MFT/AliMFTSegmentation.cxx b/MFT/AliMFTSegmentation.cxx index fc8986607a7..5eeecc5a3f9 100644 --- a/MFT/AliMFTSegmentation.cxx +++ b/MFT/AliMFTSegmentation.cxx @@ -45,13 +45,15 @@ AliMFTSegmentation::AliMFTSegmentation(): AliMFTSegmentation::AliMFTSegmentation(const Char_t *nameGeomFile): TObject(), - fMFTPlanes(new TClonesArray("AliMFTPlane", fNMaxPlanes)) + fMFTPlanes(0x0) { - + // constructor - + + fMFTPlanes = new TClonesArray("AliMFTPlane", fNMaxPlanes); + fMFTPlanes -> SetOwner(kTRUE); 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 +69,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(); @@ -74,26 +80,57 @@ AliMFTSegmentation::AliMFTSegmentation(const Char_t *nameGeomFile): // Create new plane - printf("Setting segmentation for MFT plane #%02d\n", iPlane); + AliInfo(Form("Setting segmentation for MFT plane #%02d\n", iPlane)); geomNtuple -> GetEntry(iPlane); 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); plane -> CreateStructure(); new ((*fMFTPlanes)[fMFTPlanes->GetEntries()]) AliMFTPlane(*plane); - + delete plane; + } delete geomFile; - printf("MFT segmentation set!\n"); + AliInfo("MFT segmentation set!\n"); + +} +//==================================================================================================================================================== + +AliMFTSegmentation::~AliMFTSegmentation() { + + if (fMFTPlanes) fMFTPlanes->Delete(); + delete fMFTPlanes; + +} + +//==================================================================================================================================================== + +void AliMFTSegmentation::Clear(const Option_t* /*opt*/) { + + if (fMFTPlanes) fMFTPlanes->Delete(); + delete fMFTPlanes; + fMFTPlanes = NULL; + } //==================================================================================================================================================== @@ -115,6 +152,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 +170,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; + +} + +//==================================================================================================================================================== +