Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
c3017df7
Commit
c3017df7
authored
4 years ago
by
Volker Friese
Browse files
Options
Downloads
Patches
Plain Diff
Transport macros for mcbm, including transport of beam through setup.
parent
6481d246
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!75
Simulation macros for mcbm
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
macro/mcbm/mcbm_digi_mixed.C
+120
-0
120 additions, 0 deletions
macro/mcbm/mcbm_digi_mixed.C
macro/mcbm/mcbm_transport.C
+1
-1
1 addition, 1 deletion
macro/mcbm/mcbm_transport.C
with
121 additions
and
1 deletion
macro/mcbm/mcbm_digi_mixed.C
0 → 100644
+
120
−
0
View file @
c3017df7
/** @file mcbm_digi_mixed.C
** @author Volker Friese <v.friese@gsi.de>
** @since 7 August 2020
**/
// Includes needed for IDE
#if !defined(__CLING__)
#include
"CbmDigitization.h"
#include
"FairSystemInfo.h"
#endif
/** @brief Macro for detector response simulation (digitisation)
** with two different MC inputs at different rates
** @author Volker Friese <v.friese@gsi.de>
** @date 8 August 2020
**
** The detector response produces a raw data file from the transport
** data, which serves as input for reconstruction. Raw data will
** be delivered in time-slice format (one tree entry per time-slice).
**
** For options to modify the run settings, consult
** the documentation of the CbmDigitization class.
**/
void
mcbm_digi_mixed
()
{
// ===> User settings
// --- Specify collision input (e.g., UrQMD)
TString
collInput
=
"collision.tra.root"
;
// MC file name
Double_t
collRate
=
1.e7
;
// Collision rate [1/s]
ECbmTreeAccess
collMode
=
ECbmTreeAccess
::
kRegular
;
// Take events one after one
// --- Specify beam input
TString
beamInput
=
"beam.tra.root"
;
// MC file name
Double_t
beamRate
=
1.e9
;
// Beam rate [1/s]
ECbmTreeAccess
beamMode
=
ECbmTreeAccess
::
kRandom
;
// Take random events
// --- Specify parameter file
TString
paramFile
=
"collision.par.root"
;
// --- Specify time-slice length [ns]
// --- Negative values mean that all data go into one time slice
Double_t
tsLength
=
-
1
.;
// --- Specify output file
TString
outFile
=
"combined.raw.root"
;
// <=== User settings
// --- Logger settings ----------------------------------------------------
FairLogger
::
GetLogger
()
->
SetLogScreenLevel
(
"INFO"
);
FairLogger
::
GetLogger
()
->
SetLogVerbosityLevel
(
"LOW"
);
// ------------------------------------------------------------------------
// ----- Allow overwriting of output file -----------------------------
Bool_t
overwrite
=
kTRUE
;
// ------------------------------------------------------------------------
// ----- Timer --------------------------------------------------------
TStopwatch
timer
;
timer
.
Start
();
// ------------------------------------------------------------------------
// ----- Digitization run ---------------------------------------------
CbmDigitization
run
;
run
.
AddInput
(
0
,
collInput
,
collRate
,
collMode
);
run
.
AddInput
(
1
,
beamInput
,
beamRate
,
beamMode
);
run
.
SetParameterRootFile
(
paramFile
);
run
.
SetOutputFile
(
outFile
,
overwrite
);
run
.
SetTimeSliceLength
(
tsLength
);
run
.
Deactivate
(
ECbmModuleId
::
kTof
);
run
.
Run
();
// ------------------------------------------------------------------------
// ----- Finish -------------------------------------------------------
timer
.
Stop
();
Double_t
rtime
=
timer
.
RealTime
();
Double_t
ctime
=
timer
.
CpuTime
();
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
"Macro finished successfully."
<<
std
::
endl
;
std
::
cout
<<
"Output file is "
<<
outFile
<<
std
::
endl
;
std
::
cout
<<
"Parameter file is "
<<
paramFile
<<
std
::
endl
;
std
::
cout
<<
"Real time "
<<
rtime
<<
" s, CPU time "
<<
ctime
<<
" s"
<<
std
::
endl
<<
std
::
endl
;
// ------------------------------------------------------------------------
// ----- CTest resource monitoring ------------------------------------
FairSystemInfo
sysInfo
;
Float_t
maxMemory
=
sysInfo
.
GetMaxMemory
();
std
::
cout
<<
"<DartMeasurement name=
\"
MaxMemory
\"
type=
\"
numeric/double
\"
>"
;
std
::
cout
<<
maxMemory
;
std
::
cout
<<
"</DartMeasurement>"
<<
std
::
endl
;
std
::
cout
<<
"<DartMeasurement name=
\"
WallTime
\"
type=
\"
numeric/double
\"
>"
;
std
::
cout
<<
rtime
;
std
::
cout
<<
"</DartMeasurement>"
<<
std
::
endl
;
Float_t
cpuUsage
=
ctime
/
rtime
;
std
::
cout
<<
"<DartMeasurement name=
\"
CpuLoad
\"
type=
\"
numeric/double
\"
>"
;
std
::
cout
<<
cpuUsage
;
std
::
cout
<<
"</DartMeasurement>"
<<
std
::
endl
;
// ------------------------------------------------------------------------
// ----- Finish -------------------------------------------------------
std
::
cout
<<
" Test passed"
<<
std
::
endl
;
std
::
cout
<<
" All ok "
<<
std
::
endl
;
// ------------------------------------------------------------------------
}
// End of macro
This diff is collapsed.
Click to expand it.
macro/mcbm/mcbm_transport.C
+
1
−
1
View file @
c3017df7
...
@@ -164,7 +164,7 @@ void mcbm_transport(
...
@@ -164,7 +164,7 @@ void mcbm_transport(
targetRotY
*
TMath
::
DegToRad
());
targetRotY
*
TMath
::
DegToRad
());
run
.
SetBeamPosition
(
0
.,
0
.,
0
.
1
,
0
.
1
);
// Beam width 1 mm is assumed
run
.
SetBeamPosition
(
0
.,
0
.,
0
.
1
,
0
.
1
);
// Beam width 1 mm is assumed
run
.
SetBeamAngle
(
beamRotY
*
TMath
::
DegToRad
(),
0
.);
run
.
SetBeamAngle
(
beamRotY
*
TMath
::
DegToRad
(),
0
.);
run
.
StoreTrajectories
();
//
run.StoreTrajectories();
run
.
Run
(
nEvents
);
run
.
Run
(
nEvents
);
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment