CbmRoot
Loading...
Searching...
No Matches
CbmTofInteraction.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: Sergei Zharko [committer] */
4
10
11#ifndef CbmTofInteraction_h
12#define CbmTofInteraction_h 1
13
14#include "CbmTofPoint.h"
15
16#include <string>
17#include <vector>
21 public:
22 // ----- Constructors and destructor
25
28 template<typename... Args>
29 CbmTofInteraction(Args... args) : CbmTofPoint(args...)
30 , fNofPoints(0)
31 {
32 }
33
35 ~CbmTofInteraction() = default;
36
37 // ----- Modifiers
41 void AddPoint(const CbmTofPoint* pPoint);
42
44 void Clear(Option_t*);
45
49 void SetFromPoint(const CbmTofPoint* pPoint);
50
51 // ----- Getters
53 int GetNofPoints() const { return fNofPoints; }
54
56 std::string ToString() const;
57
59 const std::vector<const CbmTofPoint*>& GetPoints() const { return fvpPoints; }
60
61 private:
62 // ----- Utility functions
66 template<typename T>
67 void UpdateAverage(const T& update, T& property)
68 {
69 property = (fNofPoints * property + update) / (fNofPoints + 1);
70 }
71
72 // ----- Properties
73 int fNofPoints = 0;
74 std::vector<const CbmTofPoint*> fvpPoints;
75};
76
77#endif // CbmTofInteraction_h
void AddPoint(const CbmTofPoint *pPoint)
Adds a point to the interaction New point updates the following properties of the interaction: positi...
void SetFromPoint(const CbmTofPoint *pPoint)
Sets parameters from a particular TOF MC-point.
CbmTofInteraction(Args... args)
int fNofPoints
Number of CbmTofPoint objects, from which the interaction is constructed.
int GetNofPoints() const
Gets number of stored points.
const std::vector< const CbmTofPoint * > & GetPoints() const
Gets pointers to points (TMP!!!!)
std::vector< const CbmTofPoint * > fvpPoints
Vector of point pointer (TMP!!!!)
void Clear(Option_t *)
Clears the instance.
std::string ToString() const
Saves content of the class to string.
void UpdateAverage(const T &update, T &property)
Updates average of the property from original TOF MC-point.
~CbmTofInteraction()=default
Destructor.
CbmTofInteraction()
Default constructor.
Geometric intersection of a MC track with a TOFb detector.
Definition CbmTofPoint.h:44