fMFTPlanes(0)
{
- // TO BE CHECKED
-
// default constructor
- fMFTPlanes = new TClonesArray("AliMFTPlane", fNMaxPlanes);
-
}
//====================================================================================================================================================
AliMFTSegmentation::AliMFTSegmentation(const Char_t *nameGeomFile):
TObject(),
- fMFTPlanes(0)
+ 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");
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();
// 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");
}
//====================================================================================================================================================
-THnSparseC* AliMFTSegmentation::GetDetElem(Int_t detElemID) {
+AliMFTSegmentation::~AliMFTSegmentation() {
+
+ if (fMFTPlanes) fMFTPlanes->Delete();
+ delete fMFTPlanes;
+
+}
+
+//====================================================================================================================================================
+
+void AliMFTSegmentation::Clear(const Option_t* /*opt*/) {
+
+ if (fMFTPlanes) fMFTPlanes->Delete();
+ delete fMFTPlanes;
+ fMFTPlanes = NULL;
+
+}
+
+//====================================================================================================================================================
+
+THnSparseC* AliMFTSegmentation::GetDetElem(Int_t detElemID) const {
// Find det elem
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 ( xHit<detElem->GetAxis(0)->GetXmin() ||
//====================================================================================================================================================
+Bool_t AliMFTSegmentation::DoesPixelExist(Int_t detElemID, Int_t xPixel, Int_t yPixel) {
+
+ THnSparseC *detElem = GetDetElem(detElemID);
+
+ if (xPixel>=0 && xPixel<detElem->GetAxis(0)->GetNbins() && yPixel>=0 && yPixel<detElem->GetAxis(1)->GetNbins()) return kTRUE;
+ else return kFALSE;
+
+}
+
+//====================================================================================================================================================
+