Tic preliminary support in config and menu
authorkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Mar 2005 09:48:38 +0000 (09:48 +0000)
committerkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Mar 2005 09:48:38 +0000 (09:48 +0000)
RICH/RichConfig.C
RICH/RichMenu.C
RICH/api.txt

index b893ff4ff0e868aabbed24efff2f8100f01985f6..76dcaf31bd4497f3545f09fcc679e3c9fb6c4d5e 100644 (file)
@@ -6,107 +6,140 @@ public:
           RichConfig(const char*sFileName);
          ~RichConfig()                    {Info("ctor","");Cleanup();}
 //protected:
-  enum ERichVers  {kNoRich=-1,kNormalRich,kTestBeam,kTestRadio,kAerogel,kOnTop,kTic};
-  enum EGenTypes  {kTestGun=100,kBox1,kGun7,kPythia7,kHijing,kHijingPara,kRichLib,kSignalHijing,kHijingPara2Proton};
+  enum EVersOpts  {kNo=-1,kVer0,kVer1,kTestBeam,kTestRadio,kOnTop,kDeclust=301,kSagita,kFeedback};
+  enum EGenTypes  {kGunAlongZ=100,kBox1,kGun7,kPythia7,kHijing,kHijingPara,kRichLib,kSignalHijing,kHijingPara2Proton};
   
   enum EDetectors {kPIPE=1,kITS,kTPC,kTRD,kTOF,kFRAME,kMAG,kCRT,kHALL,kPHOS,kSTART,kFMD,kABSO,kPMD,kDIPO,kEMCAL,kVZERO,kMUON,kZDC,kSHILD};
   enum EProcesses {kDCAY=1,kPAIR,kCOMP,kPHOT,kPFIS,kDRAY,kANNI,kBREM,kMUNU,kCKOV,kHADR,kLOSS,kMULS,kRAYL,kALL};
   enum ERawFiles  {kNoRaw=0,kRawDdl,kRawDate,kRawRoot};
-  
+//SLOTS  
   void    AddDetector(Int_t id)          {if(id==kTRD || id==kTOF) fDetBG->SetButton(kFRAME);}
   void    RemoveDetector(Int_t id)       {if(id==kFRAME) {fDetBG->SetButton(kTRD,kFALSE);fDetBG->SetButton(kTOF,kFALSE);}}
   
   void    AddProcess(Int_t id)           {if(id==kALL) for(int i=1;i<=fProcBG->GetCount();i++) fProcBG->SetButton(i,kButtonDown);}
   void    RemoveProcess(Int_t id)        {if(id==kALL) for(int i=1;i<=fProcBG->GetCount();i++) fProcBG->SetButton(i,kButtonUp);}
+  void    GeneratorSlot(Int_t type);
+  void    VerSlot(Int_t ver)             {if(ver==kTestBeam){ fMagCB->SetState(kButtonUp); fGenTypeCO->Select(kGunAlongZ);}}        
   
   Float_t Eta2Theta(Float_t arg)    const{return (180./TMath::Pi())*2.*TMath::ATan(TMath::Exp(-arg));}
   void    CreateConfig();
   void    CreateRichBatch();
   void    Exit();
      
-  TGComboBox   *fRichVerCombo;  TGButton *fRichDeclusterBC,*fRichSagBC,*fRichDebugBC,*fRichFeedbackBC;//RICH
-  TGButton     *fMagFldBC;                               //MAG
-  TGComboBox   *fGenTypeCombo,*fGenPartIdCombo,*fGenMinMomCombo,*fGenMaxMomCombo,*fGenChamberCombo; TGNumberEntry *fGenNprimEntry;//GEN
-  TGButtonGroup *fDetBG;       //DETECTORS
-  TGButtonGroup *fProcBG;      //PROCESSES
-  TGButtonGroup *fRawBtnGrp; //controls RichBatch.C creation
+  TGComboBox   *fRichCO;  TGButtonGroup *fRichBG;                                                                              //RICH
+  TGComboBox   *fTicCO;   TGButtonGroup *fTicBG;                                                                               //TIC
+  TGButton     *fMagCB;                                                                                                     //MAG
+  TGComboBox   *fGenTypeCO,*fGenPidCO,*fGenMinMomCO,*fGenMaxMomCO,*fGenChamberCO; TGGroupFrame *fGenGF,*fGenOptGF; TGNumberEntry *fGenPrimNE;             //GEN
+  TGButtonGroup *fDetBG;                                                                                                       //DETECTORS
+  TGButtonGroup *fProcBG;                                                                                                      //PROCESSES
+  TGButtonGroup *fRawBG;                                                                                                       //RAW 
   char         *fFileName;
 };//class RichConfig
 //__________________________________________________________________________________________________    
-RichConfig::RichConfig(const char *sFileName):TGMainFrame(gClient->GetRoot(),650,400)
+RichConfig::RichConfig(const char *sFileName):TGMainFrame(gClient->GetRoot(),700,400)
 {// creates configuration file  
   fFileName=sFileName;
 
-// Connect("CloseWindow()","RichConfig",this,"CloseWindow()");   
-  AddFrame(pHorFrame=new TGHorizontalFrame(this,100,200));
+//  --------------------  
+//  | |--------------------
+//  | ||-------|
+//  | ||       |
+//  | ||-------|
+//  | |  
+//  | ||-------|   
+  
+//  | |--------------------
+//  | ---------------------         
+  
+//  Connect("CloseWindow()","RichConfig",this,"CloseWindow()");   
+  AddFrame(pMainHF=new TGHorizontalFrame(this,100,200)); //main horizontal frame
+//Left vertical frame containing RICH TIC and MagField  
+  pMainHF->AddFrame(pLeftVF=new TGVerticalFrame(pMainHF,100,200));  
 //RICH
-  pHorFrame->AddFrame(pVerFrame=new TGVerticalFrame(pHorFrame,100,200));  
-  pVerFrame->AddFrame(pRichFG=new TGGroupFrame(pHorFrame,"RICH"));
-  pRichFG->AddFrame(fRichVerCombo=new TGComboBox(pRichFG,100));
-    fRichVerCombo->AddEntry("no RICH"      ,kNoRich);
-    fRichVerCombo->AddEntry("normal RICH"  ,kNormalRich);
-    fRichVerCombo->AddEntry("RICH on top"  ,kOnTop);
-    fRichVerCombo->AddEntry("test beam"    ,kTestBeam);
-    fRichVerCombo->AddEntry("radio source" ,kTestRadio);
-    fRichVerCombo->AddEntry("aerogel"      ,kAerogel);
-    fRichVerCombo->AddEntry("VHMPID TIC"   ,kTic);
-    fRichVerCombo->Select(kNormalRich);  fRichVerCombo->Resize(150,20);
-    pRichFG->AddFrame(fRichDeclusterBC=new TGCheckButton(pRichFG,"Declustering"));       fRichDeclusterBC->SetState(kButtonDown);
-    pRichFG->AddFrame(fRichSagBC      =new TGCheckButton(pRichFG,"Wire sagita?"));       fRichSagBC      ->SetState(kButtonDown);
-    pRichFG->AddFrame(fRichDebugBC    =new TGCheckButton(pRichFG,"Debug StepManager?"));
-    pRichFG->AddFrame(fRichFeedbackBC =new TGCheckButton(pRichFG,"Generate feedbacks?"));fRichFeedbackBC ->SetState(kButtonDown); 
+  pLeftVF->AddFrame(pRichGF=new TGGroupFrame(pLeftVF,"RICH"));
+  pRichGF->AddFrame(fRichCO=new TGComboBox(pRichGF,100));
+  fRichCO->Connect("Selected(Int_t)" ,"RichConfig",this,"VerSlot(Int_t)");
+    fRichCO->AddEntry("no RICH"      ,kNo);
+    fRichCO->AddEntry("debug RICH 0" ,kVer0);
+    fRichCO->AddEntry("normal RICH 1",kVer1);
+    fRichCO->AddEntry("RICH on top"  ,kOnTop);
+    fRichCO->AddEntry("test beam"    ,kTestBeam);
+    fRichCO->AddEntry("radio source" ,kTestRadio);
+    fRichCO->Select(kVer1); 
+    fRichCO->Resize(150,20);
+  pRichGF->AddFrame(fRichBG=new TGButtonGroup(pRichGF,"Options"));
+    new TGCheckButton(fRichBG,"Decluster?"   ,kDeclust);      fRichBG->SetButton(kDeclust);
+    new TGCheckButton(fRichBG,"Wire sagita?" ,kSagita);       fRichBG->SetButton(kSagita);
+    new TGCheckButton(fRichBG,"Feedbacks?"   ,kFeedback);     fRichBG->SetButton(kFeedback); 
+//TIC
+  pLeftVF->AddFrame(pTicGF=new TGGroupFrame(pLeftVF,"TIC"));
+  pTicGF->AddFrame(fTicCO=new TGComboBox(pTicGF,100));
+  fTicCO->Connect("Selected(Int_t)" ,"RichConfig",this,"VerSlot(Int_t)");
+    fTicCO->AddEntry("no TIC"      ,kNo);
+    fTicCO->AddEntry("debug TIC 0" ,kVer0);
+    fTicCO->AddEntry("normal TIC 1",kVer1);
+    fTicCO->AddEntry("test beam"   ,kTestBeam);
+    fTicCO->Select(kVer1);  
+    fTicCO->Resize(150,20);        
+  pTicGF->AddFrame(fTicBG=new TGButtonGroup(pTicGF,"Options"));
+    new TGCheckButton(fTicBG,"Decluster?"           ,kDeclust);      fTicBG->SetButton(kDeclust);
+    new TGCheckButton(fTicBG,"Wire sagita?"         ,kSagita);       fTicBG->SetButton(kSagita);
+    new TGCheckButton(fTicBG,"Feedbacks?"           ,kFeedback);     fTicBG->SetButton(kFeedback); 
+// Magnetic Field
+  pLeftVF->AddFrame(pMagGF=new TGGroupFrame(pLeftVF,"Magnetic Field"));
+  pMagGF->AddFrame(fMagCB=new TGCheckButton(pMagGF,"On/Off"));
+  fMagCB->SetState(kButtonDown);
 //Generator  
-  pVerFrame->AddFrame(pGenGrpFrm=new TGGroupFrame(pHorFrame,"Generator"));
-  pGenGrpFrm->AddFrame(fGenTypeCombo=new TGComboBox(pGenGrpFrm,100));
-  fGenTypeCombo->AddEntry("test gun along z",kTestGun);  
-  fGenTypeCombo->AddEntry("box gun to single chamber",kBox1);  
-  fGenTypeCombo->AddEntry("gun to all chambers",kGun7);
-  fGenTypeCombo->AddEntry("7 guns+Pythia",kPythia7);
-  fGenTypeCombo->AddEntry("HIJING",kHijing);
-  fGenTypeCombo->AddEntry("parametrized HIJING",kHijingPara);
-  fGenTypeCombo->AddEntry("2 p+HIJING",kHijingPara2Proton);
-  fGenTypeCombo->AddEntry("Sr90 source",kSr90);
-  fGenTypeCombo->AddEntry("RICH lib",kRichLib);
-  fGenTypeCombo->AddEntry("RICH lib+HIJING",kSignalHijing);
-  fGenTypeCombo->Select(kHijingPara);
-  fGenTypeCombo->Resize(160,20);
+  pMainHF->AddFrame(fGenGF=new TGGroupFrame(pMainHF,"Generator"));
+  fGenGF->AddFrame(fGenTypeCO=new TGComboBox(fGenGF,100));
+  fGenTypeCO->Connect("Selected(Int_t)" ,"RichConfig",this,"GeneratorSlot(Int_t)");
+  fGenTypeCO->AddEntry("gun along z"                  ,kGunAlongZ);  
+  fGenTypeCO->AddEntry("box gun to single chamber"    ,kBox1);  
+  fGenTypeCO->AddEntry("gun to all chambers"          ,kGun7);
+  fGenTypeCO->AddEntry("7 guns+Pythia"                ,kPythia7);
+  fGenTypeCO->AddEntry("HIJING"                       ,kHijing);
+  fGenTypeCO->AddEntry("HIJING para"                  ,kHijingPara);
+  fGenTypeCO->AddEntry("2 p+HIJING"                   ,kHijingPara2Proton);
+  fGenTypeCO->AddEntry("Sr90 source"                  ,kSr90);
+  fGenTypeCO->AddEntry("RICH lib"                     ,kRichLib);
+  fGenTypeCO->AddEntry("RICH lib+HIJING"              ,kSignalHijing);
+  fGenTypeCO->Select(kHijingPara);
+  fGenTypeCO->Resize(160,20);
+  
   
-  pGenGrpFrm->AddFrame(fGenPartIdCombo=new TGComboBox(pGenGrpFrm,100)); //PID for guns
-  fGenPartIdCombo->AddEntry("Pion+"     ,kPiPlus);
-  fGenPartIdCombo->AddEntry("Pion-"     ,kPiMinus);
-  fGenPartIdCombo->AddEntry("Kaon+"     ,kKPlus);
-  fGenPartIdCombo->AddEntry("Kaon-"     ,kKMinus);
-  fGenPartIdCombo->AddEntry("K0s"       ,kK0Short);    
-  fGenPartIdCombo->AddEntry("Proton"    ,kProton);
-  fGenPartIdCombo->AddEntry("ProtonBar" ,kProtonBar);
-  fGenPartIdCombo->AddEntry("Lambda"    ,kLambda0);
-  fGenPartIdCombo->AddEntry("LambdaBar" ,kLambda0Bar);
-  fGenPartIdCombo->Select(kProton);  fGenPartIdCombo->Resize(160,20);
+  fGenGF->AddFrame(fGenOptGF=new TGGroupFrame(fGenGF,"Options")); //PID for guns
 
-  pGenGrpFrm->AddFrame(fGenMinMomCombo=new TGComboBox(pGenGrpFrm,100)); //particle energy for guns
   
+  fGenOptGF->AddFrame(fGenPidCO=new TGComboBox(fGenOptGF,100)); //PID for guns
+  fGenPidCO->AddEntry("Pion+"     ,kPiPlus);
+  fGenPidCO->AddEntry("Pion-"     ,kPiMinus);
+  fGenPidCO->AddEntry("Kaon+"     ,kKPlus);
+  fGenPidCO->AddEntry("Kaon-"     ,kKMinus);
+  fGenPidCO->AddEntry("K0s"       ,kK0Short);    
+  fGenPidCO->AddEntry("Proton"    ,kProton);
+  fGenPidCO->AddEntry("ProtonBar" ,kProtonBar);
+  fGenPidCO->AddEntry("Lambda"    ,kLambda0);
+  fGenPidCO->AddEntry("LambdaBar" ,kLambda0Bar);
+  fGenPidCO->Select(kProton);  fGenPidCO->Resize(160,20);
+
+  fGenOptGF->AddFrame(fGenMinMomCO=new TGComboBox(fGenOptGF,100)); //particle energy for guns  
   for(Int_t i=5;i<=95;i+=5)
-    fGenMinMomCombo->AddEntry(Form("%3.1f GeV",0.1*i), i);
-  fGenMinMomCombo->Select(15);  fGenMinMomCombo->Resize(160,20);
+    fGenMinMomCO->AddEntry(Form("%3.1f GeV",0.1*i), i);
+  fGenMinMomCO->Select(15);  fGenMinMomCO->Resize(160,20);
   
-  pGenGrpFrm->AddFrame(fGenMaxMomCombo=new TGComboBox(pGenGrpFrm,100)); //particle energy for guns
+  fGenOptGF->AddFrame(fGenMaxMomCO=new TGComboBox(fGenOptGF,100)); //particle energy for guns
   for(Int_t i=10;i<=95;i+=5)
-    fGenMaxMomCombo->AddEntry(Form("%3.1f GeV",0.1*i), i);
-  fGenMaxMomCombo->Select(40);  fGenMaxMomCombo->Resize(160,20);
+    fGenMaxMomCO->AddEntry(Form("%3.1f GeV",0.1*i), i);
+  fGenMaxMomCO->Select(40);  fGenMaxMomCO->Resize(160,20);
   
-  pGenGrpFrm->AddFrame(fGenChamberCombo=new TGComboBox(pGenGrpFrm,100)); //chamber number in case of gun1
-  for(int i=1;i<=7;i++) fGenChamberCombo->AddEntry(Form("Chamber %i",i),i);
-  fGenChamberCombo->Select(4); fGenChamberCombo->Resize(160,20);
+  fGenOptGF->AddFrame(fGenChamberCO=new TGComboBox(fGenOptGF,100)); //chamber number in case of gun1
+  for(int i=1;i<=7;i++) fGenChamberCO->AddEntry(Form("Chamber %i",i),i);
+  fGenChamberCO->Select(4); fGenChamberCO->Resize(160,20);
   
-  pGenGrpFrm->AddFrame(pGenNprimFrm=new TGGroupFrame(pGenGrpFrm,"Number of primaries"));//number of primiries in case of HIJING
-  pGenNprimFrm->AddFrame(fGenNprimEntry=new TGNumberEntry(pGenNprimFrm,500));
-  
-// Magnetic Field
-  pVerFrame->AddFrame(pFldGrpFrm=new TGGroupFrame(pHorFrame,"Magnetic Field"));
-  pFldGrpFrm->AddFrame(fMagFldBC=new TGCheckButton(pFldGrpFrm,"On/Off"));
-  fMagFldBC->SetState(kButtonDown);
+  fGenOptGF->AddFrame(pGenPrimGF=new TGGroupFrame(fGenOptGF,"Number of primaries"));
+  pGenPrimGF->AddFrame(fGenPrimNE=new TGNumberEntry(pGenPrimGF,500));  
 //Detectors
-  pHorFrame->AddFrame(fDetBG=new TGButtonGroup(pHorFrame,"Detectors"));
+  pMainHF->AddFrame(fDetBG=new TGButtonGroup(pMainHF,"Detectors"));
   fDetBG->Connect("Pressed(Int_t)" ,"RichConfig",this,"AddDetector(Int_t)");
   fDetBG->Connect("Released(Int_t)","RichConfig",this,"RemoveDetector(Int_t)");
     new TGCheckButton(fDetBG,"PIPE"  ,kPIPE));         
@@ -130,7 +163,7 @@ RichConfig::RichConfig(const char *sFileName):TGMainFrame(gClient->GetRoot(),650
     new TGCheckButton(fDetBG,"ZDC"   ,kZDC));         
     new TGCheckButton(fDetBG,"SHILD" ,kSHILD));         
 //Processes  
-  pHorFrame->AddFrame(fProcBG=new TGButtonGroup(pHorFrame,"Processes"));
+  pMainHF->AddFrame(fProcBG=new TGButtonGroup(pMainHF,"Processes"));
   fProcBG->Connect("Pressed(Int_t)" ,"RichConfig",this,"AddProcess(Int_t)");
   fProcBG->Connect("Released(Int_t)","RichConfig",this,"RemoveProcess(Int_t)");
     new TGCheckButton(fProcBG,"ALL  ON/OFF"                 ,kALL)) ;
@@ -148,23 +181,47 @@ RichConfig::RichConfig(const char *sFileName):TGMainFrame(gClient->GetRoot(),650
     new TGCheckButton(fProcBG,"LOSS Energy losses"          ,kLOSS));  fProcBG->SetButton(kLOSS);       
     new TGCheckButton(fProcBG,"MULS Multiple scattering"    ,kMULS));  fProcBG->SetButton(kMULS);       
     new TGCheckButton(fProcBG,"RAYL"                        ,kRAYL));  fProcBG->SetButton(kRAYL);       
-//RichBatch.C control    
-  pHorFrame->AddFrame(fRawBtnGrp=new TGButtonGroup(pHorFrame,"RAW data"));
-    new TGRadioButton(fRawBtnGrp,"No RAW files"      ,kNoRaw)) ;   fRawBtnGrp->SetButton(kNoRaw);
-    new TGRadioButton(fRawBtnGrp,"RAW DDL"           ,kRawDdl)) ;
-    new TGRadioButton(fRawBtnGrp,"RAW DATE"          ,kRawDate)) ;
-    new TGRadioButton(fRawBtnGrp,"RAW ROOT"          ,kRawRoot)) ;
+//RAW
+  pMainHF->AddFrame(fRawBG=new TGButtonGroup(pMainHF,"RAW data"));
+    new TGRadioButton(fRawBG,"No RAW files"      ,kNoRaw)) ;   fRawBG->SetButton(kNoRaw);
+    new TGRadioButton(fRawBG,"RAW DDL"           ,kRawDdl)) ;
+    new TGRadioButton(fRawBG,"RAW DATE"          ,kRawDate)) ;
+    new TGRadioButton(fRawBG,"RAW ROOT"          ,kRawRoot)) ;
 //File    
-  AddFrame(pFileHorFrm=new TGHorizontalFrame(this,100,200));
-  pFileHorFrm->AddFrame(pCreateB=new TGTextButton(pFileHorFrm,"Create"));
-  pCreateB->Connect("Clicked()","RichConfig",this,"Exit()");                                 
-  pFileHorFrm->AddFrame(new TGLabel(pFileHorFrm,Form(" config file as %s",fFileName)));  
+  AddFrame(pFileHF=new TGHorizontalFrame(this,100,200));
+  pFileHF->AddFrame(pCrtTB=new TGTextButton(pFileHF,"Create"));
+  pCrtTB->Connect("Clicked()","RichConfig",this,"Exit()");                                 
+  pFileHF->AddFrame(new TGLabel(pFileHF,Form(" config file as %s",fFileName)));  
   
   MapSubwindows();   
-  Layout();
+  //Layout(); 
+  Resize(GetDefaultSize());
   SetWindowName("Create AliROOT scripts");
   MapWindow();      
 }//KirCondig::ctor
+//__________________________________________________________________________________________________
+void RichConfig::GeneratorSlot(Int_t type)
+{//enable-disable generator widegets according to generator type
+  if(type==kHijing) fGenGF->HideFrame(fGenOptGF); 
+  
+  if(type==kHijingPara){
+    fGenGF->ShowFrame(fGenOptGF);
+  }
+  
+  if(type==kGunAlongZ) {
+    fGenOptGF->ShowFrame(fGenMaxMomCO);
+    fGenOptGF->ShowFrame(fGenChamberCO);
+    fGenOptGF->ShowFrame(fGenPrimNE);    
+  }
+}        
+
+
+
+
+
+
+
+
 //__________________________________________________________________________________________________          
 void RichConfig::CreateConfig()
 {   
@@ -212,54 +269,48 @@ void RichConfig::CreateConfig()
   fprintf(fp,"  gMC->SetCut(\"DCUTM\" ,0.001);\n"); fprintf(fp,"  gMC->SetCut(\"PPCUTM\",0.001); ");
   fprintf(fp,"  gMC->SetCut(\"TOFMAX\",1e10);\n\n"); 
 //Field
-  if(fMagFldBC->GetState()==kButtonDown) fprintf(fp,"  gAlice->SetField();\n\n");else fprintf(fp,"  gAlice->SetField(0);\n\n");
+  if(fMagCB->GetState()==kButtonDown) fprintf(fp,"  gAlice->SetField();\n\n");else fprintf(fp,"  gAlice->SetField(0);\n\n");
   fprintf(fp,"  pAL->CdGAFile();\n\n");                                 //????       
 //BODY-ALIC 
   fprintf(fp,"  new AliBODY(\"BODY\",\"Alice envelop\");\n\n");
 //RICH
-  switch(fRichVerCombo->GetSelected()){
-    case kNoRich: break;
-    case kTic:   
-                  fprintf(fp,"  gSystem->Load(\"libVHMPIDbase\");\n");     
-                  fprintf(fp,"  AliVHMPID *pVHMPID=new AliVHMPIDv0(\"VHMPID\",\"Test setup\");\n\n"); 
-                  break;      
-    default:  
-      TString richStr="RICH "; 
-      if(fRichDeclusterBC->GetState()!=kButtonDown){richStr+="no declustering "  ; fprintf(fp,"  AliRICHParam::SetDeclustering(kFALSE);\n");}
-      if(fRichSagBC->GetState()      !=kButtonDown){richStr+="no sagita "        ; fprintf(fp,"  AliRICHParam::SetWireSag(kFALSE);\n")     ;}
-      switch(fRichVerCombo->GetSelected()){//RICH
-        case kOnTop:      richStr+="top position";fprintf(fp,"  AliRICHParam::SetAngleRot(0);\n")      ;break;   
-        case kAerogel:    richStr+="aerogel"     ;fprintf(fp,"  AliRICHParam::SetAerogel(kTRUE);\n") ;break;   
-        case kTestRadio:  richStr+="radioactive" ;fprintf(fp,"  AliRICHParam::SetRadioSrc(kTRUE);\n");
-                                                  fprintf(fp,"  AliRICHParam::SetTestBeam(kTRUE);\n");break;   
-        case kTestBeam:   richStr+="test beam"   ;fprintf(fp,"  AliRICHParam::SetTestBeam(kTRUE);\n");break;   
-        case kNormalRich: richStr+="normal"      ;                                                    break;   
-      }
-      if(fRichDebugBC->GetState()    ==kButtonDown){
-        richStr+="+debug StepManager"; 
-        fprintf(fp,"  AliRICH *pRICH=new AliRICHv0(\"RICH\",\"%s\");\n\n",richStr.Data());
-      }else{
-        fprintf(fp,"  AliRICH *pRICH=new AliRICHv1(\"RICH\",\"%s\");\n\n",richStr.Data());
-      }
-      break;
+  if(!fRichBG->GetButton(kDeclust)->GetState()) fprintf(fp,"  AliRICHParam::SetDeclustering(kFALSE);\n");
+  if(!fRichBG->GetButton(kSagita)->GetState())  fprintf(fp,"  AliRICHParam::SetWireSag(kFALSE);\n")     ;
+  switch(fRichCO->GetSelected()){
+    case kNo:                                                                                                  break;
+    case kVer0:  fprintf(fp,"  AliRICH *pRICH=new AliRICHv0(\"RICH\",\"Rich with debug StepManager\");\n\n"); break;      
+    case kVer1:  fprintf(fp,"  AliRICH *pRICH=new AliRICHv1(\"RICH\",\"Normal\");\n\n");                 break;      
   }//switch RICH
+//TIC  
+  switch(fTicCO->GetSelected()){
+    case kNo:                                                                                                break;
+    case kVer0:   fprintf(fp,"  gSystem->Load(\"libVHMPIDbase\");\n");     
+                  fprintf(fp,"  AliVHMPID *pVHMPID=new AliVHMPIDv0(\"Debug StepManager\");\n\n");   break;      
+    case kVer1:   fprintf(fp,"  gSystem->Load(\"libVHMPIDbase\");\n");     
+                  fprintf(fp,"  AliVHMPID *pVHMPID=new AliVHMPIDv1(\"Normal\");\n\n");                   break;      
+    case kTestBeam:fprintf(fp,"  gSystem->Load(\"libVHMPIDbase\");\n");     
+                  fprintf(fp,"  AliVHMPIDParam::fgIsTestBeam=kTRUE;\n");    
+                  fprintf(fp,"  new AliVHMPIDv1(\"Test beam\");\n\n");                                         break;      
+    default:  
+
+  }//switch TIC
 //Generator
-  switch(fGenTypeCombo->GetSelected()){
+  switch(fGenTypeCO->GetSelected()){
     case kHijingPara: 
-      fprintf(fp,"  AliGenHIJINGpara *pGen=new AliGenHIJINGpara(%i);\n",(int)fGenNprimEntry->GetNumber());
+      fprintf(fp,"  AliGenHIJINGpara *pGen=new AliGenHIJINGpara(%i);\n",(int)fGenPrimNE->GetNumber());
       fprintf(fp,"  pGen->SetMomentumRange(0,999); pGen->SetThetaRange(%f,%f); pGen->SetPhiRange(0,360);\n",Eta2Theta(8),Eta2Theta(-8));
       fprintf(fp,"  pGen->SetOrigin(0,0,0);  pGen->SetSigma(0,0,0);\n");
       fprintf(fp,"  pGen->Init();\n");
     break;
     case kBox1:     
       fprintf(fp,"  AliGenBox *pGen=new AliGenBox(1);\n");  
-      fprintf(fp,"  pGen->SetPart(%i); pGen->SetOrigin(0,0,0);\n",fGenPartIdCombo->GetSelected());  
-      fprintf(fp,"  pGen->SetMomentumRange(%3.1f,%3.1f); \n",float(fGenMinMomCombo->GetSelected())/10,   float(fGenMaxMomCombo->GetSelected())/10);
-      fprintf(fp,"  pGen->SetThetaRange(pRICH->C(%i)->ThetaD()-3,pRICH->C(%i)->ThetaD()-1); \n",fGenChamberCombo->GetSelected(),fGenChamberCombo->GetSelected());
-      fprintf(fp,"  pGen->SetPhiRange(pRICH->C(%i)->PhiD()-1,pRICH->C(%i)->PhiD()+1); \n",fGenChamberCombo->GetSelected(),fGenChamberCombo->GetSelected());    
+      fprintf(fp,"  pGen->SetPart(%i); pGen->SetOrigin(0,0,0);\n",fGenPidCO->GetSelected());  
+      fprintf(fp,"  pGen->SetMomentumRange(%3.1f,%3.1f); \n",float(fGenMinMomCO->GetSelected())/10,   float(fGenMaxMomCO->GetSelected())/10);
+      fprintf(fp,"  pGen->SetThetaRange(pRICH->C(%i)->ThetaD()-3,pRICH->C(%i)->ThetaD()-1); \n",fGenChamberCO->GetSelected(),fGenChamberCO->GetSelected());
+      fprintf(fp,"  pGen->SetPhiRange(pRICH->C(%i)->PhiD()-1,pRICH->C(%i)->PhiD()+1); \n",fGenChamberCO->GetSelected(),fGenChamberCO->GetSelected());    
       fprintf(fp,"  pGen->Init();\n");
     break;    
-    case kTestGun:   
+    case kGunAlongZ:   
       fprintf(fp,"  AliGenFixed *pGen=new AliGenFixed(1);\n");
       fprintf(fp,"  pGen->SetPart(kProton); pGen->SetOrigin(0,0,0); pGen->SetMomentum(15); pGen->SetTheta(0);\n");
       fprintf(fp,"  pGen->Init();\n");
@@ -268,7 +319,7 @@ void RichConfig::CreateConfig()
       fprintf(fp,"  AliGenCocktail *pCocktail=new AliGenCocktail();\n");
       fprintf(fp,"  for(int i=1;i<=7;i++){\n");
       fprintf(fp,"    AliGenFixed *pFixed=new AliGenFixed(1);\n");
-      fprintf(fp,"    pFixed->SetPart(%i); pFixed->SetMomentum(1.0+i*0.5); pFixed->SetOrigin(0,0,0);\n",fGenPartIdCombo->GetSelected());
+      fprintf(fp,"    pFixed->SetPart(%i); pFixed->SetMomentum(1.0+i*0.5); pFixed->SetOrigin(0,0,0);\n",fGenPidCO->GetSelected());
       fprintf(fp,"    pFixed->SetPhi(pRICH->C(i)->PhiD()); pFixed->SetTheta(pRICH->C(i)->ThetaD()-2);\n");                             
       fprintf(fp,"    pCocktail->AddGenerator(pFixed,Form(\"Fixed %i\",i),1);\n  }\n");  
       fprintf(fp,"  pCocktail->Init();\n");
@@ -277,7 +328,7 @@ void RichConfig::CreateConfig()
       fprintf(fp,"  AliGenCocktail *pCocktail=new AliGenCocktail();\n");
       fprintf(fp,"  for(int i=1;i<=7;i++){\n");
       fprintf(fp,"    AliGenFixed *pFixed=new AliGenFixed(1);\n");
-      fprintf(fp,"    pFixed->SetPart(%i); pFixed->SetMomentum(2.5+i*0.4); pFixed->SetOrigin(0,0,0);\n",fGenPartIdCombo->GetSelected());
+      fprintf(fp,"    pFixed->SetPart(%i); pFixed->SetMomentum(2.5+i*0.4); pFixed->SetOrigin(0,0,0);\n",fGenPidCO->GetSelected());
       fprintf(fp,"    pFixed->SetPhiRange(pRICH->C(i)->PhiD()); pFixed->SetThetaRange(pRICH->C(i)->ThetaD()-2);\n");                             
       fprintf(fp,"    pCocktail->AddGenerator(pFixed,Form(\"Fixed %i\",i),1);\n  }\n");  
       fprintf(fp,"  AliGenPythia *pPythia = new AliGenPythia(-1);\n");
@@ -318,16 +369,16 @@ void RichConfig::CreateConfig()
       fprintf(fp,"  pCocktail->Init();\n");
     break;  
      case kRichLib:
-      fprintf(fp,"  AliGenParam *pGen=new AliGenParam(2,new AliGenRICHlib,%i,\"EXP\"); \n",fGenPartIdCombo->GetSelected());
-      fprintf(fp,"  pGen->SetPtRange(%3.1f,%3.1f); \n",fGenMinMomCombo->GetSelected()/10,fGenMaxMomCombo->GetSelected()/10);
+      fprintf(fp,"  AliGenParam *pGen=new AliGenParam(2,new AliGenRICHlib,%i,\"EXP\"); \n",fGenPidCO->GetSelected());
+      fprintf(fp,"  pGen->SetPtRange(%3.1f,%3.1f); \n",fGenMinMomCO->GetSelected()/10,fGenMaxMomCO->GetSelected()/10);
       fprintf(fp,"  pGen->SetYRange(-0.6,0.6); \n");
       fprintf(fp,"  pGen->SetPhiRange(0.,60.); \n");
       fprintf(fp,"  pGen->SetForceDecay(kAll); \n");
       fprintf(fp,"  pGen->Init();\n");
     break;
    case kSignalHijing:
-      fprintf(fp,"  AliGenParam *pRichLib=new AliGenParam(2,new AliGenRICHlib,%i,\"FLAT\"); \n",fGenPartIdCombo->GetSelected());
-      fprintf(fp,"  pRichLib->SetPtRange(%3.1f,%3.1f); \n",fGenMinMomCombo->GetSelected()/10,fGenMaxMomCombo->GetSelected()/10);
+      fprintf(fp,"  AliGenParam *pRichLib=new AliGenParam(2,new AliGenRICHlib,%i,\"FLAT\"); \n",fGenPidCO->GetSelected());
+      fprintf(fp,"  pRichLib->SetPtRange(%3.1f,%3.1f); \n",fGenMinMomCO->GetSelected()/10,fGenMaxMomCO->GetSelected()/10);
       fprintf(fp,"  pRichLib->SetYRange(-0.6,0.6); \n");
       fprintf(fp,"  pRichLib->SetPhiRange(0.,60.); \n");
       fprintf(fp,"  pRichLib->SetForceDecay(kPhiKK); \n");
@@ -394,22 +445,22 @@ void RichConfig::CreateRichBatch()
   fprintf(fp,"{\n");
   fprintf(fp,"  gSystem->Exec(\"rm -rf *.root hlt hough fort* raw* ZZZ*\");\n");
   fprintf(fp,"  if(isDebug)   AliLog::SetGlobalDebugLevel(AliLog::kDebug);\n");
-  fprintf(fp,"  gBenchmark->Start(\"ALICE\");TDatime time;\n\n");
+  fprintf(fp,"  gBenchmark->Start(\"ALICE\");\n  TDatime time;\n\n");
 //simulation section  
   fprintf(fp,"  AliSimulation     *pSim=new AliSimulation(sConfigFileName);\n");
-  if(fGenTypeCombo->GetSelected()==kBox1||fGenTypeCombo->GetSelected()==kGun7) {
+  if(fGenTypeCO->GetSelected()==kBox1||fGenTypeCO->GetSelected()==kGun7) {
     fprintf(fp,"  pSim->SetRegionOfInterest(kTRUE);\n");
     fprintf(fp,"  pSim->SetMakeSDigits(\"TOF RICH\");\n");
     fprintf(fp,"  pSim->SetMakeDigitsFromHits(\"ITS TPC TRD\");\n");
   }
 //RAW data generation  
-  if(fRawBtnGrp->GetButton(kRawDdl)->GetState())  fprintf(fp,"  pSim->SetWriteRawData(\"ALL\");");
-  if(fRawBtnGrp->GetButton(kRawDate)->GetState()) fprintf(fp,"  pSim->SetWriteRawData(\"ALL\",\".date\");");
-  if(fRawBtnGrp->GetButton(kRawRoot)->GetState()) fprintf(fp,"  pSim->SetWriteRawData(\"ALL\",\".root\");");
+  if     (fRawBG->GetButton(kRawDdl)->GetState())  fprintf(fp,"  pSim->SetWriteRawData(\"ALL\");\n");
+  else if(fRawBG->GetButton(kRawDate)->GetState()) fprintf(fp,"  pSim->SetWriteRawData(\"ALL\",\".date\");\n");
+  else if(fRawBG->GetButton(kRawRoot)->GetState()) fprintf(fp,"  pSim->SetWriteRawData(\"ALL\",\".root\");\n");
   
-  fprintf(fp,"  pSim->Run(iNevents); delete pSim;\n\n");
+  fprintf(fp,"  pSim->Run(iNevents);\n  delete pSim;\n\n");
 //reconstraction section  
-  if(fRichVerCombo->GetSelected()==kNormalRich){
+  if(fRichCO->GetSelected()==kVer1){
     fprintf(fp,"  AliReconstruction *pRec=new AliReconstruction;\n");
     fprintf(fp,"  pRec->SetRunLocalReconstruction(\"ITS TPC TRD TOF RICH\");\n");
     fprintf(fp,"  pRec->SetFillESD(\"ITS TPC TRD TOF RICH\");\n");
@@ -418,7 +469,7 @@ void RichConfig::CreateRichBatch()
 //benchmarks  
   fprintf(fp,"  cout<<\"!!!!!!!!!!!!Info in <my/RichBatch.C>: Start time: \";time.Print();\n");
   fprintf(fp,"  cout<<\"!!!!!!!!!!!!Info in <my/RichBatch.C>: Stop  time: \";time.Set();  time.Print();\n");
-  fprintf(fp,"  gBenchmark->Show(\"ALICE\");");
+  fprintf(fp,"  gBenchmark->Show(\"ALICE\");\n");
 //indicate end of job  
   fprintf(fp,"  gSystem->Exec(\"touch ZZZ______finished_______ZZZ\");\n");
   fprintf(fp,"  gSystem->Exec(\"playwave ~/bin/end.wav\");\n");
@@ -432,7 +483,7 @@ void RichConfig::Exit()
 //slot to be invoked by clik on the Create button  
   CreateConfig();
   CreateRichBatch();
-//  SendCloseMessage();
+  SendCloseMessage();
 }
 //__________________________________________________________________________________________________
 RichConfig *rc;
index f22cfb52e9530575c9b412024b9a764e1922dabf..2734bbbd6dcd308ee8066f8db2f4633fa384f292 100644 (file)
@@ -9,28 +9,10 @@
 #endif
 
 //globals for easy manual manipulations
-AliRun *a;       
-AliRunLoader *al;
-AliLoader *rl;
-AliRICH *r;
-AliStack *s;
+AliRun *a;    AliStack *s;  AliRunLoader *al; 
+AliRICH   *r; AliVHMPID *v; AliLoader    *rl,*vl;
+
 
-void ph(Int_t event=0)  {r->PrintHits(event);}    //utility print hits for 'event' event
-void ps(Int_t event=0)  {r->PrintSDigits(event);} //utility print sdigits
-void pd(Int_t event=0)  {r->PrintDigits(event);}  //utility print digits
-void pc(Int_t event=0)  {r->PrintClusters(event);}//utility print clusters
-void pt(Int_t event=0)  {r->PrintTracks(event);}  //utility print tracks
-Int_t nem(Int_t event=0)  {AliRICHDisplFast::Nparticles(kElectron  ,event,al);} //utility number of electrons
-Int_t nep(Int_t event=0)  {AliRICHDisplFast::Nparticles(kPositron  ,event,al);} //utility number of positrons
-Int_t nmup(Int_t event=0) {AliRICHDisplFast::Nparticles(kMuonPlus  ,event,al);} //utility number of positive muons
-Int_t nmum(Int_t event=0) {AliRICHDisplFast::Nparticles(kMuonMinus ,event,al);} //utility number of negative muons
-Int_t npi0(Int_t event=0) {AliRICHDisplFast::Nparticles(kPi0       ,event,al);} //utility number of electrons
-Int_t npip(Int_t event=0) {AliRICHDisplFast::Nparticles(kPiPlus    ,event,al);} //utility number of electrons
-Int_t npim(Int_t event=0) {AliRICHDisplFast::Nparticles(kPiMinus   ,event,al);} //utility number of electrons
-Int_t nk0(Int_t event=0)  {AliRICHDisplFast::Nparticles(kK0        ,event,al);} //utility number of electrons
-Int_t nkp(Int_t event=0)  {AliRICHDisplFast::Nparticles(kKPlus     ,event,al);} //utility number of electrons
-Int_t nkm(Int_t event=0)  {AliRICHDisplFast::Nparticles(kKMinus    ,event,al);} //utility number of electrons
-Int_t npp(Int_t event=0)  {AliRICHDisplFast::Nparticles(kProton    ,event,al);} //utility number of protons
 //__________________________________________________________________________________________________
 void pp(int tid)
 {
@@ -50,11 +32,11 @@ void PrintParticleInfo(int tid)
 // Prints particle info for a given TID
   TParticle *p=al->Stack()->Particle(tid);
   cout<<p->GetName()<<"("<<tid<<")";
-  if(p->GetMother(0)!=-1){cout<<" from "; PrintParticleInfo(p->GetMother(0));}
+  if(!p->IsPrimary()){cout<<" from "; PrintParticleInfo(p->GetFirstMother());}
   else                   {cout<<endl;} 
 }    
 //__________________________________________________________________________________________________
-Int_t prim(Int_t tid)
+Int_t mother(Int_t tid)
 {
 // Who is the mother of given track TID?
   al->LoadHeader();  al->LoadKinematics();
@@ -64,121 +46,101 @@ Int_t prim(Int_t tid)
   else
     while(1){
       TParticle *p=al->Stack()->Particle(tid);
-      if(p->GetMother(0)==-1) break;
-      tid=p->GetMother(0);
+      if(p->IsPrimary()) break;
+      tid=p->GetFirstMother();
     }
   
   al->UnloadKinematics();  al->UnloadHeader();
   return tid;
 }
-
-//__________________________________________________________________________________________________
-void HitDigitClusters()
-{  
-
-      Bool_t isHits=!rl->LoadHits();  
-        Bool_t isSdigits=!rl->LoadSDigits();  
-          Bool_t isDigits=!rl->LoadDigits();//loaders
-            Bool_t isClusters=!rl->LoadRecPoints();
-  
-  for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
-    
-    
-    Int_t iHitsCounter=0;
-    Info("Show-HIT","Evt %i->   %i particles %i primaries  %i entries in TreeH %i hits",
-                     iEventN,   iNparticles,    iNprims,      iNentries,         iHitsCounter);
-    
-    if(isSdigits){
-      rl->TreeS()->GetEntry(0);
-      Info("Show-SDI","Evt %i contains %5i sdigits",iEventN,r->SDigits()->GetEntries());
-    }
-    if(isDigits){
-      rl->TreeD()->GetEntry(0);
-      for(int i=1;i<=7;i++)
-        Info("Show-DIG","Evt %i chamber %i contains %5i digits",
-                                 iEventN,   i,           r->Digits(i)->GetEntries());
-    }else
-        Info("Show-DIG","There is no digits for this event");
-    if(isClusters){
-      rl->TreeR()->GetEntry(0);
-      for(int i=1;i<=7;i++)
-        Info("Show-CLU","Evt %i chamber %i contains %5i clusters",
-                                 iEventN,   i,           r->Clusters(i)->GetEntries());
-    }
-    cout<<endl;
-  }//events loop
-//unload all trees    
-  rl->UnloadHits();  
-    if(isSdigits) rl->UnloadSDigits(); 
-      if(isDigits) rl->UnloadDigits(); 
-        if(isClusters) rl->UnloadRecPoints();
-}//void Show()
 //__________________________________________________________________________________________________
 
-Bool_t ReadAlice()
+Bool_t AliceRead()
 {
-  Info("ReadAlice","Tring to read ALICE from SIMULATED FILE.");
+  Info("ReadAlice","Tring to read ALICE from SIMULATED FILE...");
   if(gAlice){
     delete gAlice->GetRunLoader();
     delete gAlice;
   }      
-  if(!(al=AliRunLoader::Open())){//if not possible to read from galice.root, then create the new session
-    gSystem->Exec("rm -rf *.root *.dat");
-    Error("menu.C::ReadAlice","galice.root broken, removing all this garbage then init new one");
-    new AliRun("gAlice","Alice experiment system");
-    AliLog::SetModuleDebugLevel("RICH",1);
-    gAlice->Init("Config.C");
-    r=(AliRICH*)gAlice->GetDetector("RICH");
-    a=gAlice; //for manual convinience
-    return kFALSE;
-  }
-  al->LoadgAlice();//before this gAlice is 0;
-  if(!gAlice) Fatal("menu.C::ReadAlice","No gAlice in file");
-  a=al->GetAliRun();//provides pointer to AliRun object
-//RICH      
-  if(!(r=(AliRICH*)gAlice->GetDetector("RICH"))) Warning("RICH/menu.C::ReadAlice","No RICH in file");
-  if(!(rl=al->GetLoader("RICHLoader")))          Warning("RICH/menu.C::ReadAlice","No RICH loader in file");        
-        
-  Info("ReadAlice","Run contains %i event(s)",gAlice->GetEventsPerRun());      
-  return kTRUE;
+  
+  if(gSystem->Exec("ls galice.root>/dev/null")==256){//there is no galice.root in current directory
+    AliceNew();
+    RichGet();
+    return kFALSE; //new session
+  }else{
+    if(!(al=AliRunLoader::Open())){//if not possible to read from galice.root, then remove grabage and reinvoke AliceRead()
+      gSystem->Exec("rm -rf *.root *.dat");
+      AliceRead();
+    }
+    al->LoadgAlice();//before this gAlice is 0;
+    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());      
+    RichGet();
+    return kTRUE;   //old session opened from file
+  }        
+}//AliceRead()
+//__________________________________________________________________________________________________
+void AliceNew()
+{
+  Info("AliceNew","Init new session");
+  new AliRun("gAlice","Alice experiment system");  gAlice->Init(); a=gAlice; al=gAlice->GetRunLoader();
+}//AliceNew()    
+//__________________________________________________________________________________________________
+void RichGet()
+{
+  if(!(r=r()))     Warning("RICH/menu.C::ReadAlice","No RICH in file");
+  if(!(rl=rl()))   Warning("RICH/menu.C::ReadAlice","No RICH loader in file");        
+  
+  if(!(v=v()))     Warning("RICH/menu.C::ReadAlice","No VHMPID in file");
+  if(!(vl=vl()))   Warning("RICH/menu.C::ReadAlice","No VHMPID loader in file");        
 }
+
+
 //__________________________________________________________________________________________________
 void TestMenu()
 {
   TControlBar *pMenu = new TControlBar("vertical","RICH test");
-  pMenu->AddButton("Test segmentation"  ,"rp->TestSeg()"  ,"Test AliRICHParam segmentation methods");
-  pMenu->AddButton("Test response"      ,"rp->TestResp()" ,"Test AliRICHParam response methods");
-  pMenu->AddButton("Test transformation","rp->TestTrans()","Test AliRICHParam transformation methods");
-  pMenu->AddButton("Test opticals"      ,".x Opticals.h"  ,"Test optical properties");
   pMenu->Show();  
 }//TestMenu()
 //__________________________________________________________________________________________________
-void ShowMenu()
+void MenuRich()
+{
+  TControlBar *pMenu = new TControlBar("vertical","RICH");
+  pMenu->AddButton("Charged flux on RICH"  ,"r->AnaHits()"  ,"????");
+  pMenu->AddButton("Recon with stack", "r()->CheckPR()"                                           , "Create RSR.root with ntuple hn");    
+  pMenu->AddButton("Display Fast"    , "AliRICHDisplFast *d = new AliRICHDisplFast(); d->Exec();" , "Display Fast");
+  pMenu->Show();  
+}//TestMenu()
+//__________________________________________________________________________________________________
+void MenuTic()
 {
-  TControlBar *pMenu = new TControlBar("vertical","RICH show");
-  pMenu->AddButton("Charged flux on RICH"  ,"ChargedFlux()"  ,"????");
-  pMenu->AddButton("Hit-Digit-Cluster"     ,"Hit()"  ,"????");
+  TControlBar *pMenu = new TControlBar("vertical","VHMPID");
+  pMenu->AddButton("Print hits"       ,"v->HitsPrint()","????");
+  pMenu->AddButton("Hits cotrol plots","v->HitsAna()"  ,"????");
+  pMenu->AddButton("Display"          ,"v->Display()"  ,"????");
   pMenu->Show();  
 }//TestMenu()
 //__________________________________________________________________________________________________
 void RichMenu()
-{ 
-  TControlBar *pMenu = new TControlBar("vertical","RICH main");
+{   
+  TControlBar *pMenu = new TControlBar("vertical","MAIN");
        
-  if(ReadAlice()){//it's from file, show some info
-    pMenu->AddButton("Show submenu"    , "ShowMenu()"                                               , "Show submenu");
-    pMenu->AddButton("Display Fast"    , "AliRICHDisplFast *d = new AliRICHDisplFast(); d->Exec();" , "Display Fast");
-    pMenu->AddButton("Recon with stack", "r->CheckPR()"                                             , "Create RSR.root with ntuple hn");    
+  if(AliceRead()){//it's from file, show some info
+    if(r) pMenu->AddButton("RICH submenu"    , "MenuRich()"               , "Show RICH submenu"       );
+    if(v) pMenu->AddButton("VHMPID submenu"  , "MenuTic()"                , "Show VHMPID submenu"     );    
   }else{//it's aliroot, simulate
     pMenu->AddButton("Debug ON",     "DebugON();",   "Switch debug on-off");   
-    pMenu->AddButton("Debug OFF",    "DebugOFF();",   "Switch debug on-off");   
-    pMenu->AddButton("Run",         "a->Run(1)",       "Process!");
-    pMenu->AddButton("Geo GUI",     "GeomGui()",       "Shows geometry"); 
-    pMenu->AddButton("Read RAW",    "ReadRaw()",       "Read a list of digits from test beam file"); 
+    pMenu->AddButton("Debug OFF",    "DebugOFF();",  "Switch debug on-off");   
+    pMenu->AddButton("Run",          "a()->Run(1)",  "Process!");
   }
-  pMenu->AddButton("Test submenu",    "TestMenu()",            "Shows test submenu");
-  pMenu->AddButton("Browser",         "new TBrowser;",         "Start ROOT TBrowser");
-  pMenu->AddButton("Quit",            ".q",                    "Close session");
+  pMenu->AddButton("Test segmentation"  ,"rp->TestSeg()"  ,"Test AliRICHParam segmentation methods"     );
+  pMenu->AddButton("Test response"      ,"rp->TestResp()" ,"Test AliRICHParam response methods"         );
+  pMenu->AddButton("Test transformation","rp->TestTrans()","Test AliRICHParam transformation methods"   );
+  pMenu->AddButton("Test opticals"      ,".x Opticals.h"  ,"Test optical properties"                    );
+  pMenu->AddButton("Geo GUI"            ,"GeomGui()"      ,"Shows geometry"                             ); 
+  pMenu->AddButton("Browser"            ,"new TBrowser;"  ,"Start ROOT TBrowser"                        );
+  pMenu->AddButton("Quit"               ,".q"             ,"Close session"                              );
   pMenu->Show();
 }//menu()
 //__________________________________________________________________________________________________
@@ -189,138 +151,32 @@ void GeomGui()
 {
   if(gGeoManager){ 
     gGeoManager->GetTopVolume()->Draw(); 
-    AliRICHParam::ShowAxis();
+    AliRICHParam::DrawAxis();
   }else 
     new G3GeometryGUI;
 }  
-//__________________________________________________________________________________________________
-void ChargedFlux(Double_t cut=0,Double_t cutele=0,Double_t cutR=600)
-{
-  Double_t cutPantiproton    =cut;
-  Double_t cutPkaonminus     =cut;
-  Double_t cutPpionminus     =cut;
-  Double_t cutPmuonminus     =cut;
-  Double_t cutPpositron      =cutele;
-                    
-  Double_t cutPelectron      =cutele;
-  Double_t cutPmuonplus      =cut;
-  Double_t cutPpionplus      =cut;
-  Double_t cutPkaonplus      =cut;
-  Double_t cutPproton        =cut;
-                       
-  TH2F *pFluxH2    =new TH2F("flux",Form("Charged flux for central Hijing event with Vertex<%.1fcm",cutR),10,-5,5, 10,0,10); pFluxH2->SetStats(0);
-  pFluxH2->GetXaxis()->SetBinLabel(1 ,Form("p^{-}>%.3fGeV/c"   ,cutPantiproton));        
-  pFluxH2->GetXaxis()->SetBinLabel(2 ,Form("K^{-}>%.3fGeV/c"   ,cutPkaonminus ));        
-  pFluxH2->GetXaxis()->SetBinLabel(3 ,Form("#pi^{-}>%.3fGeV/c" ,cutPpionminus ));      
-  pFluxH2->GetXaxis()->SetBinLabel(4 ,Form("#mu^{-}>%.3fGeV/c" ,cutPmuonminus ));      
-  pFluxH2->GetXaxis()->SetBinLabel(5 ,Form("e^{+}>%.3fGeV/c"   ,cutPpositron  ));        
-  
-  pFluxH2->GetXaxis()->SetBinLabel(6 ,Form("e^{-}>%.3fGeV/c"   ,cutPelectron  ));        
-  pFluxH2->GetXaxis()->SetBinLabel(7 ,Form("#mu^{+}>%.3fGeV/c" ,cutPmuonplus  ));      
-  pFluxH2->GetXaxis()->SetBinLabel(8 ,Form("#pi^{+}>%.3fGeV/c" ,cutPpionplus  ));      
-  pFluxH2->GetXaxis()->SetBinLabel(9 ,Form("K^{+}>%.3fGeV/c"   ,cutPkaonplus  ));        
-  pFluxH2->GetXaxis()->SetBinLabel(10,Form("p^{+}>%.3fGeV/c"   ,cutPproton    ));        
-  
-  pFluxH2->GetYaxis()->SetBinLabel(1,"sum");  
-  pFluxH2->GetYaxis()->SetBinLabel(2,"ch1");  
-  pFluxH2->GetYaxis()->SetBinLabel(3,"ch2");  
-  pFluxH2->GetYaxis()->SetBinLabel(4,"ch3");  
-  pFluxH2->GetYaxis()->SetBinLabel(5,"ch4");  
-  pFluxH2->GetYaxis()->SetBinLabel(6,"ch5");  
-  pFluxH2->GetYaxis()->SetBinLabel(7,"ch6");  
-  pFluxH2->GetYaxis()->SetBinLabel(8,"ch7");  
-  pFluxH2->GetYaxis()->SetBinLabel(9,"prim"); 
-  pFluxH2->GetYaxis()->SetBinLabel(10,"tot");  
 
-  TH2F *pElecRZ =new TH2F("RZElec","Electrons hit RICH;Z[cm];R[cm]"     ,1000,-300,300,200,-500,500); 
-  TH2F *pElecR  =new TH2F("RElec","Electrons hit RICH;p[GeV];R[cm]"     ,1000,-1,1,100,0,500); 
-  TH1F *pElecP  =new TH1F("Pelec"  ,"Electrons hit RICH;p[GeV]"         ,1000,-1,1); 
-  TH1F *pMuonP  =new TH1F("Pmuon"  ,"Muons hit RICH;p[GeV]"             ,1000,-4,4); 
-  TH1F *pPionP  =new TH1F("Ppion"  ,"Pions hit RICH;p[GeV]"             ,1000,-4,4); 
-  TH1F *pKaonP  =new TH1F("Pkaon"  ,"Kaons hit RICH;p[GeV]"             ,1000,-4,4); 
-  TH1F *pProtP  =new TH1F("Pprot"  ,"Protons hit RICH;p[GeV]"           ,1000,-4,4); 
-  
-  al->LoadHeader(); 
-  al->LoadKinematics();  
-  Int_t iNparticles=al->Stack()->GetNtrack();
-  Int_t iNprims=al->Stack()->GetNprimary();
-  
-  
-  gBenchmark->Start("ChargedFlux");
-  for(Int_t iParticleN=0;iParticleN<iNparticles;iParticleN++){//stack loop
-    TParticle *pPart=al->Stack()->Particle(iParticleN);
+AliRun    *a() {return al->GetAliRun();}                         //provides pointer to main AliRun object (aka gAlice)
+AliRICH   *r() {return (AliRICH*)  a()->GetDetector("RICH");}    //provides pointer to RICH detector
+AliLoader *rl(){return             al->GetLoader("RICHLoader");}
 
-    if(iParticleN%10000==0) Info("Show-STA"," %i particles read",iParticleN);
-    
-    switch(pPart->GetPdgCode()){
-      case kProtonBar: pFluxH2->Fill(-4.5,9.5); if(pPart->GetFirstMother()<0) pFluxH2->Fill(-4.5,8.5); break;
-      case kKMinus:    pFluxH2->Fill(-3.5,9.5); if(pPart->GetFirstMother()<0) pFluxH2->Fill(-3.5,8.5); break;
-      case kPiMinus:   pFluxH2->Fill(-2.5,9.5); if(pPart->GetFirstMother()<0) pFluxH2->Fill(-2.5,8.5); break;
-      case kMuonMinus: pFluxH2->Fill(-1.5,9.5); if(pPart->GetFirstMother()<0) pFluxH2->Fill(-1.5,8.5); break;
-      case kPositron:  pFluxH2->Fill(-0.5,9.5); if(pPart->GetFirstMother()<0) pFluxH2->Fill(-0.5,8.5); break;
-      
-      case kElectron:  pFluxH2->Fill( 0.5,9.5); if(pPart->GetFirstMother()<0) pFluxH2->Fill( 0.5,8.5); break;      
-      case kMuonPlus:  pFluxH2->Fill( 1.5,9.5); if(pPart->GetFirstMother()<0) pFluxH2->Fill( 1.5,8.5); break;      
-      case kPiPlus:    pFluxH2->Fill( 2.5,9.5); if(pPart->GetFirstMother()<0) pFluxH2->Fill( 2.5,8.5); break;      
-      case kKPlus:     pFluxH2->Fill( 3.5,9.5); if(pPart->GetFirstMother()<0) pFluxH2->Fill( 3.5,8.5); break;      
-      case kProton:    pFluxH2->Fill( 4.5,9.5); if(pPart->GetFirstMother()<0) pFluxH2->Fill( 4.5,8.5); break;            
-    }//switch
-  }//stack loop
+AliVHMPID *v() {return (AliVHMPID*)a()->GetDetector("VHMPID");}  //provides pointer to VHMPID detector
+AliLoader *vl(){return             al->GetLoader("VHMPIDLoader");}
 
-    
-  rl->LoadHits(); 
-    
-  for(Int_t iEntryN=0;iEntryN < rl->TreeH()->GetEntries();iEntryN++){//TreeH loop
-    rl->TreeH()->GetEntry(iEntryN);//get current entry (prim)                
-    for(Int_t iHitN=0;iHitN<r->Hits()->GetEntries();iHitN++){//hits loop
-      AliRICHhit *pHit = (AliRICHhit*)r->Hits()->At(iHitN);//get current hit
-      TParticle  *pPart=al->Stack()->Particle(pHit->GetTrack());//get stack particle which produced the current hit
-      
-      Double_t R=TMath::Sqrt(pPart->Vx()*pPart->Vx()+pPart->Vy()*pPart->Vy());
-      if(R>cutR) continue;
-      
-      switch(pPart->GetPdgCode()){
-        case kProtonBar: if(pPart->P()>cutPantiproton) {pProtP->Fill(-pPart->P()); pFluxH2->Fill(-4.5,pHit->C()+0.5);}break;
-        case kKMinus   : if(pPart->P()>cutPkaonminus)  {pKaonP->Fill(-pPart->P()); pFluxH2->Fill(-3.5,pHit->C()+0.5);}break;
-        case kPiMinus  : if(pPart->P()>cutPpionminus)  {pPionP->Fill(-pPart->P()); pFluxH2->Fill(-2.5,pHit->C()+0.5);}break;
-        case kMuonMinus: if(pPart->P()>cutPmuonminus)  {pMuonP->Fill(-pPart->P()); pFluxH2->Fill(-1.5,pHit->C()+0.5);}break;        
-        case kPositron : if(pPart->P()>cutPpositron)   {pElecP->Fill(-pPart->P()); pFluxH2->Fill(-0.5,pHit->C()+0.5);
-                                                        pElecR->Fill(-pPart->P(),R);pElecRZ->Fill(pPart->Vz(),-R);}break;
-        
-        case kElectron : if(pPart->P()>cutPelectron)   {pElecP->Fill( pPart->P()); pFluxH2->Fill( 0.5,pHit->C()+0.5);
-                                                        pElecR->Fill( pPart->P(),R);pElecRZ->Fill(pPart->Vz(),R);}break;         
-        case kMuonPlus : if(pPart->P()>cutPmuonplus)   {pMuonP->Fill( pPart->P()); pFluxH2->Fill( 1.5,pHit->C()+0.5);}break;                     
-        case kPiPlus   : if(pPart->P()>cutPpionplus)   {pPionP->Fill( pPart->P()); pFluxH2->Fill( 2.5,pHit->C()+0.5);}break;           
-        case kKPlus    : if(pPart->P()>cutPkaonplus)   {pKaonP->Fill( pPart->P()); pFluxH2->Fill( 3.5,pHit->C()+0.5);}break;           
-        case kProton   : if(pPart->P()>cutPproton)     {pProtP->Fill( pPart->P()); pFluxH2->Fill( 4.5,pHit->C()+0.5);}break;
-      }
-    }//hits loop      
-  }//TreeH loop
-                        
-  gBenchmark->Show("ChargedFlux");
-  rl->UnloadHits();  
-  al->UnloadHeader(); 
-  al->UnloadKinematics();  
-  
-  
-  for(Int_t i=1;i<=pFluxH2->GetNbinsX();i++){
-    Stat_t sum=0;
-    for(Int_t j=2;j<=8;j++)    sum+=pFluxH2->GetBinContent(i,j);    
-    pFluxH2->SetBinContent(i,1,sum);
-  }
-  
-  TCanvas *pC1=new TCanvas("canvas1",Form("Event Nprims=%i",iNprims),1000,900);
-  pFluxH2->Draw("text");  gPad->SetGrid();
-  
-  new TCanvas("relec","",200,100); pElecR->Draw();
-  new TCanvas("relez","",200,100); pElecRZ->Draw();
-  new TCanvas("celec","",200,100); pElecP->Draw();
-  new TCanvas("cmuon","",200,100); pMuonP->Draw();
-  new TCanvas("cpion","",200,100); pPionP->Draw();
-  new TCanvas("ckaon","",200,100); pKaonP->Draw();
-  new TCanvas("cprot","",200,100); pProtP->Draw();
-  
-  TFile *fileout = new TFile("fileout","recreate");
-   
-  
-}
+void rh(Int_t event=0)    {r->PrintHits(event);}     //utility print hits for 'event' event
+void rs(Int_t event=0)    {r->PrintSDigits(event);}  //utility print sdigits
+void rd(Int_t event=0)    {r->PrintDigits(event);}   //utility print digits
+void rc(Int_t event=0)    {r->PrintClusters(event);} //utility print clusters
+void rt(Int_t event=0)    {r->PrintTracks(event);}   //utility print tracks
+Int_t nem(Int_t event=0)  {AliRICHDisplFast::Nparticles(kElectron  ,event,al);} //utility number of electrons
+Int_t nep(Int_t event=0)  {AliRICHDisplFast::Nparticles(kPositron  ,event,al);} //utility number of positrons
+Int_t nmup(Int_t event=0) {AliRICHDisplFast::Nparticles(kMuonPlus  ,event,al);} //utility number of positive muons
+Int_t nmum(Int_t event=0) {AliRICHDisplFast::Nparticles(kMuonMinus ,event,al);} //utility number of negative muons
+Int_t npi0(Int_t event=0) {AliRICHDisplFast::Nparticles(kPi0       ,event,al);} //utility number of neutral pions 
+Int_t npip(Int_t event=0) {AliRICHDisplFast::Nparticles(kPiPlus    ,event,al);} //utility number of positive pions
+Int_t npim(Int_t event=0) {AliRICHDisplFast::Nparticles(kPiMinus   ,event,al);} //utility number of negative pions
+Int_t nk0(Int_t event=0)  {AliRICHDisplFast::Nparticles(kK0        ,event,al);} //utility number of neutral kaons
+Int_t nkp(Int_t event=0)  {AliRICHDisplFast::Nparticles(kKPlus     ,event,al);} //utility number of positive kaons
+Int_t nkm(Int_t event=0)  {AliRICHDisplFast::Nparticles(kKMinus    ,event,al);} //utility number of negative kaons
+Int_t npp(Int_t event=0)  {AliRICHDisplFast::Nparticles(kProton    ,event,al);} //utility number of protons
+Int_t npm(Int_t event=0)  {AliRICHDisplFast::Nparticles(kProtonBar ,event,al);} //utility number of antiprotons
index 05a0e24f06349f908b378ce784b8e529d41cc69c..5f1a6973bc7676f185b8b8eec781b0036331390a 100644 (file)
@@ -1,5 +1,9 @@
 How to open session:
        use static method  AliRunLoader::Open("galice.root","AlicE","update")
+How to get total number of events in galice.root:
+       use AliRun::GetEventsPerRun()        
+How to avoid using gAlice:
+       detector->GetLoader()->GetRunLoader()->GetAliRun() returns gAlice global pointer.
 How to retrieve pointer to alice run loader:
         use pRICH->GetLoader()->GetRunLoader() (all detector classes inherit from AliDetector which has GetLoader())
        use method AliRun::GetRunLoader for gAlice (deprecated)
@@ -35,7 +39,7 @@ How to retrieve sdigits?
        Sdigits stored in tree S with the branch of TClonesArray, all sdigits in a single TClonesArray
        So the tree has only one entry.
        One needs to say:
-       pRich->GetLoader()->LoadSDigits(); this one open file, get the tree and invoke AliRICH::SetTreeAddress()    
+       -pRich->GetLoader()->LoadSDigits(); this one open file, get the tree and invoke AliRICH::SetTreeAddress()    
 How to retrieve digits? 
        Digits stored in tree D with the 7 branches of TClonesArray, one per chamber, all digits of a given chamber in a single TClonesArray
        So the tree has only one entry.
@@ -46,10 +50,7 @@ How to retrieve digits?
           pRich->GetLoader()->TreeD()->GetEntry(0) 
        -Finally pRich->Digits(chamber_number) returns the pointer to TClonesArray of AliRICHdigit          
 What are the debug methods avail:
-       AliModule::GetDebug() now depricated, use AliDebug printout instead
-       AliModule::SetDebug()
-       AliRun::GetDebug()
-       AliRun::SetDebug()
+        AliLog::SetGlobalDebugLevel(AliLog::kDebug)
 How to get info for a given particle number:
        Header and Kinematics trees must be loaded, then possible to retrieve pointer to Stack of particles
        Int_t AliRunLoader::LoadHeader(); Int_t AliRunLoader::LoadKinematics()
@@ -58,9 +59,7 @@ How to get info for a given particle number:
        TParticle::Print()
 How to deal with AliRunDigitizer:
        AliRunDigitizer::Exec() just call AliRunDigitizer::Digitize()   
-How to avoid using gAlice:
-       Rich()->GetLoader()->GetRunLoader()->GetAliRun() returns gAlice global pointer.
-What are hte meanings of different VMC flags:         
+What are the meanings of different VMC flags:         
        gMC->IsTrackAlive()
        gMC->IsTrackStop()
        gMC->IsTrackDisappeared()
@@ -75,5 +74,16 @@ How is sdigit produced from hit:
 How to get pad number for a local position:
        use static TVector AliRICHParam::Loc2Pad(TVector2 position);
 Why list of chambers belongs to AliRICHParam:
+
+How to check if a given stack particle is primary:
+       Stack is TClonesArray of TParticle. TParticle::GetMother(0) returns -1 if it's primary (no mother)         
+How to loop over all possible object:         
+  for(Int_t iEventN=0;iEventN < GetLoader()->GetRunLoader()->GetAliRun()->GetEventsPerRun();iEventN++){//events loop
+    for(Int_t iEntryN=0;iEntryN < GetLoader()->TreeH()->GetEntries();iEntryN++){//TreeH loop
+      GetLoader()->TreeH()->GetEntry(iEntryN);//get current entry (prim)  
+      for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){//hits loop
+        AliVHMPIDHit *pHit=(AliVHMPIDHit*)Hits()->At(iHitN);//get current hit 
         
-        
+      }//hits loop
+    }//TreeH loop
+  }//events loop