-
Notifications
You must be signed in to change notification settings - Fork 0
/
alignConf.C
285 lines (273 loc) · 9.88 KB
/
alignConf.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
#if !defined(__CINT__) || defined(__MAKECINT__)
#include "AliESDEvent.h"
#include "AliESD.h"
#include "AliESDfriend.h"
#include <TFile.h>
#include <TTree.h>
//
#include "AliAlgSteer.h"
#include "AliAlgDet.h"
#include "AliAlgSens.h"
#include "AliAlgDetITS.h"
#include "AliAlgDetTPC.h"
#include "AliAlgDetTRD.h"
#include "AliAlgDetTOF.h"
#include "AliAlgVtx.h"
#include "AliAlgConstraint.h"
#endif
void alignConf(AliAlgSteer* algSteer);
void ConfigITS(AliAlgSteer* algSteer);
void ConfigTPC(AliAlgSteer* algSteer);
void ConfigTRD(AliAlgSteer* algSteer);
void ConfigTOF(AliAlgSteer* algSteer);
void ConfigVTX(AliAlgSteer* algSteer);
void alignConf(AliAlgSteer* algSteer)
{
//
algSteer->SetRefOCDBConfigMacro("configRefOCDB.C");
// algSteer->SetRecoOCDBConfigMacro("configRecoOCDB.C");
algSteer->SetRecoOCDBConfigMacro(""); // Use ESD info
//
algSteer->AddDetector(AliAlgSteer::kITS);
algSteer->AddDetector(AliAlgSteer::kTPC);
algSteer->AddDetector(AliAlgSteer::kTRD);
algSteer->AddDetector(AliAlgSteer::kTOF);
algSteer->InitDetectors();
//
//algSteer->GetDetectorByDetID(AliAlgSteer::kITS)->SetDisabled();
algSteer->GetDetectorByDetID(AliAlgSteer::kTPC)->SetDisabled();
//algSteer->GetDetectorByDetID(AliAlgSteer::kTOF)->SetDisabled();
//algSteer->GetDetectorByDetID(AliAlgSteer::kTRD)->SetDisabled();
//
/*
for (int i=algSteer->GetNDetectors();i--;) { //!!!!RS
AliAlgDet* det = algSteer->GetDetector(i);
for (int iv=det->GetNVolumes();iv--;)
// det->GetVolume(iv)->SetFreeDOFPattern( (0x1<<AliAlgVol::kDOFTY)|(0x1<<AliAlgVol::kDOFTZ)|(0x1<<AliAlgVol::kDOFTX) );
// det->GetVolume(iv)->SetFreeDOFPattern( (0x1<<AliAlgVol::kDOFTX) );
det->FixNonSensors();
}
*/
ConfigITS(algSteer);
ConfigTPC(algSteer);
ConfigTRD(algSteer);
ConfigTOF(algSteer);
//
ConfigVTX(algSteer);
//
algSteer->SetPtMinColl(0.7);
algSteer->SetPtMinCosm(1.0);
//
algSteer->SetVtxMinCont(5); // accept events with min number of vertexTracks contributors
algSteer->SetVtxMinContVC(10); // use for vertex constraint only those with min number of contributors
algSteer->SetMaxDCAforVC(0.05,0.3); // dcaR/Z primary selection to allow vertex constraint
algSteer->SetMaxChi2forVC(10); // track-vertex chi2 primary selection to allow vertex constraint
algSteer->SetCosmicSelStrict(kTRUE); // apply track selection to each leg separately
//
algSteer->SetMinDetAccColl(2); // min number of detectors in track
algSteer->SetMinDetAccCosm(2);
//
algSteer->SetMinPointsColl(6,6); // min number of points per track Boff/Bon
algSteer->SetMinPointsCosm(4,4);
//
// algSteer->SetMPOutType(AliAlgSteer::kMille | AliAlgSteer::kMPRec | AliAlgSteer::kContR);
algSteer->SetMPOutType(AliAlgSteer::kMPRec | AliAlgSteer::kContR);
algSteer->SetDoKalmanResid(kTRUE); // calculate Kalman residuals on top of analytical solutiuon
//
// algSteer->SetMilleTXT(1);
//
algSteer->InitDOFs();
//
}
//======================================================================
void ConfigVTX(AliAlgSteer* algSteer)
{
//
AliAlgVtx *vtx = algSteer->GetVertexSensor();
vtx->SetAddError(0.001,0.001);
// fix vertex by precondition
for (int idf=AliAlgVol::kNDOFGeom;idf--;) {
vtx->SetParErr(idf,-999);
}
}
//======================================================================
void ConfigITS(AliAlgSteer* algSteer)
{
//
const double kCondSig[AliAlgVol::kNDOFGeom] = {0.1,0.1,0.2,1,1,1}; // precondition sigmas
//
AliAlgDetITS* det = (AliAlgDetITS*)algSteer->GetDetectorByDetID(AliAlgSteer::kITS);
if (!det||det->IsDisabled()) return;
det->SetUseErrorParam(kTRUE);
//
det->SetObligatoryColl(kTRUE);
det->SetObligatoryCosm(kTRUE);
//
det->SetTrackFlagSelCosm(AliESDtrack::kITSin);
det->SetTrackFlagSelColl(AliESDtrack::kITSrefit | AliESDtrack::kTPCrefit);
//
det->SetNPointsSelCosm(2);
det->SetNPointsSelColl(3);
//
det->SetITSSelPatternColl(AliAlgDetITS::kSPDAny);
det->SetITSSelPatternCosm(AliAlgDetITS::kSPDNoSel);
//
AliAlgVol* vol=0;
// precondition
for (int iv=det->GetNVolumes();iv--;) {
vol = det->GetVolume(iv);
for (int idf=AliAlgVol::kNDOFGeom;idf--;) {
if (TMath::Abs(vol->GetParErr(idf))>1e-6) continue; // there is already condition
vol->SetParErr(idf, kCondSig[idf] ); // set condition
}
if (!vol->IsSensor()) {
// prevent global shift of children in the containers
vol->SetChildrenConstrainPattern(AliAlgVol::kDOFBitTX | AliAlgVol::kDOFBitTY | AliAlgVol::kDOFBitTZ);
}
}
//
// constraints
vol = det->GetVolume("ITS");
//
// limit global shifts of ITS envelope
const double tolITS[6]={100e-4,100e-4,200e-4,-1,-1,-1};
for (int idf=AliAlgVol::kDOFTX;idf<=AliAlgVol::kDOFTZ;idf++) {
AliAlgConstraint* cstr = new AliAlgConstraint(Form("ITSshift%s",AliAlgVol::GetGeomDOFName(idf)),"");
cstr->SetNoJacobian();
cstr->AddChild(vol);
cstr->SetConstrainPattern(0x1<<idf);
cstr->SetSigma(idf,tolITS[idf]);
algSteer->AddConstraint(cstr);
}
//
// det->SetAddError(2,2);
det->SetAddErrorLr(0,10e-4,50e-4);
det->SetAddErrorLr(1,10e-4,50e-4);
det->SetAddErrorLr(2,5000e-4,10e-4);
det->SetAddErrorLr(3,5000e-4,10e-4);
det->SetAddErrorLr(4,20e-4,100e-4);
det->SetAddErrorLr(5,20e-4,100e-4);
}
//======================================================================
void ConfigTPC(AliAlgSteer* algSteer)
{
//
AliAlgDetTPC* det = (AliAlgDetTPC*)algSteer->GetDetectorByDetID(AliAlgSteer::kTPC);
if (!det||det->IsDisabled()) return;
//
det->SetObligatoryColl(kFALSE);
det->SetObligatoryCosm(kFALSE);
//
det->SetTrackFlagSelColl(AliESDtrack::kTPCrefit | AliESDtrack::kITSrefit);
det->SetTrackFlagSelCosm(AliESDtrack::kTPCin);
//
det->SetNPointsSelColl(70);
det->SetNPointsSelCosm(50);
//
// det->SetAddError(3,10.); // HUGE errors
det->SetAddError(0.1,0.1); // HUGE errors
}
//======================================================================
void ConfigTRD(AliAlgSteer* algSteer)
{
//
const double kCondSigSMD[AliAlgVol::kNDOFGeom] = {2,2,10,1,1,1}; // precondition sigmas
const double kCondSigCHA[AliAlgVol::kNDOFGeom] = {1.5,1.5,5.0, 1,1,1}; // precondition sigmas
AliAlgDetTRD* det = (AliAlgDetTRD*)algSteer->GetDetectorByDetID(AliAlgSteer::kTRD);
if (!det||det->IsDisabled()) return;
//
det->SetObligatoryColl(kFALSE);
det->SetObligatoryCosm(kFALSE);
//
det->SetTrackFlagSelColl(AliESDtrack::kTRDout);
det->SetTrackFlagSelCosm(AliESDtrack::kTRDout);
//
det->SetNPointsSelColl(2);
det->SetNPointsSelCosm(2);
//
// allow variation of correction parameter for DZ,DY of non-crossing tracklets
det->SetFreeDOF(AliAlgDetTRD::kCalibNRCCorrDzDtgl);
det->SetFreeDOF(AliAlgDetTRD::kCalibDVT);
//
// just repeat default settings
det->SetNonRCCorrDzDtgl(0); // correct DZ,DY of non-crossing tracklets
//det->SetNonRCCorrDzDtgl(1.6745); // correct DZ,DY of non-crossing tracklets
det->SetExtraErrRC(0.2,1.0); // assign extra error to crossing tracklets
det->SetAddError(0.05,0.05);
//
// precondition
for (int idf=0;idf<AliAlgVol::kNDOFGeom;idf++) {
det->SetDOFCondition(idf,kCondSigSMD[idf],0); // level 0 - supermodules
det->SetDOFCondition(idf,kCondSigCHA[idf],1); // level 1 - chambers
}
//
TObjArray tmpArr;
det->SelectVolumes(&tmpArr,0); // select supermodules (level0)
//
for (int i=0;i<tmpArr.GetEntriesFast();i++) {
AliAlgVol* vol = (AliAlgVol*)tmpArr[i];
//
// prevent global shift and phi rotation of chambers wrt SM (in automatic constraint)
vol->SetChildrenConstrainPattern(AliAlgVol::kDOFBitTX | AliAlgVol::kDOFBitTY |
AliAlgVol::kDOFBitTZ | AliAlgVol::kDOFBitPH);
}
//
tmpArr.Clear();
}
//======================================================================
void ConfigTOF(AliAlgSteer* algSteer)
{
//
const double kCondSigSMD[AliAlgVol::kNDOFGeom] = {1,5.,5.,1,1,1}; // precondition sigmas
// const double kCondSigSTR[AliAlgVol::kNDOFGeom] = {0.1,0.1,0.1, 1,1,1}; // precondition sigmas
const double kCondSigSTR[AliAlgVol::kNDOFGeom] = {0.1,0.1,0.1, -1,-1,-1}; // precondition sigmas
//
AliAlgDetTOF* det = (AliAlgDetTOF*)algSteer->GetDetectorByDetID(AliAlgSteer::kTOF);
if (!det||det->IsDisabled()) return;
//
det->SetObligatoryColl(kTRUE);
det->SetObligatoryCosm(kFALSE);
//
det->SetTrackFlagSelColl(AliESDtrack::kTOFout);
det->SetTrackFlagSelCosm(AliESDtrack::kTOFout);
//
det->SetNPointsSelColl(1);
det->SetNPointsSelCosm(1);
//
// precondition
for (int idf=0;idf<AliAlgVol::kNDOFGeom;idf++) {
det->SetDOFCondition(idf,kCondSigSMD[idf],0); // level 0 - supermodules
det->SetDOFCondition(idf,kCondSigSTR[idf],1); // level 1 - strips
}
//
TObjArray tmpArr;
det->SelectVolumes(&tmpArr,0); // select supermodules (level0)
//
// prevent systematic rotation by tracking Y (i.e. rphi) shifts
AliAlgConstraint* ctofY = new AliAlgConstraint("TOF_Yconstr","");
ctofY->SetNoJacobian();
ctofY->ConstrainDOF(AliAlgVol::kDOFTY);
algSteer->AddConstraint(ctofY);
//
// prevent systematic compression of inflation in R
// ATTENTION: see if using cosmics will allow to avoid this constraint
// AliAlgConstraint* ctofX = new AliAlgConstraint("TOF_Xconstr","");
// ctofX->SetNoJacobian();
// ctofX->ConstrainDOF(AliAlgVol::kDOFTX);
// algSteer->AddConstraint(ctofX);
//
for (int i=0;i<tmpArr.GetEntriesFast();i++) {
AliAlgVol* vol = (AliAlgVol*)tmpArr[i];
ctofY->AddChild(vol); // add volume to special Y constraint
// ctofX->AddChild(vol); // add volume to special X constraint
//
// prevent global shift of strips wrt SM
vol->SetChildrenConstrainPattern(AliAlgVol::kDOFBitTX | AliAlgVol::kDOFBitTY | AliAlgVol::kDOFBitTZ);
//
// ATTENTION: to limit R scaling fix TOF X, see if can be removed with cosmics added
// vol->SetParErr(AliAlgVol::kDOFTX, -999);
}
// for (int is=det->GetNSensors();is--;) det->GetSensor(is)->SetVarFrame(AliAlgVol::kLOC);
tmpArr.Clear();
//
}