]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/MUONCheckMisAligner.C
AliCaloPID: Correct matching rejection in case of recalculation in the analysis,...
[u/mrichter/AliRoot.git] / MUON / MUONCheckMisAligner.C
index efc2664614acb3290a1c8f2053461e11c0070ff1..db53ed125ca4d1bd50405b60968020237f47889b 100644 (file)
 
 /* $Id$ */
 
-/*
-  MUONCheckMisAligner: 
-  
-  This macro performs the misalignment on an existing muon arm geometry
-  based on the standard definition of the detector elements in 
-  $ALICE_ROOT/MUON/data
-
-  It uses AliMUONGeometryAligner : 
-  --> creates a new AliMUONGeometryTransformer and AliMUONGeometryAligner
-  --> reads the transformations in from the transform.dat file (make sure that
-  this file is the _standard_ one by comparing it to the one in CVS)
-  --> creates a second AliMUONGeometryTransformer by misaligning the existing 
-  one using AliMUONAligner::MisAlign
-  --> User has to specify the magnitude of the alignments, in the Cartesian 
-  co-ordiantes (which are used to apply translation misalignments) and in the
-  spherical co-ordinates (which are used to apply angular displacements)
-  --> User can also set misalignment ranges by hand using the methods : 
-  SetMaxCartMisAlig, SetMaxAngMisAlig, SetXYAngMisAligFactor
-  (last method takes account of the fact that the misalingment is greatest in 
-  the XY plane, since the detection elements are fixed to a support structure
-  in this plane. Misalignments in the XZ and YZ plane will be very small 
-  compared to those in the XY plane, which are small already - of the order 
-  of microns)
-  --> Default behavior generates a "residual" misalignment using gaussian
-  distributions. Uniform distributions can still be used, see 
-  AliMUONGeometryAligner.
-  --> User can also generate module misalignments using SetModuleCartMisAlig
-  and SetModuleAngMisAlig
-  Note : If the detection elements are allowed to be misaligned in all
-  directions, this has consequences for the alignment algorithm, which 
-  needs to know the number of free parameters. Eric only allowed 3 : 
-  x,y,theta_xy, but in principle z and the other two angles are alignable
-  as well.  
-
-// Author:Bruce Becker
-
-*/
+/// \ingroup macros
+/// \file MUONCheckMisAligner.C
+/// \brief This macro performs the misalignment on an existing muon arm geometry
+///  
+/// This macro performs the misalignment on an existing muon arm geometry
+/// based on the standard definition of the detector elements in 
+/// the AliMUONGeometryTransformer class.
+///
+/// It uses AliMUONGeometryMisAligner : 
+/// - Creates a new AliMUONGeometryTransformer and AliMUONGeometryMisAligner
+/// - Loads the geometry from the specified geometry file (default is geometry.root)
+/// - Creates a second AliMUONGeometryTransformer by misaligning the existing 
+///   one using AliMUONGeometryMisAligner::MisAlign
+/// - User has to specify the magnitude of the alignments, in the Cartesian 
+///   co-ordiantes (which are used to apply translation misalignments) and in the
+///   spherical co-ordinates (which are used to apply angular displacements)
+/// - User can also set misalignment ranges by hand using the methods : 
+///   SetMaxCartMisAlig, SetMaxAngMisAlig, SetXYAngMisAligFactor
+///   (last method takes account of the fact that the misalingment is greatest in 
+///   the XY plane, since the detection elements are fixed to a support structure
+///   in this plane. Misalignments in the XZ and YZ plane will be very small 
+///   compared to those in the XY plane, which are small already - of the order 
+///   of microns)
+/// - Default behavior generates a "residual" misalignment using gaussian
+///   distributions. Uniform distributions can still be used, see 
+///   AliMUONGeometryMisAligner.
+/// - User can also generate module misalignments using SetModuleCartMisAlig
+///   and SetModuleAngMisAlig
+///
+/// Note: If the detection elements are allowed to be misaligned in all
+/// directions, this has consequences for the alignment algorithm, which 
+/// needs to know the number of free parameters. Eric only allowed 3 : 
+/// x,y,theta_xy, but in principle z and the other two angles are alignable
+/// as well.  
+///
+/// \author:Bruce Becker
 
 #if !defined(__CINT__) || defined(__MAKECINT__)
 
@@ -99,26 +98,30 @@ void MUONCheckMisAligner(Double_t xcartmisaligm = 0.0, Double_t xcartmisaligw =
      *const_cast<TClonesArray*>(newTransform->GetMisAlignmentData()));
   // Save new geometry file
   gGeoManager->Export("geometry2.root");
-  
+
   // Extract new transformations
   AliMUONGeometryTransformer* transform3 = new AliMUONGeometryTransformer();
+  gGeoManager->UnlockGeometry();
   transform3->LoadGeometryData("geometry2.root");
   transform3->WriteTransformations("transform3.dat");
                // Check that transform3.dat is equal to transform2.dat
 
   // Generate misaligned data in local cdb
   const TClonesArray* array = newTransform->GetMisAlignmentData();
-   
+  
+  // 100 mum residual resolution for chamber misalignments?
+  misAligner.SetAlignmentResolution(array,-1,0.01,0.01,xcartmisaligw,ycartmisaligw);
+  
   TString sLocCDB("local://");
   sLocCDB += nameCDB;
   // CDB manager
   AliCDBManager* cdbManager = AliCDBManager::Instance();
-  cdbManager->SetDefaultStorage(sLocCDB.Data());
-  
+  cdbManager->SetSpecificStorage("MUON/Align/Data",sLocCDB.Data());
+
   AliCDBMetaData* cdbData = new AliCDBMetaData();
   cdbData->SetResponsible("Dimuon Offline project");
   cdbData->SetComment("MUON alignment objects with residual misalignment");
-  AliCDBId id("MUON/Align/Data", 0, 0); 
+  AliCDBId id("MUON/Align/Data", 0, AliCDBRunRange::Infinity());
   cdbManager->Put(const_cast<TClonesArray*>(array), id, cdbData);
 
   // To run simulation with misaligned geometry, you have to set