diff --git a/sim/detectors/mvd/CbmMvdPixelCharge.cxx b/sim/detectors/mvd/CbmMvdPixelCharge.cxx index 75f8b5899067d0453f308daf097bd401e043123a..0896421353d0b13617db4717760ff52ccecad85f 100644 --- a/sim/detectors/mvd/CbmMvdPixelCharge.cxx +++ b/sim/detectors/mvd/CbmMvdPixelCharge.cxx @@ -33,7 +33,9 @@ CbmMvdPixelCharge::CbmMvdPixelCharge(Float_t charge, Int_t channelNrX, Int_t cha // all segments of a track). Checks if a new track contributed charge to the pixel // Checks if the new track is dominant -void CbmMvdPixelCharge::DigestCharge(Float_t pointX, Float_t pointY, Double_t time, Int_t pointId, Int_t trackId) +void CbmMvdPixelCharge::DigestCharge(Float_t pointX, Float_t pointY, Double_t time, + Int_t pointId, Int_t trackId, + Int_t inputNr, Int_t eventNr) { Float_t chargeContr = fTrackCharge; @@ -45,6 +47,8 @@ void CbmMvdPixelCharge::DigestCharge(Float_t pointX, Float_t pointY, Double_t ti fCharge.push_back(fTrackCharge); fTrackId.push_back(trackId); fPointId.push_back(pointId); + fInputNr.push_back(inputNr); + fEventNr.push_back(eventNr); fPointWeight.push_back(chargeContr); fPointX.push_back(pointX); diff --git a/sim/detectors/mvd/CbmMvdPixelCharge.h b/sim/detectors/mvd/CbmMvdPixelCharge.h index 3fb14d4c9a2aefb6e3b883b2168ff26a27192307..0d44f3cc39b75a4a0e29be3081b39df4b317f346 100644 --- a/sim/detectors/mvd/CbmMvdPixelCharge.h +++ b/sim/detectors/mvd/CbmMvdPixelCharge.h @@ -31,7 +31,7 @@ public: Bool_t TestXY(Int_t channelNrX, Int_t channelNrY); void DigestCharge(Float_t pointX, Float_t pointY, Double_t time, Int_t PointId, - Int_t trackId); // TODO: add time here + Int_t trackId, Int_t inputNr, Int_t eventNr); // TODO: add time here void AddCharge(Float_t charge) { fTrackCharge = fTrackCharge + charge; }; @@ -40,16 +40,15 @@ public: Float_t GetMaxChargeContribution() { return fMaxChargeContribution; }; Short_t GetNContributors() { return fContributors; }; Int_t GetDominatorIndex() { return fDominatorIndex; } + std::vector<Int_t>& GetTrackID() { return fTrackId; } std::vector<Int_t>& GetPointID() { return fPointId; } + std::vector<Int_t>& GetInputNr() { return fInputNr; } + std::vector<Int_t>& GetEventNr() { return fEventNr; } std::vector<Float_t>& GetPointX() { return fPointX; } std::vector<Float_t>& GetPointY() { return fPointY; } std::vector<Float_t>& GetPointWeight() { return fPointWeight; } - /*<<<<<<< HEAD - std::vector<Double_t>& GetTime() { return fTime; } - Float_t GetPixelTime() { return fPixelTime; } -======= -*/ + std::vector<Double_t>& GetTime() { return fTime; } std::vector<Float_t>& GetCharge() { return fCharge; }; Float_t GetPixelTime() @@ -92,7 +91,6 @@ public: Float_t GetEndOfBusyTime() { return fEndOfBusyTime; } - //>>>>>>> ddd5fbbb (Time response added) void SetEndOfBusyTime(Double_t endOfBusyTime) { fEndOfBusyTime = endOfBusyTime; } @@ -100,29 +98,7 @@ public: private: - /* -<<<<<<< HEAD - Float_t fCharge = {-1.}; - Float_t fMaxChargeContribution = {0.}; - Float_t fDominatingPointX = {-1.}; - Float_t fDominatingPointY = {-1.}; - Short_t fContributors = {0}; - Int_t fChannelNrX = {0}; - Int_t fChannelNrY = {0}; - Float_t fTrackCharge = {0.}; - Int_t fDominatorTrackId = {-1}; - Int_t fDominatorPointId = {-1}; - Short_t fDominatorIndex = {0}; - Float_t fPixelTime = {-1.}; - std::vector<Int_t> fTrackId = {}; - std::vector<Int_t> fPointId = {}; - std::vector<Float_t> fPointWeight = {}; - std::vector<Float_t> fPointX = {}; - std::vector<Float_t> fPointY = {}; - std::vector<Double_t> fTime = {}; - std::vector<CbmLink> fLink = {}; -======= -*/ + //Float_t fCharge = {-1.}; Float_t fMaxChargeContribution = {0.}; Float_t fDominatingPointX = {-1.}; @@ -139,15 +115,16 @@ private: std::vector<Int_t> fTrackId = {}; std::vector<Int_t> fPointId = {}; + std::vector<Int_t> fInputNr = {}; + std::vector<Int_t> fEventNr = {}; std::vector<Float_t> fPointWeight = {}; std::vector<Float_t> fPointX = {}; std::vector<Float_t> fPointY = {}; std::vector<Double_t> fTime = {}; std::vector<Float_t> fCharge = {}; std::vector<CbmLink> fLink = {}; - //>>>>>>> ddd5fbbb (Time response added) - ClassDef(CbmMvdPixelCharge, 1); + ClassDef(CbmMvdPixelCharge, 2); }; #endif diff --git a/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx b/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx index e9fb9c232636c3491c4a403a8874e2ab59785e82..d98f05ee28b27694ca7bba3e1241189920a00a4c 100644 --- a/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx +++ b/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx @@ -568,8 +568,9 @@ void CbmMvdSensorDigitizerTask::FlushBuffer(CbmMvdPixelCharge* pixel, Int_t i) CbmMatch* match = (CbmMatch*) fDigiMatch->At(nDigis); for (Int_t iLink = 0; iLink < pixel->GetNContributors(); iLink++) { - if (pixel->GetTrackID()[iLink] > -2) { - match->AddLink((Double_t) pixel->GetPointWeight()[iLink], pixel->GetPointID()[iLink], fEventNr, fInputNr); + if (pixel->GetTrackID()[iLink] > -2) { + match->AddLink((Double_t) pixel->GetPointWeight()[iLink], pixel->GetPointID()[iLink], + pixel->GetEventNr()[iLink], pixel->GetInputNr()[iLink]); // std::cout << "CbmMvdSensorDigitizerTask::ProduceDigis() : PointID= " << pixel->GetPointID()[iLink] << std::endl; } @@ -1127,7 +1128,7 @@ void CbmMvdSensorDigitizerTask::ProducePixelCharge(CbmMvdPoint* point) if (pixelCharge) { pixelCharge->DigestCharge(((float) (point->GetX() + point->GetXOut()) / 2), ((float) (point->GetY() + point->GetYOut()) / 2), fEventTime + point->GetTime(), - point->GetPointId(), point->GetTrackID()); + point->GetPointId(), point->GetTrackID(), fInputNr, fEventNr); // So far, the charge created by this MC-hit in a given pixel was added up in the Pixel charge objects. @@ -1203,13 +1204,13 @@ void CbmMvdSensorDigitizerTask::ProduceNoise() if (fChargeMapIt == fChargeMap.end()) { pixel = new ((*fPixelCharge)[fPixelCharge->GetEntriesFast()]) CbmMvdPixelCharge(1000, xPix, yPix); // TODO: Add time - pixel->DigestCharge(Current[0], Current[1], fEventTime, 0, -4); + pixel->DigestCharge(Current[0], Current[1], fEventTime, 0, -4, -1, -1); fChargeMap[thispoint] = pixel; } else { pixel = fChargeMapIt->second; pixel->AddCharge(1000); // TODO: Add time - pixel->DigestCharge(Current[0], Current[1], fEventTime, 0, -4); + pixel->DigestCharge(Current[0], Current[1], fEventTime, 0, -4, -1, -1); } } }