Bug fix in SDD test beam simulation. Config.C added for this simulation.
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Mar 2004 22:14:46 +0000 (22:14 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Mar 2004 22:14:46 +0000 (22:14 +0000)
ITS/AliITSvSDD03.cxx
ITS/AliITSvSDD03.h
ITS/ConfigSDD03.C [new file with mode: 0644]

index adb360618cce62fbe450d9e2a150d30d37d9ff96..7e98357f1ad3d1fd9c393e1cb781995614fa000c 100644 (file)
@@ -92,7 +92,7 @@ AliITSvSDD03::AliITSvSDD03() {
     for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
 }
 //______________________________________________________________________
-AliITSvSDD03::AliITSvSDD03(const char *title) : AliITS("ITS", title){
+AliITSvSDD03::AliITSvSDD03(const char *title,Int_t year) : AliITS("ITS", title){
     ////////////////////////////////////////////////////////////////////////
     //    Standard constructor for the ITS SDD testbeam 2002 version 1.
     // Inputs:
@@ -115,6 +115,7 @@ AliITSvSDD03::AliITSvSDD03(const char *title) : AliITS("ITS", title){
     fEuclidOut    = kFALSE; // Don't write Euclide file
     fGeomDetOut   = kFALSE; // Don't write .det file
     fGeomDetIn    = kFALSE; // Don't Read .det file
+    fYear         = year;
     SetThicknessDet1();
     SetThicknessDet2();
     SetThicknessChip1();
@@ -523,10 +524,11 @@ void AliITSvSDD03::InitAliITSgeom(){
     //    none.
     // Return:
     //    none.
+
     if(strcmp(gMC->GetName(),"TGeant3")) {
-       Error("InitAliITSgeom",
-               "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
-       return;
+        Error("InitAliITSgeom",
+              "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
+        return;
     } // end if
     cout << "Reading Geometry transformation directly from Geant 3." << endl;
     const Int_t np=384;
@@ -545,17 +547,17 @@ void AliITSvSDD03::InitAliITSgeom(){
     Char_t names[ltypess][ndeep][4];
     Int_t itsGeomTreeCopys[ltypess][ndeep];
     Char_t *namesA[ltypess][ndeep] = {
-     {"ALIC","ITSV","ITEL","ITIA","IMB0","IMBS"}, // lay=5
-     {"ALIC","ITSV","IDET","IDAI","ITS0","ITST"}};// Test SDD
+        {"ALIC","ITSV","ITEL","ITAI","IMB0","IMBS"}, // lay=5
+        {"ALIC","ITSV","IDET","IDAI","ITS0","ITST"}};// Test SDD
     Int_t itsGeomTreeCopysA[ltypess][ndeep]= {{1,1,10,1,1,1},// lay=5
-                                             {1,1,1,1,1,1}};//lay=3 TestSDD
+                                              {1,1,1,1,1,1}};//lay=3 TestSDD
     for(i=0;i<ltypess;i++)for(j=0;j<ndeep;j++){
-       for(k=0;k<4;k++) names[i][j][k] = namesA[i][j][k];
-       itsGeomTreeCopys[i][j] = itsGeomTreeCopysA[i][j];
+        for(k=0;k<4;k++) names[i][j][k] = namesA[i][j][k];
+        itsGeomTreeCopys[i][j] = itsGeomTreeCopysA[i][j];
     } // end for i,j
     for(i=0;i<np;i++){// Fill in anode and cathode strip locations (lower edge)
-       p[i] = 0.5*pitch*(Float_t)np + pitch*(Float_t)i;
-       n[i] = pitch*(Float_t)np - p[i];
+        p[i] = 0.5*pitch*(Float_t)np + pitch*(Float_t)i;
+        n[i] = pitch*(Float_t)np - p[i];
     } // end for i
     // Sorry, but this is not very pritty code. It should be replaced
     // at some point with a version that can search through the geometry
@@ -571,27 +573,34 @@ void AliITSvSDD03::InitAliITSgeom(){
     ndet[0]=1;ndet[1]=1;ndet[2]=1;ndet[3]=1;ndet[4]=1;
     fITSgeom = new AliITSgeom(0,nlayers,nlad,ndet,mod);
     for(typ=1;typ<=ltypess;typ++){
-       for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[typ-1][j];
-       for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[typ-1][j];
-       lad = 1;
-       det = 1;
-       for(cpy=1;cpy<=itsGeomTreeCopys[typ-1][2];cpy++){
-           lnum[2] = cpy;
-           lay = cpy;
-           if(cpy>2 && typ==1) lay = cpy +1;
-           if(typ==2) lay = 3;
-           mod = lay-1;
-           ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,par,att,
-                           imat,imed);
-           if(!(fITSgeom->IsShapeDefined((Int_t)kSDD)))if(typ==1){
-               fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
-               fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD256(npar,par));
-           }else{
-               fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
-               fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD(box,0.0,0.0,
-                                                           np+1,p,np+1,n));
-           } // end if
-       } // end for cpy
+        for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[typ-1][j];
+        for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[typ-1][j];
+        lad = 1;
+        det = 1;
+        for(cpy=1;cpy<=itsGeomTreeCopys[typ-1][2];cpy++){
+            lnum[2] = cpy;
+            lay = cpy;
+            if(cpy>2 && typ==1) lay = cpy +1;
+            if(typ==2) lay = 3;
+            mod = lay-1;
+            ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,par,att,
+                            imat,imed);
+            switch (typ){
+            case 1:
+                if(!(fITSgeom->IsShapeDefined((Int_t)kSDD))){
+                    fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
+                    fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD256(npar,par));
+                } // end if
+                break;
+            case 2:
+                if(!(fITSgeom->IsShapeDefined((Int_t)kSSD))){
+                    fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
+                    fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD(box,0.0,0.0,
+                                                              np+1,p,np+1,n));
+                } // end if
+                break;
+            } // end switch
+        } // end for cpy
     } // end for typ
     return;
 }
index 8da8010c0a9cfa0c27fd762d3b03c181baa8b251..070684730c0c359af5118eef1f879aab4a6d5d2e 100644 (file)
@@ -13,7 +13,7 @@
 class AliITSvSDD03 : public AliITS{
  public:
     AliITSvSDD03(); // default constructor
-    AliITSvSDD03(const char *title); // standard constructor
+    AliITSvSDD03(const char *title,Int_t year); // standard constructor
     AliITSvSDD03(const AliITSvSDD03 &source); // Copy constructor
     AliITSvSDD03& operator=(const AliITSvSDD03 &source); // = operator
     virtual ~AliITSvSDD03(); // destructor
@@ -66,6 +66,7 @@ class AliITSvSDD03 : public AliITS{
     Float_t  fChip1;          // thickness of chip in SDD layer 1
     Float_t  fChip2;          // thickness of chip in SDD layer 2 
     Int_t fIDMother;          //! ITS Mother Volume id.
+    Int_t fYear;              //
 
     ClassDef(AliITSvSDD03,1) // Hits manager and geometry for SDD testbeam
 };
diff --git a/ITS/ConfigSDD03.C b/ITS/ConfigSDD03.C
new file mode 100644 (file)
index 0000000..5d51a0e
--- /dev/null
@@ -0,0 +1,120 @@
+//
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <Riostream.h>
+#include <TRandom.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
+#include <TGeant3.h>
+#include "STEER/AliRunLoader.h"
+#include "STEER/AliRun.h"
+#include "STEER/AliConfig.h"
+#include "PYTHIA6/AliDecayerPythia.h"
+#include "EVGEN/AliGenCocktail.h"
+#include "EVGEN/AliGenHIJINGpara.h"
+#include "STEER/AliMagFMaps.h"
+#include "STRUCT/AliBODY.h"
+#include "STRUCT/AliMAG.h"
+#include "STRUCT/AliABSOv0.h"
+#include "STRUCT/AliDIPOv2.h"
+#include "STRUCT/AliHALL.h"
+#include "STRUCT/AliFRAMEv2.h"
+#include "STRUCT/AliSHILv2.h"
+#include "STRUCT/AliPIPEv0.h"
+#include "ITS/AliITSvSPD02.h"
+#endif
+
+Float_t EtaToTheta(Float_t arg){
+  return (180./TMath::Pi())*2.*atan(exp(-arg));
+}
+//------------------------------------------------------------------
+void Config(){
+    // Set Random Number seed
+    // gRandom->SetSeed(12345);
+    // libraries required by geant321
+#if defined(__CINT__)
+    gSystem->Load("libgeant321");
+#endif
+    new TGeant3("C++ Interface to Geant3");
+    AliRunLoader *rl = 0;
+    rl = AliRunLoader::Open("galice.root",
+                           AliConfig::fgkDefaultEventFolderName,"recreate");
+    if (rl == 0x0){
+      gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
+      return;
+    } // end if rl==0x0
+    rl->SetCompressionLevel(2);
+    rl->SetNumberOfEventsPerFile(1000);
+    gAlice->SetRunLoader(rl);
+    //
+    // Set External decayer
+    TVirtualMCDecayer *decayer = new AliDecayerPythia();
+    decayer->SetForceDecay(kAll);
+    decayer->Init();
+    gMC->SetExternalDecayer(decayer);
+    //=======================================================================
+    gMC->SetProcess("DCAY",1);
+    gMC->SetProcess("PAIR",1);
+    gMC->SetProcess("COMP",1);
+    gMC->SetProcess("PHOT",1);
+    gMC->SetProcess("PFIS",0);
+    gMC->SetProcess("DRAY",0);
+    gMC->SetProcess("ANNI",1);
+    gMC->SetProcess("BREM",1);
+    gMC->SetProcess("MUNU",1);
+    gMC->SetProcess("CKOV",1);
+    gMC->SetProcess("HADR",1);
+    gMC->SetProcess("LOSS",2);
+    gMC->SetProcess("MULS",1);
+    gMC->SetProcess("RAYL",1);
+    Float_t cut = 1.e-3;        // 1MeV cut by default
+    Float_t tofmax = 1.e10;
+    gMC->SetCut("CUTGAM", cut);
+    gMC->SetCut("CUTELE", cut);
+    gMC->SetCut("CUTNEU", cut);
+    gMC->SetCut("CUTHAD", cut);
+    gMC->SetCut("CUTMUO", cut);
+    gMC->SetCut("BCUTE",  cut);
+    gMC->SetCut("BCUTM",  cut);
+    gMC->SetCut("DCUTE",  cut);
+    gMC->SetCut("DCUTM",  cut);
+    gMC->SetCut("PPCUTM", cut);
+    gMC->SetCut("TOFMAX", tofmax);
+    int     nParticles = 1;
+    if (gSystem->Getenv("CONFIG_NPARTICLES")){
+      nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
+    } // end if
+    //*********************************************
+    // Example for Moving Particle Gun            *
+    //*********************************************
+    AliGenBox *gener = new AliGenBox(nParticles);
+    gener->SetMomentumRange(100.,300.);
+    gener->SetPhiRange(0,0.1);
+    gener->SetThetaRange(0.0, .1);
+    gener->SetOrigin(0.,0.,-50.);
+    //vertex position
+    gener->SetSigma(0.1,0.1,0.0); //Sigma in (X,Y,Z) (cm) on IP position
+    gener->SetPart(211);                //GEANT particle type
+    gener->Init();
+    // Activate this line if you want the vertex smearing to happen
+    // track by track
+    //
+    //gener->SetVertexSmear(perTrack); 
+    // Field (L3 0.4 T)
+    //gAlice->SetField(field);
+
+    Int_t   iHALL  =  0;
+    Int_t   iITS   =  1;
+    rl->CdGAFile();
+    //=================== Alice BODY parameters =============================
+    AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
+
+    if (iHALL){
+        //=================== HALL parameters ============================
+        AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
+    } // end if
+    if(iITS) {
+       //=================== ITS parameters ============================
+       AliITSvSDD03 *ITS  = new AliITSvSDD03("SDD test beam 2003",2003);
+    }
+    return;
+}