technial fix to suppress the warning
[u/mrichter/AliRoot.git] / ITS / AliITSAlignMille2Constraint.h
CommitLineData
6526a72c 1#ifndef ALIITSALIGNMILLE2CONSTRAINT_H
2#define ALIITSALIGNMILLE2CONSTRAINT_H
3
4#include <TNamed.h>
5#include <TArrayS.h>
6#include <TArrayD.h>
7
8class AliITSAlignMille2Module;
9
10/*-----------------------------------------------------------------------------------------
11Simple constraint on the subunits of the module ID (if ID>=0) or all modules w/o
12parents (ID=-1): the mean or median of the GLOBAL corrections of each parameter requested
13in the pattern must be = 0. When added explicitly to the fit it requires addition of
14Lagrange multipliers which may require more powerfull matrix preconditioners. For this
15reason we usually ommit the constrain from explicit fit and apply it afterwards to obtained
16parameters (with median constraint this is the only method possible)
17
18Author: ruben.shahoyan@cern.ch
19------------------------------------------------------------------------------------------*/
20class AliITSAlignMille2Constraint : public TNamed
21{
22 public:
23 enum {kTypeMean,kTypeMedian};
24 enum {kDisabledBit=31};
25 //
26 AliITSAlignMille2Constraint();
27 AliITSAlignMille2Constraint(const Char_t* name,Int_t t,Int_t mdID,Double_t val=0,UInt_t pattern=0x0ffff);
28 virtual ~AliITSAlignMille2Constraint() {}
29 //
30 UInt_t GetConstraintID() const {return GetUniqueID();}
31 Int_t GetType() const {return fType;}
32 Int_t GetModuleID() const {return fModuleID;}
33 Double_t GetValue() const {return fVal;}
ef24eb3b 34 UInt_t GetPattern() const {return fPattern;}
6526a72c 35 UInt_t GetAppliedPattern() const {return fApplied;}
36 UInt_t GetRemainingPattern() const {return (~fApplied)&GetPattern();}
37 Bool_t IsApplied(Int_t par) const {return fApplied & (0x1<<par);}
38 Bool_t IsApplied() const {return (fApplied&0xffff)==GetPattern();}
ef24eb3b 39 Bool_t IncludesParam(int id) const {return fPattern&BIT(id);}
6526a72c 40 void Print(Option_t* opt="") const;
41 //
42 void SetConstraintID(UInt_t id) {SetUniqueID(id);}
43 void SetType(Int_t t) {fType = t;}
ef24eb3b 44 void SetPattern(UInt_t pat) {fPattern = pat;}
6526a72c 45 void SetValue(Double_t val) {fVal = val;}
46 void SetApplied(Int_t par) {fApplied |= par<0 ? 0x0ffff : (0x1<<par);}
3dc409f6 47 void Disable() {fApplied |= UInt_t(0x1)<<kDisabledBit;}
48 void Enable() {fApplied &= ~(UInt_t(0x1)<<kDisabledBit);}
6526a72c 49 Bool_t IsDisabled() const {return (fApplied>>kDisabledBit)&0x1;}
50 //
51 virtual Bool_t IncludesModule(Int_t id) const {return fModuleID==id;}
52 virtual Bool_t IncludesModPar(Int_t id,Int_t par) const {return IncludesModule(id) && IncludesParam(par);}
45993b23 53 virtual Bool_t IncludesModPar(const AliITSAlignMille2Module* mod, Int_t par) const;
6526a72c 54 //
55 protected:
56 AliITSAlignMille2Constraint(const AliITSAlignMille2Constraint& src);
57 AliITSAlignMille2Constraint& operator=(const AliITSAlignMille2Constraint& ) {return *this;}
58 //
59 protected:
60 Int_t fType; // constriant type: mean, median ...
61 Double_t fVal; // constraint value
62 Int_t fModuleID; // Id of the module involved, -1 for orphans
63 UInt_t fApplied; // was it already applied?
ef24eb3b 64 UInt_t fPattern; // pattern of params involved
6526a72c 65 //
66 ClassDef(AliITSAlignMille2Constraint,0)
67};
68
69
70#endif