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