]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDconfig.C
- Return from Gstpar if material is not used.
[u/mrichter/AliRoot.git] / TRD / AliTRDconfig.C
index a480f9abbeb5dd8b174f84973ef248a9f801bf1f..f39870a7f4aa94cc1136d8a05d524791baa02ed5 100644 (file)
@@ -1,7 +1,12 @@
 void Config()
 {
 
-  new AliGeant3("C++ Interface to Geant3");
+  Int_t iField = 0;
+
+  // libraries required by geant321
+  gSystem->Load("libgeant321");
+
+  new     TGeant3("C++ Interface to Geant3");
 
   // Create the output file
   TFile *rootfile = new TFile("TRD_test.root","recreate");
@@ -10,9 +15,22 @@ void Config()
   // Define the monte carlo
   TGeant3 *geant3 = (TGeant3*) gMC;
 
+  AliRunLoader* rl=0x0;
+  cout << "AliTRDconfig.C: Creating Run Loader ..." <<endl;
+  rl = AliRunLoader::Open("TRD_test.root"
+                         ,AliConfig::GetDefaultEventFolderName()
+                         ,"recreate");
+  if (rl == 0x0) {
+    gAlice->Fatal("AliTRDconfig.C","Can not instatiate the Run Loader");
+    return;
+  }
+  rl->SetCompressionLevel(2);
+  rl->SetNumberOfEventsPerFile(3);
+  gAlice->SetRunLoader(rl);
+
   // Set external decayer
-  AliDecayer* decayer = new AliDecayerPythia();
-  decayer->SetForceDecay(all);
+  TVirtualMCDecayer *decayer = new AliDecayerPythia();
+  decayer->SetForceDecay(kAll);
   decayer->Init();
   gMC->SetExternalDecayer(decayer);
 
@@ -48,18 +66,60 @@ void Config()
   // ************* STEERING parameters FOR ALICE SIMULATION **************
   // --- Specify event type to be tracked through the ALICE setup
   // --- All positions are in cm, angles in degrees, and P and E in GeV
-  //AliGenHIJINGpara *gener = new AliGenHIJINGpara(250);
-  AliGenBox *gener = new AliGenBox(100);
-  gener->SetMomentumRange(1.0,3.0);
-  gener->SetPhiRange(80.0,100.0);
-  gener->SetThetaRange(70.0,110.0);
-  gener->SetPart(11);             // Only electrons 
-  gener->SetOrigin(0,0,0);        // Vertex position
-  gener->SetSigma(0,0,0);         // Sigma in (X,Y,Z) (cm) on IP position
-  gener->Init();
-
-  //Specify maximum magnetic field in Tesla (neg. ==> default field)
-  gAlice->SetField(-999,2);    
+
+  AliGenCocktail *gener = new AliGenCocktail();
+
+  AliGenBox *genEl = new AliGenBox(100);
+  genEl->SetOrigin(0,0,0);        // Vertex position
+  genEl->SetSigma(0,0,0);         // Sigma in (X,Y,Z) (cm) on IP position
+  genEl->SetPart(11);             // Only electrons 
+
+  AliGenBox *genPi = new AliGenBox(100);
+  genPi->SetOrigin(0,0,0);        // Vertex position
+  genPi->SetSigma(0,0,0);         // Sigma in (X,Y,Z) (cm) on IP position
+  genPi->SetPart(-211);           // Only pions 
+
+  gener->AddGenerator(genEl,"Electrons",1);
+  gener->AddGenerator(genPi,"Pions"    ,1);
+
+  if (iField) {
+
+    // With magnetic field on
+    AliGenerator *gg = gener->FirstGenerator()->Generator();
+    gg->SetMomentumRange(3.00,3.01);
+    gg->SetPhiRange(76.0,92.0);
+    gg->SetThetaRange(83.0,97.0);
+    gg = gener->NextGenerator()->Generator();
+    gg->SetMomentumRange(0.560,0.561);
+    gg->SetPhiRange(62.0,78.0);
+    gg->SetThetaRange(83.0,97.0);
+
+    gener->Init();
+
+    // Specify maximum magnetic field in Tesla (neg. ==> default field)
+    // 0.4 T
+    gAlice->SetField(-999,2,2.0);    
+
+  }
+  else {
+
+    // With magnetic field off
+    AliGenerator *gg = gener->FirstGenerator()->Generator();
+    gg->SetMomentumRange(3.00,3.01);
+    gg->SetPhiRange(82.0,98.0);
+    gg->SetThetaRange(83.0,97.0);
+    gg = gener->NextGenerator()->Generator();
+    gg->SetMomentumRange(0.560,0.561);
+    gg->SetPhiRange(82.0,98.0);
+    gg->SetThetaRange(83.0,97.0);
+
+    gener->Init();
+
+    // Specify maximum magnetic field in Tesla (neg. ==> default field)
+    // No field
+    gAlice->SetField(0);    
+
+  }
 
   Int_t iMAG   = 1;
   Int_t iITS   = 1;
@@ -72,6 +132,8 @@ void Config()
   Int_t iSHIL  = 1;
   Int_t iPIPE  = 1;
 
+  rl->CdGAFile();
+
   //=================== Alice BODY parameters =============================
   AliBODY *BODY = new AliBODY("BODY","Alice envelop");
 
@@ -115,14 +177,18 @@ void Config()
   if (iITS) {
     //=================== ITS parameters ============================
     //
-    // EUCLID is a flag to output (=1) both geometry and media to two ASCII files 
-    // (called by default ITSgeometry.euc and ITSgeometry.tme) in a format
-    // understandable to the CAD system EUCLID. The default (=0) means that you 
-    // dont want to use this facility.
-    //
-    //AliITS *ITS  = new AliITSv5("ITS","normal ITS");
-    AliITS *ITS  = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
+
+    AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","ITS PPR");
+    ITS->SetMinorVersion(2);
+    ITS->SetReadDet(kTRUE);
+    ITS->SetThicknessDet1(200.);
+    ITS->SetThicknessDet2(200.);
+    ITS->SetThicknessChip1(200.);
+    ITS->SetThicknessChip2(200.);
+    ITS->SetRails(0);
+    ITS->SetCoolingFluid(1);
     ITS->SetEUCLID(0);
+
   }
 
   if (iTPC) {
@@ -142,21 +208,6 @@ void Config()
     //
     //-----------------------------------------------------------------------------
 
-    //gROOT->LoadMacro("SetTPCParam.C");
-    //AliTPCParam *param = SetTPCParam();
-    //AliTPC *TPC  = new AliTPCv2("TPC","Default"); //v1 is default
-    //TPC->SetParam(param); // pass the parameter object to the TPC
-    //
-    // set gas mixture
-    //TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.);
-    //TPC->SetSecAL(4);
-    //TPC->SetSecAU(4);
-    //TPC->SetSecLows(1,  2,  3, 19, 20, 21);
-    //TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
-    //TPC->SetSens(1);
-    //
-    //if (TPC->IsVersion()==1) param->Write(param->GetTitle());
-
     AliTPC *TPC  = new AliTPCv2("TPC","Default");
     // All sectors included 
     TPC->SetSecAL(-1);
@@ -171,12 +222,12 @@ void Config()
     TRD->SetSensChamber(2);
     TRD->SetSensSector(13);
   
-    // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
-    TRD->SetGasMix(1);
-
     // Set to detailed display
     TRD->SetDisplayType(1);
 
+    // Draw TR photons
+    TRD->SetDrawTR(1);
+
     // Switch on TR
     AliTRDsim *TRDsim = TRD->CreateTR();