CbmRoot
Loading...
Searching...
No Matches
CbmMvdPixelCharge.cxx
Go to the documentation of this file.
1/* Copyright (C) 2008-2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Christina Dritsa [committer], Samir Amar-Youcef, Florian Uhlig, Philipp Sitzmann */
4
5#include "CbmMvdPixelCharge.h"
6
7#include <Logger.h>
8
9// -------------------------------------------------------------------------
10Bool_t CbmMvdPixelCharge::TestXY(Int_t channelNrX, Int_t channelNrY)
11{
12
13 if ((channelNrX == fChannelNrX) && (channelNrY == fChannelNrY)) {
14 return 1;
15 }
16 else {
17 return 0;
18 };
19}
20
21// ----- Constructor with parameters -----------------------------------
22CbmMvdPixelCharge::CbmMvdPixelCharge(Float_t charge, Int_t channelNrX, Int_t channelNrY)
23 : TObject()
24 //, fCharge(charge)
25 , fMaxChargeContribution(charge)
26 , fChannelNrX(channelNrX)
27 , fChannelNrY(channelNrY)
28 , fTrackCharge(charge)
29{
30}
31
32// ------- DigestCharge ----------------------------------------------------#
33
34// Sums up the charge stored in track charge (assuming this is the summed charge from
35// all segments of a track). Checks if a new track contributed charge to the pixel
36// Checks if the new track is dominant
37
38void CbmMvdPixelCharge::DigestCharge(Float_t pointX, Float_t pointY, Double_t time, Int_t pointId, Int_t trackId,
39 Int_t inputNr, Int_t eventNr)
40{
41 Float_t chargeContr = fTrackCharge;
42
43 // for (auto charge : fPointWeight) {
44 // chargeContr -= charge;
45 // }
46
47 if (chargeContr > 0.) {
48 fCharge.push_back(fTrackCharge);
49 fTrackId.push_back(trackId);
50 fPointId.push_back(pointId);
51 fInputNr.push_back(inputNr);
52 fEventNr.push_back(eventNr);
53
54 fPointWeight.push_back(chargeContr);
55 fPointX.push_back(pointX);
56 fPointY.push_back(pointY);
57 fTime.push_back(time);
59
60 if (chargeContr > fMaxChargeContribution) {
62 fMaxChargeContribution = chargeContr;
63 }
64 fTrackCharge = 0.;
65 }
66}
67
ClassImp(CbmConverterManager)
std::vector< Int_t > fInputNr
std::vector< Float_t > fPointY
std::vector< Int_t > fPointId
Bool_t TestXY(Int_t channelNrX, Int_t channelNrY)
std::vector< Int_t > fEventNr
std::vector< Int_t > fTrackId
void DigestCharge(Float_t pointX, Float_t pointY, Double_t time, Int_t PointId, Int_t trackId, Int_t inputNr, Int_t eventNr)
std::vector< Float_t > fPointX
std::vector< Float_t > fPointWeight
CbmMvdPixelCharge()=default
std::vector< Double_t > fTime
std::vector< Float_t > fCharge