Commit 599891b5 authored by Sergey Gorbunov's avatar Sergey Gorbunov Committed by Sergey Gorbunov
Browse files

L1: make time-based data mode default

parent 494f4cd7
......@@ -331,7 +331,6 @@ void run_reco(const string& mcFile = "/lustre/nyx/cbm/users/criesen/cbm/data/l
else {
l1 = new CbmL1("L1", 0);
}
l1->SetDataMode(!eventBased);
// --- Material budget file names
TString mvdGeoTag;
......
......@@ -364,8 +364,8 @@ void mcbm_reco_event(Int_t nEvents = 10, TString dataset = "data/test", const ch
CbmKF* kalman = new CbmKF();
run->AddTask(kalman);
CbmL1* l1 = new CbmL1();
l1->SetmCBMmode(1);
l1->SetLegacyEventMode(1);
l1->SetMcbmMode();
l1->SetUseHitErrors(1);
// --- Material budget file names
......
......@@ -207,7 +207,6 @@ void run_reco(const string& traFile = "/Users/slebedev/Development/cbm/data/sim
else {
l1 = new CbmL1("L1", 0);
}
l1->SetDataMode(!eventBased);
// --- Material budget file names
TString mvdGeoTag;
......
......@@ -372,7 +372,6 @@ void run_reco(TString input = "", Int_t nTimeSlices = -1, Int_t firstTimeSlice =
else {
l1 = new CbmL1("L1", 0);
}
l1->SetDataMode(1);
// --- Material budget file names
TString mvdGeoTag;
......
......@@ -223,11 +223,11 @@ InitStatus CbmL1::Init()
vFileEvent.clear();
if (fTimesliceMode) { // Time-slice mode selected
if (!fLegacyEventMode) { // Time-slice mode selected
LOG(info) << GetName() << ": running in time-slice mode.";
fTimeSlice = NULL;
fTimeSlice = (CbmTimeSlice*) fManger->GetObject("TimeSlice.");
if (fTimeSlice == NULL) LOG(fatal) << GetName() << ": No time slice branch in tree!";
if (fTimeSlice == NULL) LOG(fatal) << GetName() << ": No time slice branch in the tree!";
} //? time-slice mode
......@@ -287,7 +287,7 @@ InitStatus CbmL1::Init()
if (NULL == fStsPoints) LOG(fatal) << GetName() << ": No StsPoint data!";
if (NULL == fMCTracks) LOG(fatal) << GetName() << ": No MCTrack data!";
if (fTimesliceMode) {
if (!fLegacyEventMode) {
fEventList = (CbmMCEventList*) fManger->GetObject("MCEventList.");
if (NULL == fEventList) LOG(fatal) << GetName() << ": No MCEventList data!";
}
......@@ -1062,7 +1062,7 @@ void CbmL1::Reconstruct(CbmEvent* event)
StsIndex.push_back(j);
};
if (fTimesliceMode && fPerformance) {
if (!fLegacyEventMode && fPerformance) {
int nofEvents = fEventList->GetNofEvents();
for (int iE = 0; iE < nofEvents; iE++) {
......@@ -1238,7 +1238,7 @@ void CbmL1::Reconstruct(CbmEvent* event)
if (fVerbose > 1) { cout << "L1 Track fitter ok" << endl; }
// save recontstructed tracks
if (!fTimesliceMode) vRTracksCur.clear();
if (fLegacyEventMode) vRTracksCur.clear();
int start_hit = 0;
float TsStart_new = TsStart + TsLength - TsOverlap;
......@@ -1270,7 +1270,7 @@ void CbmL1::Reconstruct(CbmEvent* event)
for (int i = 0; i < it->NHits; i++) {
int start_hit1 = start_hit;
if (algo->fRecoHits[start_hit1] > vStsHits.size() - 1) start_hit++;
else if (fTimesliceMode) {
else if (!fLegacyEventMode) {
t.StsHits.push_back(((*algo->vStsHits)[algo->fRecoHits[start_hit]]).ID);
}
else {
......@@ -1312,7 +1312,7 @@ void CbmL1::Reconstruct(CbmEvent* event)
if (indd == 1) continue;
if ((fTimesliceMode) && (isInOverlap == 1)) {
if ((!fLegacyEventMode) && (isInOverlap == 1)) {
continue; ///Discard tracks from overlap region
......@@ -1337,9 +1337,9 @@ void CbmL1::Reconstruct(CbmEvent* event)
}
};
if (fTimesliceMode) TsStart = TsStart_new; ///Set new TS strat to earliest discarted track
if (!fLegacyEventMode) TsStart = TsStart_new; ///Set new TS strat to earliest discarted track
if (fTimesliceMode) cout << "CA Track Finder: " << algo->fCATime << " s/sub-ts" << endl << endl;
if (!fLegacyEventMode) cout << "CA Track Finder: " << algo->fCATime << " s/sub-ts" << endl << endl;
}
......@@ -1373,7 +1373,7 @@ void CbmL1::Reconstruct(CbmEvent* event)
for (unsigned int iTrack = 0; iTrack < vRTracksCur.size(); iTrack++) {
for (unsigned int iHit = 0; iHit < vRTracksCur[iTrack].StsHits.size(); iHit++)
if (fTimesliceMode) vRTracksCur[iTrack].StsHits[iHit] = SortedIndex[vRTracksCur[iTrack].StsHits[iHit]];
if (!fLegacyEventMode) vRTracksCur[iTrack].StsHits[iHit] = SortedIndex[vRTracksCur[iTrack].StsHits[iHit]];
vRTracks.push_back(vRTracksCur[iTrack]);
}
......
......@@ -152,7 +152,7 @@ public:
void SetTrdMaterialBudgetFileName(TString fileName) { fTrdMatBudgetFileName = fileName; }
void SetTofMaterialBudgetFileName(TString fileName) { fTofMatBudgetFileName = fileName; }
void SetExtrapolateToTheEndOfSTS(bool b) { fExtrapolateToTheEndOfSTS = b; }
void SetDataMode(int TimesliceMode) { fTimesliceMode = TimesliceMode; }
void SetLegacyEventMode(bool b) { fLegacyEventMode = b; }
void SetMuchPar(TString fileName) { fMuchDigiFile = fileName; }
void SetUseHitErrors(bool value) { fUseHitErrors = value; }
void SetStsOnlyMode() { fTrackingMode = L1Algo::TrackingMode::kSts; }
......@@ -351,7 +351,7 @@ private:
TString fTrdMatBudgetFileName {};
TString fTofMatBudgetFileName {};
bool fExtrapolateToTheEndOfSTS {false};
int fTimesliceMode {0};
bool fLegacyEventMode {false};
KFTopoPerformance* fTopoPerformance {nullptr};
L1EventEfficiencies fEventEfficiency {}; // average efficiencies
......
/* Copyright (C) 2006-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Ivan Kisel, Sergey Gorbunov, Igor Kulakov, Valentina Akishina, Grigory Kozlov */
Authors: Ivan Kisel, Sergey Gorbunov [committer], Igor Kulakov, Valentina Akishina, Grigory Kozlov */
/*
*====================================================================
......@@ -441,7 +441,7 @@ void CbmL1::EfficienciesPerformance()
cout << "MC tracks/event found : "
<< int(double(L1_NTRA.reco.counters[L1_NTRA.indices["total"]]) / double(L1_NEVENTS)) << endl;
cout << endl;
cout << "CA Track Finder: " << L1_CATIME / L1_NEVENTS << (fTimesliceMode ? " s/time slice" : " s/ev") << endl
cout << "CA Track Finder: " << L1_CATIME / L1_NEVENTS << (fLegacyEventMode ? " s/ev" : " s/time slice") << endl
<< endl;
}
} // void CbmL1::Performance()
......@@ -1859,7 +1859,7 @@ void CbmL1::InputPerformance()
double mcTime = pt->GetTime();
if (fTimesliceMode) mcTime += fEventList->GetEventTime(link.GetEntry(), link.GetFile());
if (!fLegacyEventMode) mcTime += fEventList->GetEventTime(link.GetEntry(), link.GetFile());
// hit pulls and residuals
......@@ -1967,7 +1967,7 @@ void CbmL1::InputPerformance()
CbmMuchPoint* pt = (CbmMuchPoint*) fMuchPoints->Get(link.GetFile(), link.GetEntry(), link.GetIndex());
double mcTime = pt->GetTime();
if (fTimesliceMode) mcTime += fEventList->GetEventTime(link.GetEntry(), link.GetFile());
if (!fLegacyEventMode) mcTime += fEventList->GetEventTime(link.GetEntry(), link.GetFile());
// mcTime+=20;
// hit pulls and residuals
......@@ -2036,7 +2036,7 @@ void CbmL1::InputPerformance()
CbmTrdPoint* pt = (CbmTrdPoint*) fTrdPoints->Get(link.GetFile(), link.GetEntry(), link.GetIndex());
double mcTime = pt->GetTime();
if (fTimesliceMode) mcTime += fEventList->GetEventTime(link.GetEntry(), link.GetFile());
if (!fLegacyEventMode) mcTime += fEventList->GetEventTime(link.GetEntry(), link.GetFile());
// hit pulls and residuals
// if ((sh->GetPlaneId()) == 0) continue;
......@@ -2104,7 +2104,7 @@ void CbmL1::InputPerformance()
CbmTofPoint* pt = (CbmTofPoint*) fTofPoints->Get(link.GetFile(), link.GetEntry(), link.GetIndex());
double mcTime = pt->GetTime();
if (fTimesliceMode) mcTime += fEventList->GetEventTime(link.GetEntry(), link.GetFile());
if (!fLegacyEventMode) mcTime += fEventList->GetEventTime(link.GetEntry(), link.GetFile());
// hit pulls and residuals
......
......@@ -440,7 +440,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
hitIndex = (event ? event->GetIndex(ECbmDataType::kStsHit, j) : j);
int hitIndexSort = 0;
if (fTimesliceMode) hitIndexSort = StsIndex[hitIndex];
if (!fLegacyEventMode) hitIndexSort = StsIndex[hitIndex];
else
hitIndexSort = j;
......@@ -463,9 +463,10 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
th.time = mh->GetTime();
th.dt = mh->GetTimeError();
if (fTimesliceMode) th.id = nMvdHits + hitIndex;
else
if (!fLegacyEventMode) { th.id = nMvdHits + hitIndex; }
else {
th.id = tmpHits.size();
}
/// stop if reco TS ends and many hits left
if (!event)
......@@ -524,7 +525,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
bestWeight = stsHitMatch.GetLink(iLink).GetWeight();
Int_t iFile = stsHitMatch.GetLink(iLink).GetFile();
Int_t iEvent = stsHitMatch.GetLink(iLink).GetEntry();
// if(!fTimesliceMode) //TODO Fix the event number in links
// if(fLegacyEventMode) //TODO Fix the event number in links
// iEvent+=1;
Int_t iIndex = stsHitMatch.GetLink(iLink).GetIndex() + nMvdPoints;
Double_t dtrck = dFEI(iFile, iEvent, iIndex);
......@@ -1085,7 +1086,7 @@ bool CbmL1::ReadMCPoint(CbmL1MCPoint* MC, int iPoint, int file, int event, int M
if (MVD == 0) {
CbmStsPoint* pt = L1_DYNAMIC_CAST<CbmStsPoint*>(fStsPoints->Get(file, event, iPoint)); // file, event, object
if (!pt) return 1;
// if ( fTimesliceMode )
// if ( !fLegacyEventMode )
// {
// Double_t StartTime = fTimeSlice->GetStartTime();
// Double_t EndTime = fTimeSlice->GetEndTime();
......@@ -1095,7 +1096,7 @@ bool CbmL1::ReadMCPoint(CbmL1MCPoint* MC, int iPoint, int file, int event, int M
//
// if (Time_MC_point > EndTime )
// return 1;
// } //if ( fTimesliceMode )
// }
pt->Position(xyzI);
pt->Momentum(PI);
......@@ -1109,14 +1110,14 @@ bool CbmL1::ReadMCPoint(CbmL1MCPoint* MC, int iPoint, int file, int event, int M
if (MVD == 2) {
CbmMuchPoint* pt = L1_DYNAMIC_CAST<CbmMuchPoint*>(fMuchPoints->Get(file, event, iPoint)); // file, event, object
if (!pt) return 1;
if (fTimesliceMode) {
if (!fLegacyEventMode) {
Double_t StartTime = fTimeSlice->GetStartTime();
Double_t EndTime = fTimeSlice->GetEndTime();
Double_t Time_MC_point = pt->GetTime() + fEventList->GetEventTime(event, file);
if (Time_MC_point < StartTime) return 1;
if (Time_MC_point > EndTime) return 1;
} //if ( fTimesliceMode )
}
pt->Position(xyzI);
pt->Momentum(PI);
......@@ -1131,7 +1132,7 @@ bool CbmL1::ReadMCPoint(CbmL1MCPoint* MC, int iPoint, int file, int event, int M
CbmTrdPoint* pt = L1_DYNAMIC_CAST<CbmTrdPoint*>(fTrdPoints->Get(file, event, iPoint)); // file, event, object
if (!pt) return 1;
if (fTimesliceMode) {
if (!fLegacyEventMode) {
//Double_t StartTime = fTimeSlice->GetStartTime(); // not used
//Double_t EndTime = fTimeSlice->GetEndTime(); // not used
//Double_t Time_MC_point = pt->GetTime() + fEventList->GetEventTime(event, file); // not used
......@@ -1140,7 +1141,7 @@ bool CbmL1::ReadMCPoint(CbmL1MCPoint* MC, int iPoint, int file, int event, int M
//
// if (Time_MC_point > EndTime )
// return 1;
} //if ( fTimesliceMode )
}
pt->Position(xyzI);
pt->Momentum(PI);
......@@ -1154,14 +1155,14 @@ bool CbmL1::ReadMCPoint(CbmL1MCPoint* MC, int iPoint, int file, int event, int M
if (MVD == 4) {
CbmTofPoint* pt = L1_DYNAMIC_CAST<CbmTofPoint*>(fTofPoints->Get(file, event, iPoint)); // file, event, object
if (!pt) return 1;
if (fTimesliceMode) {
if (!fLegacyEventMode) {
Double_t StartTime = fTimeSlice->GetStartTime();
Double_t EndTime = fTimeSlice->GetEndTime();
Double_t Time_MC_point = pt->GetTime() + fEventList->GetEventTime(event, file);
if (Time_MC_point < StartTime) return 1;
if (Time_MC_point > EndTime) return 1;
} //if ( fTimesliceMode )
}
pt->Position(xyzI);
pt->Momentum(PI);
......@@ -1277,7 +1278,7 @@ void CbmL1::HitMatch()
Int_t iEvent = link.GetEntry();
Int_t iIndex = link.GetIndex();
if (!fTimesliceMode) {
if (fLegacyEventMode) {
iFile = vFileEvent.begin()->first;
iEvent = vFileEvent.begin()->second;
}
......
/* Copyright (C) 2007-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Maksym Zyzak, Valentina Akishina, Igor Kulakov */
Authors: Maksym Zyzak, Valentina Akishina, Igor Kulakov [committer] */
#ifndef L1Algo_h
#define L1Algo_h
......
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