]>
Commit | Line | Data |
---|---|---|
7b85e477 | 1 | #ifndef ALIITSALIGNMILLE2_H |
2 | #define ALIITSALIGNMILLE2_H | |
6526a72c | 3 | |
7b85e477 | 4 | /* Copyright(c) 2007-2009 , ALICE Experiment at CERN, All rights reserved. * |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
057304f3 | 7 | /* $Id$ */ |
6526a72c | 8 | //----------------------------------------------------------------------------- |
7b85e477 | 9 | // |
6526a72c | 10 | // Interface to AliMillePede2 alignment class for the ALICE ITS detector |
11 | // | |
12 | // ITS specific alignment class which interface to AliMillepede. | |
13 | // For each track ProcessTrack calculates the local and global derivatives | |
14 | // at each hit and fill the corresponding local equations. Provide methods for | |
15 | // fixing or constraining detection elements for best results. | |
16 | // | |
17 | // author M. Lunardon (thanks to J. Castillo), ruben.shahoyan@cern.ch | |
18 | //----------------------------------------------------------------------------- | |
7b85e477 | 19 | |
20 | #include <TString.h> | |
21 | #include <TObject.h> | |
6526a72c | 22 | #include <TGeoMatrix.h> |
6be22b3f | 23 | #include <TArrayS.h> |
24 | #include <TArrayD.h> | |
7b85e477 | 25 | #include "AliTrackPointArray.h" |
26 | #include "AliITSAlignMille2Module.h" | |
27 | ||
45993b23 | 28 | class TSystem; |
29 | class TGeoManager; | |
30 | class TVirtualFitter; | |
7b85e477 | 31 | class AliMillePede2; |
32 | class AliAlignObjParams; | |
7b85e477 | 33 | class AliTrackFitterRieman; |
45993b23 | 34 | class AliITSAlignMille2Constraint; |
35 | class AliITSAlignMille2ConstrArray; | |
36 | class AliITSresponseSDD; | |
6be22b3f | 37 | class AliITSTPArrayFit; |
ef24eb3b | 38 | class AliITSsegmentationSDD; |
39 | class AliITSDriftSpeedArraySDD; | |
40 | class AliCDBEntry; | |
7b85e477 | 41 | |
42 | class AliITSAlignMille2: public TObject | |
43 | { | |
44 | public: | |
6be22b3f | 45 | enum {kX,kY,kZ}; |
1d06ac63 | 46 | enum {kCosmics, kCollision, kNDataType}; |
6be22b3f | 47 | enum {kNLocal=5,kMaxPoints=100, |
48 | kNParChGeom = AliITSAlignMille2Module::kMaxParGeom, | |
49 | kNParCh = AliITSAlignMille2Module::kMaxParTot, | |
ef24eb3b | 50 | kMaxITSSensID=2197,kVtxSensID=kMaxITSSensID+1,kMaxITSSensVID=14300,kVtxSensVID=14371, |
51 | kMinITSSupeModuleID=14336, | |
6be22b3f | 52 | kSDDoffsID=240,kNSDDmod=260}; |
7b85e477 | 53 | // |
ef24eb3b | 54 | enum {kSameInitDeltasBit=BIT(14),kSameInitSDDRespBit=BIT(15),kSameInitSDDVDriftBit=BIT(16),kSameDiamondBit=BIT(17)}; |
7b85e477 | 55 | public: |
56 | // | |
6be22b3f | 57 | AliITSAlignMille2(const Char_t *configFilename="AliITSAlignMille.conf",TList* userInfo=0); |
7b85e477 | 58 | virtual ~AliITSAlignMille2(); |
59 | // | |
6526a72c | 60 | AliMillePede2* GetMillePede() const {return fMillepede;} |
6be22b3f | 61 | AliITSTPArrayFit* GetTPAFitter() const {return fTPAFitter;} |
6526a72c | 62 | // |
63 | // configuration methods | |
64 | // | |
65 | Int_t IsVIDDefined(UShort_t voluid) const; | |
66 | Int_t IsVIDContained(UShort_t voluid) const; | |
67 | Int_t IsSymDefined(const Char_t* name) const; | |
68 | Int_t IsSymContained(const Char_t* name) const; | |
8fd71c0a | 69 | Int_t GetRequestedModID(UShort_t voluid) const; |
6526a72c | 70 | // |
7b85e477 | 71 | Int_t GetModuleIndex(const Char_t *symname); |
72 | Int_t GetModuleIndex(UShort_t voluid); | |
73 | UShort_t GetModuleVolumeID(const Char_t *symname); | |
74 | UShort_t GetModuleVolumeID(Int_t index); | |
6526a72c | 75 | AliITSAlignMille2Module* GetMilleModuleByVID(UShort_t voluid) const; // get pointer to the defined supermodule |
76 | AliITSAlignMille2Module* GetMilleModuleBySymName(const Char_t* symname) const; // get pointer to the defined supermodule | |
77 | AliITSAlignMille2Module* GetMilleModuleIfContained(const Char_t* symname) const; | |
78 | AliITSAlignMille2Module* GetMilleModule(Int_t id) const {return (AliITSAlignMille2Module*)fMilleModule[id];} | |
79 | AliITSAlignMille2Module* GetCurrentModule() const {return fCurrentModule;} | |
80 | AliITSAlignMille2Module* GetSuperModule(Int_t id) const {return (AliITSAlignMille2Module*)fSuperModule[id];} | |
ef24eb3b | 81 | AliITSAlignMille2Module* CreateVertexModule(); |
6526a72c | 82 | // |
83 | AliAlignObjParams* GetPrealignedObject(const Char_t* symname) const; | |
84 | AliAlignObjParams* GetConstrRefObject(const Char_t* symname) const; | |
85 | // | |
86 | void ConvertParamsToGlobal(); | |
87 | void ConvertParamsToLocal(); | |
7b85e477 | 88 | // |
6be22b3f | 89 | const Char_t* GetGeometryPath() {return fGeometryPath.Data();} |
90 | const Char_t* GetPreAlignmentPath() {return fPreDeltaPath.Data();} | |
7b85e477 | 91 | TClonesArray* GetPreAlignmentDeltas() const {return fPrealignment;} |
ef24eb3b | 92 | AliITSresponseSDD* GetSDDPrecalResp() const {return fPreRespSDD;} |
93 | AliITSresponseSDD* GetSDDInitResp() const {return fIniRespSDD;} | |
94 | TObjArray* GetSDDInitVDrift() const {return fIniVDriftSDD;} | |
7b85e477 | 95 | void PrintCurrentModuleInfo() const {if (fCurrentModule) fCurrentModule->Print();} |
96 | void Print(Option_t*) const; | |
97 | Bool_t IsConfigured() const {return fIsConfigured;} | |
7b85e477 | 98 | Bool_t GetUseGlobalDelta() const {return fUseGlobalDelta;} |
6526a72c | 99 | Bool_t IsConstraintWrtRef() const {return fConstrRef!=0;} |
100 | Bool_t FixedOrphans() const; | |
6be22b3f | 101 | Bool_t IsLocalYError() const {return fUseLocalYErr;} |
6526a72c | 102 | // |
103 | // geometry stuffs | |
104 | Int_t GetNModules() const {return fNModules;} | |
105 | Int_t GetCurrentModuleIndex() const {return fCurrentModule ? fCurrentModule->GetIndex():-1;} | |
106 | TGeoHMatrix *GetCurrentModuleHMatrix() const {return fCurrentModule ? fCurrentModule->GetMatrix():0;} | |
107 | Double_t *GetCurrentModuleTranslation() const {return fCurrentModule ? fCurrentModule->GetMatrix()->GetTranslation():0;} | |
108 | Int_t GetCurrentModuleInternalIndex() const {return fCurrentModule ? Int_t(fCurrentModule->GetUniqueID()):-1;} | |
109 | Int_t GetTotBadLocEqPoints() const {return fTotBadLocEqPoints;} | |
110 | Int_t GetNConstraints() const {return fConstraints.GetLast()+1;} | |
111 | Int_t InitModuleParams(); | |
7b85e477 | 112 | // |
113 | // fitting methods | |
45993b23 | 114 | AliTrackFitterRieman *GetRiemanFitter() const {return fRieman;} |
7b85e477 | 115 | AliTrackPointArray *PrepareTrack(const AliTrackPointArray *track); |
45993b23 | 116 | AliTrackPointArray *GetCurrentTrack() const {return (AliTrackPointArray*)fTrack;} |
117 | AliTrackPoint *GetCurrentCluster() const {return (AliTrackPoint*)&fCluster;} | |
ef24eb3b | 118 | void ProcessSDDPointInfo(const AliTrackPoint* pnt,Int_t sID, Int_t pntID); |
45993b23 | 119 | void SetCurrentTrack(const AliTrackPointArray *atp) {fTrack = (AliTrackPointArray*)atp;} |
6be22b3f | 120 | void SetCurrentCluster(const AliTrackPoint &atp); |
7b85e477 | 121 | void InitTrackParams(int meth=1); |
ef24eb3b | 122 | Int_t ProcessTrack(const AliTrackPointArray *track, Double_t wgh=1.0); |
123 | Int_t FitTrack(); | |
7b85e477 | 124 | Int_t CheckCurrentTrack(); |
6526a72c | 125 | // |
7b85e477 | 126 | Int_t CalcIntersectionPoint(Double_t *lpar, Double_t *gpar); |
127 | Int_t CalcDerivatives(Int_t paridx, Bool_t islpar); | |
ef24eb3b | 128 | void JacobianPosGloLoc(int locid,double* jacobian); |
7b85e477 | 129 | Double_t* GetLocalIntersectionPoint() const {return (Double_t*)fPintLoc;} |
130 | Double_t* GetGlobalIntersectionPoint() const {return (Double_t*)fPintGlo;} | |
131 | AliTrackPointArray *SortTrack(const AliTrackPointArray *atp); | |
132 | void SetTemporaryExcludedModule(Int_t index) {fTempExcludedModule=index;} | |
133 | Int_t GetTemporaryExcludedModule() const {return fTempExcludedModule;} | |
6526a72c | 134 | Double_t GetMeasGlo(Int_t dim) const {return fMeasGlo[dim];} |
135 | Double_t GetMeasLoc(Int_t dim) const {return fMeasLoc[dim];} | |
136 | Int_t GetCurrentLayer() const; | |
6be22b3f | 137 | void SetBField(Double_t b=0); |
1d06ac63 | 138 | void SetTypeCosmics() {fDataType = kCosmics;} |
139 | void SetTypeCollision() {fDataType = kCollision;} | |
140 | void SetDataType(Int_t tp=kCosmics) {fDataType = tp>=0&&tp< kNDataType ? tp:kCosmics;} | |
6be22b3f | 141 | void SetUseLocalYErrors(Bool_t v=kTRUE) {fUseLocalYErr = v && fTPAFitter;} |
142 | void SetMinPointsPerSensor( Int_t n ) {fMinPntPerSens = n>0 ? n:0;} | |
143 | Int_t GetMinPointsPerSensor() const {return fMinPntPerSens;} | |
144 | void ConstrainHelixFitPT( Int_t q=0,Double_t pt=-1, Double_t err=-1); | |
145 | void ConstrainHelixFitCurv(Int_t q=0,Double_t crv=-1,Double_t crverr=-1); | |
1d06ac63 | 146 | void RemoveHelixFitConstraint(); |
6be22b3f | 147 | Double_t GetHelixContraintCharge() const {return fConstrCharge;} |
148 | Double_t GetHelixContraintPT() const {return fConstrPT;} | |
149 | Double_t GetHelixContraintPTErr() const {return fConstrPTErr;} | |
1d06ac63 | 150 | Int_t GetDataType() const {return fDataType;} |
6be22b3f | 151 | // |
152 | TGeoHMatrix* GetSensorOrigMatrixSID(Int_t sid) const; | |
153 | TGeoHMatrix* GetSensorOrigMatrixVID(Int_t vid) const; | |
154 | // | |
155 | TGeoHMatrix* GetSensorCurrMatrixSID(Int_t sid) const; | |
156 | TGeoHMatrix* GetSensorCurrMatrixVID(Int_t vid) const; | |
ef24eb3b | 157 | // |
158 | AliCDBEntry* GetCDBEntry(const char* path); | |
7b85e477 | 159 | // Hierarchical contraints |
ef24eb3b | 160 | void TieSDDVDriftsLR(AliITSAlignMille2Module* mod); |
6526a72c | 161 | Bool_t PseudoParentsAllowed() const {return fAllowPseudoParents;} |
162 | void ConstrainModuleSubUnitsMean(Int_t idm, Double_t val=0, UInt_t pattern=0xff); | |
163 | void ConstrainModuleSubUnitsMedian(Int_t idm, Double_t val=0, UInt_t pattern=0xff); | |
164 | void ConstrainOrphansMean(Double_t val=0, UInt_t pattern=0xff); | |
165 | void ConstrainOrphansMedian(Double_t val=0, UInt_t pattern=0xff); | |
166 | void ConstrainLocal(const Char_t* name,Double_t *parcf,Int_t npar,Double_t val,Double_t err); | |
7b85e477 | 167 | // |
45993b23 | 168 | void ApplyGaussianConstraint(const AliITSAlignMille2ConstrArray* cstr); |
6526a72c | 169 | void ApplyPreConstraints(); |
170 | void ApplyPostConstraints(); | |
7b85e477 | 171 | // |
ef24eb3b | 172 | void SetWeightPt(Double_t w=1) {fWeightPt = w;} |
173 | void SetSDDVDCorrMult(Bool_t v=kTRUE) {fIsSDDVDriftMult=v;} | |
174 | Double_t GetWeightPt() const {return fWeightPt;} | |
175 | Bool_t IsSDDVDCorrMult() const {return fIsSDDVDriftMult;} | |
45993b23 | 176 | Bool_t IsParModConstrained(const AliITSAlignMille2Module* mod,Int_t par, Bool_t &meanmed, Bool_t &gaussian) const; |
177 | Bool_t IsParModFamilyVaried(const AliITSAlignMille2Module* mod,Int_t par,Int_t depth=999) const; | |
178 | Bool_t IsParFamilyFree(const AliITSAlignMille2Module* mod,Int_t par,Int_t depth=999) const; | |
7b85e477 | 179 | // |
180 | // millepede methods | |
6526a72c | 181 | Int_t GlobalFit(); |
7b85e477 | 182 | void FixParameter(Int_t param, Double_t value); |
7b85e477 | 183 | void PrintGlobalParameters(); |
7b85e477 | 184 | // |
6be22b3f | 185 | TClonesArray* CreateDeltas(); |
186 | AliITSresponseSDD* CreateSDDResponse(); | |
6526a72c | 187 | // module specific |
7b85e477 | 188 | // |
6526a72c | 189 | Double_t GetTDriftSDD() const; |
190 | Double_t GetVDriftSDD() const; | |
ef24eb3b | 191 | Double_t GetDriftSpeed(Int_t id) const {return fDriftSpeed[id];} |
08517ba6 | 192 | Double_t GetDriftSpeed0(Int_t id) const {return fDriftSpeed0[id];} |
ef24eb3b | 193 | Double_t GetDriftTime0(Int_t id) const {return fDriftTime0[id];} |
194 | ||
6526a72c | 195 | // |
196 | AliITSAlignMille2Constraint* GetConstraint(Int_t i) const {return (AliITSAlignMille2Constraint*)fConstraints.At(i);} | |
197 | AliITSAlignMille2Constraint* GetConstraint(const char* name) const {return (AliITSAlignMille2Constraint*)fConstraints.FindObject(name);} | |
7b85e477 | 198 | // |
199 | // debug stuffs | |
6be22b3f | 200 | void FetchCluster(int ip) {fTrack->GetPoint(fCluster,ip);fCluster.SetUniqueID(ip);} |
45993b23 | 201 | void SetLocalInitParams(const Double_t *par) {for (int i=kNLocal;i--;) fLocalInitParam[i]=par[i];} |
1d06ac63 | 202 | Bool_t IsTypeCosmics() const {return fDataType==kCosmics;} |
203 | Bool_t IsTypeCollision() const {return fDataType==kCollision;} | |
7b85e477 | 204 | Double_t *GetMeasLoc() const {return (Double_t*)fMeasLoc;} |
205 | Double_t *GetSigmaLoc() const {return (Double_t*)fSigmaLoc;} | |
206 | Double_t GetBField() const {return fBField;} | |
1d06ac63 | 207 | Bool_t IsFieldON() const {return fBOn;} |
ef24eb3b | 208 | Bool_t IsDiamondUsed() const {return fUseDiamond;} |
7b85e477 | 209 | Double_t *GetLocalInitParam() const {return (Double_t*)fLocalInitParam;} |
210 | Double_t *GetLocalInitParEr() const {return (Double_t*)fLocalInitParEr;} | |
6526a72c | 211 | Double_t GetLocalDif(int par, int coor) const {return fDerivativeLoc[par][coor];} |
212 | Double_t GetGlobalDif(int par, int coor) const {return fDerivativeGlo[par][coor];} | |
7b85e477 | 213 | Int_t GetPreAlignmentQualityFactor(Int_t index) const;// if not prealign. return -1 |
214 | void SetBug(Int_t bug) {fBug=bug;} // 1:SSD inversion sens.18-19 | |
6526a72c | 215 | static AliITSAlignMille2* GetInstance() {return fgInstance;} |
216 | ||
6be22b3f | 217 | // pepo270809 |
218 | Int_t GetExtraClustersMode() const {return fExtraClustersMode;} | |
219 | void SetExtraClustersMode(Int_t mode) {fExtraClustersMode=mode;} | |
220 | // endpepo270809 | |
221 | ||
6526a72c | 222 | // pepo |
223 | // flag for AliITSAlignMille compatibility | |
224 | Int_t GetMilleVersion() const {return fMilleVersion;} | |
225 | void SetMilleVersion(Int_t m1) {fMilleVersion=m1;} | |
226 | // modified existing methods | |
227 | void SetCurrentModule(Int_t id); | |
228 | // old methods recovered | |
229 | Int_t IsDefined(UShort_t voluid) const {return IsVIDDefined(voluid);} | |
230 | Int_t IsContained(UShort_t voluid) const {return IsVIDContained(voluid);} | |
231 | // moved from private to public | |
1d06ac63 | 232 | void SetRequiredPoint(Char_t* where, Int_t ndet, Int_t updw, Int_t nreqpts,Int_t runtype=-1); |
6526a72c | 233 | Bool_t InitRiemanFit(); |
234 | void SetMinNPtsPerTrack(Int_t pts=3) {fMinNPtsPerTrack=pts;} | |
7b85e477 | 235 | // |
1d06ac63 | 236 | static Bool_t IsZero(Double_t v,Double_t threshold = 1e-15) { return TMath::Abs(v)<threshold; } |
6be22b3f | 237 | static void SetWordBit(UInt_t word,Int_t bitID) { word |= (1<<bitID);} |
238 | static void ResetWordBit(UInt_t word,Int_t bitID) { word &= ~(1<<bitID);} | |
239 | static Bool_t TestWordBit(UInt_t word,Int_t bitID) { return (Bool_t)(word&(1<<bitID));} | |
240 | // | |
4bd2db93 | 241 | protected: |
7b85e477 | 242 | // |
ef24eb3b | 243 | struct Mille2Data { // structure to store data for LocalEquations (X and Z, optionally Y) |
4bd2db93 | 244 | enum {kMaxLev = 7}; |
6be22b3f | 245 | Double_t fMeas[3]; // measured coordinates |
246 | Double_t fSigma[3]; // measured errors | |
247 | Double_t fDerLoc[kNLocal][3]; // calculated local derivatives | |
4bd2db93 | 248 | Int_t fNModFilled, fNGlobFilled, fModuleID[kMaxLev]; // used module info |
249 | Int_t fParMilleID[AliITSAlignMille2Module::kMaxParTot*kMaxLev]; // param id's | |
6be22b3f | 250 | Double_t fDerGlo[AliITSAlignMille2Module::kMaxParTot*kMaxLev][3]; // global derivatives |
4bd2db93 | 251 | }; |
6be22b3f | 252 | // |
7b85e477 | 253 | // configuration methods |
6526a72c | 254 | void Init(); |
abd7ef79 | 255 | Int_t CacheMatricesOrig(); |
256 | Int_t CacheMatricesCurr(); | |
6be22b3f | 257 | Int_t ProcessUserInfo(TList *userInfo=0); |
7b85e477 | 258 | Int_t LoadConfig(const Char_t *cfile="AliITSAlignMille.conf"); |
6526a72c | 259 | TObjArray* GetConfigRecord(FILE* stream, TString& recTitle, TString& recOpt, Bool_t rew); |
18986853 | 260 | Int_t CheckConfigRecords(FILE* stream); |
ef24eb3b | 261 | Int_t ReloadInitCalib(TList *userInfo); |
262 | Int_t ReloadInitCalib(); | |
6526a72c | 263 | // |
264 | void BuildHierarchy(); | |
7b85e477 | 265 | Int_t LoadSuperModuleFile(const Char_t *cfile="ITSMilleSuperModules.root"); |
6be22b3f | 266 | Int_t LoadSDDResponse(TString& path, AliITSresponseSDD *&resp); |
ef24eb3b | 267 | Int_t LoadSDDVDrift(TString& path, TObjArray *&arr); |
6be22b3f | 268 | Int_t LoadDeltas(TString& path, TClonesArray *&arr); |
ef24eb3b | 269 | Int_t LoadDiamond(TString& path); |
7b85e477 | 270 | void ResetLocalEquation(); |
6526a72c | 271 | Int_t InitGeometry(); |
7b85e477 | 272 | Int_t ApplyToGeometry(); |
273 | // | |
6526a72c | 274 | void ConstrainModuleSubUnits(Int_t idm, Double_t val=0, UInt_t pattern=0xff); |
275 | void ConstrainOrphans(Double_t val=0,UInt_t pattern=0xff); | |
276 | void PostConstrainModuleSubUnits(Int_t type,Int_t idm, Double_t val, UInt_t pattern); | |
277 | void PostConstrainOrphans(Int_t type,Double_t val, UInt_t pattern); | |
278 | // | |
6be22b3f | 279 | void SetGeometryPath(const Char_t* filename="geometry.root") { fGeometryPath = filename; } |
6526a72c | 280 | |
ef24eb3b | 281 | void SetInitTrackParamsMeth(Int_t meth=1) {fIniTrackParamsMeth=meth;} |
6526a72c | 282 | // |
283 | void AddConstraint(Double_t *factor, Double_t value, Double_t sigma=0); | |
6be22b3f | 284 | void InitGlobalParameters(Double_t *par); |
285 | Bool_t SetLocalDerivative(Int_t index, Double_t value) {return IsZero(fLocalDerivatives[index]=value);} | |
286 | Bool_t SetGlobalDerivative(Int_t index, Double_t value) {return IsZero(fGlobalDerivatives[index]=value);} | |
6526a72c | 287 | // |
7b85e477 | 288 | // millepede methods |
6526a72c | 289 | // |
4bd2db93 | 290 | Int_t AddLocalEquation(Mille2Data &m); |
6be22b3f | 291 | Int_t AddLocalEquationTPA(Mille2Data &m); |
4bd2db93 | 292 | void SetLocalEquations(const Mille2Data *marr, Int_t neq); |
6526a72c | 293 | void SetUseGlobalDelta(Bool_t v=kTRUE) {fUseGlobalDelta = v;} |
294 | void SetAllowPseudoParents(Bool_t v=kTRUE) {fAllowPseudoParents = v;} | |
295 | Int_t SetConstraintWrtRef(const char* reffname); | |
7b85e477 | 296 | // |
297 | AliITSAlignMille2(const AliITSAlignMille2& rhs); | |
298 | AliITSAlignMille2& operator=(const AliITSAlignMille2& rhs); | |
299 | // | |
300 | protected: | |
301 | // | |
18986853 | 302 | enum { |
ef24eb3b | 303 | kOCDBDefaultPath, |
304 | kOCDBSpecificPath, | |
18986853 | 305 | kGeomFile, |
306 | kSuperModileFile, | |
307 | kConstrRefFile, | |
6be22b3f | 308 | kPreDeltaFile, |
18986853 | 309 | kPreCalSDDFile, |
ef24eb3b | 310 | kPreVDriftSDDFile, |
18986853 | 311 | kInitCalSDDFile, |
ef24eb3b | 312 | kInitVDriftSDDFile, |
6be22b3f | 313 | kInitDeltaFile, |
18986853 | 314 | kGlobalDeltas, |
315 | kConstrLocal, | |
316 | kModVolID, | |
317 | kModIndex, | |
318 | kPseudoParents, | |
319 | kTrackFitMethod, | |
320 | kMinPntTrack, | |
321 | kNStDev, | |
322 | kResCutInit, | |
323 | kResCutOther, | |
324 | kLocalSigFactor, | |
325 | kStartFactor, | |
ef24eb3b | 326 | kFinalFactor, |
18986853 | 327 | kBField, |
328 | kSparseMatrix, | |
329 | kRequirePoint, | |
330 | kConstrOrphans, | |
331 | kConstrSubunits, | |
332 | kApplyConstr, | |
6be22b3f | 333 | kExtraClustersMode, |
334 | kTPAFitter, | |
335 | kUseLocalYErr, | |
336 | kMinPointsSens, | |
ef24eb3b | 337 | kSDDVDCorrMult, |
338 | kWeightPt, | |
339 | kUseDiamond, | |
340 | kSameSDDT0, | |
18986853 | 341 | // |
342 | kNKeyWords | |
343 | }; // id's of the keywirds for config file records | |
344 | ||
7b85e477 | 345 | // millepede stuffs |
346 | AliMillePede2 *fMillepede; // Detector independent alignment class | |
ef24eb3b | 347 | Double_t fStartFac; // Initial factor for chi2 cut |
348 | Double_t fFinalFac; // Final factor for chi2 cut | |
7b85e477 | 349 | Double_t fResCutInitial; // Cut on residual for first iteration |
350 | Double_t fResCut; // Cut on residual for other iterations | |
351 | Int_t fNGlobal; // Number of global parameters | |
352 | Int_t fNLocal; // Number of local parameters | |
353 | Int_t fNStdDev; // Number of standard deviations for chi2 cut | |
354 | Bool_t fIsMilleInit; // Flag for initialization | |
6526a72c | 355 | Bool_t fAllowPseudoParents; // For simple constraints don't involve parents into the fit |
7b85e477 | 356 | // |
357 | // fitting stuffs | |
6be22b3f | 358 | AliITSTPArrayFit *fTPAFitter; // TPArrayFitter |
7b85e477 | 359 | AliITSAlignMille2Module *fCurrentModule; // Current SuperModule index |
360 | AliTrackPointArray *fTrack; // pointer to current track | |
6526a72c | 361 | TObjArray fTrackBuff; // buffer for tracks of min length |
7b85e477 | 362 | AliTrackPoint fCluster; // current cluster |
6be22b3f | 363 | Int_t fCurrentSensID; // sensor index for current cluster |
364 | TArrayD fClusLoc; // local coordinates of the clusters | |
365 | TArrayD fClusGlo; // global coordinates of the clusters | |
366 | TArrayD fClusSigLoc; // local cov matrix of the clusters | |
7b85e477 | 367 | Double_t *fGlobalDerivatives; // Array of global derivatives |
368 | Double_t fLocalDerivatives[kNLocal]; // Array of local deriv. | |
369 | Double_t fLocalInitParam[kNLocal]; // Array with inital values for local parameters for current track | |
370 | Double_t fLocalInitParEr[kNLocal][kNLocal];// Array with inital values for local parameters for current track | |
371 | Double_t fModuleInitParam[kNParCh]; // Array with inital values for current module parameters (init geometry) | |
45993b23 | 372 | Double_t fPintLoc[3]; // track/module intersection point in local coordinates |
373 | Double_t fPintLoc0[3]; // track/module intersection point in local coordinates (before variation) | |
374 | Double_t fPintGlo[3]; // track/module intersection point in global coordinates | |
6be22b3f | 375 | Double_t *fMeasLoc; // current point local coordinates (the original ones) |
376 | Double_t *fMeasGlo; // current point glob. coord (AliTrackPoint) | |
377 | Double_t *fSigmaLoc; // stdev current point | |
7b85e477 | 378 | Double_t fSigmaFactor[3]; // multiplicative factor for cluster sigmaX,Y,Z |
6be22b3f | 379 | Double_t fConstrPT; // optional PT constraint for helix (abs value) |
380 | Double_t fConstrPTErr; // error on this constraint (0 - exact) | |
381 | Int_t fConstrCharge; // optional constraint on charge of Helix track (0 - no constraint) | |
7b85e477 | 382 | // |
ef24eb3b | 383 | Double_t fDerivativeLoc[kNLocal][3]; // XYZ deriv. over local params |
6526a72c | 384 | Double_t fDerivativeGlo[kNParCh][3]; // XYZ deriv. over global params |
7b85e477 | 385 | Int_t fMinNPtsPerTrack; // min number of points per track to accept it |
ef24eb3b | 386 | Int_t fIniTrackParamsMeth; // method for track fit |
7b85e477 | 387 | Int_t fTotBadLocEqPoints; // total number of reject points because of bad EqLoc |
388 | AliTrackFitterRieman *fRieman; // riemann fitter for helices | |
389 | // | |
6526a72c | 390 | TObjArray fConstraints; // list of constraints |
6be22b3f | 391 | TObjArray fCacheMatrixOrig; // cach for original geom matrices |
392 | TObjArray fCacheMatrixCurr; // cach for prealigned geom matrices | |
7b85e477 | 393 | // >> new members |
1d06ac63 | 394 | Bool_t fUseGlobalDelta; // intetpret deltas as global |
395 | Bool_t fRequirePoints[kNDataType]; // required points in specific layers | |
396 | Int_t fNReqLayUp[kNDataType][6]; // number of points required in layer[n] with Y>0 | |
397 | Int_t fNReqLayDown[kNDataType][6]; // number of points required in layer[n] with Y<0 | |
398 | Int_t fNReqLay[kNDataType][6]; // number of points required in layer[n] | |
399 | Int_t fNReqDetUp[kNDataType][3]; // number of points required in Detector[n] with Y>0 | |
400 | Int_t fNReqDetDown[kNDataType][3]; // number of points required in Detector[n] with Y<0 | |
401 | Int_t fNReqDet[kNDataType][3]; // number of points required in Detector[n] | |
7b85e477 | 402 | Int_t fTempExcludedModule; /// single module temporary excluded from initial fit |
403 | // << new members | |
404 | // | |
6be22b3f | 405 | // OCDB stuff |
ef24eb3b | 406 | TList *fIniUserInfo; // initial user info (validity is not guaranteed after initialization) |
407 | TString fIniDeltaPath; // where to take the deltas used to produce the points | |
408 | TString fIniSDDRespPath; // where to take the initial SDD response used to produce the points | |
6be22b3f | 409 | TString fPreCalSDDRespPath; // precalibration SDD response file name |
ef24eb3b | 410 | TString fIniSDDVDriftPath; // initial SDD vdrift file name |
411 | TString fPreSDDVDriftPath; // initial SDD vdrift file name | |
7b85e477 | 412 | // geometry stuffs |
6be22b3f | 413 | TString fGeometryPath; // Geometry file name |
414 | TString fPreDeltaPath; // file with prealigned objects | |
415 | TString fConstrRefPath; // file with prealigned objects wrt which constraints are defined | |
ef24eb3b | 416 | TString fDiamondPath; // file with diamond constraint |
45993b23 | 417 | TGeoManager *fGeoManager; // pointer to Alice geomanager |
418 | Bool_t fIsConfigured; // flag for loaded config file | |
419 | TArrayS fPreAlignQF; // prealignment flags (not used?) | |
7b85e477 | 420 | // |
ef24eb3b | 421 | AliITSresponseSDD* fIniRespSDD; // array of SDD t0/vdrift calib params used to create the track points |
422 | AliITSresponseSDD* fPreRespSDD; // array of SDD t0/vdrift calib params | |
423 | TObjArray* fIniVDriftSDD; // array of AliITSDriftSpeedArraySDD objects used for original reco | |
424 | TObjArray* fPreVDriftSDD; // array of AliITSDriftSpeedArraySDD objects to be used as a starting point instead of fIniVDriftSDD | |
425 | AliITSsegmentationSDD* fSegmentationSDD; // extraction of SDD segmentation params | |
7b85e477 | 426 | TClonesArray* fPrealignment; // array of prealignment global deltas |
6526a72c | 427 | TClonesArray* fConstrRef; // array of refererence deltas with respect to which the constraint are defined (survey?) |
7b85e477 | 428 | TObjArray fMilleModule; /// array of super modules to be aligned |
429 | TObjArray fSuperModule; /// array of super modules defined in supermodule file | |
430 | Int_t fNModules; // number of defined modules from config file | |
431 | Int_t fNSuperModules; /// number of custom supermodules in SM file | |
432 | Bool_t fUsePreAlignment; // start from prealigned setup | |
6be22b3f | 433 | Bool_t fUseLocalYErr; // use local Yerror due to the sensor thickness |
7b85e477 | 434 | Bool_t fBOn; // magentic field ON |
435 | Double_t fBField; // value of magnetic field | |
1d06ac63 | 436 | Int_t fDataType; // is this cosmics or collision processing? |
6be22b3f | 437 | Int_t fMinPntPerSens; // min number of points per module to vary it |
7b85e477 | 438 | Int_t fBug; /// tag for temporary bug correction |
6526a72c | 439 | // pepo |
440 | Int_t fMilleVersion; /// tag for backward compatibility | |
441 | // endpepo | |
6be22b3f | 442 | // pepo270809 |
443 | Int_t fExtraClustersMode; /// 1=remove random / 2=remove internal / 10=use only tracks with xcl | |
444 | // endpepo270809 | |
6526a72c | 445 | // |
ef24eb3b | 446 | Double_t fTrackWeight; //weight given by the user to current track |
447 | Double_t fWeightPt; //weight track equations by pT in this power | |
448 | Bool_t fIsSDDVDriftMult; //use multiplicative correction for SDD vdrift | |
08517ba6 | 449 | Double_t fDriftSpeed[50]; //temporary array for corrected drift speed of SDD alitrackpoints |
450 | Double_t fDriftSpeed0[50]; //temporary array for original drift speed of SDD alitrackpoints | |
6526a72c | 451 | Double_t fDriftTime0[50]; //temporary array for drift time 0's used for SDD alitrackpoints |
6be22b3f | 452 | Double_t fExtClusterPar[9]; //array to store the parameters of the externally imposed cluster |
ef24eb3b | 453 | AliTrackPoint fDiamond; //optional constraint on the vertex |
454 | AliTrackPoint fDiamondI; //constraint on the vertex with inverted error matrix | |
455 | Bool_t fUseDiamond; //use diamond as a vertex constraint | |
456 | Int_t fDiamondPointID; //ID of the diamond point in the track | |
457 | Int_t fDiamondModID; //id of the fake diamond module | |
7b85e477 | 458 | // |
459 | static AliITSAlignMille2* fgInstance; // global pointer on itself | |
460 | static Int_t fgInstanceID; // global counter of the instances | |
6be22b3f | 461 | static const Char_t * fgkRecKeys[]; // keywords for config file records |
462 | static const Char_t fgkXYZ[]; // XYZ labels | |
6526a72c | 463 | // |
7b85e477 | 464 | ClassDef(AliITSAlignMille2, 0) |
7b85e477 | 465 | }; |
466 | ||
6be22b3f | 467 | |
468 | //______________________________________________________________________________________ | |
469 | inline void AliITSAlignMille2::SetCurrentCluster(const AliTrackPoint &atp) | |
470 | { | |
471 | // set current cluster | |
472 | fCluster = atp; | |
473 | fCurrentSensID = AliITSAlignMille2Module::GetIndexFromVolumeID(fCluster.GetVolumeID()); | |
474 | } | |
475 | ||
476 | //______________________________________________________________________________________ | |
477 | inline TGeoHMatrix* AliITSAlignMille2::GetSensorOrigMatrixSID(Int_t sid) const | |
478 | { | |
479 | // get cached original matrix by sensor ID | |
480 | return sid<0 ? 0 : (TGeoHMatrix*) fCacheMatrixOrig[sid]; | |
481 | } | |
482 | ||
483 | //______________________________________________________________________________________ | |
484 | inline TGeoHMatrix* AliITSAlignMille2::GetSensorOrigMatrixVID(Int_t vid) const | |
485 | { | |
486 | // get cached original matrix by sensor volume ID | |
487 | return GetSensorOrigMatrixSID( AliITSAlignMille2Module::GetIndexFromVolumeID(vid) ); | |
488 | } | |
489 | ||
490 | //______________________________________________________________________________________ | |
491 | inline TGeoHMatrix* AliITSAlignMille2::GetSensorCurrMatrixSID(Int_t sid) const | |
492 | { | |
493 | // get cached current matrix by sensor ID | |
494 | return sid<0 ? 0 : (TGeoHMatrix*) fCacheMatrixCurr[sid]; | |
495 | } | |
496 | ||
497 | //______________________________________________________________________________________ | |
498 | inline TGeoHMatrix* AliITSAlignMille2::GetSensorCurrMatrixVID(Int_t vid) const | |
499 | { | |
500 | // get cached current matrix by sensor volume ID | |
501 | return GetSensorCurrMatrixSID( AliITSAlignMille2Module::GetIndexFromVolumeID(vid) ); | |
502 | } | |
503 | ||
7b85e477 | 504 | #endif |
18986853 | 505 |