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

Fix MVD digitization

Fix the digi time. There were two problems pilled up. The first problem was to
get the event time to late during execution. By accident the event time was
then also used twice, once when creating the temporary CbmPixelCharge buffer
and a second time when creating the final digi.

Flush all data which is still stored in the temporary buffer at the end of
the run.
parent c59a55ae
No related branches found
No related tags found
1 merge request!1557Fix MVD digitization and reconstruction
...@@ -418,6 +418,9 @@ void CbmMvdSensorDigitizerTask::Exec() ...@@ -418,6 +418,9 @@ void CbmMvdSensorDigitizerTask::Exec()
fDigiMatch->Clear("C"); fDigiMatch->Clear("C");
//Int_t nDigis = 0;
GetEventInfo(fInputNr, fEventNr, fEventTime);
if (fInputPoints->GetEntriesFast() > 0) { if (fInputPoints->GetEntriesFast() > 0) {
for (Int_t iPoint = 0; iPoint < fInputPoints->GetEntriesFast(); iPoint++) { for (Int_t iPoint = 0; iPoint < fInputPoints->GetEntriesFast(); iPoint++) {
...@@ -448,8 +451,6 @@ void CbmMvdSensorDigitizerTask::Exec() ...@@ -448,8 +451,6 @@ void CbmMvdSensorDigitizerTask::Exec()
ProducePixelCharge(point); ProducePixelCharge(point);
} //loop on MCpoints } //loop on MCpoints
//Int_t nDigis = 0;
GetEventInfo(fInputNr, fEventNr, fEventTime);
ProduceDigis(); ProduceDigis();
CleanPixelChargeList(); CleanPixelChargeList();
...@@ -553,12 +554,12 @@ void CbmMvdSensorDigitizerTask::FlushBuffer(CbmMvdPixelCharge* pixel, Int_t i) ...@@ -553,12 +554,12 @@ void CbmMvdSensorDigitizerTask::FlushBuffer(CbmMvdPixelCharge* pixel, Int_t i)
new ((*fDigis)[nDigis]) new ((*fDigis)[nDigis])
CbmMvdDigi(fSensor->GetSensorNr(), pixel->GetX(), pixel->GetY(), diodeCharge, fPixelSizeX, fPixelSizeY, CbmMvdDigi(fSensor->GetSensorNr(), pixel->GetX(), pixel->GetY(), diodeCharge, fPixelSizeX, fPixelSizeY,
fEventTime + analogHitTime, fSensor->GetFrameNumber(fEventTime + analogHitTime, pixel->GetY())); analogHitTime, fSensor->GetFrameNumber(analogHitTime, pixel->GetY()));
new ((*fOutputBuffer)[nDigis]) new ((*fOutputBuffer)[nDigis])
CbmMvdDigi(fSensor->GetSensorNr(), pixel->GetX(), pixel->GetY(), diodeCharge, fPixelSizeX, fPixelSizeY, CbmMvdDigi(fSensor->GetSensorNr(), pixel->GetX(), pixel->GetY(), diodeCharge, fPixelSizeX, fPixelSizeY,
fEventTime + analogHitTime, fSensor->GetFrameNumber(fEventTime + analogHitTime, pixel->GetY())); analogHitTime, fSensor->GetFrameNumber(analogHitTime, pixel->GetY()));
// To Do: Time and pixel charge are now in an array. Write function testing if the pixel is busy at a given time. // To Do: Time and pixel charge are now in an array. Write function testing if the pixel is busy at a given time.
// Write function which computes the status of the pixel at the time of readout and which cell one has to readout. // Write function which computes the status of the pixel at the time of readout and which cell one has to readout.
...@@ -1303,17 +1304,18 @@ void CbmMvdSensorDigitizerTask::ReInit(CbmMvdSensor* sensor) ...@@ -1303,17 +1304,18 @@ void CbmMvdSensorDigitizerTask::ReInit(CbmMvdSensor* sensor)
void CbmMvdSensorDigitizerTask::Finish() void CbmMvdSensorDigitizerTask::Finish()
{ {
// In time base mode flush the buffers after the last event // Convert the CbmMvdPixelCharge still in the buffer to CbmMvdDigis
if (!fEventMode) { fOutputBuffer->Clear("C");
fDigis->Clear("C");
fDigiMatch->Clear("C");
GetEventInfo(fInputNr, fEventNr, fEventTime); GetEventInfo(fInputNr, fEventNr, fEventTime);
LOG(debug) << "CbmMvdSensorDigitizerTask::Finish() - NumberOfPixelCharge = " << fPixelCharge->GetEntriesFast(); LOG(debug) << "CbmMvdSensorDigitizerTask::Finish() - NumberOfPixelCharge = " << fPixelCharge->GetEntriesFast();
for (Int_t i = 0; i < fPixelCharge->GetEntriesFast(); i++) { for (Int_t i = 0; i < fPixelCharge->GetEntriesFast(); i++) {
CbmMvdPixelCharge* pixel = (CbmMvdPixelCharge*) fPixelCharge->At(i); CbmMvdPixelCharge* pixel = (CbmMvdPixelCharge*) fPixelCharge->At(i);
FlushBuffer(pixel, i); FlushBuffer(pixel, i);
}
} }
// PrintParameters(); // 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