Skip to content
Snippets Groups Projects
Commit eabd06ff authored by Frederic Julian Linz's avatar Frederic Julian Linz Committed by Florian Uhlig
Browse files

Adding timeslice and T0 informations to AT

parent 64321a41
No related branches found
No related tags found
1 merge request!1163Adding timeslice and T0 informations to AT
Pipeline #22350 passed
......@@ -81,6 +81,7 @@ void CbmConverterManager::FillDataHeader()
std::cout << "ReadDataHeader" << std::endl;
data_header->SetSystem(system_);
data_header->SetBeamMomentum(beam_mom_);
data_header->SetTimeSliceLength(ts_length_);
auto& psd_mod_pos = data_header->AddDetector();
const int psd_node_id = 6;
......
......@@ -35,6 +35,7 @@ public:
void SetSystem(const std::string& system) { system_ = system; }
void SetBeamMomentum(float beam_mom) { beam_mom_ = beam_mom; }
void SetTimeSliceLength(float ts_length) { ts_length_ = ts_length; }
void SetOutputName(std::string file, std::string tree = "rTree")
{
......@@ -56,6 +57,7 @@ private:
std::string system_;
float beam_mom_ {0.};
float ts_length_ {0.};
std::vector<CbmConverterTask*> tasks_ {};
......
......@@ -28,6 +28,7 @@ void CbmRecEventHeaderConverter::Init()
cbm_prim_vertex_ = (CbmVertex*) ioman->GetObject("PrimaryVertex.");
cbm_sts_tracks_ = (TClonesArray*) ioman->GetObject("StsTrack");
cbm_psd_hits_ = (TClonesArray*) ioman->GetObject("PsdHit");
fTimeSlice = static_cast<CbmTimeSlice*>(ioman->GetObject("TimeSlice."));
// ***** RecEventHeader *******
AnalysisTree::BranchConfig RecEventHeaderBranch("RecEventHeader", AnalysisTree::DetType::kEventHeader);
......@@ -39,6 +40,7 @@ void CbmRecEventHeaderConverter::Init()
RecEventHeaderBranch.AddField<float>("end_time", "End time of the event, ns");
RecEventHeaderBranch.AddField<float>("match_weight", "");
RecEventHeaderBranch.AddField<float>("T0", "Reconstructed T0, ns");
RecEventHeaderBranch.AddField<float>("tStartTS", "TS start time, ns");
ivtx_chi2_ = RecEventHeaderBranch.GetFieldId("vtx_chi2");
iEpsd_ = RecEventHeaderBranch.GetFieldId("Epsd");
......@@ -48,6 +50,7 @@ void CbmRecEventHeaderConverter::Init()
iend_time_ = RecEventHeaderBranch.GetFieldId("end_time");
imatch_weight_ = RecEventHeaderBranch.GetFieldId("match_weight");
iT0_ = RecEventHeaderBranch.GetFieldId("T0");
iTStartTS_ = RecEventHeaderBranch.GetFieldId("tStartTS");
auto* man = AnalysisTree::TaskManager::GetInstance();
man->AddBranch(rec_event_header_, RecEventHeaderBranch);
......@@ -68,12 +71,15 @@ void CbmRecEventHeaderConverter::ProcessData(CbmEvent* event)
rec_event_header_->SetField(GetPsdEnergy(event), iEpsd_);
int evt_id;
float match_weight, start_time, end_time, T0;
float match_weight, start_time, end_time, T0, tStartTS;
if (event) {
evt_id = event->GetUniqueID();
start_time = event->GetStartTime();
end_time = event->GetEndTime();
T0 = event->GetTzero();
tStartTS = fTimeSlice->GetStartTime();
if (event->GetMatch()) match_weight = float(event->GetMatch()->GetMatchedLink().GetWeight());
else
match_weight = 0.;
......@@ -83,12 +89,14 @@ void CbmRecEventHeaderConverter::ProcessData(CbmEvent* event)
start_time = cbm_header_->GetT();
end_time = cbm_header_->GetT();
T0 = -999999.;
tStartTS = -1.;
match_weight = 1.;
}
rec_event_header_->SetField(evt_id, ievt_id_);
rec_event_header_->SetField(start_time, istart_time_);
rec_event_header_->SetField(end_time, iend_time_);
rec_event_header_->SetField(T0, iT0_);
rec_event_header_->SetField(tStartTS, iTStartTS_);
rec_event_header_->SetField(match_weight, imatch_weight_);
}
......
......@@ -8,6 +8,7 @@
#include "CbmConverterTask.h"
#include "CbmDefs.h"
#include "CbmEvent.h"
#include "CbmTimeSlice.h"
#include "AnalysisTree/EventHeader.hpp"
......@@ -33,6 +34,7 @@ private:
TClonesArray* cbm_sts_tracks_ {nullptr}; ///< non-owning pointer
FairMCEventHeader* cbm_header_ {nullptr}; ///< non-owning pointer
CbmVertex* cbm_prim_vertex_ {nullptr}; ///< non-owning pointer
CbmTimeSlice* fTimeSlice {nullptr};
int ivtx_chi2_ {AnalysisTree::UndefValueInt};
int iEpsd_ {AnalysisTree::UndefValueInt};
......@@ -42,6 +44,7 @@ private:
int iend_time_ {AnalysisTree::UndefValueInt};
int imatch_weight_ {AnalysisTree::UndefValueInt};
int iT0_ {AnalysisTree::UndefValueInt};
int iTStartTS_ {AnalysisTree::UndefValueInt};
ClassDef(CbmRecEventHeaderConverter, 1)
};
......
set(ANALYSISTREE_VERSION f2271e6fca78f3a5f8dc0d3f9ede3883e6a351ff) #v2.3.2
set(ANALYSISTREE_VERSION 6cfd74c707fee8268ef987fb91d9df6eb667ee2d) #v2.3.3
set(ANALYSISTREE_SRC_URL "https://github.com/HeavyIonAnalysis/AnalysisTree.git")
set(ANALYSISTREE_DESTDIR "${CMAKE_BINARY_DIR}/external/ANALYSISTREE-prefix")
......
......@@ -10,8 +10,8 @@
"time": "3:00:00",
"excludeNodes": "",
"logDir": "/lustre/cbm/users/${USER}/mc/out/log",
"cbmRoot": "/lustre/cbm/users/fkornas/soft/cbmroot/MR_master22_fr_v18.6.7_fs_apr21p2/bin/CbmRootConfig.sh",
"jobScript": "${PWD}/run_sim_reco.sh",
"cbmRoot": "/cvmfs/cbm.gsi.de/debian10/cbmroot/feb23_fr_v18.6.7_fs_apr21p2/bin/CbmRootConfig.sh",
"jobScript": "${PWD}/run_sim_reco_json.sh",
"transport": {
"run": true,
"plutoShift": 0,
......
......@@ -28,11 +28,12 @@ bool CheckOutFileName(TString fileName, Bool_t overwrite)
void run_analysis_tree_maker_json_config(TString traPath = "test", TString rawPath = "", TString recPath = "",
TString unigenFile = "", TString outPath = "", bool overwrite = true,
std::string config = "", int nEvents = 0)
std::string config = "", std::string tslength = "", int nEvents = 0)
{
const std::string system = "Au+Au"; // TODO can we read it automatically?
const float beam_mom = 12.;
const bool is_event_base = false;
const float ts_length = std::stof(tslength);
// --- Logger settings ----------------------------------------------------
const TString logLevel = "INFO";
......@@ -137,6 +138,9 @@ void run_analysis_tree_maker_json_config(TString traPath = "test", TString rawPa
auto* man = new CbmConverterManager();
man->SetSystem(system);
man->SetBeamMomentum(beam_mom);
std::cout << "Event mode : " << is_event_base << std::endl;
std::cout << "TimeSliceLength = " << ts_length << std::endl;
man->SetTimeSliceLength(ts_length);
man->SetOutputName(outFile.Data(), "rTree");
......
......@@ -35,11 +35,16 @@ for step in ${steps}; do
rawFile=$(getJsonVal "['AT']['rawFile']")
recFile=$(getJsonVal "['AT']['recFile']")
unigenFile=$(getJsonVal "['AT']['unigenFile']")
eventMode=$(getJsonVal "['digitization']['eventMode']")
tslength=-1;
if [ ${eventMode} == false ]; then
tslength=$(getJsonVal "['digitization']['timeSliceLength']")
fi
echo " "
echo "Run AT converter: ${macro}(\"${traFile}\",\"${rawFile}\",\"${recFile}\",\
\"${unigenFile}\",\"${outFile}\",${overwrite},\"${config}\")"
\"${unigenFile}\",\"${outFile}\",${overwrite},\"${config}\",\"${tslength}\")"
root -b -l -q "${macro}(\"${traFile}\",\"${rawFile}\",\"${recFile}\",\
\"${unigenFile}\",\"${outFile}\",${overwrite},\"${config}\")" &> ${log}
\"${unigenFile}\",\"${outFile}\",${overwrite},\"${config}\",\"${tslength}\")" &> ${log}
else
if [ ${step} == digitization ]; then
input=$(getJsonVal "['transport']['output']['path']")
......@@ -62,7 +67,7 @@ for step in ${steps}; do
rm -v .rootrc
if [ ${step} == reconstruction ]; then
if [ "${isL1EffQA}" == true ]; then
rm -v *{moni,CA}* all_*.par
rm -v *{core,moni,CA}* all_*.par
else
rm -v *{core,moni,CA,L1,Edep}* all_*.par
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment