]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGeometryMisAligner.h
Add some class-docs.
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryMisAligner.h
index 28775e0cbe92b5519c127b7c71c6186ae2bbebd8..40943800540f39bdebe1b707e2314e1d93841d97 100644 (file)
@@ -6,23 +6,26 @@
 /// \ingroup geometry
 /// \class AliMUONGeometryMisAligner
 /// \brief Class for misalignment of geometry transformations
-///
-/// Author: Bruce Becker
+//
+//  Authors: Bruce Becker, Javier Castillo
 
 
 #ifndef ALI_MUON_GEOMETRY_MIS_ALIGNER_H
 #define ALI_MUON_GEOMETRY_MIS_ALIGNER_H
 
 #include <TObject.h>
-#include <TGeoMatrix.h>
-class TRandom;
 
 class AliMUONGeometryTransformer;
 
+class TRandom;
+class TGeoCombiTrans;
+
 class AliMUONGeometryMisAligner:public TObject
 {
  public:
-  AliMUONGeometryMisAligner(Double_t cartMisAlig, Double_t angMisAlig);
+  AliMUONGeometryMisAligner(Double_t cartXMisAligM, Double_t cartXMisAligW, Double_t cartYMisAligM, Double_t cartYMisAligW, Double_t angMisAligM, Double_t angMisAligW);
+  AliMUONGeometryMisAligner(Double_t cartMisAligM, Double_t cartMisAligW, Double_t angMisAligM, Double_t angMisAligW);
+  AliMUONGeometryMisAligner(Double_t cartMisAligW, Double_t angMisAligW);
   AliMUONGeometryMisAligner();
   virtual ~AliMUONGeometryMisAligner();
   
@@ -30,31 +33,73 @@ class AliMUONGeometryMisAligner:public TObject
   // methods
   
   // return a misaligned geometry obtained from the existing one.
-  AliMUONGeometryTransformer* MisAlign(const AliMUONGeometryTransformer* transformer, Bool_t verbose = kFALSE);
+  AliMUONGeometryTransformer* MisAlign(const AliMUONGeometryTransformer* transformer, 
+                                       Bool_t verbose = kFALSE);
   
-  // return a misaligned transformation
-  TGeoCombiTrans MisAlign(const TGeoCombiTrans& transform) const;
+  /// Set cartesian displacement parameters different along x, y
+  void SetCartMisAlig(Double_t xmean, Double_t xwidth, Double_t ymean, Double_t ywidth, Double_t zmean = 0., Double_t zwidth = 0.)
+    {fDetElemMisAlig[0][0] = xmean; fDetElemMisAlig[0][1] = xwidth; fDetElemMisAlig[1][0] = ymean; fDetElemMisAlig[1][1] = ywidth; fDetElemMisAlig[2][0] = zmean; fDetElemMisAlig[2][1] = zwidth; }
 
-  void SetMaxCartMisAlig(Double_t offset)
-    {fMaxCartMisAlig = offset ;}
+  /// Set cartesian displacement parameters, the same along x, y
+  void SetCartMisAlig(Double_t mean, Double_t width)
+    {fDetElemMisAlig[0][0] = mean; fDetElemMisAlig[0][1] = width; fDetElemMisAlig[1][0] = mean; fDetElemMisAlig[1][1] = width;}
   
-  void SetMaxAngMisAlig(Double_t offset)
-    {fMaxAngMisAlig = offset;}
+  /// Set angular displacement
+  void SetAngMisAlig(Double_t zmean, Double_t zwidth, Double_t xmean = 0., Double_t xwidth = 0., Double_t ymean = 0., Double_t ywidth = 0.)
+    {fDetElemMisAlig[3][0] = xmean; fDetElemMisAlig[3][1] = xwidth; fDetElemMisAlig[4][0] = ymean; fDetElemMisAlig[4][1] = ywidth; fDetElemMisAlig[5][0] = zmean; fDetElemMisAlig[5][1] = zwidth;}
   
-  void SetXYAngMisAligFactor(Double_t factor);
+  /// Set cartesian displacement (Kept for backward compatibility)
+  void SetMaxCartMisAlig(Double_t width) 
+    {fDetElemMisAlig[0][0] = 0.0; fDetElemMisAlig[0][1] = width; fDetElemMisAlig[1][0] = 0.0; fDetElemMisAlig[1][1] = width;}
   
+  /// Set angular displacement (Kept for backward compatibility)
+  void SetMaxAngMisAlig(Double_t width) 
+    {fDetElemMisAlig[5][0] = 0.0; fDetElemMisAlig[5][1] = width;}
+
+  void SetXYAngMisAligFactor(Double_t factor);
+
+  void SetZCartMisAligFactor(Double_t factor);
+
+  /// Set option for gaussian distribution 
+  void SetUseGaus(Bool_t usegaus)
+    {fUseGaus=usegaus; fUseUni=!usegaus;}
+
+  /// Set option for uniform distribution 
+  void SetUseUni(Bool_t useuni)
+    {fUseGaus=!useuni; fUseUni=useuni;}
+
+  /// Set module (half chambers) cartesian displacement parameters
+  void SetModuleCartMisAlig(Double_t xmean, Double_t xwidth, Double_t ymean, Double_t ywidth, Double_t zmean, Double_t zwidth) 
+    {fModuleMisAlig[0][0] = xmean; fModuleMisAlig[0][1] = xwidth; fModuleMisAlig[1][0] = ymean; fModuleMisAlig[1][1] = ywidth; fModuleMisAlig[2][0] = zmean; fModuleMisAlig[2][1] = zwidth;}
+
+  /// Set module (half chambers) cartesian displacement parameters
+  void SetModuleAngMisAlig(Double_t xmean, Double_t xwidth, Double_t ymean, Double_t ywidth, Double_t zmean, Double_t zwidth) 
+    {fModuleMisAlig[3][0] = xmean; fModuleMisAlig[3][1] = xwidth; fModuleMisAlig[4][0] = ymean; fModuleMisAlig[4][1] = ywidth; fModuleMisAlig[5][0] = zmean; fModuleMisAlig[5][1] = zwidth;}
   
  protected:
+  /// Not implemented
   AliMUONGeometryMisAligner(const AliMUONGeometryMisAligner & right);
+  /// Not implemented
   AliMUONGeometryMisAligner & operator =(const AliMUONGeometryMisAligner &right);
   
+  
  private:
-  Double_t fMaxCartMisAlig;   // cartesian displacement range, set by SetMaxCartMisAlig (translations)
-  Double_t fMaxAngMisAlig;    // Angular displacement range (rotations)
-  Double_t fXYAngMisAligFactor; // factor (<1) to apply to angular misalignment range since range of motion is restricted out of the xy plane
-  TRandom *fDisplacementGenerator;  // random number generator for the displacements
+  // return a misaligned transformation
+  TGeoCombiTrans MisAlignDetElem(const TGeoCombiTrans& transform) const;
+  TGeoCombiTrans MisAlignModule(const TGeoCombiTrans& transform) const;
+  void GetUniMisAlign(Double_t cartMisAlig[3], Double_t angMisAlig[3], const Double_t lParMisAlig[6][2]) const;
+  void GetGausMisAlign(Double_t cartMisAlig[3], Double_t angMisAlig[3], const Double_t lParMisAlig[6][2]) const;
+
+  Bool_t fUseUni;            ///< use uniform distribution for misaligmnets
+  Bool_t fUseGaus;           ///< use gaussian distribution for misaligmnets
+  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)
+  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)  
+
+  Double_t fXYAngMisAligFactor;  ///< factor (<1) to apply to angular misalignment range since range of motion is restricted out of the xy plane
+  Double_t fZCartMisAligFactor; ///< factor (<1) to apply to cartetian misalignment range since range of motion is restricted in z direction
+  TRandom *fDisplacementGenerator;  ///< random number generator for the displacements
   
-  ClassDef(AliMUONGeometryMisAligner,2)        // Geometry parametrisation
+  ClassDef(AliMUONGeometryMisAligner,3)        // Geometry parametrisation
 };
 
 #endif //ALI_MUON_GEOMETRY_MIS_ALIGNER_H