Skip to content
Snippets Groups Projects
Commit 4cb4d139 authored by Administrator's avatar Administrator Committed by Sergey Gorbunov
Browse files

Fix mvd digitization

Receice at the end of the run all data which is still in the buffers of the
mvd sensors, create digis and send them to the DAQ.
parent 6968e40f
No related branches found
No related tags found
1 merge request!1557Fix MVD digitization and reconstruction
......@@ -141,8 +141,6 @@ void CbmMvdDigitizer::Exec(Option_t* /*opt*/)
Int_t nPoints = fInputPoints->GetEntriesFast();
Int_t nDigis = 0;
CbmMvdPoint* point = 0;
fTmpDigi->Clear();
fTmpMatch->Clear();
cout << fName << "Debug: 1" << endl;
if (fInputPoints->GetEntriesFast() > 0) {
......@@ -204,6 +202,7 @@ void CbmMvdDigitizer::Exec(Option_t* /*opt*/)
// cout << fName <<"Debug: 7" << endl;
}
// TODO: (VF) There seem to be no entries in the match array, nor matches
// attached to the digi object
LOG(debug) << fName << ": Sent " << nDigis << " digis to DAQ";
......@@ -219,6 +218,11 @@ void CbmMvdDigitizer::Exec(Option_t* /*opt*/)
// << fixed << setprecision(6) << fTimer.RealTime() << " s";
}
// Clear the arrays after being used. Every digi and match was already
// copied and send to the DAQ
fTmpDigi->Clear();
fTmpMatch->Clear();
// --- Event log
fTimer.Stop();
LOG(info) << "+ " << setw(15) << GetName() << ": Event " << setw(6) << right << fCurrentEvent << " at " << fixed
......@@ -340,8 +344,9 @@ InitStatus CbmMvdDigitizer::ReInit() { return kSUCCESS; }
// ----- Virtual method Finish -----------------------------------------
void CbmMvdDigitizer::Finish()
{
Int_t i = DetectPlugin(100);
LOG(debug) << "CbmMvdDigitizer::Finish() Autodetect: " << i << " Manual Detect " << fDigiPluginNr;
Int_t nTargetPlugin = DetectPlugin(100);
LOG(debug) << "CbmMvdDigitizer::Finish() Autodetect: " << nTargetPlugin << " Manual Detect " << fDigiPluginNr;
LOG(debug) << "finishing";
LOG(debug) << "Trying to show Histograms: " << fShowDebugHistos;
......@@ -353,7 +358,33 @@ void CbmMvdDigitizer::Finish()
LOG(debug) << "Histograms completed";
// Get the digis which are still in the sensor buffers
fDetector->Finish();
fDetector->GetOutputArray(nTargetPlugin, fTmpDigi);
fDetector->GetMatchArray(nTargetPlugin, fTmpMatch);
// Send the remaining digis to the DAQ
Int_t nEntries = fTmpDigi->GetEntriesFast();
LOG(info) << GetName() << " Finalising buffers with " << nEntries << " digis";
for (Int_t index = 0; index < nEntries; index++) {
CbmMvdDigi* digi = dynamic_cast<CbmMvdDigi*>(fTmpDigi->At(index));
CbmMvdDigi* digi1 = new CbmMvdDigi(*digi);
assert(digi1);
fDigiVect.push_back(digi1);
if (fCreateMatches) {
CbmMatch* match = dynamic_cast<CbmMatch*>(fTmpMatch->At(index));
CbmMatch* match1 = new CbmMatch(*match);
fMatchVect.push_back(match1);
SendData(digi1->GetTime(), digi1, match1);
}
else {
SendData(digi1->GetTime(), digi1);
}
}
PrintParameters();
}
......
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