// Configure St1 chamber segmentations
if (cathod == 0) {
- // bending plane
segmentation->Add(id0, bendSt1);
segmentation->Add(id0 + 1, nonbendSt1);
segmentation->Add(id0 + 50, bendSt1);
segmentation->Add(id0 + 51, nonbendSt1);
}
else if (cathod == 1) {
- // non-bending plane
segmentation->Add(id0, nonbendSt1);
segmentation->Add(id0 + 1, bendSt1);
segmentation->Add(id0 + 50, nonbendSt1);
//_____________________________________________________________________________
AliMpGraphContext::AliMpGraphContext(const AliMpGraphContext& right)
- : TObject(right)
+ : TObject(right),
+ fColor(right.fColor),
+ fPadPosition(right.fPadPosition),
+ fPadDimensions(right.fPadDimensions),
+ fRealPosition(right.fRealPosition),
+ fRealDimensions(right.fRealDimensions)
{
-// protected copy constructor
-
- Fatal("AliMpGraphContext", "Copy constructor not provided.");
+// Copy constructor
}
//_____________________________________________________________________________
// check assignement to self
if (this == &right) return *this;
- Fatal("operator =", "Assignement operator not provided.");
+ fColor = right.fColor;
+ fPadPosition = right.fPadPosition;
+ fPadDimensions = right.fPadDimensions;
+ fRealPosition = right.fRealPosition;
+ fRealDimensions = right.fRealDimensions;
return *this;
}
// conversion between pad indices, pad location, pad position;
// finding pad neighbour.
//
-// Included in AliRoot: 2003/05/02
// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
#include <Riostream.h>
ClassImp(AliMpSectorSegmentation)
#ifdef WITH_ROOT
-const Double_t AliMpSectorSegmentation::fgkSeparator = 10000.;
+const Double_t AliMpSectorSegmentation::fgkS1 = 10000.;
+const Double_t AliMpSectorSegmentation::fgkS2 = 100.;
#endif
//______________________________________________________________________________
//______________________________________________________________________________
Long_t AliMpSectorSegmentation::GetIndex(const TVector2& vector2) const
{
-// Converts the twovector to long.
+// Converts the two vector to long.
// ---
- if (vector2.X() >= fgkSeparator || vector2.Y() >= fgkSeparator)
- Fatal("GetIndex", "Index out of limit.");
-
- return Long_t(vector2.X()*fgkSeparator + vector2.Y() + 1.);
+ return Long_t(TMath::Floor((vector2.X()*fgkS1 + vector2.Y())*fgkS2));
}
//______________________________________________________________________________
// Converts the long index to twovector.
// ---
- return TVector2(TMath::Floor((index-1.)/fgkSeparator),
- (index-1.) - TMath::Floor((index-1.)/fgkSeparator)*fgkSeparator);
+ return TVector2( TMath::Floor(index/fgkS1)/fgkS2,
+ (index - TMath::Floor(index/fgkS1)*fgkS1)/fgkS2 );
}
#endif
fPadDimensionsMap[zoneID*10] = zone->GetPadDimensions();
#endif
#ifdef WITH_ROOT
- fPadDimensionsMap.Add((Long_t)(zoneID*10),
+ fPadDimensionsMap.Add((Long_t)(zoneID*10),
GetIndex(zone->GetPadDimensions()));
#endif
}
TVector2 dimensions = GetVector(value);
if (AliMpConstants::IsEqual(dimensions, pad.Dimensions()))
return (Int_t)key;
- }
- return 0;
-
+ }
#endif
// Should never happen
- Fatal("Zone(AliMpPad)", "not found");
+ Error("Zone(AliMpPad)", "not found");
+ cerr << pad << endl;
return 0;
}
return true;
}
+
+//______________________________________________________________________________
+void AliMpSectorSegmentation::PrintZones() const
+{
+// Prints all zones and pads dimensions from the map.
+// ---
+
+ cout << "Zones: " << endl;
+
+#ifdef WITH_STL
+ PadDimensionsMapCIterator it;
+ for (it = fPadDimensionsMap.begin(); it != fPadDimensionsMap.end(); ++it) {
+ cout << " zone: " << setw(4) << it->first;
+ cout << " pad dimensions: ( "
+ << it->second.X() << ", " << it->second.Y() << ")" << endl;
+ }
+#endif
+
+#ifdef WITH_ROOT
+ PadDimensionsMapCIterator it(&fPadDimensionsMap);
+ Long_t key, value;
+ while ( it.Next(key, value) ) {
+ //cout << "Iterating over: " << key << ", " << value << endl;
+ TVector2 dimensions = GetVector(value);
+
+ cout << " zone: " << setw(4) << key;
+ cout << " pad dimensions: ( "
+ << dimensions.X() << ", " << dimensions.Y() << ")" << endl;
+ }
+#endif
+}
+