/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ // $Id$ // $MpId: AliMpSector.cxx,v 1.14 2006/05/24 13:58:46 ivana Exp $ // Category: sector //----------------------------------------------------------------------------- // Class AliMpSector // ----------------- // Class describing the sector of the MUON chamber of station 1. // Included in AliRoot: 2003/05/02 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay //----------------------------------------------------------------------------- #include "AliMpSector.h" #include "AliMpSectorPadIterator.h" #include "AliMpZone.h" #include "AliMpRow.h" #include "AliMpVRowSegment.h" #include "AliMpVMotif.h" #include "AliMpMotifMap.h" #include "AliMpEncodePair.h" #include "AliMpConstants.h" #include "AliLog.h" #include using std::cout; using std::endl; /// \cond CLASSIMP ClassImp(AliMpSector) /// \endcond //_____________________________________________________________________________ AliMpSector::AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows, AliMp::Direction direction, Double_t offsetx, Double_t offsety) : TNamed("Sector", ""), fID(id), fOffsetX(offsetx), fOffsetY(offsety), fDimensionX(0.), fDimensionY(0.), fZones(), fRows(), fMotifMap(0), fDirection(direction), fMinPadDimensionX(1.e6), fMinPadDimensionY(1.e6), fMaxPadDimensionX(0.), fMaxPadDimensionY(0.), fLMaxPadIndices(0), fNofPads(0) { /// Standard constructor AliDebugStream(1) << "this = " << this << endl; fMotifMap = new AliMpMotifMap; for (Int_t izone = 0; izoneGetID() << " center Y " << row->GetPositionY() << endl; for (Int_t j=0; jGetNofRowSegments(); j++) { AliMpVRowSegment* rowSegment = row->GetRowSegment(j); cout << " ROW Segment " << j << " borders " << rowSegment->LeftBorderX() << " " << rowSegment->RightBorderX() << " x-size " << 2*rowSegment->GetDimensionX() << " " << endl; } } } //_____________________________________________________________________________ AliMpRow* AliMpSector::FindRow(Int_t motifPositionId) const { /// Find the row with the the specified motif position. \n /// Return 0 if no row is found. AliMpVRowSegment* segment = FindRowSegment(motifPositionId); if (segment) return segment->GetRow(); return 0; } //_____________________________________________________________________________ AliMpVRowSegment* AliMpSector::FindRowSegment(Int_t motifPositionId) const { /// Find the row segment with the the specified motif position. \n /// Return 0 if no row segment is found. for (Int_t irow=0; irowGetNofRowSegments(); iseg++) { AliMpVRowSegment* segment = row->GetRowSegment(iseg); if (segment->HasMotifPosition(motifPositionId)) return segment; } } return 0; } //_____________________________________________________________________________ Double_t AliMpSector::GetPositionX() const { /// Return the sector offset. return fOffsetX; } //_____________________________________________________________________________ Double_t AliMpSector::GetPositionY() const { /// Return the sector offset. return fOffsetY; } //_____________________________________________________________________________ Double_t AliMpSector::GetDimensionX() const { /// Return the maximum halflengths in x. return fDimensionX; } //_____________________________________________________________________________ Double_t AliMpSector::GetDimensionY() const { /// Return the maximum halflengths in y. return fDimensionY; } //_____________________________________________________________________________ Int_t AliMpSector::GetNofZones() const { /// Return the number of zones. return fZones.GetEntriesFast(); } //_____________________________________________________________________________ AliMpZone* AliMpSector::GetZone(Int_t zoneID) const { /// Return zone with specified ID. if (zoneID < 1 || zoneID > GetNofZones()) { AliWarningStream() << "Index outside range" << endl; return 0; } return (AliMpZone*)fZones[zoneID-1]; } //_____________________________________________________________________________ Int_t AliMpSector::GetNofRows() const { /// Return the number of rows. return fRows.GetEntriesFast(); } //_____________________________________________________________________________ AliMpRow* AliMpSector::GetRow(Int_t rowID) const { /// Return row with specified ID. if (rowID < 0 || rowID >= GetNofRows()) { AliWarningStream() << "Index outside range" << endl; return 0; } return (AliMpRow*)fRows[rowID]; } //_____________________________________________________________________________ AliMp::PlaneType AliMpSector::GetPlaneType() const { /// Return the plane type return GetDirection()==AliMp::kY ? AliMp::kBendingPlane : AliMp::kNonBendingPlane; } //_____________________________________________________________________________ Int_t AliMpSector::GetNofMotifPositions() const { /// Return the number of manus return fMotifMap->GetNofMotifPositions(); } //_____________________________________________________________________________ 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); }