Commit 28265f89 authored by sergeizharko's avatar sergeizharko
Browse files

Changed hardcoded 'data' directory and 'cbmroot' directory to parameters defined in myParameters.h

parent 9abd126a
#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
}
/**************************************************************************************************************
* @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
#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
}
#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
}
#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
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment