]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpMotifMap.cxx
Removing debug printing
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpMotifMap.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: AliMpMotifMap.cxx,v 1.13 2006/03/15 10:04:36 ivana Exp $
18 // Category: motif
19 // -------------------
20 // Class AliMpMotifMap
21 // -------------------
22 // Class describing the motif map container, where motifs are
23 // mapped to their string IDs.
24 // Included in AliRoot: 2003/05/02
25 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
26
27 #include <Riostream.h>
28 #include <TVector2.h>
29
30 #include "AliMpMotifMap.h"
31 #include "AliMpVMotif.h"
32 #include "AliMpMotif.h"
33 #include "AliMpMotifSpecial.h"
34 #include "AliMpMotifType.h"
35 #include "AliMpMotifPosition.h"
36 #include "TArrayI.h"
37
38 ClassImp(AliMpMotifMap)
39
40 //_____________________________________________________________________________
41 AliMpMotifMap::AliMpMotifMap(Bool_t /*standardConstructor*/) 
42   : TObject()
43 #ifdef WITH_ROOT
44     ,fMotifs(true),
45      fMotifTypes(true),
46      fMotifPositions(true),
47      fMotifPositions2(true)
48 #endif 
49 {
50 /// Standard constructor
51   
52   //fMotifPositions2.SetOwner(false);
53 }
54
55 //_____________________________________________________________________________
56 AliMpMotifMap::AliMpMotifMap() 
57   : TObject(),
58     fMotifs(),
59     fMotifTypes(),
60     fMotifPositions(),
61     fMotifPositions2()
62 {
63 /// Default constructor
64 }
65
66 //_____________________________________________________________________________
67 AliMpMotifMap::~AliMpMotifMap() 
68 {
69 /// Destructor  
70
71   // Delete all registered motifs, motif types, motif positions
72   
73 #ifdef WITH_STL
74   for (MotifMapIterator im=fMotifs.begin(); im != fMotifs.end(); im++) {
75     delete im->second;
76   }  
77
78   for (MotifTypeMapIterator it=fMotifTypes.begin(); 
79        it != fMotifTypes.end(); it++) {
80     delete it->second;
81   }
82
83   for (MotifPositionMapIterator ip=fMotifPositions.begin(); 
84        ip != fMotifPositions.end(); ip++) {
85     delete ip->second;
86   }  
87 #endif  
88 }
89
90 // 
91 // private methods
92 //
93
94 //_____________________________________________________________________________
95 void  AliMpMotifMap::PrintMotif(const AliMpVMotif* motif) const
96 {
97 /// Print the motif.
98 // ---
99
100   cout << motif->GetID().Data() << "  "
101        << motif->GetMotifType()->GetID() << "    "
102        << motif->Dimensions().X() << " "
103        << motif->Dimensions().Y();
104 }
105
106 //_____________________________________________________________________________
107 void  AliMpMotifMap::PrintMotifType(const AliMpMotifType* motifType) const
108 {
109 /// Print the motif type.
110
111   cout << motifType->GetID().Data() << "  "
112        << motifType->GetNofPadsX() << "  " 
113        << motifType->GetNofPadsY() << "  ";
114 }
115
116 //_____________________________________________________________________________
117 void  AliMpMotifMap::PrintMotifPosition(
118                           const AliMpMotifPosition* motifPosition) const
119 {
120 /// Print the motif position.
121
122   cout << " ID " << motifPosition->GetID() << "  "
123        << " Motif ID " << motifPosition->GetMotif()->GetID() << "  " 
124        << " Pos (X,Y) = (" << motifPosition->Position().X() << ","
125        << motifPosition->Position().Y() << ")";
126 }
127
128 //_____________________________________________________________________________
129 void  AliMpMotifMap::PrintMotifPosition2(
130                           const AliMpMotifPosition* motifPosition) const
131 {
132 /// Print the motif position.
133
134   cout << setw(3) << motifPosition->GetLowIndicesLimit().GetFirst() << "  "
135        << setw(3) << motifPosition->GetLowIndicesLimit().GetSecond() << "  "
136        << setw(3) << motifPosition->GetHighIndicesLimit().GetFirst()  << " " 
137        << setw(3) << motifPosition->GetHighIndicesLimit().GetSecond()  << " "
138        << motifPosition->GetID() << "  ";
139 }
140
141 //_____________________________________________________________________________
142 void  AliMpMotifMap::PrintMotifs() const
143 {
144 /// Print all the motifs and their motif types 
145 /// for all motifs in the motifs map.
146
147 #ifdef WITH_STL
148   if (fMotifs.size()) {
149     cout << "Dump of Motif Map - " << fMotifs.size() << " entries:" << endl;
150     Int_t counter = 0;        
151     for (MotifMapIterator i=fMotifs.begin(); i != fMotifs.end(); i++) {
152       const TString& id  = (*i).first;
153       cout << "Map element " 
154            << setw(3) << counter++ << "   " 
155            << id.Data() << "   " ;
156       PrintMotif((*i).second);     
157       cout << endl;
158     }
159     cout << endl;
160   }
161 #endif
162
163 #ifdef WITH_ROOT
164   if (fMotifs.GetSize()) {
165     cout << "Dump of Motif Map - " << fMotifs.GetSize() << " entries:" << endl;
166     Int_t counter = 0;        
167     TExMapIter i = fMotifs.GetIterator();
168     Long_t key, value;
169     while ( i.Next(key, value) ) {
170       TString id  = fMotifs.AliMpExMap::GetString(key);
171       AliMpVMotif* motif = (AliMpVMotif*)value;
172       cout << "Map element " 
173            << setw(3) << counter++ << "   " 
174            << id.Data() << "   " ;
175       PrintMotif(motif);           
176       cout << endl;
177     }
178     cout << endl;
179   }
180 #endif  
181 }
182
183 //_____________________________________________________________________________
184 void  AliMpMotifMap::PrintMotifTypes() const
185 {
186 /// Print all the the motifs types and their motif dimensions
187 /// for all motif types in the motif types map.
188
189 #ifdef WITH_STL
190   if (fMotifTypes.size()) {
191     cout << "Dump of Motif Type Map - " << fMotifTypes.size() << " entries:" << endl;
192     Int_t counter = 0;        
193     for (MotifTypeMapIterator i=fMotifTypes.begin(); i != fMotifTypes.end(); i++) {
194       const TString& id  = (*i).first;
195       cout << "Map element " 
196            << setw(3) << counter++ << "   " 
197            << id.Data() << "   ";
198       PrintMotifType((*i).second);         
199       cout << endl;
200     }
201     cout << endl;
202   }
203 #endif  
204
205 #ifdef WITH_ROOT
206   if (fMotifTypes.GetSize()) {
207     cout << "Dump of Motif Type Map - " << fMotifTypes.GetSize() << " entries:" << endl;
208     Int_t counter = 0;        
209     TExMapIter i = fMotifTypes.GetIterator();
210     Long_t key, value;
211     while ( i.Next(key, value) ) {
212       TString id  = AliMpExMap::GetString(key);
213       AliMpMotifType* motifType = (AliMpMotifType*)value;
214       cout << "Map element " 
215            << setw(3) << counter++ << "   " 
216            << id.Data() << "   " ;
217       PrintMotifType(motifType);           
218       cout << endl;
219     }
220     cout << endl;
221   }
222 #endif  
223 }
224
225 //_____________________________________________________________________________
226 void 
227 AliMpMotifMap::GetAllMotifPositionsIDs(TArrayI& ecn) const
228 {
229 /// Fill the given array with all motif positions IDs (electronic card numbers)
230 /// defined in the map
231
232 #ifdef WITH_STL
233   ecn.Set(fMotifPositions.size());  
234   Int_t i(0);
235   MotifPositionMapIterator it;
236   for (it=fMotifPositions.begin(); it != fMotifPositions.end(); it++) {
237     AliMpMotifPosition* motifPosition = (*it).second;
238     ecn[i++] = motifPosition->GetID();
239   }
240 #endif
241   
242 #ifdef WITH_ROOT  
243   ecn.Set(fMotifPositions.GetSize());
244   TExMapIter it = fMotifPositions.GetIterator();
245   Long_t key, value;
246   Int_t i(0);
247   
248   while ( it.Next(key, value) ) 
249   {
250     AliMpMotifPosition* motifPosition = reinterpret_cast<AliMpMotifPosition*>(value);
251     ecn[i] = motifPosition->GetID();
252     ++i;
253   }
254   
255 #endif  
256 }
257
258 //_____________________________________________________________________________
259 Int_t AliMpMotifMap::CalculateNofPads() const 
260 {
261   Int_t nofPads = 0;
262
263 #ifdef WITH_STL
264   MotifPositionMapIterator it;
265   for (it=fMotifPositions.begin(); it != fMotifPositions.end(); it++) {
266     AliMpMotifPosition* motifPosition = (*it).second;
267     nofPads += motifPosition->GetMotif()->GetMotifType()->GetNofPads();
268   }
269 #endif
270   
271 #ifdef WITH_ROOT  
272   TExMapIter it = fMotifPositions.GetIterator();
273   Long_t key, value;
274   
275   while ( it.Next(key, value) ) {
276     AliMpMotifPosition* motifPosition = reinterpret_cast<AliMpMotifPosition*>(value);
277     nofPads += motifPosition->GetMotif()->GetMotifType()->GetNofPads();
278   }
279 #endif  
280
281   return nofPads;
282 }
283
284 //_____________________________________________________________________________
285 void  AliMpMotifMap::PrintMotifPositions() const
286 {
287 /// Print all the the motifs positions.
288
289 #ifdef WITH_STL
290   if (fMotifPositions.size()) {
291     cout << "Dump of Motif Position Map - " << fMotifPositions.size() << " entries:" << endl;
292     Int_t counter = 0;        
293     for (MotifPositionMapIterator i=fMotifPositions.begin(); 
294                                   i != fMotifPositions.end(); i++) {
295
296       cout << "Map element " 
297            << setw(3) << counter++ << "   "; 
298       PrintMotifPosition((*i).second);     
299       cout << endl;
300     }
301     cout << endl;
302   }
303 #endif  
304
305 #ifdef WITH_ROOT
306   if (fMotifPositions.GetSize()) {
307     cout << "Dump of Motif Position Map - " << fMotifPositions.GetSize() << " entries:" << endl;
308     Int_t counter = 0;        
309     TExMapIter i = fMotifPositions.GetIterator();
310     Long_t key, value;
311     while ( i.Next(key, value) ) {
312       AliMpMotifPosition* motifPosition = (AliMpMotifPosition*)value;
313       cout << "Map element " 
314            << setw(3) << counter++ << "   "; 
315       PrintMotifPosition(motifPosition);           
316       cout << endl;
317     }
318     cout << endl;
319   }
320 #endif  
321 }
322
323 //_____________________________________________________________________________
324 void  AliMpMotifMap::PrintMotifPositions2() const
325 {
326 /// Print all the the motifs positions from the second map
327 /// (by global indices)
328
329 #ifdef WITH_STL
330   if (fMotifPositions2.size()) {
331     cout << "Dump of Motif Position Map 2 - " << fMotifPositions2.size() << " entries:" << endl;
332     Int_t counter = 0;        
333     for (MotifPositionMap2Iterator i=fMotifPositions2.begin(); 
334                                    i != fMotifPositions2.end(); i++) {
335
336       cout << "Map element " 
337            << setw(3) << counter++ << "   "; 
338       PrintMotifPosition2((*i).second);  
339       cout << endl;
340     }
341     cout << endl;
342   }
343 #endif  
344
345 #ifdef WITH_ROOT
346   if (fMotifPositions2.GetSize()) {
347     cout << "Dump of Motif Position Map 2 - " << fMotifPositions2.GetSize() << " entries:" << endl;
348     Int_t counter = 0;        
349     TExMapIter i = fMotifPositions2.GetIterator();
350     Long_t key, value;
351     while ( i.Next(key, value) ) {
352       AliMpMotifPosition* motifPosition = (AliMpMotifPosition*)value;
353       cout << "Map element " 
354            << setw(3) << counter++ << "   "; 
355       PrintMotifPosition2(motifPosition);          
356       cout << endl;
357     }
358     cout << endl;
359   }
360 #endif  
361 }
362
363 //
364 // public methods
365 //
366
367 //_____________________________________________________________________________
368 Bool_t AliMpMotifMap::AddMotif(AliMpVMotif* motif, Bool_t warn)
369 {
370 /// Add the specified motif 
371 /// if the motif with this ID is not yet present.
372
373   AliMpVMotif* found = FindMotif(motif->GetID());
374   if (found) {    
375     if (warn && found == motif) 
376       Warning("AddMotif", "The motif is already in map.");
377     if (warn && found != motif) 
378       Warning("AddMotif", "Another motif with the same ID is already in map.");      
379     return false;
380   }  
381
382 #ifdef WITH_STL
383   fMotifs[motif->GetID()] = motif;
384 #endif
385
386 #ifdef WITH_ROOT
387   fMotifs.Add(motif->GetID(), motif);
388 #endif
389
390   return true;
391 }
392
393 //_____________________________________________________________________________
394 Bool_t AliMpMotifMap::AddMotifType(AliMpMotifType* motifType, Bool_t warn)
395 {
396 /// Add the specified motif type
397 /// if the motif with this ID is not yet present.
398
399   AliMpMotifType* found = FindMotifType(motifType->GetID());
400   if (found) {    
401     if (warn && found == motifType) 
402       Warning("AddMotifType", "The motif type is already in map.");
403     if (warn && found != motifType) 
404       Warning("AddMotifType", 
405               "Another motif type with the same ID is already in map.");      
406     return false;
407   }  
408
409 #ifdef WITH_STL
410   fMotifTypes[motifType->GetID()] = motifType;
411 #endif
412
413 #ifdef WITH_ROOT
414   fMotifTypes.Add(motifType->GetID(), motifType);
415 #endif
416
417   return true;
418 }
419
420 //_____________________________________________________________________________
421 Bool_t AliMpMotifMap::AddMotifPosition(AliMpMotifPosition* motifPosition, Bool_t warn)
422 {
423 /// Add the specified motif position
424 /// if this position is not yet present.
425
426   AliMpMotifPosition* found = FindMotifPosition(motifPosition->GetID());
427   if (found) { 
428     if (warn && found == motifPosition) {
429       cerr << "ID: " << motifPosition->GetID() 
430            << "  found: " << found 
431            << "  new:   " << motifPosition << endl;   
432       Warning("AddMotifPosition", "This motif position is already in map.");
433     }  
434     if (warn && found != motifPosition) { 
435       cerr << "ID: " << motifPosition->GetID() 
436            << "  found: " << found 
437            << "  new:   " << motifPosition << endl;   
438       Warning("AddMotifposition", 
439               "Another motif position with the same ID is already in map.");
440     }               
441     return false;
442   }  
443
444 #ifdef WITH_STL
445   fMotifPositions[motifPosition->GetID()] = motifPosition;
446 #endif
447
448 #ifdef WITH_ROOT
449   fMotifPositions.Add(motifPosition->GetID(), motifPosition);
450 #endif
451
452   return true;
453 }
454
455 //_____________________________________________________________________________
456 void AliMpMotifMap::FillMotifPositionMap2()
457 {
458 /// Fill the second map (by global indices) of motif positions.
459
460 #ifdef WITH_STL
461   if (fMotifPositions2.size() > 0 ) {
462     Warning("FillMotifPositionMap2", "Map has been already filled.");
463     return;
464   }  
465
466   for (MotifPositionMapIterator ip=fMotifPositions.begin(); 
467        ip != fMotifPositions.end(); ip++) {
468
469     fMotifPositions2[(*ip).second->GetLowIndicesLimit()] = (*ip).second;
470   }  
471 #endif
472
473 #ifdef WITH_ROOT
474   if (fMotifPositions2.GetSize() > 0 ) {
475     Warning("FillMotifPositionMap2", "Map has been already filled.");
476     return;
477   }  
478
479   TExMapIter i = fMotifPositions.GetIterator();
480   Long_t key, value;
481   while ( i.Next(key, value) ) {
482     AliMpMotifPosition* motifPosition = (AliMpMotifPosition*)value;
483     fMotifPositions2.Add(motifPosition->GetLowIndicesLimit(), motifPosition);
484   }
485 #endif
486
487 }
488
489 //_____________________________________________________________________________
490 void  AliMpMotifMap::Print(const char* opt) const
491 {
492 /// Print the motifs and motif types maps.
493
494   TString sopt(opt);
495   
496   sopt.ToUpper();
497   
498   if ( sopt.Contains("MOTIFS") || sopt == "ALL" ) PrintMotifs();
499   if ( sopt.Contains("MOTIFTYPES") || sopt == "ALL" ) PrintMotifTypes();
500   if ( sopt.Contains("MOTIFPOSITIONS") || sopt == "ALL" ) PrintMotifPositions();
501   if ( sopt.Contains("MOTIFPOSITIONS2") || sopt == "ALL" ) PrintMotifPositions2();
502 }
503
504 //_____________________________________________________________________________
505 void  AliMpMotifMap::PrintGlobalIndices(const char* fileName) const
506 {
507 /// Print all the motifs positions and their global indices.
508
509   ofstream out(fileName, ios::out);
510
511 #ifdef WITH_STL
512   if (fMotifPositions.size()) {
513     for (MotifPositionMapIterator i=fMotifPositions.begin(); 
514                                    i != fMotifPositions.end(); i++) {
515
516       AliMpMotifPosition* motifPosition = (*i).second;
517       out << setw(5) << motifPosition->GetID() << "     "
518           << setw(3) << motifPosition->GetLowIndicesLimit().GetFirst()  << " " 
519           << setw(3) << motifPosition->GetLowIndicesLimit().GetSecond() 
520          << endl;
521     }
522     out << endl;
523   }
524 #endif
525
526 #ifdef WITH_ROOT
527   if (fMotifPositions.GetSize()) {
528     TExMapIter i = fMotifPositions.GetIterator();
529     Long_t key, value;
530     while ( i.Next(key, value) ) {
531       AliMpMotifPosition* motifPosition = (AliMpMotifPosition*)value;
532       out << setw(5) << motifPosition->GetID() << "     "
533           << setw(3) << motifPosition->GetLowIndicesLimit().GetFirst()  << " " 
534           << setw(3) << motifPosition->GetLowIndicesLimit().GetSecond() 
535          << endl;
536     }
537     out << endl;
538   }
539 #endif
540 }
541
542 //_____________________________________________________________________________
543 void  AliMpMotifMap::UpdateGlobalIndices(const char* fileName)
544 {
545 /// Updates the motifs positions global indices
546 /// from the file.
547
548   ifstream in(fileName, ios::in);
549
550   Int_t motifPositionId, offx, offy;
551     
552   do {
553     in >> motifPositionId >> offx >> offy;
554     
555     if (in.eof()) {
556       FillMotifPositionMap2();
557       return;
558     }  
559     
560     AliMpMotifPosition* motifPosition = FindMotifPosition(motifPositionId);
561           
562     if (motifPosition) {
563        cout << "Processing " 
564             << motifPosition->GetID() << " " << offx << " " << offy << endl; 
565
566        motifPosition->SetLowIndicesLimit(AliMpIntPair(offx, offy));
567        
568        Int_t offx2 
569          = offx + motifPosition->GetMotif()->GetMotifType()->GetNofPadsX() - 1;
570          
571        Int_t offy2 
572          = offy + motifPosition->GetMotif()->GetMotifType()->GetNofPadsY() - 1;
573        
574        motifPosition->SetHighIndicesLimit(AliMpIntPair(offx2, offy2));
575     }
576     else {   
577        cerr <<"Motif position " << motifPositionId << endl;
578        Warning("UpdateGlobalIndices", "Motif position not found !!!");
579     }
580   }    
581   while (!in.eof());
582 }
583
584
585 //_____________________________________________________________________________
586 AliMpVMotif* AliMpMotifMap::FindMotif(const TString& motifID) const
587 {
588 /// Finds the motif with the specified ID.
589   
590 #ifdef WITH_STL
591   MotifMapIterator i = fMotifs.find(motifID);
592   if (i != fMotifs.end()) 
593     return (*i).second;
594   else                 
595     return 0;
596 #endif
597
598 #ifdef WITH_ROOT
599   return (AliMpVMotif*)fMotifs.GetValue(motifID);
600 #endif
601 }
602
603 //_____________________________________________________________________________
604 AliMpVMotif* AliMpMotifMap::FindMotif(const TString& motifID, 
605                                       const TString& motifTypeID,
606                                       const TVector2& padDimensions ) const
607 {
608 /// Finds the motif with the specified ID and returns it
609 /// only if its motif type and motif dimensions agree
610 /// with the given motifTypeID and motifDimensions.
611 /// Disagreement causes fatal error.
612  
613   AliMpVMotif* motif = FindMotif(motifID);
614
615   if (motif && motif->GetMotifType()->GetID() != motifTypeID) {
616       Fatal("FindMotif", 
617             "Motif has been already defined with a different type.");
618       return 0;     
619   }
620
621   // check pad dimension in case of a normal motif
622   if (motif && 
623       dynamic_cast<AliMpMotif*>(motif) && 
624       ( motif->GetPadDimensions(0).X() != padDimensions.X() ||
625         motif->GetPadDimensions(0).Y() != padDimensions.Y())) { 
626       
627       Fatal("FindMotifType", 
628             "Motif type has been already defined with different dimensions.");
629       return 0;
630
631   } 
632
633   // check case of a special motif
634   if (motif && 
635       (padDimensions.X() == 0. && padDimensions.Y() == 0.) &&
636       !dynamic_cast<AliMpMotifSpecial*>(motif)) {
637
638       Fatal("FindMotifType", 
639             "Motif type has been already defined with different dimensions.");
640       return 0;
641
642   } 
643   
644   return motif;
645 }
646
647 //_____________________________________________________________________________
648 AliMpMotifType* AliMpMotifMap::FindMotifType(const TString& motifTypeID) const
649 {
650 /// Find the motif type with the specified motif type ID.
651   
652 #ifdef WITH_STL
653   MotifTypeMapIterator i = fMotifTypes.find(motifTypeID);
654   if (i != fMotifTypes.end()) 
655     return (*i).second;
656   else                 
657     return 0;
658 #endif
659
660 #ifdef WITH_ROOT
661   return (AliMpMotifType*)fMotifTypes.GetValue(motifTypeID);
662 #endif
663 }
664
665 //_____________________________________________________________________________
666 AliMpMotifPosition* 
667 AliMpMotifMap::FindMotifPosition(Int_t motifPositionID) const
668 {
669 /// Find the motif position with the specified motif position ID.
670   
671 #ifdef WITH_STL
672   MotifPositionMapIterator i = fMotifPositions.find(motifPositionID);
673   if (i != fMotifPositions.end()) 
674     return (*i).second;
675   else                 
676     return 0;
677 #endif
678
679 #ifdef WITH_ROOT
680   return (AliMpMotifPosition*)fMotifPositions.GetValue(motifPositionID);
681 #endif
682 }
683
684 /*
685 //_____________________________________________________________________________
686 AliMpMotifPosition* 
687 AliMpMotifMap::FindMotifPosition(const AliMpIntPair& indices) const
688 {
689 /// Find the last motif position which has the global indices (low limit)
690 /// less then the indices specified.
691
692 #ifdef WITH_STL
693   MotifPositionMap2Iterator found 
694     = fMotifPositions2.lower_bound(indices);
695   
696   if (found == fMotifPositions2.end()) found--; 
697
698   MotifPositionMap2Iterator i=found;
699   do {
700     AliMpIntPair low = (*i).second->GetLowIndicesLimit();
701     AliMpIntPair up = (*i).second->GetHighIndicesLimit();
702     
703     if ( indices.GetFirst()  >= low.GetFirst() &&
704          indices.GetSecond() >= low.GetSecond() &&
705          indices.GetFirst()  <= up.GetFirst() &&
706          indices.GetSecond() <= up.GetSecond())
707          
708          return (*i).second;                     
709   }
710   while ( i-- != fMotifPositions2.begin());
711   
712   return 0;
713 #endif
714
715 #ifdef WITH_ROOT
716   // HOW TO DO THIS WITH ROOT ????
717   // Fortunately it seems not to be used anywhere
718   Fatal("FindMotifPosition", "Difficult in Root to do this.");
719   return 0;
720 #endif
721 }
722 */