CbmRoot
Loading...
Searching...
No Matches
CbmBbaConstraint.h
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov [committer] */
4
9
10#pragma once
11
12#include <set>
13
14namespace cbm::bba
15{
17 class Constraint {
18 public:
25
27 Constraint() = default;
28
30 ~Constraint() = default;
31
33 void Reset()
34 {
35 fBodies.clear();
36 fConstraints.clear();
37 }
38
40 void AddBody(int bodyIndex) { fBodies.insert(bodyIndex); }
41
43 void AddConstraint(ConstraintType type) { fConstraints.insert(type); }
44
46 const std::set<int>& GetBodies() const { return fBodies; }
47
49 const std::set<ConstraintType>& GetConstraints() const { return fConstraints; }
50
51 private:
52 std::set<int> fBodies;
53 std::set<ConstraintType> fConstraints;
54
56 };
57} // namespace cbm::bba
std::set< int > fBodies
indices of bodies in the constrained set
void AddBody(int bodyIndex)
Add a body to the constrained set.
const std::set< ConstraintType > & GetConstraints() const
Get the types of constraints applied to the set.
~Constraint()=default
Destructor.
@ kShiftZ
mean shift in Z is zero
@ kShiftX
mean shift in X is zero
@ kShiftY
mean shift in Y is zero
void AddConstraint(ConstraintType type)
Add a constraint type to the set.
Constraint()=default
Default constructor.
const std::set< int > & GetBodies() const
Get the indices of bodies in the constrained set.
ClassDefNV(Constraint, 0)
std::set< ConstraintType > fConstraints
types of constraints applied to the set
void Reset()
Clear the set of bodies and constraints.