Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sergey Gorbunov
CbmTools
Commits
28265f89
Commit
28265f89
authored
Dec 19, 2021
by
sergeizharko
Browse files
Changed hardcoded 'data' directory and 'cbmroot' directory to parameters defined in myParameters.h
parent
9abd126a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
34 deletions
+54
-34
macro/myDigi.C
macro/myDigi.C
+8
-6
macro/myParameters.h
macro/myParameters.h
+16
-0
macro/myQa.C
macro/myQa.C
+4
-4
macro/myReco.C
macro/myReco.C
+8
-6
macro/myTransport.C
macro/myTransport.C
+18
-18
No files found.
macro/myDigi.C
View file @
28265f89
#include "TROOT.h"
#include "TSystem.h"
#include "myParameters.h"
/*
Macro to run standard cbmroot digitization in a simplified form
...
...
@@ -9,10 +10,10 @@
*/
void
myDigi
(
TString
inpSetup
,
TString
inpEnergy
,
TString
inpCentr
,
TString
type
)
{
void
myDigi
(
TString
inpSetup
=
"el"
,
TString
inpEnergy
=
"10gev"
,
TString
inpCentr
=
"mbias"
,
TString
type
=
"eb"
)
{
// setup: "el" or "mu"
// energy: "10gev" or "25gev"
...
...
@@ -32,10 +33,11 @@ void myDigi(TString inpSetup,
cout
<<
"wrong type "
<<
type
<<
endl
;
}
TString
command
=
s
+
".x $CBMSRCDIR/macro/run/run_digi.C("
+
"
\"
data/"
+
file
TString
command
=
s
+
".x "
+
myParameters
::
kCBMROOT_DIR
+
"/macro/run/run_digi.C("
+
"
\"
"
+
myParameters
::
kDATA_DIR
+
"/"
+
file
+
"
\"
, -1,
\"\"
, "
+
rate
+
")"
;
cout
<<
"processing command "
<<
command
<<
endl
;
gROOT
->
ProcessLine
(
command
);
cout
<<
"processed command "
<<
command
<<
endl
;
}
\ No newline at end of file
}
macro/myParameters.h
0 → 100644
View file @
28265f89
/**************************************************************************************************************
* @file myParameters.h
*************************************************************************************************************/
#ifndef myParameters_h
#define myParameters_h 1
// NOTE: ROOT does not understand '~' symbol
namespace
myParameters
{
const
TString
kDATA_DIR
{
"/home/sergei/research/CBM/data"
};
const
TString
kCBMROOT_DIR
{
"/home/sergei/research/CBM/cbmroot"
};
}
#endif // myParameters_h
macro/myQa.C
View file @
28265f89
#include "TROOT.h"
#include "TSystem.h"
#include "myParameters.h"
/*
Macro to run standard cbmroot qa in a simplified form
Example:
...
...
@@ -9,7 +9,7 @@
*/
void
myQa
(
TString
inpSetup
,
TString
inpEnergy
,
TString
inpCentr
,
TString
type
)
{
void
myQa
(
TString
inpSetup
=
"el"
,
TString
inpEnergy
=
"10gev"
,
TString
inpCentr
=
"mbias"
,
TString
type
=
"eb"
)
{
// setup: "el" or "mu"
// energy: "10gev" or "25gev"
...
...
@@ -31,10 +31,10 @@ void myQa(TString inpSetup, TString inpEnergy, TString inpCentr, TString type) {
TString
file
=
inpSetup
+
"."
+
inpEnergy
+
"."
+
inpCentr
+
"."
+
type
;
TString
command
=
s
+
".x
$CBMSRCDIR/macro/run/run_qa.C("
+
"
\"
data
/"
+
file
TString
command
=
s
+
".x
"
+
myParameters
::
kCBMROOT_DIR
+
"/macro/run/run_qa.C("
+
"
\"
"
+
myParameters
::
kDATA_DIR
+
"
/"
+
file
+
"
\"
, "
+
setup
+
")"
;
cout
<<
"processing command "
<<
command
<<
endl
;
gROOT
->
ProcessLine
(
command
);
cout
<<
"processed command "
<<
command
<<
endl
;
}
\ No newline at end of file
}
macro/myReco.C
View file @
28265f89
#include "TROOT.h"
#include "TSystem.h"
#include "myParameters.h"
/*
Macro to run standard cbmroot reconstruction in a simplified form
...
...
@@ -8,10 +9,10 @@
root -l -q ~/cbmtools/macro/myReco.C'("mu","10gev","mbias","tb")'
*/
void
myReco
(
TString
inpSetup
,
TString
inpEnergy
,
TString
inpCentr
,
TString
type
)
{
void
myReco
(
TString
inpSetup
=
"el"
,
TString
inpEnergy
=
"10gev"
,
TString
inpCentr
=
"mbias"
,
TString
type
=
"eb"
)
{
// setup: "el" or "mu"
// energy: "10gev" or "25gev"
...
...
@@ -35,7 +36,8 @@ void myReco(TString inpSetup,
//TString command = s + ".x $CBMSRCDIR/macro/run/run_reco.C(" + "\"data/" + file
// + "\", -1, 0, \"\", \"\", " + setup + ", \"\", true)";
TString
command
=
s
+
".x $CBMSRCDIR/macro/run/run_reco.C("
+
"
\"
data/"
+
file
TString
command
=
s
+
".x "
+
myParameters
::
kCBMROOT_DIR
+
"/macro/run/run_reco.C("
+
"
\"
"
+
myParameters
::
kDATA_DIR
+
"/"
+
file
+
"
\"
, -1, 0,
\"\"
,
\"\"
, "
+
setup
+
",
\"\"
, true)"
;
//command = s + ".x $CBMSRCDIR/macro/run/run_reco_event.C(-1," + "\"data/" + file
...
...
@@ -48,4 +50,4 @@ void myReco(TString inpSetup,
cout
<<
"processing command "
<<
command
<<
endl
;
gROOT
->
ProcessLine
(
command
);
cout
<<
"processed command "
<<
command
<<
endl
;
}
\ No newline at end of file
}
macro/myTransport.C
View file @
28265f89
#include "TROOT.h"
#include "TSystem.h"
#include "myParameters.h"
/*
Macro to run standard cbmroot transport in a simplified form
...
...
@@ -11,17 +11,16 @@
root -l -q ~/cbmtools/macro/myTransport.C'("mu","10gev","mbias")'
*/
void
myTransport
(
TString
inpSetup
,
const
char
*
inpEnergy
,
const
char
*
inpCentr
)
{
void
myTransport
(
TString
inpSetup
=
"el"
,
const
char
*
inpEnergy
=
"10gev"
,
const
char
*
inpCentr
=
"mbias"
)
{
// setup: "el" or "mu"
// energy: "10gev" or "25gev"
// centr: "mbias" or "centr"
gSystem
->
Exec
(
"mkdir
data"
);
gSystem
->
Exec
(
"cp
$CBMSRCDIR
/macro/run/.rootrc ."
);
gSystem
->
Exec
(
"mkdir
"
+
myParameters
::
kDATA_DIR
);
gSystem
->
Exec
(
"cp
"
+
myParameters
::
kCBMROOT_DIR
+
"
/macro/run/.rootrc ."
);
TString
s
;
TString
setup
;
...
...
@@ -30,7 +29,8 @@ void myTransport(TString inpSetup,
}
else
if
(
inpSetup
==
"mu"
)
{
setup
=
"
\"
sis100_muon_jpsi
\"
"
;
}
else
{
cout
<<
"Wrong setup name
\"
"
<<
inpSetup
<<
"
\"
!!!"
<<
endl
;
// TODO: Change stdout to stderr (?)
cerr
<<
"Wrong setup name
\"
"
<<
inpSetup
<<
"
\"
!!!"
<<
endl
;
return
;
}
...
...
@@ -38,30 +38,30 @@ void myTransport(TString inpSetup,
file
=
file
+
inpSetup
+
"."
+
inpEnergy
+
"."
+
inpCentr
;
TString
events
;
events
=
events
+
"
\"
/home/cbmdock/cbmroot
/input/urqmd.auau."
+
inpEnergy
events
=
events
+
"
\"
"
+
myParameters
::
kCBMROOT_DIR
+
"
/input/urqmd.auau."
+
inpEnergy
+
"."
+
inpCentr
+
".root
\"
"
;
TString
command
;
command
=
command
+
".x
$CBMSRCDIR
/macro/run/run_transport.C("
+
"10,"
+
setup
+
",
\"
data
/"
+
file
+
"
\"
,"
+
events
+
")"
;
command
=
command
+
".x
"
+
myParameters
::
kCBMROOT_DIR
+
"
/macro/run/run_transport.C("
+
"10,"
+
setup
+
",
\"
"
+
myParameters
::
kDATA_DIR
+
"
/"
+
file
+
"
\"
,"
+
events
+
")"
;
cout
<<
"processing command "
<<
command
<<
endl
;
gROOT
->
ProcessLine
(
command
);
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".par.root
data
/"
+
file
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".par.root
"
+
myParameters
::
kDATA_DIR
+
"
/"
+
file
+
".eb.par.root"
);
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".tra.root
data
/"
+
file
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".tra.root
"
+
myParameters
::
kDATA_DIR
+
"
/"
+
file
+
".eb.tra.root"
);
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".geo.root
data
/"
+
file
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".geo.root
"
+
myParameters
::
kDATA_DIR
+
"
/"
+
file
+
".eb.geo.root"
);
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".par.root
data
/"
+
file
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".par.root
"
+
myParameters
::
kDATA_DIR
+
"
/"
+
file
+
".tb.par.root"
);
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".tra.root
data
/"
+
file
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".tra.root
"
+
myParameters
::
kDATA_DIR
+
"
/"
+
file
+
".tb.tra.root"
);
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".geo.root
data
/"
+
file
gSystem
->
Exec
(
s
+
"ln -sf "
+
file
+
".geo.root
"
+
myParameters
::
kDATA_DIR
+
"
/"
+
file
+
".tb.geo.root"
);
cout
<<
"processed command "
<<
command
<<
endl
;
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment