]>
Commit | Line | Data |
---|---|---|
57e827c3 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
18 | /* | |
19 | MUONCheckMisAligner: | |
20 | ||
21 | This macro performs the misalignment on an existing muon arm geometry | |
22 | based on the standard definition of the detector elements in | |
23 | $ALICE_ROOT/MUON/data | |
24 | ||
25 | It uses AliMUONGeometryAligner : | |
26 | --> creates a new AliMUONGeometryTransformer and AliMUONGeometryAligner | |
27 | --> reads the transformations in from the transform.dat file (make sure that | |
28 | this file is the _standard_ one by comparing it to the one in CVS) | |
29 | --> creates a second AliMUONGeometryTransformer by misaligning the existing | |
30 | one using AliMUONAligner::MisAlign | |
31 | --> User has to specify the magnitude of the alignments, in the Cartesian | |
32 | co-ordiantes (which are used to apply translation misalignments) and in the | |
33 | spherical co-ordinates (which are used to apply angular displacements) | |
34 | --> User can also set misalignment ranges by hand using the methods : | |
35 | SetMaxCartMisAlig, SetMaxAngMisAlig, SetXYAngMisAligFactor | |
36 | (last method takes account of the fact that the misalingment is greatest in | |
37 | the XY plane, since the detection elements are fixed to a support structure | |
38 | in this plane. Misalignments in the XZ and YZ plane will be very small | |
39 | compared to those in the XY plane, which are small already - of the order | |
40 | of microns) | |
41 | Note : If the detection elements are allowed to be misaligned in all | |
42 | directions, this has consequences for the alignment algorithm, which | |
43 | needs to know the number of free parameters. Eric only allowed 3 : | |
44 | x,y,theta_xy, but in principle z and the other two angles are alignable | |
45 | as well. | |
46 | ||
47 | // Author:Bruce Becker | |
48 | ||
49 | */ | |
50 | ||
51 | void MUONCheckMisAligner(Double_t cartmisalig = 1.0, Double_t angmisalig = 10.) | |
52 | { | |
53 | ||
54 | AliMUONGeometryTransformer *transform = new AliMUONGeometryTransformer(true); | |
f1d59163 | 55 | transform->ReadGeometryData("volpath.dat", "transform.dat"); |
57e827c3 | 56 | |
57 | AliMUONGeometryMisAligner misAligner(cartmisalig,angmisalig); | |
58 | ||
f1d59163 | 59 | // Generate mis alignment data |
57e827c3 | 60 | AliMUONGeometryTransformer *newTransform = misAligner.MisAlign(transform,true); |
61 | newTransform->WriteTransformations("transform2.dat"); | |
f1d59163 | 62 | newTransform->WriteMisAlignmentData("misalign.root"); |
63 | ||
64 | // Apply misAlignment via AliRoot framework | |
65 | TGeoManager::Import("geometry.root"); | |
66 | AliRun::ApplyDisplacements( | |
67 | const_cast<TClonesArray*>(newTransform->GetMisAlignmentData())); | |
68 | // Save new geometry file | |
69 | gGeoManager->Export("geometry2.root"); | |
70 | ||
71 | // Extract new transformations | |
72 | AliMUONGeometryTransformer* transform3 = new AliMUONGeometryTransformer(true); | |
73 | transform3->ReadGeometryData("volpath.dat", "geometry2.root"); | |
74 | transform3->WriteTransformations("transform3.dat"); | |
75 | // Check that transform3.dat is equal to transform2.dat | |
57e827c3 | 76 | |
77 | // To run simulation with misaligned geometry, you have to set | |
78 | // the Align option in Config.C: | |
79 | // MUON->SetAlign("transform2.dat"); | |
80 | } | |
81 | ||
82 | ||
83 | ||
84 |