1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////
17 // AliITSUGeomTGeo is a simple interface class to TGeoManager //
18 // It is used in the simulation and reconstruction in order to //
19 // query the TGeo ITS geometry //
21 // author - cvetan.cheshkov@cern.ch //
23 // adapted to ITSupg 18/07/2012 - ruben.shahoyan@cern.ch //
25 // ATTENTION: In opposite to ols AliITSgeomTGeo, all indices start //
26 // from 0, not from 1!!! //
28 ///////////////////////////////////////////////////////////////////////////
32 #include <TGeoManager.h>
33 #include <TGeoPhysicalNode.h>
38 #include "AliITSUGeomTGeo.h"
40 #include "AliAlignObj.h"
41 #include "AliITSsegmentation.h"
42 #include "AliITSUSegmentationPix.h"
43 using namespace TMath;
45 ClassImp(AliITSUGeomTGeo)
48 const char* AliITSUGeomTGeo::fgkITSVolName = "ITSV";
49 const char* AliITSUGeomTGeo::fgkITSLrName = "ITSULayer";
50 const char* AliITSUGeomTGeo::fgkITSLadName = "ITSULadder";
51 const char* AliITSUGeomTGeo::fgkITSModName = "ITSUModule";
52 const char* AliITSUGeomTGeo::fgkITSSensName ="ITSUSensor";
53 const char* AliITSUGeomTGeo::fgkITSDetTypeName[AliITSUGeomTGeo::kNDetTypes] = {"Pix"};
55 TString AliITSUGeomTGeo::fgITSsegmFileName = "itsSegmentations.root";
57 //______________________________________________________________________
58 AliITSUGeomTGeo::AliITSUGeomTGeo(Bool_t build, Bool_t loadSegm)
71 if (build) BuildITS(loadSegm);
74 //______________________________________________________________________
75 AliITSUGeomTGeo::AliITSUGeomTGeo(const AliITSUGeomTGeo &src)
77 ,fVersion(src.fVersion)
78 ,fNLayers(src.fNLayers)
79 ,fNModules(src.fNModules)
90 fNLadders = new Int_t[fNLayers];
91 fNDetectors = new Int_t[fNLayers];
92 fLrDetType = new Int_t[fNLayers];
93 fLastModIndex = new Int_t[fNLayers];
94 for (int i=fNLayers;i--;) {
95 fNLadders[i] = src.fNLadders[i];
96 fNDetectors[i] = src.fNDetectors[i];
97 fLrDetType[i] = src.fLrDetType[i];
98 fLastModIndex[i] = src.fLastModIndex[i];
101 fMatSens = new TObjArray(fNModules);
102 fMatSens->SetOwner(kTRUE);
103 for (int i=0;i<fNModules;i++) {
104 const TGeoHMatrix* mat = (TGeoHMatrix*)src.fMatSens->At(i);
105 fMatSens->AddAt(new TGeoHMatrix(*mat),i);
109 fMatT2L = new TObjArray(fNModules);
110 fMatT2L->SetOwner(kTRUE);
111 for (int i=0;i<fNModules;i++) {
112 const TGeoHMatrix* mat =(TGeoHMatrix*) src.fMatT2L->At(i);
113 fMatT2L->AddAt(new TGeoHMatrix(*mat),i);
117 int sz = src.fSegm->GetEntriesFast();
118 fSegm = new TObjArray(sz);
119 fSegm->SetOwner(kTRUE);
120 for (int i=0;i<sz;i++) {
121 AliITSsegmentation* sg = (AliITSsegmentation*)src.fSegm->UncheckedAt(i);
123 fSegm->AddAt(sg->Clone(),i);
129 //______________________________________________________________________
130 AliITSUGeomTGeo::~AliITSUGeomTGeo()
135 delete[] fNDetectors;
136 delete[] fLastModIndex;
143 //______________________________________________________________________
144 AliITSUGeomTGeo& AliITSUGeomTGeo::operator=(const AliITSUGeomTGeo &src)
150 delete[] fNDetectors;
151 delete[] fLastModIndex;
152 fNLadders = fLrDetType = fNDetectors = fLastModIndex = 0;
153 fVersion = src.fVersion;
154 fNLayers = src.fNLayers;
155 fNModules = src.fNModules;
158 fMatSens = new TObjArray(fNModules);
159 fMatSens->SetOwner(kTRUE);
160 for (int i=0;i<fNModules;i++) {
161 const TGeoHMatrix* mat = (TGeoHMatrix*) src.fMatSens->At(i);
162 fMatSens->AddAt(new TGeoHMatrix(*mat),i);
167 fMatT2L = new TObjArray(fNModules);
168 fMatT2L->SetOwner(kTRUE);
169 for (int i=0;i<fNModules;i++) {
170 const TGeoHMatrix* mat = (TGeoHMatrix*) src.fMatT2L->At(i);
171 fMatT2L->AddAt(new TGeoHMatrix(*mat),i);
175 int sz = src.fSegm->GetEntriesFast();
176 fSegm = new TObjArray(sz);
177 fSegm->SetOwner(kTRUE);
178 for (int i=0;i<sz;i++) {
179 AliITSsegmentation* sg = (AliITSsegmentation*)src.fSegm->UncheckedAt(i);
181 fSegm->AddAt(sg->Clone(),i);
186 fNLadders = new Int_t[fNLayers];
187 fNDetectors = new Int_t[fNLayers];
188 fLrDetType = new Int_t[fNLayers];
189 fLastModIndex = new Int_t[fNLayers];
190 for (int i=fNLayers;i--;) {
191 fNLadders[i] = src.fNLadders[i];
192 fNDetectors[i] = src.fNDetectors[i];
193 fLrDetType[i] = src.fLrDetType[i];
194 fLastModIndex[i] = src.fLastModIndex[i];
201 //______________________________________________________________________
202 Int_t AliITSUGeomTGeo::GetModuleIndex(Int_t lay,Int_t lad,Int_t det) const
204 // This routine computes the module index number from the layer,
205 // ladder, and detector numbers. The number of ladders and detectors
206 // per layer is set statically
207 // see above for details.
209 // Int_t lay The layer number. Starting from 0.
210 // Int_t lad The ladder number. Starting from 0
211 // Int_t det The detector number in the ladder. Starting from 0
213 return GetFirstModIndex(lay) + fNDetectors[lay]*lad + det;
216 //______________________________________________________________________
217 Bool_t AliITSUGeomTGeo::GetLayer(Int_t index,Int_t &lay,Int_t &index2) const
219 // This routine computes the layer number for a
220 // given the module index. The
222 // Int_t index The module index number, starting from zero.
224 // Int_t index2 The module index inside a layer, starting from zero.
225 // Int_t lay The layer number. Starting from 0.
227 lay = GetLayer(index);
228 index2 = index - GetFirstModIndex(lay);
233 //______________________________________________________________________
234 Int_t AliITSUGeomTGeo::GetLayer(Int_t index) const
236 // Get module layer, from 0
239 while(index>fLastModIndex[lay]) lay++;
243 //______________________________________________________________________
244 Int_t AliITSUGeomTGeo::GetLadder(Int_t index) const
246 // Get module ladder, from 0
249 while(index>fLastModIndex[lay]) lay++;
250 index -= GetFirstModIndex(lay);
251 return index/fNDetectors[lay];
254 //______________________________________________________________________
255 Int_t AliITSUGeomTGeo::GetModIdInLayer(Int_t index) const
257 // Get module number within layer, from 0
260 while(index>fLastModIndex[lay]) lay++;
261 index -= GetFirstModIndex(lay);
265 //______________________________________________________________________
266 Int_t AliITSUGeomTGeo::GetModIdInLadder(Int_t index) const
268 // Get module number within ladder, from 0
271 while(index>fLastModIndex[lay]) lay++;
272 index -= GetFirstModIndex(lay);
273 return index%fNDetectors[lay];
276 //______________________________________________________________________
277 Bool_t AliITSUGeomTGeo::GetModuleId(Int_t index,Int_t &lay,Int_t &lad,Int_t &det) const
279 // The method is taken from the old AliITSgeom class by Bjorn Nilsen
281 // This routine computes the layer, ladder and detector number
282 // given the module index number.
284 // Int_t index The module index number, starting from zero.
286 // Int_t lay The layer number. Starting from 0
287 // Int_t lad The ladder number. Starting from 0
288 // Int_t det The detector number. Starting from 0
290 lay = GetLayer(index);
291 index -= GetFirstModIndex(lay);
292 lad = index/fNDetectors[lay];
293 det = index%fNDetectors[lay];
297 //______________________________________________________________________
298 const char* AliITSUGeomTGeo::GetSymName(Int_t index) const
300 // Get the TGeoPNEntry symbolic name
301 // for a given module identified by 'index'
304 if (!GetLayer(index,lay,index2)) return NULL;
305 // return AliGeomManager::SymName((AliGeomManager::ELayerID)((lay-1)+AliGeomManager::kSPD1),index2);
306 // RS: this is not optimal, but we cannod access directly AliGeomManager, since the latter has hardwired layers
307 // TGeoPNEntry* pne = gGeoManager->GetAlignableEntryByUID( AliGeomManager::LayerToVolUID(lay+1,index2) );
308 TGeoPNEntry* pne = gGeoManager->GetAlignableEntryByUID( ModuleVolUID(index) );
310 AliError(Form("Failed to find alignable entry with index %d: (Lr%d Mod:%d) !",index,lay,index2));
313 return pne->GetName();
316 //______________________________________________________________________
317 const char* AliITSUGeomTGeo::ComposeSymNameITS()
319 // sym name of the layer
323 //______________________________________________________________________
324 const char* AliITSUGeomTGeo::ComposeSymNameLayer(Int_t lr)
326 // sym name of the layer
327 return Form("%s/%s%d",ComposeSymNameITS(),GetITSLayerPattern(),lr);
330 //______________________________________________________________________
331 const char* AliITSUGeomTGeo::ComposeSymNameLadder(Int_t lr, Int_t ladder)
333 // sym name of the ladder at given layer
334 return Form("%s/%s%d",ComposeSymNameLayer(lr),GetITSLadderPattern(),ladder);
337 //______________________________________________________________________
338 const char* AliITSUGeomTGeo::ComposeSymNameModule(Int_t lr, Int_t lad, int det)
340 // sym name of the module
341 return Form("%s/%s%d",ComposeSymNameLadder(lr,lad),GetITSModulePattern(),det);
344 //______________________________________________________________________
345 TGeoHMatrix* AliITSUGeomTGeo::GetMatrix(Int_t index) const
347 // Get the transformation matrix for a given module 'index'
348 // by quering the TGeoManager
349 TGeoPNEntry *pne = GetPNEntry(index);
350 if (!pne) return NULL;
352 TGeoPhysicalNode *pnode = pne->GetPhysicalNode();
353 if (pnode) return pnode->GetMatrix();
355 const char* path = pne->GetTitle();
356 gGeoManager->PushPath(); // Preserve the modeler state.
357 if (!gGeoManager->cd(path)) {
358 gGeoManager->PopPath();
359 AliError(Form("Volume path %s not valid!",path));
362 TGeoHMatrix *mat = gGeoManager->GetCurrentMatrix();
363 gGeoManager->PopPath();
367 //______________________________________________________________________
368 Bool_t AliITSUGeomTGeo::GetTranslation(Int_t index, Double_t t[3]) const
370 // Get the translation vector for a given module 'index'
371 // by quering the TGeoManager
372 TGeoHMatrix *m = GetMatrix(index);
373 if (!m) return kFALSE;
375 Double_t *trans = m->GetTranslation();
376 for (Int_t i = 0; i < 3; i++) t[i] = trans[i];
381 //______________________________________________________________________
382 Bool_t AliITSUGeomTGeo::GetRotation(Int_t index, Double_t r[9]) const
384 // Get the rotation matrix for a given module 'index'
385 // by quering the TGeoManager
386 TGeoHMatrix *m = GetMatrix(index);
387 if (!m) return kFALSE;
389 Double_t *rot = m->GetRotationMatrix();
390 for (Int_t i = 0; i < 9; i++) r[i] = rot[i];
395 //______________________________________________________________________
396 Bool_t AliITSUGeomTGeo::GetOrigMatrix(Int_t index, TGeoHMatrix &m) const
398 // Get the original (ideal geometry) TGeo matrix for
399 // a given module identified by 'index'.
400 // The method is slow, so it should be used
404 const char *symname = GetSymName(index);
405 if (!symname) return kFALSE;
407 return AliGeomManager::GetOrigGlobalMatrix(symname,m);
410 //______________________________________________________________________
411 Bool_t AliITSUGeomTGeo::GetOrigTranslation(Int_t index, Double_t t[3]) const
413 // Get the original translation vector (ideal geometry)
414 // for a given module 'index' by quering the TGeoManager
416 if (!GetOrigMatrix(index,m)) return kFALSE;
418 Double_t *trans = m.GetTranslation();
419 for (Int_t i = 0; i < 3; i++) t[i] = trans[i];
424 //______________________________________________________________________
425 Bool_t AliITSUGeomTGeo::GetOrigRotation(Int_t index, Double_t r[9]) const
427 // Get the original rotation matrix (ideal geometry)
428 // for a given module 'index' by quering the TGeoManager
430 if (!GetOrigMatrix(index,m)) return kFALSE;
432 Double_t *rot = m.GetRotationMatrix();
433 for (Int_t i = 0; i < 9; i++) r[i] = rot[i];
438 //______________________________________________________________________
439 TGeoHMatrix* AliITSUGeomTGeo::ExtractMatrixT2L(Int_t index) const
441 // Get the matrix which transforms from the tracking to local r.s.
442 // The method queries directly the TGeoPNEntry
443 TGeoPNEntry *pne = GetPNEntry(index);
444 if (!pne) return NULL;
446 TGeoHMatrix *m = (TGeoHMatrix*) pne->GetMatrix();
447 if (!m) AliError(Form("TGeoPNEntry (%s) contains no matrix !",pne->GetName()));
452 //______________________________________________________________________
453 Bool_t AliITSUGeomTGeo::GetTrackingMatrix(Int_t index, TGeoHMatrix &m)
455 // Get the matrix which transforms from the tracking r.s. to
457 // Returns kFALSE in case of error.
460 TGeoHMatrix *m1 = GetMatrix(index);
461 if (!m1) return kFALSE;
463 const TGeoHMatrix *m2 = GetMatrixT2L(index);
464 if (!m2) return kFALSE;
472 //______________________________________________________________________
473 TGeoHMatrix* AliITSUGeomTGeo::ExtractMatrixSens(Int_t index) const
475 // Get the transformation matrix of the SENSOR (not ncessary the same as the module)
476 // for a given module 'index' by quering the TGeoManager
477 const TString kPathBase = Form("/ALIC_1/%s_2/",AliITSUGeomTGeo::GetITSVolPattern());
478 const TString kNames = Form("%%s%s%%d_1/%s%%d_%%d/%s%%d_%%d/%s%%d_%%d"
479 ,AliITSUGeomTGeo::GetITSLayerPattern()
480 ,AliITSUGeomTGeo::GetITSLadderPattern()
481 ,AliITSUGeomTGeo::GetITSModulePattern()
482 ,AliITSUGeomTGeo::GetITSSensorPattern());
484 Int_t lay,ladd,detInLad;
485 GetModuleId(index,lay,ladd,detInLad);
487 path.Form(kNames.Data(),kPathBase.Data(),lay,lay,ladd,lay,detInLad,lay,1);
488 gGeoManager->PushPath();
489 if (!gGeoManager->cd(path.Data())) {
490 gGeoManager->PopPath();
491 AliError(Form("Error in cd-ing to %s",path.Data()));
493 } // end if !gGeoManager
494 TGeoHMatrix* mat = gGeoManager->GetCurrentMatrix();
496 // printf("%d/%d/%d %s\n",lay,ladd,detInLad,path.Data());
498 // Retstore the modeler state.
499 gGeoManager->PopPath();
504 //______________________________________________________________________
505 TGeoPNEntry* AliITSUGeomTGeo::GetPNEntry(Int_t index) const
507 // Get a pointer to the TGeoPNEntry of a module
508 // identified by 'index'
509 // Returns NULL in case of invalid index,
510 // missing TGeoManager or invalid symbolic name
512 if (index >= fNModules) {
513 AliError(Form("Invalid ITS module index: %d (0 -> %d) !",index,fNModules));
517 if (!gGeoManager || !gGeoManager->IsClosed()) {
518 AliError("Can't get the matrix! gGeoManager doesn't exist or it is still opened!");
522 TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(GetSymName(index));
523 if (!pne) AliError(Form("The symbolic volume name %s does not correspond to a physical entry!",GetSymName(index)));
528 //______________________________________________________________________
529 void AliITSUGeomTGeo::BuildITS(Bool_t loadSegm)
531 // exract upg ITS parameters from TGeo
532 if (fVersion!=kITSVNA) {AliWarning("Already built"); return; // already initialized}
533 if (!gGeoManager) AliFatal("Geometry is not loaded");
535 fNLayers = ExtractNumberOfLayers();
536 if (!fNLayers) return;
538 fNLadders = new Int_t[fNLayers];
539 fNDetectors = new Int_t[fNLayers];
540 fLrDetType = new Int_t[fNLayers];
541 fLastModIndex = new Int_t[fNLayers];
543 for (int i=0;i<fNLayers;i++) {
544 fNLadders[i] = ExtractNumberOfLadders(i);
545 fNDetectors[i] = ExtractNumberOfDetectors(i);
546 fLrDetType[i] = ExtractLayerDetType(i);
547 fNModules += fNLadders[i]*fNDetectors[i];
548 fLastModIndex[i] = fNModules-1;
554 if (loadSegm) { // fetch segmentations
555 fSegm = new TObjArray();
556 AliITSUSegmentationPix::LoadSegmentations(fSegm,GetITSsegmentationFileName());
561 //______________________________________________________________________
562 Int_t AliITSUGeomTGeo::ExtractNumberOfLayers() const
564 // Determines the number of layers in the Upgrade Geometry
566 Int_t numberOfLayers = 0;
568 TGeoVolume *itsV = gGeoManager->GetVolume(fgkITSVolName);
569 if (!itsV) AliFatal(Form("ITS volume %s is not in the geometry",fgkITSVolName));
571 // Loop on all ITSV nodes, count Layer volumes by checking names
572 Int_t nNodes = itsV->GetNodes()->GetEntries();
573 for (Int_t j=0; j<nNodes; j++) if (strstr(itsV->GetNodes()->At(j)->GetName(),fgkITSLrName)) numberOfLayers++;
575 return numberOfLayers;
578 //______________________________________________________________________
579 Int_t AliITSUGeomTGeo::ExtractNumberOfLadders(Int_t lay) const
581 // Determines the number of layers in the Upgrade Geometry
584 // lay: layer number, starting from 0
587 Int_t numberOfLadders = 0;
589 snprintf(laynam, 30, "%s%d",fgkITSLrName,lay);
590 TGeoVolume* volLr = gGeoManager->GetVolume(laynam);
591 if (!volLr) AliFatal(Form("can't find %s volume",laynam));
593 // Loop on all layer nodes, count Ladder volumes by checking names
594 Int_t nNodes = volLr->GetNodes()->GetEntries();
595 for (Int_t j=0; j<nNodes; j++) if (strstr(volLr->GetNodes()->At(j)->GetName(),fgkITSLadName)) numberOfLadders++;
597 return numberOfLadders;
601 //______________________________________________________________________
602 Int_t AliITSUGeomTGeo::ExtractNumberOfDetectors(Int_t lay) const
604 // Determines the number of detectors per ladder in the Upgrade Geometry
607 // lay: layer number from 0
609 Int_t numberOfModules = 0;
611 snprintf(laddnam, 30, "%s%d", fgkITSLadName,lay);
612 TGeoVolume* volLd = gGeoManager->GetVolume(laddnam);
613 if (!volLd) AliFatal(Form("can't find %s volume",laddnam));
615 // Loop on all ladder nodes, count Module volumes by checking names
616 Int_t nNodes = volLd->GetNodes()->GetEntries();
617 for (Int_t j=0; j<nNodes; j++) if (strstr(volLd->GetNodes()->At(j)->GetName(),fgkITSModName)) numberOfModules++;
619 return numberOfModules;
623 //______________________________________________________________________
624 Int_t AliITSUGeomTGeo::ExtractLayerDetType(Int_t lay) const
626 // Determines the layer detector type the Upgrade Geometry
629 // lay: layer number from 0
633 // detector type id for the layer
636 snprintf(laddnam, 30, "%s%d", fgkITSLrName,lay);
637 TGeoVolume* volLd = gGeoManager->GetVolume(laddnam);
638 if (!volLd) {AliFatal(Form("can't find %s volume",laddnam)); return -1;}
640 return volLd->GetUniqueID();
644 //______________________________________________________________________
645 UInt_t AliITSUGeomTGeo::ComposeDetTypeID(UInt_t segmId)
647 if (segmId>=kMaxSegmPerDetType) AliFatalClass(Form("Id=%d is >= max.allowed %d",segmId,kMaxSegmPerDetType));
648 return segmId + kDetTypePix*kMaxSegmPerDetType;
651 //______________________________________________________________________
652 void AliITSUGeomTGeo::Print(Option_t *) const
655 printf("Geometry version %d, NLayers:%d NModules:%d\n",fVersion,fNLayers,fNModules);
656 if (fVersion==kITSVNA) return;
657 for (int i=0;i<fNLayers;i++) {
658 printf("Lr%2d\tNLadd:%2d\tNDet:%2d\tDetType:%3d\tMod#:%4d:%4d\n",
659 i,fNLadders[i],fNDetectors[i],fLrDetType[i],GetFirstModIndex(i),GetLastModIndex(i));
663 //______________________________________________________________________
664 void AliITSUGeomTGeo::FetchMatrices()
666 // store pointer on often used matrices for faster access
667 if (!gGeoManager) AliFatal("Geometry is not loaded");
668 fMatSens = new TObjArray(fNModules);
669 fMatSens->SetOwner(kTRUE);
670 for (int i=0;i<fNModules;i++) fMatSens->AddAt(new TGeoHMatrix(*ExtractMatrixSens(i)),i);
674 //______________________________________________________________________
675 void AliITSUGeomTGeo::CreateT2LMatrices()
677 // create tracking to local (Sensor!) matrices
678 fMatT2L = new TObjArray(fNModules);
679 fMatT2L->SetOwner(kTRUE);
681 double loc[3]={0,0,0},glo[3];
683 for (int isn=0;isn<fNModules;isn++) {
684 const TGeoHMatrix* matSens = GetMatrixSens(isn);
685 if (!matSens) {AliFatal(Form("Failed to get matrix for sensor %d",isn)); return;}
686 matSens->LocalToMaster(loc,glo);
687 rotm = matSens->GetRotationMatrix();
688 Double_t al = -ATan2(rotm[1],rotm[0]);
689 double sn=Sin(al), cs=Cos(al), r=glo[0]*sn-glo[1]*cs, x=r*sn, y=-r*cs; // sensor plane PCA to origin
690 TGeoHMatrix* t2l = new TGeoHMatrix();
691 t2l->RotateZ(ATan2(y,x)*RadToDeg()); // rotate in direction of normal to the sensor plane
694 t2l->MultiplyLeft(&matSens->Inverse());
695 fMatT2L->AddAt(t2l,isn);
697 const double *gtrans = matSens->GetTranslation();
698 memcpy(&rotMatrix[0], matSens->GetRotationMatrix(), 9*sizeof(Double_t));
699 Double_t al = -ATan2(rotMatrix[1],rotMatrix[0]);
700 Double_t rSens = Sqrt(gtrans[0]*gtrans[0] + gtrans[1]*gtrans[1]);
701 Double_t tanAl = ATan2(gtrans[1],gtrans[0]) - Pi()/2; //angle of tangent
702 Double_t alTr = tanAl - al;
704 // The X axis of tracking frame must always look outward
706 matSens->LocalToMaster(loc,glo);
707 double rPos = Sqrt(glo[0]*glo[0] + glo[1]*glo[1]);
708 Bool_t rotOutward = rPos>rSens ? kFALSE : kTRUE;
710 // Transformation matrix
712 matLtoT.SetDx(-rSens*Sin(alTr)); // translation
714 matLtoT.SetDz(gtrans[2]);
716 rotMatrix[0]= 0; rotMatrix[1]= 1; rotMatrix[2]= 0; // + rotation
717 rotMatrix[3]=-1; rotMatrix[4]= 0; rotMatrix[5]= 0;
718 rotMatrix[6]= 0; rotMatrix[7]= 0; rotMatrix[8]= 1;
721 rot.SetMatrix(rotMatrix);
722 matLtoT.MultiplyLeft(&rot);
723 if (rotOutward) matLtoT.RotateZ(180.);
724 // Inverse transformation Matrix
725 fMatT2L->AddAt(new TGeoHMatrix(matLtoT.Inverse()),isn);