コード例 #1
0
void commonConfig(ConfigVersion_t configVersion = kConfigV0)
{
  cout << "Running commonConfig.C ... " << endl;

    // Set Random Number seed
  gRandom->SetSeed(123456); // Set 0 to use the currecnt time
  IlcLog::Message(IlcLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);


  //=======================================================================
  // Load Pythia libraries
  //=======================================================================

  LoadPythia();

  //=======================================================================
  // ILC steering object (IlcRunLoader)
  //=======================================================================

  IlcRunLoader* rl 
    = IlcRunLoader::Open("gilc.root",
			  IlcConfig::GetDefaultEventFolderName(),
			  "recreate");
  if ( ! rl ) {
    gIlc->Fatal("Config.C","Can not instatiate the Run Loader");
    return;
  }
  rl->SetCompressionLevel(2);
  rl->SetNumberOfEventsPerFile(3);
  gIlc->SetRunLoader(rl);
  
  //======================================================================
  // Trigger configuration
  //=======================================================================

  IlcSimulation::Instance()->SetTriggerConfig(pprTrigConfName[strig]);
  cout << "Trigger configuration is set to  " << pprTrigConfName[strig] << endl;

  // ============================= 
  // Magnetic field
  // ============================= 

  // Field (L3 0.5 T)
  IlcMagF* field = new IlcMagF("Maps","Maps", -1., -1., IlcMagF::k5kG);
  TGeoGlobalMagField::Instance()->SetField(field);

  printf("\n \n Comment: %s \n \n", comment.Data());

  // ============================= 
  // Modules
  // ============================= 

  rl->CdGAFile();

  Int_t   iABSO  =  1;
  Int_t   iDIPO  =  1;
  Int_t   iFMD   =  1;
  Int_t   iFRAME =  1;
  Int_t   iHALL  =  1;
  Int_t   iITS   =  1;
  Int_t   iMAG   =  1;
  Int_t   iMUON  =  1;
  Int_t   iPHOS  =  1;
  Int_t   iPIPE  =  1;
  Int_t   iPMD   =  1;
  Int_t   iHMPID =  1;
  Int_t   iSHIL  =  1;
  Int_t   iT0    =  1;
  Int_t   iTOF   =  1;
  Int_t   iTPC   =  1;
  Int_t   iTRD   =  1;
  Int_t   iZDC   =  1;
  Int_t   iEMCAL =  1;
  Int_t   iACORDE = 1;
  Int_t   iVZERO =  1;

  rl->CdGAFile();
  //=================== Ilc BODY parameters =============================
  IlcBODY *BODY = new IlcBODY("BODY", "Ilc envelop");

  if (iMAG)
  {
      //=================== MAG parameters ============================
      // --- Start with Magnet since detector layouts may be depending ---
      // --- on the selected Magnet dimensions ---
      IlcMAG *MAG = new IlcMAG("MAG", "Magnet");
  }


  if (iABSO)
  {
      //=================== ABSO parameters ============================
      IlcABSO *ABSO = new IlcABSOv3("ABSO", "Muon Absorber");
  }

  if (iDIPO)
  {
      //=================== DIPO parameters ============================

      IlcDIPO *DIPO = new IlcDIPOv3("DIPO", "Dipole version 3");
  }

  if (iHALL)
  {
      //=================== HALL parameters ============================

      IlcHALL *HALL = new IlcHALLv3("HALL", "Ilc Hall");
  }


  if (iFRAME)
  {
      //=================== FRAME parameters ============================

      IlcFRAMEv2 *FRAME = new IlcFRAMEv2("FRAME", "Space Frame");
      FRAME->SetHoles(1);
  }

  if (iSHIL)
  {
      //=================== SHIL parameters ============================

      IlcSHIL *SHIL = new IlcSHILv3("SHIL", "Shielding Version 3");
  }


  if (iPIPE)
  {
      //=================== PIPE parameters ============================

      IlcPIPE *PIPE = new IlcPIPEv3("PIPE", "Beam Pipe");
  }
 
  if (iITS)
  {
      //=================== ITS parameters ============================

      IlcITS *ITS  = new IlcITSv11("ITS","ITS v11");
  }

  if (iTPC)
  {
      //============================ TPC parameters ===================
      IlcTPC *TPC = new IlcTPCv2("TPC", "Default");
  }


  if (iTOF) {
      //=================== TOF parameters ============================
      IlcTOF *TOF = new IlcTOFv6T0("TOF", "normal TOF");
  }


  if (iHMPID)
  {
      //=================== HMPID parameters ===========================
      IlcHMPID *HMPID = new IlcHMPIDv3("HMPID", "normal HMPID");

  }


  if (iZDC)
  {
      //=================== ZDC parameters ============================

      IlcZDC *ZDC = new IlcZDCv3("ZDC", "normal ZDC");
  }

  if (iTRD)
  {
      //=================== TRD parameters ============================

      IlcTRD *TRD = new IlcTRDv1("TRD", "TRD slow simulator");
      if ( configVersion == kConfigV1 ) {
        IlcTRDgeometry *geoTRD = TRD->GetGeometry();
        // Partial geometry: modules at 0,1,7,8,9,16,17
        // starting at 3h in positive direction
        geoTRD->SetSMstatus(2,0);
        geoTRD->SetSMstatus(3,0);
        geoTRD->SetSMstatus(4,0);
        geoTRD->SetSMstatus(5,0);
        geoTRD->SetSMstatus(6,0);
        geoTRD->SetSMstatus(11,0);
        geoTRD->SetSMstatus(12,0);
        geoTRD->SetSMstatus(13,0);
        geoTRD->SetSMstatus(14,0);
        geoTRD->SetSMstatus(15,0);
        geoTRD->SetSMstatus(16,0);
      }
  }

  if (iFMD)
  {
      //=================== FMD parameters ============================
      IlcFMD *FMD = new IlcFMDv1("FMD", "normal FMD");
  }

  if (iMUON)
  {
      //=================== MUON parameters ===========================
      // New MUONv1 version (geometry defined via builders)
      IlcMUON *MUON = new IlcMUONv1("MUON", "default");
  }
  //=================== PHOS parameters ===========================

  if (iPHOS)
  {
     if ( configVersion == kConfigV0 ) 
       IlcPHOS *PHOS = new IlcPHOSv1("PHOS", "IHEP");
     else if ( configVersion == kConfigV1 )  
       IlcPHOS *PHOS = new IlcPHOSv1("PHOS", "noCPV_Modules123"); 
  }


  if (iPMD)
  {
      //=================== PMD parameters ============================
      IlcPMD *PMD = new IlcPMDv1("PMD", "normal PMD");
  }

  if (iT0)
  {
      //=================== T0 parameters ============================
      IlcT0 *T0 = new IlcT0v1("T0", "T0 Detector");
  }

  if (iEMCAL)
  {
      //=================== EMCAL parameters ============================
    if ( configVersion == kConfigV0 ) 
      IlcEMCAL *EMCAL = new IlcEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
    else if ( configVersion == kConfigV1 )  
      IlcEMCAL *EMCAL = new IlcEMCALv2("EMCAL", "EMCAL_FIRSTYEARV1");
  }

   if (iACORDE)
  {
      //=================== ACORDE parameters ============================
      IlcACORDE *ACORDE = new IlcACORDEv1("ACORDE", "normal ACORDE");
  }

   if (iVZERO)
  {
      //=================== VZERO parameters ============================
      IlcVZERO *VZERO = new IlcVZEROv7("VZERO", "normal VZERO");
  }

  IlcLog::Message(IlcLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);

  cout << "Running commonConfig.C finished ... " << endl;
}
コード例 #2
0
void Config()
{

new TGeant3("C++ Interface to Geant3");

//=======================================================================
//  Create the output file
   
TFile *rootfile = new TFile("$TEMPO/gilc.root","recreate");
rootfile->SetCompressionLevel(2);
TGeant3 *geant3 = (TGeant3*)gMC;

//=======================================================================
// ******* GEANT STEERING parameters FOR ILC 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)
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 ILC SIMULATION **************
// --- Specify event type to be tracked through the ILC setup
// --- All positions are in cm, angles in degrees, and P and E in GeV
//
// The following Cocktail generator is defined to simulate the neutral and
// charged background in the ILC detector. This background is important 
// in the case of photon detector as PVBAR. We simulated a cocktail of 
// pions (pi+, pi- and pi0) , kaons (K+, K-, Kshort and Klong), eta mesons, 
// omega mesons and main baryons (protons, antiprotons, neutrons and
// antineutrons) 
//
// 1-Nov-1999 Gines MARTINEZ, GPS @ SUBATECH, Nantes, France  
//
IlcGenCocktail *gener = new IlcGenCocktail();
 gener->SetPtRange(.5,5.);
 gener->SetPhiRange(180.,360.);
 gener->SetYRange(-0.5,0.5);
 gener->SetOrigin(0,0,0);        // vertex position
 gener->SetSigma(0,0,5.6);       // Sigma in (X,Y,Z) (cm) on IP position

//===========================
//  3 0 8 0    P  I  O  N  S
//===========================
    IlcGenParam *generpion = 
   new IlcGenParam(3080,Pion,
                IlcGenPVBARlib::GetPt(Pion),
                IlcGenPVBARlib::GetY(Pion),
                IlcGenPVBARlib::GetIp(Pion)  );
    generpion->SetWeighting(non_analog);
    generpion->SetForceDecay(nodecay);
//=======================
//  4 4 0  K  A  O  N  S
//=======================
   IlcGenParam *generkaon = new IlcGenParam(440,Kaon,            
                IlcGenPVBARlib::GetPt(Kaon),
   		IlcGenPVBARlib::GetY(Kaon),
                IlcGenPVBARlib::GetIp(Kaon)   );
    generkaon->SetWeighting(non_analog);
    generkaon->SetForceDecay(nodecay);
//=====================
//  1 7 8   E  T  A  S
//=====================
    IlcGenParam *genereta = new IlcGenParam(178,Eta,            
                 IlcGenPVBARlib::GetPt(Eta),
  		 IlcGenPVBARlib::GetY(Eta),
                 IlcGenPVBARlib::GetIp(Eta) );
    genereta->SetWeighting(non_analog);
    genereta->SetForceDecay(nodecay);
//==================
//  50  O M E G A S
//==================
    IlcGenParam *generomega = new IlcGenParam(50,Omega,            
                 IlcGenPVBARlib::GetPt(Omega),
  	         IlcGenPVBARlib::GetY(Omega),
  	         IlcGenPVBARlib::GetIp(Omega) );
    generomega->SetWeighting(non_analog);
    generomega->SetForceDecay(nodecay);
//========================
//  2 8 8   B A R Y O N S
//========================
    IlcGenParam *generbaryon = new IlcGenParam(288,Baryon,            
                 IlcGenPVBARlib::GetPt(Baryon),
                 IlcGenPVBARlib::GetY(Baryon),
   	         IlcGenPVBARlib::GetIp(Baryon) );
    generbaryon->SetWeighting(non_analog);
    generbaryon->SetForceDecay(nodecay);
    
    
  gener->AddGenerator(generpion,"pion",1.);
  gener->AddGenerator(generkaon,"kaon",1.);
  gener->AddGenerator(genereta,"eta",1.);
  gener->AddGenerator(generomega,"omega",1.);
  gener->AddGenerator(generbaryon,"baryon",1.);
  gener->Init();

// 
// Activate this line if you want the vertex smearing to happen
// track by track
//
//gener->SetVertexSmear(perTrack); 

gIlc->SetField(-999,2);    //Specify maximum magnetic field in Tesla (neg. ==> default field)

Int_t iMAG=1;
Int_t iITS=0;
Int_t iTPC=0;
Int_t iTOF=0;
Int_t iHMPID=0;
Int_t iZDC=0;
Int_t iCASTOR=0;
Int_t iTRD=0;
Int_t iABSO=0;
Int_t iDIPO=1;
Int_t iHALL=1;
Int_t iFRAME=1;
Int_t iSHIL=1;
Int_t iPIPE=1;
Int_t iFMD=0;
Int_t iMUON=0;
Int_t iPVBAR=1;
Int_t iPMD=0;
Int_t iT0=0;

//=================== Ilc BODY parameters =============================
IlcBODY *BODY = new IlcBODY("BODY","Ilc envelop");


if(iMAG) {
//=================== MAG parameters ============================
// --- Start with Magnet since detector layouts may be depending ---
// --- on the selected Magnet dimensions ---
IlcMAG *MAG  = new IlcMAG("MAG","Magnet");
}


if(iABSO) {
//=================== ABSO parameters ============================
IlcABSO *ABSO  = new IlcABSO("ABSO","Muon Absorber");
}

if(iDIPO) {
//=================== DIPO parameters ============================

IlcDIPO *DIPO  = new IlcDIPOv2("DIPO","Dipole version 2");
}

if(iHALL) {
//=================== HALL parameters ============================

IlcHALL *HALL  = new IlcHALL("HALL","Ilc Hall");
}


if(iFRAME) {
//=================== FRAME parameters ============================

IlcFRAME *FRAME  = new IlcFRAMEv0("FRAME","Space Frame");
// Uncomment the following line to obtain the closed version
// of the space frame. The default is the version with holes
// FRAME->SetEuclidFile("$(ILC_ROOT)/Euclid/frame.tme","$(ILC_ROOT)/Euclid/frame1099i.euc");
}

if(iSHIL) {
//=================== SHIL parameters ============================

IlcSHIL *SHIL  = new IlcSHIL("SHIL","Shielding");
}


if(iPIPE) {
//=================== PIPE parameters ============================

IlcPIPE *PIPE  = new IlcPIPEv0("PIPE","Beam Pipe");
}


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.
//
IlcITS *ITS  = new IlcITSv5("ITS","normal ITS");
ITS->SetEUCLID(0);
}

if(iTPC) {
//============================ TPC parameters ================================
// --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
// --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
// --- sectors are specified, any value other than that requires at least one 
// --- sector (lower or upper)to be specified!
// --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
// ---           sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
// --- SecLows - number of lower sectors specified (up to 6)
// --- SecUps - number of upper sectors specified (up to 12)
// --- Sens - sensitive strips for the Slow Simulator !!!
// --- This does NOT work if all S or L-sectors are specified, i.e.
// --- if SecAL or SecAU < 0
//
//
//-----------------------------------------------------------------------------

IlcTPC *TPC  = new IlcTPCv1("TPC","Normal TPC");
IlcTPCD *paramd = TPC->GetDigParam();
IlcTPCParam *param = &(paramd->GetParam());

// Set geometrical parameters

param->SetSectorAngles(20.,0.,20.,0.);
param->SetInnerRadiusLow(83.9);
param->SetInnerRadiusUp(141.3);
param->SetOuterRadiusLow(146.9);
param->SetOuterRadiusUp(249.4);
param->SetInSecLowEdge(81.6);
param->SetInSecUpEdge(143.6);
param->SetOuSecLowEdge(144.2);
param->SetOuSecUpEdge(252.1);
param->SetEdge(1.5);
param->SetDeadZone(1.15);
param->SetPadLength(2.0);
param->SetPadWidth(0.3);
param->SetPadPitchLength(2.05);
param->SetPadPitchWidth(0.35);
param->Update();

if (TPC->IsVersion() != 2) paramd->Write("Param1");

// set gas mixture

TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.);
TPC->SetSecAL(1);
TPC->SetSecAU(1);
// Meaningless with versions other than 2
TPC->SetSecLows(1, 2, 3, 1+18, 2+18, 3+18);
TPC->SetSecUps(1+36, 2+36, 3+36, 1+38+18, 2+38+18, 3+38+18, -1,-1,-1,-1,-1,-1);
TPC->SetSens(1);
}

if(iTOF) {
//=================== TOF parameters ============================
IlcTOF *TOF  = new IlcTOFv2("TOF","normal TOF");
}

if(iHMPID) {
//=================== HMPID parameters ===========================

  IlcHMPID *HMPID  = new IlcHMPIDv0("HMPID","normal HMPID");

  HMPID->SetSMAXAR(0.03);
  HMPID->SetSMAXAL(-1);
//
// Version 0
// Default Segmentation
  IlcHMPIDsegmentationV0* RsegV0 = new IlcHMPIDsegmentationV0;
  RsegV0->SetPADSIZ(.8, .8);
  RsegV0->SetDAnod(0.8/3);
// Default response
  IlcHMPIDresponseV0* Rresponse0 = new IlcHMPIDresponseV0;
  IlcHMPIDresponseCkv* RresponseCkv = new IlcHMPIDresponseCkv;

//------------------------Chambers 0-6 ----------------------------
  for (Int_t i=0; i<7; i++) {
    HMPID->SetSegmentationModel(i, 1, RsegV0);
    HMPID->SetResponseModel(i, mip     , Rresponse0);
    HMPID->SetResponseModel(i, cerenkov, RresponseCkv);
    HMPID->Chamber(i).SetRSIGM(5.);
    HMPID->Chamber(i).SetMUCHSP(43.);
    HMPID->Chamber(i).SetMUSIGM(0.18, 0.18);
    HMPID->Chamber(i).SetMAXADC( 1024);
    HMPID->Chamber(i).SetSqrtKx3(0.77459667);
    HMPID->Chamber(i).SetKx2(0.962);
    HMPID->Chamber(i).SetKx4(0.379);
    HMPID->Chamber(i).SetSqrtKy3(0.77459667);
    HMPID->Chamber(i).SetKy2(0.962);
    HMPID->Chamber(i).SetKy4(0.379);
    HMPID->Chamber(i).SetPitch(0.25);
    HMPID->SetNsec(i,1);
  }
}

if(iZDC) {
//=================== ZDC parameters ============================

IlcZDC *ZDC  = new IlcZDCv1("ZDC","normal ZDC");
}

if(iCASTOR) {
//=================== CASTOR parameters ============================

IlcCASTOR *CASTOR  = new IlcCASTORv1("CASTOR","normal CASTOR");
}

if(iTRD) {
//=================== TRD parameters ============================

IlcTRD *TRD  = new IlcTRDv0("TRD","TRD version 0");
// Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
TRD->SetGasMix(0);
TRD->SetHits(1);
}

if(iFMD) {
//=================== FMD parameters ============================

IlcFMD *FMD  = new IlcFMDv1("FMD","normal FMD");
}

if(iMUON) {
//=================== MUON parameters ===========================

IlcMUON *MUON  = new IlcMUONv0("MUON","normal MUON");

  MUON->SetMaxStepGas(0.1);
  MUON->SetMaxStepAlu(0.1);
//
// Version 0
//
// First define the number of planes that are segmented (1 or 2) by a call
// to SetNsec. 
// Then chose for each chamber (chamber plane) the segmentation 
// and response model.
// They should be equal for the two chambers of each station. In a future
// version this will be enforced.
//
//  
 Int_t chamber;
 Int_t station;
// Default response
 IlcMUONresponseV0* response0 = new IlcMUONresponseV0;
 response0->SetSqrtKx3(0.7131);
 response0->SetKx2(1.0107);
 response0->SetKx4(0.4036);
 response0->SetSqrtKy3(0.7642);
 response0->SetKy2(0.9706);
 response0->SetKy4(0.3831);
 response0->SetPitch(0.25);
 response0->SetSigmaIntegration(10.);
 response0->SetChargeSlope(50);
 response0->SetChargeSpread(0.18, 0.18);
 response0->SetMaxAdc(4096);
//--------------------------------------------------------
// Configuration for Chamber TC1/2  (Station 1) ----------           
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// Float_t rseg1[4]={17.5, 55.2, 71.3, 95.5};
 Float_t rseg1[4]={15.5, 55.2, 71.3, 95.5};
 Int_t   nseg1[4]={4, 4, 2, 1};
//
 chamber=1;
//^^^^^^^^^
 MUON->SetNsec(chamber-1,2);
//
 IlcMUONsegmentationV01 *seg11=new IlcMUONsegmentationV01;
 
 seg11->SetSegRadii(rseg1);
 seg11->SetPADSIZ(3, 0.5);
 seg11->SetDAnod(3.0/3./4);
 seg11->SetPadDivision(nseg1);
 
 MUON->SetSegmentationModel(chamber-1, 1, seg11);
//
 IlcMUONsegmentationV02 *seg12=new IlcMUONsegmentationV02;
 seg12->SetSegRadii(rseg1); 
 seg12->SetPADSIZ(0.75, 2.0);
 seg12->SetDAnod(3.0/3./4);
 seg12->SetPadDivision(nseg1);

 MUON->SetSegmentationModel(chamber-1, 2, seg12);

 MUON->SetResponseModel(chamber-1, response0);	    

 chamber=2;
//^^^^^^^^^
//
 MUON->SetNsec(chamber-1,2);
//
 IlcMUONsegmentationV01 *seg21=new IlcMUONsegmentationV01;
 seg21->SetSegRadii(rseg1);
 seg21->SetPADSIZ(3, 0.5);
 seg21->SetDAnod(3.0/3./4);
 seg21->SetPadDivision(nseg1);
 MUON->SetSegmentationModel(chamber-1, 1, seg21);
//
 IlcMUONsegmentationV02 *seg22=new IlcMUONsegmentationV02;
 seg22->SetSegRadii(rseg1); 
 seg22->SetPADSIZ(0.75, 2.);
 seg22->SetDAnod(3.0/3./4);
 seg22->SetPadDivision(nseg1);
 MUON->SetSegmentationModel(chamber-1, 2, seg22);

 MUON->SetResponseModel(chamber-1, response0);	    
//
//--------------------------------------------------------
// Configuration for Chamber TC3/4 -----------------------
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// Float_t rseg2[4]={23.5, 47.1, 87.7, 122.5};
 Float_t rseg2[4]={21.5, 47.1, 87.7, 122.5};
 Int_t   nseg2[4]={4, 4, 2, 1};
//
 chamber=3;
//^^^^^^^^^
 MUON->SetNsec(chamber-1,2);
//
 IlcMUONsegmentationV01 *seg31=new IlcMUONsegmentationV01;
 seg31->SetSegRadii(rseg2);
 seg31->SetPADSIZ(3, 0.5);
 seg31->SetDAnod(3.0/3./4);
 seg31->SetPadDivision(nseg2);
 MUON->SetSegmentationModel(chamber-1, 1, seg31);
//
 IlcMUONsegmentationV02 *seg32=new IlcMUONsegmentationV02;
 seg32->SetSegRadii(rseg2); 
 seg32->SetPADSIZ(0.75, 2.);
 seg32->SetPadDivision(nseg2);
 seg32->SetDAnod(3.0/3./4);

 MUON->SetSegmentationModel(chamber-1, 2, seg32);

 MUON->SetResponseModel(chamber-1, response0);	    

 chamber=4;
//^^^^^^^^^
//
 MUON->SetNsec(chamber-1,2);
//
 IlcMUONsegmentationV01 *seg41=new IlcMUONsegmentationV01;
 seg41->SetSegRadii(rseg2);
 seg41->SetPADSIZ(3, 0.5);
 seg41->SetDAnod(3.0/3./4);
 seg41->SetPadDivision(nseg2);
 MUON->SetSegmentationModel(chamber-1, 1, seg41);
//
 IlcMUONsegmentationV02 *seg42=new IlcMUONsegmentationV02;
 seg42->SetSegRadii(rseg2); 
 seg42->SetPADSIZ(0.75, 2.);
 seg42->SetPadDivision(nseg2);
 seg42->SetDAnod(3.0/3./4);

 MUON->SetSegmentationModel(chamber-1, 2, seg42);

 MUON->SetResponseModel(chamber-1, response0);	    


//--------------------------------------------------------
// Configuration for Chamber TC5/6 -----------------------
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/*
 seg5 =  new IlcMUONsegmentationV1;
 IlcMUONresponseV0* response5 =  new IlcMUONresponseV0;
 // K3 = 0.62
 response5->SetSqrtKx3(0.78740079);
 response5->SetKx2(0.95237319); //  0.5 * kPI * (1- 0.5*sqrtky3 )
 response5->SetKx4(0.37480633); // 0.25/TMath::ATan(sqrtkx3)
 // K3 = 0.55
 response5->SetSqrtKy3(0.74161985);
 response5->SetKy2(0.98832946);
 response5->SetKy4(0.39177817);
 response5->SetPitch(0.325);
 response5->SetSigmaIntegration(10.);
 response5->SetChargeSlope(50);
 response5->SetChargeSpread(0.4, 0.4);
 response5->SetMaxAdc(4096);

 chamber=5;
 MUON->SetNsec(chamber-1,1);
 MUON->SetSegmentationModel(chamber-1, 1, seg5);
 MUON->SetResponseModel(chamber-1, response5);	    

 chamber=6;
 MUON->SetNsec(chamber-1,1);
 MUON->SetSegmentationModel(chamber-1, 1, seg5);
 MUON->SetResponseModel(chamber-1, response5);	    
//
// Station 3
 station=3;
 MUON->SetPADSIZ(station, 1, 0.975, 0.55);
*/

 chamber=5;
//^^^^^^^^^
 MUON->SetNsec(chamber-1,2);
//
 IlcMUONsegmentationV0 *seg51=new IlcMUONsegmentationV0;
 seg51->SetPADSIZ(0.75, 0.5);
 seg51->SetDAnod(3.0/3./4);
 MUON->SetSegmentationModel(chamber-1, 1, seg51);
//
 IlcMUONsegmentationV0 *seg52=new IlcMUONsegmentationV0;
 seg52->SetPADSIZ(0.5,0.75);
 seg52->SetDAnod(3.0/3./4);
 MUON->SetSegmentationModel(chamber-1, 2, seg52);

 MUON->SetResponseModel(chamber-1, response0);	    

 chamber=6;
//^^^^^^^^^
 MUON->SetNsec(chamber-1,2);
//
 IlcMUONsegmentationV0 *seg61=new IlcMUONsegmentationV0;
 seg61->SetPADSIZ(0.75, 0.5);
 seg61->SetDAnod(3.0/3./4);
 MUON->SetSegmentationModel(chamber-1, 1, seg61);
//
 IlcMUONsegmentationV0 *seg62=new IlcMUONsegmentationV0;
 seg62->SetPADSIZ(0.5,0.75);
 seg62->SetDAnod(3.0/3./4);
 MUON->SetSegmentationModel(chamber-1, 2, seg62);

 MUON->SetResponseModel(chamber-1, response0);	  

//--------------------------------------------------------
// Configuration for Chamber TC7/8  (Station 4) ----------           
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 Int_t   nseg4[4]={4, 4, 2, 1};

 chamber=7;
//^^^^^^^^^
 MUON->SetNsec(chamber-1,2);
//
 IlcMUONsegmentationV04 *seg71=new IlcMUONsegmentationV04;
 seg71->SetPADSIZ(10.,0.5);
 seg71->SetDAnod(0.25);
 seg71->SetPadDivision(nseg4);
 MUON->SetSegmentationModel(chamber-1, 1, seg71);

 IlcMUONsegmentationV05 *seg72=new IlcMUONsegmentationV05;
 seg72->SetPADSIZ(1,10);
 seg72->SetDAnod(0.25);
 seg72->SetPadDivision(nseg4);
 MUON->SetSegmentationModel(chamber-1, 2, seg72);

 MUON->SetResponseModel(chamber-1, response0);	    

 chamber=8;
//^^^^^^^^^
 MUON->SetNsec(chamber-1,2);
 IlcMUONsegmentationV04 *seg81=new IlcMUONsegmentationV04;
 seg81->SetPADSIZ(10., 0.5);
 seg81->SetPadDivision(nseg4);
 seg81->SetDAnod(0.25);
 MUON->SetSegmentationModel(chamber-1, 1, seg81);

 IlcMUONsegmentationV05 *seg82=new IlcMUONsegmentationV05;
 seg82->SetPADSIZ(1, 10);
 seg82->SetPadDivision(nseg4);
 seg82->SetDAnod(0.25);
 MUON->SetSegmentationModel(chamber-1, 2, seg82);

 MUON->SetResponseModel(chamber-1, response0);	    
//--------------------------------------------------------
// Configuration for Chamber TC9/10  (Station 5) ---------           
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 chamber=9;
//^^^^^^^^^
 MUON->SetNsec(chamber-1,2);
//
 IlcMUONsegmentationV04 *seg91=new IlcMUONsegmentationV04;
 seg91->SetPADSIZ(10.,0.5);
 seg91->SetDAnod(0.25);
 seg91->SetPadDivision(nseg4);
 MUON->SetSegmentationModel(chamber-1, 1, seg91);

 IlcMUONsegmentationV05 *seg92=new IlcMUONsegmentationV05;
 seg92->SetPADSIZ(1,10);
 seg92->SetDAnod(0.25);
 seg92->SetPadDivision(nseg4);

 MUON->SetSegmentationModel(chamber-1, 2, seg92);

 MUON->SetResponseModel(chamber-1, response0);	    

 chamber=10;
//^^^^^^^^^
 MUON->SetNsec(chamber-1,2);
 IlcMUONsegmentationV04 *seg101=new IlcMUONsegmentationV04;
 seg101->SetPADSIZ(10., 0.5);
 seg101->SetPadDivision(nseg4);
 seg101->SetDAnod(0.25);
 MUON->SetSegmentationModel(chamber-1, 1, seg101);

 IlcMUONsegmentationV05 *seg102=new IlcMUONsegmentationV05;
 seg102->SetPADSIZ(1,10);
 seg102->SetPadDivision(nseg4);
 seg102->SetDAnod(0.25);
 MUON->SetSegmentationModel(chamber-1, 2, seg102);

 MUON->SetResponseModel(chamber-1, response0);	    
//--------------------------------------------------------
// Configuration for Trigger staions --------------------- 
// (not yet used/implemented) ----------------------------          
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 chamber=11;
 MUON->SetNsec(chamber-1,1);
 IlcMUONsegmentationV0 *seg1112=new IlcMUONsegmentationV0;
 seg1112->SetDAnod(0.51/3.);

 MUON->SetSegmentationModel(chamber-1, 1, seg1112);
 MUON->SetResponseModel(chamber-1, response0);	    

 chamber=12;
 MUON->SetNsec(chamber-1,1);
 MUON->SetSegmentationModel(chamber-1, 1, seg1112);
 MUON->SetResponseModel(chamber-1, response0);	    
//
// Trigger Station 1
 station=6;
 MUON->SetPADSIZ(station, 1, 0.75, 0.5);

 chamber=13;
 MUON->SetNsec(chamber-1,1);
 IlcMUONsegmentationV0 *seg1314=new IlcMUONsegmentationV0;
 seg1314->SetDAnod(0.51/3.);

 MUON->SetSegmentationModel(chamber-1, 1, seg1314);
 MUON->SetResponseModel(chamber-1, response0);	    

 chamber=14;
 MUON->SetNsec(chamber-1,1);
 MUON->SetSegmentationModel(chamber-1, 1, seg1314);
 MUON->SetResponseModel(chamber-1, response0);	    
//
// Trigger Station 2
 station=7;
 MUON->SetPADSIZ(station, 1, 0.75, 0.5);
}
 
//=================== PVBAR parameters ===========================

if(iPVBAR) {
IlcPVBARv2 *PVBAR  = new IlcPVBARv2("PVBAR","Version PVBAR");
// * PVBARflags:    YES: X<>0   NO: X=0
// * PVBARflags(1) : -----X  Create branch for TObjArray of IlcPVBARCradle
// *                ----X-  Create file (ftn03 on HP-UX) with list of SHAKER particles (7Mb/event)
// *                
//PVBAR->SetFlags(000001);
//PVBAR->SetRadius(460); //Distance from beam to PVBAR crystals.
// (crystal_side_size,crystal_length,wrap_thikness,air_thikness,PIN_size,PIN length)
//PVBAR->SetCell(2.2,          18.,         0.01,        0.01,        1.,      0.1);
//PVBAR->SetCradleSize(48, 90, 4); // Nz (along beam), Nphi, Ncradles
//PVBAR->SetCradleA(0);   //Angle between Cradles
// *  ===============
// * PVBAR extra parameters (contact Maxim Volkov [email protected])
// * 1. STE_THICK         Steel cover thickness
// * 2. SUP_Y             Crystal support height
// * 3. FTIU_THICK        Thermo Insulating outer cover Upper plate thickness
// * 4. UFP_Y             Upper Polystyrene Foam plate thickness
// * 5. TCB_THICK         Thermo insulating Crystal Block wall thickness
// * 6. UCP_Y             Upper Cooling Plate thickness
// * 7. ASP_Y             Al Support Plate thickness
// * 8. TIP_Y             Lower Thermo Insulating Plate thickness
// * 9. TXP_Y             Lower Textolit Plate thickness
//PVBAR->SetExtra(0.001, 6.95, 4., 5., 2., 0.06, 10., 3., 1.);   
//PVBAR->SetTextolitWall(209., 71., 250.);    //Textolit Wall box dimentions
//PVBAR->SetInnerAir(206.,    66.,     244.); //Inner AIR volume dimensions
// *  ===============================
// * 1. FTI_X             Foam Thermo Insulating outer cover dimensions
// * 2. FTI_Y             ==//==
// * 3. FTI_Z             ==//==
// * 4. FTI_R             Distance from IP to Foam Thermo Insulating top plate
//PVBAR->SetFoam(214.6,  80.,  260., 467.); 
//    =================================
// *******************************************************************************
// * KINE 700  - SHAKER generator
// * KINE 700 x y z NDNDY YLIM PTLIM ChargeFlag
// *     JWEAK=0
// *     JPI0=JETA=1
// *     JPIC=JPRO=JKAC=JKA0=JRHO=JOME=JPHI=JPSI=JDRY=ChargeFlag
// *     Int_t               JWEI;           // Unweighted generation
// *     Int_t               NDNDY;          // Density of charged particles
// *     Float_t             YLIM;           // Rapidity Limit
// *     Float_t             PTLIM;          // Pt limit in GeV/c
// *     Int_t               JWEAK;          // Disable weak decays
// *     Int_t               JPI0;           // pi0 generation
// *     Int_t               JETA;           // eta generation
// *     Int_t               JPIC;           // pi+/- generation
// *     Int_t               JPRO;           // proton generation
// *     Int_t               JKAC;           // K+/- generation
// *     Int_t               JKA0;           // K0 generation
// *     Int_t               JRHO;           // rho generation
// *     Int_t               JOME;           // omega generation
// *     Int_t               JPHI;           // phi generation
// *     Int_t               JPSI;           // J/psi generation
// *     Int_t               JDRY;           // Drell-Yan generation
// * KINE  700     5.    175.    0.          800. 1.5 5. 1.
// *******************************************************************************
}

if(iPMD) {
//=================== PMD parameters ============================

IlcPMD *PMD  = new IlcPMDv0("PMD","normal PMD");
PMD->SetPAR(1., 1., 0.8, 0.02);
PMD->SetIN(6., 18., -580., 27., 27.);
PMD->SetGEO(0.0, 0.2, 4.);
PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);

}

if(iT0) {
//=================== T0 parameters ============================
IlcT0 *T0  = new IlcT0v0("T0","T0 Detector");
}

         
}
コード例 #3
0
ファイル: Config.C プロジェクト: brettviren/ORKA-ILCRoot
void Config()
{

  cout << "==> Config.C..." << endl;
  
  // Set Random Number seed
  UInt_t at = (UInt_t) gSystem->Now() ;
  UInt_t seed = ((gSystem->GetPid()*111)%at)*137 ;
//  gRandom->SetSeed(seed);
  gRandom->SetSeed(12345);
  printf("MySeed: %d\n",seed) ;
  cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl;

  
  
  // libraries required by fluka21

  Bool_t isFluka = kFALSE;
  if (isFluka) {
    gSystem->Load("libGeom");
    cout << "\t* Loading TFluka..." << endl;  
    gSystem->Load("libTFluka");    
    
    cout << "\t* Instantiating TFluka..." << endl;
    new  TFluka("C++ Interface to Fluka", 0/*verbositylevel*/);
  }
  else {
    cout << "\t* Loading Geant3..." << endl;  
    gSystem->Load("libgeant321");
    
    cout << "\t* Instantiating Geant3TGeo..." << endl;
    new     TGeant3TGeo("C++ Interface to Geant3");
  }
  
  IlcRunLoader* rl=0x0;
                                                                                
  cout<<"Config.C: Creating Run Loader ..."<<endl;
  rl = IlcRunLoader::Open("gilc.root",
			    IlcConfig::GetDefaultEventFolderName(),
			    "recreate");
  if (rl == 0x0)
    {
      gIlc->Fatal("Config.C","Can not instatiate the Run Loader");
      return;
    }
  rl->SetCompressionLevel(2);
  rl->SetNumberOfEventsPerFile(1000);
  gIlc->SetRunLoader(rl);
                                                                                
  //
  // Set External decayer
  IlcDecayer *decayer = new IlcDecayerPythia();
                                                                               
  decayer->SetForceDecay(kAll);
  decayer->Init();
  gMC->SetExternalDecayer(decayer);

  //
  //
  //
  // Physics process control

  gMC->SetProcess("DCAY",1);
  gMC->SetProcess("PAIR",1);
  gMC->SetProcess("COMP",1);
  gMC->SetProcess("PHOT",1);
  gMC->SetProcess("PFIS",0);
  gMC->SetProcess("DRAY",0); //AZ 1);
  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);

  ((IlcMC*)gMC)->SetTransPar("./gilc.cuts") ;
  //
  //=======================================================================
  // ************* STEERING parameters FOR ILC SIMULATION **************
  // --- Specify event type to be tracked through the ILC setup
  // --- All positions are in cm, angles in degrees, and P and E in GeV
 
    IlcGenBox *gener = new IlcGenBox(5);
    gener->SetMomentumRange(0.5, 5.);
    gener->SetPhiRange(260., 280.);
    gener->SetThetaRange(82.,98.);
    gener->SetPart(kGamma);

    gener->SetOrigin(0, 0, 0);  //vertex position
    gener->SetSigma(0, 0, 0);   //Sigma in (X,Y,Z) (cm) on IP position
    gener->Init() ;
 
  // 
  // Activate this line if you want the vertex smearing to happen
  // track by track
  //
  //  gener->SetVertexSmear(kPerEvent) ;
 


    if (smag == IlcMagF::k2kG) {
        comment = comment.Append(" | L3 field 0.2 T");
    } else if (smag == IlcMagF::k5kG) {
        comment = comment.Append(" | L3 field 0.5 T");
    }
                                                                                
                                                                                
    if (srad == kGluonRadiation)
    {
        comment = comment.Append(" | Gluon Radiation On");
                                                                                
    } else {
        comment = comment.Append(" | Gluon Radiation Off");
    }
                                                                                
    if (sgeo == kHoles)
    {
        comment = comment.Append(" | Holes for PVBAR/RICH");
                                                                                
    } else {
        comment = comment.Append(" | No holes for PVBAR/RICH");
    }
                                                                                
    printf("\n \n Comment: %s \n \n", comment.Data());
                                                                                
                                                                                
// Field (L3 0.4 T)
    //Zero magnetic field
    IlcMagF* field = new IlcMagF("Maps","Maps", 0., 0., IlcMagF::k5kGUniform);
    //    IlcMagF* field = new IlcMagF("Maps","Maps", 2, -1., -1., 10., smag);
    TGeoGlobalMagField::Instance()->SetField(field);

    rl->CdGAFile();
 
  Int_t   iABSO  = 0; 
  Int_t   iCRT   = 0; 
  Int_t   iDIPO  = 0; 
  Int_t   iFMD   = 0; 
  Int_t   iFRAME = 0; 
  Int_t   iHALL  = 0; 
  Int_t   iITS   = 0; 
  Int_t   iMAG   = 0; 
  Int_t   iMUON  = 0; 
  Int_t   iPVBAR  = 1; 
  Int_t   iPIPE  = 0; 
  Int_t   iPMD   = 0; 
  Int_t   iRICH  = 0; 
  Int_t   iSHIL  = 0; 
  Int_t   iSTART = 0; 
  Int_t   iTOF   = 0; 
  Int_t   iTPC   = 0;
  Int_t   iTRD   = 0; 
  Int_t   iZDC   = 0; 
  Int_t   iEMCAL = 0; 
  Int_t   iVZERO = 0;
 
  cout << "\t* Creating the detectors ..." << endl;
  //=================== Ilc BODY parameters =============================
    //=================== Ilc BODY parameters =============================
    IlcBODY *BODY = new IlcBODY("BODY", "Ilc envelop");
                                                                                
                                                                                
    if (iMAG)
    {
        //=================== MAG parameters ============================
        // --- Start with Magnet since detector layouts may be depending ---
        // --- on the selected Magnet dimensions ---
        IlcMAG *MAG = new IlcMAG("MAG", "Magnet");
    }
                                                                                
                                                                                
    if (iABSO)
    {
        //=================== ABSO parameters ============================
        IlcABSO *ABSO = new IlcABSOv0("ABSO", "Muon Absorber");
    }
                                                                                
    if (iDIPO)
    {
        //=================== DIPO parameters ============================
                                                                                
        IlcDIPO *DIPO = new IlcDIPOv2("DIPO", "Dipole version 2");
    }
                                                                                
    if (iHALL)
    {
        //=================== HALL parameters ============================
                                                                                
        IlcHALL *HALL = new IlcHALL("HALL", "Ilc Hall");
    }
                                                                                
                                                                                
    if (iFRAME)
    {
        //=================== FRAME parameters ============================
                                                                                
        IlcFRAMEv2 *FRAME = new IlcFRAMEv2("FRAME", "Space Frame");
        if (sgeo == kHoles) {
            FRAME->SetHoles(1);
        } else {
            FRAME->SetHoles(0);
        }
    }
                                                                                
    if (iSHIL)
    {
        //=================== SHIL parameters ============================
                                                                                
        IlcSHIL *SHIL = new IlcSHILv2("SHIL", "Shielding Version 2");
    }
                                                                                
                                                                                
    if (iPIPE)
    {
        //=================== PIPE parameters ============================
                                                                                
        IlcPIPE *PIPE = new IlcPIPEv0("PIPE", "Beam Pipe");
    }
                                                                                
    if(iITS) {
                                                                                
    //=================== ITS parameters ============================
    //
    // As the innermost detector in ILC, the Inner Tracking System "impacts" on
    // almost all other detectors. This involves the fact that the ITS geometry
    // still has several options to be followed in parallel in order to determine
    // the best set-up which minimizes the induced background. All the geometries
    // available to date are described in the following. Read carefully the comments
    // and use the default version (the only one uncommented) unless you are making
    // comparisons and you know what you are doing. In this case just uncomment the
    // ITS geometry you want to use and run Ilcroot.
    //
    // Detailed geometries:
    //
    //
    //IlcITS *ITS  = new IlcITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
    //
    //IlcITS *ITS  = new IlcITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
    //
        IlcITSvPPRasymmFMD *ITS  = new IlcITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
        ITS->SetMinorVersion(2);  // don't touch this parameter if you're not an ITS developer
        ITS->SetReadDet(kTRUE);   // don't touch this parameter if you're not an ITS developer
    //    ITS->SetWriteDet("$ILC_ROOT/ITS/ITSgeometry_vPPRasymm2.det");  // don't touch this parameter if you're not an ITS developer
        ITS->SetThicknessDet1(200.);   // detector thickness on layer 1 must be in the range [100,300]
        ITS->SetThicknessDet2(200.);   // detector thickness on layer 2 must be in the range [100,300]
        ITS->SetThicknessChip1(200.);  // chip thickness on layer 1 must be in the range [150,300]
        ITS->SetThicknessChip2(200.);  // chip thickness on layer 2 must be in the range [150,300]
        ITS->SetRails(0);            // 1 --> rails in ; 0 --> rails out
        ITS->SetCoolingFluid(1);   // 1 --> water ; 0 --> freon
                                                                                
    // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
    // for reconstruction !):
    //
    //
    //IlcITSvPPRcoarseasymm *ITS  = new IlcITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
    //ITS->SetRails(0);                // 1 --> rails in ; 0 --> rails out
    //ITS->SetSupportMaterial(0);      // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
    //
    //IlcITS *ITS  = new IlcITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
    //ITS->SetRails(0);                // 1 --> rails in ; 0 --> rails out
    //ITS->SetSupportMaterial(0);      // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
    //
    //
    //
    // Geant3 <-> EUCLID conversion
    // ============================
    //
    // SetEUCLID is a flag to output (=1) or not to output (=0) 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.
    //
        ITS->SetEUCLID(0);
    }
                                                                                
    if (iTPC)
    {
        //============================ TPC parameters ================================
//        IlcTPC *TPC = new IlcTPCv0("TPC", "Default");
        IlcTPC *TPC = new IlcTPCv2("TPC", "Default");
    }
                                                                                
                                                                                
    if (iTOF) {
        //=================== TOF parameters ============================
        IlcTOF *TOF = new IlcTOFv4T0("TOF", "normal TOF");
    }
                                                                                
                                                                                
    if (iRICH)
    {
        //=================== RICH parameters ===========================
        IlcRICH *RICH = new IlcRICHv1("RICH", "normal RICH");
                                                                                
    }
                                                                                
                                                                                
    if (iZDC)
    {
        //=================== ZDC parameters ============================
                                                                                
        IlcZDC *ZDC = new IlcZDCv2("ZDC", "normal ZDC");
    }
                                                                                
    if (iTRD)
    {
        //=================== TRD parameters ============================
                                                                                
        IlcTRD *TRD = new IlcTRDv1("TRD", "TRD slow simulator");
                                                                                
        // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
        TRD->SetGasMix(1);
        if (sgeo == kHoles) {
            // With hole in front of PVBAR
            TRD->SetPVBARhole();
            // With hole in front of RICH
            TRD->SetRICHhole();
        }
            // Switch on TR
            IlcTRDsim *TRDsim = TRD->CreateTR();
    }
                                                                                
    if (iFMD)
    {
        //=================== FMD parameters ============================
        IlcFMD *FMD = new IlcFMDv1("FMD", "normal FMD");
   }
                                                                                
    if (iMUON)
    {
        //=================== MUON parameters ===========================
                                                                                
        IlcMUON *MUON = new IlcMUONv1("MUON", "default");
    }
    //=================== PVBAR parameters ===========================
                                                                                
    if (iPVBAR)
    {
       IlcPVBAR *PVBAR = new IlcPVBARv1("PVBAR", "ORKA");
//         IlcPVBAR *PVBAR = new IlcPVBARv1("PVBAR", "noCPV");
    }
                                                                                
                                                                                
    if (iPMD)
    {
        //=================== PMD parameters ============================
        IlcPMD *PMD = new IlcPMDv1("PMD", "normal PMD");
    }
                                                                                
    if (iSTART)
    {
        //=================== START parameters ============================
        IlcSTART *START = new IlcSTARTv1("START", "START Detector");
    }
                                                                                
    if (iEMCAL)
    {
        //=================== EMCAL parameters ============================
        IlcEMCAL *EMCAL = new IlcEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
    }
                                                                                
     if (iCRT)
    {
        //=================== CRT parameters ============================
        IlcCRT *CRT = new IlcCRTv0("CRT", "normal ACORDE");
    }
                                                                                
     if (iVZERO)
    {
        //=================== CRT parameters ============================
        IlcVZERO *VZERO = new IlcVZEROv3("VZERO", "normal VZERO");
    }
                                                                                
                                                                                
}
コード例 #4
0
void Config()
{
    

  // Get settings from environment variables
  ProcessEnvironmentVars();

  gRandom->SetSeed(seed);
  cerr<<"Seed for random number generation= "<<seed<<endl; 

  // Libraries required by geant321
#if defined(__CINT__)
  gSystem->Load("liblhapdf");      // Parton density functions
  gSystem->Load("libEGPythia6");   // TGenerator interface
  gSystem->Load("libpythia6");     // Pythia
  gSystem->Load("libIlcPythia6");  // ILC specific implementations
  gSystem->Load("libgeant321");
#endif

  new TGeant3TGeo("C++ Interface to Geant3");

  //=======================================================================
  //  Create the output file

   
  IlcRunLoader* rl=0x0;

  cout<<"Config.C: Creating Run Loader ..."<<endl;
  rl = IlcRunLoader::Open("gilc.root",
			  IlcConfig::GetDefaultEventFolderName(),
			  "recreate");
  if (rl == 0x0)
    {
      gIlc->Fatal("Config.C","Can not instatiate the Run Loader");
      return;
    }
  rl->SetCompressionLevel(2);
  rl->SetNumberOfEventsPerFile(1000);
  gIlc->SetRunLoader(rl);
  // gIlc->SetGeometryFromFile("geometry.root");
  // gIlc->SetGeometryFromCDB();
  
  // Set the trigger configuration: proton-proton
  IlcSimulation::Instance()->SetTriggerConfig("p-p");

  //
  //=======================================================================
  // ************* STEERING parameters FOR ILC SIMULATION **************
  // --- Specify event type to be tracked through the ILC setup
  // --- All positions are in cm, angles in degrees, and P and E in GeV


    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); 




  //======================//
  // Set External decayer //
  //======================//
  TVirtualMCDecayer* decayer = new IlcDecayerPythia();
  decayer->SetForceDecay(kAll);
  decayer->Init();
  gMC->SetExternalDecayer(decayer);

  //=========================//
  // Generator Configuration //
  //=========================//
  // Create pileup generator
  IlcGenPileup *pileup = new IlcGenPileup();

  IlcGenerator* gener = 0x0;
  
  if (proc == kPythia6) {
      gener = MbPythia();
  } else if (proc == kPhojet) {
      gener = MbPhojet();
  }
  
  // Set the pileup interaction generator
  // The second argument is the pileup rate
  // in terms of event rate per bunch crossing
  pileup->SetGenerator(gener,0.01);
  // Set the beam time structure
  // Details on the syntax in STEER/IlcTriggerBCMask
  pileup->SetBCMask("72(1H1L)3420L");
  // Examples of the pileup rate and beam structure settings
  // Most of the information is taken from the LHC commissionning page
  // rate from 0.01 (at 900GeV) to 0.76 (at 14TeV)
  // 1 bunch/orbit     - bc-mask = "1H3563L"
  // 43 bunches/orbit  - bc-mask = "43(1H80L)81L"
  // 72 bunches/orbit  - bc-mask = "72(1H1L)3420L" (50ns mode)
  // Please note that most of these setting should be cross-checked because
  // for example the 43 bunches mode is taken at CMS IP and not the ILC one.

  // Generate the trigger interaction
  pileup->GenerateTrigInteraction(kTRUE);

  // PRIMARY VERTEX
  //
  pileup->SetOrigin(0., 0., 0.);    // vertex position
  //
  //
  // Size of the interaction diamond
  // Longitudinal
  Float_t sigmaz  = 5.4 / TMath::Sqrt(2.); // [cm]
  if (energy == 900)
    sigmaz  = 10.5 / TMath::Sqrt(2.); // [cm]
  //
  // Transverse
  Float_t betast  = 10;                 // beta* [m]
  Float_t eps     = 3.75e-6;            // emittance [m]
  Float_t gamma   = energy / 2.0 / 0.938272;  // relativistic gamma [1]
  Float_t sigmaxy = TMath::Sqrt(eps * betast / gamma) / TMath::Sqrt(2.) * 100.;  // [cm]
  printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
    
  pileup->SetSigma(sigmaxy, sigmaxy, sigmaz);      // Sigma in (X,Y,Z) (cm) on IP position
  pileup->SetCutVertexZ(3.);        // Truncate at 3 sigma
  pileup->SetVertexSmear(kPerEvent);

  pileup->Init();

  // FIELD
  //
  IlcMagF* field = 0x0;
  if (mag == kNoField) {
    comment = comment.Append(" | L3 field 0.0 T");
    field = new IlcMagF("Maps","Maps", 0., 0., IlcMagF::k5kGUniform);
  } else if (mag == k5kG) {
    comment = comment.Append(" | L3 field 0.5 T");
    field = new IlcMagF("Maps","Maps", -1., -1., IlcMagF::k5kG);
  }
  printf("\n \n Comment: %s \n \n", comment.Data());
  TGeoGlobalMagField::Instance()->SetField(field);
    
  rl->CdGAFile();

  Int_t iABSO  = 1;
  Int_t iACORDE= 0;
  Int_t iDIPO  = 1;
  Int_t iEMCAL = 0;
  Int_t iFMD   = 1;
  Int_t iFRAME = 1;
  Int_t iHALL  = 1;
  Int_t iITS   = 1;
  Int_t iMAG   = 1;
  Int_t iMUON  = 1;
  Int_t iPHOS  = 1;
  Int_t iPIPE  = 1;
  Int_t iPMD   = 0;
  Int_t iHMPID = 1;
  Int_t iSHIL  = 1;
  Int_t iT0    = 1;
  Int_t iTOF   = 1;
  Int_t iTPC   = 1;
  Int_t iTRD   = 1;
  Int_t iVZERO = 1;
  Int_t iZDC   = 1;
  

    //=================== Ilc BODY parameters =============================
    IlcBODY *BODY = new IlcBODY("BODY", "Ilc envelop");


    if (iMAG)
    {
        //=================== MAG parameters ============================
        // --- Start with Magnet since detector layouts may be depending ---
        // --- on the selected Magnet dimensions ---
        IlcMAG *MAG = new IlcMAG("MAG", "Magnet");
    }


    if (iABSO)
    {
        //=================== ABSO parameters ============================
        IlcABSO *ABSO = new IlcABSOv3("ABSO", "Muon Absorber");
    }

    if (iDIPO)
    {
        //=================== DIPO parameters ============================

        IlcDIPO *DIPO = new IlcDIPOv3("DIPO", "Dipole version 3");
    }

    if (iHALL)
    {
        //=================== HALL parameters ============================

        IlcHALL *HALL = new IlcHALLv3("HALL", "Ilc Hall");
    }


    if (iFRAME)
    {
        //=================== FRAME parameters ============================

        IlcFRAMEv2 *FRAME = new IlcFRAMEv2("FRAME", "Space Frame");
	FRAME->SetHoles(1);
    }

    if (iSHIL)
    {
        //=================== SHIL parameters ============================

        IlcSHIL *SHIL = new IlcSHILv3("SHIL", "Shielding Version 3");
    }


    if (iPIPE)
    {
        //=================== PIPE parameters ============================

        IlcPIPE *PIPE = new IlcPIPEv3("PIPE", "Beam Pipe");
    }
 
    if (iITS)
    {
        //=================== ITS parameters ============================

	IlcITS *ITS  = new IlcITSv11("ITS","ITS v11");
    }

    if (iTPC)
    {
      //============================ TPC parameters =====================

        IlcTPC *TPC = new IlcTPCv2("TPC", "Default");
    }


    if (iTOF) {
        //=================== TOF parameters ============================

	IlcTOF *TOF = new IlcTOFv6T0("TOF", "normal TOF");
    }


    if (iHMPID)
    {
        //=================== HMPID parameters ===========================

        IlcHMPID *HMPID = new IlcHMPIDv3("HMPID", "normal HMPID");

    }


    if (iZDC)
    {
        //=================== ZDC parameters ============================

        IlcZDC *ZDC = new IlcZDCv4("ZDC", "normal ZDC");
    }

    if (iTRD)
    {
        //=================== TRD parameters ============================

        IlcTRD *TRD = new IlcTRDv1("TRD", "TRD slow simulator");
        IlcTRDgeometry *geoTRD = TRD->GetGeometry();
	// Partial geometry: modules at 0,1,7,8,9,10,17
	// starting at 3h in positive direction
	geoTRD->SetSMstatus(2,0);
	geoTRD->SetSMstatus(3,0);
	geoTRD->SetSMstatus(4,0);
        geoTRD->SetSMstatus(5,0);
	geoTRD->SetSMstatus(6,0);
        geoTRD->SetSMstatus(11,0);
        geoTRD->SetSMstatus(12,0);
        geoTRD->SetSMstatus(13,0);
        geoTRD->SetSMstatus(14,0);
        geoTRD->SetSMstatus(15,0);
        geoTRD->SetSMstatus(16,0);
    }

    if (iFMD)
    {
        //=================== FMD parameters ============================

	IlcFMD *FMD = new IlcFMDv1("FMD", "normal FMD");
   }

    if (iMUON)
    {
        //=================== MUON parameters ===========================
        // New MUONv1 version (geometry defined via builders)

        IlcMUON *MUON = new IlcMUONv1("MUON", "default");
    }

    if (iPHOS)
    {
        //=================== PHOS parameters ===========================

        IlcPHOS *PHOS = new IlcPHOSv1("PHOS", "noCPV_Modules123");
    }


    if (iPMD)
    {
        //=================== PMD parameters ============================

        IlcPMD *PMD = new IlcPMDv1("PMD", "normal PMD");
    }

    if (iT0)
    {
        //=================== T0 parameters ============================
        IlcT0 *T0 = new IlcT0v1("T0", "T0 Detector");
    }

    if (iEMCAL)
    {
        //=================== EMCAL parameters ============================

        IlcEMCAL *EMCAL = new IlcEMCALv2("EMCAL", "EMCAL_FIRSTYEAR");
    }

     if (iACORDE)
    {
        //=================== ACORDE parameters ============================

        IlcACORDE *ACORDE = new IlcACORDEv1("ACORDE", "normal ACORDE");
    }

     if (iVZERO)
    {
        //=================== ACORDE parameters ============================

        IlcVZERO *VZERO = new IlcVZEROv7("VZERO", "normal VZERO");
    }
}