Commit e82a23b8 authored by Semen Lebedev's avatar Semen Lebedev
Browse files

Changes in RICH geotest routines

parent 625a2223
/* Copyright (C) 2014 UGiessen, JINR-LIT
SPDX-License-Identifier: GPL-3.0-only
Authors: Semen Lebedev [committer] */
void run_ana_geo_opt(Int_t nEvents = 200)
{
TTree::SetMaxTreeSize(90000000000);
TString script = TString(gSystem->Getenv("SCRIPT"));
TString parDir = TString(gSystem->Getenv("VMCWORKDIR")) + TString("/parameters");
TString stsMatBudgetFileName = parDir + "/sts/sts_matbudget_v12b.root"; // Material budget file for L1 STS tracking
gRandom->SetSeed(10);
TString outDir = "/Users/slebedev/Development/cbm/data/simulations/rich/urqmdtest/";
TString mcFile = outDir + "25gev.centr.mc.0000.root";
TString parFile = outDir + "25gev.centr.param.0000.root";
TString recFile = outDir + "25gev.centr.reco.0000.root";
TString anaFile = outDir + "25gev.centr.ana.0000.root";
std::string resultDir = "results_urqmd_25gev_centr/";
TString parDir = TString(gSystem->Getenv("VMCWORKDIR")) + TString("/parameters");
TList* parFileList = new TList();
//TObjString stsDigiFile = parDir + "/sts/sts_v13d_std.digi.par"; // STS digi file
//parFileList->Add(&stsDigiFile);
if (script == "yes") {
mcFile = TString(gSystem->Getenv("MC_FILE"));
recFile = TString(gSystem->Getenv("RECO_FILE"));
parFile = TString(gSystem->Getenv("PAR_FILE"));
anaFile = TString(gSystem->Getenv("ANA_FILE"));
}
gDebug = 0;
TStopwatch timer;
timer.Start();
gROOT->LoadMacro("$VMCWORKDIR/macro/littrack/loadlibs.C");
loadlibs();
FairRunAna* run = new FairRunAna();
run->SetInputFile(mcFile);
run->SetOutputFile(anaFile);
run->AddFriend(recFile);
CbmRichGeoOpt* richGeoOpt = new CbmRichGeoOpt();
run->AddTask(richGeoOpt);
// ----- Parameter database --------------------------------------------
FairRuntimeDb* rtdb = run->GetRuntimeDb();
FairParRootFileIo* parIo1 = new FairParRootFileIo();
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
parIo1->open(parFile.Data());
parIo2->open(parFileList, "in");
rtdb->setFirstInput(parIo1);
rtdb->setSecondInput(parIo2);
rtdb->setOutput(parIo1);
rtdb->saveOutput();
run->Init();
cout << "Starting run" << endl;
run->Run(0, nEvents);
// ----- Finish -------------------------------------------------------
timer.Stop();
Double_t rtime = timer.RealTime();
Double_t ctime = timer.CpuTime();
cout << endl << endl;
cout << "Macro finished successfully." << endl;
cout << "Output file is " << recFile << endl;
cout << "Parameter file is " << parFile << endl;
cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
cout << endl;
cout << " Test passed" << endl;
cout << " All ok " << endl;
}
......@@ -2,14 +2,10 @@
SPDX-License-Identifier: GPL-3.0-only
Authors: Semen Lebedev [committer], Andrey Lebedev */
void run_digi_geotest(const string& mcFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/mc.00000.root",
const string& parFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/param.00000.root",
const string& digiFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/digi.00000.root",
int nEvents = 10000)
void run_digi(const string& traFile, const string& parFile, const string& digiFile, int nEvents)
{
FairLogger::GetLogger()->SetLogScreenLevel("INFO");
FairLogger::GetLogger()->SetLogVerbosityLevel("LOW");
TTree::SetMaxTreeSize(90000000000);
Double_t eventRate = 1.e7;
......@@ -23,7 +19,7 @@ void run_digi_geotest(const string& mcFile = "/Users/slebedev/Development/cbm/
timer.Start();
CbmDigitization run;
run.AddInput(mcFile.c_str(), eventRate);
run.AddInput(traFile.c_str(), eventRate);
run.SetOutputFile(digiFile.c_str(), overwrite);
run.SetParameterRootFile(parFile.c_str());
run.SetTimeSliceLength(timeSliceLength);
......@@ -32,6 +28,7 @@ void run_digi_geotest(const string& mcFile = "/Users/slebedev/Development/cbm/
CbmRichDigitizer* richDigitizer = new CbmRichDigitizer();
richDigitizer->SetMaxNofHitsPerPmtCut(65);
richDigitizer->SetNoiseDigiRate(0.);
run.SetDigitizer(ECbmModuleId::kRich, richDigitizer, "RichPoint", true);
run.Run(nEvents);
......
/* Copyright (C) 2018-2020 UGiessen, JINR-LIT
SPDX-License-Identifier: GPL-3.0-only
Authors: Semen Lebedev [committer], Andrey Lebedev */
void run_digi_urqmdtest(
const string& mcFile = "/Users/slebedev/Development/cbm/data/sim/rich/urqmdtest/mc.00000.root",
const string& parFile = "/Users/slebedev/Development/cbm/data/sim/rich/urqmdtest/param.00000.root",
const string& digiFile = "/Users/slebedev/Development/cbm/data/sim/rich/urqmdtest/digi.00000.root",
int nEvents = 1000)
{
FairLogger::GetLogger()->SetLogScreenLevel("INFO");
FairLogger::GetLogger()->SetLogVerbosityLevel("LOW");
TTree::SetMaxTreeSize(90000000000);
Double_t eventRate = 1.e7;
Double_t timeSliceLength = 1.e4;
Bool_t eventMode = true;
Bool_t overwrite = true;
remove(digiFile.c_str());
TStopwatch timer;
timer.Start();
CbmDigitization run;
run.AddInput(mcFile.c_str(), eventRate);
run.SetOutputFile(digiFile.c_str(), overwrite);
run.SetParameterRootFile(parFile.c_str());
run.SetTimeSliceLength(timeSliceLength);
run.SetEventMode(eventMode);
run.SetMonitorFile("");
CbmRichDigitizer* richDigitizer = new CbmRichDigitizer();
richDigitizer->SetMaxNofHitsPerPmtCut(65);
run.SetDigitizer(kRich, richDigitizer, "RichPoint", true);
run.Run(nEvents);
timer.Stop();
std::cout << std::endl;
std::cout << "Macro finished successfully." << std::endl;
std::cout << "Digi file is " << digiFile << std::endl;
std::cout << "Parameter file is " << parFile << std::endl;
std::cout << "Real time " << timer.RealTime() << " s, CPU time " << timer.CpuTime() << " s" << std::endl;
std::cout << std::endl << "Test passed" << std::endl << "All ok" << std::endl;
}
import os
for taskId in range(7,8):
commandXterm = ('xterm -hold -e python3 run_one.py {}&').format(taskId)
print(commandXterm + " " + str(taskId))
os.system(commandXterm)
commandXterm1 = ('xterm -hold -e python3 run_one.py {} {}&').format(1, "4gev")
os.system(commandXterm1)
commandXterm2 = ('xterm -hold -e python3 run_one.py {} {}&').format(2, "8gev")
os.system(commandXterm2)
commandXterm3 = ('xterm -hold -e python3 run_one.py {} {}&').format(3, "10gev")
os.system(commandXterm3)
commandXterm4 = ('xterm -hold -e python3 run_one.py {} {}&').format(4, "12gev")
os.system(commandXterm4)
\ No newline at end of file
#!/usr/bin/env python3
import os
import sys
taskId = sys.argv[1]
cbmrootConfigPath = "/Users/slebedev/Development/cbm/trunk/build/config.sh"
macroDir = "/Users/slebedev/Development/cbm/trunk/cbmroot/macro/rich/geotest/"
nofEvents = 20000
os.system(("source {}").format(cbmrootConfigPath))
urqmdFile = "/Users/slebedev/Development/cbm/data/urqmd/auau/10gev/centr/urqmd.auau.10gev.centr.00001.root"
dataDir= "/Users/slebedev/Development/cbm/data/sim/rich/geotest/"
mcFile = dataDir + "/mc."+ taskId + ".root"
parFile = dataDir + "/param."+ taskId + ".root"
digiFile = dataDir + "/digi."+ taskId + ".root"
recoFile = dataDir + "/reco."+ taskId + ".root"
qaFile = dataDir + "/qa."+ taskId + ".root"
geoSimFile = dataDir + "/geosim."+ taskId + ".root"
geoSetup = "rich_v19b_" + taskId
resultDir = "results_rich_v19b/geotest/results_" + geoSetup + "/"
#geotest
commandSim=('root -l -b -q {}/run_sim_geotest.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, geoSimFile, geoSetup, nofEvents)
commandDigi=('root -l -b -q {}/run_digi_geotest.C\(\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, nofEvents)
commandReco=('root -l -b -q {}/run_reco_geotest.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, recoFile, geoSetup, resultDir, nofEvents)
commandQa=('root -l -b -q {}/run_qa_geotest.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, recoFile, qaFile, geoSetup, resultDir, nofEvents)
#urqmdtest
# commandSim=('root -l -b -q {}/run_sim_urqmdtest.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, urqmdFile, mcFile, parFile, geoSimFile, geoSetup, nofEvents)
# commandDigi=('root -l -b -q {}/run_digi_urqmdtest.C\(\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, nofEvents)
# commandReco=('root -l -b -q {}/run_reco_urqmdtest.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, recoFile, geoSetup, resultDir, nofEvents)
# commandQa=('root -l -b -q {}/run_qa_urqmdtest.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, recoFile, qaFile, geoSetup, resultDir, nofEvents)
#recoqa
# commandSim=('root -l -b -q {}/run_sim.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{},{},\\"{}\\",\\"{}\\",{}\)').format(macroDir, urqmdFile, mcFile, parFile, geoSimFile, 5, 5, "", geoSetup, nofEvents)
# #commandSim=('root -l -b -q {}/run_sim.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{},{},\\"{}\\",\\"{}\\",{}\)').format(macroDir, "", mcFile, parFile, geoSimFile, 15, 15, "", geoSetup, nofEvents)
# commandDigi=('root -l -b -q {}/run_digi.C\(\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, nofEvents)
# commandReco=('root -l -b -q {}/run_reco.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, recoFile, geoSetup, resultDir, nofEvents)
# commandQa=('root -l -b -q {}/run_qa.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, recoFile, qaFile, geoSetup, resultDir, nofEvents)
os.system(commandSim)
os.system(commandDigi)
os.system(commandReco)
os.system(commandQa)
import os
import sys
import shutil
import argparse
def main():
runId = sys.argv[1]
energy = sys.argv[2]
cbmrootConfigPath = "/Users/slebedev/Development/cbm/git/build/config.sh"
urqmdFile = ("/Users/slebedev/Development/cbm/data/urqmd/auau/{}/mbias/urqmd.auau.{}.mbias.00001.root").format(energy, energy)
plutoFile = ""
dataDir = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/"
resultDir = "results_" + runId + "_"+ energy +"/"
#runId = "0"
geoSetup = "sis100_electron"
nEvents = 1000
testType = "urqmdTest" # urqmdTest or geoTest
traFile = dataDir + "/tra." + runId + ".root"
parFile = dataDir + "/param." + runId + ".root"
digiFile = dataDir + "/digi." + runId + ".root"
recoFile = dataDir + "/reco." + runId + ".root"
qaFile = dataDir + "/qa." + runId + ".root"
geoSimFile = dataDir + "/geosim." + runId + ".root"
traCmd = ('root -l -b -q run_transport.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(urqmdFile, plutoFile, traFile, parFile, geoSimFile, geoSetup, nEvents)
digiCmd = ('root -l -b -q run_digi.C\(\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(traFile, parFile, digiFile, nEvents)
recoCmd = ('root -l -b -q run_reco.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(testType, traFile, parFile, digiFile, recoFile, geoSetup, nEvents)
qaCmd = ('root -l -b -q run_qa.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(testType, traFile, parFile, digiFile, recoFile, qaFile, geoSetup, resultDir, nEvents)
os.system((". /{} -a; {}").format(cbmrootConfigPath, traCmd))
os.system((". /{} -a; {}").format(cbmrootConfigPath, digiCmd))
os.system((". /{} -a; {}").format(cbmrootConfigPath, recoCmd))
os.system((". /{} -a; {}").format(cbmrootConfigPath, qaCmd))
# def make_args():
# parser = argparse.ArgumentParser()
# parser.add_argument('--urqmdFile', help='urqmdFile')
# return parser.parse_args()
if __name__ == '__main__':
# import sys
# args = make_args()
# main(make_args())
main()
......@@ -2,30 +2,26 @@
SPDX-License-Identifier: GPL-3.0-only
Authors: Semen Lebedev [committer] */
void run_qa_geotest(const string& mcFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/mc.00000.root",
const string& parFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/param.00000.root",
const string& digiFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/digi.00000.root",
const string& recoFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/reco.00000.root",
const string& qaFile = "/Users/slebedev/Development/cbm/data/sim/rich/"
"geotest/qa.g3new_media0.00000.root",
const string& geoSetup = "sis100_electron",
const string& resultDir = "results_geotest_geant3_new_media0/", int nEvents = 10000)
void run_qa(const string& testType, // "geoTest" or "urqmdTest"
const string& traFile, const string& parFile, const string& digiFile, const string& recoFile,
const string& qaFile, const string& geoSetup, const string& resultDir, int nEvents)
{
if (testType != "urqmdTest" && testType != "geoTest") {
std::cout << "ERROR testType is not correct. It must be urqmdTest or geoTest" << std::endl;
return;
}
FairLogger::GetLogger()->SetLogScreenLevel("INFO");
FairLogger::GetLogger()->SetLogVerbosityLevel("LOW");
TTree::SetMaxTreeSize(90000000000);
TString myName = "run_qa_geotest";
TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory
remove(qaFile.c_str());
TString setupFile = srcDir + "/geometry/setup/setup_" + geoSetup + ".C";
TString setupFunct = "setup_" + geoSetup + "()";
gROOT->LoadMacro(setupFile);
gROOT->ProcessLine(setupFunct);
CbmSetup* geo = CbmSetup::Instance();
geo->LoadSetup(geoSetup.c_str());
std::cout << std::endl << "-I- " << myName << ": Defining parameter files " << std::endl;
TList* parFileList = new TList();
TStopwatch timer;
......@@ -35,22 +31,28 @@ void run_qa_geotest(const string& mcFile = "/Users/slebedev/Development/cbm/da
FairRunAna* run = new FairRunAna();
FairFileSource* inputSource = new FairFileSource(digiFile.c_str());
inputSource->AddFriend(recoFile.c_str());
inputSource->AddFriend(mcFile.c_str());
inputSource->AddFriend(traFile.c_str());
run->SetSource(inputSource);
run->SetOutputFile(qaFile.c_str());
run->SetGenerateRunInfo(kTRUE);
run->SetGenerateRunInfo(false);
CbmMCDataManager* mcManager = new CbmMCDataManager("MCManager", 1);
mcManager->AddFile(mcFile.c_str());
mcManager->AddFile(traFile.c_str());
run->AddTask(mcManager);
CbmRichGeoTest* geoTest = new CbmRichGeoTest();
geoTest->SetDrawPmts(false);
//geoTest->SetDrawEventDisplay(false);
geoTest->SetOutputDir(resultDir);
run->AddTask(geoTest);
if (testType == "geoTest") {
CbmRichGeoTest* geoTest = new CbmRichGeoTest();
geoTest->SetDrawPmts(false);
//geoTest->SetDrawEventDisplay(false);
geoTest->SetOutputDir(resultDir);
run->AddTask(geoTest);
}
else if (testType == "urqmdTest") {
CbmRichUrqmdTest* urqmdTest = new CbmRichUrqmdTest();
urqmdTest->SetOutputDir(resultDir);
run->AddTask(urqmdTest);
}
std::cout << std::endl << std::endl << "-I- " << myName << ": Set runtime DB" << std::endl;
FairRuntimeDb* rtdb = run->GetRuntimeDb();
FairParRootFileIo* parIo1 = new FairParRootFileIo();
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
......@@ -61,18 +63,10 @@ void run_qa_geotest(const string& mcFile = "/Users/slebedev/Development/cbm/da
rtdb->setSecondInput(parIo2);
}
std::cout << std::endl << "-I- " << myName << ": Initialise run" << std::endl;
run->Init();
rtdb->setOutput(parIo1);
rtdb->saveOutput();
rtdb->print();
std::cout << std::endl << std::endl;
std::cout << "-I- " << myName << ": Starting run" << std::endl;
run->Run(0, nEvents);
......
/* Copyright (C) 2019-2020 UGiessen, JINR-LIT
SPDX-License-Identifier: GPL-3.0-only
Authors: Semen Lebedev [committer] */
void run_qa_urqmdtest(
const string& mcFile = "/Users/slebedev/Development/cbm/data/sim/rich/urqmdtest/mc.00000.root",
const string& parFile = "/Users/slebedev/Development/cbm/data/sim/rich/urqmdtest/param.00000.root",
const string& digiFile = "/Users/slebedev/Development/cbm/data/sim/rich/urqmdtest/digi.00000.root",
const string& recoFile = "/Users/slebedev/Development/cbm/data/sim/rich/urqmdtest/reco.00000.root",
const string& qaFile = "/Users/slebedev/Development/cbm/data/sim/rich/urqmdtest/qa.00000.root",
const string& geoSetup = "sis100_electron", const string& resultDir = "results_urqmdtest_geant4/", int nEvents = 1000)
{
FairLogger::GetLogger()->SetLogScreenLevel("INFO");
FairLogger::GetLogger()->SetLogVerbosityLevel("LOW");
TTree::SetMaxTreeSize(90000000000);
TString myName = "run_reco_urqmdtest";
TString srcDir = gSystem->Getenv("VMCWORKDIR");
remove(qaFile.c_str());
TString setupFile = srcDir + "/geometry/setup/setup_" + geoSetup + ".C";
TString setupFunct = "setup_" + geoSetup + "()";
gROOT->LoadMacro(setupFile);
gROOT->ProcessLine(setupFunct);
CbmSetup* setup = CbmSetup::Instance();
std::cout << std::endl << "-I- " << myName << ": Defining parameter files " << std::endl;
TList* parFileList = new TList();
TStopwatch timer;
timer.Start();
gDebug = 0;
FairRunAna* run = new FairRunAna();
FairFileSource* inputSource = new FairFileSource(digiFile.c_str());
inputSource->AddFriend(mcFile.c_str());
inputSource->AddFriend(recoFile.c_str());
run->SetSource(inputSource);
run->SetOutputFile(qaFile.c_str());
run->SetGenerateRunInfo(kTRUE);
CbmMCDataManager* mcManager = new CbmMCDataManager("MCManager", 1);
mcManager->AddFile(mcFile.c_str());
run->AddTask(mcManager);
CbmRichUrqmdTest* urqmdTest = new CbmRichUrqmdTest();
urqmdTest->SetOutputDir(resultDir);
run->AddTask(urqmdTest);
std::cout << std::endl << std::endl << "-I- " << myName << ": Set runtime DB" << std::endl;
FairRuntimeDb* rtdb = run->GetRuntimeDb();
FairParRootFileIo* parIo1 = new FairParRootFileIo();
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
parIo1->open(parFile.c_str(), "UPDATE");
rtdb->setFirstInput(parIo1);
if (!parFileList->IsEmpty()) {
parIo2->open(parFileList, "in");
rtdb->setSecondInput(parIo2);
}
std::cout << std::endl << "-I- " << myName << ": Initialise run" << std::endl;
run->Init();
rtdb->setOutput(parIo1);
rtdb->saveOutput();
rtdb->print();
std::cout << std::endl << std::endl;
std::cout << "-I- " << myName << ": Starting run" << std::endl;
run->Run(0, nEvents);
timer.Stop();
std::cout << std::endl << std::endl;
std::cout << "Macro finished succesfully." << std::endl;
std::cout << "Reco file is " << recoFile << std::endl;
std::cout << "Parameter file is " << parFile << std::endl;
std::cout << "Real time " << timer.RealTime() << " s, CPU time " << timer.CpuTime() << " s" << std::endl;
std::cout << std::endl << "Test passed" << std::endl << "All ok" << std::endl;
}
/* Copyright (C) 2009-2020 UGiessen, JINR-LIT
/* Copyright (C) 2013-2020 UGiessen, JINR-LIT
SPDX-License-Identifier: GPL-3.0-only
Authors: Semen Lebedev [committer], Andrey Lebedev */
void run_reco_geotest(const string& mcFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/mc.00000.root",
const string& parFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/param.00000.root",
const string& digiFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/digi.00000.root",
const string& recoFile = "/Users/slebedev/Development/cbm/data/sim/rich/geotest/reco.00000.root",
const string& geoSetup = "sis100_electron",
const string& resultDir = "rich_pipe_v1", // "results_geotest_test/",
int nEvents = 10000)
void run_reco(const string& testType, // "geoTest" or "urqmdTest"
const string& traFile, const string& parFile, const string& digiFile, const string& recoFile,
const string& geoSetup, int nEvents)
{
if (testType != "urqmdTest" && testType != "geoTest") {
std::cout << "ERROR testType:" << testType << " is not correct. It must be urqmdTest or geoTest" << std::endl;
return;
}
FairLogger::GetLogger()->SetLogScreenLevel("INFO");
FairLogger::GetLogger()->SetLogVerbosityLevel("LOW");
TTree::SetMaxTreeSize(90000000000);
TString myName = "run_reco_geotest";
TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory
TString srcDir = gSystem->Getenv("VMCWORKDIR");
remove(recoFile.c_str());
TString setupFile = srcDir + "/geometry/setup/setup_" + geoSetup + ".C";
TString setupFunct = "setup_" + geoSetup + "()";
gROOT->LoadMacro(setupFile);
gROOT->ProcessLine(setupFunct);
CbmSetup* geo = CbmSetup::Instance();
geo->LoadSetup(geoSetup.c_str());
std::cout << std::endl << "-I- " << myName << ": Defining parameter files " << std::endl;
TList* parFileList = new TList();
TStopwatch timer;
......@@ -33,34 +31,56 @@ void run_reco_geotest(const string& mcFile = "/Users/slebedev/Development/cbm/
FairRunAna* run = new FairRunAna();
FairFileSource* inputSource = new FairFileSource(digiFile.c_str());
inputSource->AddFriend(mcFile.c_str());
inputSource->AddFriend(traFile.c_str());
run->SetSource(inputSource);
run->SetOutputFile(recoFile.c_str());
run->SetGenerateRunInfo(kTRUE);
run->SetGenerateRunInfo(false);
CbmMCDataManager* mcManager = new CbmMCDataManager("MCManager", 1);
mcManager->AddFile(mcFile.c_str());
mcManager->AddFile(traFile.c_str());
run->AddTask(mcManager);
if (testType == "urqmdTest") {
CbmRecoSts* stsReco = new CbmRecoSts(kCbmRecoTimeslice);
run->AddTask(stsReco);
CbmKF* kalman = new CbmKF();
run->AddTask(kalman);
CbmL1* l1 = new CbmL1("L1", 0);
TString stsGeoTag;
if (geo->GetGeoTag(ECbmModuleId::kSts, stsGeoTag)) {
TString parFile = gSystem->Getenv("VMCWORKDIR");
parFile += "/parameters/sts/sts_matbudget_" + stsGeoTag + ".root";
l1->SetStsMaterialBudgetFileName(parFile.Data());
}
run->AddTask(l1);
CbmStsTrackFinder* stsTrackFinder = new CbmL1StsTrackFinder();
FairTask* stsFindTracks = new CbmStsFindTracksEvents(stsTrackFinder, false);
run->AddTask(stsFindTracks);
CbmLitFindGlobalTracks* finder = new CbmLitFindGlobalTracks();
finder->SetTrackingType("branch");
finder->SetMergerType("nearest_hit");
run->AddTask(finder);
}
CbmRichHitProducer* richHitProd = new CbmRichHitProducer();
run->AddTask(richHitProd);
CbmRichReconstruction* richReco = new CbmRichReconstruction();
richReco->SetRunExtrapolation(false);
richReco->SetRunProjection(false);
if (testType == "geoTest") {
richReco->SetRunExtrapolation(false);
richReco->SetRunProjection(false);
}
richReco->SetRunTrackAssign(false);
richReco->SetFinderName("ideal");
run->AddTask(richReco);
CbmMatchRecoToMC* matchRecoToMc = new CbmMatchRecoToMC();
run->AddTask(matchRecoToMc);
// CbmRichGeoTest* geoTest = new CbmRichGeoTest();
// geoTest->SetOutputDir(resultDir);
// run->AddTask(geoTest);
CbmMatchRecoToMC* match = new CbmMatchRecoToMC();
run->AddTask(match);
std::cout << std::endl << std::endl << "-I- " << myName << ": Set runtime DB" << std::endl;
FairRuntimeDb* rtdb = run->GetRuntimeDb();
FairParRootFileIo* parIo1 = new FairParRootFileIo();
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
......@@ -71,26 +91,20 @@ void run_reco_geotest(const string& mcFile = "/Users/slebedev/Development/cbm/
rtdb->setSecondInput(parIo2);
}
std::cout << std::endl << "-I- " << myName << ": Initialise run" << std::endl;
run->Init();
rtdb->setOutput(parIo1);
rtdb->saveOutput();
rtdb->print();
std::cout << std::endl << std::endl;
std::cout << "-I- " << myName << ": Starting run" << std::endl;
run->Run(0, nEvents);