ROOT logo
#include <TPDGCode.h>

void Config(){
    // Set Random Number seed
    // gRandom->SetSeed(12345);
    // libraries required by geant321
    gSystem->Load("libgeant321");
    new TGeant3("C++ Interface to Geant3");
    if (!gSystem->Getenv("CONFIG_FILE")){
        cout<<"Config.C: Creating Run Loader ..."<<endl;
        AliRunLoader *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);
    } // end if !gSystem
    TGeant3 *geant3 = (TGeant3 *) gMC;
    // Set External decayer
    AliDecayer *decayer = new AliDecayerPythia();
    decayer->SetForceDecay(kAll);
    decayer->Init();
    gMC->SetExternalDecayer(decayer);
    //=======================================================================
    // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
    geant3->SetTRIG(1);         //Number of events to be processed 
    geant3->SetSWIT(4, 10);
    geant3->SetDEBU(0, 0, 1);
    //geant3->SetSWIT(2,2);
    geant3->SetDCAY(1);
    geant3->SetPAIR(1);
    geant3->SetCOMP(1);
    geant3->SetPHOT(1);
    geant3->SetPFIS(0);
    geant3->SetDRAY(0);
    geant3->SetANNI(1);
    geant3->SetBREM(1);
    geant3->SetMUNU(1);
    geant3->SetCKOV(1);
    geant3->SetHADR(1);//Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
    geant3->SetLOSS(2);
    geant3->SetMULS(1);
    geant3->SetRAYL(1);
    geant3->SetAUTO(1);//Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
    geant3->SetABAN(0);//Restore 3.16 behaviour for abandoned tracks
    geant3->SetOPTI(2);//Select optimisation level for GEANT geometry searches (0,1,2)
    geant3->SetERAN(5.e-7);
    Float_t cut = 1.e-3;        // 1MeV cut by default
    Float_t tofmax = 1.e10;
    //             GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
    geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
                    tofmax);
    //=======================================================================
    // ************* 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
    if (gSystem->Getenv("CONFIG_NPARTICLES")){
        int     nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
    }else{
        int     nParticles = 1;
    } // 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(kPiPlus);
    gener->Init();
    // Activate this line if you want the vertex smearing to happen
    // track by track
    //
    //gener->SetVertexSmear(perTrack); 
    // Field (L3 0.4 T)
    rootfile->cd();
    //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 ============================
	AliITSvSPD02 *ITS  = new AliITSvSPD02("SPD test beam 2002");
    }
    return;
}

Float_t EtaToTheta(Float_t arg){
  return (180./TMath::Pi())*2.*atan(exp(-arg));
}
 ConfigSPD02.C:1
 ConfigSPD02.C:2
 ConfigSPD02.C:3
 ConfigSPD02.C:4
 ConfigSPD02.C:5
 ConfigSPD02.C:6
 ConfigSPD02.C:7
 ConfigSPD02.C:8
 ConfigSPD02.C:9
 ConfigSPD02.C:10
 ConfigSPD02.C:11
 ConfigSPD02.C:12
 ConfigSPD02.C:13
 ConfigSPD02.C:14
 ConfigSPD02.C:15
 ConfigSPD02.C:16
 ConfigSPD02.C:17
 ConfigSPD02.C:18
 ConfigSPD02.C:19
 ConfigSPD02.C:20
 ConfigSPD02.C:21
 ConfigSPD02.C:22
 ConfigSPD02.C:23
 ConfigSPD02.C:24
 ConfigSPD02.C:25
 ConfigSPD02.C:26
 ConfigSPD02.C:27
 ConfigSPD02.C:28
 ConfigSPD02.C:29
 ConfigSPD02.C:30
 ConfigSPD02.C:31
 ConfigSPD02.C:32
 ConfigSPD02.C:33
 ConfigSPD02.C:34
 ConfigSPD02.C:35
 ConfigSPD02.C:36
 ConfigSPD02.C:37
 ConfigSPD02.C:38
 ConfigSPD02.C:39
 ConfigSPD02.C:40
 ConfigSPD02.C:41
 ConfigSPD02.C:42
 ConfigSPD02.C:43
 ConfigSPD02.C:44
 ConfigSPD02.C:45
 ConfigSPD02.C:46
 ConfigSPD02.C:47
 ConfigSPD02.C:48
 ConfigSPD02.C:49
 ConfigSPD02.C:50
 ConfigSPD02.C:51
 ConfigSPD02.C:52
 ConfigSPD02.C:53
 ConfigSPD02.C:54
 ConfigSPD02.C:55
 ConfigSPD02.C:56
 ConfigSPD02.C:57
 ConfigSPD02.C:58
 ConfigSPD02.C:59
 ConfigSPD02.C:60
 ConfigSPD02.C:61
 ConfigSPD02.C:62
 ConfigSPD02.C:63
 ConfigSPD02.C:64
 ConfigSPD02.C:65
 ConfigSPD02.C:66
 ConfigSPD02.C:67
 ConfigSPD02.C:68
 ConfigSPD02.C:69
 ConfigSPD02.C:70
 ConfigSPD02.C:71
 ConfigSPD02.C:72
 ConfigSPD02.C:73
 ConfigSPD02.C:74
 ConfigSPD02.C:75
 ConfigSPD02.C:76
 ConfigSPD02.C:77
 ConfigSPD02.C:78
 ConfigSPD02.C:79
 ConfigSPD02.C:80
 ConfigSPD02.C:81
 ConfigSPD02.C:82
 ConfigSPD02.C:83
 ConfigSPD02.C:84
 ConfigSPD02.C:85
 ConfigSPD02.C:86
 ConfigSPD02.C:87
 ConfigSPD02.C:88
 ConfigSPD02.C:89
 ConfigSPD02.C:90
 ConfigSPD02.C:91
 ConfigSPD02.C:92
 ConfigSPD02.C:93
 ConfigSPD02.C:94
 ConfigSPD02.C:95
 ConfigSPD02.C:96
 ConfigSPD02.C:97
 ConfigSPD02.C:98
 ConfigSPD02.C:99
 ConfigSPD02.C:100
 ConfigSPD02.C:101
 ConfigSPD02.C:102
 ConfigSPD02.C:103
 ConfigSPD02.C:104
 ConfigSPD02.C:105