]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONContourHandler.cxx
Fixing display of data at pad level (pads were hollow)
[u/mrichter/AliRoot.git] / MUON / AliMUONContourHandler.cxx
index 271f1ff81bfb237dbc218a9f125e54aa870e748e..5a91b1e2d143a2942fbcb74e9e466818a7211f80 100644 (file)
@@ -51,6 +51,8 @@
 #include "TPolyLine.h"
 #include "TSystem.h"
 
+using std::cout;
+using std::endl;
 ///\cond CLASSIMP
 ClassImp(AliMUONContourHandler)
 ///\endcond
@@ -70,9 +72,15 @@ fAllContourArray(0x0)
   /// before you've loaded the mapping in memory (see e.g. AliMpCDB::LoadDDLStore)
   ///
   
-  fTransformations = GenerateTransformations(explodedView);
+  if ( explodedView ) 
+  {
+    fTransformations = GenerateTransformations(explodedView);
+  }
+  
   AliMUONManuContourMaker manuMaker(fTransformations);
+  
   TObjArray* manus = manuMaker.GenerateManuContours(kTRUE);
+  
   if (manus)
   {
     manus->SetOwner(kFALSE);
@@ -85,6 +93,7 @@ fAllContourArray(0x0)
 AliMUONContourHandler::~AliMUONContourHandler()
 {
   /// Dtor
+  delete fTransformations;
   delete fAllContourMap;
   delete fAllContourArray;
 }
@@ -120,8 +129,15 @@ AliMUONContourHandler::CreateContourList(const TObjArray& manuContours)
   /// of station0/chamber0 and station0/chamber1 in the example above).
   ///
   
-  AliCodeTimerAuto("",);
+  AliCodeTimerAuto("",0);
+  
+  Int_t start(0);
   
+  if ( !fTransformations )
+  {
+    start = 2; // skip chamber and station contours, as we seem to be in 3D
+  }
+    
   TIter next(&manuContours);
   AliMUONContour* contour;
   TObjArray* mapArray = new TObjArray;
@@ -132,7 +148,7 @@ AliMUONContourHandler::CreateContourList(const TObjArray& manuContours)
     
     TString key(contour->GetName());
     TObjArray* s = key.Tokenize("/");
-    for ( Int_t i = 0; i < s->GetLast(); ++i ) 
+    for ( Int_t i = start; i < s->GetLast(); ++i ) 
     {
       TMap* m = static_cast<TMap*>(mapArray->At(i));
       if (!m)
@@ -179,14 +195,11 @@ AliMUONContourHandler::GenerateAllContours(const TObjArray& manuContours)
   /// Note that manuContours should NOT be the owner of its contours,
   /// as they are adopted by the array returned by this method.
   
-  AliCodeTimerAuto("",);
+  AliCodeTimerAuto("",0);
   
   // Get the list of contours to create
   TObjArray* mapArray = CreateContourList(manuContours);
   
-  // Now loop over the mapArray to actually create the contours
-  TIter next2(mapArray,kIterBackward);
-  
   fAllContourMap = new TMap(20000,1);
   fAllContourMap->SetOwnerKeyValue(kTRUE,kTRUE);
   
@@ -227,7 +240,7 @@ AliMUONContourHandler::GenerateAllContours(const TObjArray& manuContours)
         }
         else
         {
-          AliError(Form("Did not find contour %s",k->String().Data()))
+          AliError(Form("Did not find contour %s",k->String().Data()));
           continue;
         }
       }
@@ -267,7 +280,7 @@ AliMUONContourHandler::GenerateTransformations(Bool_t exploded)
   /// If exploded=kFALSE then we generate real transformations, otherwise
   /// we generate tweaked ones that look fine on screen.
   
-  AliCodeTimerAuto("",);
+  AliCodeTimerAuto("",0);
   
   AliMUONGeometryTransformer transformer;
   Bool_t ok = transformer.LoadGeometryData("transform.dat");
@@ -326,15 +339,22 @@ AliMUONContourHandler::GetContour(const char* contourname) const
 
 //_____________________________________________________________________________
 void
-AliMUONContourHandler::Print(Option_t* /*opt*/) const
+AliMUONContourHandler::Print(Option_t* opt) const
 {
   /// printout
   
-  if ( fAllContourMap ) 
+  if ( ! fAllContourMap )  return;
+  
+  cout << Form("Contour map : collisions = %5.3f size = %d capacity = %d", 
+               fAllContourMap->AverageCollisions(),
+               fAllContourMap->GetSize(),
+               fAllContourMap->Capacity()) << endl;
+
+  TString sopt(opt);
+  sopt.ToUpper();
+  
+  if ( sopt.Contains("ALL") || sopt.Contains("FULL") )
   {
-    cout << Form("Contour map : collisions = %5.3f size = %d capacity = %d", 
-                 fAllContourMap->AverageCollisions(),
-                 fAllContourMap->GetSize(),
-                 fAllContourMap->Capacity()) << endl;
+    fAllContourMap->Print();
   }
 }