]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpSectorSegmentation.cxx
- Adding new CreateIterator() and GetNeighbours() methods (Laurent)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSectorSegmentation.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 // $Id$
17 // $MpId: AliMpSectorSegmentation.cxx,v 1.15 2006/05/24 13:58:46 ivana Exp $
18 // Category: sector
19 //
20 // Class AliMpSectorSegmentation
21 // -----------------------------
22 // Class describing the segmentation of the sector.        
23 // Provides methods related to pads:
24 // conversion between pad indices, pad location, pad position;
25 // finding pad neighbour.
26 //
27 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
28
29 #include "AliMpSectorSegmentation.h"
30 #include "AliMpSector.h"
31 #include "AliMpZone.h"
32 #include "AliMpSubZone.h"
33 #include "AliMpRow.h"
34 #include "AliMpVRowSegment.h"
35 #include "AliMpMotifMap.h"
36 #include "AliMpVMotif.h"
37 #include "AliMpMotifPosition.h"
38 #include "AliMpConnection.h"
39 #include "AliMpNeighboursPadIterator.h"
40 #include "AliMpSectorAreaHPadIterator.h"
41 #include "AliMpSectorAreaVPadIterator.h"
42 #include "AliMpIntPair.h"
43 #include "AliMpArea.h"
44 #include "AliMpConstants.h"
45
46 #include "AliLog.h"
47
48 #include <Riostream.h>
49 #include <TMath.h>
50
51 /// \cond CLASSIMP
52 ClassImp(AliMpSectorSegmentation)
53 /// \endcond
54
55 #ifdef WITH_ROOT
56 const Double_t AliMpSectorSegmentation::fgkS1 = 100000.;
57 const Double_t AliMpSectorSegmentation::fgkS2 = 1000.;
58 #endif
59
60 //______________________________________________________________________________
61 AliMpSectorSegmentation::AliMpSectorSegmentation(
62                             const AliMpSector* sector, Bool_t own) 
63   : AliMpVSegmentation(),
64     fkSector(sector),
65     fIsOwner(own),
66     fPadBuffer(0),
67     fPadDimensionsMap(),
68     fMaxIndexInX(0),
69     fMaxIndexInY(0)
70 {
71 /// Standard constructor
72
73   AliDebugStream(1) << "this = " << this << endl;
74
75   fPadBuffer = new AliMpPad(AliMpPad::Invalid());
76   
77   FillPadDimensionsMap();
78 }
79
80 //______________________________________________________________________________
81 AliMpSectorSegmentation::AliMpSectorSegmentation() 
82   : AliMpVSegmentation(),
83     fkSector(0),
84     fIsOwner(false),
85     fPadBuffer(0),
86     fPadDimensionsMap(),      
87     fMaxIndexInX(0),
88     fMaxIndexInY(0)
89 {
90 /// Default constructor
91
92   AliDebugStream(1) << "this = " << this << endl;
93 }
94
95 //______________________________________________________________________________
96 AliMpSectorSegmentation::~AliMpSectorSegmentation() 
97 {
98 /// Destructor 
99
100   AliDebugStream(1) << "this = " << this << endl;
101
102   if ( fIsOwner ) delete fkSector;
103
104   delete fPadBuffer;
105   
106 }
107
108 //
109 // private methods
110 //
111
112 //_____________________________________________________________________________
113 void 
114 AliMpSectorSegmentation::GetAllElectronicCardIDs(TArrayI& ecn) const
115 {
116   GetSector()->GetAllMotifPositionsIDs(ecn);
117 }
118
119 #ifdef WITH_ROOT
120 //______________________________________________________________________________
121 Long_t AliMpSectorSegmentation::GetIndex(const TVector2& vector2) const
122 {
123 /// Convert the two vector to long.
124
125   return Long_t(TMath::Floor((vector2.X()*fgkS1 + vector2.Y())*fgkS2));
126 }  
127
128 //______________________________________________________________________________
129 TVector2  AliMpSectorSegmentation::GetVector(Long_t index) const
130 {
131 /// Convert the long index to twovector.
132
133   return TVector2( TMath::Floor(index/fgkS1)/fgkS2,
134                    (index - TMath::Floor(index/fgkS1)*fgkS1)/fgkS2 );
135 }  
136 #endif
137
138 //______________________________________________________________________________
139 void AliMpSectorSegmentation::FillPadDimensionsMap()
140 {
141 /// Fill the maps between zone ids and pad dimensions.
142
143   for (Int_t i=0; i<fkSector->GetNofZones(); i++) {
144     AliMpZone* zone   = fkSector->GetZone(i+1);
145     Int_t  zoneID = zone->GetID();
146     
147     if (!AliMpConstants::IsEqual(zone->GetPadDimensions(), TVector2())) {
148
149       // regular zone
150 #ifdef WITH_STL
151       fPadDimensionsMap[zoneID*10] = zone->GetPadDimensions();
152 #endif
153 #ifdef WITH_ROOT
154      AliDebugStream(3)
155        << "Filling fPadDimensions[" << zoneID*10 << "] = ("
156        << zone->GetPadDimensions().X() << ", "
157        << zone->GetPadDimensions().Y() << ")" << endl;
158
159      fPadDimensionsMap.Add((Long_t)(zoneID*10), 
160                             GetIndex(zone->GetPadDimensions()));
161 #endif
162     }
163     else {
164       // special zone
165       Int_t subIndex = 0;
166       for (Int_t j=0; j<zone->GetNofSubZones(); j++) {
167         AliMpSubZone* subZone = zone->GetSubZone(j);
168         AliMpVMotif*  motif = subZone->GetMotif();
169         
170         for (Int_t k=0; k<motif->GetNofPadDimensions(); k++) {
171           Int_t index = zoneID*10 +  subIndex++;
172 #ifdef WITH_STL
173           fPadDimensionsMap[index] = motif->GetPadDimensions(k);
174 #endif
175 #ifdef WITH_ROOT
176           AliDebugStream(3)
177             << "Filling fPadDimensions[" << index << "] = ("
178             << motif->GetPadDimensions(k).X() << ", "
179             << motif->GetPadDimensions(k).Y() << ") motif "
180             << motif->GetID().Data() << "-" << k << endl;
181
182           fPadDimensionsMap.Add((Long_t)(index), 
183                             GetIndex(motif->GetPadDimensions(k)));
184 #endif
185         }
186       }   
187     }     
188   }      
189 }
190
191 //______________________________________________________________________________
192 AliMpMotifPosition* 
193 AliMpSectorSegmentation::FindMotifPosition(const AliMpIntPair& indices) const
194 {
195 /// Find the motif position which contains the given pad indices
196 /// return 0 if not found
197
198   switch (fkSector->GetDirection()) {
199     case AliMp::kX : {
200     // Case where all the pads have the same size along X direction
201
202       for (Int_t irow=0; irow<fkSector->GetNofRows(); ++irow) {
203         AliMpRow* row = fkSector->GetRow(irow);
204         if (row->GetLowIndicesLimit().GetFirst()<=indices.GetFirst() &&
205             row->GetHighIndicesLimit().GetFirst()>=indices.GetFirst()) {
206             
207            for (Int_t iseg=0;iseg<row->GetNofRowSegments();++iseg){
208             AliMpVRowSegment* seg = row->GetRowSegment(iseg);
209             if (seg->GetLowIndicesLimit().GetFirst()<=indices.GetFirst() &&
210                 seg->GetHighIndicesLimit().GetFirst()>=indices.GetFirst()) {
211
212               AliMpMotifPosition* motifPos;
213               for (Int_t imot=0;imot<seg->GetNofMotifs();++imot) {
214                 motifPos 
215                   = fkSector->GetMotifMap()
216                     ->FindMotifPosition(seg->GetMotifPositionId(imot));
217                 if (motifPos && motifPos->HasPad(indices)) return motifPos;
218               }
219             }
220           }
221         }
222       }
223       return 0;
224     }
225     break;
226     ////////////////////////////////////////////////////////////////////////////////
227     case AliMp::kY : {
228       // Case where all the pads have the same size along Y direction   
229       // look for the row which contains the indices
230       AliMpRow* row=0;
231       Int_t irow;
232       for (irow=0; irow<fkSector->GetNofRows(); ++irow) {
233         row = fkSector->GetRow(irow);
234         AliMpVRowSegment* lastSeg = row->GetRowSegment(row->GetNofRowSegments()-1);
235         if (lastSeg->GetLowIndicesLimit().GetSecond()<=indices.GetSecond() &&
236             lastSeg->GetHighIndicesLimit().GetSecond()>=indices.GetSecond()) break;
237         // NOTE : We use the last row segment in order to ensure that
238         // we are not on a special motif
239       }
240       if (irow==fkSector->GetNofRows()) return 0;
241       // look for the row segment, in the found row, which contains the indices
242       AliMpVRowSegment* seg=0;
243       Int_t iseg;
244       for (iseg=0;iseg<row->GetNofRowSegments();++iseg){
245         seg = row->GetRowSegment(iseg);
246         if (seg->HasIndices(indices)) break;
247       }
248       if (iseg==row->GetNofRowSegments()) return 0;
249   
250       // look for the motif position which contains the indices
251       AliMpMotifPosition* motifPos=0;
252       Int_t imot=0;
253       for (imot=0;imot<seg->GetNofMotifs();++imot) {
254         motifPos 
255           = fkSector->GetMotifMap()
256             ->FindMotifPosition(seg->GetMotifPositionId(imot));
257         if (motifPos && motifPos->HasPad(indices)) break;
258       }      
259       if (imot==seg->GetNofMotifs()) return 0;
260    
261       return motifPos;      
262     }
263     default: return 0;
264   }
265 }
266
267 //______________________________________________________________________________
268 AliMpPad 
269 AliMpSectorSegmentation::PadByXDirection(const TVector2& startPosition, 
270                                          Double_t maxX) const
271 {
272 /// Find the first valid pad from starting position in the
273 /// direction of pad lines up to distance dx.
274
275   // Define step limits
276   Double_t  stepX = fkSector->GetMinPadDimensions().X();
277  
278   // Search in X direction
279   AliMpPad pad;
280   TVector2 position(startPosition);    
281   do {
282     pad = PadByPosition(position, false);
283     position += TVector2(stepX, 0.);
284   }   
285   while ( !pad.IsValid() && 
286           position.X() - fkSector->GetMaxPadDimensions().X() < maxX ); 
287   
288   // Invalidate pad if it is outside limits
289   if ( (pad.Position().X() - pad.Dimensions().X()) > maxX ) 
290     pad = AliMpPad::Invalid();
291
292   return pad;
293 }
294
295 //______________________________________________________________________________
296 AliMpPad 
297 AliMpSectorSegmentation::PadByYDirection(const TVector2& startPosition, 
298                                          Double_t maxY) const
299 {
300 /// Find the first valid pad from starting position in the
301 /// direction of pad columns up to distance dx.
302   
303   // Define step limits
304   Double_t stepY = fkSector->GetMinPadDimensions().Y();
305  
306   // Search in Y direction
307   AliMpPad pad;
308   TVector2 position(startPosition);    
309   do {
310     pad = PadByPosition(position, false);
311     position += TVector2(0., stepY);
312   }   
313   while ( !pad.IsValid() && 
314           position.Y() - fkSector->GetMaxPadDimensions().Y()< maxY ); 
315   
316   // Invalidate pad if it is outside limits
317   if ((pad.Position().Y() - pad.Dimensions().Y()) > maxY) 
318     pad = AliMpPad::Invalid();
319
320   return pad;
321 }
322
323 //
324 // public methods
325 //
326
327 //______________________________________________________________________________
328 AliMpVPadIterator* 
329 AliMpSectorSegmentation::CreateIterator() const
330 {
331   /// Currently uses default implementation
332   return AliMpVSegmentation::CreateIterator();
333 }
334
335 //______________________________________________________________________________
336 AliMpVPadIterator* 
337 AliMpSectorSegmentation::CreateIterator(const AliMpArea& area) const
338 {
339 /// Create the area iterator. 
340
341   switch (fkSector->GetDirection()) {
342   
343     case AliMp::kX: return new AliMpSectorAreaVPadIterator(this, area);
344              ;;
345     case AliMp::kY: return new AliMpSectorAreaHPadIterator(this, area);
346              ;;
347   }
348   
349   Fatal("CreateIterator", "Incomplete switch on Sector direction");
350   return 0;  
351 }   
352   
353 //______________________________________________________________________________
354 Int_t 
355 AliMpSectorSegmentation::GetNeighbours(const AliMpPad& pad, TObjArray& neighbours,
356                                        Bool_t includeSelf,
357                                        Bool_t includeVoid) const
358 {
359   /// Uses default implementation
360   return AliMpVSegmentation::GetNeighbours(pad,neighbours,includeSelf,includeVoid);
361 }
362
363 //______________________________________________________________________________
364 AliMpVPadIterator* 
365 AliMpSectorSegmentation::CreateIterator(const AliMpPad& centerPad,
366                                         Bool_t includeCenter) const
367 {
368   /// Create the neighbours pad iterator.
369
370   return new AliMpNeighboursPadIterator(this, centerPad, includeCenter);
371 }   
372   
373 //______________________________________________________________________________
374 TVector2
375 AliMpSectorSegmentation::Dimensions() const
376 {
377   return GetSector()->Dimensions();
378 }
379
380 //______________________________________________________________________________
381 AliMp::PlaneType
382 AliMpSectorSegmentation::PlaneType() const
383 {
384   return GetSector()->GetPlaneType();
385 }
386
387 //______________________________________________________________________________
388 AliMpPad 
389 AliMpSectorSegmentation::PadByLocation(const AliMpIntPair& location, 
390                                        Bool_t warning) const
391 {
392 /// Find the pad which corresponds to the given location
393   
394   if ((*fPadBuffer).GetLocation()==location) return (*fPadBuffer);
395   
396   AliMpMotifPosition* motifPos = 
397     fkSector->GetMotifMap()->FindMotifPosition(location.GetFirst());
398   if (!motifPos){
399     if (warning) Warning("PadByLocation","The pad motif position ID doesn't exists");
400     return AliMpPad::Invalid();
401   }
402   
403   AliMpVMotif* motif = motifPos->GetMotif();
404   AliMpIntPair localIndices = 
405     motif->GetMotifType()->FindLocalIndicesByGassiNum(location.GetSecond());
406   if (! localIndices.IsValid()) {
407     if (warning) Warning("PadByLocation","The pad number doesn't exists");
408     return AliMpPad::Invalid();
409   }
410   TVector2 delta = motif->PadPositionLocal(localIndices);
411   return (*fPadBuffer) = AliMpPad(location,
412               motifPos->GlobalIndices(localIndices),
413               motifPos->Position()+delta,
414               motif->GetPadDimensions(localIndices));
415
416 }
417 //______________________________________________________________________________
418 AliMpPad 
419 AliMpSectorSegmentation::PadByIndices(const AliMpIntPair& indices,
420                                       Bool_t warning ) const
421 {
422 /// Find the pad which corresponds to the given indices  
423
424   if ((*fPadBuffer).GetIndices()==indices) return (*fPadBuffer);    
425    
426   AliMpMotifPosition* motifPos = FindMotifPosition(indices);
427   if (!motifPos) {    
428     if (warning) 
429       Warning("PadByIndices","Pad indices not contained in any motif!");
430     return AliMpPad::Invalid();
431   }
432   
433   // retrieve the local indices in the found motif
434   AliMpVMotif* motif = motifPos->GetMotif();
435   AliMpIntPair localIndices = indices - motifPos->GetLowIndicesLimit();
436   
437   AliMpConnection* connection=
438     motif->GetMotifType()->FindConnectionByLocalIndices(localIndices);
439     
440   if (!connection){
441     if (warning) Warning("PadByIndices","No connection with the given indices!");
442     return AliMpPad::Invalid();
443   }
444
445   TVector2 localPos = motif->PadPositionLocal(localIndices);
446
447   return (*fPadBuffer) 
448     = AliMpPad(AliMpIntPair(motifPos->GetID(),connection->GetGassiNum()),
449                indices,
450                motifPos->Position()+localPos,
451                motif->GetPadDimensions(localIndices)); 
452
453 }
454 //______________________________________________________________________________
455 AliMpPad 
456 AliMpSectorSegmentation::PadByPosition(const TVector2& position,
457                                        Bool_t warning) const
458 {
459 /// Find the pad which corresponds to the given position
460
461   if ((*fPadBuffer).Position().X()==position.X() && 
462       (*fPadBuffer).Position().Y()==position.Y()) return (*fPadBuffer);  
463
464   Int_t motifPosID = fkSector->FindMotifPositionId(position);
465   AliMpMotifPosition* motifPos 
466     = fkSector->GetMotifMap()
467         ->FindMotifPosition(motifPosID);
468     
469   if (!motifPos){
470     if (warning) Warning("PadByPosition","Position outside limits");
471     return AliMpPad::Invalid();
472   }
473
474   AliMpVMotif* motif =  motifPos->GetMotif();  
475   AliMpIntPair localIndices 
476     = motif->PadIndicesLocal(position-motifPos->Position());
477     
478   AliMpConnection* connect = 
479     motif->GetMotifType()->FindConnectionByLocalIndices(localIndices);
480
481    if (!connect){
482     if (warning) Warning("PadByPosition","Position outside motif limits");
483     return AliMpPad::Invalid();
484   }
485   
486   return (*fPadBuffer)
487     = AliMpPad(AliMpIntPair(motifPosID,connect->GetGassiNum()),
488                motifPos->GlobalIndices(localIndices),
489                motifPos->Position()+motif->PadPositionLocal(localIndices),
490                motif->GetPadDimensions(localIndices));
491
492 }
493
494 //______________________________________________________________________________
495 AliMpPad 
496 AliMpSectorSegmentation::PadByDirection(const TVector2& startPosition, 
497                                         Double_t distance) const
498 {
499 /// Find the first valid pad from starting position in the
500 /// direction of pad lines/columns up to the specified distance.
501 /// Pad lines are the lines of pads in the sector with constant pad y size,
502 /// pad columns are the columns of pads in the sector with constant pad x size. 
503
504   switch (fkSector->GetDirection()) {
505   
506     case AliMp::kX: return PadByYDirection(startPosition, distance);
507              ;;
508     case AliMp::kY: return PadByXDirection(startPosition, distance);
509              ;;
510   }
511   
512   Fatal("PadByDirection", "Incomplete switch on Sector direction");
513   return AliMpPad::Invalid();  
514 }
515
516 //______________________________________________________________________________
517 Int_t  AliMpSectorSegmentation::MaxPadIndexX() const
518 {
519 /// Return maximum pad index in x
520
521   return fkSector->GetMaxPadIndices().GetFirst();
522 }
523
524 //______________________________________________________________________________
525 Int_t  AliMpSectorSegmentation::MaxPadIndexY() const
526 {
527 /// Return maximum pad index in y
528
529   return fkSector->GetMaxPadIndices().GetSecond();
530 }
531
532 //______________________________________________________________________________
533 Int_t  AliMpSectorSegmentation::NofPads() const
534 {
535 /// Return number of pads defined in the sector
536
537   return fkSector->GetNofPads();
538 }
539
540 //______________________________________________________________________________
541 Bool_t AliMpSectorSegmentation::HasPad(const AliMpIntPair& indices) const
542 {
543 /// Does the pad specified by \a indices exist ?
544
545   return PadByIndices(indices,kFALSE) != AliMpPad::Invalid();
546 }
547
548 //______________________________________________________________________________
549 Bool_t AliMpSectorSegmentation::HasMotifPosition(Int_t motifPositionID) const
550 {
551 /// Does the motif position specified by motifPositionID exist ?
552
553   return (fkSector->GetMotifMap()->FindMotifPosition(motifPositionID) != 0);
554 }
555
556 //______________________________________________________________________________
557 TVector2  AliMpSectorSegmentation::GetMinPadDimensions() const
558 {
559 /// Returne the dimensions of the smallest pad.
560
561   return fkSector->GetMinPadDimensions();
562 }  
563
564 //______________________________________________________________________________
565 Int_t AliMpSectorSegmentation::Zone(const AliMpPad& pad, Bool_t warning) const
566 {
567 /// Return the zone index of the zone containing the specified pad.
568 /// This zone index is different from the zone ID,
569 /// as it is unique for each pad dimensions.
570 /// It is composed in this way:
571 ///   zoneID*10 + specific index 
572 /// Specific index is present only for zones containing special motifs.
573
574   if (!pad.IsValid()) {
575     if (warning) Warning("Zone(AliMpPad)", "Invalid pad");
576     return 0;
577   }  
578
579 #ifdef WITH_STL
580   PadDimensionsMapCIterator it;
581   for (it = fPadDimensionsMap.begin(); it != fPadDimensionsMap.end(); ++it) {
582     if (AliMpConstants::IsEqual(it->second, pad.Dimensions()))
583       return it->first;
584   }
585 #endif
586
587 #ifdef WITH_ROOT
588   PadDimensionsMapCIterator it(&fPadDimensionsMap);
589   Long_t key, value;
590   while ( it.Next(key, value) ) {
591     TVector2 dimensions =  GetVector(value);
592     if (AliMpConstants::IsEqual(dimensions, pad.Dimensions()))
593       return (Int_t)key;
594   } 
595   
596   AliError(Form("fPadDimensionsMap size is %d",fPadDimensionsMap.GetSize()));
597   
598 #endif
599
600   // Should never happen
601   AliErrorStream() 
602     << "Zone(AliMpPad pad) not found, where pad is: " << pad << endl;
603   return 0;
604 }  
605
606 //______________________________________________________________________________
607 TVector2 
608 AliMpSectorSegmentation::PadDimensions(Int_t zone, Bool_t warning) const
609 {
610 /// Return the pad dimensions for the zone with the specified zone index.
611
612 #ifdef WITH_STL
613   PadDimensionsMapCIterator it = fPadDimensionsMap.find(zone);
614   if (it != fPadDimensionsMap.end()) return it->second;
615 #endif
616
617 #ifdef WITH_ROOT
618   Long_t value = fPadDimensionsMap.GetValue(zone);
619   if (value) return GetVector(value);
620 #endif
621
622   if (warning) Warning("PadDimensions(zone)", "not found");
623   return TVector2();
624 }  
625
626 //______________________________________________________________________________
627 Bool_t AliMpSectorSegmentation::CircleTest(const AliMpIntPair& indices) const
628 {
629 /// Verify that all methods for retrieving pads are consistents between them.
630 /// Return true if the pad with specified indices was found and verified,
631 /// false otherwise.
632
633   if (!HasPad(indices)) return false;
634
635   // Verify the indice->location->position->indice way
636   AliMpIntPair location = PadByIndices(indices).GetLocation();
637   TVector2 position = PadByLocation(location).Position();
638   AliMpIntPair retIndices = PadByPosition(position).GetIndices();
639     
640   if (retIndices != indices) {
641     cout << "Pad " << indices << " lead to inconsistency" << endl;
642     cout << "in indice->location->position->indice way..." << endl;
643     cout << "starting from " << indices << "-->" << location << "-->" 
644          << '(' << position.X() << ',' << position.Y() << ')'
645          << " and retIndices: " << retIndices << endl;
646   }
647     
648     
649   // Verify the indice->position->location->indice way    
650   position = PadByIndices(indices).Position();
651   location = PadByPosition(position).GetLocation();
652   retIndices = PadByLocation(location).GetIndices();
653
654   if (retIndices != indices) {
655     cout << "Pad " << indices << " lead to inconsistency" << endl;
656     cout << "in indice->position->location->indice way..." <<endl;
657     cout << "starting from " << indices 
658          << " and retIndices: " << retIndices << endl;
659   }
660   
661   return true;
662 }
663
664 //______________________________________________________________________________
665 void
666 AliMpSectorSegmentation::Print(Option_t* opt) const
667 {
668   fkSector->Print(opt);
669 }
670
671 //______________________________________________________________________________
672 void AliMpSectorSegmentation::PrintZones() const
673 {
674 /// Print all zones and pads dimensions from the map.
675
676   cout << "Zones: " << endl;
677
678 #ifdef WITH_STL
679   PadDimensionsMapCIterator it;
680   for (it = fPadDimensionsMap.begin(); it != fPadDimensionsMap.end(); ++it) {
681     cout << "    zone: " <<   setw(4) << it->first;
682     cout << "    pad dimensions: ( " 
683          << it->second.X() << ", " << it->second.Y() << ")" << endl; 
684   }
685 #endif
686
687 #ifdef WITH_ROOT
688   PadDimensionsMapCIterator it(&fPadDimensionsMap);
689   Long_t key, value;
690   while ( it.Next(key, value) ) {
691     //cout << "Iterating over: " << key << ", " << value << endl;
692     TVector2 dimensions =  GetVector(value);
693
694     cout << "    zone: " <<   setw(4) << key;
695     cout << "    pad dimensions: ( " 
696          << dimensions.X() << ", " << dimensions.Y() << ")" << endl; 
697   }
698 #endif
699 }
700