RichMenu modified to switch between aligned and misaligned geometry
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 May 2006 10:16:16 +0000 (10:16 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 May 2006 10:16:16 +0000 (10:16 +0000)
RICH/RichMenu.C

index 496d017..e5dd157 100644 (file)
@@ -23,11 +23,23 @@ Bool_t AliceRead()
     if(!gAlice) Fatal("menu.C::ReadAlice","No gAlice in file");
     a=al->GetAliRun();//provides pointer to AliRun object
     Info("AliceRead","Run contains %i event(s)",a->GetEventsPerRun());      
+    GeomAlign(kTRUE);
     RichGet();
     return kTRUE;   //old session opened from file
   }        
 }//AliceRead()
 //__________________________________________________________________________________________________
+void GeomAlign(Bool_t isAlign)
+{
+  if(gGeoManager) delete gGeoManager;
+  if(AliRICHParam::Instance()) delete AliRICHParam::Instance();
+  if(isAlign) 
+    TGeoManager::Import("geometry.root");
+  else
+    TGeoManager::Import("misaligned_geometry.root");
+  AliRICHParam::Instance();
+}
+//__________________________________________________________________________________________________
 void AliceNew()
 {
   Info("AliceNew","Init new session");
@@ -46,6 +58,8 @@ void RichMenu()
   TControlBar *pMenu = new TControlBar("vertical","MAIN");
        
   if(AliceRead()){//it's from file, show some info
+    pMenu->AddButton("Geometry Align OK      "         ,"GeomAlign(kTRUE);"  , "Ideal Geometry Aligned");
+    pMenu->AddButton("Geometry MisAligned SET"         ,"GeomAlign(kFALSE);"  , "Misaligned Geometry SET");
     pMenu->AddButton("Display single chambers"         ,"r->Display();"  , "Display Fast");
     pMenu->AddButton("Display ALL chambers"            ,"r->DisplayEvent(0,0);"  , "Display Fast");
     pMenu->AddButton("Recon with stack"                ,"AliRICHReconstructor::CheckPR(        )","Create RSR.root with ntuple hn");