// the mapping package
//
// Author: Ivana Hrivnacova, IPN Orsay
-
+
#include <TError.h>
#include <TF1.h>
#include <TObjArray.h>
#include <TVector2.h>
+#include <TSystem.h>
+
+#include "AliLog.h"
#include "AliMpPad.h"
#include "AliMpArea.h"
-#include "AliMpReader.h"
+#include "AliMpSectorReader.h"
#include "AliMpSector.h"
#include "AliMpVPadIterator.h"
#include "AliMpSectorSegmentation.h"
-
-#include "AliMUONSt12QuadrantSegmentation.h"
-#include "AliRun.h"
-#include "AliMUON.h"
-#include "AliMUONChamber.h"
-#include "AliLog.h"
#include "AliMpFiles.h"
#include "AliMpNeighboursPadIterator.h"
-#include <TSystem.h>
+
+#include "AliMUONSt12QuadrantSegmentation.h"
+#include "AliMUONConstants.h"
ClassImp(AliMUONSt12QuadrantSegmentation)
-const Float_t AliMUONSt12QuadrantSegmentation::fgkWireD = 0.20;
-const Float_t AliMUONSt12QuadrantSegmentation::fgkLengthUnit = 0.1;
+const Float_t AliMUONSt12QuadrantSegmentation::fgkWireD = 0.21;
//______________________________________________________________________________
AliMUONSt12QuadrantSegmentation::AliMUONSt12QuadrantSegmentation(
fCorrA->AddAt(0,0);
fCorrA->AddAt(0,1);
fCorrA->AddAt(0,2);
+
+ AliDebug(1, Form("ctor this = %p", this) );
}
//______________________________________________________________________________
fYt(0.),
fCorrA(0) {
// Default Constructor
+
+ AliDebug(1, Form("default (empty) ctor this = %p", this));
}
//______________________________________________________________________________
AliMUONSt12QuadrantSegmentation::~AliMUONSt12QuadrantSegmentation() {
// Destructor
+ AliDebug(1, Form("dtor this = %p", this));
+
delete fSector;
delete fSectorSegmentation;
delete fSectorIterator;
fIx = pad.GetIndices().GetFirst();
fIy = pad.GetIndices().GetSecond();
- fX = pad.Position().X() * fgkLengthUnit;
- fY = pad.Position().Y() * fgkLengthUnit;
+ fX = pad.Position().X();
+ fY = pad.Position().Y();
fZone = fSectorSegmentation->Zone(pad);
}
if (!gSystem->Getenv("MINSTALL")) {
TString dirPath = gSystem->Getenv("ALICE_ROOT");
dirPath += "/MUON/mapping";
- AliMpFiles::Instance()->SetTopPath(dirPath);
+ AliMpFiles::SetTopPath(dirPath);
gSystem->Setenv("MINSTALL", dirPath.Data());
//cout << "AliMpFiles top path set to " << dirPath << endl;
}
- AliMpReader r(fStationType, fPlaneType);
+ AliMpSectorReader r(fStationType, fPlaneType);
fSector = r.BuildSector();
fSectorSegmentation = new AliMpSectorSegmentation(fSector);
}
// fSector->GetMotifMap()->Print();
AliMpPad pad = fSectorSegmentation
- ->PadByPosition(TVector2(x/fgkLengthUnit, y/fgkLengthUnit), false);
+ ->PadByPosition(TVector2(x,y), false);
return pad.IsValid();
}
}
//______________________________________________________________________________
-const AliMpSectorSegmentation*
+const AliMpVSegmentation*
AliMUONSt12QuadrantSegmentation::GetMpSegmentation() const
{
// Returns the mapping segmentation
// If there is no pad, ix = 0, iy = 0 are returned.
// ---
- AliMpPad pad = fSectorSegmentation
- ->PadByPosition(TVector2(x/fgkLengthUnit, y/fgkLengthUnit), true);
+ AliMpPad pad = fSectorSegmentation->PadByPosition(TVector2(x,y), true);
ix = pad.GetIndices().GetFirst();
iy = pad.GetIndices().GetSecond();
AliMpPad pad = fSectorSegmentation->PadByIndices(AliMpIntPair(ix,iy), true);
- x = pad.Position().X() * fgkLengthUnit;
- y = pad.Position().Y() * fgkLengthUnit;
+ x = pad.Position().X();
+ y = pad.Position().Y();
}
// find Npx, Npy and save this info
// reference to chamber
- AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON");
- fChamber = &(pMUON->Chamber(chamber));
- fRmin=fChamber->RInner();
- fRmax=fChamber->ROuter();
+ fRmin=AliMUONConstants::Rmin(0);
+ fRmax=AliMUONConstants::Rmax(0);
fZ = 0;
fId=chamber;
}
// Pad size in x by sector
// ---
- return fSectorSegmentation->PadDimensions(isector).X()*2.*fgkLengthUnit;
+ return fSectorSegmentation->PadDimensions(isector).X()*2.0;
}
//______________________________________________________________________________
// Pad size in x, y by Sector
// ---
- return fSectorSegmentation->PadDimensions(isector).Y()*2.*fgkLengthUnit;
+ return fSectorSegmentation->PadDimensions(isector).Y()*2.0;
}
//______________________________________________________________________________
if (dx == 0.) dx = 0.01;
if (dy == 0.) dy = 0.01;
+ // Delete previous iterator
+ delete fSectorIterator;
+
fSectorIterator
= fSectorSegmentation
- ->CreateIterator(AliMpArea(TVector2(fXhit/fgkLengthUnit, fYhit/fgkLengthUnit),
- TVector2(dx/fgkLengthUnit, dy/fgkLengthUnit)));
+ ->CreateIterator(AliMpArea(TVector2(fXhit,fYhit),TVector2(dx,dy)));
+ AliDebug(1,Form("CreateIterator area=%e,%e +- %e,%e %s",
+ fXhit,fYhit,dx,dy,PlaneTypeName(fPlaneType)));
+
fSectorIterator->First();
if (! fSectorIterator->IsDone())
if (!pad.IsValid())
AliFatal("Cannot locate pad.");
- return (pad.Position()*fgkLengthUnit - TVector2(x, y)).Mod2();
+ return (pad.Position() - TVector2(x, y)).Mod2();
}
//______________________________________________________________________________
return fSectorSegmentation
->Zone(fSectorSegmentation
- ->PadByPosition(TVector2(x/fgkLengthUnit, y/fgkLengthUnit)));
+ ->PadByPosition(TVector2(x,y)));
}
//______________________________________________________________________________