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 // Implementation of the alignment object class, holding the alignment
18 // constants for a single volume, through the abstract class AliAlignObj.
19 // From it two derived concrete representation of alignment object class
20 // (AliAlignObjAngles, AliAlignObjMatrix) are derived in separate files.
21 //-----------------------------------------------------------------
22 #include <TGeoManager.h>
23 #include <TGeoPhysicalNode.h>
25 #include "AliAlignObj.h"
26 #include "AliTrackPointArray.h"
28 #include "AliAlignObjAngles.h"
32 Int_t AliAlignObj::fgLayerSize[kLastLayer - kFirstLayer] = {
33 80, 160, // ITS SPD first and second layer
34 84, 176, // ITS SDD first and second layer
35 748, 950, // ITS SSD first and second layer
36 36, 36, // TPC inner and outer chambers
37 90, 90, 90, 90, 90, 90, // 6 TRD chambers' layers
44 const char* AliAlignObj::fgLayerName[kLastLayer - kFirstLayer] = {
45 "ITS inner pixels layer", "ITS outer pixels layer",
46 "ITS inner drifts layer", "ITS outer drifts layer",
47 "ITS inner strips layer", "ITS outer strips layer",
48 "TPC inner chambers layer", "TPC outer chambers layer",
49 "TRD chambers layer 1", "TRD chambers layer 2", "TRD chambers layer 3",
50 "TRD chambers layer 4", "TRD chambers layer 5", "TRD chambers layer 6",
57 TString* AliAlignObj::fgVolPath[kLastLayer - kFirstLayer] = {
70 AliAlignObj** AliAlignObj::fgAlignObjs[kLastLayer - kFirstLayer] = {
83 //_____________________________________________________________________________
84 AliAlignObj::AliAlignObj():
88 // default constructor
92 //_____________________________________________________________________________
93 AliAlignObj::AliAlignObj(const char* symname, UShort_t voluid) :
98 // standard constructor
102 //_____________________________________________________________________________
103 AliAlignObj::AliAlignObj(const AliAlignObj& theAlignObj) :
104 TObject(theAlignObj),
105 fVolPath(theAlignObj.GetSymName()),
106 fVolUID(theAlignObj.GetVolUID())
111 //_____________________________________________________________________________
112 AliAlignObj &AliAlignObj::operator =(const AliAlignObj& theAlignObj)
114 // assignment operator
115 if(this==&theAlignObj) return *this;
116 fVolPath = theAlignObj.GetSymName();
117 fVolUID = theAlignObj.GetVolUID();
121 //_____________________________________________________________________________
122 AliAlignObj &AliAlignObj::operator*=(const AliAlignObj& theAlignObj)
124 // multiplication operator
125 // The operator can be used to 'combine'
126 // two alignment objects
130 theAlignObj.GetMatrix(m2);
131 m1.MultiplyLeft(&m2);
136 //_____________________________________________________________________________
137 AliAlignObj::~AliAlignObj()
142 //_____________________________________________________________________________
143 void AliAlignObj::SetVolUID(ELayerID detId, Int_t modId)
145 // From detector name and module number (according to detector numbering)
146 // build fVolUID, unique numerical identity of that volume inside ALICE
147 // fVolUID is 16 bits, first 5 reserved for detID (32 possible values),
148 // remaining 11 for module ID inside det (2048 possible values).
150 fVolUID = LayerToVolUID(detId,modId);
153 //_____________________________________________________________________________
154 void AliAlignObj::GetVolUID(ELayerID &layerId, Int_t &modId) const
156 // From the fVolUID, unique numerical identity of that volume inside ALICE,
157 // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
158 // remaining 11 for module ID inside det (2048 possible values)), sets
159 // the argument layerId to the identity of the layer to which that volume
160 // belongs and sets the argument modId to the identity of that volume
161 // internally to the layer.
163 layerId = VolUIDToLayer(fVolUID,modId);
166 //_____________________________________________________________________________
167 Bool_t AliAlignObj::GetPars(Double_t tr[], Double_t angles[]) const
170 return GetAngles(angles);
173 //_____________________________________________________________________________
174 Int_t AliAlignObj::GetLevel() const
176 // Return the geometry level of the alignable volume to which
177 // the alignment object is associated; this is the number of
178 // slashes in the corresponding volume path
181 AliWarning("gGeoManager doesn't exist or it is still opened: unable to return meaningful level value.");
184 const char* symname = GetSymName();
186 TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(symname);
188 path = pne->GetTitle();
193 TString path_str = path;
194 if(path_str[0]!='/') path_str.Prepend('/');
195 return path_str.CountChar('/');
198 //_____________________________________________________________________________
199 Int_t AliAlignObj::Compare(const TObject *obj) const
201 // Compare the levels of two
203 // Used in the sorting during
204 // the application of alignment
205 // objects to the geometry
207 Int_t level = GetLevel();
208 Int_t level2 = ((AliAlignObj *)obj)->GetLevel();
212 return ((level > level2) ? 1 : -1);
215 //_____________________________________________________________________________
216 void AliAlignObj::AnglesToMatrix(const Double_t *angles, Double_t *rot) const
218 // Calculates the rotation matrix using the
219 // Euler angles in "x y z" notation
221 Double_t degrad = TMath::DegToRad();
222 Double_t sinpsi = TMath::Sin(degrad*angles[0]);
223 Double_t cospsi = TMath::Cos(degrad*angles[0]);
224 Double_t sinthe = TMath::Sin(degrad*angles[1]);
225 Double_t costhe = TMath::Cos(degrad*angles[1]);
226 Double_t sinphi = TMath::Sin(degrad*angles[2]);
227 Double_t cosphi = TMath::Cos(degrad*angles[2]);
229 rot[0] = costhe*cosphi;
230 rot[1] = -costhe*sinphi;
232 rot[3] = sinpsi*sinthe*cosphi + cospsi*sinphi;
233 rot[4] = -sinpsi*sinthe*sinphi + cospsi*cosphi;
234 rot[5] = -costhe*sinpsi;
235 rot[6] = -cospsi*sinthe*cosphi + sinpsi*sinphi;
236 rot[7] = cospsi*sinthe*sinphi + sinpsi*cosphi;
237 rot[8] = costhe*cospsi;
240 //_____________________________________________________________________________
241 Bool_t AliAlignObj::MatrixToAngles(const Double_t *rot, Double_t *angles) const
243 // Calculates the Euler angles in "x y z" notation
244 // using the rotation matrix
245 // Returns false in case the rotation angles can not be
246 // extracted from the matrix
248 if(TMath::Abs(rot[0])<1e-7 || TMath::Abs(rot[8])<1e-7) {
249 AliError("Failed to extract roll-pitch-yall angles!");
252 Double_t raddeg = TMath::RadToDeg();
253 angles[0]=raddeg*TMath::ATan2(-rot[5],rot[8]);
254 angles[1]=raddeg*TMath::ASin(rot[2]);
255 angles[2]=raddeg*TMath::ATan2(-rot[1],rot[0]);
259 //______________________________________________________________________________
260 void AliAlignObj::Transform(AliTrackPoint &p) const
262 // The method transforms the space-point coordinates using the
263 // transformation matrix provided by the AliAlignObj
264 // The covariance matrix is not affected since we assume
265 // that the transformations are sufficiently small
267 if (fVolUID != p.GetVolumeID())
268 AliWarning(Form("Alignment object ID is not equal to the space-point ID (%d != %d)",fVolUID,p.GetVolumeID()));
272 Double_t *rot = m.GetRotationMatrix();
273 Double_t *tr = m.GetTranslation();
275 Float_t xyzin[3],xyzout[3];
277 for (Int_t i = 0; i < 3; i++)
286 //_____________________________________________________________________________
287 void AliAlignObj::Transform(AliTrackPointArray &array) const
289 // This method is used to transform all the track points
290 // from the input AliTrackPointArray
293 for (Int_t i = 0; i < array.GetNPoints(); i++) {
296 array.AddPoint(i,&p);
300 //_____________________________________________________________________________
301 void AliAlignObj::Print(Option_t *) const
303 // Print the contents of the
304 // alignment object in angles and
305 // matrix representations
313 const Double_t *rot = m.GetRotationMatrix();
315 printf("Volume=%s\n",GetSymName());
316 if (GetVolUID() != 0) {
319 GetVolUID(layerId,modId);
320 printf("VolumeID=%d LayerID=%d ( %s ) ModuleID=%d\n", GetVolUID(),layerId,LayerName(layerId),modId);
322 printf("%12.8f%12.8f%12.8f Tx = %12.8f Psi = %12.8f\n", rot[0], rot[1], rot[2], tr[0], angles[0]);
323 printf("%12.8f%12.8f%12.8f Ty = %12.8f Theta = %12.8f\n", rot[3], rot[4], rot[5], tr[1], angles[1]);
324 printf("%12.8f%12.8f%12.8f Tz = %12.8f Phi = %12.8f\n", rot[6], rot[7], rot[8], tr[2], angles[2]);
328 //_____________________________________________________________________________
329 Int_t AliAlignObj::LayerSize(Int_t layerId)
331 // Get the layer size for layer corresponding to layerId.
332 // Implemented only for ITS,TPC,TRD,TOF and RICH
334 if (layerId < kFirstLayer || layerId >= kLastLayer) {
335 AliErrorClass(Form("Invalid layer index %d ! Layer range is (%d -> %d) !",layerId,kFirstLayer,kLastLayer));
339 return fgLayerSize[layerId - kFirstLayer];
343 //_____________________________________________________________________________
344 const char* AliAlignObj::LayerName(Int_t layerId)
346 // Get the layer name corresponding to layerId.
347 // Implemented only for ITS,TPC,TRD,TOF and RICH
349 if (layerId < kFirstLayer || layerId >= kLastLayer) {
350 AliErrorClass(Form("Invalid layer index %d ! Layer range is (%d -> %d) !",layerId,kFirstLayer,kLastLayer));
351 return "Invalid Layer!";
354 return fgLayerName[layerId - kFirstLayer];
358 //_____________________________________________________________________________
359 UShort_t AliAlignObj::LayerToVolUID(ELayerID layerId, Int_t modId)
361 // From detector (layer) name and module number (according to detector
362 // internal numbering) build the unique numerical identity of that volume
364 // fVolUID is 16 bits, first 5 reserved for layerID (32 possible values),
365 // remaining 11 for module ID inside det (2048 possible values).
367 return ((UShort_t(layerId) << 11) | UShort_t(modId));
370 //_____________________________________________________________________________
371 UShort_t AliAlignObj::LayerToVolUID(Int_t layerId, Int_t modId)
373 // From detector (layer) name and module number (according to detector
374 // internal numbering) build the unique numerical identity of that volume
376 // fVolUID is 16 bits, first 5 reserved for layerID (32 possible values),
377 // remaining 11 for module ID inside det (2048 possible values).
379 return ((UShort_t(layerId) << 11) | UShort_t(modId));
382 //_____________________________________________________________________________
383 AliAlignObj::ELayerID AliAlignObj::VolUIDToLayer(UShort_t voluid, Int_t &modId)
385 // From voluid, unique numerical identity of that volume inside ALICE,
386 // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
387 // remaining 11 for module ID inside det (2048 possible values)), return
388 // the identity of the layer to which that volume belongs and sets the
389 // argument modId to the identity of that volume internally to the layer.
391 modId = voluid & 0x7ff;
393 return VolUIDToLayer(voluid);
396 //_____________________________________________________________________________
397 AliAlignObj::ELayerID AliAlignObj::VolUIDToLayer(UShort_t voluid)
399 // From voluid, unique numerical identity of that volume inside ALICE,
400 // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
401 // remaining 11 for module ID inside det (2048 possible values)), return
402 // the identity of the layer to which that volume belongs
404 return ELayerID((voluid >> 11) & 0x1f);
407 //_____________________________________________________________________________
408 void AliAlignObj::SetPars(Double_t x, Double_t y, Double_t z,
409 Double_t psi, Double_t theta, Double_t phi)
411 // Set rotation matrix and translation using 3 angles and 3 translations
412 // The three angles are expressed in degrees
414 SetTranslation(x,y,z);
415 SetRotation(psi,theta,phi);
418 //_____________________________________________________________________________
419 Bool_t AliAlignObj::SetLocalPars(Double_t x, Double_t y, Double_t z,
420 Double_t psi, Double_t theta, Double_t phi)
422 // Set the translations and angles (in degrees) by considering the
423 // parameters passed as arguments as expressed in the local reference
424 // system of the alignable volume (known by TGeo geometry).
425 // In case that the TGeo was not initialized or not closed,
426 // returns false and the object parameters are not set.
429 Double_t tr[3] = {x, y, z};
430 m.SetTranslation(tr);
431 Double_t angles[3] = {psi, theta, phi};
433 AnglesToMatrix(angles,rot);
436 return SetLocalMatrix(m);
440 //_____________________________________________________________________________
441 Bool_t AliAlignObj::SetLocalMatrix(const TGeoMatrix& m)
443 // Set the translations and angles by considering the TGeo matrix
444 // passed as argument as expressing the transformation in the local
445 // reference system of the alignable volume (known by TGeo geometry).
446 // In case that the TGeo was not initialized or not closed,
447 // returns false and the object parameters are not set.
449 if (!gGeoManager || !gGeoManager->IsClosed()) {
450 AliError("Can't set the alignment object parameters! gGeoManager doesn't exist or it is still opened!");
454 const char* symname = GetSymName();
455 TGeoPhysicalNode* node;
456 TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(symname);
458 node = gGeoManager->MakeAlignablePN(pne);
460 AliWarning(Form("The symbolic volume name %s does not correspond to a physical entry. Using it as volume path!",symname));
461 node = (TGeoPhysicalNode*) gGeoManager->MakePhysicalNode(symname);
465 AliError(Form("Volume name or path %s not valid!",symname));
468 if (node->IsAligned())
469 AliWarning(Form("Volume %s has been already misaligned!",symname));
472 const Double_t *tr = m.GetTranslation();
473 m1.SetTranslation(tr);
474 const Double_t* rot = m.GetRotationMatrix();
477 TGeoHMatrix align,gprime,gprimeinv;
478 gprime = *node->GetMatrix();
479 gprimeinv = gprime.Inverse();
480 m1.Multiply(&gprimeinv);
481 m1.MultiplyLeft(&gprime);
483 return SetMatrix(m1);
486 //_____________________________________________________________________________
487 Bool_t AliAlignObj::SetMatrix(const TGeoMatrix& m)
489 // Set rotation matrix and translation using the TGeoMatrix passed
490 // as argument considering it as relative to the global reference
494 return SetRotation(m);
497 //_____________________________________________________________________________
498 Bool_t AliAlignObj::ApplyToGeometry()
500 // Apply the current alignment object to the TGeo geometry
501 // This method returns FALSE if the symname of the object was not
502 // valid neither to get a TGeoPEntry nor as a volume path
504 if (!gGeoManager || !gGeoManager->IsClosed()) {
505 AliError("Can't apply the alignment object! gGeoManager doesn't exist or it is still opened!");
509 const char* symname = GetSymName();
511 TGeoPhysicalNode* node;
512 TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(symname);
514 path = pne->GetTitle();
515 if(!gGeoManager->CheckPath(path)){
516 AliDebug(1,Form("Valid PNEntry but invalid volume path %s!",path));
517 // this should happen only for volumes in disactivated branches
520 node = gGeoManager->MakeAlignablePN(pne);
522 AliWarning(Form("The symbolic volume name %s does not correspond to a physical entry. Using it as a volume path!",symname));
524 if (!gGeoManager->CheckPath(path)) {
525 AliError(Form("Volume path %s not valid!",path));
528 if (gGeoManager->GetListOfPhysicalNodes()->FindObject(path)) {
529 AliError(Form("Volume %s has already been misaligned!",path));
532 node = (TGeoPhysicalNode*) gGeoManager->MakePhysicalNode(path);
536 AliError(Form("Volume path %s not valid!",path));
540 TGeoHMatrix align,gprime;
541 gprime = *node->GetMatrix();
543 gprime.MultiplyLeft(&align);
544 TGeoHMatrix *ginv = new TGeoHMatrix;
545 TGeoHMatrix *g = node->GetMatrix(node->GetLevel()-1);
546 *ginv = g->Inverse();
548 AliAlignObj::ELayerID layerId; // unique identity for layer in the alobj
549 Int_t modId; // unique identity for volume inside layer in the alobj
550 GetVolUID(layerId, modId);
551 AliDebug(2,Form("Aligning volume %s of detector layer %d with local ID %d",symname,layerId,modId));
557 //_____________________________________________________________________________
558 Bool_t AliAlignObj::GetFromGeometry(const char *symname, AliAlignObj &alobj)
560 // Get the alignment object which corresponds to the symbolic volume name
561 // symname (in case equal to the TGeo volume path)
562 // The method is extremely slow due to the searching by string.
563 // Therefore it should be used with great care!!
564 // This method returns FALSE if the symname of the object was not
565 // valid neither to get a TGeoPEntry nor as a volume path, or if the path
566 // associated to the TGeoPNEntry was not valid.
569 // Reset the alignment object
570 alobj.SetPars(0,0,0,0,0,0);
571 alobj.SetSymName(symname);
573 if (!gGeoManager || !gGeoManager->IsClosed()) {
574 AliErrorClass("Can't get the alignment object! gGeoManager doesn't exist or it is still opened!");
578 if (!gGeoManager->GetListOfPhysicalNodes()) {
579 AliErrorClass("Can't get the alignment object! gGeoManager doesn't contain any aligned nodes!");
584 TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(symname);
586 path = pne->GetTitle();
588 AliWarningClass(Form("The symbolic volume name %s does not correspond to a physical entry. Using it as a volume path!",symname));
591 TObjArray* nodesArr = gGeoManager->GetListOfPhysicalNodes();
592 TGeoPhysicalNode* node = NULL;
593 for (Int_t iNode = 0; iNode < nodesArr->GetEntriesFast(); iNode++) {
594 TGeoPhysicalNode* tempNode = (TGeoPhysicalNode*) nodesArr->UncheckedAt(iNode);
595 const char *nodePath = tempNode->GetName();
596 if (strcmp(symname,nodePath) == 0) {
603 if (!gGeoManager->cd(symname)) {
604 AliErrorClass(Form("%s not valid neither as symbolic volume name nor as volume path!",symname));
608 AliWarningClass(Form("Volume (%s) has not been misaligned!",symname));
613 TGeoHMatrix align,gprime,g,ginv,l;
614 gprime = *node->GetMatrix();
615 l = *node->GetOriginalMatrix();
616 g = *node->GetMatrix(node->GetLevel()-1);
619 align = gprime * ginv;
621 return alobj.SetMatrix(align);
624 //_____________________________________________________________________________
625 void AliAlignObj::InitAlignObjFromGeometry()
627 // Loop over all alignable volumes and extract
628 // the corresponding alignment objects from
631 if(fgAlignObjs[0]) return;
635 for (Int_t iLayer = kFirstLayer; iLayer < AliAlignObj::kLastLayer; iLayer++) {
636 fgAlignObjs[iLayer-kFirstLayer] = new AliAlignObj*[AliAlignObj::LayerSize(iLayer)];
637 for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
638 UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
639 fgAlignObjs[iLayer-kFirstLayer][iModule] = new AliAlignObjAngles("",volid,0,0,0,0,0,0,kTRUE);
640 const char *symname = SymName(volid);
641 if (!GetFromGeometry(symname, *fgAlignObjs[iLayer-kFirstLayer][iModule]))
642 AliErrorClass(Form("Failed to extract the alignment object for the volume (ID=%d and path=%s) !",volid,symname));
648 //_____________________________________________________________________________
649 AliAlignObj* AliAlignObj::GetAlignObj(UShort_t voluid) {
650 // Returns the alignment object for given volume ID
653 ELayerID layerId = VolUIDToLayer(voluid,modId);
654 return GetAlignObj(layerId,modId);
657 //_____________________________________________________________________________
658 AliAlignObj* AliAlignObj::GetAlignObj(ELayerID layerId, Int_t modId)
660 // Returns pointer to alignment object given its layer and module ID
662 if(modId<0 || modId>=fgLayerSize[layerId-kFirstLayer]){
663 AliWarningClass(Form("Module number %d not in the valid range (0->%d) !",modId,fgLayerSize[layerId-kFirstLayer]-1));
666 InitAlignObjFromGeometry();
668 return fgAlignObjs[layerId-kFirstLayer][modId];
671 //_____________________________________________________________________________
672 const char* AliAlignObj::SymName(UShort_t voluid) {
673 // Returns the symbolic volume name for given volume ID
676 ELayerID layerId = VolUIDToLayer(voluid,modId);
677 return SymName(layerId,modId);
680 //_____________________________________________________________________________
681 const char* AliAlignObj::SymName(ELayerID layerId, Int_t modId)
683 // Returns the symbolic volume name given for a given layer
686 if(modId<0 || modId>=fgLayerSize[layerId-kFirstLayer]){
687 AliWarningClass(Form("Module number %d not in the valid range (0->%d) !",modId,fgLayerSize[layerId-kFirstLayer]-1));
692 return fgVolPath[layerId-kFirstLayer][modId].Data();
695 //_____________________________________________________________________________
696 void AliAlignObj::InitSymNames()
698 // Initialize the LUTs which associate the symbolic volume names
699 // for each alignable volume with their unique numerical identity.
700 // The LUTs are static, so they are created during the instantiation
701 // of the first intance of AliAlignObj
703 if (fgVolPath[0]) return;
705 for (Int_t iLayer = 0; iLayer < (kLastLayer - kFirstLayer); iLayer++)
706 fgVolPath[iLayer] = new TString[fgLayerSize[iLayer]];
709 Int_t modnum; // in the following, set it to 0 at the start of each layer
711 /********************* ITS layers ***********************/
712 TString strSPD = "ITS/SPD";
713 TString strSDD = "ITS/SDD";
714 TString strSSD = "ITS/SSD";
715 TString strStave = "/Stave";
716 TString strLadder = "/Ladder";
717 TString strSector = "/Sector";
718 TString strSensor = "/Sensor";
719 TString strEntryName1;
720 TString strEntryName2;
722 /********************* SPD layer1 ***********************/
726 for(Int_t c1 = 1; c1<=10; c1++){
727 strEntryName1 = strSPD;
729 strEntryName1 += strSector;
730 strEntryName1 += (c1-1);
731 for(Int_t c2 =1; c2<=2; c2++){
732 strEntryName2 = strEntryName1;
733 strEntryName2 += strStave;
734 strEntryName2 += (c2-1);
735 for(Int_t c3 =1; c3<=4; c3++){
736 symname = strEntryName2;
737 symname += strLadder;
739 fgVolPath[kSPD1-kFirstLayer][modnum] = symname.Data();
746 /********************* SPD layer2 ***********************/
750 for(Int_t c1 = 1; c1<=10; c1++){
751 strEntryName1 = strSPD;
753 strEntryName1 += strSector;
754 strEntryName1 += (c1-1);
755 for(Int_t c2 =1; c2<=4; c2++){
756 strEntryName2 = strEntryName1;
757 strEntryName2 += strStave;
758 strEntryName2 += (c2-1);
759 for(Int_t c3 =1; c3<=4; c3++){
760 symname = strEntryName2;
761 symname += strLadder;
763 fgVolPath[kSPD2-kFirstLayer][modnum] = symname.Data();
770 /********************* SDD layer1 ***********************/
774 for(Int_t c1 = 1; c1<=14; c1++){
775 strEntryName1 = strSDD;
777 strEntryName1 +=strLadder;
778 strEntryName1 += (c1-1);
779 for(Int_t c2 =1; c2<=6; c2++){
780 symname = strEntryName1;
781 symname += strSensor;
783 fgVolPath[kSDD1-kFirstLayer][modnum] = symname.Data();
789 /********************* SDD layer2 ***********************/
793 for(Int_t c1 = 1; c1<=22; c1++){
794 strEntryName1 = strSDD;
796 strEntryName1 +=strLadder;
797 strEntryName1 += (c1-1);
798 for(Int_t c2 = 1; c2<=8; c2++){
799 symname = strEntryName1;
800 symname += strSensor;
802 fgVolPath[kSDD2-kFirstLayer][modnum] = symname.Data();
808 /********************* SSD layer1 ***********************/
812 for(Int_t c1 = 1; c1<=34; c1++){
813 strEntryName1 = strSSD;
815 strEntryName1 +=strLadder;
816 strEntryName1 += (c1-1);
817 for(Int_t c2 = 1; c2<=22; c2++){
818 symname = strEntryName1;
819 symname += strSensor;
821 fgVolPath[kSSD1-kFirstLayer][modnum] = symname.Data();
827 /********************* SSD layer2 ***********************/
831 for(Int_t c1 = 1; c1<=38; c1++){
832 strEntryName1 = strSSD;
834 strEntryName1 +=strLadder;
835 strEntryName1 += (c1-1);
836 for(Int_t c2 = 1; c2<=25; c2++){
837 symname = strEntryName1;
838 symname += strSensor;
840 fgVolPath[kSSD2-kFirstLayer][modnum] = symname.Data();
847 /*************** TPC inner and outer layers ****************/
848 TString sAsector="TPC/EndcapA/Sector";
849 TString sCsector="TPC/EndcapC/Sector";
850 TString sInner="/InnerChamber";
851 TString sOuter="/OuterChamber";
853 /*************** TPC inner chambers' layer ****************/
857 for(Int_t cnt=1; cnt<=18; cnt++){
861 fgVolPath[kTPC1-kFirstLayer][modnum] = symname.Data();
864 for(Int_t cnt=1; cnt<=18; cnt++){
868 fgVolPath[kTPC1-kFirstLayer][modnum] = symname.Data();
873 /*************** TPC outer chambers' layer ****************/
877 for(Int_t cnt=1; cnt<=18; cnt++){
881 fgVolPath[kTPC2-kFirstLayer][modnum] = symname.Data();
884 for(Int_t cnt=1; cnt<=18; cnt++){
888 fgVolPath[kTPC2-kFirstLayer][modnum] = symname.Data();
893 /********************* TOF layer ***********************/
901 Int_t nStrips=nstrA+2*nstrB+2*nstrC;
903 TString snSM = "TOF/sm";
904 TString snSTRIP = "/strip";
906 for (Int_t isect = 0; isect < nSectors; isect++) {
907 for (Int_t istr = 1; istr <= nStrips; istr++) {
909 symname += Form("%02d",isect);
911 symname += Form("%02d",istr);
912 fgVolPath[kTOF-kFirstLayer][modnum] = symname.Data();
918 /********************* RICH layer ***********************/
920 TString str = "ALIC_1/RICH_";
923 for (modnum=0; modnum < 7; modnum++) {
925 symname += (modnum+1);
926 fgVolPath[kRICH-kFirstLayer][modnum] = symname.Data();
930 /********************* TRD layers 1-6 *******************/
931 //!! 6 layers with index increasing in outwards direction
933 Int_t arTRDlayId[6] = {kTRD1, kTRD2, kTRD3, kTRD4, kTRD5, kTRD6};
935 TString snStr = "TRD/sm";
936 TString snApp1 = "/st";
937 TString snApp2 = "/pl";
939 for(Int_t layer=0; layer<6; layer++){
941 for (Int_t isect = 0; isect < 18; isect++) {
942 for (Int_t icham = 0; icham < 5; icham++) {
944 symname += Form("%02d",isect);
949 fgVolPath[arTRDlayId[layer]-kFirstLayer][modnum] = symname.Data();