*** ../run/run_sim.C 2015-10-02 09:28:20.056678715 +0200 --- mcbm_sim.C 2015-10-02 12:30:38.145209489 +0200 *************** *** 50,56 **** TString defaultInputFile=""; ! void run_sim(Int_t nEvents = 2, const char* setup = "sis100_electron") { // ======================================================================== --- 50,56 ---- TString defaultInputFile=""; ! void mcbm_sim(Int_t nEvents = 1, const char* setup = "sis18_mcbm") { // ======================================================================== *************** *** 74,81 **** TString inFile = inDir + defaultInputFile; ! // Function needed for CTest runtime dependency ! TString depFile = Remove_CTest_Dependency_File(outDir, "run_sim" , setup); // --- Logger settings ---------------------------------------------------- TString logLevel = "INFO"; // "DEBUG"; --- 74,81 ---- TString inFile = inDir + defaultInputFile; ! // // Function needed for CTest runtime dependency ! // TString depFile = Remove_CTest_Dependency_File(outDir, "run_sim" , setup); // --- Logger settings ---------------------------------------------------- TString logLevel = "INFO"; // "DEBUG"; *************** *** 94,105 **** // created by the placement of the target. // TString targetElement = "Gold"; ! Double_t targetThickness = 0.025; // full thickness in cm Double_t targetDiameter = 2.5; // diameter in cm Double_t targetPosX = 0.; // target x position in global c.s. [cm] Double_t targetPosY = 0.; // target y position in global c.s. [cm] Double_t targetPosZ = 0.; // target z position in global c.s. [cm] ! Double_t targetRotY = 0.; // target rotation angle around the y axis [deg] // ------------------------------------------------------------------------ --- 94,105 ---- // created by the placement of the target. // TString targetElement = "Gold"; ! Double_t targetThickness = 0.25; // full thickness in cm Double_t targetDiameter = 2.5; // diameter in cm Double_t targetPosX = 0.; // target x position in global c.s. [cm] Double_t targetPosY = 0.; // target y position in global c.s. [cm] Double_t targetPosZ = 0.; // target z position in global c.s. [cm] ! Double_t beamRotY = -30.; // beam rotation angle around the y axis [deg] // ------------------------------------------------------------------------ *************** *** 113,120 **** // Bool_t smearVertexXY = kTRUE; Bool_t smearVertexZ = kTRUE; ! Double_t beamWidthX = 1.; // Gaussian sigma of the beam profile in x [cm] ! Double_t beamWidthY = 1.; // Gaussian sigma of the beam profile in y [cm] // ------------------------------------------------------------------------ --- 113,120 ---- // Bool_t smearVertexXY = kTRUE; Bool_t smearVertexZ = kTRUE; ! Double_t beamWidthX = 0.5; // Gaussian sigma of the beam profile in x [cm] ! Double_t beamWidthY = 0.5; // Gaussian sigma of the beam profile in y [cm] // ------------------------------------------------------------------------ *************** *** 172,178 **** targetThickness, targetDiameter); target->SetPosition(targetPosX, targetPosY, targetPosZ); ! target->SetRotation(targetRotY); fRun->AddModule(target); if ( magnetGeom != "" ) { --- 172,178 ---- targetThickness, targetDiameter); target->SetPosition(targetPosX, targetPosY, targetPosZ); ! // target->SetRotation(beamRotY); fRun->AddModule(target); if ( magnetGeom != "" ) { *************** *** 247,260 **** // ------------------------------------------------------------------------ // ----- Create magnetic field ---------------------------------------- ! CbmFieldMap* magField = NULL; ! if ( 2 == fieldSymType ) { ! magField = new CbmFieldMapSym2(fieldMap); ! } else if ( 3 == fieldSymType ) { ! magField = new CbmFieldMapSym3(fieldMap); ! } ! magField->SetPosition(0., 0., fieldZ); ! magField->SetScale(fieldScale); fRun->SetField(magField); // ------------------------------------------------------------------------ --- 247,261 ---- // ------------------------------------------------------------------------ // ----- Create magnetic field ---------------------------------------- ! // CbmFieldMap* magField = NULL; ! // if ( 2 == fieldSymType ) { ! // magField = new CbmFieldMapSym2(fieldMap); ! // } else if ( 3 == fieldSymType ) { ! // magField = new CbmFieldMapSym3(fieldMap); ! // } ! // magField->SetPosition(0., 0., fieldZ); ! // magField->SetScale(fieldScale); ! FairConstField* magField = new FairConstField(); fRun->SetField(magField); // ------------------------------------------------------------------------ *************** *** 275,280 **** --- 276,282 ---- tDz = target->GetThickness(); } primGen->SetTarget(tZ, tDz); + // primGen->SetTargetRotAngle(0., beamRotY * TMath::Pi()/180.); primGen->SetBeam(0., 0., beamWidthX, beamWidthY); primGen->SmearGausVertexXY(smearVertexXY); primGen->SmearVertexZ(smearVertexZ); *************** *** 290,298 **** --- 292,322 ---- CbmUnigenGenerator* uniGen = new CbmUnigenGenerator(inFile); uniGen->SetEventPlane(0. , 360.); primGen->AddGenerator(uniGen); + primGen->SetBeamAngle(beamRotY * TMath::Pi()/180.,0,0,0); // set direction of beam to 30 degrees fRun->SetGenerator(primGen); // ------------------------------------------------------------------------ + // // ----- Create Electron gun as alternative ----------------------------- + // FairPrimaryGenerator* primGen = new FairPrimaryGenerator(); + // // Use the FairBoxGenerator which generates a soingle electron + // FairBoxGenerator *eminus = new FairBoxGenerator(); + // eminus->SetPDGType(11); + // eminus->SetMultiplicity(1000); + // // eminus->SetBoxXYZ(32.,-32.,32.,-32.,0.); // shoot at corner of diagonal modules + // // eminus->SetBoxXYZ(0., 0., 0., 0., 0.); // shoot at corner of diagonal modules + // // eminus->SetBoxXYZ(57.,-57., 0., 0.,0.); // shoot at corner of diagonal modules + // // eminus->SetBoxXYZ(-57.,-57., 57., 57.,0.); // shoot at corner of diagonal modules + // eminus->SetBoxXYZ(-180.,-15.,-150.,15.,0.); // shoot at corner of diagonal modules + // eminus->SetPRange(2.,2.); + // eminus->SetPhiRange(0.,360.); + // eminus->SetThetaRange(0.,0.); + // primGen->AddGenerator(eminus); + // + // // primGen->SetBeamAngle(30*TMath::Pi()/180.,0,0,0); // set direction of beam to 30 degrees + // + // fRun->SetGenerator(primGen); + // // ------------------------------------------------------------------------ + // Trajectories Visualization (TGeoManager Only) // Switch this on if you want to visualize tracks in the *************** *** 305,322 **** fRun->Init(); // ------------------------------------------------------------------------ ! // Set cuts for storing the trajectories. ! // Switch this on only if trajectories are stored. ! // Choose this cuts according to your needs, but be aware ! // that the file size of the output file depends on these cuts ! ! FairTrajFilter* trajFilter = FairTrajFilter::Instance(); ! trajFilter->SetStepSizeCut(0.01); // 1 cm ! trajFilter->SetVertexCut(-2000., -2000., 4., 2000., 2000., 100.); ! trajFilter->SetMomentumCutP(10e-3); // p_lab > 10 MeV ! trajFilter->SetEnergyCut(0., 1.02); // 0 < Etot < 1.04 GeV ! trajFilter->SetStorePrimaries(kTRUE); ! trajFilter->SetStoreSecondaries(kTRUE); // ----- Runtime database --------------------------------------------- CbmFieldPar* fieldPar = (CbmFieldPar*) rtdb->getContainer("CbmFieldPar"); --- 329,346 ---- fRun->Init(); // ------------------------------------------------------------------------ ! // // Set cuts for storing the trajectories. ! // // Switch this on only if trajectories are stored. ! // // Choose this cuts according to your needs, but be aware ! // // that the file size of the output file depends on these cuts ! // ! // FairTrajFilter* trajFilter = FairTrajFilter::Instance(); ! // trajFilter->SetStepSizeCut(0.01); // 1 cm ! // trajFilter->SetVertexCut(-2000., -2000., 4., 2000., 2000., 100.); ! // trajFilter->SetMomentumCutP(10e-3); // p_lab > 10 MeV ! // trajFilter->SetEnergyCut(0., 1.02); // 0 < Etot < 1.04 GeV ! // trajFilter->SetStorePrimaries(kTRUE); ! // trajFilter->SetStoreSecondaries(kTRUE); // ----- Runtime database --------------------------------------------- CbmFieldPar* fieldPar = (CbmFieldPar*) rtdb->getContainer("CbmFieldPar"); *************** *** 352,359 **** cout << " Test passed" << endl; cout << " All ok " << endl; ! // Function needed for CTest runtime dependency ! Generate_CTest_Dependency_File(depFile); } --- 376,383 ---- cout << " Test passed" << endl; cout << " All ok " << endl; ! // // Function needed for CTest runtime dependency ! // Generate_CTest_Dependency_File(depFile); }