-//______________________________________________________________________
-Bool_t AliITSInitGeometry::InitAliITSgeomtest2(AliITSgeom *geom){
- // Initilizes the geometry transformation class AliITSgeom
- // to values appropreate to this specific geometry. Now that
- // the segmentation is part of AliITSgeom, the detector
- // segmentations are also defined here.
- // Inputs:
- // AliITSgeom *geom A pointer to the AliITSgeom class
- // Outputs:
- // AliITSgeom *geom This pointer recreated and properly inilized.
- // Return:
- // none.
- // const Double_t kcm2micron = 1.0E4;
- const Int_t kItype=0; // Type of transormation defined 0=> Geant
- const Int_t klayers = 6; // number of layers in the ITS
- const Int_t kladders[klayers] = {1,1,1,1,1,1}; // Number of ladders
- const Int_t kdetectors[klayers] = {1,1,1,1,1,1};// number of detector/lad
- const AliITSDetector kIdet[6] = {kSPD,kSPD,kSDD,kSDD,kSSD,kSSD};
- const TString kNames[klayers] = {
- "/ALIC_1/ITSV_1/ITSspd1_1/ITS1_1", // lay=1
- "/ALIC_1/ITSV_1/ITSspd2_1/ITS2_1", // lay=2
- "/ALIC_1/ITSV_1/ITSsdd1_1/ITS3_1", // lay=3
- "/ALIC_1/ITSV_1/ITSsdd2_1/ITS4_1", // lay=4
- "/ALIC_1/ITSV_1/ITSssd1_1/ITS5_1", // lay=5
- "/ALIC_1/ITSV_1/ITSssd2_1/ITS6_1"};// Lay=6
- Int_t mod,nmods=0,lay,lad,det,cpn0,cpn1,cpn2;
- Double_t tran[3]={0.0,0.0,0.0},rot[10]={9*0.0,1.0};
- TArrayD shapePar;
- TString shapeName;
- TGeoHMatrix matrix;
- Bool_t initSeg[3]={kFALSE,kFALSE,kFALSE};
- TStopwatch *time = 0x0;if(fTiming) time=new TStopwatch();
-
- if(fTiming) time->Start();
- for(mod=0;mod<klayers;mod++) nmods += kladders[mod]*kdetectors[mod];
- geom->Init(kItype,klayers,kladders,kdetectors,nmods);
- for(mod=0;mod<nmods;mod++){
- DecodeDetectorLayers(mod,lay,lad,det); // Write
- geom->CreateMatrix(mod,lay,lad,det,kIdet[lay-1],tran,rot);
- RecodeDetector(mod,cpn0,cpn1,cpn2); // Write reusing lay,lad,det.
- geom->GetGeomMatrix(mod)->SetPath(kNames[lay-1]);
- GetTransformation(kNames[lay-1].Data(),matrix);
- geom->SetTrans(mod,matrix.GetTranslation());
- TransposeTGeoHMatrix(&matrix); // Transpose TGeo's rotation matrixes
- geom->SetRotMatrix(mod,matrix.GetRotationMatrix());
- if(initSeg[kIdet[lay-1]]) continue;
- GetShape(kNames[lay-1],shapeName,shapePar);
- if(shapeName.CompareTo("BOX")){
- Error("InitITSgeom2","Geometry changed without proper code update"
- "or error in reading geometry. Shape is not BOX shape is %s",
- shapeName.Data());
- return kFALSE;
- } // end if
- InitGeomShapePPRasymmFMD(kIdet[lay-1],initSeg,shapePar,geom);
- } // end for module
- if(fTiming){
- time->Stop();
- time->Print();
- delete time;
- } // end if
- return kTRUE;
-}
-//______________________________________________________________________
-Bool_t AliITSInitGeometry::InitAliITSgeomSPD02(AliITSgeom *geom){
- // Initilizes the geometry transformation class AliITSgeom
- // to values appropreate to this specific geometry. Now that
- // the segmentation is part of AliITSgeom, the detector
- // segmentations are also defined here.
- // Inputs:
- // AliITSgeom *geom A pointer to the AliITSgeom class
- // Outputs:
- // AliITSgeom *geom This pointer recreated and properly inilized.
- // Return:
- // none.
- const Int_t kltypess=2;
- const Int_t knlayers=5;
- const TString knames[kltypess]=
- {"ALIC_1/ITSV_1/ITEL_%d/IMB0_1/IMBS_1",//lay=1,2,4,5
- "ALIC_1/ITSV_1/IDET_%d/ITS0_1/ITST_1"};// lay=3
- const Int_t kitsGeomTreeCopys[2]={4,1};
- const Int_t knlad[knlayers]={knlayers*1},kndet[knlayers]={knlayers*1};
- TString path,shapeName;
- TGeoHMatrix matrix;
- TArrayD shapePar;
- TArrayF shapeParF;
- Double_t trans[3]={3*0.0},rot[10]={10*0.0};
- Int_t npar=3,mod,i,j,lay,lad,det,cpy;
- Float_t par[20];
- TStopwatch *time = 0x0;if(fTiming) time=new TStopwatch();
-
- par[0]=0.64;par[1]=0.5*300.0E-4;par[2]=3.48;
- mod=5;;
- geom->Init(0,knlayers,knlad,kndet,mod);
-
- if(fTiming) time->Start();
- for(i=0;i<kltypess;i++)for(cpy=1;cpy<=kitsGeomTreeCopys[i];cpy++){
- path.Form(knames[i].Data(),cpy);
- GetTransformation(path.Data(),matrix);
- GetShape(path.Data(),shapeName,shapePar);
- shapeParF.Set(shapePar.GetSize());
- for(j=0;j<shapePar.GetSize();j++) shapeParF[j]=shapePar[j];
- lay = cpy;
- if(i==0&&cpy>2) lay=cpy+1;
- if(i==1) lay=3;
- DecodeDetector(mod,kitsGeomTreeCopys[i],1,cpy,0);
- DecodeDetectorLayers(mod,lay,lad,det);
- geom->CreateMatrix(mod,lay,lad,det,kSPD,trans,rot);
- geom->SetTrans(mod,matrix.GetTranslation());
- geom->SetRotMatrix(mod,matrix.GetRotationMatrix());
- geom->GetGeomMatrix(mod)->SetPath(path.Data());
- if(!(geom->IsShapeDefined((Int_t)kSPD)))
- geom->ReSetShape(kSPD,new AliITSgeomSPD425Short(npar,par));
- } // end for i,cpy/
- if(fTiming){
- time->Stop();
- time->Print();
- delete time;
- } // end if
- return kTRUE;
-}
-//______________________________________________________________________
-Bool_t AliITSInitGeometry::InitAliITSgeomSDD03(AliITSgeom *geom){
- // Initilizes the geometry transformation class AliITSgeom
- // to values appropreate to this specific geometry. Now that
- // the segmentation is part of AliITSgeom, the detector
- // segmentations are also defined here.
- // Inputs:
- // AliITSgeom *geom A pointer to the AliITSgeom class
- // Outputs:
- // AliITSgeom *geom This pointer recreated and properly inilized.
- // Return:
- // none
- const Int_t knlayers=12;
- // const Int_t kndeep=6;
- const Int_t kltypess=2;
- const AliITSDetector kidet[knlayers]={kSSD,kSDD};
- const TString knames[kltypess]={
- "/ALIC_1/ITSV_1/ITEL_%d/ITAI_1/IMB0_1/IMBS_1",
- "/ALIC_1/ITSV_1/IDET_%d/IDAI_1/ITS0_1/ITST_1"};
- const Int_t kitsGeomTreeCopys[kltypess]={10,2};
- const Int_t knp=384;
- const Float_t kpitch=50.E-4;/*cm*/
- Float_t box[3]={0.5*kpitch*(Float_t)knp,150.E-4,1.0},p[knp+1],n[knp+1];
- Int_t nlad[knlayers]={knlayers*1};
- Int_t ndet[knlayers]={knlayers*1};
- Int_t mod=knlayers,lay=0,lad=0,det=0,i,j,cp0;
- TString path,shapeName;
- TGeoHMatrix matrix;
- Double_t trans[3]={3*0.0},rot[10]={10*0.0};
- TArrayD shapePar;
- TArrayF shapeParF;
- Bool_t isShapeDefined[kltypess]={kltypess*kFALSE};
-
- geom->Init(0,knlayers,nlad,ndet,mod);
- p[0]=-box[0];
- n[0]=box[0];
- // Fill in anode and cathode strip locations (lower edge)
- for(i=1;i<knp;i++){
- p[i] =p[i-1]+kpitch;
- n[i] =n[i-1]-kpitch;
- } // end for i
- p[knp]=box[0];
- n[knp]=-box[0];
- for(i=0;i<kltypess;i++)for(cp0=1;cp0<=kitsGeomTreeCopys[i];cp0++){
- DecodeDetector(mod,kitsGeomTreeCopys[i],cp0,1,2);
- DecodeDetectorLayers(mod,lay,lad,det);
- path.Form(knames[i].Data(),cp0);
- GetTransformation(path.Data(),matrix);
- GetShape(path.Data(),shapeName,shapePar);
- shapeParF.Set(shapePar.GetSize());
- for(j=0;j<shapePar.GetSize();j++)shapeParF[j]=shapePar[j];
- geom->CreateMatrix(mod,lay,lad,det,kidet[i],trans,rot);
- geom->SetTrans(mod,matrix.GetTranslation());
- geom->SetRotMatrix(mod,matrix.GetRotationMatrix());
- geom->GetGeomMatrix(mod)->SetPath(path.Data());
- switch (kidet[i]){
- case kSDD: if(!(geom->IsShapeDefined((Int_t)kSDD))){
- geom->ReSetShape(kSDD,new AliITSgeomSDD256(shapeParF.GetSize(),
- shapeParF.GetArray()));
- isShapeDefined[i]=kTRUE;
- } break;
- case kSSD:if(!(geom->IsShapeDefined((Int_t)kSSD))){
- geom->ReSetShape(kSSD,new AliITSgeomSSD(box,0.0,0.0,
- knp+1,p,knp+1,n));
- isShapeDefined[i]=kTRUE;
- } break;
- default:{} break;
- } // end switch
- } // end for i,cp0
-
- return kTRUE;
-}
-//______________________________________________________________________
-Bool_t AliITSInitGeometry::InitAliITSgeomSSD03(AliITSgeom *geom){
- // Initilizes the geometry transformation class AliITSgeom
- // to values appropreate to this specific geometry. Now that
- // the segmentation is part of AliITSgeom, the detector
- // segmentations are also defined here.
- // Inputs:
- // AliITSgeom *geom A pointer to the AliITSgeom class
- // Outputs:
- // AliITSgeom *geom This pointer recreated and properly inilized.
- // Return:
- // none.
- const Int_t knlayers=5;
- // const Int_t kndeep=6;
- const Int_t kltypess=3;
- const AliITSDetector kIdet[knlayers]={kND,kSSD,kND};
- const TString knames[kltypess]={
- "/ALIC_1/ITSV_1/ITSA_%d/ITSS_1",
- "/ALIC_1/ITSV_1/IGAR_%d/IAIR_1/ITST_1",
- "/ALIC_1/ITSV_1/IFRA_%d/IFRS_1"};
- const Int_t kitsGeomTreeCopys[kltypess]={3,1,1};
- const Int_t kitsGeomDetTypes[kltypess]={1,2,3};
- const Int_t knp=384;
- const Float_t kpitch=50.E-4;//cm
- Bool_t initSeg[3]={kFALSE, kFALSE, kFALSE};
- Float_t box[3]={0.5*kpitch*(Float_t)knp,150.E-4,1.0},p[knp+1],n[knp+1];
- Int_t nlad[knlayers]={knlayers*1};
- Int_t ndet[knlayers]={knlayers*1};
- Int_t mod=knlayers,lay=0,lad=0,det=0,i,j,cp0;
- TString path,shapeName;
- TGeoHMatrix matrix;
- Double_t trans[3]={3*0.0},rot[10]={10*0.0};
- TArrayD shapePar;
- TArrayF shapeParF;
- Bool_t isShapeDefined[kltypess]={kltypess*kFALSE};
-
- geom->Init(0,knlayers,nlad,ndet,mod);
- p[0]=-box[0];
- n[0]=box[0];
- // Fill in anode and cathode strip locations (lower edge)
- for(i=1;i<knp;i++){
- p[i] =p[i-1]+kpitch;
- n[i] =n[i-1]-kpitch;
- } // end for i
- p[knp]=box[0];
- n[knp]=-box[0];
- for(i=0;i<kltypess;i++)for(cp0=1;cp0<=kitsGeomTreeCopys[i];cp0++){
- DecodeDetector(mod,kitsGeomDetTypes[i],cp0,1,0);
- DecodeDetectorLayers(mod,lay,lad,det);
- path.Form(knames[i].Data(),cp0);
- GetTransformation(path.Data(),matrix);
- GetShape(path.Data(),shapeName,shapePar);
- shapeParF.Set(shapePar.GetSize());
- for(j=0;j<shapePar.GetSize();j++)shapeParF[j]=shapePar[j];
- geom->CreateMatrix(mod,lay,lad,det,kIdet[i],trans,rot);
- geom->SetTrans(mod,matrix.GetTranslation());
- geom->SetRotMatrix(mod,matrix.GetRotationMatrix());
- geom->GetGeomMatrix(mod)->SetPath(path.Data());
- switch (kIdet[i]){
- case kSSD:if(!(geom->IsShapeDefined((Int_t)kSSD))){
- InitGeomShapePPRasymmFMD(kIdet[lay-1],initSeg,shapePar,geom);
- isShapeDefined[i]=kTRUE;
- } break;
- default:{} break;
- } // end switch
- } // end for i,cp0
-
- return kTRUE;
-}
-//______________________________________________________________________
-Bool_t AliITSInitGeometry::InitAliITSgeomITS04(AliITSgeom *geom) const{
- // Initilizes the geometry transformation class AliITSgeom
- // to values appropreate to this specific geometry. Now that
- // the segmentation is part of AliITSgeom, the detector
- // segmentations are also defined here.
- // Inputs:
- // AliITSgeom *geom A pointer to the AliITSgeom class
- // Outputs:
- // AliITSgeom *geom This pointer recreated and properly inilized.
- // Return:
- // none.
-
- // We can not use AliITSvBeamTestITS04::fgk... data members because
- // AliITSInitGeometry is part of the base library while AliITSvBeamTestITS04
- // is part of the simulation library. This would introduce a dependance
- // between the 2 libraries
-
-
- const Int_t knlayers = 6;
- Int_t nlad[knlayers], ndet[knlayers];
-
- nlad[0] = 1; ndet[0] = 2;
- nlad[1] = 1; ndet[1] = 2;
- nlad[2] = 1; ndet[2] = 1;
- nlad[3] = 1; ndet[3] = 1;
- nlad[4] = 1; ndet[4] = 2;
- nlad[5] = 1; ndet[5] = 2;
-
- Int_t nModTot = 10;
- geom->Init(0,knlayers,nlad,ndet,nModTot);
-
- /*
- //=== Set default shapes
- const Float_t kDxyzSPD[] = {AliITSvBeamTestITS04::fgkSPDwidthSens/2,
- AliITSvBeamTestITS04::fgkSPDthickSens/2,
- AliITSvBeamTestITS04::fgkSPDlengthSens/2};
- if(!(geom->IsShapeDefined(kSPD)))
- geom->ReSetShape(kSPD,new AliITSgeomSPD425Short(3,(Float_t *)kDxyzSPD));
-
- const Float_t kDxyzSDD[] = {AliITSvBeamTestITS04::fgkSDDwidthSens/2.,
- AliITSvBeamTestITS04::fgkSDDthickSens/2.,
- AliITSvBeamTestITS04::fgkSDDlengthSens/2.};
- if(!(geom->IsShapeDefined(kSDD)))
- geom->ReSetShape(kSDD, new AliITSgeomSDD256(3,(Float_t *)kDxyzSDD));
-
- const Float_t kDxyzSSD[] = {AliITSvBeamTestITS04::fgkSSDlengthSens/2,
- AliITSvBeamTestITS04::fgkSSDthickSens/2,
- AliITSvBeamTestITS04::fgkSSDwidthSens/2};
- if(!(geom->IsShapeDefined(kSSD)))
- geom->ReSetShape(kSSD,new AliITSgeomSSD75and275(3,(Float_t *)kDxyzSSD));
-
- // Creating the matrices in AliITSgeom for each sensitive volume
- // (like in AliITSv11GeometrySDD) mln
- // Here, each layer is one detector
-
- char layerName[30];
- Int_t startMod = 0,mod;
- TGeoVolume *itsmotherVolume = gGeoManager->GetVolume("ITSV");
- // SPD
- for (Int_t i=0; i<4;i++) {
- sprintf(layerName, "ITSspdWafer_%i",i+1);
- TGeoNode *layNode = itsmotherVolume->GetNode(layerName);
- if (layNode) {
- TGeoHMatrix layMatrix(*layNode->GetMatrix());
- Double_t *trans = layMatrix.GetTranslation();
- Double_t *r = layMatrix.GetRotationMatrix();
- Double_t rot[10] = {r[0],r[1],r[2],
- r[3],r[4],r[5],
- r[6],r[7],r[8], 1.0};
- Int_t iDet = 1;
- Int_t iLad = 1;
- Int_t iLay = 1;
- DecodeDetector(mod,layNode->GetNumber(),i+1,0,0);
- DecodeDetectorLayers(mod,iLay,iLad,iDet);
- geom->CreateMatrix(startMod,iLay,iLad,iDet,kSPD,trans,rot);
- startMod++;
- };
- };
-
- // SDD
- for (Int_t i=0; i<2;i++) {
- sprintf(layerName, "ITSsddWafer_%i",i+4+1);
- TGeoNode *layNode = itsmotherVolume->GetNode(layerName);
- if (layNode) {
- TGeoHMatrix layMatrix(*layNode->GetMatrix());
- Double_t *trans = layMatrix.GetTranslation();
- Double_t *r = layMatrix.GetRotationMatrix();
- Double_t rot[10] = {r[0],r[1],r[2],
- r[3],r[4],r[5],
- r[6],r[7],r[8], 1.0};
- Int_t iDet = 1;
- Int_t iLad = 1;
- Int_t iLay = 1;
- DecodeDetector(mod,layNode->GetNumber(),i+1,0,0);
- DecodeDetectorLayers(mod,iLay,iLad,iDet);
- geom->CreateMatrix(startMod,iLay,iLad,iDet,kSDD,trans,rot);
- startMod++;
- };
- };
-
- // SSD
- for (Int_t i=0; i<4;i++) {
- sprintf(layerName, "ITSssdWafer_%i",i+4+2+1);
- TGeoNode *layNode = itsmotherVolume->GetNode(layerName);
- if (layNode) {
- TGeoHMatrix layMatrix(*layNode->GetMatrix());
- Double_t *trans = layMatrix.GetTranslation();
- Double_t *r = layMatrix.GetRotationMatrix();
- Double_t rot[10] = {r[0],r[1],r[2],
- r[3],r[4],r[5],
- r[6],r[7],r[8], 1.0};
- Int_t iDet = 1;
- Int_t iLad = 1;
- Int_t iLay = 5;
- DecodeDetector(mod,layNode->GetNumber(),i+1,0,0);
- DecodeDetectorLayers(mod,iLay,iLad,iDet);
- geom->CreateMatrix(startMod,iLay,iLad,iDet,kSSD,trans,rot);
- startMod++;
- };
- };
-
- return kTRUE;
- */
- return kFALSE;
-}
-//______________________________________________________________________
-Bool_t AliITSInitGeometry::InitAliITSgeomPPRasymmFMD(AliITSgeom *geom){
- // Initilizes the geometry transformation class AliITSgeom
- // to values appropreate to this specific geometry. Now that
- // the segmentation is part of AliITSgeom, the detector
- // segmentations are also defined here.
- // Inputs:
- // AliITSgeom *geom A pointer to the AliITSgeom class
- // Outputs:
- // AliITSgeom *geom This pointer recreated and properly inilized.
- // Return:
- // none.
- // const Double_t kcm2micron = 1.0E4;
- const Int_t kItype=0; // Type of transormation defined 0=> Geant
- const Int_t klayers = 6; // number of layers in the ITS
- const Int_t kladders[klayers] = {20,40,14,22,34,38}; // Number of ladders
- const Int_t kdetectors[klayers] = {4,4,6,8,22,25};// number of detector/lad
- const AliITSDetector kIdet[6] = {kSPD,kSPD,kSDD,kSDD,kSSD,kSSD};
- const TString kPathbase = "/ALIC_1/ITSV_1/ITSD_1/";
- const TString kNames[2][klayers] = {
- {"%sIT12_1/I12A_%d/I10A_%d/I103_%d/I101_1/ITS1_1", // lay=1
- "%sIT12_1/I12A_%d/I20A_%d/I1D3_%d/I1D1_1/ITS2_1", // lay=2
- "%sIT34_1/I004_%d/I302_%d/ITS3_%d/", // lay=3
- "%sIT34_1/I005_%d/I402_%d/ITS4_%d/", // lay=4
- "%sIT56_1/I565_%d/I562_%d/ITS5_%d/", // lay=5
- "%sIT56_1/I569_%d/I566_%d/ITS6_%d/"},// lay=6
-// {"%sIT12_1/I12B_%d/I10B_%d/I107_%d/I101_1/ITS1_1", // lay=1
-// "%sIT12_1/I12B_%d/I20B_%d/I1D7_%d/I1D1_1/ITS2_1", // lay=2
- {"%sIT12_1/I12B_%d/I10B_%d/L1H-STAVE%d_1/I107_%d/I101_1/ITS1_1",//lay=1
- "%sIT12_1/I12B_%d/I20B_%d/L2H-STAVE%d_1/I1D7_%d/I1D1_1/ITS2_1",//lay=2
- "%sIT34_1/I004_%d/I302_%d/ITS3_%d", // lay=3
- "%sIT34_1/I005_%d/I402_%d/ITS4_%d", // lay=4
- "%sIT56_1/I565_%d/I562_%d/ITS5_%d", // lay=5
- "%sIT56_1/I569_%d/I566_%d/ITS6_%d"}};// Lay=6
- /*
- Int_t itsGeomTreeCopys[knlayers][3]= {{10, 2, 4},// lay=1
- {10, 4, 4},// lay=2
- {14, 6, 1},// lay=3
- {22, 8, 1},// lay=4
- {34,22, 1},// lay=5
- {38,25, 1}};//lay=6
- */
- Int_t mod,nmods=0,lay,lad,det,cpn0,cpn1,cpn2, cpnHS;
- Double_t tran[3]={0.0,0.0,0.0},rot[10]={9*0.0,1.0};
- TArrayD shapePar;
- TString path,shapeName;
- TGeoHMatrix matrix;
- Bool_t initSeg[3]={kFALSE,kFALSE,kFALSE};
- TStopwatch *time = 0x0;if(fTiming) time=new TStopwatch();
-
- if(fTiming) time->Start();
- for(mod=0;mod<klayers;mod++) nmods += kladders[mod]*kdetectors[mod];
- geom->Init(kItype,klayers,kladders,kdetectors,nmods);
- for(mod=0;mod<nmods;mod++){
- DecodeDetectorLayers(mod,lay,lad,det); // Write
- geom->CreateMatrix(mod,lay,lad,det,kIdet[lay-1],tran,rot);
- RecodeDetector(mod,cpn0,cpn1,cpn2); // Write reusing lay,lad,det.