AliRoot Core  edcc906 (edcc906)
AliMUONAlignment.h
Go to the documentation of this file.
1 #ifndef ALIMUONALIGNMENT_H
2 #define ALIMUONALIGNMENT_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5 
6 /* $Id: AliMUONAlignment.h 50858 2011-07-29 10:58:20Z ivana $ */
7 
11 //
12 // Authors: Bruce Becker, Javier Castillo, Hugo Pereira Da Costa
13 
14 #include "AliMillePedeRecord.h"
15 
16 #include <TFile.h>
17 #include <TGeoMatrix.h>
18 #include <TObject.h>
19 #include <TString.h>
20 #include <TTree.h>
21 
22 class TClonesArray;
23 class AliMillePede2;
25 class AliMUONTrack;
26 class AliMUONTrackParam;
27 class AliMUONVCluster;
28 
30 class LocalTrackParam: public TObject
31 {
32 
33  public:
34 
35  //* construction
36  LocalTrackParam( void ):
37  fTrackX(0),
38  fTrackY(0),
39  fTrackZ(0),
40  fTrackSlopeX(0),
41  fTrackSlopeY(0)
42  {}
43 
44  //* y and z
45  Double_t fTrackX;
46  Double_t fTrackY;
47  Double_t fTrackZ;
48  Double_t fTrackSlopeX;
49  Double_t fTrackSlopeY;
50 
51  ClassDef(LocalTrackParam,1)
52 
53 };
54 
55 class AliMUONAlignment:public TObject
56 {
57 
58  public:
59 
61 
62  virtual ~AliMUONAlignment();
63 
64  // initialize
65  void Init( void );
66 
67  // terminate
68  void Terminate( void );
69 
70  // array dimendions
71  enum
72  {
74  fgNSt = 5,
75 
77  fgNCh = 10,
78 
80  fgNTrkMod = 16,
81 
83  fgNHalfCh = 20,
84 
86  fgNDetHalfChMax = 13,
87 
90  fgNDetElem = 156,
91 
93  fNLocal = 4,
94 
96  fgNParCh = 4,
97 
99  fNGlobal = fgNParCh*fgNDetElem
100  };
101 
103  static const Int_t fgNDetElemCh[fgNCh];
104 
106  static const Int_t fgSNDetElemCh[fgNCh+1];
107 
109  static const Int_t fgNDetElemHalfCh[fgNHalfCh];
110 
112  static const Int_t fgDetElemHalfCh[fgNHalfCh][fgNDetHalfChMax];
113 
116  {
117  ParX = 1<<0,
118  ParY = 1<<1,
119  ParZ = 1<<2,
120  ParTZ = 1<<3,
121 
122  ParAllTranslations = ParX|ParY|ParZ,
123  ParAllRotations = ParTZ,
124  ParAll = ParAllTranslations|ParAllRotations
125 
126  };
127 
130  {
131  SideTop = 1<<0,
132  SideLeft = 1<<1,
133  SideBottom = 1<<2,
134  SideRight = 1<<3,
135  SideTopLeft = SideTop|SideLeft,
136  SideTopRight = SideTop|SideRight,
137  SideBottomLeft = SideBottom|SideLeft,
138  SideBottomRight = SideBottom|SideRight,
139  AllSides = SideTop|SideBottom|SideLeft|SideRight
140  };
141 
142  AliMillePedeRecord* ProcessTrack( AliMUONTrack* track, Bool_t doAlignment, Double_t weight = 1 );
143 
144  void ProcessTrack( AliMillePedeRecord* );
145 
146  //@name modifiers
148 
150  void SetRunNumber( Int_t id )
151  {fRunNumber = id;}
152 
154  void SetBFieldOn( Bool_t value )
155  { fBFieldOn = value; }
156 
158  void SetDoEvaluation( Bool_t value )
159  { fDoEvaluation = value; }
160 
162  void SetRefitStraightTracks( Bool_t value )
163  { fRefitStraightTracks = value; }
164 
165  void SetAllowedVariation( Int_t iPar, Double_t value );
166 
167  void SetSigmaXY(Double_t sigmaX, Double_t sigmaY);
168 
171  { fTransform = transformer; }
172 
174 
175  //@name fixing detectors
177 
178  void FixAll( UInt_t parameterMask = ParAll );
179 
180  void FixChamber( Int_t iCh, UInt_t parameterMask = ParAll );
181 
182  void FixDetElem( Int_t iDetElemId, UInt_t parameterMask = ParAll );
183 
184  void FixHalfSpectrometer( const Bool_t* bChOnOff, UInt_t sidesMask = AllSides, UInt_t parameterMask = ParAll );
185 
186  void FixParameter( Int_t iPar );
187 
188  void FixParameter( Int_t iDetElem, Int_t iPar )
189  { FixParameter( iDetElem*fgNParCh + iPar ); }
190 
192 
193  //@name releasing detectors
195 
196  void ReleaseChamber( Int_t iCh, UInt_t parameterMask = ParAll );
197 
198  void ReleaseDetElem( Int_t iDetElemId, UInt_t parameterMask = ParAll );
199 
200  void ReleaseParameter( Int_t iPar );
201 
202  void ReleaseParameter( Int_t iDetElem, Int_t iPar )
203  { ReleaseParameter( iDetElem*fgNParCh + iPar ); }
204 
206 
207  //@name grouping detectors
209 
210  void GroupChamber( Int_t iCh, UInt_t parameterMask = ParAll );
211 
212  void GroupHalfChamber( Int_t iCh, Int_t iHalf, UInt_t parameterMask = ParAll );
213 
214  void GroupDetElems( Int_t detElemMin, Int_t detElemMax, UInt_t parameterMask = ParAll );
215 
216  void GroupDetElems( const Int_t *detElemList, Int_t nDetElem, UInt_t parameterMask = ParAll );
217 
219 
220  //@name define non linearity
222 
223  void SetChamberNonLinear( Int_t iCh, UInt_t parameterMask);
224 
225  void SetDetElemNonLinear( Int_t iSt, UInt_t parameterMask);
226 
227  void SetParameterNonLinear( Int_t iPar );
228 
229  void SetParameterNonLinear( Int_t iDetElem, Int_t iPar )
230  { SetParameterNonLinear( iDetElem*fgNParCh + iPar ); }
231 
233 
234  //@name constraints
236 
237  void AddConstraints( const Bool_t *bChOnOff, UInt_t parameterMask );
238 
239  void AddConstraints( const Bool_t *bChOnOff, const Bool_t *lVarXYT, UInt_t sidesMask = AllSides );
240 
242 
244  void InitGlobalParameters( Double_t *par );
245 
247  void GlobalFit( Double_t *parameters,Double_t *errors,Double_t *pulls );
248 
250  void PrintGlobalParameters( void ) const;
251 
253  Double_t GetParError( Int_t iPar ) const;
254 
255  AliMUONGeometryTransformer* ReAlign( const AliMUONGeometryTransformer * transformer, const double *misAlignments, Bool_t verbose );
256 
257  void SetAlignmentResolution( const TClonesArray* misAlignArray, Int_t chId, Double_t chResX, Double_t chResY, Double_t deResX, Double_t deResY );
258 
259  private:
260 
262  AliMUONAlignment(const AliMUONAlignment& right);
263 
265  AliMUONAlignment& operator = (const AliMUONAlignment& right);
266 
268  void SetLocalDerivative(Int_t index, Double_t value)
269  { fLocalDerivatives[index] = value; }
270 
272  void SetGlobalDerivative(Int_t index, Double_t value)
273  { fGlobalDerivatives[index] = value; }
274 
276  LocalTrackParam RefitStraightTrack( AliMUONTrack*, Double_t ) const;
277 
278  void FillDetElemData( AliMUONVCluster* );
279 
280  void FillRecPointData( AliMUONVCluster* );
281 
282  void FillTrackParamData( AliMUONTrackParam* );
283 
284  void LocalEquationX( void );
285 
286  void LocalEquationY( void );
287 
288  TGeoCombiTrans DeltaTransform(const double *detElemMisAlignment) const;
289 
291 
292 
293  void AddConstraint(Double_t* parameters, Double_t value );
294 
295  Int_t GetChamberId( Int_t iDetElemNumber ) const;
296 
297  Bool_t DetElemIsValid( Int_t iDetElemId ) const;
298 
299  Int_t GetDetElemNumber( Int_t iDetElemId ) const;
300 
301  TString GetParameterMaskString( UInt_t parameterMask ) const;
302 
303  TString GetSidesMaskString( UInt_t sidesMask ) const;
304 
306 
308  Bool_t fInitialized;
309 
311  Int_t fRunNumber;
312 
314  Bool_t fBFieldOn;
315 
318 
320  Double_t fAllowVar[fgNParCh];
321 
323 
324  Double_t fStartFac;
325 
327  Double_t fResCutInitial;
328 
330  Double_t fResCut;
331 
334 
337 
339  Int_t fNStdDev;
340 
342  Double_t fClustPos[3];
343 
345  Double_t fTrackSlope0[2];
346 
348  Double_t fTrackSlope[2];
349 
351  Double_t fTrackPos0[3];
352 
354  Double_t fTrackPos[3];
355 
357  Double_t fMeas[2];
358 
360  Double_t fSigma[2];
361 
363  enum
364  {
365  kFixedParId = -1,
366  kFreeParId = kFixedParId-1,
367  kGroupBaseId = -10
368  };
369 
372  Int_t fGlobalParameterStatus[fNGlobal];
373 
375  Double_t fGlobalDerivatives[fNGlobal];
376 
378  Double_t fLocalDerivatives[fNLocal];
379 
382 
385 
388  TGeoCombiTrans fGeoCombiTransInverse;
389 
392 
396 
398  TFile* fTFile;
399 
401  TTree* fTTree;
402 
403  ClassDef(AliMUONAlignment, 2)
404 
405 };
406 
407 #endif
Class for alignment of muon spectrometer.
void SetDoEvaluation(Bool_t value)
set to true to do refit evaluation
Int_t fNStdDev
Number of standard deviations for chi2 cut.
Top container class for geometry transformations.
AliRunLoader * Init()
void SetGlobalDerivative(Int_t index, Double_t value)
Set array of global derivatives.
ParameterMask
global parameter bit set, used for masks
AliMUONGeometryTransformer * ReAlign(const AliMUONGeometryTransformer *transformer, int rMod, TGeoCombiTrans deltaDetElemTransf[], Bool_t verbose)
LocalTrackParam * fTrackParamNew
void SetParameterNonLinear(Int_t iDetElem, Int_t iPar)
void ReleaseParameter(Int_t iDetElem, Int_t iPar)
AliMUONVCluster * fCluster
running AliMUONVCluster
Track parameters in ALICE dimuon spectrometer.
static int fgNDetElemCh[10]
AliMUONGeometryTransformer * fTransform
Geometry transformation.
TFile * fTFile
output TFile
AliTPCfastTrack * track
void SetBFieldOn(Bool_t value)
Set flag for Magnetic field On/Off.
Int_t fDetElemNumber
current detection element number
TTree * fTTree
output TTree
void SetRunNumber(Int_t id)
run number
AliMillePede2 * fMillepede
Detector independent alignment class.
abstract base class for clusters
local track parameters, for refit
Double_t fStartFac
Initial value for chi2 cut.
Bool_t fBFieldOn
Flag for Magnetic filed On/Off.
AliMillePedeRecord fTrackRecord
running Track record
Bool_t fDoEvaluation
preform evaluation
Double_t fResCut
Cut on residual for other iterations.
Int_t fRunNumber
current run id
TVectorD errors
Definition: driftITSTPC.C:97
Bool_t fInitialized
true when initialized
void FixParameter(Int_t iDetElem, Int_t iPar)
Reconstructed track in ALICE dimuon spectrometer.
Definition: AliMUONTrack.h:24
Bool_t fRefitStraightTracks
true if straight track refit is to be performed
SidesMask
detector sides bit set, used for selecting sides in constrains
LocalTrackParam * fTrackParamOrig
original local track params
TGeoCombiTrans fGeoCombiTransInverse
void SetRefitStraightTracks(Bool_t value)
set to true to refit tracks
void SetGeometryTransformer(AliMUONGeometryTransformer *transformer)
Set geometry transformer.
void SetLocalDerivative(Int_t index, Double_t value)
Set array of local derivatives.
Double_t fResCutInitial
Cut on residual for first iteration.