1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 //-----------------------------------------------------------------------------
18 /// class AliITSAlignMille2Module
19 /// Alignment class for the ALICE ITS detector
21 /// This class is used by AliITSAlignMille to build custom supermodules
22 /// made of ITS sensitive modules. These supermodules are then aligned
24 /// Custom supermodules must have VolumeID > 14335
26 /// \author M. Lunardon
27 //-----------------------------------------------------------------------------
29 #include <TGeoManager.h>
30 #include <TGeoMatrix.h>
32 #include "AliITSAlignMille2Module.h"
33 #include "AliITSgeomTGeo.h"
34 #include "AliGeomManager.h"
35 #include "AliAlignObjParams.h"
37 #include "AliITSAlignMille2.h"
40 ClassImp(AliITSAlignMille2Module)
45 AliAlignObjParams AliITSAlignMille2Module::fgTempAlignObj;
47 //-------------------------------------------------------------
48 AliITSAlignMille2Module::AliITSAlignMille2Module() :
58 fSensVolModifMatrix(NULL),
62 fMatrix = new TGeoHMatrix;
63 fSensVolMatrix = new TGeoHMatrix;
64 fSensVolModifMatrix = new TGeoHMatrix;
66 fSensVolVolumeID.Set(1);
67 fSigmaFactor[0]=fSigmaFactor[1]=fSigmaFactor[2]=1.0;
70 //-------------------------------------------------------------
71 AliITSAlignMille2Module::AliITSAlignMille2Module(Int_t index,UShort_t volid,char* symname,TGeoHMatrix *m,Int_t nsv,UShort_t *volidsv) :
81 fSensVolModifMatrix(NULL),
85 fMatrix = new TGeoHMatrix;
86 fSensVolMatrix = new TGeoHMatrix;
87 fSensVolModifMatrix = new TGeoHMatrix;
88 fSigmaFactor[0]=fSigmaFactor[1]=fSigmaFactor[2]=1.0;
89 if (Set(index,volid,symname,m,nsv,volidsv)) {
90 AliInfo("Error in AliITSAlignMille2Module::Set() - initializing void supermodule...");
94 //-------------------------------------------------------------
95 AliITSAlignMille2Module::AliITSAlignMille2Module(UShort_t volid) :
104 fSensVolMatrix(NULL),
105 fSensVolModifMatrix(NULL),
108 /// simple constructor building a supermodule from a single sensitive volume
109 fMatrix = new TGeoHMatrix;
110 fSensVolMatrix = new TGeoHMatrix;
111 fSensVolModifMatrix = new TGeoHMatrix;
112 // temporary align object, just use the rotation...
113 fSensVolIndex.Set(1);
114 fSensVolVolumeID.Set(1);
115 fSigmaFactor[0]=fSigmaFactor[1]=fSigmaFactor[2]=1.0;
117 fIndex = GetIndexFromVolumeID(volid);
118 if (fIndex>=0 && gGeoManager) { // good sensitive module and geometry loaded
119 SetName(AliGeomManager::SymName(volid));
121 AddSensitiveVolume(volid);
122 if (SensVolMatrix(volid, fMatrix))
123 AliInfo("Matrix not defined");
126 AliInfo("Wrong VolumeID or Geometry not loaded - initializing void supermodule...");
131 //_____________________________________________________________________________
132 AliITSAlignMille2Module::AliITSAlignMille2Module(const AliITSAlignMille2Module &m) :
134 fNSensVol(m.fNSensVol),
136 fVolumeID(m.fVolumeID),
138 fSensVolIndex(m.fSensVolIndex),
139 fSensVolVolumeID(m.fSensVolVolumeID),
140 fMatrix(new TGeoHMatrix(*m.GetMatrix())),
141 fSensVolMatrix(new TGeoHMatrix),
142 fSensVolModifMatrix(new TGeoHMatrix),
146 fSensVolIndex = m.fSensVolIndex;
147 fSensVolVolumeID = m.fSensVolVolumeID;
148 for (int i=3;i--;) fSigmaFactor[i] = m.fSigmaFactor[i];
151 //_____________________________________________________________________________
152 AliITSAlignMille2Module& AliITSAlignMille2Module::operator=(const AliITSAlignMille2Module &m)
156 if(this==&m) return *this;
157 ((TNamed *)this)->operator=(m);
159 fNSensVol=m.fNSensVol;
161 fVolumeID=m.fVolumeID;
162 for (int i=3;i--;) fSigmaFactor[i] = m.fSigmaFactor[i];
163 if (fMatrix) delete fMatrix;
164 fMatrix=new TGeoHMatrix(*m.GetMatrix());
165 fSensVolIndex = m.fSensVolIndex;
166 fSensVolVolumeID = m.fSensVolVolumeID;
172 //-------------------------------------------------------------
173 AliITSAlignMille2Module::~AliITSAlignMille2Module() {
176 delete fSensVolMatrix;
177 delete fSensVolModifMatrix;
180 //-------------------------------------------------------------
181 Int_t AliITSAlignMille2Module::Set(Int_t index, UShort_t volid, char* symname, TGeoHMatrix *m, Int_t nsv, UShort_t *volidsv)
183 // initialize a custom supermodule
184 // index, volid, symname and matrix must be given
185 // if (volidsv) add nsv sensitive volumes to the supermodules
186 // return 0 if success
189 AliInfo("Index must be >= 2198");
193 AliInfo("VolumeID must be >= 14336");
197 if (!symname) return -3;
198 for (Int_t i=0; i<2198; i++) {
199 if (!strcmp(symname,AliITSgeomTGeo::GetSymName(i))) {
200 AliInfo("Symname already used by a Sensitive Volume");
207 // can initialize needed stuffs
214 fSensVolIndex.Set(nsv);
215 fSensVolVolumeID.Set(nsv);
216 // add sensitive volumes
217 for (Int_t i=0; i<nsv; i++) AddSensitiveVolume(volidsv[i]);
222 //-------------------------------------------------------------
223 Int_t AliITSAlignMille2Module::GetIndexFromVolumeID(UShort_t voluid) {
224 /// index from volume ID
225 AliGeomManager::ELayerID lay = AliGeomManager::VolUIDToLayer(voluid);
226 if (lay<1|| lay>6) return -1;
227 Int_t idx=Int_t(voluid)-2048*lay;
228 if (idx>=AliGeomManager::LayerSize(lay)) return -1;
229 for (Int_t ilay=1; ilay<lay; ilay++)
230 idx += AliGeomManager::LayerSize(ilay);
234 //-------------------------------------------------------------
235 void AliITSAlignMille2Module::AddSensitiveVolume(UShort_t voluid)
237 /// add a sensitive volume to this supermodule
238 if (GetIndexFromVolumeID(voluid)<0) return; // bad volid
240 // in principle, the correct size of fSensVol... arrays was set outside but check anyway
241 if (fSensVolVolumeID.GetSize()<fNSensVol) {
242 fSensVolVolumeID.Set(fNSensVol+1);
243 fSensVolIndex.Set(fNSensVol+1);
246 fSensVolVolumeID[fNSensVol] = Short_t(voluid);
247 fSensVolIndex[fNSensVol] = GetIndexFromVolumeID(voluid);
251 //-------------------------------------------------------------
252 void AliITSAlignMille2Module::DelSensitiveVolume(Int_t at)
254 // Suppress sensor at position "at"
255 // in fact we are swapping with the last valid one
256 int lastValid = --fNSensVol;
257 int tmpv = fSensVolIndex[at];
258 fSensVolIndex[at] = fSensVolIndex[lastValid];
259 tmpv = fSensVolVolumeID[at];
260 fSensVolVolumeID[at] = fSensVolVolumeID[lastValid];
261 fSensVolVolumeID[lastValid] = tmpv;
265 //-------------------------------------------------------------
266 Bool_t AliITSAlignMille2Module::IsIn(UShort_t voluid) const
268 /// check if voluid is defined
269 if (!voluid) return kFALSE; // only positive voluid are accepted
270 for (Int_t i=0; i<fNSensVol; i++) if (UShort_t(fSensVolVolumeID[i])==voluid) return kTRUE;
274 //-------------------------------------------------------------
275 Bool_t AliITSAlignMille2Module::BelongsTo(AliITSAlignMille2Module* parent) const
277 /// check if parent contains the sensors of this volume
278 if (fNSensVol<1 || fNSensVol>=parent->GetNSensitiveVolumes()) return kFALSE;
279 return parent->IsIn( fSensVolVolumeID[0] );
282 //-------------------------------------------------------------
283 TGeoHMatrix *AliITSAlignMille2Module::GetSensitiveVolumeModifiedMatrix(UShort_t voluid, Double_t *delta,Bool_t local)
285 // modify the original TGeoHMatrix of the sensitive module 'voluid' according
286 // with a delta transform. applied to the supermodule matrix
287 // return NULL if error
289 if (!IsIn(voluid)) return NULL;
290 if (!gGeoManager) return NULL;
292 // prepare the TGeoHMatrix
293 Double_t tr[3],ang[3];
294 tr[0]=delta[0]; // in centimeter
297 ang[0]=delta[3]; // psi (X) in deg
298 ang[1]=delta[4]; // theta (Y)
299 ang[2]=delta[5]; // phi (Z)
301 fgTempAlignObj.SetRotation(ang[0],ang[1],ang[2]);
302 fgTempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);
303 AliDebug(3,Form("Delta angles: psi=%f theta=%f phi=%f",ang[0],ang[1],ang[2]));
305 fgTempAlignObj.GetMatrix(hm);
306 //printf("\n0: delta matrix\n");hm.Print();
308 // 1) start setting fSensVolModif = fSensVol
309 if (SensVolMatrix(voluid, fSensVolModifMatrix)) return NULL;
312 // 2) set fSensVolModif = SensVolRel
313 fSensVolModifMatrix->MultiplyLeft( &fMatrix->Inverse() );
314 // 3) multiply left by delta
315 fSensVolModifMatrix->MultiplyLeft( &hm );
316 // 4) multiply left by fMatrix
317 fSensVolModifMatrix->MultiplyLeft( fMatrix );
319 else fSensVolModifMatrix->MultiplyLeft( &hm );
321 return fSensVolModifMatrix;
324 //-------------------------------------------------------------
325 AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeMisalignment(UShort_t voluid, Double_t *deltalocal)
327 // calculate misalignment of sens.vol. 'voluid' according with a displacement 'deltalocal'
328 // of the mother volume. The misalignment is returned as AliAlignObjParams object
330 if (!IsIn(voluid)) return NULL;
331 if (!gGeoManager) return NULL;
333 // prepare the TGeoHMatrix
334 Double_t tr[3],ang[3];
335 tr[0]=deltalocal[0]; // in centimeter
338 ang[0]=deltalocal[3]; // psi (X) in deg
339 ang[1]=deltalocal[4]; // theta (Y)
340 ang[2]=deltalocal[5]; // phi (Z)
342 fgTempAlignObj.SetRotation(ang[0],ang[1],ang[2]);
343 fgTempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);
344 AliDebug(3,Form("Delta angles: psi=%f theta=%f phi=%f",ang[0],ang[1],ang[2]));
346 return GetSensitiveVolumeMisalignment(voluid,&fgTempAlignObj);
349 //-------------------------------------------------------------
350 AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeMisalignment(UShort_t voluid, AliAlignObjParams *a)
352 // return the misalignment of the sens. vol. 'voluid' corresponding with
353 // a misalignment 'a' in the mother volume
354 // return NULL if error
356 // Gsv = Gg * Gg-1 * Gsv -> Lsv,g = Gg-1 * Gsv
357 // G'sv = Gg * Dg * Lsv,g === Gsv * Dsv
358 // Gg * Dg * Gg-1 * Gsv = Gsv * Gsv-1 * Gg * Dg * Gg-1 * Gsv
360 // => Dsv = (Gsv-1 * Gg * Dg * Gg-1 * Gsv)
363 if (!IsIn(voluid)) return NULL;
364 if (!gGeoManager) return NULL;
368 // prepare the Delta matrix Dg
373 // 1) start setting fSensVolModif = Gsv
374 if (SensVolMatrix(voluid, fSensVolModifMatrix)) return NULL;
375 //printf("\n1: modif=orig del sensvol\n");fSensVolModifMatrix->Print();
377 // 2) set fSensVolModif = Gg-1 * Gsv
378 fSensVolModifMatrix->MultiplyLeft( &fMatrix->Inverse() );
379 //printf("\n2: modif=relative del sensvol\n");fSensVolModifMatrix->Print();
381 // 3) set fSensVolModif = Dg * Gg-1 * Gsv
382 fSensVolModifMatrix->MultiplyLeft( &dg );
383 //printf("\n3: modif= delta*relative\n");fSensVolModifMatrix->Print();
385 // 4) set fSensVolModif = Gg * Dg * Gg-1 * Gsv
386 fSensVolModifMatrix->MultiplyLeft( fMatrix );
387 //printf("\n4: modif=quasi,manca il Gsv-1...\n");fSensVolModifMatrix->Print();
389 // 5) set fSensVolModif = Gsv-1 * Gg * Dg * Gg-1 * Gsv
390 if (SensVolMatrix(voluid, &dg)) return NULL;
391 fSensVolModifMatrix->MultiplyLeft( &dg.Inverse() );
392 //printf("\n5: modif=finale\n");fSensVolModifMatrix->Print();
395 // 6) mo' fSensVolModif dovrebbe essere la Dsv(loc) t.c. G'sv = Gsv*Dsv(loc)
396 // per trasformarla in Dsv(loc rispetto al Gsv0, non modificato) dovrebbe essere:
397 // Dsv(loc) -> Dpre * Dsv(loc) * Dpre-1
398 //TGeoHMatrix dpre; // dpre = Gsv0-1*Gsv
399 //if (SensVolOrigGlobalMatrix(voluid, &dg)) return NULL;
400 //if (SensVolMatrix(voluid, &dpre)) return NULL;
401 //dpre.MultiplyLeft( &dg.Inverse() );
402 //fSensVolModifMatrix->Multiply( &dpre.Inverse() );
403 //fSensVolModifMatrix->MultiplyLeft( &dpre );
404 // direi che NON FUNZIONA!!!!
408 // reset align object (may not be needed...)
409 fgTempAlignObj.SetVolUID(0);
410 fgTempAlignObj.SetSymName("");
411 fgTempAlignObj.SetTranslation(0,0,0);
412 fgTempAlignObj.SetRotation(0,0,0);
416 // correction for SPD y-shift
417 if (voluid>=2048 && voluid<4256) {
419 double dy[3]={0.,0.0081,0.};
420 deltay.SetTranslation(dy);
421 fSensVolModifMatrix->MultiplyLeft( &deltay );
422 fSensVolModifMatrix->Multiply( &deltay.Inverse() );
426 if (!fgTempAlignObj.SetMatrix(*fSensVolModifMatrix)) return NULL;
427 fgTempAlignObj.SetVolUID(voluid);
428 fgTempAlignObj.SetSymName(AliGeomManager::SymName(voluid));
430 return &fgTempAlignObj;
434 //-------------------------------------------------------------
435 AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeTotalMisalignment(UShort_t voluid, Double_t *deltalocal)
437 // calculate misalignment of sens.vol. 'voluid' according with a displacement 'deltalocal'
438 // of the mother volume. The misalignment is returned as AliAlignObjParams object including
439 // the (evenctual) prealignment => no merging needed
441 if (!IsIn(voluid)) return NULL;
442 if (!gGeoManager) return NULL;
444 // prepare the TGeoHMatrix
445 Double_t tr[3],ang[3];
446 tr[0]=deltalocal[0]; // in centimeter
449 ang[0]=deltalocal[3]; // psi (X) in deg
450 ang[1]=deltalocal[4]; // theta (Y)
451 ang[2]=deltalocal[5]; // phi (Z)
453 // reset align object (may not be needed...)
454 fgTempAlignObj.SetVolUID(0);
455 fgTempAlignObj.SetSymName("");
456 fgTempAlignObj.SetRotation(ang[0],ang[1],ang[2]);
457 fgTempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);
458 AliDebug(3,Form("Delta angles: psi=%f theta=%f phi=%f",ang[0],ang[1],ang[2]));
460 // Gsv = Gg * Gg-1 * Gsv -> Lsv,g = Gg-1 * Gsv
461 // G'sv = Gg * Dg * Lsv,g === DGsv * Gsv
463 // => Dsv = (G0sv-1 * Gg * Dg * Gg-1 * GMsv) //
466 // prepare the Delta matrix Dg
468 fgTempAlignObj.GetMatrix(dg);
471 // 1) start setting fSensVolModif = Gsv
472 if (SensVolMatrix(voluid, fSensVolModifMatrix)) return NULL;
473 //printf("\n1: modif=orig del sensvol\n");fSensVolModifMatrix->Print();
475 // 2) set fSensVolModif = Gg-1 * Gsv
476 fSensVolModifMatrix->MultiplyLeft( &fMatrix->Inverse() );
477 //printf("\n2: modif=relative del sensvol\n");fSensVolModifMatrix->Print();
479 // 3) set fSensVolModif = Dg * Gg-1 * Gsv
480 fSensVolModifMatrix->MultiplyLeft( &dg );
481 //printf("\n3: modif= delta*relative\n");fSensVolModifMatrix->Print();
483 // 4) set fSensVolModif = Gg * Dg * Gg-1 * Gsv
484 fSensVolModifMatrix->MultiplyLeft( fMatrix );
485 //printf("\n4: modif=quasi,manca il Gsv-1...\n");fSensVolModifMatrix->Print();
487 // 5) set fSensVolModif = G0sv-1 * Gg * Dg * Gg-1 * Gsv
488 // qui usa l'orig anziche' la prealigned...
489 if (SensVolOrigGlobalMatrix(voluid, &dg)) return NULL;
490 fSensVolModifMatrix->MultiplyLeft( &dg.Inverse() );
491 //printf("\n5: modif=finale\n");fSensVolModifMatrix->Print();
493 // reset align object (may not be needed...)
494 fgTempAlignObj.SetVolUID(0);
495 fgTempAlignObj.SetSymName("");
496 fgTempAlignObj.SetTranslation(0,0,0);
497 fgTempAlignObj.SetRotation(0,0,0);
500 // correction for SPD y-shift
501 if (voluid>=2048 && voluid<4256) {
503 double dy[3]={0.,0.0081,0.};
504 deltay.SetTranslation(dy);
505 fSensVolModifMatrix->MultiplyLeft( &deltay );
506 fSensVolModifMatrix->Multiply( &deltay.Inverse() );
509 if (!fgTempAlignObj.SetMatrix(*fSensVolModifMatrix)) return NULL;
510 fgTempAlignObj.SetVolUID(voluid);
511 fgTempAlignObj.SetSymName(AliGeomManager::SymName(voluid));
514 //fgTempAlignObj.Print("");
516 return &fgTempAlignObj;
518 //-------------------------------------------------------------
520 //-------------------------------------------------------------
521 AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeGlobalMisalignment(UShort_t voluid, Double_t *deltalocal)
523 // calculate misalignment of sens.vol. 'voluid' according with a displacement 'deltalocal'
524 // of the mother volume. The misalignment is returned as AliAlignObjParams object
526 if (!IsIn(voluid)) return NULL;
527 if (!gGeoManager) return NULL;
529 // prepare the TGeoHMatrix
530 Double_t tr[3],ang[3];
531 tr[0]=deltalocal[0]; // in centimeter
534 ang[0]=deltalocal[3]; // psi (X) in deg
535 ang[1]=deltalocal[4]; // theta (Y)
536 ang[2]=deltalocal[5]; // phi (Z)
538 // reset align object (may not be needed...)
539 fgTempAlignObj.SetTranslation(0,0,0);
540 fgTempAlignObj.SetRotation(0,0,0);
542 fgTempAlignObj.SetRotation(ang[0],ang[1],ang[2]);
543 fgTempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);
544 AliDebug(3,Form("Delta angles: psi=%f theta=%f phi=%f",ang[0],ang[1],ang[2]));
546 // Gsv = Gg * Gg-1 * Gsv -> Lsv,g = Gg-1 * Gsv
547 // G'sv = Gg * Dg * Lsv,g === DGsv * Gsv
549 // => DGsv = (Gg * Dg * Gg-1)
552 // prepare the Delta matrix Dg
554 fgTempAlignObj.GetMatrix(dg);
557 dg.MultiplyLeft( fMatrix );
558 dg.Multiply( &fMatrix->Inverse() );
560 // reset align object (may not be needed...)
561 fgTempAlignObj.SetTranslation(0,0,0);
562 fgTempAlignObj.SetRotation(0,0,0);
564 fgTempAlignObj.SetVolUID(voluid);
565 fgTempAlignObj.SetSymName(AliGeomManager::SymName(voluid));
567 if (!fgTempAlignObj.SetMatrix(dg)) return NULL;
569 //fgTempAlignObj.Print("");
571 return &fgTempAlignObj;
575 //-------------------------------------------------------------
576 TGeoHMatrix *AliITSAlignMille2Module::GetSensitiveVolumeMatrix(UShort_t voluid)
578 // return TGeoHMatrix of the sens.vol. 'voluid' in the current geometry
579 if (SensVolMatrix(voluid,fSensVolMatrix)) return NULL;
580 return fSensVolMatrix;
583 //-------------------------------------------------------------
584 TGeoHMatrix *AliITSAlignMille2Module::GetSensitiveVolumeOrigGlobalMatrix(UShort_t voluid)
586 // return original ideal position (from AliGeomManager::GetOrigGlobalMatrix())
587 if (SensVolOrigGlobalMatrix(voluid,fSensVolMatrix)) return NULL;
588 return fSensVolMatrix;
590 //-------------------------------------------------------------
591 Int_t AliITSAlignMille2Module::SensVolMatrix(UShort_t volid, TGeoHMatrix *m)
593 // set matrix for sensitive modules (SPD corrected)
594 // return 0 if success
596 Int_t idx=GetIndexFromVolumeID(volid);
597 if (idx<0) return -1;
598 if (!AliITSgeomTGeo::GetRotation(idx,rot)) return -2;
600 Double_t oLoc[3]={0,0,0};
601 Double_t oGlo[3]={0,0,0};
602 if (!AliITSgeomTGeo::LocalToGlobal(idx,oLoc,oGlo)) return -3;
603 m->SetTranslation(oGlo);
607 //-------------------------------------------------------------
608 Int_t AliITSAlignMille2Module::SensVolOrigGlobalMatrix(UShort_t volid, TGeoHMatrix *m)
610 // set original global matrix for sensitive modules (SPD corrected)
611 // return 0 if success
612 Int_t idx=GetIndexFromVolumeID(volid);
613 if (idx<0) return -1;
615 if (!AliGeomManager::GetOrigGlobalMatrix(AliGeomManager::SymName(volid),mo)) (*m)=mo;
618 // SPD y-shift by 81 mu
620 Double_t oLoc[3]={0.0,0.0081,0.0};
621 Double_t oGlo[3]={0,0,0};
622 m->LocalToMaster(oLoc,oGlo);
623 m->SetTranslation(oGlo);
629 //-------------------------------------------------------------
630 UShort_t AliITSAlignMille2Module::GetVolumeIDFromSymname(const Char_t *symname) {
631 /// volume ID from symname
632 if (!symname) return 0;
634 for (UShort_t voluid=2000; voluid<13300; voluid++) {
636 AliGeomManager::ELayerID layerId = AliGeomManager::VolUIDToLayer(voluid,modId);
637 if (layerId>0 && layerId<7 && modId>=0 && modId<AliGeomManager::LayerSize(layerId)) {
638 if (!strcmp(symname,AliGeomManager::SymName(layerId,modId))) return voluid;
645 //-------------------------------------------------------------
646 UShort_t AliITSAlignMille2Module::GetVolumeIDFromIndex(Int_t index) {
647 /// volume ID from index
648 if (index<0 || index>2197) return 0;
649 return GetVolumeIDFromSymname(AliITSgeomTGeo::GetSymName(index));
652 //-------------------------------------------------------------
653 void AliITSAlignMille2Module::Print(Option_t*) const
656 printf("*** ITS SuperModule for AliITSAlignMille ***\n");
657 printf("symname : %s\n",GetName());
658 printf("parent : %s\n",fParent ? fParent->GetName() : "N/A");
659 printf("volumeID : %4d | index : %4d\n",fVolumeID,fIndex);
660 printf("Factors : X=%.2f Y=%.2f Z=%.2f | DOF: Tx:%d Ty:%d Tz:%d Phi:%d Theta:%d Psi:%d\n",
661 fSigmaFactor[0],fSigmaFactor[1],fSigmaFactor[2],
662 IsFreeDOF(AliITSAlignMille2::kDOFTX),IsFreeDOF(AliITSAlignMille2::kDOFTY),
663 IsFreeDOF(AliITSAlignMille2::kDOFTZ),IsFreeDOF(AliITSAlignMille2::kDOFPH),
664 IsFreeDOF(AliITSAlignMille2::kDOFTH),IsFreeDOF(AliITSAlignMille2::kDOFPS));
666 printf("%4d Sensitive volumes | %6d Processed Points\n",fNSensVol,fNProcPoints);
667 for (Int_t i=0; i<fNSensVol; i++) printf(" voluid[%d] = %d\n",i,UShort_t(fSensVolVolumeID[i]));
670 //-------------------------------------------------------------
671 Bool_t AliITSAlignMille2Module::IsAlignable() const
673 TGeoManager* geoManager = AliGeomManager::GetGeometry();
675 AliInfo("Couldn't initialize geometry");
678 return geoManager->GetAlignableEntry(GetName())!=0;
681 //-------------------------------------------------------------
682 void AliITSAlignMille2Module::GetLocalMatrix(TGeoHMatrix &mat) const
684 // return the local matrix for transformation to its parent
686 if (fParent) mat.MultiplyLeft( &fParent->GetMatrix()->Inverse() );