+++ /dev/null
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-// $Id$
-// $MpId: AliMpBasicTypes.h,v 1.4 2005/08/26 15:43:36 ivana Exp $
-
-/// \ingroup basic
-///
-/// AliMpBasicTypes
-/// System dependent types definitions for basic category.
-///
-/// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
-
-#ifndef ALI_MP_BASIC_TYPES_H
-#define ALI_MP_BASIC_TYPES_H
-
-#include <utility>
-#include "AliMpPad.h"
-
-#ifdef __HP_aCC
- typedef pair<AliMpPad, AliMpPad> PadPair;
-#else
- typedef std::pair<AliMpPad, AliMpPad> PadPair;
-#endif
-
-#endif //ALI_MP_BASIC_TYPES_H
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+// $Id$
+// $MpId: AliMpExMap.cxx,v 1.1 2005/09/26 16:16:16 ivana Exp $
+// Category: basic
+//
+// Class AliMpExMap
+// ------------------------
+// Helper class making Root persistent TExMap
+// Author:Ivana Hrivnacova; IPN Orsay
+
+#include <stdlib.h>
+
+#include <TClass.h>
+#include <Riostream.h>
+#include <TString.h>
+#include <TError.h>
+
+#include "AliMpExMap.h"
+//#include "AliMpConstants.h"
+#include "AliMpIntPair.h"
+#include "AliLog.h"
+
+ClassImp(AliMpExMap)
+
+//
+// static members
+//
+
+const Int_t AliMpExMap::fgkDefaultSize = 300;
+const Bool_t AliMpExMap::fgkDefaultOwnership = true;
+
+const Int_t AliMpExMap::fgkSeparator1 = 10000;
+const Int_t AliMpExMap::fgkSeparator2 = 100;
+
+const TString AliMpExMap::fgkCharacterMap
+ = " 1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.";
+
+//
+// static methods
+//
+
+//______________________________________________________________________________
+Long_t AliMpExMap::GetIndex(const AliMpIntPair& pair)
+{
+/// Convert the pair of integers to integer.
+
+ if (pair.GetFirst() >= fgkSeparator1 || pair.GetSecond() >= fgkSeparator1) {
+ // to do - use AliLog, is it possible for static function
+ // AliFatal("Index out of limit.");
+ cerr << "AliMpExMap::GetIndex(const AliMpIntPair&): Index out of limit." << endl;
+ exit(1);
+ }
+
+ return pair.GetFirst()*fgkSeparator1 + pair.GetSecond() + 1;
+}
+
+//_____________________________________________________________________________
+Long_t AliMpExMap::GetIndex(const TString& s)
+{
+/// Convert the TString to integer.
+
+ if (s.Length() > 5) {
+ // to do - use AliLog, is it possible for static function
+ // AliFatal("String too long.");
+ cerr << "AliMpExMap::GetIndex(const TString&): String too long." << endl;
+ return 0;
+ }
+
+ Long_t index = 0;
+ for (Int_t i=s.Length()-1; i>=0; --i)
+ index = index*fgkSeparator2 + fgkCharacterMap.First(s(i));
+
+ return index;
+}
+
+//______________________________________________________________________________
+AliMpIntPair AliMpExMap::GetPair(Long_t index)
+{
+/// Convert the integer index to the pair of integers.
+
+ return AliMpIntPair((index-1)/fgkSeparator1,(index-1)%fgkSeparator1);
+}
+
+//_____________________________________________________________________________
+TString AliMpExMap::GetString(Long_t index)
+{
+/// Convert the integer index to the string.
+
+ TString s;
+ while (index >0) {
+ Char_t c = fgkCharacterMap(index%fgkSeparator2);
+ s += c;
+ index = index/fgkSeparator2;
+ }
+ return s;
+}
+
+//
+// constructors/destructor
+//
+
+//_____________________________________________________________________________
+AliMpExMap::AliMpExMap(Bool_t /*standardConstructor*/)
+ : TObject(),
+ fMap(fgkDefaultSize),
+ fObjects(fgkDefaultSize),
+ fKeys(fgkDefaultSize)
+{
+/// Standard constructor
+
+ fObjects.SetOwner(fgkDefaultOwnership);
+}
+
+//_____________________________________________________________________________
+AliMpExMap::AliMpExMap()
+ : TObject(),
+ fMap(),
+ fObjects(),
+ fKeys()
+{
+/// Default constructor
+}
+
+//_____________________________________________________________________________
+AliMpExMap::~AliMpExMap()
+{
+/// Destructor
+}
+
+//
+// private methods
+//
+
+//_____________________________________________________________________________
+void AliMpExMap::FillMap()
+{
+/// Fill transient map from the arrays of objects and keys
+
+ for (Int_t i=0; i<fObjects.GetEntriesFast(); i++)
+ fMap.Add(fKeys.At(i), (Long_t)fObjects.At(i));
+}
+
+//_____________________________________________________________________________
+void AliMpExMap::AddKey(Long_t key)
+{
+/// Add key in array with checking size
+
+ // Resize array if needed
+ if (fObjects.GetEntriesFast() == fKeys.GetSize()) {
+ fKeys.Set(2*fKeys.GetSize());
+ cout << "AliMpExMap::AddKey: resized Key array " << endl;
+ }
+
+ fKeys.AddAt(key, fObjects.GetEntriesFast());
+}
+
+//
+// public methods
+//
+
+//_____________________________________________________________________________
+void AliMpExMap::Add(const AliMpIntPair& key, TObject* object)
+{
+/// Add object with its key to the map and arrays
+
+ fMap.Add(GetIndex(key), (Long_t)object);
+ AddKey(GetIndex(key));
+ fObjects.Add(object);
+}
+
+//_____________________________________________________________________________
+void AliMpExMap::Add(const TString& key, TObject* object)
+{
+/// Add object with its key to the map and arrays
+
+ fMap.Add(GetIndex(key), (Long_t)object);
+ AddKey(GetIndex(key));
+ fObjects.Add(object);
+}
+
+//_____________________________________________________________________________
+void AliMpExMap::Add(Int_t key, TObject* object)
+{
+/// Add object with its key to the map and arrays
+
+ fMap.Add(key, (Long_t)object);
+ AddKey(key);
+ fObjects.Add(object);
+}
+
+//_____________________________________________________________________________
+void AliMpExMap::SetSize(Int_t size)
+{
+/// Set given size to the key array
+
+ // fMap.Set(size);
+ // fObjects.Set(size);
+ fKeys.Set(size);
+}
+
+//_____________________________________________________________________________
+void AliMpExMap::SetOwner(Bool_t owner)
+{
+/// Set given ownership to object array
+
+ fObjects.SetOwner(owner);
+}
+
+//_____________________________________________________________________________
+Int_t AliMpExMap::GetSize() const
+{
+/// Return TExMap iterator set to the beginning of the map
+
+ return fObjects.GetEntriesFast();
+}
+
+//_____________________________________________________________________________
+TExMapIter AliMpExMap::GetIterator() const
+{
+/// Return TExMap iterator set to the beginning of the map
+
+ return TExMapIter(&fMap);
+}
+
+//_____________________________________________________________________________
+TObject* AliMpExMap::GetValue(const AliMpIntPair& key) const
+{
+/// Return the object associated with the given key if found,
+/// otherwise return 0
+
+ Long_t value = fMap.GetValue(GetIndex(key));
+ if (value)
+ return (TObject*)value;
+ else
+ return 0;
+
+}
+
+//_____________________________________________________________________________
+TObject* AliMpExMap::GetValue(const TString& key) const
+{
+/// Return the object associated with the given key if found,
+/// otherwise return 0
+
+ Long_t value = fMap.GetValue(GetIndex(key));
+ if (value)
+ return (TObject*)value;
+ else
+ return 0;
+
+}
+
+//_____________________________________________________________________________
+TObject* AliMpExMap::GetValue(Int_t key) const
+{
+/// Return the object associated with the given key if found,
+/// otherwise return 0
+
+ Long_t value = fMap.GetValue(key);
+ if (value)
+ return (TObject*)value;
+ else
+ return 0;
+
+}
+
+//_____________________________________________________________________________
+void AliMpExMap::Streamer(TBuffer &R__b)
+{
+/// Customized streamer \n
+/// After the arrays are read, fill the transient map
+
+ if (R__b.IsReading()) {
+ AliMpExMap::Class()->ReadBuffer(R__b, this);
+ FillMap();
+ }
+ else {
+ AliMpExMap::Class()->WriteBuffer(R__b, this);
+ }
+}
--- /dev/null
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+// $Id$
+// $MpId: AliMpExMap.h,v 1.1 2005/09/26 16:16:16 ivana Exp $
+
+/// \ingroup basic
+/// \class AliMpExMap
+/// \brief Helper class making Root persistent TExMap
+///
+/// The objects and keys from TExMap are store in additional
+/// arrays which are Root persistent.
+///
+/// Author: Ivana Hrivnacova; IPN Orsay
+
+#ifndef ALI_MP_EX_MAP_H
+#define ALI_MP_EX_MAP_H
+
+#include <TObject.h>
+#include <TObjArray.h>
+#include <TArrayL.h>
+#include <TExMap.h>
+
+class TString;
+
+class AliMpIntPair;
+
+class AliMpExMap : public TObject
+{
+ public:
+ AliMpExMap(Bool_t standardConstructor);
+ AliMpExMap();
+ virtual ~AliMpExMap();
+
+ // static methods
+ // conversion between varius keys and Long_t
+ //
+ static Long_t GetIndex(const AliMpIntPair& pair);
+ static Long_t GetIndex(const TString& s);
+ static AliMpIntPair GetPair(Long_t index);
+ static TString GetString(Long_t index);
+
+ // set methods
+ void Add(const AliMpIntPair& key, TObject* object);
+ void Add(const TString& key, TObject* object);
+ void Add(Int_t key, TObject* object);
+
+ void SetSize(Int_t size);
+ void SetOwner(Bool_t owner);
+
+ // get methods
+ Int_t GetSize() const;
+ TExMapIter GetIterator() const;
+
+ TObject* GetValue(const AliMpIntPair& key) const;
+ TObject* GetValue(const TString& key) const;
+ TObject* GetValue(Int_t key) const;
+
+ private:
+ // methods
+ void FillMap();
+ void AddKey(Long_t key);
+
+ // static data members
+ static const Int_t fgkDefaultSize; // Default initial size
+ static const Bool_t fgkDefaultOwnership; // Default ownership
+
+ static const Int_t fgkSeparator1; // the separator used for conversion
+ // of AliMpIntPair to Int_t
+ static const Int_t fgkSeparator2; // the separator used for conversion
+ // of TString to Int_t
+ static const TString fgkCharacterMap; // the string mapping characters
+ // to integers
+
+ // data members
+ mutable TExMap fMap; //! Transient map class
+ TObjArray fObjects; // Array of objects
+ TArrayL fKeys; // Array of keys
+
+ ClassDef(AliMpExMap,1) // Root persistent TExMap
+};
+
+#endif //ALI_MP_EX_MAP_H
+
**************************************************************************/
// $Id$
-// $MpId: AliMpGraphContext.cxx,v 1.7 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpGraphContext.cxx,v 1.8 2005/09/26 16:06:36 ivana Exp $
// Category: graphics
//
// Class AliMpGraphContext
ClassImp(AliMpGraphContext)
AliMpGraphContext *AliMpGraphContext::fgInstance = 0;
-GraphContextVector AliMpGraphContext::fgStack;
+AliMpGraphContext::GraphContextVector AliMpGraphContext::fgStack;
#ifdef WITH_ROOT
Int_t AliMpGraphContext::fgStackSize = 0;
#endif
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpGraphContext.h,v 1.7 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpGraphContext.h,v 1.8 2005/09/26 16:06:11 ivana Exp $
/// \ingroup graphics
/// \class AliMpGraphContext
#ifndef ALI_MP_GRAPH_CONTEXT_H
#define ALI_MP_GRAPH_CONTEXT_H
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <vector>
+#endif
+
+#ifdef WITH_ROOT
+#include "AliMpExMap.h"
+#endif
+
#include <TObject.h>
#include <TVector2.h>
-#include "AliMpGraphicsTypes.h"
-
class MPainter;
class AliMpGraphContext : public TObject
{
+ public:
+#ifdef WITH_STL
+ typedef std::vector<AliMpGraphContext*> GraphContextVector;
+#endif
+#ifdef WITH_ROOT
+ typedef TObjArray GraphContextVector;
+#endif
+
public:
void Push() const;
void Pop();
+++ /dev/null
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-// $Id$
-// $MpId: AliMpGraphicsTypes.h,v 1.5 2005/08/26 15:43:36 ivana Exp $
-
-/// \ingroup graphics
-/// AliMpGraphicsTypes
-/// System dependent types definitions for graphics category.
-///
-/// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
-
-#ifndef ALI_MP_GRAPHICS_TYPES_H
-#define ALI_MP_GRAPHICS_TYPES_H
-
-#include "AliMpContainers.h"
-
-#ifdef WITH_STL
- #include <vector>
-#endif
-
-#ifdef WITH_ROOT
- #include <TObjArray.h>
-#endif
-
-class AliMpGraphContext;
-
-#ifdef WITH_STL
-#ifdef __HP_aCC
- typedef vector<AliMpGraphContext*> GraphContextVector;
-#else
- typedef std::vector<AliMpGraphContext*> GraphContextVector;
-#endif
-#endif
-
-#ifdef WITH_ROOT
- typedef TObjArray GraphContextVector;
-#endif
-
-#endif //ALI_MP_GRAPHICS_TYPES_H
**************************************************************************/
// $Id$
-// $MpId: AliMpMotifMap.cxx,v 1.7 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpMotifMap.cxx,v 1.9 2005/09/26 16:11:20 ivana Exp $
// Category: motif
//
// Class AliMpMotifMap
ClassImp(AliMpMotifMap)
+//_____________________________________________________________________________
+AliMpMotifMap::AliMpMotifMap(Bool_t /*standardConstructor*/)
+ : TObject()
#ifdef WITH_ROOT
-const Int_t AliMpMotifMap::fgkSeparator = 100;
-#endif
+ ,fMotifs(true),
+ fMotifTypes(true),
+ fMotifPositions(true),
+ fMotifPositions2(true)
+#endif
+{
+/// Standard constructor
+
+ //fMotifPositions2.SetOwner(false);
+}
//_____________________________________________________________________________
AliMpMotifMap::AliMpMotifMap()
- : TObject()
+ : TObject(),
+ fMotifs(),
+ fMotifTypes(),
+ fMotifPositions(),
+ fMotifPositions2()
{
/// Default constructor
}
delete ip->second;
}
#endif
-
-#ifdef WITH_ROOT
- MotifMapIterator im(&fMotifs);
- Long_t mkey, mvalue;
- while ( im.Next(mkey, mvalue) ) delete (AliMpMotif*)mvalue;
-
- MotifMapIterator it(&fMotifTypes);
- Long_t tkey, tvalue;
- while ( it.Next(tkey, tvalue) ) delete (AliMpMotifType*)tvalue;
-
- MotifMapIterator ip(&fMotifPositions);
- Long_t pkey, pvalue;
- while ( it.Next(pkey, pvalue) ) delete (AliMpMotifPosition*)pvalue;
-#endif
}
//
// private methods
//
-#ifdef WITH_ROOT
-//_____________________________________________________________________________
-Int_t AliMpMotifMap::GetIndex(const TString& s) const
-{
-/// Convert the TString to integer.
-
- if (s.Length() > 5) {
- Fatal("GetIndex", "String too long.");
- return 0;
- }
-
- Int_t index = 0;
- for (Int_t i=s.Length(); i>=0; --i) index = index*100 + int(s(i));
- return index;
-}
-
-//______________________________________________________________________________
-Int_t AliMpMotifMap::GetIndex(const AliMpIntPair& pair) const
-{
-/// Convert the pair of integers to integer.
-
- if (pair.GetFirst() >= fgkSeparator || pair.GetSecond() >= fgkSeparator)
- Fatal("GetIndex", "Index out of limit.");
-
- return pair.GetFirst()*fgkSeparator + pair.GetSecond() + 1;
-}
-
-//_____________________________________________________________________________
-TString AliMpMotifMap::GetString(Int_t index) const
-{
-/// Convert the integer index to the string.
-
- TString s;
- while (index >0) {
- Char_t c = index%100;
- s += c;
- index = index/100;
- }
- return s;
-}
-
-//______________________________________________________________________________
-AliMpIntPair AliMpMotifMap::GetPair(Int_t index) const
-{
-/// Convert the integer index to the pair of integers.
-
- return AliMpIntPair((index-1)/fgkSeparator, (index-1)%fgkSeparator);
-}
-#endif
-
//_____________________________________________________________________________
void AliMpMotifMap::PrintMotif(const AliMpVMotif* motif) const
{
if (fMotifs.GetSize()) {
cout << "Dump of Motif Map - " << fMotifs.GetSize() << " entries:" << endl;
Int_t counter = 0;
- MotifMapIterator i(&fMotifs);
+ TExMapIter i = fMotifs.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
- TString id = GetString(key);
+ TString id = fMotifs.AliMpExMap::GetString(key);
AliMpVMotif* motif = (AliMpVMotif*)value;
cout << "Map element "
<< setw(3) << counter++ << " "
if (fMotifTypes.GetSize()) {
cout << "Dump of Motif Type Map - " << fMotifTypes.GetSize() << " entries:" << endl;
Int_t counter = 0;
- MotifTypeMapIterator i(&fMotifTypes);
+ TExMapIter i = fMotifTypes.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
- TString id = GetString(key);
+ TString id = AliMpExMap::GetString(key);
AliMpMotifType* motifType = (AliMpMotifType*)value;
cout << "Map element "
<< setw(3) << counter++ << " "
if (fMotifPositions.GetSize()) {
cout << "Dump of Motif Position Map - " << fMotifPositions.GetSize() << " entries:" << endl;
Int_t counter = 0;
- MotifPositionMapIterator i(&fMotifPositions);
+ TExMapIter i = fMotifPositions.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpMotifPosition* motifPosition = (AliMpMotifPosition*)value;
if (fMotifPositions2.GetSize()) {
cout << "Dump of Motif Position Map 2 - " << fMotifPositions2.GetSize() << " entries:" << endl;
Int_t counter = 0;
- MotifPositionMapIterator i(&fMotifPositions2);
+ TExMapIter i = fMotifPositions2.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpMotifPosition* motifPosition = (AliMpMotifPosition*)value;
#endif
#ifdef WITH_ROOT
- fMotifs.Add(GetIndex(motif->GetID()), (Long_t)motif);
+ fMotifs.Add(motif->GetID(), motif);
#endif
return true;
#endif
#ifdef WITH_ROOT
- fMotifTypes.Add(GetIndex(motifType->GetID()), (Long_t)motifType);
+ fMotifTypes.Add(motifType->GetID(), motifType);
#endif
return true;
#endif
#ifdef WITH_ROOT
- fMotifPositions.Add(motifPosition->GetID(), (Long_t)motifPosition);
+ fMotifPositions.Add(motifPosition->GetID(), motifPosition);
#endif
return true;
return;
}
- MotifPositionMapIterator i(&fMotifPositions);
+ TExMapIter i = fMotifPositions.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpMotifPosition* motifPosition = (AliMpMotifPosition*)value;
- fMotifPositions2.Add(GetIndex(motifPosition->GetLowIndicesLimit()),
- (Long_t)motifPosition);
+ fMotifPositions2.Add(motifPosition->GetLowIndicesLimit(), motifPosition);
}
#endif
#ifdef WITH_ROOT
if (fMotifPositions.GetSize()) {
- MotifPositionMapIterator i(&fMotifPositions);
+ TExMapIter i = fMotifPositions.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpMotifPosition* motifPosition = (AliMpMotifPosition*)value;
#endif
#ifdef WITH_ROOT
- Long_t value = fMotifs.GetValue(GetIndex(motifID));
- if (value)
- return (AliMpVMotif*)value;
- else
- return 0;
+ return (AliMpVMotif*)fMotifs.GetValue(motifID);
#endif
}
#endif
#ifdef WITH_ROOT
- Long_t value = fMotifTypes.GetValue(GetIndex(motifTypeID));
- if (value)
- return (AliMpMotifType*)value;
- else
- return 0;
+ return (AliMpMotifType*)fMotifTypes.GetValue(motifTypeID);
#endif
}
#endif
#ifdef WITH_ROOT
- Long_t value = fMotifPositions.GetValue(motifPositionID);
- if (value)
- return (AliMpMotifPosition*)value;
- else
- return 0;
+ return (AliMpMotifPosition*)fMotifPositions.GetValue(motifPositionID);
#endif
}
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpMotifMap.h,v 1.7 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpMotifMap.h,v 1.9 2005/09/26 16:10:46 ivana Exp $
/// \ingroup motif
/// \class AliMpMotifMap
#ifndef ALI_MP_MOTIF_MAP_H
#define ALI_MP_MOTIF_MAP_H
+#include "AliMpContainers.h"
+
#ifdef WITH_STL
- #include <map>
+#include <map>
+#include "AliMpIntPair.h"
#endif
-#include <TObject.h>
+#ifdef WITH_ROOT
+#include "AliMpExMap.h"
+#endif
-#include "AliMpMotifTypes.h"
+#include <TObject.h>
class TString;
class TVector2;
class AliMpMotifMap : public TObject
{
public:
+#ifdef WITH_STL
+ typedef std::map<TString, AliMpVMotif*> MotifMap;
+ typedef MotifMap::const_iterator MotifMapIterator;
+ typedef std::map<TString, AliMpMotifType*> MotifTypeMap;
+ typedef MotifTypeMap::const_iterator MotifTypeMapIterator;
+ typedef std::map<Int_t, AliMpMotifPosition*> MotiPositionMap;
+ typedef MotiPositionMap::const_iterator MotifPositionMapIterator;
+ typedef std::map<AliMpIntPair, AliMpMotifPosition*> MotifPositionMap2;
+ typedef MotifPositionMap2::const_iterator MotifPositionMap2Iterator;
+#endif
+#ifdef WITH_ROOT
+ typedef AliMpExMap MotifMap;
+ typedef AliMpExMap MotifTypeMap;
+ typedef AliMpExMap MotifPositionMap;
+ typedef AliMpExMap MotifPositionMap2;
+#endif
+
+ public:
+ AliMpMotifMap(Bool_t /*standardConstructor*/);
AliMpMotifMap();
virtual ~AliMpMotifMap();
// AliMpMotifPosition* FindMotifPosition(const AliMpIntPair& indices) const;
private:
-#ifdef WITH_ROOT
- static const Int_t fgkSeparator; // the separator used for conversion
- // of TString to Int_t
-
- // methods
- Int_t GetIndex(const TString& s) const;
- Int_t GetIndex(const AliMpIntPair& pair) const;
- TString GetString(Int_t index) const;
- AliMpIntPair GetPair(Int_t index) const;
-#endif
-
// methods
void PrintMotif(const AliMpVMotif* motif) const;
void PrintMotifType(const AliMpMotifType* motifType) const;
void PrintMotifPositions() const;
void PrintMotifPositions2() const;
-#ifdef WITH_STL
-#ifdef __HP_aCC
- // data members
- // EXCLUDED FOR CINT (does not compile on HP)
- MotifMap fMotifs; //! motifs map
- MotifTypeMap fMotifTypes; //!motif types map
- //MotifPositionMap fMotifPositions; //! motif positions map
- // not taken by cint
- map<Int_t, AliMpMotifPosition*> fMotifPositions; //! motif positions map by Id
- MotifPositionMap2 fMotifPositions2; //! motif positions map
-#else
// data members
- MotifMap fMotifs; // motifs map
- MotifTypeMap fMotifTypes; // motif types map
- //MotifPositionMap fMotifPositions; // motif positions map
- // not taken by cint
+ MotifMap fMotifs; // motifs map
+ MotifTypeMap fMotifTypes; // motifs types map
+#ifdef WITH_STL
std::map<Int_t, AliMpMotifPosition*> fMotifPositions; // motif positions map by Id
- MotifPositionMap2 fMotifPositions2; // motif positions map
-#endif
#endif
-
#ifdef WITH_ROOT
- // data members
- mutable MotifMap fMotifs; // motifs map
- mutable MotifTypeMap fMotifTypes; // motifs types map
- mutable MotifPositionMap fMotifPositions; // motifs positions map
- mutable MotifPositionMap2 fMotifPositions2;// motifs positions map
+ MotifPositionMap fMotifPositions; // motifs positions map
#endif
+ MotifPositionMap2 fMotifPositions2;// motifs positions map
ClassDef(AliMpMotifMap,1) // motif map
};
**************************************************************************/
// $Id$
-// $MpId: AliMpMotifReader.cxx,v 1.4 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpMotifReader.cxx,v 1.6 2005/09/26 16:11:20 ivana Exp $
// Category: sector
//
// Class AliMpMotifReader
ClassImp(AliMpMotifReader)
-#ifdef WITH_ROOT
-const Int_t AliMpMotifReader::fgkSeparator = 100;
-#endif
-
//_____________________________________________________________________________
AliMpMotifReader::AliMpMotifReader(AliMpStationType station,
AliMpPlaneType plane)
// private methods
//
-#ifdef WITH_ROOT
-//_____________________________________________________________________________
-Int_t AliMpMotifReader::GetIndex(const string& s) const
-{
-/// Converts the TString to integer.
-
- if (s.length() > 5) {
- Fatal("GetIndex", "String too long.");
- return 0;
- }
-
- Int_t index = 0;
- for (Int_t i=s.length(); i>=0; --i) index = index*100 + int(s[i]);
-
- return index;
-}
-
-//______________________________________________________________________________
-Int_t AliMpMotifReader::GetIndex(const AliMpIntPair& pair) const
-{
-/// Convert the pair of integers to integer.
-
- if (pair.GetFirst() >= fgkSeparator || pair.GetSecond() >= fgkSeparator)
- Fatal("GetIndex", "Index out of limit.");
-
- return pair.GetFirst()*fgkSeparator + pair.GetSecond() + 1;
-}
-
-//_____________________________________________________________________________
-string AliMpMotifReader::GetString(Int_t index) const
-{
-/// Convert the integer index to the string.
-
- string s;
- while (index >0) {
- Char_t c = index%100;
- s += c;
- index = index/100;
- }
-
- return s;
-
-}
-
-//______________________________________________________________________________
-AliMpIntPair AliMpMotifReader::GetPair(Int_t index) const
-{
-/// Convert the integer index to the pair of integers.
-
- return AliMpIntPair((index-1)/fgkSeparator, (index-1)%fgkSeparator);
-}
-#endif
//
// public methods
positions[key].second=j;
#endif
#ifdef WITH_ROOT
- positions.Add(GetIndex(key), GetIndex(AliMpIntPair(i,j)));
+ positions.Add( AliMpExMap::GetIndex(key),
+ AliMpExMap::GetIndex(AliMpIntPair(i,j)) );
#endif
} while (!padPos.eof());
#endif
#ifdef WITH_ROOT
- Long_t value = positions.GetValue(GetIndex(padName));
+ Long_t value = positions.GetValue(AliMpExMap::GetIndex(padName));
if (!value) {
cerr<<"Problem: Pad number "<<padNum<<" found in the file "<<motifTypeFileName
<<" but not in the file"<<padPosFileName<<endl;
continue;
}
- ix = GetPair(value).GetFirst();
- iy = GetPair(value).GetSecond();
+ ix = AliMpExMap::GetPair(value).GetFirst();
+ iy = AliMpExMap::GetPair(value).GetSecond();
#endif
motifType->AddConnection(AliMpIntPair(ix,iy),
* See cxx source for full Copyright notice */
// $Id$
-// $Id$
+// $MpId: AliMpMotifReader.h,v 1.5 2005/09/26 16:10:46 ivana Exp $
/// \ingroup motif
/// \class AliMpMotifReader
#ifndef ALI_MP_MOTIF_READER_H
#define ALI_MP_MOTIF_READER_H
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <map>
+#endif
+
+#ifdef WITH_ROOT
+#include <TExMap.h>
+#endif
+
#include <fstream>
#include <TObject.h>
class AliMpMotifReader : public TObject
{
+ public:
+#ifdef WITH_STL
+ typedef std::map<std::string, std::pair<Int_t,Int_t> > PadMapType;
+ typedef PadMapType::iterator PadMapTypeIterator;
+#endif
+#ifdef WITH_ROOT
+ typedef TExMap PadMapType;
+#endif
+
public:
AliMpMotifReader(AliMpStationType station, AliMpPlaneType plane);
AliMpMotifReader();
AliMpMotifReader& operator = (const AliMpMotifReader& right);
private:
-#ifdef WITH_ROOT
- static const Int_t fgkSeparator; // the separator used for conversion
- // of string to Int_t
-
- // methods
- Int_t GetIndex(const string& s) const;
- Int_t GetIndex(const AliMpIntPair& pair) const;
- string GetString(Int_t index) const;
- AliMpIntPair GetPair(Int_t index) const;
-#endif
-
// data members
AliMpStationType fStationType; // station type
AliMpPlaneType fPlaneType; // plane type
**************************************************************************/
// $Id$
-// $MpId: AliMpMotifSpecial.cxx,v 1.8 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpMotifSpecial.cxx,v 1.9 2005/09/26 16:11:20 ivana Exp $
// Category: motif
//
// Class AliMpMotifSpecial
AliMpMotifSpecial::AliMpMotifSpecial(const TString &id,
AliMpMotifType *motifType)
: AliMpVMotif(id,motifType),
+#ifdef WITH_STL
fPadDimensionsVector(),
+#endif
+#ifdef WITH_ROOT
+ fPadDimensionsVector(true),
+#endif
fPadDimensionsVector2()
{
#ifdef WITH_STL
fPadDimensionsVector.resize(motifType->GetNofPadsX()*motifType->GetNofPadsY());
#endif
-
-#ifdef WITH_ROOT
- fPadDimensionsVector.Expand(motifType->GetNofPadsX()*motifType->GetNofPadsY());
-#endif
}
//______________________________________________________________________________
AliMpMotifSpecial::~AliMpMotifSpecial()
{
/// Destructor
-
-#ifdef WITH_ROOT
- fPadDimensionsVector.Delete();
-#endif
}
// public methods
//
+#include <Riostream.h>
//______________________________________________________________________________
TVector2
AliMpMotifSpecial::GetPadDimensions(const AliMpIntPair& localIndices) const
{
/// Return the dimensions of pad located at the given indices
- if (GetMotifType()->HasPad(localIndices))
+ if (GetMotifType()->HasPad(localIndices)) {
#ifdef WITH_STL
return fPadDimensionsVector[VectorIndex(localIndices)];
#endif
#ifdef WITH_ROOT
- return *((TVector2*)fPadDimensionsVector[VectorIndex(localIndices)]);
-#endif
+ if (!fPadDimensionsVector.GetValue(localIndices)) {
+ Warning("GetPadDimensions","Indices outside limits");
+ return TVector2(0.,0.);
+ }
+ else
+ return *((TVector2*)fPadDimensionsVector.GetValue(localIndices));
+#endif
+ }
else {
Warning("GetPadDimensions","Indices outside limits");
return TVector2(0.,0.);
#ifdef WITH_ROOT
TVector2* dimensionsObj = new TVector2(dimensions);
- fPadDimensionsVector[VectorIndex(localIndices)]= dimensionsObj;
+ fPadDimensionsVector.Add(localIndices, dimensionsObj);
// fill the vector of different pad dimensions
// only if these dimensions are not yet present
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpMotifSpecial.h,v 1.6 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpMotifSpecial.h,v 1.7 2005/09/26 16:10:46 ivana Exp $
/// \ingroup motif
/// \class AliMpMotifSpecial
#ifndef ALI_MP_MOTIF_SPECIAL_H
#define ALI_MP_MOTIF_SPECIAL_H
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <vector>
+#endif
+
+#ifdef WITH_ROOT
+#include <TObjArray.h>
+#include "AliMpExMap.h"
+#endif
+
#include <TVector2.h>
-#include "AliMpMotifTypes.h"
#include "AliMpVMotif.h"
class TString;
class AliMpMotifSpecial : public AliMpVMotif
{
+ public:
+#ifdef WITH_STL
+ typedef std::vector< TVector2 > DimensionsMap;
+ typedef std::vector< TVector2 > DimensionsMap2;
+#endif
+#ifdef WITH_ROOT
+ typedef AliMpExMap DimensionsMap;
+ typedef TObjArray DimensionsMap2;
+#endif
+
public:
AliMpMotifSpecial(const TString &id, AliMpMotifType *motifType);
AliMpMotifSpecial();
virtual AliMpIntPair PadIndicesLocal(const TVector2& localPos) const;
private:
-
// methods
Int_t VectorIndex(const AliMpIntPair& indices) const;
// data members
- DimensionsMap fPadDimensionsVector; // the vector of pad dimensions
- DimensionsMap fPadDimensionsVector2; // the vector of different pad dimensions
+ DimensionsMap fPadDimensionsVector; // the vector of pad dimensions
+ DimensionsMap2 fPadDimensionsVector2; // the vector of different pad dimensions
ClassDef(AliMpMotifSpecial,1) // A motif with its ID
};
**************************************************************************/
// $Id$
-// $MpId: AliMpMotifType.cxx,v 1.6 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpMotifType.cxx,v 1.7 2005/09/26 16:11:20 ivana Exp $
// Category: motif
//
// Class AliMpMotifType
ClassImp(AliMpMotifType)
const Int_t AliMpMotifType::fgkPadNumForA = 65;
-#ifdef WITH_ROOT
-const Int_t AliMpMotifType::fgkSeparator = 10000;
-#endif
-
//______________________________________________________________________________
AliMpMotifType::AliMpMotifType(const TString &id)
fNofPadsX(0),
fNofPadsY(0),
fVerboseLevel(0),
+#ifdef WITH_STL
fConnections()
+#endif
+#ifdef WITH_ROOT
+ fConnections(true)
+#endif
{
/// Standard constructor
}
fConnections.erase(fConnections.begin(),fConnections.end());
#endif
-
-#ifdef WITH_ROOT
- ConnectionMapCIterator i(&fConnections);
- Long_t key, value;
- while ( i.Next(key, value) ) delete (AliMpConnection*)value;
-#endif
}
-#ifdef WITH_ROOT
-
-//______________________________________________________________________________
-Int_t AliMpMotifType::GetIndex(const AliMpIntPair& pair) const
-{
-/// Convert the pair of integers to integer.
-
- if (pair.GetFirst() >= fgkSeparator || pair.GetSecond() >= fgkSeparator)
- Fatal("GetIndex", "Index out of limit.");
-
- return pair.GetFirst()*fgkSeparator + pair.GetSecond() + 1;
-}
-
-//______________________________________________________________________________
-AliMpIntPair AliMpMotifType::GetPair(Int_t index) const
-{
-/// Convert the integer index to the pair of integers.
-
- return AliMpIntPair((index-1)/fgkSeparator,(index-1)%fgkSeparator);
-}
-#endif
-
//______________________________________________________________________________
AliMpVPadIterator* AliMpMotifType::CreateIterator() const
{
#endif
#ifdef WITH_ROOT
- fConnections.Add(GetIndex(localIndices), (Long_t)connection);
+ fConnections.Add(localIndices, connection);
#endif
connection->SetOwner(this);
#endif
#ifdef WITH_ROOT
- ConnectionMapCIterator i(&fConnections);
+ TExMapIter i = fConnections.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpConnection* connection = (AliMpConnection*)value;
#endif
#ifdef WITH_ROOT
- Long_t value = fConnections.GetValue(GetIndex(localIndices));
- if (value)
- return (AliMpConnection*)value;
- else
- return 0;
+ return (AliMpConnection*)fConnections.GetValue(localIndices);
#endif
}
#endif
#ifdef WITH_ROOT
- ConnectionMapCIterator i(&fConnections);
+ TExMapIter i = fConnections.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpConnection* connection = (AliMpConnection*)value;
#endif
#ifdef WITH_ROOT
- ConnectionMapCIterator i(&fConnections);
+ TExMapIter i = fConnections.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpConnection* connection = (AliMpConnection*)value;
#endif
#ifdef WITH_ROOT
- ConnectionMapCIterator i(&fConnections);
+ TExMapIter i = fConnections.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpConnection* connection = (AliMpConnection*)value;
#endif
#ifdef WITH_ROOT
- ConnectionMapCIterator i(&fConnections);
+ TExMapIter i = fConnections.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpConnection* aConnection = (AliMpConnection*)value;
- if (aConnection == connection) return GetPair(key);
+ if (aConnection == connection) return AliMpExMap::GetPair(key);
}
#endif
#endif
#ifdef WITH_ROOT
- ConnectionMapCIterator i(&fConnections);
+ TExMapIter i = fConnections.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpConnection* connection = (AliMpConnection*)value;
- if (connection->GetPadNum() == padNum) return GetPair(key);
+ if (connection->GetPadNum() == padNum) return AliMpExMap::GetPair(key);
}
#endif
return AliMpIntPair::Invalid();
#endif
#ifdef WITH_ROOT
- ConnectionMapCIterator i(&fConnections);
+ TExMapIter i = fConnections.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpConnection* connection = (AliMpConnection*)value;
- if (connection->GetGassiNum()==gassiNum) return GetPair(key);
+ if (connection->GetGassiNum()==gassiNum) return AliMpExMap::GetPair(key);
}
#endif
#endif
#ifdef WITH_ROOT
- ConnectionMapCIterator i(&fConnections);
+ TExMapIter i = fConnections.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpConnection* connection = (AliMpConnection*)value;
- if (connection->GetKaptonNum()==kaptonNum) return GetPair(key);
+ if (connection->GetKaptonNum()==kaptonNum) return AliMpExMap::GetPair(key);
}
#endif
#endif
#ifdef WITH_ROOT
- ConnectionMapCIterator i(&fConnections);
+ TExMapIter i = fConnections.GetIterator();
Long_t key, value;
while ( i.Next(key, value) ) {
AliMpConnection* connection = (AliMpConnection*)value;
- if (connection->GetBergNum()==bergNum) return GetPair(key);
+ if (connection->GetBergNum()==bergNum) return AliMpExMap::GetPair(key);
}
#endif
{
/// Return true if the pad indexed by <localIndices> has a connection
+ //cout << "AliMpMotifType::HasPad: " << localIndices
+ // << "Connections size: " << fConnections.size() << endl;
+
if (!localIndices.IsValid()) return false;
#ifdef WITH_STL
#endif
#ifdef WITH_ROOT
- Long_t value = fConnections.GetValue(GetIndex(localIndices));
+ TObject* value = fConnections.GetValue(localIndices);
return value!=0;
#endif
}
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpMotifType.h,v 1.7 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpMotifType.h,v 1.8 2005/09/26 16:10:46 ivana Exp $
/// \ingroup motif
/// \class AliMpMotifType
#ifndef ALI_MP_MOTIF_TYPE_H
#define ALI_MP_MOTIF_TYPE_H
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <map>
+#endif
+
+#ifdef WITH_ROOT
+#include "AliMpExMap.h"
+#endif
+
#include <TObject.h>
#include <TString.h>
-#include "AliMpMotifTypes.h"
#include "AliMpIntPair.h"
class AliMpConnection;
class AliMpMotifType : public TObject
{
+ public:
+#ifdef WITH_STL
+ typedef std::map< AliMpIntPair, AliMpConnection* > ConnectionMap;
+ typedef ConnectionMap::const_iterator ConnectionMapCIterator;
+#endif
+#ifdef WITH_ROOT
+ typedef AliMpExMap ConnectionMap;
+#endif
+
public:
AliMpMotifType(const TString &id);
AliMpMotifType();
private:
// static data members
static const Int_t fgkPadNumForA; // the pad number for the pad "A"
-
-#ifdef WITH_ROOT
- static const Int_t fgkSeparator; // the separator used for conversion
- // of AliMpIntPair to Int_t
-
- // methods
- Int_t GetIndex(const AliMpIntPair& pair) const;
- AliMpIntPair GetPair(Int_t index) const;
-#endif
// data members
- TString fID; // unique motif ID
- Int_t fNofPadsX; // number of pads in x direction
- Int_t fNofPadsY; // number of pads in y direction
- Int_t fVerboseLevel; // verbose level
-
-#ifdef WITH_STL
- ConnectionMap_t fConnections; //! Map (ix,iy) of connections
-#endif
-#ifdef WITH_ROOT
- mutable ConnectionMap_t fConnections; // Map (ix,iy) of connections
-#endif
+ TString fID; // unique motif ID
+ Int_t fNofPadsX; // number of pads in x direction
+ Int_t fNofPadsY; // number of pads in y direction
+ Int_t fVerboseLevel; // verbose level
+ ConnectionMap fConnections; // Map (ix,iy) of connections
ClassDef(AliMpMotifType,1) //Motif type
};
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpMotifTypePadIterator.h,v 1.5 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpMotifTypePadIterator.h,v 1.6 2005/09/26 16:10:46 ivana Exp $
/// \ingroup motif
/// \class AliMpMotifTypePadIterator
// private data members
const AliMpMotifType* fMotifType;// the motif type over which iterate
- AliMpIntPair fCurrentPosition; //! the current position inside the motif type
- // EXCLUDED FOR CINT (does not compile on HP)
+ AliMpIntPair fCurrentPosition; // the current position inside the motif type
ClassDef(AliMpMotifTypePadIterator,1) // iterator over motif's pads
};
+++ /dev/null
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-// $Id$
-// $MpId: AliMpMotifTypes.h,v 1.7 2005/08/26 15:43:36 ivana Exp $
-
-/// \ingroup motif
-/// AliMpMotifTypes
-/// Sytem dependent types definitions for motif category.
-///
-/// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
-
-#ifndef ALI_MP_MOTIF_TYPES_H
-#define ALI_MP_MOTIF_TYPES_H
-
-#include "AliMpContainers.h"
-
-#ifdef WITH_STL
- #include <map>
- #include <vector>
-#endif
-
-#ifdef WITH_ROOT
- #include <TExMap.h>
- #include <TObjArray.h>
-#endif
-
-#include <TVector2.h>
-#include <TString.h>
-
-#include "AliMpIntPair.h"
-
-class AliMpConnection;
-class AliMpVMotif;
-class AliMpMotifType;
-class AliMpMotifPosition;
-
-#ifdef WITH_STL
-#ifdef __HP_aCC
- typedef map<AliMpIntPair, AliMpConnection*> ConnectionMap_t;
- typedef ConnectionMap_t::const_iterator ConnectionMapCIterator;
- typedef map<TString, AliMpVMotif*> MotifMap;
- typedef MotifMap::const_iterator MotifMapIterator;
- typedef map<TString, AliMpMotifType*> MotifTypeMap;
- typedef MotifTypeMap::const_iterator MotifTypeMapIterator;
- typedef map<Int_t, AliMpMotifPosition*> MotiPositionMap;
- typedef MotiPositionMap::const_iterator MotifPositionMapIterator;
- typedef map<AliMpIntPair, AliMpMotifPosition*> MotifPositionMap2;
- typedef MotifPositionMap2::const_iterator MotifPositionMap2Iterator;
- typedef map<string,pair<Int_t,Int_t> > PadMapType;
- typedef PadMapType::iterator PadMapTypeIterator;
- typedef vector<TVector2> DimensionsMap;
-#else
- typedef std::map< AliMpIntPair, AliMpConnection* > ConnectionMap_t;
- typedef ConnectionMap_t::const_iterator ConnectionMapCIterator;
- typedef std::map<TString, AliMpVMotif*> MotifMap;
- typedef MotifMap::const_iterator MotifMapIterator;
- typedef std::map<TString, AliMpMotifType*> MotifTypeMap;
- typedef MotifTypeMap::const_iterator MotifTypeMapIterator;
- typedef std::map<Int_t, AliMpMotifPosition*> MotiPositionMap;
- typedef MotiPositionMap::const_iterator MotifPositionMapIterator;
- typedef std::map<AliMpIntPair, AliMpMotifPosition*> MotifPositionMap2;
- typedef MotifPositionMap2::const_iterator MotifPositionMap2Iterator;
- typedef std::map<std::string, std::pair<Int_t,Int_t> > PadMapType;
- typedef PadMapType::iterator PadMapTypeIterator;
- typedef std::vector< TVector2 > DimensionsMap;
-#endif
-#endif
-
-#ifdef WITH_ROOT
- typedef TExMap ConnectionMap_t;
- typedef TExMapIter ConnectionMapCIterator;
- typedef TExMap MotifMap;
- typedef TExMapIter MotifMapIterator;
- typedef TExMap MotifTypeMap;
- typedef TExMapIter MotifTypeMapIterator;
- typedef TExMap MotifPositionMap;
- typedef TExMapIter MotifPositionMapIterator;
- typedef TExMap MotifPositionMap2;
- typedef TExMapIter MotifPositionMap2Iterator;
- typedef TExMap PadMapType;
- typedef TExMapIter PadMapTypeIterator;
- typedef TObjArray DimensionsMap;
-#endif
-
-#endif //ALI_MP_MOTIF_TYPES_H
**************************************************************************/
// $Id$
-// $MpId: AliMpNeighboursPadIterator.cxx,v 1.8 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpNeighboursPadIterator.cxx,v 1.9 2005/09/26 16:12:23 ivana Exp $
// Category: sector
//
// Class AliMpNeighboursPadIterator
#ifdef WITH_STL
//______________________________________________________________________________
-PadVector AliMpNeighboursPadIterator::PadVectorLine(const AliMpPad& from,
- const AliMpIntPair& direction) const
+AliMpNeighboursPadIterator::PadVector
+AliMpNeighboursPadIterator::PadVectorLine(const AliMpPad& from,
+ const AliMpIntPair& direction) const
{
/// Fill a new vector with all pads which have common
/// parts with the pad located at <fCenterPad>, in a given line
#endif
#ifdef WITH_ROOT
//______________________________________________________________________________
-PadVector* AliMpNeighboursPadIterator::PadVectorLine(const AliMpPad& from,
- const AliMpIntPair& direction) const
+AliMpNeighboursPadIterator::PadVector*
+AliMpNeighboursPadIterator::PadVectorLine(const AliMpPad& from,
+ const AliMpIntPair& direction) const
{
/// Fill a new vector with all pads which have common
/// parts with the pad located at <fCenterPad>, in a given line
if (includeCenter) fPads.push_back(fCenterPad);
//fPads.insert(fPads.end(),setTotal.begin(),setTotal.end());
- PadSetIterator it;
+ PadSetCIterator it;
for (it = setTotal.begin(); it != setTotal.end(); it++)
fPads.push_back((*it));
#endif
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpNeighboursPadIterator.h,v 1.7 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpNeighboursPadIterator.h,v 1.8 2005/09/26 16:12:11 ivana Exp $
/// \ingroup sector
/// \class AliMpNeighboursPadIterator
#ifndef ALI_MP_NEIGHBOURS_PAD_ITERATOR_H
#define ALI_MP_NEIGHBOURS_PAD_ITERATOR_H
-#include "AliMpSectorTypes.h"
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <vector>
+#include <set>
+#endif
+
+#ifdef WITH_ROOT
+#include <TObjArray.h>
+#endif
+
#include "AliMpVPadIterator.h"
#include "AliMpPad.h"
class AliMpNeighboursPadIterator : public AliMpVPadIterator
{
+ public:
+#ifdef WITH_STL
+ typedef std::vector<AliMpPad> PadVector;
+ typedef std::set<AliMpPad> PadSet;
+ typedef PadSet::const_iterator PadSetCIterator;
+#endif
+#ifdef WITH_ROOT
+ typedef TObjArray PadVector;
+ typedef TObjArray PadSet;
+#endif
+
public:
AliMpNeighboursPadIterator();
AliMpNeighboursPadIterator(const AliMpSectorSegmentation* segmentation,
#endif
#ifdef WITH_ROOT
PadVector* PadVectorLine(const AliMpPad& from,
- const AliMpIntPair& direction) const;
+ const AliMpIntPair& direction) const;
void UpdateTotalSet(PadSet& setTotal, PadVector* from) const;
#endif
void FillPadsVector(Bool_t includeCenter);
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpPadRow.h,v 1.6 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpPadRow.h,v 1.7 2005/09/26 16:12:11 ivana Exp $
/// \ingroup sector
/// \class AliMpPadRow
#ifndef ALI_MP_PAD_ROW_H
#define ALI_MP_PAD_ROW_H
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <vector>
+#endif
+
+#ifdef WITH_ROOT
+#include <TObjArray.h>
+#endif
+
#include <TObject.h>
-#include "AliMpSectorTypes.h"
#include "AliMpXDirection.h"
class AliMpVPadRowSegment;
class AliMpPadRow : public TObject
{
+ public:
+#ifdef WITH_STL
+ typedef std::vector<AliMpVPadRowSegment*> PadRowSegmentVector;
+#endif
+#ifdef WITH_ROOT
+ typedef TObjArray PadRowSegmentVector;
+#endif
+
public:
AliMpPadRow(AliMpXDirection direction);
AliMpPadRow();
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpRow.h,v 1.7 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpRow.h,v 1.8 2005/09/26 16:12:11 ivana Exp $
/// \ingroup sector
/// \class AliMpRow
#ifndef ALI_MP_ROW_H
#define ALI_MP_ROW_H
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <vector>
+#endif
+
+#ifdef WITH_ROOT
+#include <TList.h>
+#endif
+
#include <TVector2.h>
-#include "AliMpSectorTypes.h"
#include "AliMpVIndexed.h"
#include "AliMpDirection.h"
class AliMpRow : public AliMpVIndexed
{
+ public:
+#ifdef WITH_STL
+ typedef std::vector<AliMpVRowSegment*> RowSegmentVector;
+#endif
+#ifdef WITH_ROOT
+ typedef TList RowSegmentVector;
+#endif
+
public:
AliMpRow(Int_t id, AliMpMotifMap* motifMap);
AliMpRow();
#include <TVector2.h>
-#include "AliMpSectorTypes.h"
#include "AliMpVRowSegmentSpecial.h"
class AliMpRow;
#include <TVector2.h>
-#include "AliMpSectorTypes.h"
#include "AliMpVRowSegmentSpecial.h"
class AliMpRow;
**************************************************************************/
// $Id$
-// $MpId: AliMpSector.cxx,v 1.9 2005/09/02 10:01:09 ivana Exp $
+// $MpId: AliMpSector.cxx,v 1.10 2005/09/26 16:12:23 ivana Exp $
// Category: sector
//
// Class AliMpSector
//_____________________________________________________________________________
AliMpSector::AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows,
AliMpDirection direction, const TVector2& offset)
- : TObject(),
+ : TNamed("Sector", ""),
fID(id),
fOffset(offset),
fZones(),
{
/// Standard constructor
- fMotifMap = new AliMpMotifMap();
+ fMotifMap = new AliMpMotifMap(true);
+ //fMotifMap = new AliMpMotifMap();
#ifdef WITH_STL
for (Int_t izone = 0; izone<nofZones; izone++)
//_____________________________________________________________________________
AliMpSector::AliMpSector(const AliMpSector& right)
- : TObject(right)
+ : TNamed(right)
{
/// Protected copy constructor (not provided)
//_____________________________________________________________________________
AliMpSector::AliMpSector()
- : TObject(),
+ : TNamed(),
fID(""),
fOffset(TVector2(0., 0.)),
fZones(),
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpSector.h,v 1.8 2005/09/02 10:00:49 ivana Exp $
+// $MpId: AliMpSector.h,v 1.9 2005/09/26 16:12:11 ivana Exp $
/// \ingroup sector
/// \class AliMpSector
#ifndef ALI_MP_SECTOR_H
#define ALI_MP_SECTOR_H
-#include <TObject.h>
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <vector>
+#endif
+
+#ifdef WITH_ROOT
+#include <TObjArray.h>
+#endif
+
+#include <TNamed.h>
#include <TString.h>
#include <TVector2.h>
-#include "AliMpSectorTypes.h"
#include "AliMpDirection.h"
class AliMpZone;
class AliMpVPadIterator;
class AliMpMotifMap;
-class AliMpSector : public TObject
+class AliMpSector : public TNamed
{
+ public:
+#ifdef WITH_STL
+ typedef std::vector<AliMpRow*> RowVector;
+ typedef std::vector<AliMpZone*> ZoneVector;
+#endif
+#ifdef WITH_ROOT
+ typedef TObjArray RowVector;
+ typedef TObjArray ZoneVector;
+#endif
+
public:
AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows,
AliMpDirection direction, const TVector2& offset);
**************************************************************************/
// $Id$
-// $MpId: AliMpSectorReader.cxx,v 1.4 2005/09/02 10:01:09 ivana Exp $
+// $MpId: AliMpSectorReader.cxx,v 1.5 2005/09/26 16:12:23 ivana Exp $
// Category: sector
//
// Class AliMpSectorReader
// Process data
//
- PadRowVector newPadRows;
+ AliMpVRowSegmentSpecial::PadRowVector newPadRows;
for (Int_t i=0; i<nofPadRows; i++) {
// Create pad row
#include <TObject.h>
#include <TString.h>
-#include "AliMpSectorTypes.h"
#include "AliMpStationType.h"
#include "AliMpPlaneType.h"
#include "AliMpXDirection.h"
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpSectorSegmentation.h,v 1.9 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpSectorSegmentation.h,v 1.10 2005/09/26 16:12:11 ivana Exp $
/// \ingroup sector
/// \class AliMpSectorSegmentation
#ifndef ALI_MP_SECTOR_SEGMENTATION_H
#define ALI_MP_SECTOR_SEGMENTATION_H
+
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <map>
+#endif
+
+#ifdef WITH_ROOT
+#include <TExMap.h>
+#endif
+
#include <TVector2.h>
-#include "AliMpSectorTypes.h"
#include "AliMpVSegmentation.h"
#include "AliMpPad.h"
class AliMpSectorSegmentation : public AliMpVSegmentation
{
+ public:
+#ifdef WITH_STL
+ typedef std::map<Int_t, TVector2> PadDimensionsMap;
+ typedef PadDimensionsMap::const_iterator PadDimensionsMapCIterator;
+#endif
+#ifdef WITH_ROOT
+ typedef TExMap PadDimensionsMap;
+ typedef TExMapIter PadDimensionsMapCIterator;
+#endif
+
public:
AliMpSectorSegmentation(const AliMpSector* sector);
AliMpSectorSegmentation();
const AliMpSector* fkSector; // Sector
AliMpPad* fPadBuffer; // The pad buffer
#ifdef WITH_STL
- PadDimensionsMap fPadDimensionsMap; //! Map between zone IDs and pad dimensions
+ PadDimensionsMap fPadDimensionsMap; // Map between zone IDs and pad dimensions
// EXCLUDED FOR CINT (does not compile on HP)
#endif
#ifdef WITH_ROOT
+++ /dev/null
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-// $Id$
-// $MpId: AliMpSectorTypes.h,v 1.7 2005/08/26 15:43:36 ivana Exp $
-
-/// \ingroup sector
-/// AliMpSectorTypes
-/// System dependent types definitions for sector category.
-///
-/// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
-
-#ifndef ALI_MP_SECTOR_TYPES_H
-#define ALI_MP_SECTOR_TYPES_H
-
-#include "AliMpContainers.h"
-
-#ifdef WITH_STL
- #include <vector>
- #include <map>
- #include <set>
-#endif
-
-#ifdef WITH_ROOT
- #include <TArrayI.h>
- #include <TObjArray.h>
- #include <TList.h>
- #include <TExMap.h>
-#endif
-
-#include <string>
-
-#include <TVector2.h>
-
-#include "AliMpPad.h"
-
-class AliMpVPadRowSegment;
-class AliMpPadRow;
-class AliMpVMotif;
-class AliMpVRowSegment;
-class AliMpSubZone;
-class AliMpZone;
-class AliMpRow;
-
-#ifdef WITH_STL
-#ifdef __HP_aCC
- typedef vector<Int_t> MotifPositionIdVector;
- typedef vector<AliMpPad> PadVector;
- typedef vector<AliMpPadRow*> PadRowVector;
- typedef vector<AliMpVMotif*> MotifVector;
- typedef vector<AliMpVRowSegment*> RowSegmentVector;
- typedef vector<AliMpVPadRowSegment*> PadRowSegmentVector;
- typedef vector<AliMpSubZone*> SubZoneVector;
- typedef vector<AliMpRow*> RowVector;
- typedef vector<AliMpZone*> ZoneVector;
- typedef map<Int_t, TVector2> PadDimensionsMap;
- typedef PadDimensionsMap::const_iterator PadDimensionsMapCIterator;
- typedef set<AliMpPad> PadSet;
- typedef PadSet::const_iterator PadSetIterator;
-#else
- typedef std::vector<Int_t> MotifPositionIdVector;
- typedef std::vector<AliMpPad> PadVector;
- typedef std::vector<AliMpPadRow*> PadRowVector;
- typedef std::vector<AliMpVMotif*> MotifVector;
- typedef std::vector<AliMpVRowSegment*> RowSegmentVector;
- typedef std::vector<AliMpVPadRowSegment*> PadRowSegmentVector;
- typedef std::vector<AliMpSubZone*> SubZoneVector;
- typedef std::vector<AliMpRow*> RowVector;
- typedef std::vector<AliMpZone*> ZoneVector;
- typedef std::map<Int_t, TVector2> PadDimensionsMap;
- typedef PadDimensionsMap::const_iterator PadDimensionsMapCIterator;
- typedef std::set<AliMpPad> PadSet;
- typedef PadSet::const_iterator PadSetIterator;
-#endif
-#endif
-
-#ifdef WITH_ROOT
-#ifndef __HP_aCC
- using std::string;
-#endif
- typedef TArrayI MotifPositionIdVector;
- typedef TObjArray PadVector;
- typedef TObjArray PadRowVector;
- typedef TObjArray MotifVector;
- typedef TList RowSegmentVector;
- typedef TObjArray PadRowSegmentVector;
- typedef TObjArray SubZoneVector;
- typedef TObjArray RowVector;
- typedef TObjArray ZoneVector;
- typedef TExMap PadDimensionsMap;
- typedef TExMapIter PadDimensionsMapCIterator;
- typedef TObjArray PadSet;
-#endif
-
-#endif //ALI_MP_SECTOR_TYPES_H
**************************************************************************/
// $Id$
-// $MpId: AliMpSt345Reader.cxx,v 1.4 2005/09/19 19:01:31 ivana Exp $
+// $MpId: AliMpSt345Reader.cxx,v 1.5 2005/09/23 12:57:32 ivana Exp $
#include "AliMpSt345Reader.h"
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpSubZone.h,v 1.7 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpSubZone.h,v 1.8 2005/09/26 16:12:11 ivana Exp $
/// \ingroup sector
/// \class AliMpSubZone
#ifndef ALI_MP_SUB_ZONE_H
#define ALI_MP_SUB_ZONE_H
-#include <TObject.h>
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <vector>
+#endif
+
+#ifdef WITH_ROOT
+#include <TList.h>
+#endif
-#include "AliMpSectorTypes.h"
+#include <TObject.h>
class AliMpVMotif;
class AliMpVRowSegment;
class AliMpSubZone : public TObject
{
+ public:
+#ifdef WITH_STL
+ typedef std::vector<AliMpVRowSegment*> RowSegmentVector;
+#endif
+#ifdef WITH_ROOT
+ typedef TList RowSegmentVector;
+#endif
+
public:
AliMpSubZone(AliMpVMotif* motif);
AliMpSubZone();
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpVRowSegmentSpecial.h,v 1.6 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpVRowSegmentSpecial.h,v 1.7 2005/09/26 16:12:11 ivana Exp $
/// \ingroup sector
/// \class AliMpVRowSegmentSpecial
#ifndef ALI_MP_V_ROW_SEGMENT_SPECIAL_H
#define ALI_MP_V_ROW_SEGMENT_SPECIAL_H
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <vector>
+#endif
+
+#ifdef WITH_ROOT
+#include <TArrayI.h>
+#include <TObjArray.h>
+#endif
+
#include <TVector2.h>
-#include "AliMpSectorTypes.h"
#include "AliMpVRowSegment.h"
#include "AliMpVMotif.h"
class AliMpVRowSegmentSpecial : public AliMpVRowSegment
{
+ public:
+#ifdef WITH_STL
+ typedef std::vector<AliMpPadRow*> PadRowVector;
+ typedef std::vector<AliMpVMotif*> MotifVector;
+ typedef std::vector<Int_t> MotifPositionIdVector;
+#endif
+#ifdef WITH_ROOT
+ typedef TObjArray PadRowVector;
+ typedef TObjArray MotifVector;
+ typedef TArrayI MotifPositionIdVector;
+#endif
+
public:
AliMpVRowSegmentSpecial(AliMpRow* row, Double_t offsetX);
AliMpVRowSegmentSpecial();
PadRowVector fPadRows; //pad rows vector
MotifVector fMotifs; //motifs vector
MotifPositionIdVector fMotifPositionIds; //motifs position Ids vector
+
#ifdef WITH_ROOT
- Int_t fNofMotifPositionIds; // number of motif positions Ids
+ Int_t fNofMotifPositionIds; // number of motif positions Ids
#endif
ClassDef(AliMpVRowSegmentSpecial,1) //Row segment
* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpZone.h,v 1.6 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpZone.h,v 1.7 2005/09/26 16:12:11 ivana Exp $
/// \ingroup sector
/// \class AliMpZone
#ifndef ALI_MP_ZONE_H
#define ALI_MP_ZONE_H
+#include "AliMpContainers.h"
+
+#ifdef WITH_STL
+#include <vector>
+#endif
+
+#ifdef WITH_ROOT
+#include <TObjArray.h>
+#endif
+
#include <TObject.h>
#include <TVector2.h>
-#include "AliMpSectorTypes.h"
-
class AliMpSubZone;
+class AliMpVMotif;
class AliMpZone : public TObject
{
+ public:
+#ifdef WITH_STL
+ typedef std::vector<AliMpSubZone*> SubZoneVector;
+#endif
+#ifdef WITH_ROOT
+ typedef TObjArray SubZoneVector;
+#endif
+
public:
AliMpZone(Int_t id);
AliMpZone();