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