CbmRoot
Loading...
Searching...
No Matches
CbmMvdPixelCharge.h
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Christina Dritsa [committer], Philipp Sitzmann, Florian Uhlig */
4
5#ifndef CBMMVDPIXELCHARGE_H
6#define CBMMVDPIXELCHARGE_H 1
7
8#include "CbmLink.h"
9
10#include <Rtypes.h> // for ClassDef
11#include <RtypesCore.h> // for Float_t, Int_t, Short_t, Bool_t, Option_t
12#include <TObject.h> // for TObject
13
14class TBuffer;
15class TClass;
16class TMemberInspector;
17
18
19class CbmMvdPixelCharge : public TObject {
20
21 public:
23 CbmMvdPixelCharge() = default;
24
27 CbmMvdPixelCharge(Float_t charge, Int_t channelNrX, Int_t channelNrY);
28
29 virtual ~CbmMvdPixelCharge() = default;
30
31 Bool_t TestXY(Int_t channelNrX, Int_t channelNrY);
32
33 void DigestCharge(Float_t pointX, Float_t pointY, Double_t time, Int_t PointId, Int_t trackId, Int_t inputNr,
34 Int_t eventNr); // TODO: add time here
35 void AddCharge(Float_t charge) { fTrackCharge = fTrackCharge + charge; };
36
37
38 Int_t GetX() { return fChannelNrX; };
39 Int_t GetY() { return fChannelNrY; };
41 Short_t GetNContributors() { return fContributors; };
43
44 std::vector<Int_t>& GetTrackID() { return fTrackId; }
45 std::vector<Int_t>& GetPointID() { return fPointId; }
46 std::vector<Int_t>& GetInputNr() { return fInputNr; }
47 std::vector<Int_t>& GetEventNr() { return fEventNr; }
48 std::vector<Float_t>& GetPointX() { return fPointX; }
49 std::vector<Float_t>& GetPointY() { return fPointY; }
50 std::vector<Float_t>& GetPointWeight() { return fPointWeight; }
51
52 std::vector<Double_t>& GetTime() { return fTime; }
53 std::vector<Float_t>& GetCharge() { return fCharge; };
54 Float_t GetPixelTime()
55 {
56 if (GetNContributors() != 0) {
57 return fTime.front();
58 }
59 else {
60 return -1.;
61 };
62 } //kept for backward compatibility
63
65 {
66 if (GetNContributors() != 0) {
67 return fTime.front();
68 }
69 else {
70 return -1.;
71 }
72 };
74 {
75 if (GetNContributors() != 0) {
76 return fTime.back();
77 }
78 else {
79 return -1.;
80 }
81 };
82
84 {
85 if (GetNContributors() != 0) {
86 return fCharge.front();
87 }
88 else {
89 return -1.;
90 }
91 };
93 {
94 if (GetNContributors() != 0) {
95 return fCharge.back();
96 }
97 else {
98 return -1.;
99 }
100 };
101
102 Float_t GetEndOfBusyTime() { return fEndOfBusyTime; }
103
104
105 void SetEndOfBusyTime(Double_t endOfBusyTime) { fEndOfBusyTime = endOfBusyTime; }
106
107 virtual void Clear(Option_t* = ""){};
108
109
110 private:
111 //Float_t fCharge = {-1.};
113 Float_t fDominatingPointX = {-1.};
114 Float_t fDominatingPointY = {-1.};
115 Short_t fContributors = {0};
116 Int_t fChannelNrX = {0};
117 Int_t fChannelNrY = {0};
118 Float_t fTrackCharge = {0.};
119 Int_t fDominatorTrackId = {-1};
120 Int_t fDominatorPointId = {-1};
121 Short_t fDominatorIndex = {0};
122 Float_t fPixelTime = {-1.};
123 Double_t fEndOfBusyTime = -1.;
124
125 std::vector<Int_t> fTrackId = {};
126 std::vector<Int_t> fPointId = {};
127 std::vector<Int_t> fInputNr = {};
128 std::vector<Int_t> fEventNr = {};
129 std::vector<Float_t> fPointWeight = {};
130 std::vector<Float_t> fPointX = {};
131 std::vector<Float_t> fPointY = {};
132 std::vector<Double_t> fTime = {};
133 std::vector<Float_t> fCharge = {};
134 std::vector<CbmLink> fLink = {};
135
137};
138
139#endif
std::vector< Int_t > & GetEventNr()
virtual ~CbmMvdPixelCharge()=default
Float_t GetEarliestHitCharge()
std::vector< Int_t > fInputNr
std::vector< Float_t > fPointY
std::vector< Int_t > fPointId
Bool_t TestXY(Int_t channelNrX, Int_t channelNrY)
void SetEndOfBusyTime(Double_t endOfBusyTime)
std::vector< Int_t > fEventNr
std::vector< Int_t > fTrackId
std::vector< Int_t > & GetInputNr()
std::vector< Double_t > & GetTime()
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
std::vector< Float_t > & GetPointY()
void AddCharge(Float_t charge)
CbmMvdPixelCharge()=default
std::vector< Int_t > & GetPointID()
ClassDef(CbmMvdPixelCharge, 2)
std::vector< CbmLink > fLink
std::vector< Int_t > & GetTrackID()
std::vector< Double_t > fTime
std::vector< Float_t > & GetPointWeight()
std::vector< Float_t > fCharge
std::vector< Float_t > & GetCharge()
std::vector< Float_t > & GetPointX()
virtual void Clear(Option_t *="")
Float_t GetMaxChargeContribution()