]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONGeometryMisAligner.h
New classes for finding multiple vertices (in case of pile-up). They will be used...
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryMisAligner.h
CommitLineData
21dd83fc 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
4// $Id$
5
6/// \ingroup geometry
7/// \class AliMUONGeometryMisAligner
8/// \brief Class for misalignment of geometry transformations
a9aad96e 9//
10// Authors: Bruce Becker, Javier Castillo
21dd83fc 11
12
13#ifndef ALI_MUON_GEOMETRY_MIS_ALIGNER_H
14#define ALI_MUON_GEOMETRY_MIS_ALIGNER_H
15
16#include <TObject.h>
21dd83fc 17
18class AliMUONGeometryTransformer;
19
ef79ed3a 20class TRandom;
328e160e 21class TGeoCombiTrans;
4818a9b7 22class TClonesArray;
ef79ed3a 23
21dd83fc 24class AliMUONGeometryMisAligner:public TObject
25{
26 public:
328e160e 27 AliMUONGeometryMisAligner(Double_t cartXMisAligM, Double_t cartXMisAligW, Double_t cartYMisAligM, Double_t cartYMisAligW, Double_t angMisAligM, Double_t angMisAligW);
28 AliMUONGeometryMisAligner(Double_t cartMisAligM, Double_t cartMisAligW, Double_t angMisAligM, Double_t angMisAligW);
29 AliMUONGeometryMisAligner(Double_t cartMisAligW, Double_t angMisAligW);
21dd83fc 30 AliMUONGeometryMisAligner();
31 virtual ~AliMUONGeometryMisAligner();
32
33 //_________________________________________________________________
34 // methods
35
36 // return a misaligned geometry obtained from the existing one.
ef79ed3a 37 AliMUONGeometryTransformer* MisAlign(const AliMUONGeometryTransformer* transformer,
38 Bool_t verbose = kFALSE);
21dd83fc 39
a9aad96e 40 /// Set cartesian displacement parameters different along x, y
4600314b 41 void SetCartMisAlig(Double_t xmean, Double_t xwidth, Double_t ymean, Double_t ywidth, Double_t zmean = 0., Double_t zwidth = 0.)
42 {fDetElemMisAlig[0][0] = xmean; fDetElemMisAlig[0][1] = xwidth; fDetElemMisAlig[1][0] = ymean; fDetElemMisAlig[1][1] = ywidth; fDetElemMisAlig[2][0] = zmean; fDetElemMisAlig[2][1] = zwidth; }
328e160e 43
a9aad96e 44 /// Set cartesian displacement parameters, the same along x, y
328e160e 45 void SetCartMisAlig(Double_t mean, Double_t width)
4600314b 46 {fDetElemMisAlig[0][0] = mean; fDetElemMisAlig[0][1] = width; fDetElemMisAlig[1][0] = mean; fDetElemMisAlig[1][1] = width;}
21dd83fc 47
a9aad96e 48 /// Set angular displacement
4600314b 49 void SetAngMisAlig(Double_t zmean, Double_t zwidth, Double_t xmean = 0., Double_t xwidth = 0., Double_t ymean = 0., Double_t ywidth = 0.)
50 {fDetElemMisAlig[3][0] = xmean; fDetElemMisAlig[3][1] = xwidth; fDetElemMisAlig[4][0] = ymean; fDetElemMisAlig[4][1] = ywidth; fDetElemMisAlig[5][0] = zmean; fDetElemMisAlig[5][1] = zwidth;}
21dd83fc 51
a9aad96e 52 /// Set cartesian displacement (Kept for backward compatibility)
53 void SetMaxCartMisAlig(Double_t width)
4600314b 54 {fDetElemMisAlig[0][0] = 0.0; fDetElemMisAlig[0][1] = width; fDetElemMisAlig[1][0] = 0.0; fDetElemMisAlig[1][1] = width;}
21dd83fc 55
a9aad96e 56 /// Set angular displacement (Kept for backward compatibility)
57 void SetMaxAngMisAlig(Double_t width)
4600314b 58 {fDetElemMisAlig[5][0] = 0.0; fDetElemMisAlig[5][1] = width;}
328e160e 59
60 void SetXYAngMisAligFactor(Double_t factor);
61
62 void SetZCartMisAligFactor(Double_t factor);
63
a9aad96e 64 /// Set option for gaussian distribution
328e160e 65 void SetUseGaus(Bool_t usegaus)
66 {fUseGaus=usegaus; fUseUni=!usegaus;}
67
a9aad96e 68 /// Set option for uniform distribution
328e160e 69 void SetUseUni(Bool_t useuni)
70 {fUseGaus=!useuni; fUseUni=useuni;}
4600314b 71
72 /// Set module (half chambers) cartesian displacement parameters
73 void SetModuleCartMisAlig(Double_t xmean, Double_t xwidth, Double_t ymean, Double_t ywidth, Double_t zmean, Double_t zwidth)
74 {fModuleMisAlig[0][0] = xmean; fModuleMisAlig[0][1] = xwidth; fModuleMisAlig[1][0] = ymean; fModuleMisAlig[1][1] = ywidth; fModuleMisAlig[2][0] = zmean; fModuleMisAlig[2][1] = zwidth;}
75
76 /// Set module (half chambers) cartesian displacement parameters
77 void SetModuleAngMisAlig(Double_t xmean, Double_t xwidth, Double_t ymean, Double_t ywidth, Double_t zmean, Double_t zwidth)
78 {fModuleMisAlig[3][0] = xmean; fModuleMisAlig[3][1] = xwidth; fModuleMisAlig[4][0] = ymean; fModuleMisAlig[4][1] = ywidth; fModuleMisAlig[5][0] = zmean; fModuleMisAlig[5][1] = zwidth;}
4818a9b7 79
80 /// Set alignment resolution to misalign objects to be stored in CDB
81 void SetAlignmentResolution(const TClonesArray* misAlignArray, Int_t chId=-1, Double_t chResX=-1., Double_t chResY=-1., Double_t deResX=-1., Double_t deResY=-1.);
21dd83fc 82
83 protected:
71a2d3aa 84 /// Not implemented
21dd83fc 85 AliMUONGeometryMisAligner(const AliMUONGeometryMisAligner & right);
71a2d3aa 86 /// Not implemented
21dd83fc 87 AliMUONGeometryMisAligner & operator =(const AliMUONGeometryMisAligner &right);
88
328e160e 89
21dd83fc 90 private:
ef79ed3a 91 // return a misaligned transformation
4600314b 92 TGeoCombiTrans MisAlignDetElem(const TGeoCombiTrans& transform) const;
93 TGeoCombiTrans MisAlignModule(const TGeoCombiTrans& transform) const;
94 void GetUniMisAlign(Double_t cartMisAlig[3], Double_t angMisAlig[3], const Double_t lParMisAlig[6][2]) const;
95 void GetGausMisAlign(Double_t cartMisAlig[3], Double_t angMisAlig[3], const Double_t lParMisAlig[6][2]) const;
ef79ed3a 96
829425a5 97 Bool_t fUseUni; ///< use uniform distribution for misaligmnets
98 Bool_t fUseGaus; ///< use gaussian distribution for misaligmnets
4600314b 99 Double_t fDetElemMisAlig[6][2]; ///< Mean and width of the displacements of the detection elements along x,y,z (translations) and about x,y,z (rotations)
100 Double_t fModuleMisAlig[6][2]; ///< Mean and width of the displacements of the modules along x,y,z (translations) and about x,y,z (rotations)
101
102 Double_t fXYAngMisAligFactor; ///< factor (<1) to apply to angular misalignment range since range of motion is restricted out of the xy plane
829425a5 103 Double_t fZCartMisAligFactor; ///< factor (<1) to apply to cartetian misalignment range since range of motion is restricted in z direction
104 TRandom *fDisplacementGenerator; ///< random number generator for the displacements
21dd83fc 105
328e160e 106 ClassDef(AliMUONGeometryMisAligner,3) // Geometry parametrisation
21dd83fc 107};
108
109#endif //ALI_MUON_GEOMETRY_MIS_ALIGNER_H
110
111
112
113