File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,18 @@ fLabels()
2828
2929Digit::~Digit (){}
3030
31+ Digit &Digit::operator +=(const Digit &other){
32+ fCharge += other.fCharge ;
33+ return *this ;
34+ }
35+
36+ const Digit Digit::operator +(const Digit &other){
37+ Digit result (*this );
38+ result += other;
39+ return result;
40+ }
41+
42+
3143std::ostream &Digit::Print (std::ostream &output) const {
3244 output << " ITS Digit of chip index [" << fChipIndex << " ] and pixel [" << fPixelIndex << " ]with charge " << fCharge << " at time stamp" << fTimeStamp ;
3345 return output;
Original file line number Diff line number Diff line change 1616namespace AliceO2 {
1717 namespace ITS {
1818
19+ // / \class Digit
20+ // / \brief Digit class for the ITS
21+ // /
1922 class Digit : public FairTimeStamp {
2023 public:
2124
@@ -32,6 +35,19 @@ namespace AliceO2{
3235 // / Destructor
3336 virtual ~Digit ();
3437
38+ // / Addition operator
39+ // / Adds the charge of 2 digits
40+ // / @param lhs First digit for addition (also serves as time stamp)
41+ // / @param rhs Second digit for addition
42+ // / @return Digit with the summed charge of two digits and the time stamp of the first one
43+ const Digit operator +(const Digit &other);
44+
45+ // / Operator +=
46+ // / Adds charge in other digit to this digit
47+ // / @param other Digit added to this digit
48+ // / @return Digit after addition
49+ Digit &operator +=(const Digit &other);
50+
3551 // / Get the index of the chip
3652 // / @return Index of the chip
3753 ULong_t GetChipIndex () const { return fChipIndex ; }
You can’t perform that action at this time.
0 commit comments