Commit 1d067a27 authored by Sergey Gorbunov's avatar Sergey Gorbunov
Browse files

add simplified sim/rec macros

parent f43760d8
#include "TROOT.h"
#include "TSystem.h"
/*
Macro to run standard cbmroot digitization in a simplified form
Example:
root -l -q ~/cbmtools/macro/myDigi.C'("mu","10gev","mbias","tb")'
*/
void myDigi(TString inpSetup,
TString inpEnergy,
TString inpCentr,
TString type) {
// setup: "el" or "mu"
// energy: "10gev" or "25gev"
// centr: "mbias" or "centr"
// type: "eb" or "tb"
TString s;
TString file = inpSetup + "." + inpEnergy + "." + inpCentr + "." + type;
TString rate;
if (type == "eb") {
rate = "-1";
} else if (type == "tb") {
rate = "1.e7";
} else {
cout << "wrong type " << type << endl;
}
TString command = s + ".x $CBMSRCDIR/macro/run/run_digi.C(" + "\"data/" + file
+ "\", -1, \"\", " + rate + ")";
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"
/*
Macro to run standard cbmroot qa in a simplified form
Example:
root -l -q ~/cbmtools/macro/myQa.C'("mu","10gev","mbias","tb")'
*/
void myQa(TString inpSetup, TString inpEnergy, TString inpCentr, TString type) {
// setup: "el" or "mu"
// energy: "10gev" or "25gev"
// centr: "mbias" or "centr"
// type: "eb" or "tb"
TString s;
TString setup;
if (inpSetup == "el") {
setup = "\"sis100_electron\"";
} else if (inpSetup == "mu") {
setup = "\"sis100_muon_jpsi\"";
} else {
cout << "Wrong setup name \"" << inpSetup << "\"!!!" << endl;
return;
}
TString file = inpSetup + "." + inpEnergy + "." + inpCentr + "." + type;
TString command = s + ".x $CBMSRCDIR/macro/run/run_qa.C(" + "\"data/" + 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"
/*
Macro to run standard cbmroot reconstruction in a simplified form
Example:
root -l -q ~/cbmtools/macro/myReco.C'("mu","10gev","mbias","tb")'
*/
void myReco(TString inpSetup,
TString inpEnergy,
TString inpCentr,
TString type) {
// setup: "el" or "mu"
// energy: "10gev" or "25gev"
// centr: "mbias" or "centr"
// type: "eb" or "tb"
TString s;
TString setup;
if (inpSetup == "el") {
setup = "\"sis100_electron\"";
} else if (inpSetup == "mu") {
setup = "\"sis100_muon_jpsi\"";
} else {
cout << "Wrong setup name \"" << inpSetup << "\"!!!" << endl;
return;
}
TString file = inpSetup + "." + inpEnergy + "." + inpCentr + "." + type;
//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
+ "\", -1, 0, \"\", \"\", " + setup + ", \"\", true)";
//command = s + ".x $CBMSRCDIR/macro/run/run_reco_event.C(-1," + "\"data/" + file
// + "\"," + setup + ", 1, 1)";
//command = s + ".x $CBMSRCDIR/macro/run/run_reco_tb_track1.C(" + "\"data/" + file
// + "\", -1, " + 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"
/*
Macro to run standard cbmroot transport in a simplified form
Example:
mkdir events
cd events
root -l -q ~/cbmtools/macro/myTransport.C'("mu","10gev","mbias")'
*/
void myTransport(TString inpSetup,
const char* inpEnergy,
const char* inpCentr) {
// setup: "el" or "mu"
// energy: "10gev" or "25gev"
// centr: "mbias" or "centr"
gSystem->Exec("mkdir data");
gSystem->Exec("cp $CBMSRCDIR/macro/run/.rootrc .");
TString s;
TString setup;
if (inpSetup == "el") {
setup = "\"sis100_electron\"";
} else if (inpSetup == "mu") {
setup = "\"sis100_muon_jpsi\"";
} else {
cout << "Wrong setup name \"" << inpSetup << "\"!!!" << endl;
return;
}
TString file;
file = file + inpSetup + "." + inpEnergy + "." + inpCentr;
TString events;
events = events + "\"/home/cbmdock/cbmroot/input/urqmd.auau." + inpEnergy
+ "." + inpCentr + ".root\"";
TString command;
command = command + ".x $CBMSRCDIR/macro/run/run_transport.C(" + "10," + setup
+ ",\"data/" + file + "\"," + events + ")";
cout << "processing command " << command << endl;
gROOT->ProcessLine(command);
gSystem->Exec(s + "ln -sf " + file + ".par.root data/" + file
+ ".eb.par.root");
gSystem->Exec(s + "ln -sf " + file + ".tra.root data/" + file
+ ".eb.tra.root");
gSystem->Exec(s + "ln -sf " + file + ".geo.root data/" + file
+ ".eb.geo.root");
gSystem->Exec(s + "ln -sf " + file + ".par.root data/" + file
+ ".tb.par.root");
gSystem->Exec(s + "ln -sf " + file + ".tra.root data/" + file
+ ".tb.tra.root");
gSystem->Exec(s + "ln -sf " + file + ".geo.root data/" + file
+ ".tb.geo.root");
cout << "processed command " << command << endl;
}
\ No newline at end of file
Markdown is supported
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