X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2Fmapping%2FAliMpSector.cxx;h=91bf9fe733be1b32d072bcbe1aa9cde842502a17;hb=f1cb4ee87ecf8c6016dabe6b2b13795856684ea8;hp=a2f970188aaedcf96d0f431b78b61fdf3c93eff3;hpb=5006ec943c36d17321f7f2678e77a947981bdaf1;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/mapping/AliMpSector.cxx b/MUON/mapping/AliMpSector.cxx index a2f970188aa..91bf9fe733b 100755 --- a/MUON/mapping/AliMpSector.cxx +++ b/MUON/mapping/AliMpSector.cxx @@ -14,7 +14,7 @@ **************************************************************************/ // $Id$ -// $MpId: AliMpSector.cxx,v 1.10 2005/09/26 16:12:23 ivana Exp $ +// $MpId: AliMpSector.cxx,v 1.14 2006/05/24 13:58:46 ivana Exp $ // Category: sector // // Class AliMpSector @@ -23,9 +23,6 @@ // Included in AliRoot: 2003/05/02 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay -#include -#include - #include "AliMpSector.h" #include "AliMpSectorPadIterator.h" #include "AliMpZone.h" @@ -36,21 +33,33 @@ #include "AliMpIntPair.h" #include "AliMpConstants.h" +#include "AliLog.h" + +#include + +/// \cond CLASSIMP ClassImp(AliMpSector) +/// \endcond //_____________________________________________________________________________ AliMpSector::AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows, - AliMpDirection direction, const TVector2& offset) + AliMp::Direction direction, const TVector2& offset) : TNamed("Sector", ""), fID(id), fOffset(offset), fZones(), fRows(), + fMotifMap(0), fDirection(direction), - fMinPadDimensions(TVector2(1.e6, 1.e6)) + fMinPadDimensions(TVector2(1.e6, 1.e6)), + fMaxPadDimensions(), + fMaxPadIndices(AliMpIntPair::Invalid()), + fNofPads(0) { /// Standard constructor + AliDebugStream(1) << "this = " << this << endl; + fMotifMap = new AliMpMotifMap(true); //fMotifMap = new AliMpMotifMap(); @@ -71,15 +80,6 @@ AliMpSector::AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows, #endif } -//_____________________________________________________________________________ -AliMpSector::AliMpSector(const AliMpSector& right) - : TNamed(right) -{ -/// Protected copy constructor (not provided) - - Fatal("AliMpSector", "Copy constructor not provided."); -} - //_____________________________________________________________________________ AliMpSector::AliMpSector() : TNamed(), @@ -88,10 +88,15 @@ AliMpSector::AliMpSector() fZones(), fRows(), fMotifMap(0), - fDirection(kX), - fMinPadDimensions(TVector2(0., 0.)) + fDirection(AliMp::kX), + fMinPadDimensions(TVector2(0., 0.)), + fMaxPadDimensions(), + fMaxPadIndices(AliMpIntPair::Invalid()), + fNofPads(0) { /// Default constructor + + AliDebugStream(1) << "this = " << this << endl; } //_____________________________________________________________________________ @@ -99,6 +104,8 @@ AliMpSector::~AliMpSector() { /// Destructor + AliDebugStream(1) << "this = " << this << endl; + // deletes for (Int_t izone = 0; izoneGetPadDimensions(); - if ( fDirection == kX && + if ( fDirection == AliMp::kX && padDimensions.Y() > 0. && padDimensions.Y() < fMinPadDimensions.Y() || - fDirection == kY && + fDirection == AliMp::kY && padDimensions.X() > 0. && padDimensions.X() < fMinPadDimensions.X()) fMinPadDimensions = padDimensions; + + if ( fDirection == AliMp::kX && + padDimensions.Y() > 0. && padDimensions.Y() > fMaxPadDimensions.Y() || + fDirection == AliMp::kY && + padDimensions.X() > 0. && padDimensions.X() > fMinPadDimensions.X()) + + fMaxPadDimensions = padDimensions; } } +//_____________________________________________________________________________ +void AliMpSector::SetMaxPadIndices() +{ +/// Set maximum pad indices in x, y + + if ( fMaxPadIndices != AliMpIntPair::Invalid() ) return; + + Int_t maxIndexInX = 0; + Int_t maxIndexInY = 0; + for (Int_t i=0; iGetHighIndicesLimit().GetFirst(); + if ( ixh > maxIndexInX ) maxIndexInX = ixh; + + Int_t iyh = GetRow(i)->GetHighIndicesLimit().GetSecond(); + if ( iyh > maxIndexInY ) maxIndexInY = iyh; + } + + fMaxPadIndices = AliMpIntPair(maxIndexInX, maxIndexInY); +} + + +//_____________________________________________________________________________ +void AliMpSector::SetNofPads() +{ +/// Set the total number of pads + + fNofPads = fMotifMap->CalculateNofPads(); +} + // // public methods // @@ -230,7 +257,9 @@ void AliMpSector::Initialize() SetRowOffsets(); SetMotifPositions(); SetGlobalIndices(); - SetMinPadDimensions(); + SetMinMaxPadDimensions(); + SetMaxPadIndices(); + SetNofPads(); } //_____________________________________________________________________________ @@ -360,7 +389,7 @@ TVector2 AliMpSector::FindPosition(Int_t motifPositionId) const AliMpVRowSegment* segment = FindRowSegment(motifPositionId); if (!segment) { - Warning("FindPosition", "Given motifPositionId not found."); + AliWarningStream() << "Given motifPositionId not found." << endl; return TVector2(); } @@ -442,7 +471,7 @@ AliMpZone* AliMpSector::GetZone(Int_t zoneID) const /// Return zone with specified ID. if (zoneID < 1 || zoneID > GetNofZones()) { - Warning("GetZone", "Index outside range"); + AliWarningStream() << "Index outside range" << endl; return 0; } @@ -475,7 +504,7 @@ AliMpRow* AliMpSector::GetRow(Int_t rowID) const /// Return row with specified ID. if (rowID < 0 || rowID >= GetNofRows()) { - Warning("GetRow", "Index outside range"); + AliWarningStream() << "Index outside range" << endl; return 0; } @@ -487,3 +516,31 @@ AliMpRow* AliMpSector::GetRow(Int_t rowID) const return (AliMpRow*)fRows[rowID]; #endif } + +//_____________________________________________________________________________ +AliMp::PlaneType +AliMpSector::GetPlaneType() const +{ +/// Return the plane type + + return GetDirection()==AliMp::kY ? AliMp::kBendingPlane : AliMp::kNonBendingPlane; +} + +//_____________________________________________________________________________ +void +AliMpSector::GetAllMotifPositionsIDs(TArrayI& ecn) const +{ +/// Return the array of all motif positions IDs + + fMotifMap->GetAllMotifPositionsIDs(ecn); +} + +//_____________________________________________________________________________ +void +AliMpSector::Print(Option_t* opt) const +{ +/// Print the map of motifs + + cout << "Sector," << PlaneTypeName(GetPlaneType()) << endl; + fMotifMap->Print(opt); +}