some minor changes to adpat for the situation when no digits or clusters avalbale
[u/mrichter/AliRoot.git] / RICH / CreateConfig.C
1 class KirConfig
2 {
3 RQ_OBJECT()
4 public:
5   enum EDetectors {kPIPE=1,kITS=2,kTPC=4,kTRD=8,kTOF=16,kFRAME=32,kMAG=64,kCRT=128,kHALL=256,kPHOS=512,kSTART=1024,kFMD=2048,kABSO=4096,
6                    kPMD=8192,kDIPO=16384,kEMCAL=32768,kVZERO=65536,kMUON=131072,kZDC=262144,kSHILD=524288};
7   enum EProcesses {kDCAY=1,kPAIR=2,kCOMP=4,kPHOT=8,kPFIS=16,kDRAY=32,kANNI=64,kBREM=128,kMUNU=256,kCKOV=512,kHADR=1024,kLOSS=2048,kMULS=4096,
8                    kRAYL=8192};
9   enum EGenTypes  {kGun1,kGun7,kPythia7,kHijing,kHijingPara};
10   
11           KirConfig(const char*sFileName);
12          ~KirConfig()                    {Info("ctor","");fMain->Cleanup(); delete fMain;}
13   void    AddDetector(Int_t id)          {fDetectors+=id; if(id==kTRD) fDetButGrp->SetButton(kFRAME);}
14   void    RemoveDetector(Int_t id)       {fDetectors-=id; if(id==kFRAME&&IsDetectorOn(kTRD)) fDetButGrp->SetButton(kTRD,kFALSE);}
15   void    AddProcess(Int_t id)           {fProcesses+=id;}
16   void    RemoveProcess(Int_t id)        {fProcesses-=id;}
17   Bool_t  IsDetectorOn(Int_t id)    const{return fDetectors&id;}
18   Bool_t  IsProcessOn(Int_t id)     const{return fProcesses&id;}
19   Float_t Eta2Theta(Float_t arg)    const{return (180./TMath::Pi())*2.*TMath::ATan(TMath::Exp(-arg));}
20   void    CreateConfigFile();
21 protected:
22   TGMainFrame  *fMain;//main window poiter
23   TGComboBox   *fRichVersionCombo;  TGButton *fRichTopChkBtn;//RICH
24   TGButton     *fMagFldChkBtn;                               //MAG
25   TGComboBox   *fGenTypeCombo,*fGenPartIdCombo,*fGenMomCombo,*fGenChamberCombo; TGNumberEntry *fGenNprimEntry;//GEN
26   Int_t         fDetectors; TGButtonGroup *fDetButGrp;       //DETECTORS
27   Int_t         fProcesses;
28   char         *fFileName;
29 };//class KirConfig
30          
31 KirConfig::KirConfig(const char *sFileName)
32 {   
33   fFileName=sFileName;
34   fDetectors=0;
35 // Create main frame       
36   fMain=new TGMainFrame(gClient->GetRoot(),500,400);
37 //  fMain->Connect("CloseWindow()","KirConfig",this,"CloseWindow()");   
38   fMain->AddFrame(pHorFrame=new TGHorizontalFrame(fMain,100,200));
39 //RICH
40   pHorFrame->AddFrame(pVerFrame=new TGVerticalFrame(pHorFrame,100,200));  
41   pVerFrame->AddFrame(pRichGrpFrm=new TGGroupFrame(pHorFrame,"RICH"));
42   pRichGrpFrm->AddFrame(fRichVersionCombo=new TGComboBox(pRichGrpFrm,100));
43   fRichVersionCombo->AddEntry("no RICH",-1);
44   fRichVersionCombo->AddEntry("version 0",0);  
45   fRichVersionCombo->AddEntry("version 1",1);
46   fRichVersionCombo->Select(1);  fRichVersionCombo->Resize(160,20);
47   pRichGrpFrm->AddFrame(fRichTopChkBtn=new TGCheckButton(pRichGrpFrm,"Rotate to Top?"));
48 //Generator  
49   pVerFrame->AddFrame(pGenGrpFrm=new TGGroupFrame(pHorFrame,"Generator"));
50   pGenGrpFrm->AddFrame(fGenTypeCombo=new TGComboBox(pGenGrpFrm,100));
51   fGenTypeCombo->AddEntry("gun to single chamber",kGun1);  fGenTypeCombo->AddEntry("gun to all chambers",kGun7);
52   fGenTypeCombo->AddEntry("7 guns on top of Pythia",kPythia7);
53   fGenTypeCombo->AddEntry("HIJING",kHijing);                fGenTypeCombo->AddEntry("parametrized HIJING",kHijingPara);
54   fGenTypeCombo->Select(kHijingPara);
55   fGenTypeCombo->Resize(160,20);
56   
57   pGenGrpFrm->AddFrame(fGenPartIdCombo=new TGComboBox(pGenGrpFrm,100)); //PID for guns
58   fGenPartIdCombo->AddEntry("Pion+",kPiPlus);
59   fGenPartIdCombo->AddEntry("Pion-",kPiMinus);
60   fGenPartIdCombo->AddEntry("Kaon+",kKPlus);
61   fGenPartIdCombo->AddEntry("Kaon-",kKMinus);
62   fGenPartIdCombo->AddEntry("Proton",kProton);
63   fGenPartIdCombo->AddEntry("AntiProton",kProtonBar);
64   fGenPartIdCombo->Select(kPiPlus);  fGenPartIdCombo->Resize(160,20);
65
66   pGenGrpFrm->AddFrame(fGenMomCombo=new TGComboBox(pGenGrpFrm,100)); //particle energy for guns
67   fGenMomCombo->AddEntry("1.5 GeV",15);
68   fGenMomCombo->AddEntry("2.0 Gev",20);
69   fGenMomCombo->AddEntry("2.5 GeV",25);
70   fGenMomCombo->AddEntry("3.0 GeV",30);
71   fGenMomCombo->AddEntry("3.5 GeV",35);
72   fGenMomCombo->AddEntry("4.0 GeV",40);
73   fGenMomCombo->AddEntry("4.5 GeV",45);
74   fGenMomCombo->Select(40);  fGenMomCombo->Resize(160,20);
75   
76   pGenGrpFrm->AddFrame(fGenChamberCombo=new TGComboBox(pGenGrpFrm,100)); //chamber number in case of gun1
77   for(int i=1;i<=7;i++) fGenChamberCombo->AddEntry(Form("Chamber %i",i),i);
78   fGenChamberCombo->Select(4); fGenChamberCombo->Resize(160,20);
79   
80   pGenGrpFrm->AddFrame(pGenNprimFrm=new TGGroupFrame(pGenGrpFrm,"Number of primiries"));//number of primiries in case of HIJING
81   pGenNprimFrm->AddFrame(fGenNprimEntry=new TGNumberEntry(pGenNprimFrm,500));
82   
83 // Magnetic Field
84   pVerFrame->AddFrame(pFldGrpFrm=new TGGroupFrame(pHorFrame,"Magnetic Field"));
85   pFldGrpFrm->AddFrame(fMagFldChkBtn=new TGCheckButton(pFldGrpFrm,"On/Off"));
86   fMagFldChkBtn->SetState(kButtonUp);
87 //Detectors
88   pHorFrame->AddFrame(fDetButGrp=new TGButtonGroup(pHorFrame,"Detectors"));
89   fDetButGrp->Connect("Pressed(Int_t)","KirConfig",this,"AddDetector(Int_t)");
90   fDetButGrp->Connect("Released(Int_t)","KirConfig",this,"RemoveDetector(Int_t)");
91   new TGCheckButton(fDetButGrp,"PIPE"  ,kPIPE));         
92   new TGCheckButton(fDetButGrp,"ITS"   ,kITS));         
93   new TGCheckButton(fDetButGrp,"TPC"   ,kTPC));
94   new TGCheckButton(fDetButGrp,"TRD"   ,kTRD));
95   new TGCheckButton(fDetButGrp,"TOF"   ,kTOF));         
96   new TGCheckButton(fDetButGrp,"FRAME" ,kFRAME));         
97   new TGCheckButton(fDetButGrp,"MAG"   ,kMAG));         
98   new TGCheckButton(fDetButGrp,"CRT"   ,kCRT));         
99   new TGCheckButton(fDetButGrp,"HALL"  ,kHALL));         
100   new TGCheckButton(fDetButGrp,"PHOS"  ,kPHOS));         
101   new TGCheckButton(fDetButGrp,"START" ,kSTART));         
102   new TGCheckButton(fDetButGrp,"FMD"   ,kFMD));         
103   new TGCheckButton(fDetButGrp,"ABSO"  ,kABSO));         
104   new TGCheckButton(fDetButGrp,"PMD"   ,kPMD));         
105   new TGCheckButton(fDetButGrp,"DIPO"  ,kDIPO));         
106   new TGCheckButton(fDetButGrp,"EMCAL" ,kEMCAL));         
107   new TGCheckButton(fDetButGrp,"VZERO" ,kVZERO));         
108   new TGCheckButton(fDetButGrp,"MUON"  ,kMUON));         
109   new TGCheckButton(fDetButGrp,"ZDC"   ,kZDC));         
110   new TGCheckButton(fDetButGrp,"SHILD" ,kSHILD));         
111 //Processes  
112   pHorFrame->AddFrame(pProcButGrp=new TGButtonGroup(pHorFrame,"Processes"));
113   pProcButGrp->Connect("Pressed(Int_t)","KirConfig",this,"AddProcess(Int_t)");
114   pProcButGrp->Connect("Released(Int_t)","KirConfig",this,"RemoveProcess(Int_t)");
115   new TGCheckButton(pProcButGrp,"DCAY decay",kDCAY));  pProcButGrp->SetButton(kDCAY);       
116   new TGCheckButton(pProcButGrp,"PAIR pair production",kPAIR));  pProcButGrp->SetButton(kPAIR);       
117   new TGCheckButton(pProcButGrp,"COMP Compton",kCOMP));  pProcButGrp->SetButton(kCOMP);
118   new TGCheckButton(pProcButGrp,"PHOT",kPHOT));  pProcButGrp->SetButton(kPHOT);
119   new TGCheckButton(pProcButGrp,"PFIS Photofission",kPFIS));  
120   new TGCheckButton(pProcButGrp,"DRAY delta electrons",kDRAY));  
121   new TGCheckButton(pProcButGrp,"ANNI annihilation",kANNI));  pProcButGrp->SetButton(kANNI);       
122   new TGCheckButton(pProcButGrp,"BREM Bremstraslung",kBREM));  pProcButGrp->SetButton(kBREM);       
123   new TGCheckButton(pProcButGrp,"MUNU",kMUNU));  pProcButGrp->SetButton(kMUNU);       
124   new TGCheckButton(pProcButGrp,"CKOV Cerenkovs",kCKOV));  pProcButGrp->SetButton(kCKOV);       
125   new TGCheckButton(pProcButGrp,"HADR Hadronic interactions ",kHADR));  pProcButGrp->SetButton(kHADR);       
126   new TGCheckButton(pProcButGrp,"LOSS",kLOSS));  pProcButGrp->SetButton(kLOSS);       
127   new TGCheckButton(pProcButGrp,"MULS",kMULS));  pProcButGrp->SetButton(kMULS);       
128   new TGCheckButton(pProcButGrp,"RAYL",kRAYL));  pProcButGrp->SetButton(kRAYL);       
129 //File    
130   fMain->AddFrame(pFileHorFrm=new TGHorizontalFrame(fMain,100,200));
131   pFileHorFrm->AddFrame(pCreateBtn=new TGTextButton(pFileHorFrm,"Create"));
132   pCreateBtn->Connect("Clicked()","KirConfig",this,"CreateConfigFile()");                                 
133   pFileHorFrm->AddFrame(new TGLabel(pFileHorFrm,Form(" config file as %s",fFileName)));  
134   
135   fMain->MapSubwindows();   
136   fMain->Layout();
137   fMain->SetWindowName("Create AliROOT Config script");
138   fMain->MapWindow();      
139 }//KirCondig::ctor
140           
141 void KirConfig::CreateConfigFile()
142 {   
143   FILE *fp=fopen(fFileName,"w"); if(!fp){Info("CreateConfigFile","Cannot open output file:%sn",fFileName);return;}
144   
145   fprintf(fp,"void Config()\n");
146   fprintf(fp,"{\n");
147   fprintf(fp,"  ::Info(\"RICH private config\",\"Start\");\n\n"); 
148 //Random
149   fprintf(fp,"  gRandom->SetSeed(123456);//put 0 to use system time\n\n");    
150 //Geant  
151   fprintf(fp,"  gSystem->Load(\"libgeant321\");\n");
152   fprintf(fp,"  new TGeant3(\"C++ Interface to Geant3\");\n\n");
153 //File
154   fprintf(fp,"  AliRunLoader *pAL=AliRunLoader::Open(\"galice.root\",AliConfig::fgkDefaultEventFolderName,\"recreate\");\n");    
155   fprintf(fp,"  pAL->SetCompressionLevel(2);\n");
156   fprintf(fp,"  pAL->SetNumberOfEventsPerFile(50);\n");
157   fprintf(fp,"  gAlice->SetRunLoader(pAL);\n\n");
158 //Decayer  
159   fprintf(fp,"  TVirtualMCDecayer *pDecayer=new AliDecayerPythia();\n");
160   fprintf(fp,"  pDecayer->SetForceDecay(kAll);\n"); 
161   fprintf(fp,"  pDecayer->Init();\n"); 
162   fprintf(fp,"  gMC->SetExternalDecayer(pDecayer);\n\n");
163 //Physics
164   if(IsProcessOn(kDCAY)) fprintf(fp,"  gMC->SetProcess(\"DCAY\",1);");  else fprintf(fp,"  gMC->SetProcess(\"DCAY\",0);");
165   if(IsProcessOn(kPAIR)) fprintf(fp,"  gMC->SetProcess(\"PAIR\",1);\n");else fprintf(fp,"  gMC->SetProcess(\"PAIR\",0);\n");
166   if(IsProcessOn(kCOMP)) fprintf(fp,"  gMC->SetProcess(\"COMP\",1);");  else fprintf(fp,"  gMC->SetProcess(\"COMP\",0);");
167   if(IsProcessOn(kPHOT)) fprintf(fp,"  gMC->SetProcess(\"PHOT\",1);\n");else fprintf(fp,"  gMC->SetProcess(\"PHOT\",0);\n");
168   if(IsProcessOn(kPFIS)) fprintf(fp,"  gMC->SetProcess(\"PFIS\",1);");  else fprintf(fp,"  gMC->SetProcess(\"PFIS\",0);");
169   if(IsProcessOn(kDRAY)) fprintf(fp,"  gMC->SetProcess(\"DRAY\",1);\n");else fprintf(fp,"  gMC->SetProcess(\"DRAY\",0);\n");
170   if(IsProcessOn(kANNI)) fprintf(fp,"  gMC->SetProcess(\"ANNI\",1);");  else fprintf(fp,"  gMC->SetProcess(\"ANNI\",0);");
171   if(IsProcessOn(kBREM)) fprintf(fp,"  gMC->SetProcess(\"BREM\",1);\n");else fprintf(fp,"  gMC->SetProcess(\"BREM\",0);\n");
172   if(IsProcessOn(kMUNU)) fprintf(fp,"  gMC->SetProcess(\"MUNU\",1);");  else fprintf(fp,"  gMC->SetProcess(\"MUNU\",0);");
173   if(IsProcessOn(kCKOV)) fprintf(fp,"  gMC->SetProcess(\"CKOV\",1);\n");else fprintf(fp,"  gMC->SetProcess(\"CKOV\",0);\n");
174   if(IsProcessOn(kHADR)) fprintf(fp,"  gMC->SetProcess(\"HADR\",1);");  else fprintf(fp,"  gMC->SetProcess(\"HADR\",0);");
175   if(IsProcessOn(kLOSS)) fprintf(fp,"  gMC->SetProcess(\"LOSS\",2);\n");else fprintf(fp,"  gMC->SetProcess(\"LOSS\",0);\n");
176   if(IsProcessOn(kMULS)) fprintf(fp,"  gMC->SetProcess(\"MULS\",1);");  else fprintf(fp,"  gMC->SetProcess(\"MULS\",0);");
177   if(IsProcessOn(kRAYL)) fprintf(fp,"  gMC->SetProcess(\"RAYL\",1);\n");else fprintf(fp,"  gMC->SetProcess(\"RAYL\",0);\n");
178   
179   fprintf(fp,"  gMC->SetCut(\"CUTGAM\",0.001); ");  fprintf(fp,"  gMC->SetCut(\"CUTELE\",0.001); ");
180   fprintf(fp,"  gMC->SetCut(\"CUTNEU\",0.001);\n"); fprintf(fp,"  gMC->SetCut(\"CUTHAD\",0.001); ");
181   fprintf(fp,"  gMC->SetCut(\"CUTMUO\",0.001); ");  fprintf(fp,"  gMC->SetCut(\"BCUTE\" ,0.001);\n");
182   fprintf(fp,"  gMC->SetCut(\"BCUTM\" ,0.001); ");  fprintf(fp,"  gMC->SetCut(\"DCUTE\" ,0.001); ");
183   fprintf(fp,"  gMC->SetCut(\"DCUTM\" ,0.001);\n");  fprintf(fp,"  gMC->SetCut(\"PPCUTM\",0.001); ");
184   fprintf(fp,"  gMC->SetCut(\"TOFMAX\",1e10);\n\n"); 
185 //Field
186   if(fMagFldChkBtn->GetState()==kButtonDown) fprintf(fp,"  gAlice->SetField();\n\n");else fprintf(fp,"  gAlice->SetField(0);\n\n");
187   fprintf(fp,"  pAL->CdGAFile();\n\n");                                 //????       
188 //BODY-ALIC 
189   fprintf(fp,"  new AliBODY(\"BODY\",\"Alice envelop\");\n\n");
190 //RICH
191   if(fRichVersionCombo->GetSelected() != -1){  
192     if(fRichTopChkBtn->GetState()==kButtonDown) fprintf(fp,"  AliRICHParam::AngleRot(0);\n");
193     switch(fRichVersionCombo->GetSelected()){//RICH
194       case 0:   fprintf(fp,"  pRICH=new AliRICHv0(\"RICH\",\"RICH version 0\");\n"); break;   
195       case 1:   fprintf(fp,"  pRICH=new AliRICHv1(\"RICH\",\"RICH version 1\");\n"); break;   
196     }
197     fprintf(fp,"  ::Info(\"RICH private config\",\"version %i\");\n\n",fRichVersionCombo->GetSelected()); 
198   }
199 //Generator
200   switch(fGenTypeCombo->GetSelected()){
201     case kHijingPara: 
202       fprintf(fp,"  AliGenHIJINGpara *pGen=new AliGenHIJINGpara(%i);\n",(int)fGenNprimEntry->GetNumber());
203       fprintf(fp,"  pGen->SetMomentumRange(0,999); pGen->SetPhiRange(0,360); pGen->SetThetaRange(%f,%f);\n",Eta2Theta(8),Eta2Theta(-8));
204       fprintf(fp,"  pGen->SetOrigin(0,0,0);  pGen->SetSigma(0,0,0);\n");
205       fprintf(fp,"  pGen->Init();\n");
206     break;
207     case kGun1:     
208       fprintf(fp,"  AliGenFixed *pGen=new AliGenFixed(1);\n");  
209       fprintf(fp,"  pGen->SetPart(%i); pGen->SetMomentum(%3.1f); pGen->SetOrigin(0,0,0);\n",fGenPartIdCombo->GetSelected(),float(fGenMomCombo->GetSelected())/10);  
210       fprintf(fp,"  pGen->SetPhiRange(pRICH->C(%i)->PhiD()); pGen->SetThetaRange(pRICH->C(%i)->ThetaD()-2);\n",fGenChamberCombo->GetSelected(),fGenChamberCombo->GetSelected());            
211       fprintf(fp,"  pGen->Init();\n");
212     break;    
213     case kGun7:   
214       fprintf(fp,"  AliGenCocktail *pCocktail=new AliGenCocktail();\n");
215       fprintf(fp,"  for(int i=1;i<=7;i++){\n");
216       fprintf(fp,"    AliGenFixed *pFixed=new AliGenFixed(1);\n");
217       fprintf(fp,"    pFixed->SetPart(%i); pFixed->SetMomentum(2.5+i*0.4); pFixed->SetOrigin(0,0,0);\n",fGenPartIdCombo->GetSelected());
218       fprintf(fp,"    pFixed->SetPhiRange(gRICH->C(i)->PhiD()); pFixed->SetThetaRange(gRICH->C(i)->ThetaD()-2);\n");                             
219       fprintf(fp,"    pCocktail->AddGenerator(pFixed,Form(\"Fixed %i\",i),1);\n  }\n");  
220       fprintf(fp,"  pCocktail->Init();\n");
221     break;
222     case kPythia7:      
223       fprintf(fp,"  AliGenCocktail *pCocktail=new AliGenCocktail();\n");
224       fprintf(fp,"  for(int i=1;i<=7;i++){\n");
225       fprintf(fp,"    AliGenFixed *pFixed=new AliGenFixed(1);\n");
226       fprintf(fp,"    pFixed->SetPart(%i); pFixed->SetMomentum(2.5+i*0.4); pFixed->SetOrigin(0,0,0);\n",fGenPartIdCombo->GetSelected());
227       fprintf(fp,"    pFixed->SetPhiRange(gRICH->C(i)->PhiD()); pFixed->SetThetaRange(gRICH->C(i)->ThetaD()-2);\n");                             
228       fprintf(fp,"    pCocktail->AddGenerator(pFixed,Form(\"Fixed %i\",i),1);\n  }\n");  
229       fprintf(fp,"  AliGenPythia *pPythia = new AliGenPythia(-1);\n");
230       fprintf(fp,"  pPythia->SetMomentumRange(0,999999); pPythia->SetPhiRange(20,80); pPythia->SetThetaRange(75,115);\n");
231       fprintf(fp,"  pPythia->SetYRange(-12,12);  pPythia->SetPtRange(0,1000);  pPythia->SetStrucFunc(kCTEQ4L);\n");
232       fprintf(fp,"  pPythia->SetProcess(kPyMb);  pPythia->SetEnergyCMS(14000);\n");      
233       fprintf(fp,"  pCocktail->AddGenerator(pPythia,\"Pythia\",1);\n");  
234       fprintf(fp,"  pCocktail->Init();\n");
235     break;  
236   }
237 //central before RICH detectors                  
238   if(IsDetectorOn(kPIPE)) fprintf(fp,"\n  new AliPIPEv0(\"PIPE\",\"Beam Pipe\");\n");
239   if(IsDetectorOn(kSHILD))fprintf(fp,"\n  new AliSHILv2(\"SHIL\",\"Shielding Version 2\");\n");  
240   if(IsDetectorOn(kITS)){
241     fprintf(fp,"\n  AliITSvPPRasymmFMD *pIts =new AliITSvPPRasymmFMD(\"ITS\",\"ITS PPR detailed version\");\n");
242     fprintf(fp,"  pIts->SetMinorVersion(2); pIts->SetReadDet(kTRUE);\n");
243     fprintf(fp,"  pIts->SetThicknessDet1(200.); pIts->SetThicknessDet2(200.);\n");
244     fprintf(fp,"  pIts->SetThicknessChip1(200.); pIts->SetThicknessChip2(200.);\n");
245     fprintf(fp,"  pIts->SetRails(0); pIts->SetCoolingFluid(1);\n");
246     fprintf(fp,"  pIts->SetEUCLID(0);\n");
247   }  
248   if(IsDetectorOn(kTPC)) {fprintf(fp,"\n  AliTPC *pTpc=new AliTPCv2(\"TPC\",\"Default\"); pTpc->SetSecAU(-1);pTpc->SetSecAL(-1);\n");}  
249   if(IsDetectorOn(kFRAME))fprintf(fp,"\n  AliFRAMEv2 *pFrame=new AliFRAMEv2(\"FRAME\",\"Space Frame\"); pFrame->SetHoles(1);\n");
250   if(IsDetectorOn(kTRD)){
251     fprintf(fp,"\n  AliTRD *pTrd=new AliTRDv1(\"TRD\",\"TRD slow simulator\");\n");
252     fprintf(fp,"  pTrd->SetGasMix(1); pTrd->SetPHOShole(); pTrd->SetRICHhole();pTrd->CreateTR();\n");
253   }  
254   if(IsDetectorOn(kTOF))   fprintf(fp,"\n  new AliTOFv4T0(\"TOF\", \"normal TOF\");\n");
255 //central after RICH detectors  
256   if(IsDetectorOn(kMAG))  fprintf(fp,"\n  new AliMAG(\"MAG\",\"Magnet\");\n");  
257   if(IsDetectorOn(kHALL)) fprintf(fp,"\n  new AliHALL(\"HALL\",\"Alice Hall\");\n");
258 //forward detectors  
259   if(IsDetectorOn(kFMD))   fprintf(fp,"\n  new AliFMDv1(\"FMD\",\"normal FMD\");\n");
260   if(IsDetectorOn(kABSO))  fprintf(fp,"\n  new AliABSOv0(\"ABSO\",\"Muon absorber\");\n");
261   if(IsDetectorOn(kDIPO))  fprintf(fp,"\n  new AliDIPOv2(\"DIPO\",\"Dipole version 2\");\n");
262   if(IsDetectorOn(kMUON))  fprintf(fp,"\n  new AliMUONv1(\"MUON\",\"default\");\n");
263   if(IsDetectorOn(kPMD))   fprintf(fp,"\n  new AliPMDv1(\"PMD\",\"normal PMD\");\n");
264   if(IsDetectorOn(kSTART)) fprintf(fp,"\n  new AliSTARTv1(\"START\",\"START Detector\");\n");
265   if(IsDetectorOn(kVZERO)) fprintf(fp,"\n  new AliVZEROv2(\"VZERO\",\"normal VZERO\");\n");
266   if(IsDetectorOn(kZDC))   fprintf(fp,"\n  new AliZDCv2(\"ZDC\",\"normal ZDC\");\n");
267 //different phase space detectors  
268   if(IsDetectorOn(kPHOS))  fprintf(fp,"\n  new AliPHOSv1(\"PHOS\",\"IHEP\");\n");
269   if(IsDetectorOn(kEMCAL)) fprintf(fp,"\n  new AliEMCALv1(\"EMCAL\",\"G56_2_55_19_104_14\");\n");
270   if(IsDetectorOn(kCRT))   fprintf(fp,"\n  new AliCRTv0(\"CRT\",\"normal ACORDE\");\n");
271
272   fprintf(fp,"\n  ::Info(\"RICH private config\",\"Stop\");\n"); 
273   fprintf(fp,"}\n");
274   fclose(fp);  
275   
276 //  fMain->CloseWindow();
277 }//CreateConfigFile
278
279 KirConfig *p;
280 void CreateConfig()
281 {
282    p=new KirConfig("Config.C");
283 }   
284