Skip to content
Snippets Groups Projects
Commit 343ec0e4 authored by Sergey Gorbunov's avatar Sergey Gorbunov
Browse files

bufix: set target position to -44cm in simulation macros

parent 8a4c0a88
No related branches found
No related tags found
1 merge request!1217bugfix: set default target position to -44cm in simulation macros
Pipeline #22977 passed
...@@ -71,15 +71,17 @@ void c2f_transport(Int_t nEvents = 2, const char* setupName = "sis100_electron", ...@@ -71,15 +71,17 @@ void c2f_transport(Int_t nEvents = 2, const char* setupName = "sis100_electron",
// in the responsibility of the user that no overlaps or extrusions are // in the responsibility of the user that no overlaps or extrusions are
// created by the placement of the target. // created by the placement of the target.
// //
TString targetElement = "Gold"; TString targetMaterial = "Gold";
Double_t targetThickness = 0.025; // full thickness in cm Double_t targetThickness = 0.025; // full thickness in cm
Double_t targetDiameter = 2.5; // diameter in cm Double_t targetDiameter = 2.5; // diameter in cm
Double_t targetPosX = 0.; // target x position in global c.s. [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 targetPosY = 0.; // target y position in global c.s. [cm]
Double_t targetPosZ = 0.; // target z position in global c.s. [cm] // The target is at -44 cm from the centre of the magnet.
Double_t targetPosZ = -44.; // target z position in global c.s. [cm]
Double_t targetRotY = 0.; // target rotation angle around the y axis [deg] Double_t targetRotY = 0.; // target rotation angle around the y axis [deg]
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
std::cout << "Target is at " << targetPosZ << "cm from origin" << std::endl;
// --- Define the creation of the primary vertex ------------------------ // --- Define the creation of the primary vertex ------------------------
// //
...@@ -158,13 +160,15 @@ void c2f_transport(Int_t nEvents = 2, const char* setupName = "sis100_electron", ...@@ -158,13 +160,15 @@ void c2f_transport(Int_t nEvents = 2, const char* setupName = "sis100_electron",
// ----- Create and register the target ------------------------------- // ----- Create and register the target -------------------------------
std::cout << std::endl; std::cout << std::endl;
std::cout << "-I- " << myName << ": Registering target" << std::endl; std::cout << "-I- " << myName << ": Registering target" << std::endl;
CbmTarget* target = new CbmTarget(targetElement.Data(), targetThickness, targetDiameter); CbmTarget* target = new CbmTarget(targetMaterial.Data(), targetThickness, targetDiameter);
target->SetPosition(targetPosX, targetPosY, targetPosZ); target->SetPosition(targetPosX, targetPosY, targetPosZ);
target->SetRotation(targetRotY); target->SetRotation(targetRotY);
std::cout << target->ToString() << std::endl; std::cout << target->ToString() << std::endl;
run->AddModule(target); run->AddModule(target);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
......
...@@ -75,6 +75,15 @@ void run_reco_L1global(TString input = "", Int_t nTimeSlices = -1, Int_t firstTi ...@@ -75,6 +75,15 @@ void run_reco_L1global(TString input = "", Int_t nTimeSlices = -1, Int_t firstTi
{ {
// how to run it: // how to run it:
//
// mkdir data
//
// muon setup:
// root -l -q $VMCWORKDIR/macro/run/run_tra_file.C'("$VMCWORKDIR/input/urqmd.auau.10gev.mbias.root", 100, "./data/mu.10gev.mbias.eb", "sis100_muon_jpsi", kGeant3, 1, true)'
// root -l -q $VMCWORKDIR/macro/run/run_digi.C'("./data/mu.10gev.mbias.eb", -1, "", -1., -1)'
// root -l -q $VMCWORKDIR/macro/L1/run_reco_L1global.C'("./data/mu.10gev.mbias.eb", -1, 0, "", "", "sis100_muon_jpsi", "", true)'
//
// trd2d setup:
// root -l -q $VMCWORKDIR/macro/L1/run_reco_L1global.C'("trd2d", -1, 0, "", "", "trd2d", "", true)' // root -l -q $VMCWORKDIR/macro/L1/run_reco_L1global.C'("trd2d", -1, 0, "", "", "trd2d", "", true)'
// ======================================================================== // ========================================================================
......
...@@ -70,6 +70,18 @@ void dimuon_transport(Int_t nEvents = 1000, const char* setupName = "sis100_muon ...@@ -70,6 +70,18 @@ void dimuon_transport(Int_t nEvents = 1000, const char* setupName = "sis100_muon
std::cout << "-I- " << myName << ": Using signal input file " << inFile << std::endl; std::cout << "-I- " << myName << ": Using signal input file " << inFile << std::endl;
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
TString targetMaterial = "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]
// The target is at -44 cm from the centre of the magnet.
Double_t targetPosZ = -44.; // target z position in global c.s. [cm]
Double_t targetRotY = 0.; // target rotation angle around the y axis [deg]
// ------------------------------------------------------------------------
std::cout << "Target is at " << targetPosZ << "cm from the origin" << std::endl;
// ----- Timer -------------------------------------------------------- // ----- Timer --------------------------------------------------------
TStopwatch timer; TStopwatch timer;
...@@ -83,7 +95,13 @@ void dimuon_transport(Int_t nEvents = 1000, const char* setupName = "sis100_muon ...@@ -83,7 +95,13 @@ void dimuon_transport(Int_t nEvents = 1000, const char* setupName = "sis100_muon
run.SetParFileName(parFile); run.SetParFileName(parFile);
run.SetGeoFileName(geoFile); run.SetGeoFileName(geoFile);
run.LoadSetup(setupName); run.LoadSetup(setupName);
run.SetTarget("Gold", 0.025, 2.5);
if (!(run.GetSetup())->IsActive(ECbmModuleId::kTarget)) {
std::cout << "Target being generated in tra macro" << std::endl;
run.SetTarget(targetMaterial.Data(), targetThickness, targetDiameter, targetPosX, targetPosY, targetPosZ,
targetRotY);
};
run.SetBeamPosition(0., 0., 0.1, 0.1); run.SetBeamPosition(0., 0., 0.1, 0.1);
run.SetEngine(kGeant3); run.SetEngine(kGeant3);
run.SetRandomSeed(randomSeed); run.SetRandomSeed(randomSeed);
......
...@@ -72,6 +72,21 @@ void run_transport(Int_t nEvents = 3, const char* setupName = "sis100_muon_lmvm" ...@@ -72,6 +72,21 @@ void run_transport(Int_t nEvents = 3, const char* setupName = "sis100_muon_lmvm"
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// ----- Target properties --------------------------------------------
// For flexibility, the target volume is not part of the predefined
// geometry setup. It thus has to be specified in this macro. By default,
// a Gold target of 250 micrometer thickness and 2.5 cm diameter is used.
// The target shifts by 4 cm upstream by decision of the technical board
// in Apr 2020 which is 40 cm from center of magnet.
TString targetMaterial = "Gold";
Double_t targetThickness = 0.025; // in cm
Double_t targetDiameter = 2.5; // in cm
Double_t targetZpos = -44.0; // The target is at -44 cm from the centre of the magnet.
std::cout << "Target is at " << targetZpos << "cm from origin" << std::endl;
// ------------------------------------------------------------------------
// ----- Timer -------------------------------------------------------- // ----- Timer --------------------------------------------------------
TStopwatch timer; TStopwatch timer;
timer.Start(); timer.Start();
...@@ -117,7 +132,12 @@ void run_transport(Int_t nEvents = 3, const char* setupName = "sis100_muon_lmvm" ...@@ -117,7 +132,12 @@ void run_transport(Int_t nEvents = 3, const char* setupName = "sis100_muon_lmvm"
run.SetParFileName(parFile); run.SetParFileName(parFile);
run.SetGeoFileName(geoFile); run.SetGeoFileName(geoFile);
run.LoadSetup(setupName); run.LoadSetup(setupName);
run.SetTarget("Gold", 0.025, 2.5);
if (!(run.GetSetup())->IsActive(ECbmModuleId::kTarget)) {
std::cout << "Target being generated in tra macro" << std::endl;
run.SetTarget(targetMaterial.Data(), targetThickness, targetDiameter, 0, 0, targetZpos);
}
run.SetBeamPosition(0., 0., 0.1, 0.1); run.SetBeamPosition(0., 0., 0.1, 0.1);
run.SetEngine(kGeant3); run.SetEngine(kGeant3);
run.SetRandomSeed(randomSeed); run.SetRandomSeed(randomSeed);
......
...@@ -108,7 +108,8 @@ void run_tra_file(const char* input = "", Int_t nEvents = 1, const char* output ...@@ -108,7 +108,8 @@ void run_tra_file(const char* input = "", Int_t nEvents = 1, const char* output
// a Gold target of 250 micrometer thickness and 2.5 cm diameter is used. // a Gold target of 250 micrometer thickness and 2.5 cm diameter is used.
// The target shifts by 4 cm upstream by decision of the technical board // The target shifts by 4 cm upstream by decision of the technical board
// in Apr 2020 which is 40 cm from center of magnet. // in Apr 2020 which is 40 cm from center of magnet.
const char* targetMedium = "Gold";
TString targetMaterial = "Gold";
Double_t targetThickness = 0.025; // in cm Double_t targetThickness = 0.025; // in cm
Double_t targetDiameter = 2.5; // in cm Double_t targetDiameter = 2.5; // in cm
...@@ -159,7 +160,7 @@ void run_tra_file(const char* input = "", Int_t nEvents = 1, const char* output ...@@ -159,7 +160,7 @@ void run_tra_file(const char* input = "", Int_t nEvents = 1, const char* output
run.LoadSetup(setup); run.LoadSetup(setup);
if (!(run.GetSetup())->IsActive(ECbmModuleId::kTarget)) { if (!(run.GetSetup())->IsActive(ECbmModuleId::kTarget)) {
std::cout << "Target being generated in tra macro" << std::endl; std::cout << "Target being generated in tra macro" << std::endl;
run.SetTarget(targetMedium, targetThickness, targetDiameter, 0, 0, targetZpos); run.SetTarget(targetMaterial.Data(), targetThickness, targetDiameter, 0, 0, targetZpos);
}; };
run.SetBeamPosition(beamPosX, beamPosY, beamSigmaX, beamSigmaY); run.SetBeamPosition(beamPosX, beamPosY, beamSigmaX, beamSigmaY);
if (rotateEvents) run.SetRandomEventPlane(); if (rotateEvents) run.SetRandomEventPlane();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment