From 2294822de2efdcc1a7d9f45ea363d0cc4188390d Mon Sep 17 00:00:00 2001 From: ivana Date: Wed, 11 Mar 2009 16:30:13 +0000 Subject: [PATCH] In mapping: Removing compilation options WITH_STL, WITH_ROOT; kept code within WITH_ROOT option only. --- MUON/AliMUONSt1GeometryBuilderV2.cxx | 29 +-- MUON/AliMUONSt1GeometryBuilderV2.h | 6 - MUON/MUONmappingLinkDef.h | 9 - MUON/mapping/AliMpGraphContext.cxx | 25 +- MUON/mapping/AliMpGraphContext.h | 27 +- MUON/mapping/AliMpMotifMap.cxx | 259 -------------------- MUON/mapping/AliMpMotifMap.h | 56 +---- MUON/mapping/AliMpMotifReader.cxx | 25 +- MUON/mapping/AliMpMotifReader.h | 20 -- MUON/mapping/AliMpMotifSpecial.cxx | 45 +--- MUON/mapping/AliMpMotifSpecial.h | 30 +-- MUON/mapping/AliMpMotifType.h | 5 +- MUON/mapping/AliMpNeighboursPadIterator.cxx | 96 +------- MUON/mapping/AliMpNeighboursPadIterator.h | 44 +--- MUON/mapping/AliMpPCB.cxx | 74 +----- MUON/mapping/AliMpPCB.h | 35 +-- MUON/mapping/AliMpPad.cxx | 46 ---- MUON/mapping/AliMpPad.h | 21 +- MUON/mapping/AliMpPadRow.cxx | 18 -- MUON/mapping/AliMpPadRow.h | 20 +- MUON/mapping/AliMpRow.cxx | 36 --- MUON/mapping/AliMpRow.h | 20 +- MUON/mapping/AliMpSector.cxx | 61 +---- MUON/mapping/AliMpSector.h | 26 +- MUON/mapping/AliMpSectorReader.cxx | 12 +- MUON/mapping/AliMpSectorSegmentation.cxx | 47 +--- MUON/mapping/AliMpSectorSegmentation.h | 32 +-- MUON/mapping/AliMpSlat.cxx | 49 +--- MUON/mapping/AliMpSlat.h | 31 ++- MUON/mapping/AliMpSubZone.cxx | 18 -- MUON/mapping/AliMpSubZone.h | 21 +- MUON/mapping/AliMpVRowSegmentSpecial.cxx | 58 +---- MUON/mapping/AliMpVRowSegmentSpecial.h | 45 +--- MUON/mapping/AliMpZone.cxx | 18 -- MUON/mapping/AliMpZone.h | 21 +- 35 files changed, 89 insertions(+), 1296 deletions(-) diff --git a/MUON/AliMUONSt1GeometryBuilderV2.cxx b/MUON/AliMUONSt1GeometryBuilderV2.cxx index b2049b48946..12cf8253d76 100644 --- a/MUON/AliMUONSt1GeometryBuilderV2.cxx +++ b/MUON/AliMUONSt1GeometryBuilderV2.cxx @@ -33,7 +33,6 @@ #include "AliMpSegmentation.h" #include "AliMpDEManager.h" -#include "AliMpContainers.h" #include "AliMpConstants.h" #include "AliMpCDB.h" #include "AliMpSector.h" @@ -60,14 +59,7 @@ #include #include #include - -#ifdef WITH_STL - #include -#endif - -#ifdef WITH_ROOT - #include "TArrayI.h" -#endif +#include /// \cond CLASSIMP ClassImp(AliMUONSt1GeometryBuilderV2) @@ -1976,14 +1968,8 @@ void AliMUONSt1GeometryBuilderV2::PlaceSector(const AliMpSector* sector, GReal_t posX,posY,posZ; -#ifdef WITH_STL - vector alreadyDone; -#endif - -#ifdef WITH_ROOT TArrayI alreadyDone(20); Int_t nofAlreadyDone = 0; -#endif for (Int_t irow=0;irowGetNofRows();irow++){ // for each row AliMpRow* row = sector->GetRow(irow); @@ -2035,12 +2021,6 @@ void AliMUONSt1GeometryBuilderV2::PlaceSector(const AliMpSector* sector, Int_t motifPosId = seg->GetMotifPositionId(motifNum); -#ifdef WITH_STL - if (find(alreadyDone.begin(),alreadyDone.end(),motifPosId) - != alreadyDone.end()) continue; // don't treat the same motif twice - -#endif -#ifdef WITH_ROOT Bool_t isDone = false; Int_t i=0; while (iGspos(fgkDaughterName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY"); -#ifdef WITH_STL - alreadyDone.push_back(motifPosId);// mark this motif as done -#endif -#ifdef WITH_ROOT if (nofAlreadyDone == alreadyDone.GetSize()) alreadyDone.Set(2*nofAlreadyDone); alreadyDone.AddAt(motifPosId, nofAlreadyDone++); -#endif + AliDebugStream(2) << chamber << " processed motifPosId: " << motifPosId << endl; } // COMMENT OUT END diff --git a/MUON/AliMUONSt1GeometryBuilderV2.h b/MUON/AliMUONSt1GeometryBuilderV2.h index a9e4b467620..72c161f4369 100644 --- a/MUON/AliMUONSt1GeometryBuilderV2.h +++ b/MUON/AliMUONSt1GeometryBuilderV2.h @@ -16,14 +16,8 @@ #include "AliMUONVGeometryBuilder.h" -#include "AliMpContainers.h" - #include -#ifdef WITH_STL - #include -#endif - // typedef Float_t GReal_t; // for AliGeant3 typedef Double_t GReal_t; // for VirtualMC diff --git a/MUON/MUONmappingLinkDef.h b/MUON/MUONmappingLinkDef.h index 6f4810413b8..7db7ae7ea0e 100644 --- a/MUON/MUONmappingLinkDef.h +++ b/MUON/MUONmappingLinkDef.h @@ -142,12 +142,3 @@ #pragma link C++ class AliMpPCBPainter+; #pragma link C++ class AliMpDEVisu+; #pragma link C++ class AliMpIteratorPainter+; - -#ifdef WITH_STL -#pragma link C++ class std::pair+; -#pragma link C++ class std::pair+; -#pragma link C++ class std::pair+; -#pragma link C++ class std::pair+; -#pragma link C++ class std::pair+; -#pragma link C++ class std::pair+; -#endif diff --git a/MUON/mapping/AliMpGraphContext.cxx b/MUON/mapping/AliMpGraphContext.cxx index 6fc1410c811..bbd96ba5ca4 100755 --- a/MUON/mapping/AliMpGraphContext.cxx +++ b/MUON/mapping/AliMpGraphContext.cxx @@ -32,12 +32,9 @@ ClassImp(AliMpGraphContext) /// \endcond -AliMpGraphContext *AliMpGraphContext::fgInstance = 0; -AliMpGraphContext::GraphContextVector AliMpGraphContext::fgStack; - -#ifdef WITH_ROOT +AliMpGraphContext* AliMpGraphContext::fgInstance = 0; +TObjArray AliMpGraphContext::fgStack; Int_t AliMpGraphContext::fgStackSize = 0; -#endif //_____________________________________________________________________________ AliMpGraphContext::AliMpGraphContext(): @@ -144,13 +141,7 @@ void AliMpGraphContext::Push() const AliMpGraphContext *save = new AliMpGraphContext(*this); -#ifdef WITH_STL - fgStack.push_back(save); -#endif - -#ifdef WITH_ROOT fgStack.AddAt(save, fgStackSize++); -#endif } //_____________________________________________________________________________ @@ -158,17 +149,6 @@ void AliMpGraphContext::Pop() { /// Pop an object from the stack. -#ifdef WITH_STL - // restore the last saved configuration - if (!fgStack.empty()){ - AliMpGraphContext *obj = fgStack.back(); - *this = *obj; - fgStack.pop_back(); - delete obj; - } -#endif - -#ifdef WITH_ROOT // restore the last saved configuration if ( fgStackSize ){ AliMpGraphContext *obj @@ -177,5 +157,4 @@ void AliMpGraphContext::Pop() fgStack.RemoveAt(fgStackSize); delete obj; } -#endif } diff --git a/MUON/mapping/AliMpGraphContext.h b/MUON/mapping/AliMpGraphContext.h index 7d34b20b113..23fd27f0b65 100755 --- a/MUON/mapping/AliMpGraphContext.h +++ b/MUON/mapping/AliMpGraphContext.h @@ -16,31 +16,14 @@ #include -#include "AliMpContainers.h" - -#include -#ifdef WITH_ROOT #include "AliMpExMap.h" -#endif -#ifdef WITH_STL -#include -#endif +#include class MPainter; class AliMpGraphContext : public TObject { - public: -#ifdef WITH_STL - /// GraphContextVector type - typedef std::vector GraphContextVector; -#endif -#ifdef WITH_ROOT - /// GraphContextVector type - typedef TObjArray GraphContextVector; -#endif - public: void Push() const; void Pop(); @@ -92,11 +75,9 @@ class AliMpGraphContext : public TObject AliMpGraphContext(); ///< static data members - static AliMpGraphContext *fgInstance; ///< the global instance - static GraphContextVector fgStack; ///< the object stack -#ifdef WITH_ROOT - static Int_t fgStackSize; ///< the object stack size -#endif + static AliMpGraphContext* fgInstance; ///< the global instance + static TObjArray fgStack; ///< the object stack + static Int_t fgStackSize;///< the object stack size //data members Int_t fColor; ///< color to use diff --git a/MUON/mapping/AliMpMotifMap.cxx b/MUON/mapping/AliMpMotifMap.cxx index c5a1d40a2dc..12903973564 100755 --- a/MUON/mapping/AliMpMotifMap.cxx +++ b/MUON/mapping/AliMpMotifMap.cxx @@ -56,32 +56,20 @@ AliMpMotifMap::AliMpMotifMap() { /// Standard constructor -#ifdef WITH_ROOT fMotifPositions2.SetOwner(false); -#endif } //_____________________________________________________________________________ AliMpMotifMap::AliMpMotifMap(TRootIOCtor* ioCtor) : TObject(), -#ifdef WITH_STL - fMotifs(), - fMotifTypes(), - fMotifPositions(), - fMotifPositions2() -#endif -#ifdef WITH_ROOT fMotifs(ioCtor), fMotifTypes(ioCtor), fMotifPositions(ioCtor), fMotifPositions2(ioCtor) -#endif { /// Root IO constructor -#ifdef WITH_ROOT fMotifPositions2.SetOwner(false); -#endif } //_____________________________________________________________________________ @@ -90,23 +78,6 @@ AliMpMotifMap::~AliMpMotifMap() /// Destructor // Delete all registered motifs, motif types, motif positions - -#ifdef WITH_STL - for (MotifMapIterator im=fMotifs.begin(); im != fMotifs.end(); im++) { - delete im->second; - } - - for (MotifTypeMapIterator it=fMotifTypes.begin(); - it != fMotifTypes.end(); it++) { - delete it->second; - } - - for (MotifPositionMapIterator ip=fMotifPositions.begin(); - ip != fMotifPositions.end(); ip++) { - delete ip->second; - } -#endif - } // @@ -165,23 +136,6 @@ void AliMpMotifMap::PrintMotifs() const /// Print all the motifs and their motif types /// for all motifs in the motifs map. -#ifdef WITH_STL - if (fMotifs.size()) { - cout << "Dump of Motif Map - " << fMotifs.size() << " entries:" << endl; - Int_t counter = 0; - for (MotifMapIterator i=fMotifs.begin(); i != fMotifs.end(); i++) { - const TString& id = (*i).first; - cout << "Map element " - << setw(3) << counter++ << " " - << id.Data() << " " ; - PrintMotif((*i).second); - cout << endl; - } - cout << endl; - } -#endif - -#ifdef WITH_ROOT if (fMotifs.GetSize()) { cout << "Dump of Motif Map - " << fMotifs.GetSize() << " entries:" << endl; Int_t counter = 0; @@ -201,7 +155,6 @@ void AliMpMotifMap::PrintMotifs() const cout << endl; delete it; } -#endif } //_____________________________________________________________________________ @@ -210,23 +163,6 @@ void AliMpMotifMap::PrintMotifTypes() const /// Print all the the motifs types and their motif dimensions /// for all motif types in the motif types map. -#ifdef WITH_STL - if (fMotifTypes.size()) { - cout << "Dump of Motif Type Map - " << fMotifTypes.size() << " entries:" << endl; - Int_t counter = 0; - for (MotifTypeMapIterator i=fMotifTypes.begin(); i != fMotifTypes.end(); i++) { - const TString& id = (*i).first; - cout << "Map element " - << setw(3) << counter++ << " " - << id.Data() << " "; - PrintMotifType((*i).second); - cout << endl; - } - cout << endl; - } -#endif - -#ifdef WITH_ROOT if (fMotifTypes.GetSize()) { cout << "Dump of Motif Type Map - " << fMotifTypes.GetSize() << " entries:" << endl; Int_t counter = 0; @@ -246,7 +182,6 @@ void AliMpMotifMap::PrintMotifTypes() const cout << endl; delete it; } -#endif } //_____________________________________________________________________________ @@ -256,17 +191,6 @@ AliMpMotifMap::GetAllMotifPositionsIDs(TArrayI& ecn) const /// Fill the given array with all motif positions IDs (electronic card numbers) /// defined in the map -#ifdef WITH_STL - ecn.Set(fMotifPositions.size()); - Int_t i(0); - MotifPositionMapIterator it; - for (it=fMotifPositions.begin(); it != fMotifPositions.end(); it++) { - AliMpMotifPosition* motifPosition = (*it).second; - ecn[i++] = motifPosition->GetID(); - } -#endif - -#ifdef WITH_ROOT ecn.Set(fMotifPositions.GetSize()); TIter next(fMotifPositions.CreateIterator()); AliMpMotifPosition* motifPosition; @@ -276,7 +200,6 @@ AliMpMotifMap::GetAllMotifPositionsIDs(TArrayI& ecn) const ecn[i] = motifPosition->GetID(); ++i; } -#endif } //_____________________________________________________________________________ @@ -284,13 +207,7 @@ UInt_t AliMpMotifMap::GetNofMotifPositions() const { /// Return the number of all motif positions IDs (electronic card numbers) -#ifdef WITH_STL - return fMotifPositions.size(); -#endif - -#ifdef WITH_ROOT return fMotifPositions.GetSize(); -#endif } //_____________________________________________________________________________ @@ -305,17 +222,9 @@ AliMpMotifPosition* AliMpMotifMap::GetMotifPosition(UInt_t index) const return 0; } -#ifdef WITH_STL - MotifPositionMapIterator it = fMotifPositions.begin(); - std::advance(it, index); - return it->second; -#endif - -#ifdef WITH_ROOT TIter next(fMotifPositions.CreateIterator()); while (index-- > 0) next(); return static_cast(next()); -#endif } //_____________________________________________________________________________ @@ -325,22 +234,12 @@ Int_t AliMpMotifMap::CalculateNofPads() const Int_t nofPads = 0; -#ifdef WITH_STL - MotifPositionMapIterator it; - for (it=fMotifPositions.begin(); it != fMotifPositions.end(); it++) { - AliMpMotifPosition* motifPosition = (*it).second; - nofPads += motifPosition->GetMotif()->GetMotifType()->GetNofPads(); - } -#endif - -#ifdef WITH_ROOT TIter next(fMotifPositions.CreateIterator()); AliMpMotifPosition* motifPosition; while ( ( motifPosition = static_cast(next()) ) ) { nofPads += motifPosition->GetMotif()->GetMotifType()->GetNofPads(); } -#endif return nofPads; } @@ -350,23 +249,6 @@ void AliMpMotifMap::PrintMotifPositions() const { /// Print all motif positions. -#ifdef WITH_STL - if (fMotifPositions.size()) { - cout << "Dump of Motif Position Map - " << fMotifPositions.size() << " entries:" << endl; - Int_t counter = 0; - for (MotifPositionMapIterator i=fMotifPositions.begin(); - i != fMotifPositions.end(); i++) { - - cout << "Map element " - << setw(3) << counter++ << " "; - PrintMotifPosition((*i).second); - cout << endl; - } - cout << endl; - } -#endif - -#ifdef WITH_ROOT if (fMotifPositions.GetSize()) { cout << "Dump of Motif Position Map - " << fMotifPositions.GetSize() << " entries:" << endl; Int_t counter = 0; @@ -382,7 +264,6 @@ void AliMpMotifMap::PrintMotifPositions() const } cout << endl; } -#endif } //_____________________________________________________________________________ @@ -391,24 +272,6 @@ void AliMpMotifMap::PrintMotifPositions2() const /// Print all motif positions from the second map /// (by global indices) -#ifdef WITH_STL - if (fMotifPositions2.size()) { - cout << "Dump of Motif Position Map 2 - " << fMotifPositions2.size() << " entries:" << endl; - Int_t counter = 0; - for (MotifPositionMap2Iterator i=fMotifPositions2.begin(); - i != fMotifPositions2.end(); i++) { - - cout << "Map element " - << setw(3) << counter++ << " "; - PrintMotifPosition2((*i).second); - cout << endl; - } - cout << endl; - } -#endif - -#ifdef WITH_ROOT - if (fMotifPositions2.GetSize()) { cout << "Dump of Motif Position Map 2 - " << fMotifPositions2.GetSize() << " entries:" << endl; @@ -424,7 +287,6 @@ void AliMpMotifMap::PrintMotifPositions2() const } cout << endl; } -#endif } // @@ -449,13 +311,7 @@ Bool_t AliMpMotifMap::AddMotif(AliMpVMotif* motif, Bool_t warn) return false; } -#ifdef WITH_STL - fMotifs[motif->GetID()] = motif; -#endif - -#ifdef WITH_ROOT fMotifs.Add(motif->GetID(), motif); -#endif return true; } @@ -478,13 +334,7 @@ Bool_t AliMpMotifMap::AddMotifType(AliMpMotifType* motifType, Bool_t warn) return false; } -#ifdef WITH_STL - fMotifTypes[motifType->GetID()] = motifType; -#endif - -#ifdef WITH_ROOT fMotifTypes.Add(motifType->GetID(), motifType); -#endif return true; } @@ -517,13 +367,7 @@ Bool_t AliMpMotifMap::AddMotifPosition(AliMpMotifPosition* motifPosition, Bool_t return false; } -#ifdef WITH_STL - fMotifPositions[motifPosition->GetID()] = motifPosition; -#endif - -#ifdef WITH_ROOT fMotifPositions.Add(motifPosition->GetID() << 16, motifPosition); -#endif return true; } @@ -533,20 +377,6 @@ void AliMpMotifMap::FillMotifPositionMap2() { /// Fill the second map (by global indices) of motif positions. -#ifdef WITH_STL - if (fMotifPositions2.size() > 0 ) { - AliWarningStream() << "Map has been already filled." << endl; - return; - } - - for (MotifPositionMapIterator ip=fMotifPositions.begin(); - ip != fMotifPositions.end(); ip++) { - - fMotifPositions2[(*ip).second->GetLowIndicesLimit()] = (*ip).second; - } -#endif - -#ifdef WITH_ROOT if (fMotifPositions2.GetSize() > 0 ) { AliWarningStream() <<"Map has been already filled." << endl; return; @@ -558,8 +388,6 @@ void AliMpMotifMap::FillMotifPositionMap2() { fMotifPositions2.Add(motifPosition->GetLowIndicesLimit(), motifPosition); } -#endif - } //_____________________________________________________________________________ @@ -584,22 +412,6 @@ void AliMpMotifMap::PrintGlobalIndices(const char* fileName) const ofstream out(fileName, ios::out); -#ifdef WITH_STL - if (fMotifPositions.size()) { - for (MotifPositionMapIterator i=fMotifPositions.begin(); - i != fMotifPositions.end(); i++) { - - AliMpMotifPosition* motifPosition = (*i).second; - out << setw(5) << motifPosition->GetID() << " " - << setw(3) << motifPosition->GetLowIndicesLimit().GetFirst() << " " - << setw(3) << motifPosition->GetLowIndicesLimit().GetSecond() - << endl; - } - out << endl; - } -#endif - -#ifdef WITH_ROOT if (fMotifPositions.GetSize()) { TIter next(fMotifPositions.CreateIterator()); AliMpMotifPosition* motifPosition; @@ -612,7 +424,6 @@ void AliMpMotifMap::PrintGlobalIndices(const char* fileName) const } out << endl; } -#endif } //_____________________________________________________________________________ @@ -665,17 +476,7 @@ AliMpVMotif* AliMpMotifMap::FindMotif(const TString& motifID) const //AliCodeTimerAuto(""); -#ifdef WITH_STL - MotifMapIterator i = fMotifs.find(motifID); - if (i != fMotifs.end()) - return (*i).second; - else - return 0; -#endif - -#ifdef WITH_ROOT return (AliMpVMotif*)fMotifs.GetValue(motifID); -#endif } //_____________________________________________________________________________ @@ -728,17 +529,7 @@ AliMpMotifType* AliMpMotifMap::FindMotifType(const TString& motifTypeID) const //AliCodeTimerAuto(""); -#ifdef WITH_STL - MotifTypeMapIterator i = fMotifTypes.find(motifTypeID); - if (i != fMotifTypes.end()) - return (*i).second; - else - return 0; -#endif - -#ifdef WITH_ROOT return (AliMpMotifType*)fMotifTypes.GetValue(motifTypeID); -#endif } //_____________________________________________________________________________ @@ -749,55 +540,5 @@ AliMpMotifMap::FindMotifPosition(Int_t motifPositionID) const //AliCodeTimerAuto(""); -#ifdef WITH_STL - MotifPositionMapIterator i = fMotifPositions.find(motifPositionID); - if (i != fMotifPositions.end()) - return (*i).second; - else - return 0; -#endif - -#ifdef WITH_ROOT return (AliMpMotifPosition*)fMotifPositions.GetValue(motifPositionID << 16); -#endif -} - -/* -//_____________________________________________________________________________ -AliMpMotifPosition* -AliMpMotifMap::FindMotifPosition(const AliMpIntPair& indices) const -{ -/// Find the last motif position which has the global indices (low limit) -/// less then the indices specified. - -#ifdef WITH_STL - MotifPositionMap2Iterator found - = fMotifPositions2.lower_bound(indices); - - if (found == fMotifPositions2.end()) found--; - - MotifPositionMap2Iterator i=found; - do { - AliMpIntPair low = (*i).second->GetLowIndicesLimit(); - AliMpIntPair up = (*i).second->GetHighIndicesLimit(); - - if ( indices.GetFirst() >= low.GetFirst() && - indices.GetSecond() >= low.GetSecond() && - indices.GetFirst() <= up.GetFirst() && - indices.GetSecond() <= up.GetSecond()) - - return (*i).second; - } - while ( i-- != fMotifPositions2.begin()); - - return 0; -#endif - -#ifdef WITH_ROOT - // HOW TO DO THIS WITH ROOT ???? - // Fortunately it seems not to be used anywhere - Fatal("FindMotifPosition", "Difficult in Root to do this."); - return 0; -#endif } -*/ diff --git a/MUON/mapping/AliMpMotifMap.h b/MUON/mapping/AliMpMotifMap.h index d6de9df7653..a96579df3a0 100755 --- a/MUON/mapping/AliMpMotifMap.h +++ b/MUON/mapping/AliMpMotifMap.h @@ -21,20 +21,7 @@ #include -#include "AliMpContainers.h" - -#ifdef WITH_STL -#include "AliMpIntPair.h" -#endif - -#ifdef WITH_ROOT #include "AliMpExMap.h" -#endif - -#ifdef WITH_STL -#include -#include -#endif class AliMpVMotif; class AliMpMotifType; @@ -47,36 +34,6 @@ class TVector2; class AliMpMotifMap : public TObject { - public: -#ifdef WITH_STL - /// Motif map type - typedef std::map MotifMap; - /// Motif map iterator type - typedef MotifMap::const_iterator MotifMapIterator; - /// Motif type map type - typedef std::map MotifTypeMap; - /// Motif type map iterator type - typedef MotifTypeMap::const_iterator MotifTypeMapIterator; - /// Motif position map to int type - typedef std::map MotiPositionMap; - /// Motif position map to int iterator type - typedef MotiPositionMap::const_iterator MotifPositionMapIterator; - /// Motif position map to int pair type - typedef std::map MotifPositionMap2; - /// Motif position map to int pair iterator type - typedef MotifPositionMap2::const_iterator MotifPositionMap2Iterator; -#endif -#ifdef WITH_ROOT - /// Motif map type - typedef AliMpExMap MotifMap; - /// Motif type map type - typedef AliMpExMap MotifTypeMap; - /// Motif position map to int type - typedef AliMpExMap MotifPositionMap; - /// Motif position map to int pair iterator type - typedef AliMpExMap MotifPositionMap2; -#endif - public: AliMpMotifMap(); AliMpMotifMap(TRootIOCtor* ioCtor); @@ -123,15 +80,10 @@ class AliMpMotifMap : public TObject void PrintMotifPositions2() const; // data members - MotifMap fMotifs; ///< motifs map - MotifTypeMap fMotifTypes; ///< motifs types map -#ifdef WITH_STL - std::map fMotifPositions; ///< motif positions map by Id -#endif -#ifdef WITH_ROOT - MotifPositionMap fMotifPositions; ///< motifs positions map -#endif - MotifPositionMap2 fMotifPositions2;///< motifs positions map + AliMpExMap fMotifs; ///< motifs map + AliMpExMap fMotifTypes; ///< motifs types map + AliMpExMap fMotifPositions; ///< motifs positions map + AliMpExMap fMotifPositions2;///< motifs positions map ClassDef(AliMpMotifMap,1) // motif map }; diff --git a/MUON/mapping/AliMpMotifReader.cxx b/MUON/mapping/AliMpMotifReader.cxx index 7faafe59340..11bf503cc0b 100644 --- a/MUON/mapping/AliMpMotifReader.cxx +++ b/MUON/mapping/AliMpMotifReader.cxx @@ -99,7 +99,7 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId) AliMpMotifType* motifType = new AliMpMotifType(motifTypeId); - PadMapType positions; + TExMap positions; char line[256]; do { @@ -119,14 +119,8 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId) int i,j; strline>>i>>j; -#ifdef WITH_STL - positions[key].first=i; - positions[key].second=j; -#endif -#ifdef WITH_ROOT positions.Add( AliMpExMap::GetIndex(key), AliMpExMap::GetIndex(AliMpIntPair(i,j)) ); -#endif } while (!padPosStream.eof()); const Int_t knbergpins = @@ -201,21 +195,6 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId) gassiNum = gassiChannel[numBerg-1]; -#ifdef WITH_STL - PadMapTypeIterator iter = positions.find(padName); - if (iter==positions.end()) { - AliWarningStream() - << "Problem: Pad number " << padNum - << " for motif type " << motifTypeId.Data() - << " found in the motifType stream, but not in the padPos stream" << endl; - continue; - } - - ix= iter->second.first; - iy= iter->second.second; -#endif - -#ifdef WITH_ROOT Long_t value = positions.GetValue(AliMpExMap::GetIndex(padName)); if (!value) { AliWarningStream() @@ -227,8 +206,6 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId) ix = AliMpExMap::GetPair(value).GetFirst(); iy = AliMpExMap::GetPair(value).GetSecond(); - -#endif AliMpConnection* connection = new AliMpConnection(padNum,numBerg,numKapton,gassiNum, AliMpIntPair(ix,iy)); diff --git a/MUON/mapping/AliMpMotifReader.h b/MUON/mapping/AliMpMotifReader.h index aad229fba42..62e76892dc4 100644 --- a/MUON/mapping/AliMpMotifReader.h +++ b/MUON/mapping/AliMpMotifReader.h @@ -15,25 +15,17 @@ #include -#include "AliMpContainers.h" - #include "AliMpStationType.h" #include "AliMpStation12Type.h" #include "AliMpPlaneType.h" #include "AliMpIntPair.h" -#include "AliMpContainers.h" -#ifdef WITH_ROOT #include -#endif #include #include #include #include -#ifdef WITH_STL -#include -#endif class AliMpMotifMap; class AliMpVMotif; @@ -43,18 +35,6 @@ class AliMpDataStreams; class AliMpMotifReader : public TObject { - public: -#ifdef WITH_STL - /// Map of int pair to string - typedef std::map > PadMapType; - /// Map of int pair to string iterator - typedef PadMapType::iterator PadMapTypeIterator; -#endif -#ifdef WITH_ROOT - /// Map of int pair to string - typedef TExMap PadMapType; -#endif - public: AliMpMotifReader(const AliMpDataStreams& dataStreams, AliMp::StationType station, diff --git a/MUON/mapping/AliMpMotifSpecial.cxx b/MUON/mapping/AliMpMotifSpecial.cxx index a8e900f86fe..3f79ed7f9ff 100755 --- a/MUON/mapping/AliMpMotifSpecial.cxx +++ b/MUON/mapping/AliMpMotifSpecial.cxx @@ -34,6 +34,7 @@ #include "AliLog.h" #include +#include /// \cond CLASSIMP ClassImp(AliMpMotifSpecial) @@ -50,22 +51,13 @@ AliMpMotifSpecial::AliMpMotifSpecial(const TString &id, { /// Standard constructor. - -#ifdef WITH_STL - fPadDimensionsVector.resize(motifType->GetNofPadsX()*motifType->GetNofPadsY()); -#endif } //______________________________________________________________________________ AliMpMotifSpecial::AliMpMotifSpecial(TRootIOCtor* ioCtor): AliMpVMotif(), fDimensions(), -#ifdef WITH_STL - fPadDimensionsVector(), -#endif -#ifdef WITH_ROOT fPadDimensionsVector(ioCtor), -#endif fPadDimensionsVector2() { /// Root IO constructor @@ -96,7 +88,6 @@ Int_t AliMpMotifSpecial::VectorIndex(const AliMpIntPair& indices) const // public methods // -#include //______________________________________________________________________________ TVector2 AliMpMotifSpecial::GetPadDimensions(const AliMpIntPair& localIndices) const @@ -104,17 +95,12 @@ AliMpMotifSpecial::GetPadDimensions(const AliMpIntPair& localIndices) const /// Return the dimensions of pad located at the given indices if (GetMotifType()->HasPadByLocalIndices(localIndices)) { -#ifdef WITH_STL - return fPadDimensionsVector[VectorIndex(localIndices)]; -#endif -#ifdef WITH_ROOT 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"); @@ -127,13 +113,7 @@ Int_t AliMpMotifSpecial::GetNofPadDimensions() const { /// Return number of different pad dimensions in this motif -#ifdef WITH_STL - return fPadDimensionsVector2.size(); -#endif - -#ifdef WITH_ROOT return fPadDimensionsVector2.GetEntriesFast(); -#endif } //______________________________________________________________________________ @@ -146,13 +126,7 @@ TVector2 AliMpMotifSpecial::GetPadDimensions(Int_t i) const return TVector2(); } -#ifdef WITH_STL - return fPadDimensionsVector2[i]; -#endif - -#ifdef WITH_ROOT return *((TVector2*) fPadDimensionsVector2[i]); -#endif } //______________________________________________________________________________ @@ -281,21 +255,6 @@ void AliMpMotifSpecial::SetPadDimensions(const AliMpIntPair& localIndices, } // fill the dimensions map vector -#ifdef WITH_STL - fPadDimensionsVector[VectorIndex(localIndices)]=dimensions; - - // fill the vector of different pad dimensions - // only if these dimensions are not yet present - Bool_t isPresent = false; - for (Int_t i=0; i -#ifdef WITH_ROOT #include -#endif - -#ifdef WITH_STL -#include -#endif class TString; class AliMpMotifSpecial : public AliMpVMotif { - public: -#ifdef WITH_STL - /// Dimensions map type - typedef std::vector< TVector2 > DimensionsMap; - /// Dimensions map iterator type - typedef std::vector< TVector2 > DimensionsMap2; -#endif -#ifdef WITH_ROOT - /// Dimensions map type - typedef AliMpExMap DimensionsMap; - /// Dimensions map iterator type - typedef TObjArray DimensionsMap2; -#endif - public: AliMpMotifSpecial(const TString &id, AliMpMotifType *motifType); AliMpMotifSpecial(TRootIOCtor* ioCtor); @@ -76,9 +52,9 @@ class AliMpMotifSpecial : public AliMpVMotif Int_t VectorIndex(const AliMpIntPair& indices) const; // data members - TVector2 fDimensions; ///< motif dimensions - DimensionsMap fPadDimensionsVector; ///< the vector of pad dimensions - DimensionsMap2 fPadDimensionsVector2; ///< the vector of different pad dimensions + TVector2 fDimensions; ///< motif dimensions + AliMpExMap fPadDimensionsVector; ///< the vector of pad dimensions + TObjArray fPadDimensionsVector2; ///< the vector of different pad dimensions ClassDef(AliMpMotifSpecial,2) // A motif with its ID }; diff --git a/MUON/mapping/AliMpMotifType.h b/MUON/mapping/AliMpMotifType.h index 3be991e03f3..61d13ff65b0 100755 --- a/MUON/mapping/AliMpMotifType.h +++ b/MUON/mapping/AliMpMotifType.h @@ -15,11 +15,10 @@ #include -#include "AliMpContainers.h" - #include "AliMpIntPair.h" + #ifndef ROOT_TObjArray -# include "TObjArray.h" +# include #endif #include diff --git a/MUON/mapping/AliMpNeighboursPadIterator.cxx b/MUON/mapping/AliMpNeighboursPadIterator.cxx index ad40864b79c..a80eb4fcf82 100755 --- a/MUON/mapping/AliMpNeighboursPadIterator.cxx +++ b/MUON/mapping/AliMpNeighboursPadIterator.cxx @@ -88,9 +88,7 @@ AliMpNeighboursPadIterator::~AliMpNeighboursPadIterator() { /// Destructor -#ifdef WITH_ROOT fPads.Delete(); -#endif } // operators @@ -102,7 +100,6 @@ AliMpNeighboursPadIterator::operator = (const AliMpNeighboursPadIterator& right) /// Assignment operator. \n /// If the right hand iterator isn't of a good type /// the current operator is invalidated \n -/// Not provided for WITH_ROOT option. // check assignment to self if (this == &right) return *this; @@ -110,15 +107,7 @@ AliMpNeighboursPadIterator::operator = (const AliMpNeighboursPadIterator& right) // base class assignment AliMpVPadIterator::operator=(right); -#ifdef WITH_STL - fkSegmentation = right.fkSegmentation; - fCenterPad = right.fCenterPad; - fPads = right.fPads; - fIndex = right.fIndex; -#endif -#ifdef WITH_ROOT AliFatal("Not allowed assignment for TObjArray"); -#endif return *this; } @@ -142,9 +131,8 @@ Bool_t AliMpNeighboursPadIterator::IsNeighbour(const AliMpPad& pad) const } -#ifdef WITH_STL //______________________________________________________________________________ -AliMpNeighboursPadIterator::PadVector +TObjArray* AliMpNeighboursPadIterator::PadVectorLine(const AliMpPad& from, const AliMpIntPair& direction) const { @@ -153,44 +141,7 @@ AliMpNeighboursPadIterator::PadVectorLine(const AliMpPad& from, /// starting from \a from and moving by \a direction AliMpPad current = from; - PadVector ans; - Bool_t cont=kTRUE; - do { - if (IsNeighbour(current)) - ans.push_back(current); - else - cont=kFALSE; - TVector2 nextPos = current.Position() + TVector2( - current.Dimensions().X()*(AliMpConstants::LengthStep()+1.)*direction.GetFirst(), - current.Dimensions().Y()*(AliMpConstants::LengthStep()+1.)*direction.GetSecond()); - current = fkSegmentation->PadByPosition(nextPos, false); - } while (cont); - return ans; -} - -//______________________________________________________________________________ -void AliMpNeighboursPadIterator::UpdateTotalSet(PadSet& setTotal, - const PadVector& from) const -{ -/// Add pads from pad vector to the total set -/// only if they are not yet included - - setTotal.insert(from.begin(),from.end()); -} - -#endif -#ifdef WITH_ROOT -//______________________________________________________________________________ -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 \a fCenterPad, in a given line -/// starting from \a from and moving by \a direction - - AliMpPad current = from; - PadVector* ans = new PadVector(); + TObjArray* ans = new TObjArray(); Bool_t cont=kTRUE; do { if (IsNeighbour(current)) @@ -206,8 +157,8 @@ AliMpNeighboursPadIterator::PadVectorLine(const AliMpPad& from, } //______________________________________________________________________________ -void AliMpNeighboursPadIterator::UpdateTotalSet(PadSet& setTotal, - PadVector* from) const +void AliMpNeighboursPadIterator::UpdateTotalSet(TObjArray& setTotal, + TObjArray* from) const { /// Add pads from pad vector to the total set /// only if they are not yet included and deletes the pad vector @@ -232,8 +183,6 @@ void AliMpNeighboursPadIterator::UpdateTotalSet(PadSet& setTotal, delete from; } -#endif - //______________________________________________________________________________ void AliMpNeighboursPadIterator::FillPadsVector(Bool_t includeCenter) { @@ -245,16 +194,11 @@ void AliMpNeighboursPadIterator::FillPadsVector(Bool_t includeCenter) AliMpPad from; AliMpIntPair direction; -#ifdef WITH_STL - PadVector found; -#endif -#ifdef WITH_ROOT - PadVector* found; -#endif + TObjArray* found; // repare a unique simple associative container // --> no doublons, rapid insersion - PadSet setTotal; + TObjArray setTotal; ///////////// Left side @@ -323,25 +267,12 @@ void AliMpNeighboursPadIterator::FillPadsVector(Bool_t includeCenter) // fill the fIndices vector with the set (-->pass from a rapid insertion, // to rapid and indexed access, for the rest of the job) -#ifdef WITH_STL - fPads.clear(); - // include the center pad if requiered - if (includeCenter) fPads.push_back(fCenterPad); - //fPads.insert(fPads.end(),setTotal.begin(),setTotal.end()); - - PadSetCIterator it; - for (it = setTotal.begin(); it != setTotal.end(); it++) - fPads.push_back((*it)); -#endif - -#ifdef WITH_ROOT fPads.Delete(); // include the center pad if requiered if (includeCenter) fPads.Add(new AliMpPad(fCenterPad)); for (Int_t i = 0; i -#endif - -#ifdef WITH_STL -#include -#include -#endif class AliMpVSegmentation; class AliMpIntPair; class AliMpNeighboursPadIterator : public AliMpVPadIterator { - public: -#ifdef WITH_STL - /// Pad vector type - typedef std::vector PadVector; - /// Pad set type - typedef std::set PadSet; - /// Pad set iterator type - typedef PadSet::const_iterator PadSetCIterator; -#endif -#ifdef WITH_ROOT - /// Pad vector type - typedef TObjArray PadVector; - /// Pad set type - typedef TObjArray PadSet; -#endif - public: AliMpNeighboursPadIterator(); AliMpNeighboursPadIterator(const AliMpVSegmentation* segmentation, @@ -72,25 +47,18 @@ class AliMpNeighboursPadIterator : public AliMpVPadIterator static const UInt_t fgkInvalidIndex; ///< invalid index number // private methods - Bool_t IsNeighbour(const AliMpPad& pad) const; -#ifdef WITH_STL - PadVector PadVectorLine(const AliMpPad& from, - const AliMpIntPair& direction) const; - void UpdateTotalSet(PadSet& setTotal, const PadVector& from) const; -#endif -#ifdef WITH_ROOT - PadVector* PadVectorLine(const AliMpPad& from, + Bool_t IsNeighbour(const AliMpPad& pad) const; + TObjArray* PadVectorLine(const AliMpPad& from, const AliMpIntPair& direction) const; - void UpdateTotalSet(PadSet& setTotal, PadVector* from) const; -#endif - void FillPadsVector(Bool_t includeCenter); - Bool_t IsValid() const; + void UpdateTotalSet(TObjArray& setTotal, TObjArray* from) const; + void FillPadsVector(Bool_t includeCenter); + Bool_t IsValid() const; // private data members const AliMpVSegmentation* fkSegmentation; ///< \brief The segmentation /// segmentation over which to iterate AliMpPad fCenterPad; ///< Pad arround which we iterate - PadVector fPads; ///< The list of pad arround fCenterIndices + TObjArray fPads; ///< The list of pad arround fCenterIndices UInt_t fIndex; ///< Current index inside the fPads vector ClassDef(AliMpNeighboursPadIterator,1) // iterator over motif's pads diff --git a/MUON/mapping/AliMpPCB.cxx b/MUON/mapping/AliMpPCB.cxx index 9ddb95bbf35..d4905f426ac 100644 --- a/MUON/mapping/AliMpPCB.cxx +++ b/MUON/mapping/AliMpPCB.cxx @@ -77,9 +77,7 @@ AliMpPCB::AliMpPCB() /// /// Default ctor. /// -#ifdef WITH_ROOT fMotifPositions.SetOwner(kTRUE); -#endif AliDebug(1,Form("this=%p",this)); } @@ -107,9 +105,7 @@ AliMpPCB::AliMpPCB(AliMpSlatMotifMap* motifMap, const char* id, Double_t padSize /// Normal ctor. Must be fed with the PCB's name (id), the pad dimensions /// and the global dimension of the virtual enveloppe of the PCB /// (usually 400x400 mm) -#ifdef WITH_ROOT fMotifPositions.SetOwner(kTRUE); -#endif AliDebug(1,Form("this=%p id=%s",this,id)); } @@ -135,9 +131,8 @@ AliMpPCB::AliMpPCB(const AliMpPCB& o) /// /// Copy constructor -#ifdef WITH_ROOT - fMotifPositions.SetOwner(kTRUE); -#endif + fMotifPositions.SetOwner(kTRUE); + AliDebug(1,Form("this=%p (copy ctor) : begin",this)); o.Copy(*this); AliDebug(1,Form("this=%p (copy ctor) : end",this)); @@ -173,18 +168,13 @@ AliMpPCB::AliMpPCB(const char* id, AliMpMotifSpecial* ms) AliDebug(1,Form("this=%p (ctor special motif)",this)); -#ifdef WITH_ROOT fMotifPositions.SetOwner(kTRUE); -#endif + TVector2 position(ms->Dimensions()); AliMpMotifPosition* mp = new AliMpMotifPosition(-1,ms,position); mp->SetLowIndicesLimit(AliMpIntPair(fIxmin,fIymin)); mp->SetHighIndicesLimit(AliMpIntPair(fIxmax,fIymax)); -#ifdef WITH_ROOT fMotifPositions.AddLast(mp); -#else - fMotifPositions.push_back(mp); -#endif } //_____________________________________________________________________________ @@ -206,13 +196,6 @@ AliMpPCB::~AliMpPCB() /// Dtor. /// AliDebug(1,Form("this=%p",this)); -#ifndef WITH_ROOT - for ( UInt_t i = 0; i < fMotifPositions.size(); ++i ) - { - delete fMotifPositions[i]; - } -#endif - } //_____________________________________________________________________________ @@ -309,11 +292,7 @@ AliMpPCB::Add(AliMpMotifType* mt, Int_t ix, Int_t iy) mp->SetLowIndicesLimit(AliMpIntPair(ixmin,iymin)); mp->SetHighIndicesLimit(AliMpIntPair(ixmax,iymax)); -#ifdef WITH_ROOT fMotifPositions.AddLast(mp); -#else - fMotifPositions.push_back(mp); -#endif fIxmin = TMath::Min(fIxmin,ixmin); fIxmax = TMath::Max(fIxmax,ixmax); @@ -429,22 +408,11 @@ AliMpPCB::Copy(TObject& o) const pcb.fActiveXmin = fActiveXmin; pcb.fActiveXmax = fActiveXmax; -#ifdef WITH_ROOT AliDebug(1,"Deleting pcb.fMotifPositions"); pcb.fMotifPositions.Delete(); AliDebug(1,"Deleting pcb.fMotifPositions : done"); -#else - for ( UInt_t i = 0; i < pcb.fMotifPositions.size(); ++i ) - { - delete pcb.fMotifPositions[i]; - } -#endif -#ifdef WITH_ROOT for ( Int_t i = 0; i < fMotifPositions.GetEntriesFast(); ++i ) -#else - for ( UInt_t i = 0; i < fMotifPositions.size(); ++i ) -#endif { AliMpMotifPosition* pos = (AliMpMotifPosition*)fMotifPositions[i]; AliMpMotifPosition* pcbpos = new AliMpMotifPosition(pos->GetID(), @@ -452,11 +420,7 @@ AliMpPCB::Copy(TObject& o) const pos->Position()); pcbpos->SetLowIndicesLimit(pos->GetLowIndicesLimit()); pcbpos->SetHighIndicesLimit(pos->GetHighIndicesLimit()); -#ifdef WITH_ROOT pcb.fMotifPositions.AddLast(pcbpos); -#else - pcb.fMotifPositions.push_back(pcbpos); -#endif } pcb.fNofPads = fNofPads; @@ -527,11 +491,7 @@ AliMpPCB::FindMotifPosition(Int_t ix, Int_t iy) const /// integer indices (ix,iy). /// -#ifdef WITH_ROOT for (Int_t i = 0; i < fMotifPositions.GetEntriesFast(); ++i ) -#else - for (UInt_t i = 0; i < fMotifPositions.size(); ++i ) -#endif { AliMpMotifPosition* mp = (AliMpMotifPosition*)fMotifPositions[i]; if ( mp->HasPadByIndices(AliMpIntPair(ix,iy)) ) @@ -550,11 +510,7 @@ AliMpPCB::FindMotifPosition(Double_t x, Double_t y) const /// Returns the motifPosition located at position (x,y) /// -#ifdef WITH_ROOT for (Int_t i = 0; i < fMotifPositions.GetEntriesFast(); ++i ) -#else - for (UInt_t i = 0; i < fMotifPositions.size(); ++i ) -#endif { AliMpMotifPosition* mp = (AliMpMotifPosition*)fMotifPositions[i]; @@ -589,11 +545,8 @@ AliMpPCB::GetMotifPosition(Int_t i) const /// Get the i-th motifPosition stored in this PCB's internal array. /// -#ifdef WITH_ROOT if ( i >= fMotifPositions.GetEntriesFast() ) return 0; -#else - if ( i >= Int_t(fMotifPositions.size()) ) return 0; -#endif + return (AliMpMotifPosition*)fMotifPositions[i]; } @@ -627,11 +580,7 @@ AliMpPCB::GetSize() const /// Returns the number of motifPositions stored in this PCB. /// -#ifdef WITH_ROOT return fMotifPositions.GetEntriesFast(); -#else - return fMotifPositions.size(); -#endif } //_____________________________________________________________________________ @@ -640,7 +589,6 @@ AliMpPCB::HasMotifPositionID(Int_t manuId) const { /// Returns whether or not we have manuId -#ifdef WITH_ROOT TIter next(&fMotifPositions); AliMpMotifPosition* pos; while ( ( pos = static_cast(next()) ) ) @@ -648,12 +596,6 @@ AliMpPCB::HasMotifPositionID(Int_t manuId) const if ( pos->GetID() == manuId ) return kTRUE; } return kFALSE; -#else - for ( UInt_t i=0; iGetID() == manuId ) return kTRUE; - } - return kFALSE; -#endif } @@ -741,11 +683,7 @@ AliMpPCB::Print(Option_t* option) const if ( option && option[0] == 'M' ) { -#ifdef WITH_ROOT for ( Int_t i = 0; i < fMotifPositions.GetEntriesFast(); ++i ) -#else - for ( UInt_t i = 0; i < fMotifPositions.size(); ++i ) -#endif { if (option) { @@ -771,11 +709,7 @@ AliMpPCB::Save() const TList lines; lines.SetOwner(kTRUE); -#ifdef WITH_ROOT for ( Int_t i = 0; i < fMotifPositions.GetEntriesFast(); ++i ) -#else - for ( UInt_t i = 0; i < fMotifPositions.size(); ++i ) -#endif { AliMpMotifPosition* pos = GetMotifPosition(i); AliMpVMotif* motif = pos->GetMotif(); diff --git a/MUON/mapping/AliMpPCB.h b/MUON/mapping/AliMpPCB.h index df826207dc6..bb73e27f6f0 100644 --- a/MUON/mapping/AliMpPCB.h +++ b/MUON/mapping/AliMpPCB.h @@ -13,34 +13,29 @@ #ifndef ALIMPPCB_H #define ALIMPPCB_H -#ifndef ROOT_TObject -# include "TObject.h" +#ifndef ALI_MP_VPAD_ITERATOR_H +# include "AliMpVPadIterator.h" #endif -#ifndef ROOT_TString -# include "TString.h" +#ifndef ALI_MP_AREA_H +# include "AliMpArea.h" #endif -# ifndef ROOT_TArraI -# include "TArrayI.h" -# endif -#include "AliMpContainers.h" +#ifndef ROOT_TObject +# include "TObject.h" +#endif -#ifdef WITH_ROOT -# ifndef ROOT_TObjArray -# include "TObjArray.h" -# endif -#else -# include +#ifndef ROOT_TString +# include "TString.h" #endif -#ifndef ALI_MP_VPAD_ITERATOR_H -# include "AliMpVPadIterator.h" +#ifndef ROOT_TArraI +# include "TArrayI.h" #endif -#ifndef ALI_MP_AREA_H -# include "AliMpArea.h" +#ifndef ROOT_TObjArray +# include "TObjArray.h" #endif class AliMpSlatMotifMap; @@ -160,11 +155,7 @@ class AliMpPCB : public TObject Int_t fIxmax; ///< max pad index in x Int_t fIymin; ///< min pad index in y Int_t fIymax; ///< max pad index in y -#ifdef WITH_ROOT TObjArray fMotifPositions; ///< array of motifs -#else - std::vector fMotifPositions; ///< array of motif positions -#endif Int_t fNofPads; ///< number of pads in this PCB AliMpSlatMotifMap* fMotifMap; ///< to keep track of things to avoid duplications of motif and motiftypes, and get proper deletion diff --git a/MUON/mapping/AliMpPad.cxx b/MUON/mapping/AliMpPad.cxx index 38bc60b7722..c845909b414 100755 --- a/MUON/mapping/AliMpPad.cxx +++ b/MUON/mapping/AliMpPad.cxx @@ -64,9 +64,7 @@ AliMpPad::AliMpPad(const AliMpIntPair& location,const AliMpIntPair& indices, Bool_t validity) : TObject(), fLocations(0), -#ifdef WITH_ROOT fNofLocations(0), -#endif fLocation(location), fIndices(indices), fPosition(position), @@ -85,9 +83,7 @@ AliMpPad::AliMpPad(const AliMpIntPair& location,const AliMpIntPair& indices, AliMpPad::AliMpPad() : TObject(), fLocations(0), -#ifdef WITH_ROOT fNofLocations(0), -#endif fLocation(AliMpIntPair::Invalid()), fIndices(AliMpIntPair::Invalid()), fPosition(-1.,-1.), @@ -102,9 +98,7 @@ AliMpPad::AliMpPad() AliMpPad::AliMpPad(const AliMpPad& rhs) : TObject(rhs), fLocations(0), -#ifdef WITH_ROOT fNofLocations(0), -#endif fLocation(AliMpIntPair::Invalid()), fIndices(AliMpIntPair::Invalid()), fPosition(-1.,-1.), @@ -121,13 +115,7 @@ AliMpPad::~AliMpPad() { /// Destructor -#ifdef WITH_STL - delete fLocations; -#endif - -#ifdef WITH_ROOT delete [] fLocations; -#endif } //_____________________________________________________________________________ @@ -149,24 +137,12 @@ AliMpPad& AliMpPad::operator = (const AliMpPad& rhs) fValidity = rhs.fValidity; fLocations = 0; - -#ifdef WITH_STL - if ( rhs.GetNofLocations() ) { - fLocations = new IntPairVector(rhs.GetNofLocations()); - - for (Int_t i=0; ipush_back(location); - return true; -#endif - -#ifdef WITH_ROOT if ( ! fLocations) fLocations = new AliMpIntPair[fgkMaxNofLocations]; fLocations[fNofLocations++] = location; return true; -#endif } //_____________________________________________________________________________ @@ -302,13 +268,7 @@ Int_t AliMpPad::GetNofLocations() const if (!fLocations) return 0; -#ifdef WITH_STL - return fLocations->size(); -#endif - -#ifdef WITH_ROOT return fNofLocations; -#endif } @@ -320,13 +280,7 @@ AliMpIntPair AliMpPad::GetLocation(Int_t i) const if ( !fLocations || i<0 || i>=GetNofLocations() ) return AliMpIntPair::Invalid(); -#ifdef WITH_STL - return (*fLocations)[i]; -#endif - -#ifdef WITH_ROOT return fLocations[i]; -#endif } //_____________________________________________________________________________ diff --git a/MUON/mapping/AliMpPad.h b/MUON/mapping/AliMpPad.h index 86867814cce..726e3c3a520 100755 --- a/MUON/mapping/AliMpPad.h +++ b/MUON/mapping/AliMpPad.h @@ -15,30 +15,13 @@ #include -#include "AliMpContainers.h" #include "AliMpIntPair.h" #include -#ifdef WITH_ROOT #include -#endif - -#ifdef WITH_STL -#include -#endif class AliMpPad : public TObject { - public: -#ifdef WITH_STL - /// Int pair vector type - typedef std::vector IntPairVector; -#endif -#ifdef WITH_ROOT - /// Int pair vector type - typedef AliMpIntPair IntPairVector; -#endif - public: AliMpPad(const AliMpIntPair& location, const AliMpIntPair& indices, const TVector2& position, const TVector2& dimensions, @@ -94,10 +77,8 @@ class AliMpPad : public TObject static const Int_t fgkMaxNofLocations; ///< \brief maximum number of pad locations /// in the collection // data members - IntPairVector* fLocations; ///< collection of pad locations -#ifdef WITH_ROOT + AliMpIntPair* fLocations; ///< collection of pad locations UInt_t fNofLocations; ///< number of locations in fLocations -#endif AliMpIntPair fLocation; ///< pad location AliMpIntPair fIndices; ///< pad indices TVector2 fPosition; ///< the pad position (in cm) diff --git a/MUON/mapping/AliMpPadRow.cxx b/MUON/mapping/AliMpPadRow.cxx index 7fd5221b7f6..2d0eb826594 100755 --- a/MUON/mapping/AliMpPadRow.cxx +++ b/MUON/mapping/AliMpPadRow.cxx @@ -113,13 +113,7 @@ AliMpPadRow::AddPadRowSegment(AliMpMotif* motif, Int_t motifPositionId, padRowSegment->SetOffsetX(CurrentBorderX()); // Adds the pad row segment -#ifdef WITH_STL - fSegments.push_back(padRowSegment); -#endif - -#ifdef WITH_ROOT fSegments.Add(padRowSegment); -#endif return padRowSegment; } @@ -176,13 +170,7 @@ Int_t AliMpPadRow::GetNofPadRowSegments() const { /// Return the number of pad row segments. -#ifdef WITH_STL - return fSegments.size(); -#endif - -#ifdef WITH_ROOT return fSegments.GetEntriesFast(); -#endif } //_____________________________________________________________________________ @@ -195,13 +183,7 @@ AliMpVPadRowSegment* AliMpPadRow::GetPadRowSegment(Int_t i) const return 0; } -#ifdef WITH_STL - return fSegments[i]; -#endif - -#ifdef WITH_ROOT return (AliMpVPadRowSegment*)fSegments[i]; -#endif } //_____________________________________________________________________________ diff --git a/MUON/mapping/AliMpPadRow.h b/MUON/mapping/AliMpPadRow.h index 8c9b725d795..aaef5e35532 100755 --- a/MUON/mapping/AliMpPadRow.h +++ b/MUON/mapping/AliMpPadRow.h @@ -15,33 +15,15 @@ #include -#include "AliMpContainers.h" - #include "AliMpXDirection.h" -#ifdef WITH_ROOT #include -#endif - -#ifdef WITH_STL -#include -#endif class AliMpVPadRowSegment; class AliMpMotif; class AliMpPadRow : public TObject { - public: -#ifdef WITH_STL - /// Pad row segment vector type - typedef std::vector PadRowSegmentVector; -#endif -#ifdef WITH_ROOT - /// Pad row segment vector type - typedef TObjArray PadRowSegmentVector; -#endif - public: AliMpPadRow(AliMp::XDirection direction); AliMpPadRow(); @@ -72,7 +54,7 @@ class AliMpPadRow : public TObject AliMp::XDirection fDirection; ///< the pad row x direction Int_t fID; ///< the pad row ID Double_t fOffsetX; ///< the x position of the border - PadRowSegmentVector fSegments; ///< the pad row segments + TObjArray fSegments; ///< the pad row segments ClassDef(AliMpPadRow,1) // Pad row }; diff --git a/MUON/mapping/AliMpRow.cxx b/MUON/mapping/AliMpRow.cxx index 3a2ce1e0a82..8c6d6520564 100755 --- a/MUON/mapping/AliMpRow.cxx +++ b/MUON/mapping/AliMpRow.cxx @@ -71,14 +71,7 @@ AliMpRow::~AliMpRow() { /// Destructor -#ifdef WITH_STL - for (Int_t i=0; i= rs->LeftBorderX() && x <= rs->RightBorderX()) return rs; @@ -438,13 +414,7 @@ Int_t AliMpRow::GetNofRowSegments() const { /// Return number of row segments. -#ifdef WITH_STL - return fSegments.size(); -#endif - -#ifdef WITH_ROOT return fSegments.GetSize(); -#endif } //_____________________________________________________________________________ @@ -457,12 +427,6 @@ AliMpVRowSegment* AliMpRow::GetRowSegment(Int_t i) const return 0; } -#ifdef WITH_STL - return fSegments[i]; -#endif - -#ifdef WITH_ROOT return (AliMpVRowSegment*)fSegments.At(i); -#endif } diff --git a/MUON/mapping/AliMpRow.h b/MUON/mapping/AliMpRow.h index 3a197c6c1c2..fe8cfafba23 100755 --- a/MUON/mapping/AliMpRow.h +++ b/MUON/mapping/AliMpRow.h @@ -13,19 +13,11 @@ #ifndef ALI_MP_ROW_H #define ALI_MP_ROW_H -#include "AliMpContainers.h" - #include "AliMpVIndexed.h" #include "AliMpDirection.h" #include -#ifdef WITH_ROOT #include -#endif - -#ifdef WITH_STL -#include -#endif class AliMpVRowSegment; class AliMpVPadIterator; @@ -34,16 +26,6 @@ class AliMpMotifMap; class AliMpRow : public AliMpVIndexed { - public: -#ifdef WITH_STL - /// Row segment vector type - typedef std::vector RowSegmentVector; -#endif -#ifdef WITH_ROOT - /// Row segment vector type - typedef TList RowSegmentVector; -#endif - public: AliMpRow(Int_t id, AliMpMotifMap* motifMap); AliMpRow(); @@ -88,7 +70,7 @@ class AliMpRow : public AliMpVIndexed // data members UInt_t fID; ///< row ID Double_t fOffsetY; ///< the y position of the centre of motifs - RowSegmentVector fSegments;///< row segments + TList fSegments;///< row segments AliMpMotifMap* fMotifMap;///< the motif map associated with its sector ClassDef(AliMpRow,1) // Row diff --git a/MUON/mapping/AliMpSector.cxx b/MUON/mapping/AliMpSector.cxx index 33040d5b4a4..12b271a622e 100755 --- a/MUON/mapping/AliMpSector.cxx +++ b/MUON/mapping/AliMpSector.cxx @@ -64,21 +64,11 @@ AliMpSector::AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows, fMotifMap = new AliMpMotifMap; -#ifdef WITH_STL - for (Int_t izone = 0; izone= fRows[i]->LowBorderY() && y <= fRows[i]->UpperBorderY()) - return fRows[i]; - } -#endif - -#ifdef WITH_ROOT for (Int_t i=0; i= ((AliMpRow*)fRows[i])->LowBorderY() && y <= ((AliMpRow*)fRows[i])->UpperBorderY()) return (AliMpRow*)fRows[i]; } -#endif return 0; } @@ -365,13 +346,8 @@ AliMpVRowSegment* AliMpSector::FindRowSegment(Int_t motifPositionId) const for (Int_t irow=0; irowGetNofRowSegments(); iseg++) { AliMpVRowSegment* segment = row->GetRowSegment(iseg); if (segment->HasMotifPosition(motifPositionId)) return segment; @@ -430,23 +406,12 @@ TVector2 AliMpSector::Dimensions() const Double_t y = 0.; for (Int_t i=0; iDimensions().X() > x) - x = fRows[i]->Dimensions().X(); - - // add all rows y dimensions - y += fRows[i]->Dimensions().Y(); -#endif - -#ifdef WITH_ROOT // take the largest x row dimension if ( ((AliMpRow*)fRows[i])->Dimensions().X() > x) x = ((AliMpRow*)fRows[i])->Dimensions().X(); // add all rows y dimensions y += ((AliMpRow*)fRows[i])->Dimensions().Y(); -#endif } return TVector2(x, y); @@ -457,13 +422,7 @@ Int_t AliMpSector::GetNofZones() const { /// Return the number of zones. -#ifdef WITH_STL - return fZones.size(); -#endif - -#ifdef WITH_ROOT return fZones.GetEntriesFast(); -#endif } //_____________________________________________________________________________ @@ -476,13 +435,7 @@ AliMpZone* AliMpSector::GetZone(Int_t zoneID) const return 0; } -#ifdef WITH_STL - return fZones[zoneID-1]; -#endif - -#ifdef WITH_ROOT return (AliMpZone*)fZones[zoneID-1]; -#endif } //_____________________________________________________________________________ @@ -490,13 +443,7 @@ Int_t AliMpSector::GetNofRows() const { /// Return the number of rows. -#ifdef WITH_STL - return fRows.size(); -#endif - -#ifdef WITH_ROOT return fRows.GetEntriesFast(); -#endif } //_____________________________________________________________________________ @@ -509,13 +456,7 @@ AliMpRow* AliMpSector::GetRow(Int_t rowID) const return 0; } -#ifdef WITH_STL - return fRows[rowID]; -#endif - -#ifdef WITH_ROOT return (AliMpRow*)fRows[rowID]; -#endif } //_____________________________________________________________________________ diff --git a/MUON/mapping/AliMpSector.h b/MUON/mapping/AliMpSector.h index 4efd4c7aebc..1c8cbfd23e5 100755 --- a/MUON/mapping/AliMpSector.h +++ b/MUON/mapping/AliMpSector.h @@ -15,21 +15,13 @@ #include -#include "AliMpContainers.h" - #include "AliMpDirection.h" #include "AliMpPlaneType.h" #include "AliMpIntPair.h" #include #include -#ifdef WITH_ROOT #include -#endif - -#ifdef WITH_STL -#include -#endif class AliMpZone; class AliMpRow; @@ -42,20 +34,6 @@ class TArrayI; class AliMpSector : public TNamed { - public: -#ifdef WITH_STL - /// Row vector type - typedef std::vector RowVector; - /// Zone vector type - typedef std::vector ZoneVector; -#endif -#ifdef WITH_ROOT - /// Row vector type - typedef TObjArray RowVector; - /// Zone vector type - typedef TObjArray ZoneVector; -#endif - public: AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows, AliMp::Direction direction, const TVector2& offset); @@ -125,8 +103,8 @@ class AliMpSector : public TNamed // data members TString fID; ///< sector ID TVector2 fOffset; ///< sector position - ZoneVector fZones; ///< zones - RowVector fRows; ///< rows + TObjArray fZones; ///< zones + TObjArray fRows; ///< rows AliMpMotifMap* fMotifMap; ///< motif map AliMp::Direction fDirection; ///< the direction of constant pad size TVector2 fMinPadDimensions; ///< minimum pad dimensions diff --git a/MUON/mapping/AliMpSectorReader.cxx b/MUON/mapping/AliMpSectorReader.cxx index a6015c4bdea..a3ddc66a3f6 100755 --- a/MUON/mapping/AliMpSectorReader.cxx +++ b/MUON/mapping/AliMpSectorReader.cxx @@ -438,7 +438,7 @@ void AliMpSectorReader::ReadRowSegmentSpecialData(istream& in, // Process data // - AliMpVRowSegmentSpecial::PadRowVector newPadRows; + TObjArray newPadRows; for (Int_t i=0; iAddPadRow(padRow); // Keep the new rows in a temporary vector -#ifdef WITH_STL - newPadRows.push_back(padRow); -#endif -#ifdef WITH_ROOT newPadRows.Add(padRow); -#endif } TString nextKeyword; @@ -481,12 +476,7 @@ void AliMpSectorReader::ReadRowSegmentSpecialData(istream& in, for (Int_t i=0; iGetMotifMap()->FindMotif(motifId); diff --git a/MUON/mapping/AliMpSectorSegmentation.cxx b/MUON/mapping/AliMpSectorSegmentation.cxx index b61a7a16b80..2804f0c9bc7 100755 --- a/MUON/mapping/AliMpSectorSegmentation.cxx +++ b/MUON/mapping/AliMpSectorSegmentation.cxx @@ -55,10 +55,8 @@ ClassImp(AliMpSectorSegmentation) /// \endcond -#ifdef WITH_ROOT const Double_t AliMpSectorSegmentation::fgkS1 = 100000.; const Double_t AliMpSectorSegmentation::fgkS2 = 1000.; -#endif //______________________________________________________________________________ AliMpSectorSegmentation::AliMpSectorSegmentation( @@ -112,7 +110,6 @@ AliMpSectorSegmentation::~AliMpSectorSegmentation() // private methods // -#ifdef WITH_ROOT //______________________________________________________________________________ Long_t AliMpSectorSegmentation::GetIndex(const TVector2& vector2) const { @@ -129,7 +126,6 @@ TVector2 AliMpSectorSegmentation::GetVector(Long_t index) const return TVector2( TMath::Floor(index/fgkS1)/fgkS2, (index - TMath::Floor(index/fgkS1)*fgkS1)/fgkS2 ); } -#endif //______________________________________________________________________________ void AliMpSectorSegmentation::FillPadDimensionsMap() @@ -143,10 +139,6 @@ void AliMpSectorSegmentation::FillPadDimensionsMap() if (!AliMpConstants::IsEqual(zone->GetPadDimensions(), TVector2())) { // regular zone -#ifdef WITH_STL - fPadDimensionsMap[zoneID*10] = zone->GetPadDimensions(); -#endif -#ifdef WITH_ROOT AliDebugStream(3) << "Filling fPadDimensions[" << zoneID*10 << "] = (" << zone->GetPadDimensions().X() << ", " @@ -154,7 +146,6 @@ void AliMpSectorSegmentation::FillPadDimensionsMap() fPadDimensionsMap.Add((Long_t)(zoneID*10), GetIndex(zone->GetPadDimensions())); -#endif } else { // special zone @@ -165,10 +156,6 @@ void AliMpSectorSegmentation::FillPadDimensionsMap() for (Int_t k=0; kGetNofPadDimensions(); k++) { Int_t index = zoneID*10 + subIndex++; -#ifdef WITH_STL - fPadDimensionsMap[index] = motif->GetPadDimensions(k); -#endif -#ifdef WITH_ROOT AliDebugStream(3) << "Filling fPadDimensions[" << index << "] = (" << motif->GetPadDimensions(k).X() << ", " @@ -177,7 +164,6 @@ void AliMpSectorSegmentation::FillPadDimensionsMap() fPadDimensionsMap.Add((Long_t)(index), GetIndex(motif->GetPadDimensions(k))); -#endif } } } @@ -639,16 +625,7 @@ Int_t AliMpSectorSegmentation::Zone(const AliMpPad& pad, Bool_t warning) const return 0; } -#ifdef WITH_STL - PadDimensionsMapCIterator it; - for (it = fPadDimensionsMap.begin(); it != fPadDimensionsMap.end(); ++it) { - if (AliMpConstants::IsEqual(it->second, pad.Dimensions())) - return it->first; - } -#endif - -#ifdef WITH_ROOT - PadDimensionsMapCIterator it(&fPadDimensionsMap); + TExMapIter it(&fPadDimensionsMap); Long_t key, value; while ( it.Next(key, value) ) { TVector2 dimensions = GetVector(value); @@ -657,8 +634,6 @@ Int_t AliMpSectorSegmentation::Zone(const AliMpPad& pad, Bool_t warning) const } AliError(Form("fPadDimensionsMap size is %d",fPadDimensionsMap.GetSize())); - -#endif // Should never happen AliErrorStream() @@ -672,15 +647,8 @@ AliMpSectorSegmentation::PadDimensions(Int_t zone, Bool_t warning) const { /// Return the pad dimensions for the zone with the specified zone index. -#ifdef WITH_STL - PadDimensionsMapCIterator it = fPadDimensionsMap.find(zone); - if (it != fPadDimensionsMap.end()) return it->second; -#endif - -#ifdef WITH_ROOT Long_t value = fPadDimensionsMap.GetValue(zone); if (value) return GetVector(value); -#endif if (warning) Warning("PadDimensions(zone)", "not found"); return TVector2(); @@ -739,17 +707,7 @@ void AliMpSectorSegmentation::PrintZones() const cout << "Zones: " << endl; -#ifdef WITH_STL - PadDimensionsMapCIterator it; - for (it = fPadDimensionsMap.begin(); it != fPadDimensionsMap.end(); ++it) { - cout << " zone: " << setw(4) << it->first; - cout << " pad dimensions: ( " - << it->second.X() << ", " << it->second.Y() << ")" << endl; - } -#endif - -#ifdef WITH_ROOT - PadDimensionsMapCIterator it(&fPadDimensionsMap); + TExMapIter it(&fPadDimensionsMap); Long_t key, value; while ( it.Next(key, value) ) { //cout << "Iterating over: " << key << ", " << value << endl; @@ -759,6 +717,5 @@ void AliMpSectorSegmentation::PrintZones() const cout << " pad dimensions: ( " << dimensions.X() << ", " << dimensions.Y() << ")" << endl; } -#endif } diff --git a/MUON/mapping/AliMpSectorSegmentation.h b/MUON/mapping/AliMpSectorSegmentation.h index 1fc19d4a0b3..9e4bcb60090 100755 --- a/MUON/mapping/AliMpSectorSegmentation.h +++ b/MUON/mapping/AliMpSectorSegmentation.h @@ -17,19 +17,11 @@ #ifndef ALI_MP_SECTOR_SEGMENTATION_H #define ALI_MP_SECTOR_SEGMENTATION_H -#include "AliMpContainers.h" - #include "AliMpVSegmentation.h" #include "AliMpPad.h" #include -#ifdef WITH_ROOT #include -#endif - -#ifdef WITH_STL -#include -#endif class AliMpSector; class AliMpMotifPosition; @@ -39,20 +31,6 @@ class AliMpArea; class AliMpSectorSegmentation : public AliMpVSegmentation { - public: -#ifdef WITH_STL - /// Pad dimensions map type - typedef std::map PadDimensionsMap; - /// Pad dimensions map iterator type - typedef PadDimensionsMap::const_iterator PadDimensionsMapCIterator; -#endif -#ifdef WITH_ROOT - /// Pad dimensions map type - typedef TExMap PadDimensionsMap; - /// Pad dimensions map iterator type - typedef TExMapIter PadDimensionsMapCIterator; -#endif - public: AliMpSectorSegmentation(const AliMpSector* sector, Bool_t own = false); AliMpSectorSegmentation(); @@ -115,14 +93,12 @@ class AliMpSectorSegmentation : public AliMpVSegmentation /// Not implemented AliMpSectorSegmentation& operator = (const AliMpSectorSegmentation& right); -#ifdef WITH_ROOT static const Double_t fgkS1; ///< the separators used for conversion static const Double_t fgkS2; ///< of TVector2 to Long_t // methods Long_t GetIndex(const TVector2& vector2) const; TVector2 GetVector(Long_t index) const; -#endif // methods void FillPadDimensionsMap(); @@ -136,13 +112,7 @@ class AliMpSectorSegmentation : public AliMpVSegmentation const AliMpSector* fkSector; ///< Sector Bool_t fIsOwner; ///< Sector ownership AliMpPad* fPadBuffer; ///< The pad buffer -#ifdef WITH_STL - PadDimensionsMap fPadDimensionsMap; ///< Map between zone IDs and pad dimensions -#endif -#ifdef WITH_ROOT - mutable PadDimensionsMap fPadDimensionsMap; ///< Map between zone IDs and pad dimensions -#endif - + mutable TExMap fPadDimensionsMap; ///< Map between zone IDs and pad dimensions Int_t fMaxIndexInX; ///< maximum pad index in x Int_t fMaxIndexInY; ///< maximum pad index in y diff --git a/MUON/mapping/AliMpSlat.cxx b/MUON/mapping/AliMpSlat.cxx index 98ab3cdbf07..ba2b1ebc97f 100644 --- a/MUON/mapping/AliMpSlat.cxx +++ b/MUON/mapping/AliMpSlat.cxx @@ -64,9 +64,8 @@ AliMpSlat::AliMpSlat(TRootIOCtor* ioCtor) /// Empty ctor. /// AliDebug(1,Form("this=%p Empty ctor",this)); -#ifdef WITH_ROOT + fPCBs.SetOwner(kTRUE); -#endif fManuMap.SetOwner(kFALSE); } @@ -88,9 +87,8 @@ AliMpSlat::AliMpSlat(const char* id, AliMp::PlaneType bendingOrNonBending) /// Normal ctor /// AliDebug(1,Form("this=%p id=%s",this,id)); -#ifdef WITH_ROOT + fPCBs.SetOwner(kTRUE); -#endif fManuMap.SetOwner(kFALSE); } @@ -101,14 +99,8 @@ AliMpSlat::~AliMpSlat() /// Dtor. /// AliDebug(1,Form("this=%p fId=%s",this,fId.Data())); -#ifdef WITH_ROOT + fPCBs.Delete(); -#else - for ( UInt_t i = 0; i < fPCBs.size(); ++i ) - { - delete fPCBs[i]; - } -#endif } //_____________________________________________________________________________ @@ -132,11 +124,7 @@ AliMpSlat::Add(const AliMpPCB& pcbType, const TArrayI& manuList) } Double_t xOffset = DX()*2; AliMpPCB* pcb = pcbType.Clone(manuList,ixOffset,xOffset); -#ifdef WITH_ROOT fPCBs.AddLast(pcb); -#else - fPCBs.push_back(pcb); -#endif fDY = TMath::Max(pcb->DY(),fDY); fDX += pcb->DX(); fNofPadsX += pcb->GetNofPadsX(); @@ -147,7 +135,6 @@ AliMpSlat::Add(const AliMpPCB& pcbType, const TArrayI& manuList) AliMpMotifPosition* mp = pcb->GetMotifPosition(i); Int_t manuID = mp->GetID(); // Before inserting a new key, check if it's already there -//#ifdef WITH_ROOT TObject* there = fManuMap.GetValue(manuID); if ( there == 0 ) { @@ -159,10 +146,7 @@ AliMpSlat::Add(const AliMpPCB& pcbType, const TArrayI& manuList) { AliError(Form("ManuID %d is duplicated for PCB %s",manuID,pcbType.GetID())); } -//#else -// fManuMap[manuID] = mp; -//#endif - } + } fPosition.Set(DX(),DY()); fNofPads += pcb->NofPads(); } @@ -204,19 +188,7 @@ AliMpSlat::FindMotifPosition(Int_t manuID) const /// /// Returns the motifPosition referenced by it manuID /// -//#ifdef WITH_ROOT return static_cast(fManuMap.GetValue(manuID)); -//#else -// std::map::const_iterator it = fManuMap.find(manuID); -// if ( it != fManuMap.end() ) -// { -// return it->second; -// } -// else -// { -// return 0; -// } -//#endif } //_____________________________________________________________________________ @@ -372,7 +344,6 @@ AliMpSlat::GetAllMotifPositionsIDs(TArrayI& ecn) const Int_t nofElectronicCards(GetNofElectronicCards()); assert(nofElectronicCards>0); ecn.Set(nofElectronicCards); -//#ifdef WITH_ROOT TIter next(fManuMap.CreateIterator()); AliMpMotifPosition* mp; Int_t n(0); @@ -382,9 +353,6 @@ AliMpSlat::GetAllMotifPositionsIDs(TArrayI& ecn) const ++n; } assert(n==nofElectronicCards); -//#else - // missing here -//#endif } //_____________________________________________________________________________ @@ -473,13 +441,8 @@ AliMpSlat::GetPCB(Int_t i) const /// /// Returns the i-th PCB of this slat. /// -#ifdef WITH_ROOT if ( i >= fPCBs.GetEntriesFast() ) return 0; return (AliMpPCB*)fPCBs[i]; -#else - if ( i >= Int_t(fPCBs.size()) ) return 0; - return fPCBs[i]; -#endif } //_____________________________________________________________________________ @@ -489,11 +452,7 @@ AliMpSlat::GetSize() const /// /// Returns the number of PCB in this slat. /// -#ifdef WITH_ROOT return fPCBs.GetEntriesFast(); -#else - return fPCBs.size(); -#endif } //_____________________________________________________________________________ diff --git a/MUON/mapping/AliMpSlat.h b/MUON/mapping/AliMpSlat.h index 1242b068302..41a4adce858 100644 --- a/MUON/mapping/AliMpSlat.h +++ b/MUON/mapping/AliMpSlat.h @@ -13,12 +13,6 @@ #ifndef ALI_MP_SLAT_H #define ALI_MP_SLAT_H -#include - -#ifndef ROOT_TString -# include "TString.h" -#endif - #ifndef ALI_MP_PAD_H # include "AliMpPad.h" #endif @@ -31,18 +25,25 @@ # include "AliMpPlaneType.h" #endif -#include "AliMpContainers.h" -#include "AliMpExMap.h" +#ifndef ALI_MP_EX_MAP_H + #include "AliMpExMap.h" +#endif -class TArrayI; +#ifndef ROOT_TObject + #include +#endif -#ifdef WITH_ROOT +#ifndef ROOT_TString +# include "TString.h" +#endif + +#ifndef ROOT_TObjArray # include "TObjArray.h" -#else -# include -//# include #endif +class TArrayI; + + class AliMpMotifPosition; class AliMpPCB; class TArrayI; @@ -147,11 +148,7 @@ class AliMpSlat : public TObject Int_t fNofPadsX; ///< Actual number of pads in x direction Int_t fMaxNofPadsY; ///< Maximum number of pads in y direction mutable AliMpExMap fManuMap; ///< map of int to AliMpMotifPosition* -#ifdef WITH_ROOT TObjArray fPCBs; ///< array of AliMpPCB* -#else - std::vector fPCBs; ///< array of AliMpPCB* -#endif TVector2 fPosition; ///< Position of the slat center. Int_t fNofPads; ///< number of pads in this slat diff --git a/MUON/mapping/AliMpSubZone.cxx b/MUON/mapping/AliMpSubZone.cxx index 307661cd498..8eef969944a 100755 --- a/MUON/mapping/AliMpSubZone.cxx +++ b/MUON/mapping/AliMpSubZone.cxx @@ -71,13 +71,7 @@ void AliMpSubZone::AddRowSegment(AliMpVRowSegment* rowSegment) { /// Add row segment. -#ifdef WITH_STL - fSegments.push_back(rowSegment); -#endif - -#ifdef WITH_ROOT fSegments.Add(rowSegment); -#endif } @@ -103,13 +97,7 @@ Int_t AliMpSubZone::GetNofRowSegments() const { /// Return number of row segments. -#ifdef WITH_STL - return fSegments.size(); -#endif - -#ifdef WITH_ROOT return fSegments.GetSize(); -#endif } //_____________________________________________________________________________ @@ -122,13 +110,7 @@ AliMpVRowSegment* AliMpSubZone::GetRowSegment(Int_t i) const return 0; } -#ifdef WITH_STL - return fSegments[i]; -#endif - -#ifdef WITH_ROOT return (AliMpVRowSegment*)fSegments.At(i); -#endif } //_____________________________________________________________________________ diff --git a/MUON/mapping/AliMpSubZone.h b/MUON/mapping/AliMpSubZone.h index 53ea5ca8a9e..569a8d9ecfa 100755 --- a/MUON/mapping/AliMpSubZone.h +++ b/MUON/mapping/AliMpSubZone.h @@ -15,32 +15,13 @@ #define ALI_MP_SUB_ZONE_H #include - -#include "AliMpContainers.h" - -#ifdef WITH_ROOT #include -#endif - -#ifdef WITH_STL -#include -#endif class AliMpVMotif; class AliMpVRowSegment; class AliMpSubZone : public TObject { - public: -#ifdef WITH_STL - /// Row segment vector type - typedef std::vector RowSegmentVector; -#endif -#ifdef WITH_ROOT - /// Row segment vector type - typedef TList RowSegmentVector; -#endif - public: AliMpSubZone(AliMpVMotif* motif); AliMpSubZone(); @@ -63,7 +44,7 @@ class AliMpSubZone : public TObject // data members AliMpVMotif* fMotif; ///< the motif in this subzone - RowSegmentVector fSegments;///< contained row segments + TList fSegments;///< contained row segments ClassDef(AliMpSubZone,1) // Zone segment }; diff --git a/MUON/mapping/AliMpVRowSegmentSpecial.cxx b/MUON/mapping/AliMpVRowSegmentSpecial.cxx index 52943ee8fd4..e3c4f40c429 100644 --- a/MUON/mapping/AliMpVRowSegmentSpecial.cxx +++ b/MUON/mapping/AliMpVRowSegmentSpecial.cxx @@ -42,9 +42,7 @@ ClassImp(AliMpVRowSegmentSpecial) /// \endcond -#ifdef WITH_ROOT const Int_t AliMpVRowSegmentSpecial::fgkMaxNofMotifPositionIds = 20; -#endif //______________________________________________________________________________ AliMpVRowSegmentSpecial::AliMpVRowSegmentSpecial(AliMpRow* row, Double_t offsetX) @@ -53,10 +51,8 @@ AliMpVRowSegmentSpecial::AliMpVRowSegmentSpecial(AliMpRow* row, Double_t offsetX fOffsetX(offsetX), fPadRows(), fMotifs(), - fMotifPositionIds() -#ifdef WITH_ROOT - ,fNofMotifPositionIds(0) -#endif + fMotifPositionIds(), + fNofMotifPositionIds(0) { /// Standard constructor } @@ -68,16 +64,12 @@ AliMpVRowSegmentSpecial::AliMpVRowSegmentSpecial() fOffsetX(0.), fPadRows(), fMotifs(), - fMotifPositionIds() -#ifdef WITH_ROOT - ,fNofMotifPositionIds(0) -#endif + fMotifPositionIds(), + fNofMotifPositionIds(0) { /// Default constructor -#ifdef WITH_ROOT fMotifPositionIds.Set(fgkMaxNofMotifPositionIds); -#endif } //______________________________________________________________________________ @@ -189,15 +181,8 @@ Bool_t AliMpVRowSegmentSpecial::HasMotif(const AliMpVMotif* motif) const /// Return true if the specified motif is already in fMotifs vector, /// returns false otherwise. -#ifdef WITH_STL - for (UInt_t i=0; iSetOffsetX(fOffsetX); padRow->SetID(GetNofPadRows()); -#ifdef WITH_STL - fPadRows.push_back(padRow); -#endif - -#ifdef WITH_ROOT fPadRows.Add(padRow); -#endif } //______________________________________________________________________________ @@ -264,12 +231,6 @@ void AliMpVRowSegmentSpecial::UpdateMotifVector() AliMpVMotif* motif = padRow->GetPadRowSegment(j)->GetMotif(); if (!HasMotif(motif)) { -#ifdef WITH_STL - fMotifs.push_back(motif); - fMotifPositionIds.push_back( - padRow->GetPadRowSegment(j)->GetMotifPositionId()); -#endif -#ifdef WITH_ROOT fMotifs.Add(motif); // resize array if needed @@ -279,7 +240,6 @@ void AliMpVRowSegmentSpecial::UpdateMotifVector() fMotifPositionIds.AddAt( padRow->GetPadRowSegment(j)->GetMotifPositionId(), fNofMotifPositionIds++); -#endif } } } @@ -398,12 +358,7 @@ Int_t AliMpVRowSegmentSpecial::GetNofMotifs() const { /// Return the number of different motifs present in this row segment. -#ifdef WITH_STL - return fMotifs.size(); -#endif -#ifdef WITH_ROOT return fMotifs.GetEntriesFast(); -#endif } //______________________________________________________________________________ @@ -411,12 +366,7 @@ AliMpVMotif* AliMpVRowSegmentSpecial::GetMotif(Int_t i) const { /// Return the i-th motif present in this row segment. -#ifdef WITH_STL - return fMotifs[i]; -#endif -#ifdef WITH_ROOT return (AliMpVMotif*)fMotifs[i]; -#endif } //______________________________________________________________________________ diff --git a/MUON/mapping/AliMpVRowSegmentSpecial.h b/MUON/mapping/AliMpVRowSegmentSpecial.h index 4c7c7c80893..7e6c0c20b82 100644 --- a/MUON/mapping/AliMpVRowSegmentSpecial.h +++ b/MUON/mapping/AliMpVRowSegmentSpecial.h @@ -14,20 +14,12 @@ #ifndef ALI_MP_V_ROW_SEGMENT_SPECIAL_H #define ALI_MP_V_ROW_SEGMENT_SPECIAL_H -#include "AliMpContainers.h" - #include "AliMpVRowSegment.h" #include "AliMpVMotif.h" #include -#ifdef WITH_ROOT #include #include -#endif - -#ifdef WITH_STL -#include -#endif class AliMpRow; class AliMpPadRow; @@ -36,24 +28,6 @@ class AliMpIntPair; class AliMpVRowSegmentSpecial : public AliMpVRowSegment { - public: -#ifdef WITH_STL - /// Pad row vector type - typedef std::vector PadRowVector; - /// Motif vector type - typedef std::vector MotifVector; - /// Motif position Id vector type - typedef std::vector MotifPositionIdVector; -#endif -#ifdef WITH_ROOT - /// Pad row vector type - typedef TObjArray PadRowVector; - /// Motif vector type - typedef TObjArray MotifVector; - /// Motif position Id vector type - typedef TArrayI MotifPositionIdVector; -#endif - public: AliMpVRowSegmentSpecial(AliMpRow* row, Double_t offsetX); AliMpVRowSegmentSpecial(); @@ -128,22 +102,17 @@ class AliMpVRowSegmentSpecial : public AliMpVRowSegment /// Not implemented AliMpVRowSegmentSpecial& operator = (const AliMpVRowSegmentSpecial& right); -#ifdef WITH_ROOT // static data members static const Int_t fgkMaxNofMotifPositionIds; ///< dimension of fMotifPositionIds -#endif // data members - AliMpRow* fRow; ///< the row containing this segment - Double_t fOffsetX; ///< \brief the x position of the border that touches a standard - /// row segment - 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 -#endif + AliMpRow* fRow; ///< the row containing this segment + Double_t fOffsetX; ///< \brief the x position of the border that touches a standard + /// row segment + TObjArray fPadRows; ///< pad rows vector + TObjArray fMotifs; ///< motifs vector + TArrayI fMotifPositionIds; ///< motifs position Ids vector + Int_t fNofMotifPositionIds; ///< number of motif positions Ids ClassDef(AliMpVRowSegmentSpecial,1) //Row segment }; diff --git a/MUON/mapping/AliMpZone.cxx b/MUON/mapping/AliMpZone.cxx index f0ac4a1462c..d7e3009cc9c 100755 --- a/MUON/mapping/AliMpZone.cxx +++ b/MUON/mapping/AliMpZone.cxx @@ -71,13 +71,7 @@ void AliMpZone::AddSubZone(AliMpSubZone* subZone) { /// Add row segment. -#ifdef WITH_STL - fSubZones.push_back(subZone); -#endif - -#ifdef WITH_ROOT fSubZones.Add(subZone); -#endif } //_____________________________________________________________________________ @@ -99,13 +93,7 @@ Int_t AliMpZone::GetNofSubZones() const { /// Return number of row segments. -#ifdef WITH_STL - return fSubZones.size(); -#endif - -#ifdef WITH_ROOT return fSubZones.GetEntriesFast(); -#endif } //_____________________________________________________________________________ @@ -118,11 +106,5 @@ AliMpSubZone* AliMpZone::GetSubZone(Int_t i) const return 0; } -#ifdef WITH_STL - return fSubZones[i]; -#endif - -#ifdef WITH_ROOT return (AliMpSubZone*)fSubZones[i]; -#endif } diff --git a/MUON/mapping/AliMpZone.h b/MUON/mapping/AliMpZone.h index dfc05123e5d..e8100a80bed 100755 --- a/MUON/mapping/AliMpZone.h +++ b/MUON/mapping/AliMpZone.h @@ -17,33 +17,14 @@ #define ALI_MP_ZONE_H #include - -#include "AliMpContainers.h" - #include -#ifdef WITH_ROOT #include -#endif - -#ifdef WITH_STL -#include -#endif class AliMpSubZone; class AliMpVMotif; class AliMpZone : public TObject { - public: -#ifdef WITH_STL - /// Sub zone vector type - typedef std::vector SubZoneVector; -#endif -#ifdef WITH_ROOT - /// Sub zone vector type - typedef TObjArray SubZoneVector; -#endif - public: AliMpZone(Int_t id); AliMpZone(); @@ -67,7 +48,7 @@ class AliMpZone : public TObject private: // data members UInt_t fID; ///< ID - SubZoneVector fSubZones; ///< subzones + TObjArray fSubZones; ///< subzones TVector2 fPadDimensions;///< pad dimensions ClassDef(AliMpZone,1) // Zone -- 2.43.0