 |
The META Alignment algorithm
December, 7 2001
|
 |
Contents:
Overview
Procedure
Overview of a class HMetaAligner
Macro makeInputNTuple.C
Macro align.C
Macro checkResults.C
My current procedure
Overview
The idea of this algorithm was developed by Manuel. I wrote some class
to implement it and I made few changes.
The algorithm takes straight lines defined by the target position and
the hits on MDC and try to move and rotate the META detectors to minimize
the distance between the line and the position of the hit in the local
co-ordinate system of the detector.
Top
Procedure
The procedure of the alignment is divided into few steps. It should be
repeated with the input parameters from the previous iteration up to a
point when the results are satisfied.
-
As an input two root files are taken. The first with current parameters,
and the second with data up to the hit level. The alignment procedure will
tell how to change the geometrical parameters from the first file.
-
A macro makeInputNTuple.C produce a root
file with NTuple which consists only good hits for the alignment procedure
-
A macro align.C calculates how to shift
and rotate the detectors to get better alignment
-
A new root file with the new parameters should be generated and used for
new root file with hits. Go to #1
Top
Overview of a class HMetaAligner
A class for aligning the META detectors respective to the straight lines
defined from the target and MDC positions or the Santiago tracking.
Input
The input is a Ntuples file (currently generated by the makeInputNTuple.C
macro) which defines:
| The straight line parameters |
xc yc zc - the target position
alphax alphay alphaz - direction of the line |
| Hit parameters in the local co-ordinate system |
xo yo - the hit position
sigxo sigyo - the errors of the position |
| Parameters of the detector |
s - sector
sys - system (0 - PreShower, 1 -TOF)
mod - module (for TOF) |
| Info parameters |
d - the distance between the line and the hit |
Algorithm
The alignment procedure tries to minimize chi2 defined
as the sum of squares distances between the line and the hit on the detector
normalized by the resolutions of the detectors.
The class allows to fix/release translations and rotations of the detectors.
The translations are defined as additional offsets in the lab system from
the position defined in the parameters file (RunTime dB).
The rotations are defined in the local co-ordinate system around X,
Y, Z axes - in this order.
Tukay's bi-squered weights may be use to improve the results (A new
robust fitting algorithm for vertex reconstruction in the CERES experiment,
G.Agakichiev et al. NIM A 394 (1997) 225), as well as an improved method
which changes the weights on flight (it doesn't work well yet). The method
calculates a weight of each chi^2 taken into the account. If the chi2>Ct
then the point is not taken. Otherwise it is taken with a weight=(1-(chi2/Ct2))2.
When the improved method is used then the Ct changes
from iteration to iteration (as it was written above this doesn't work
well).
Output
As a result a table with the fitted parameters is printed. Moreover a root
file out.root is generated. The file consists of NTuples which
describe some parameters for each hit taken into the calculations:
| xm ym |
Hit position in the local co-ordinate system |
| dx dy |
Distances to the line along the axis |
| sys |
System (0 - PreShower, 1 -TOF) |
| c |
chi2 for the point |
| cw |
chi2 with Tukay's weight (lower then 0 if out of
the condition) |
Useful methods
| setValue(Int_t iParam, Double_t dVal) |
Set the start value for a parameter.
iParam:
0: dX
1: dY
2: dZ
3: dRotX
4: dRotY
5: dRotZ |
| fixParam(Int_t iParam, Bool_t bFix = kTRUE) |
Fix the parameter |
| releaseParam(Int_t iParam) |
Release the parameter |
| releaseAll(void) |
Release all the parameters |
| fixAll(void) |
Fix all the parameters |
| runFit(Bool_t bUseTukay, const char
*pOut, Int_t iMethod) |
Run the alignment procedure.
bUseTukay defines if the Tukay's weights should be used.
pOut defines a file with the output NTuples. pOut == NULL
- no output file.
iMethod: MINUIT minimize method:
0 - MINImize
1 - MIGrad
2 - SIMplex |
| contFit(Bool_t bUseTukay, const char *pOut, Int_t iMethod) |
Next iteration of the alignment procedure.
Parameters as for runFit method |
| print(const char *pFileName) |
Print a table with all the results of the alignment procedure.
If pFileName != NULL the output is redirected to the pFileName
file, otherwise it is send to stdout.
When (I) appears after the method name the minimization was improved.
(Chw) after the Tukay's const. value means that the weight was changing.
(N) after FCN means that FCN was normalized and (eS) means that all detectors
resolutions was equal 11. |
All methods of the class are documented in the code.
Definition of the Rotations
The order of rotations:
-
Rotation around x-axis: --> x1 = x0, y1, z1
-
Rotation around y-axis: --> x2, y2 = y1, z2
-
Rotation around z-axis: --> x3, y2, z3 = z2
It is done by: HGeomRotation = HGeomRotation(0, rotY, rotZ) *
HGeomRotation(90, rotX, -90)
Top
Macro makeInputNTuple.C
The macro prepares the input NTuple for the HMetaAligner class.
Use with analyze("makeInputNTuple.C",nEvents).
To define the straight lines it takes the target position and the hit
location on the MDC. Only hits on META detectors which are closer
than 300 mm from the line are taken into the account. There must not be
more than 1 hit in the window. sigxo and sigyo
are calculated as:
| PRE-SHOWER sigma X |
max(cell_top, cell_bottom) / sqrt(12.0)
|
| PRE-SHOWER sigma Y |
cell_height / sqrt(12.0)
|
| TOF sigma X |
25.0 mm (tof resolution)
|
| TOF sigma Y |
rod_height / sqrt(12.0)
|
The parameters at the begin of the script define:
| fShowerWindow |
The window size |
| fShowerDX fShowerDY fShowerDZ |
Offsets of the detectors before the window condition. Should be set
to 0 ! |
| inFile outDir RootParFile AsciiParFile |
Files used in the macro |
To use the macro one must have libShowerUtil.so library. Otherwise
comment a HSUProgressRec *pProgress task !
Top
Macro align.C
Use with: .x align.C
This macro uses class HMetaAligner
to calculate additional offsets and rotations of the detectors. It automatically
generate some log information in formats of plain text and HTML code. The
macro uses a checkResults.C macro to calculate the quality of
fits.
A the begin of the macro's code there are defined start parameters
for the calculations and variables which define the input and output of
the macro.
The flag IDEAL defines the alignment procedure.
-
If it is set then: two iterations are done:
1. Release only dZ shifts
2. dX, dY, dZ shifts are released
-
if the IDEAL flag is not set: three iterations are done:
1. Only rotations released
2. Only shifts are released
3. All parameters are released
in every iteration parameters from previous step are used. After each step
results are added to the log files.
Tukay's algorithm with Ct=6 is used.
Top
Macro checkResults.C
This macro is used to check the fit quality.
It should be used with:
.L checkResults.C
checkResultsFunction(NULL, 0)
The first parameter defines a file to which redirect fits parameters.
NULL
means stdout. The second parameter must be set to 0. Otherwise
(default) the histograms are drawn in a small window which is closed at
the end of the script (used by align.C
macro).
The histograms in the output:
| Hits distribution (y ver x) |
Distances between the hits and the lines (dx ver dy) |
dy ver y |
dx ver x |
| dy for whole the detector |
dy for the upper part |
dy for the middle part |
dy for the lower part |
| dx for whole the detector |
dx for the upper part |
dx for the middle part |
dx for the lower part |
In the dx, dy histograms: back line - all hits, red line - hits which
are inside the Tukay's condition (if any). The fit is done for the red
line.
Top
My current procedure
-
Take the ideal geometrical parameters and change the target position and
MDC geometry
-
Prepare a normal root file with hits using these parameters
-
Run makeInputNTuple.C macro to get input NTuples for the calculations
(10k - 30k events)
-
In align.C macro set on the IDEAL
flag and put some start parameters for the detectors positions (taken for
example from the measurements in the cave). If the start parameters
are too far away from the real value the MINUIT fails, so one should be
really careful about them
-
Run align.C macro and get some offsets
-
Modify the ideal geometry with the new parameters
-
Do steps 2 and 3
-
In the align.C macro set off the
IDEAL flag and run the macro to get additional offsets and rotations.
-
Prepare new parameters file with new values from the fit.
-
If the quality of the fit is poor try to go go step 6 once again
Top
Marcin Jaskula