Adding misAlignment via AliRoot framework
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Feb 2006 15:12:43 +0000 (15:12 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Feb 2006 15:12:43 +0000 (15:12 +0000)
MUON/MUONCheckMisAligner.C

index 978d33e..21fc8f5 100644 (file)
@@ -52,12 +52,27 @@ void MUONCheckMisAligner(Double_t cartmisalig = 1.0, Double_t angmisalig = 10.)
 {
   
   AliMUONGeometryTransformer *transform = new AliMUONGeometryTransformer(true);
-  transform->ReadTransformations("transform.dat");
+  transform->ReadGeometryData("volpath.dat", "transform.dat");
 
   AliMUONGeometryMisAligner misAligner(cartmisalig,angmisalig);
 
+  // Generate mis alignment data
   AliMUONGeometryTransformer *newTransform = misAligner.MisAlign(transform,true); 
   newTransform->WriteTransformations("transform2.dat");
+  newTransform->WriteMisAlignmentData("misalign.root");
+
+  // Apply misAlignment via AliRoot framework
+  TGeoManager::Import("geometry.root");
+  AliRun::ApplyDisplacements(
+     const_cast<TClonesArray*>(newTransform->GetMisAlignmentData()));
+  // Save new geometry file
+  gGeoManager->Export("geometry2.root");
+  
+  // Extract new transformations
+  AliMUONGeometryTransformer* transform3 = new AliMUONGeometryTransformer(true);
+  transform3->ReadGeometryData("volpath.dat", "geometry2.root");
+  transform3->WriteTransformations("transform3.dat");
+               // Check that transform3.dat is equal to transform2.dat
 
   // To run simulation with misaligned geometry, you have to set
   // the Align option in Config.C: