Skip to content
Snippets Groups Projects
Commit 7a049115 authored by Pascal Raisig's avatar Pascal Raisig
Browse files

Add ascii parameter loading for Trd

To fix the tests for these macros, the Trd parameters need to be loaded from the
ascii file db. Since, during the tests no par.root file from the unpacking is
available
parent 93aaadfa
No related branches found
No related tags found
1 merge request!210Trd mcbm common reco redmine issue #1827
......@@ -29,11 +29,19 @@ void mcbm_build_and_reco(UInt_t uRunId = 28,
// ----- In- and output file names ------------------------------------
TString inFile = Form("./data/unp_mcbm_%i.root", uRunId);
TString parFileIn = Form("./data/unp_mcbm_params_%i.root", uRunId);
TString geoFile = paramDir + "mcbm2020_reco.geo.root"; // Created in sim. run
TString parFileOut = Form("./data/reco_mcbm_evt_win_params_%u.root", uRunId);
TString outFile = Form("./data/reco_mcbm_evt_win_%u.root", uRunId);
// ------------------------------------------------------------------------
// --- Load the geometry setup ----
// This is currently only required by the TRD (parameters)
std::string geoSetupTag = "mcbm_beam_2020_03";
TString geoFile =
paramDir + geoSetupTag.data() + ".geo.root"; // Created in sim. run
CbmSetup* geoSetup = CbmSetup::Instance();
geoSetup->LoadSetup(geoSetupTag.data());
TList* parFileList = new TList();
// ------------------------------------------------------------------------
// ----- Timer --------------------------------------------------------
TStopwatch timer;
......@@ -198,6 +206,29 @@ void mcbm_build_and_reco(UInt_t uRunId = 28,
// ----- Local reconstruction in TRD ----------------------------------
// Load parameters <- they are required by the hit producer.
// For now, it is enough to load the default ascii parameters
// if no root file is existing from the unpacking process.
TString geoTagTrd = "";
bool isActiveTrd =
(geoSetup->GetGeoTag(ECbmModuleId::kTrd, geoTagTrd)) ? true : false;
if (!isActiveTrd) {
LOG(warning) << Form(
"TRD - parameter loading - Trd not found in CbmSetup(%s) -> parameters "
"can not be loaded correctly!",
geoSetupTag.data());
} else {
TString paramFilesTrd(
Form("%s/parameters/trd/trd_%s", srcDir.Data(), geoTagTrd.Data()));
std::vector<std::string> paramFilesVecTrd;
CbmTrdParManager::GetParFileExtensions(&paramFilesVecTrd);
for (auto parIt : paramFilesVecTrd) {
parFileList->Add(
new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data())));
}
}
// -- end trd parameters
// -- beginn trd reco
Double_t triggerThreshold = 0.5e-6; // Default
CbmTrdClusterFinder* trdCluster = new CbmTrdClusterFinder();
trdCluster->SetNeighbourEnable(true, false);
......@@ -247,8 +278,10 @@ void mcbm_build_and_reco(UInt_t uRunId = 28,
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
FairParRootFileIo* parIo3 = new FairParRootFileIo();
parIo1->open(parFileIn.Data(), "READ");
parIo3->open(parFileOut.Data(), "RECREATE");
rtdb->setFirstInput(parIo1);
parIo2->open(parFileList, "in");
rtdb->setSecondInput(parIo2);
parIo3->open(parFileOut.Data(), "RECREATE");
// ------------------------------------------------------------------------
......
......@@ -64,11 +64,19 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28,
// ----- In- and output file names ------------------------------------
TString geoFile = paramDir + "mcbm2020_reco.geo.root"; // Created in sim. run
TString parFileOut = Form("./data/reco_mcbm_evt_win_params_%u.root", uRunId);
TString outFile = Form("./data/reco_mcbm_evt_win_%u.root", uRunId);
// ------------------------------------------------------------------------
// --- Load the geometry setup ----
// This is currently only required by the TRD (parameters)
std::string geoSetupTag = "mcbm_beam_2020_03";
TString geoFile =
paramDir + geoSetupTag.data() + ".geo.root"; // Created in sim. run
CbmSetup* geoSetup = CbmSetup::Instance();
geoSetup->LoadSetup(geoSetupTag.data());
TList* parFileList = new TList();
// ------------------------------------------------------------------------
// ----- Timer --------------------------------------------------------
TStopwatch timer;
......@@ -233,6 +241,29 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28,
// ----- Local reconstruction in TRD ----------------------------------
// Load parameters <- they are required by the hit producer.
// For now, it is enough to load the default ascii parameters
// if no root file is existing from the unpacking process.
TString geoTagTrd = "";
bool isActiveTrd =
(geoSetup->GetGeoTag(ECbmModuleId::kTrd, geoTagTrd)) ? true : false;
if (!isActiveTrd) {
LOG(warning) << Form(
"TRD - parameter loading - Trd not found in CbmSetup(%s) -> parameters "
"can not be loaded correctly!",
geoSetupTag.data());
} else {
TString paramFilesTrd(
Form("%s/parameters/trd/trd_%s", srcDir.Data(), geoTagTrd.Data()));
std::vector<std::string> paramFilesVecTrd;
CbmTrdParManager::GetParFileExtensions(&paramFilesVecTrd);
for (auto parIt : paramFilesVecTrd) {
parFileList->Add(
new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data())));
}
}
// -- end trd parameters
// -- beginn trd reco
Double_t triggerThreshold = 0.5e-6; // Default
CbmTrdClusterFinder* trdCluster = new CbmTrdClusterFinder();
trdCluster->SetNeighbourEnable(true, false);
......@@ -282,8 +313,10 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28,
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
FairParRootFileIo* parIo3 = new FairParRootFileIo();
parIo1->open(parFileIn.Data(), "READ");
parIo3->open(parFileOut.Data(), "RECREATE");
rtdb->setFirstInput(parIo1);
parIo2->open(parFileList, "in");
rtdb->setSecondInput(parIo2);
parIo3->open(parFileOut.Data(), "RECREATE");
// ------------------------------------------------------------------------
......
......@@ -24,10 +24,18 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
// ----- In- and output file names ------------------------------------
TString inFile = Form("./data/unp_mcbm_%i.root", runId);
TString parFile = Form("./data/unp_mcbm_params_%i.root", runId);
TString geoFile = paramDir + "mcbm2020_reco.geo.root"; // Created in sim. run
TString outFile = Form("./data/reco_mcbm_%i.root", runId);
// ------------------------------------------------------------------------
// --- Load the geometry setup ----
// This is currently only required by the TRD (parameters)
std::string geoSetupTag = "mcbm_beam_2020_03";
TString geoFile =
paramDir + geoSetupTag.data() + ".geo.root"; // Created in sim. run
CbmSetup* geoSetup = CbmSetup::Instance();
geoSetup->LoadSetup(geoSetupTag.data());
TList* parFileList = new TList();
// ------------------------------------------------------------------------
// ----- Timer --------------------------------------------------------
TStopwatch timer;
......@@ -130,6 +138,29 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
// ----- Local reconstruction in TRD ----------------------------------
// Load parameters <- they are required by the hit producer.
// For now, it is enough to load the default ascii parameters
// if no root file is existing from the unpacking process.
TString geoTagTrd = "";
bool isActiveTrd =
(geoSetup->GetGeoTag(ECbmModuleId::kTrd, geoTagTrd)) ? true : false;
if (!isActiveTrd) {
LOG(warning) << Form(
"TRD - parameter loading - Trd not found in CbmSetup(%s) -> parameters "
"can not be loaded correctly!",
geoSetupTag.data());
} else {
TString paramFilesTrd(
Form("%s/parameters/trd/trd_%s", srcDir.Data(), geoTagTrd.Data()));
std::vector<std::string> paramFilesVecTrd;
CbmTrdParManager::GetParFileExtensions(&paramFilesVecTrd);
for (auto parIt : paramFilesVecTrd) {
parFileList->Add(
new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data())));
}
}
// -- end trd parameters
// -- beginn trd reco
Double_t triggerThreshold = 0.5e-6; // Default
CbmTrdClusterFinder* trdCluster = new CbmTrdClusterFinder();
trdCluster->SetNeighbourEnable(true, false);
......@@ -179,6 +210,8 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
parIo1->open(parFile.Data(), "UPDATE");
rtdb->setFirstInput(parIo1);
parIo2->open(parFileList, "in");
rtdb->setSecondInput(parIo2);
// ------------------------------------------------------------------------
......
......@@ -29,11 +29,19 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
Form("/lustre/cbm/users/ploizeau/mcbm2020/unp_evt_data_7f229b3f_20201103/"
"unp_mcbm_params_%i.root",
runId);
TString geoFile = paramDir + "mcbm2020_reco.geo.root"; // Created in sim. run
TString parFileOut = Form("./data/reco_mcbm_params_%i.root", runId);
TString outFile = Form("./data/reco_mcbm_%i.root", runId);
// ------------------------------------------------------------------------
// --- Load the geometry setup ----
// This is currently only required by the TRD (parameters)
std::string geoSetupTag = "mcbm_beam_2020_03";
TString geoFile =
paramDir + geoSetupTag.data() + ".geo.root"; // Created in sim. run
CbmSetup* geoSetup = CbmSetup::Instance();
geoSetup->LoadSetup(geoSetupTag.data());
TList* parFileList = new TList();
// ------------------------------------------------------------------------
// ----- Timer --------------------------------------------------------
TStopwatch timer;
......@@ -134,6 +142,29 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
// ----- Local reconstruction in TRD ----------------------------------
// Load parameters <- they are required by the hit producer.
// For now, it is enough to load the default ascii parameters
// if no root file is existing from the unpacking process.
TString geoTagTrd = "";
bool isActiveTrd =
(geoSetup->GetGeoTag(ECbmModuleId::kTrd, geoTagTrd)) ? true : false;
if (!isActiveTrd) {
LOG(warning) << Form(
"TRD - parameter loading - Trd not found in CbmSetup(%s) -> parameters "
"can not be loaded correctly!",
geoSetupTag.data());
} else {
TString paramFilesTrd(
Form("%s/parameters/trd/trd_%s", srcDir.Data(), geoTagTrd.Data()));
std::vector<std::string> paramFilesVecTrd;
CbmTrdParManager::GetParFileExtensions(&paramFilesVecTrd);
for (auto parIt : paramFilesVecTrd) {
parFileList->Add(
new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data())));
}
}
// -- end trd parameters
// -- beginn trd reco
Double_t triggerThreshold = 0.5e-6; // Default
CbmTrdClusterFinder* trdCluster = new CbmTrdClusterFinder();
trdCluster->SetNeighbourEnable(true, false);
......@@ -183,8 +214,10 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
FairParRootFileIo* parIo3 = new FairParRootFileIo();
parIo1->open(parFileIn.Data(), "READ");
parIo3->open(parFileOut.Data(), "RECREATE");
rtdb->setFirstInput(parIo1);
parIo2->open(parFileList, "in");
rtdb->setSecondInput(parIo2);
parIo3->open(parFileOut.Data(), "RECREATE");
// ------------------------------------------------------------------------
......
......@@ -24,10 +24,18 @@ void mcbm_reco(Int_t runId = 831, Int_t nTimeslices = 0) {
// ----- In- and output file names ------------------------------------
TString inFile = Form("./data/unp_mcbm_%i.root", runId);
TString parFile = Form("./data/unp_mcbm_params_%i.root", runId);
TString geoFile = paramDir + "mcbm2020_reco.geo.root"; // Created in sim. run
TString outFile = Form("./data/reco_mcbm_%i.root", runId);
// ------------------------------------------------------------------------
// --- Load the geometry setup ----
// This is currently only required by the TRD (parameters)
std::string geoSetupTag = "mcbm_beam_2020_03";
TString geoFile =
paramDir + geoSetupTag.data() + ".geo.root"; // Created in sim. run
CbmSetup* geoSetup = CbmSetup::Instance();
geoSetup->LoadSetup(geoSetupTag.data());
TList* parFileList = new TList();
// ------------------------------------------------------------------------
// ----- Timer --------------------------------------------------------
TStopwatch timer;
......@@ -113,6 +121,29 @@ void mcbm_reco(Int_t runId = 831, Int_t nTimeslices = 0) {
// ----- Local reconstruction in TRD ----------------------------------
// Load parameters <- they are required by the hit producer.
// For now, it is enough to load the default ascii parameters
// if no root file is existing from the unpacking process.
TString geoTagTrd = "";
bool isActiveTrd =
(geoSetup->GetGeoTag(ECbmModuleId::kTrd, geoTagTrd)) ? true : false;
if (!isActiveTrd) {
LOG(warning) << Form(
"TRD - parameter loading - Trd not found in CbmSetup(%s) -> parameters "
"can not be loaded correctly!",
geoSetupTag.data());
} else {
TString paramFilesTrd(
Form("%s/parameters/trd/trd_%s", srcDir.Data(), geoTagTrd.Data()));
std::vector<std::string> paramFilesVecTrd;
CbmTrdParManager::GetParFileExtensions(&paramFilesVecTrd);
for (auto parIt : paramFilesVecTrd) {
parFileList->Add(
new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data())));
}
}
// -- end trd parameters
// -- beginn trd reco
Double_t triggerThreshold = 0.5e-6; // Default
CbmTrdClusterFinder* trdCluster = new CbmTrdClusterFinder();
trdCluster->SetNeighbourEnable(true, false);
......@@ -162,6 +193,8 @@ void mcbm_reco(Int_t runId = 831, Int_t nTimeslices = 0) {
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
parIo1->open(parFile.Data(), "UPDATE");
rtdb->setFirstInput(parIo1);
parIo2->open(parFileList, "in");
rtdb->setSecondInput(parIo2);
// ------------------------------------------------------------------------
......
......@@ -28,11 +28,19 @@ void mcbm_reco_kronos(Int_t runId = 831, Int_t nTimeslices = 0) {
Form("/lustre/cbm/users/ploizeau/mcbm2020/unp_evt_data_7f229b3f_20201103/"
"unp_mcbm_params_%i.root",
runId);
TString geoFile = paramDir + "mcbm2020_reco.geo.root"; // Created in sim. run
TString parFileOut = Form("./data/reco_mcbm_params_%i.root", runId);
TString outFile = Form("./data/reco_mcbm_%i.root", runId);
// ------------------------------------------------------------------------
// --- Load the geometry setup ----
// This is currently only required by the TRD (parameters)
std::string geoSetupTag = "mcbm_beam_2020_03";
TString geoFile =
paramDir + geoSetupTag.data() + ".geo.root"; // Created in sim. run
CbmSetup* geoSetup = CbmSetup::Instance();
geoSetup->LoadSetup(geoSetupTag.data());
TList* parFileList = new TList();
// ------------------------------------------------------------------------
// ----- Timer --------------------------------------------------------
TStopwatch timer;
......@@ -118,6 +126,28 @@ void mcbm_reco_kronos(Int_t runId = 831, Int_t nTimeslices = 0) {
// ----- Local reconstruction in TRD ----------------------------------
// Load parameters <- they are required by the hit producer.
// For now, it is enough to load the default ascii parameters
// if no root file is existing from the unpacking process.
TString geoTagTrd = "";
bool isActiveTrd =
(geoSetup->GetGeoTag(ECbmModuleId::kTrd, geoTagTrd)) ? true : false;
if (!isActiveTrd) {
LOG(warning) << Form(
"TRD - parameter loading - Trd not found in CbmSetup(%s) -> parameters "
"can not be loaded correctly!",
geoSetupTag.data());
} else {
TString paramFilesTrd(
Form("%s/parameters/trd/trd_%s", srcDir.Data(), geoTagTrd.Data()));
std::vector<std::string> paramFilesVecTrd;
CbmTrdParManager::GetParFileExtensions(&paramFilesVecTrd);
for (auto parIt : paramFilesVecTrd) {
parFileList->Add(
new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data())));
}
}
// -- end trd parameters
Double_t triggerThreshold = 0.5e-6; // Default
CbmTrdClusterFinder* trdCluster = new CbmTrdClusterFinder();
trdCluster->SetNeighbourEnable(true, false);
......@@ -167,8 +197,10 @@ void mcbm_reco_kronos(Int_t runId = 831, Int_t nTimeslices = 0) {
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
FairParRootFileIo* parIo3 = new FairParRootFileIo();
parIo1->open(parFileIn.Data(), "READ");
parIo3->open(parFileOut.Data(), "RECREATE");
rtdb->setFirstInput(parIo1);
parIo2->open(parFileList, "in");
rtdb->setSecondInput(parIo2);
parIo3->open(parFileOut.Data(), "RECREATE");
// ------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment