Project
Loading...
Searching...
No Matches
GeometricalConstraint.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
27#ifndef GEOMETRICALCONSTRAINT_H
28#define GEOMETRICALCONSTRAINT_H
29
30#include <cstdio>
31#include <Rtypes.h>
33
34namespace o2
35{
36namespace align
37{
38
40{
41 public:
43 //
44 const std::string getName() const { return mName; }
45 void setName(const std::string& n) { mName = n; }
46 void setParent(const AlignableVolume* par)
47 {
48 mParent = par;
49 if (mName.empty()) {
50 mName = par->getSymName();
51 }
52 }
53 const AlignableVolume* getParent() const { return mParent; }
54 //
55 int getNChildren() const { return mChildren.size(); }
56 const AlignableVolume* getChild(int i) const { return mChildren[i]; }
58 {
59 if (v) {
60 mChildren.push_back(v);
61 }
62 }
63 //
64 bool isDOFConstrained(int dof) const { return mConstraint & 0x1 << dof; }
65 uint8_t getConstraintPattern() const { return mConstraint; }
66 void constrainDOF(int dof) { mConstraint |= 0x1 << dof; }
67 void unConstrainDOF(int dof) { mConstraint &= ~(0x1 << dof); }
68 void setConstrainPattern(uint8_t pat) { mConstraint = pat; }
69 bool hasConstraint() const { return mConstraint; }
70 double getSigma(int i) const { return mSigma[i]; }
71 void setSigma(int i, double s = 0) { mSigma[i] = s; }
72 //
73 void setNoJacobian(bool v = true) { mNoJacobian = v; }
74 bool getNoJacobian() const { return mNoJacobian; }
75 //
76 void constrCoefGeom(const TGeoHMatrix& matRD, double* jac /*[kNDOFGeom][kNDOFGeom]*/) const;
77 //
78 void print() const;
79 void writeChildrenConstraints(FILE* conOut) const;
80 void checkConstraint() const;
81 const char* getDOFName(int i) const { return AlignableVolume::getGeomDOFName(i); }
82
83 protected:
84 bool mNoJacobian = false; // flag that Jacobian is not needed
85 uint8_t mConstraint = 0; // bit pattern of constraint
86 double mSigma[kNDOFGeom] = {}; // optional sigma if constraint is gaussian
87 const AlignableVolume* mParent = nullptr; // parent volume for contraint, lab if 0
88 std::vector<const AlignableVolume*> mChildren; // volumes subjected to constraints
89 std::string mName{};
90 //
92};
93
94} // namespace align
95} // namespace o2
96#endif
Base class of alignable volume.
int32_t i
static const char * getGeomDOFName(int i)
const char * getSymName() const
void setName(const std::string &n)
void writeChildrenConstraints(FILE *conOut) const
const AlignableVolume * getChild(int i) const
ClassDefNV(GeometricalConstraint, 2)
const char * getDOFName(int i) const
const AlignableVolume * getParent() const
std::vector< const AlignableVolume * > mChildren
void constrCoefGeom(const TGeoHMatrix &matRD, double *jac) const
void addChild(const AlignableVolume *v)
void setParent(const AlignableVolume *par)
GLdouble n
Definition glcorearb.h:1982
const GLdouble * v
Definition glcorearb.h:832
void align(gsl::span< ElinkEncoder< BareFormat, CHARGESUM > > elinks)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...