#include "AliMagF.h"
#include "AliRun.h"
#include "AliTrackReference.h"
+#include "AliGeomManager.h"
#define GEANTGEOMETRY kTRUE
// none.
fIgm.SetGeometryName("");
}
+
//______________________________________________________________________
AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const Char_t *title):
AliITS(title), // Standard AliITS Constructor
fIdSens = new Int_t[fIdN];
for(i=0;i<fIdN;i++) fIdSens[i] = 0;
}
+
//______________________________________________________________________
AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const char *name, const char *title):
AliITS(name,title), // Extended AliITS Constructor
SetThicknessChip2();
SetDensityServicesByThickness();
}
+
//______________________________________________________________________
AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const AliITSvPPRasymmFMD &source):
AliITS(source.GetName(),source.GetTitle()),// Extended AliITS Constructor
Warning("Copy Constructor","Not allowed to copy AliITSvPPRasymmFMD");
return;
}
+
//______________________________________________________________________
AliITSvPPRasymmFMD& AliITSvPPRasymmFMD::operator=(const AliITSvPPRasymmFMD
&source){
Warning("= operator","Not allowed to copy AliITSvPPRasymmFMD");
return *this; // return null pointer, copy not allowed.
}
+
//______________________________________________________________________
AliITSvPPRasymmFMD::~AliITSvPPRasymmFMD() {
// Standard destructor for the ITS version 10.
// Return:
// none.
}
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::AddAlignableVolumes() const
{
return;
}
+ AliGeomManager::ELayerID layerId;
+ Int_t modUID, modnum;
+
if( !gGeoManager->SetAlignableEntry("ITS","ALIC_1/ITSV_1") )
AliFatal("Unable to set alignable entry!!");
TString strSDD = "ITS/SDD";
TString strSSD = "ITS/SSD";
TString strStave = "/Stave";
+ TString strHalfStave = "/HalfStave";
TString strLadder = "/Ladder";
TString strSector = "/Sector";
TString strSensor = "/Sensor";
TString strEntryName1;
TString strEntryName2;
TString strEntryName3;
+ TString strEntryName4;
//===== SPD layer1 =====
{
+ layerId = AliGeomManager::kSPD1;
+ modnum = 0;
TString str0 = "ALIC_1/ITSV_1/ITSD_1/IT12_1/I12B_";
TString str1 = "/I10B_";
+ TString str1Bis = "/L1H-STAVE";
+ TString str1Tierce = "_1";
TString str2 = "/I107_";
-
+
TString sector;
TString stave;
+ TString halfStave;
TString module;
-
- for(Int_t c1 = 1; c1<=10; c1++){
-
+
+ for(Int_t cSect = 0; cSect<10; cSect++)
+ {
sector = str0;
- sector += c1; // this is one full sector
+ sector += cSect+1; // this is one full sector
strEntryName1 = strSPD;
strEntryName1 += 0;
strEntryName1 += strSector;
- strEntryName1 += (c1-1);
+ strEntryName1 += cSect;
+ //printf("%s == %s\n",strEntryName1.Data(),sector.Data());
if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),sector.Data()))
AliFatal("Unable to set alignable entry!!");
- //printf("%s == %s\n",strEntryName1.Data(),sector.Data());
- for(Int_t c2 =1; c2<=2; c2++){
-
+ for(Int_t cStave = 0; cStave<2; cStave++)
+ {
stave = sector;
stave += str1;
- stave += c2;
+ stave += cStave+1;
strEntryName2 = strEntryName1;
strEntryName2 += strStave;
- strEntryName2 += (c2-1);
- if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),stave.Data()))
- AliFatal("Unable to set alignable entry!!");
+ strEntryName2 += cStave;
//printf("%s == %s\n",strEntryName2.Data(),stave.Data()); // this is a stave
- for(Int_t c3 =1; c3<=4; c3++){
-
- module = stave;
- module += str2;
- module += c3;
+ for(Int_t cHS=0; cHS<2; cHS++)
+ {
+ halfStave = stave;
+ halfStave += str1Bis;
+ halfStave += cHS;
+ halfStave += str1Tierce;
strEntryName3 = strEntryName2;
- strEntryName3 += strLadder;
- strEntryName3 += (c3-1);
- if(!gGeoManager->SetAlignableEntry(strEntryName3.Data(),module.Data()))
+ strEntryName3 += strHalfStave;
+ strEntryName3 += cHS;
+ //printf("%s == %s\n",strEntryName3.Data(),halfStave.Data()); // this is a half-stave
+ if(!gGeoManager->SetAlignableEntry(strEntryName3.Data(),halfStave.Data()))
AliFatal("Unable to set alignable entry!!");
- //printf("%s == %s\n",strEntryName3.Data(),module.Data());
-
- // Creates the TGeo Local to Tracking transformation matrix ...
- TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(strEntryName3.Data());
- const char *path = alignableEntry->GetTitle();
- if (!gGeoManager->cd(path))
- AliFatal(Form("Volume path %s not valid!",path));
- TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
- gtrans = globMatrix->GetTranslation();
- memcpy(&rotMatrix[0], globMatrix->GetRotationMatrix(), 9*sizeof(Double_t));
- al = TMath::ATan2(rotMatrix[1],rotMatrix[0]);
- TGeoHMatrix *matLtoT = new TGeoHMatrix;
- matLtoT->SetDx( gtrans[0]*TMath::Cos(al)+gtrans[1]*TMath::Sin(al) ); // translation
- al += TMath::Pi()/2;
- // matLtoT->SetDy( gtrans[0]*TMath::Cos(al)+gtrans[1]*TMath::Sin(al) );
- // Not taking into account the shift w.r.t. sensitive volume
- // correction with fChip1*0.0001/2. is due to the fact
- // that the alignable volume is not the sensitive volume
- // matLtoT->SetDy( gtrans[0]*TMath::Cos(al)+gtrans[1]*TMath::Sin(al) - fChip1*0.0001/2.);
- matLtoT->SetDy(-fChip1*0.0001/2.);
- matLtoT->SetDz(-gtrans[2]);
- rotMatrix[0]= 0; rotMatrix[1]= 1; rotMatrix[2]= 0; // + rotation
- rotMatrix[3]=-1; rotMatrix[4]= 0; rotMatrix[5]= 0; // ! flip in y for the SPD1 only
- rotMatrix[6]= 0; rotMatrix[7]= 0; rotMatrix[8]=-1;
- TGeoRotation rot;
- rot.SetMatrix(rotMatrix);
- matLtoT->MultiplyLeft(&rot);
- TGeoHMatrix *matTtoL = new TGeoHMatrix(matLtoT->Inverse());
- delete matLtoT;
- alignableEntry->SetMatrix(matTtoL);
+
+ for(Int_t cLadder = 0; cLadder<2; cLadder++)
+ {
+ modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
+ module = halfStave;
+ module += str2;
+ module += cLadder+cHS*2+1;
+ strEntryName4 = strEntryName3;
+ strEntryName4 += strLadder;
+ strEntryName4 += cLadder+cHS*2;
+ //printf("%s == %s\n",strEntryName4.Data(),module.Data());
+ if(!gGeoManager->SetAlignableEntry(strEntryName4.Data(),module.Data(),modUID))
+ AliFatal("Unable to set alignable entry!!");
+
+ // Creates the TGeo Local to Tracking transformation matrix ...
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
+ TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig();
+ gtrans = globMatrix->GetTranslation();
+ memcpy(&rotMatrix[0], globMatrix->GetRotationMatrix(), 9*sizeof(Double_t));
+ al = TMath::ATan2(rotMatrix[1],rotMatrix[0]);
+ TGeoHMatrix *matLtoT = new TGeoHMatrix;
+ matLtoT->SetDx( gtrans[0]*TMath::Cos(al)+gtrans[1]*TMath::Sin(al) ); // translation
+ al += TMath::Pi()/2;
+
+ matLtoT->SetDy(-fChip1*0.0001/2.);
+ matLtoT->SetDz(-gtrans[2]);
+ rotMatrix[0]= 0; rotMatrix[1]=-1; rotMatrix[2]= 0; // + rotation
+ rotMatrix[3]=-1; rotMatrix[4]= 0; rotMatrix[5]= 0; // ! flip in y for the SPD1 only
+ rotMatrix[6]= 0; rotMatrix[7]= 0; rotMatrix[8]=-1;
+ TGeoRotation rot;
+ rot.SetMatrix(rotMatrix);
+ matLtoT->MultiplyLeft(&rot);
+ TGeoHMatrix *matTtoL = new TGeoHMatrix(matLtoT->Inverse());
+ delete matLtoT;
+ alignableEntry->SetMatrix(matTtoL);
+ }
}
}
}
- }
-
- //===== SPD layer2 =====
- {
- TString str0 = "ALIC_1/ITSV_1/ITSD_1/IT12_1/I12B_";
- TString str1 = "/I20B_";
- TString str2 = "/I1D7_";
-
- TString sector;
- TString stave;
- TString module;
-
- for(Int_t c1 = 1; c1<=10; c1++){
-
+
+ //===== SPD layer2 =====
+ layerId = AliGeomManager::kSPD2;
+ modnum = 0;
+ str1Bis = "/L2H-STAVE";
+ str1 = "/I20B_";
+ str2 = "/I1D7_";
+
+ for(Int_t cSect = 0; cSect<10; cSect++)
+ {
sector = str0;
- sector += c1; // this is one full sector
+ sector += cSect+1; // this is one full sector
strEntryName1 = strSPD;
strEntryName1 += 1;
strEntryName1 += strSector;
- strEntryName1 += (c1-1);
- if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),sector.Data()))
- AliFatal("Unable to set alignable entry!!");
- //printf("%s == %s\n",strEntryName1.Data(),sector.Data());
+ strEntryName1 += cSect;
+ // if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),sector.Data()))
+ // AliFatal("Unable to set alignable entry!!");
+ // we don't need the previous lines because the whole sector is already define
+ // with first layer ...
- for(Int_t c2 =1; c2<=4; c2++){
-
+ for(Int_t cStave =0; cStave<4; cStave++)
+ {
stave = sector;
stave += str1;
- stave += c2;
+ stave += cStave+1;
strEntryName2 = strEntryName1;
strEntryName2 += strStave;
- strEntryName2 += (c2-1);
- if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),stave.Data()))
- AliFatal("Unable to set alignable entry!!");
- //printf("%s == %s\n",strEntryName2.Data(),stave.Data()); // this is a stave
-
- for(Int_t c3 =1; c3<=4; c3++){
-
- module = stave;
- module += str2;
- module += c3;
+ strEntryName2 += cStave;
+
+ for(Int_t cHS=0; cHS<2; cHS++)
+ {
+ halfStave = stave;
+ halfStave += str1Bis;
+ halfStave += cHS;
+ halfStave += str1Tierce;
strEntryName3 = strEntryName2;
- strEntryName3 += strLadder;
- strEntryName3 += (c3-1);
- if(!gGeoManager->SetAlignableEntry(strEntryName3.Data(),module.Data()))
- AliFatal("Unable to set alignable entry!!");
- //printf("%s == %s\n",strEntryName3.Data(),module.Data());
-
- // Creates the TGeo Local to Tracking transformation matrix ...
- TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(strEntryName3.Data());
- const char *path = alignableEntry->GetTitle();
- if (!gGeoManager->cd(path))
- AliFatal(Form("Volume path %s not valid!",path));
- TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
- gtrans = globMatrix->GetTranslation();
- memcpy(&rotMatrix[0], globMatrix->GetRotationMatrix(), 9*sizeof(Double_t));
- al = TMath::ATan2(rotMatrix[1],rotMatrix[0]) + TMath::Pi();
- TGeoHMatrix *matLtoT = new TGeoHMatrix;
- matLtoT->SetDx(-gtrans[0]*TMath::Cos(al)-gtrans[1]*TMath::Sin(al) ); // translation
- al += TMath::Pi()/2;
- //matLtoT->SetDy( gtrans[0]*TMath::Cos(al)+gtrans[1]*TMath::Sin(al) );
- // not taking into account the shift w.r.t. sensitive volume
- // matLtoT->SetDy( gtrans[0]*TMath::Cos(al)+gtrans[1]*TMath::Sin(al) + fChip2*0.0001/2.);
- matLtoT->SetDy(-fChip2*0.0001/2.);
- matLtoT->SetDz(-gtrans[2]);
- rotMatrix[0]= 0; rotMatrix[1]= 1; rotMatrix[2]= 0; // + rotation
- rotMatrix[3]= 1; rotMatrix[4]= 0; rotMatrix[5]= 0;
- rotMatrix[6]= 0; rotMatrix[7]= 0; rotMatrix[8]=-1;
- TGeoRotation rot;
- rot.SetMatrix(rotMatrix);
- matLtoT->MultiplyLeft(&rot);
- TGeoHMatrix *matTtoL = new TGeoHMatrix(matLtoT->Inverse());
- delete matLtoT;
- alignableEntry->SetMatrix(matTtoL);
+ strEntryName3 += strHalfStave;
+ strEntryName3 += cHS;
+ //printf("%s == %s\n",strEntryName3.Data(),halfStave.Data()); // this is a half-stave
+ if(!gGeoManager->SetAlignableEntry(strEntryName3.Data(),halfStave.Data()))
+ AliFatal("Unable to set alignable entry!!");
+
+ for(Int_t cLad =0; cLad<2; cLad++)
+ {
+ modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
+ module = halfStave;
+ module += str2;
+ module += cLad+cHS*2+1;
+ strEntryName4 = strEntryName3;
+ strEntryName4 += strLadder;
+ strEntryName4 += cLad+cHS*2;
+ //printf("%s == %s\n",strEntryName4.Data(),module.Data());
+ if(!gGeoManager->SetAlignableEntry(strEntryName4.Data(),module.Data(),modUID))
+ AliFatal("Unable to set alignable entry!!");
+
+ // Creates the TGeo Local to Tracking transformation matrix ...
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
+ TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig();
+ gtrans = globMatrix->GetTranslation();
+ memcpy(&rotMatrix[0], globMatrix->GetRotationMatrix(), 9*sizeof(Double_t));
+ al = TMath::ATan2(rotMatrix[1],rotMatrix[0]) + TMath::Pi();
+ TGeoHMatrix *matLtoT = new TGeoHMatrix;
+ matLtoT->SetDx(-gtrans[0]*TMath::Cos(al)-gtrans[1]*TMath::Sin(al) ); // translation
+ al += TMath::Pi()/2;
+
+ matLtoT->SetDy(-fChip2*0.0001/2.);
+ matLtoT->SetDz(-gtrans[2]);
+ rotMatrix[0]= 0; rotMatrix[1]= 1; rotMatrix[2]= 0; // + rotation
+ rotMatrix[3]= 1; rotMatrix[4]= 0; rotMatrix[5]= 0;
+ rotMatrix[6]= 0; rotMatrix[7]= 0; rotMatrix[8]=-1;
+ TGeoRotation rot;
+ rot.SetMatrix(rotMatrix);
+ matLtoT->MultiplyLeft(&rot);
+ TGeoHMatrix *matTtoL = new TGeoHMatrix(matLtoT->Inverse());
+ delete matLtoT;
+ alignableEntry->SetMatrix(matTtoL);
+ }
}
}
}
}
-
+
//===== SDD layer1 =====
{
+ layerId = AliGeomManager::kSDD1;
+ modnum = 0;
TString str0 = "ALIC_1/ITSV_1/ITSD_1/IT34_1/I004_";
TString str1 = "/I302_";
TString ladder;
TString wafer;
- for(Int_t c1 = 1; c1<=14; c1++){
-
+ for(Int_t c1 = 1; c1<=14; c1++)
+ {
ladder = str0;
ladder += c1; // the set of wafers from one ladder
strEntryName1 = strSDD;
AliFatal("Unable to set alignable entry!!");
//printf("%s == %s\n",strEntryName1.Data(),ladder.Data());
- for(Int_t c2 =1; c2<=6; c2++){
-
+ for(Int_t c2 =1; c2<=6; c2++)
+ {
+ modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
wafer = ladder;
wafer += str1;
wafer += c2; // one wafer
strEntryName2 = strEntryName1;
strEntryName2 += strSensor;
strEntryName2 += (c2-1);
- if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data()))
+ if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data(),modUID))
AliFatal("Unable to set alignable entry!!");
//printf("%s == %s\n",strEntryName2.Data(),wafer.Data());
// Creates the TGeo Local to Tracking transformation matrix ...
- TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(strEntryName2.Data());
- const char *path = alignableEntry->GetTitle();
- if (!gGeoManager->cd(path))
- AliFatal(Form("Volume path %s not valid!",path));
- TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
+ TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig();
gtrans = globMatrix->GetTranslation();
memcpy(&rotMatrix[0], globMatrix->GetRotationMatrix(), 9*sizeof(Double_t));
al = TMath::ATan2(rotMatrix[1],rotMatrix[0]) + TMath::Pi();
//===== SDD layer2 =====
{
+ layerId = AliGeomManager::kSDD2;
+ modnum = 0;
TString str0 = "ALIC_1/ITSV_1/ITSD_1/IT34_1/I005_";
TString str1 = "/I402_";
TString ladder;
TString wafer;
- for(Int_t c1 = 1; c1<=22; c1++){
-
+ for(Int_t c1 = 1; c1<=22; c1++)
+ {
ladder = str0;
ladder += c1; // the set of wafers from one ladder
strEntryName1 = strSDD;
AliFatal("Unable to set alignable entry!!");
//printf("%s == %s\n",strEntryName1.Data(),ladder.Data());
- for(Int_t c2 =1; c2<=8; c2++){
-
+ for(Int_t c2 =1; c2<=8; c2++)
+ {
+ modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
wafer = ladder;
wafer += str1;
wafer += c2; // one wafer
strEntryName2 = strEntryName1;
strEntryName2 += strSensor;
strEntryName2 += (c2-1);
- if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data()))
+ if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data(),modUID))
AliFatal("Unable to set alignable entry!!");
//printf("%s == %s\n",strEntryName2.Data(),wafer.Data());
// Creates the TGeo Local to Tracking transformation matrix ...
- TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(strEntryName2.Data());
- const char *path = alignableEntry->GetTitle();
- if (!gGeoManager->cd(path))
- AliFatal(Form("Volume path %s not valid!",path));
- TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
+ TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig();
gtrans = globMatrix->GetTranslation();
memcpy(&rotMatrix[0], globMatrix->GetRotationMatrix(), 9*sizeof(Double_t));
al = TMath::ATan2(rotMatrix[1],rotMatrix[0]) + TMath::Pi();
//===== SSD layer1 =====
{
+ layerId = AliGeomManager::kSSD1;
+ modnum = 0;
TString str0 = "ALIC_1/ITSV_1/ITSD_1/IT56_1/I565_";
TString str1 = "/I562_";
TString ladder;
TString wafer;
- for(Int_t c1 = 1; c1<=34; c1++){
-
+ for(Int_t c1 = 1; c1<=34; c1++)
+ {
ladder = str0;
ladder += c1; // the set of wafers from one ladder
strEntryName1 = strSSD;
AliFatal("Unable to set alignable entry!!");
//printf("%s == %s\n",strEntryName1.Data(),ladder.Data());
- for(Int_t c2 = 1; c2<=22; c2++){
-
+ for(Int_t c2 = 1; c2<=22; c2++)
+ {
+ modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
wafer = ladder;
wafer += str1;
wafer += c2; // one wafer
strEntryName2 = strEntryName1;
strEntryName2 += strSensor;
strEntryName2 += (c2-1);
- if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data()))
+ if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data(),modUID))
AliFatal("Unable to set alignable entry!!");
//printf("%s == %s\n",strEntryName2.Data(),wafer.Data());
// Creates the TGeo Local to Tracking transformation matrix ...
- TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(strEntryName2.Data());
- const char *path = alignableEntry->GetTitle();
- if (!gGeoManager->cd(path))
- AliFatal(Form("Volume path %s not valid!",path));
- TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
+ TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig();
gtrans = globMatrix->GetTranslation();
memcpy(&rotMatrix[0], globMatrix->GetRotationMatrix(), 9*sizeof(Double_t));
al = TMath::ATan2(rotMatrix[1],rotMatrix[0]) + TMath::Pi();
//===== SSD layer2 =====
{
+ layerId = AliGeomManager::kSSD2;
+ modnum = 0;
TString str0 = "ALIC_1/ITSV_1/ITSD_1/IT56_1/I569_";
TString str1 = "/I566_";
TString ladder;
TString wafer;
- for(Int_t c1 = 1; c1<=38; c1++){
-
+ for(Int_t c1 = 1; c1<=38; c1++)
+ {
ladder = str0;
ladder += c1; // the set of wafers from one ladder
strEntryName1 = strSSD;
AliFatal("Unable to set alignable entry!!");
//printf("%s == %s\n",strEntryName1.Data(),ladder.Data());
- for(Int_t c2 = 1; c2<=25; c2++){
-
+ for(Int_t c2 = 1; c2<=25; c2++)
+ {
+ modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
wafer = ladder;
wafer += str1;
wafer += c2; // one wafer
strEntryName2 = strEntryName1;
strEntryName2 += strSensor;
strEntryName2 += (c2-1);
- if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data()))
+ if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data(),modUID))
AliFatal("Unable to set alignable entry!!");
//printf("%s == %s\n",strEntryName2.Data(),wafer.Data());
// Creates the TGeo Local to Tracking transformation matrix ...
- TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(strEntryName2.Data());
- const char *path = alignableEntry->GetTitle();
- if (!gGeoManager->cd(path))
- AliFatal(Form("Volume path %s not valid!",path));
- TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
+ TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig();
gtrans = globMatrix->GetTranslation();
memcpy(&rotMatrix[0], globMatrix->GetRotationMatrix(), 9*sizeof(Double_t));
al = TMath::ATan2(rotMatrix[1],rotMatrix[0]) + TMath::Pi();
}
}
}
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::BuildGeometry(){
// Geometry builder for the ITS version 10. Event Display geometry.
node->SetLineColor(kColorITS);
fNodes->Add(node);
}
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::CreateGeometry(){
// This routine defines and Creates the geometry for version 10 of
gMC->Gspos("I124",1,"I12B",-0.4965,6.8742,0.0,idrotm[215],"ONLY");
gMC->Gspos("I105",3,"I10B",-0.05,-0.01,-16.844,idrotm[201],"ONLY");
gMC->Gspos("I105",4,"I10B",-0.05,-0.01,16.844,0,"ONLY");
- gMC->Gspos("I107",2,"I10B",-0.0455,-di10b[1]+di107[1],3.536,0,"ONLY");
- gMC->Gspos("I107",1,"I10B",-0.0455,-di10b[1]+di107[1],10.708,0,"ONLY");
- gMC->Gspos("I107",4,"I10B",-0.0455,-di10b[1]+di107[1],-10.708,0,"ONLY");
- gMC->Gspos("I107",3,"I10B",-0.0455,-di10b[1]+di107[1],-3.536,0,"ONLY");
+
+ // Insertion of half-stave level in SPD1:
+ gGeoManager->MakeVolumeAssembly("L1H-STAVE0");
+ gGeoManager->MakeVolumeAssembly("L1H-STAVE1");
+ gMC->Gspos("L1H-STAVE0",1,"I10B",0,0,0,0,"ONLY");
+ gMC->Gspos("L1H-STAVE1",1,"I10B",0,0,0,0,"ONLY");
+ gMC->Gspos("I107",1,"L1H-STAVE0",-0.0455,-di10b[1]+di107[1],10.708,0,"ONLY");
+ gMC->Gspos("I107",2,"L1H-STAVE0",-0.0455,-di10b[1]+di107[1],3.536,0,"ONLY");
+ gMC->Gspos("I107",3,"L1H-STAVE1",-0.0455,-di10b[1]+di107[1],-3.536,0,"ONLY");
+ gMC->Gspos("I107",4,"L1H-STAVE1",-0.0455,-di10b[1]+di107[1],-10.708,0,"ONLY");
+// gMC->Gspos("I107",2,"I10B",-0.0455,-di10b[1]+di107[1],3.536,0,"ONLY");
+// gMC->Gspos("I107",1,"I10B",-0.0455,-di10b[1]+di107[1],10.708,0,"ONLY");
+// gMC->Gspos("I107",4,"I10B",-0.0455,-di10b[1]+di107[1],-10.708,0,"ONLY");
+// gMC->Gspos("I107",3,"I10B",-0.0455,-di10b[1]+di107[1],-3.536,0,"ONLY");
+
+ // Insertion of half-stave level in SPD2:
+ gGeoManager->MakeVolumeAssembly("L2H-STAVE0");
+ gGeoManager->MakeVolumeAssembly("L2H-STAVE1");
+ gMC->Gspos("L2H-STAVE0",1,"I20B",0,0,0,0,"ONLY");
+ gMC->Gspos("L2H-STAVE1",1,"I20B",0,0,0,0,"ONLY");
+ gMC->Gspos("I1D7",1,"L2H-STAVE0",-0.0455,-di20b[1]+di1d7[1],10.708,0,"ONLY");
+ gMC->Gspos("I1D7",2,"L2H-STAVE0",-0.0455,-di20b[1]+di1d7[1],3.536,0,"ONLY");
+ gMC->Gspos("I1D7",3,"L2H-STAVE1",-0.0455,-di20b[1]+di1d7[1],-3.536,0,"ONLY");
+ gMC->Gspos("I1D7",4,"L2H-STAVE1",-0.0455,-di20b[1]+di1d7[1],-10.708,0,"ONLY");
+// gMC->Gspos("I1D7",2,"I20B",-0.0455,-di20b[1]+di1d7[1],3.536,0,"ONLY");
+// gMC->Gspos("I1D7",1,"I20B",-0.0455,-di20b[1]+di1d7[1],10.708,0,"ONLY");
+// gMC->Gspos("I1D7",4,"I20B",-0.0455,-di20b[1]+di1d7[1],-10.708,0,"ONLY");
+// gMC->Gspos("I1D7",3,"I20B",-0.0455,-di20b[1]+di1d7[1],-3.536,0,"ONLY");
+
gMC->Gspos("I109",1,"I10B",-0.138,0.015,-16.844,idrotm[201],"ONLY");
gMC->Gspos("I109",2,"I10B",-0.138,0.015,16.844,0,"ONLY");
gMC->Gspos("I108",1,"I10B",-0.138,-di10b[1]+2.*di107[1]+di108[1],0.0,0,"ONLY");
gMC->Gspos("I105",1,"I20B",-0.05,-0.01,-16.844,idrotm[201],"ONLY");
gMC->Gspos("I105",2,"I20B",-0.05,-0.01,16.844,0,"ONLY");
- gMC->Gspos("I1D7",2,"I20B",-0.0455,-di20b[1]+di1d7[1],3.536,0,"ONLY");
- gMC->Gspos("I1D7",1,"I20B",-0.0455,-di20b[1]+di1d7[1],10.708,0,"ONLY");
- gMC->Gspos("I1D7",4,"I20B",-0.0455,-di20b[1]+di1d7[1],-10.708,0,"ONLY");
- gMC->Gspos("I1D7",3,"I20B",-0.0455,-di20b[1]+di1d7[1],-3.536,0,"ONLY");
gMC->Gspos("I109",3,"I20B",-0.138,0.015,-16.844,idrotm[201],"ONLY");
gMC->Gspos("I109",4,"I20B",-0.138,0.015,16.844,0,"ONLY");
gMC->Gspos("I108",2,"I20B",-0.138,-di20b[1]+2.*di1d7[1]+di108[1],0.0,0,"ONLY");
}
}
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::CreateMaterials(){
// Create ITS materials
AliMaterial(96, "SSD cone$",63.546, 29., 1.15, 1.265, 999);
AliMedium(96,"SSD cone$",96,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
}
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::InitAliITSgeom(){
// Based on the geometry tree defined in Geant 3.21, this
} // end for lay
return;
}
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::Init(){
// Initialise the ITS after it has been created.
//
fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
}
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::SetDefaults(){
// sets the default segmentation, response, digit and raw cluster classes
// Return:
// none.
- const Float_t kconv = 1.0e+04; // convert cm to microns
-
if(!fDetTypeSim){
Warning("SetDefaults","Error fDetTypeSim not defined");
return;
}
- AliITSgeomSPD *s0;
- AliITSgeomSDD *s1;
- AliITSgeomSSD *s2;
- Int_t i;
- Float_t bx[256],bz[280];
-
fDetTypeSim->SetDefaults();
- //SPD
- s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);
- // Get shape info. Do it this way for now.
- //AliITSCalibrationSPD* resp0=new AliITSCalibrationSPD();
- AliITSsegmentationSPD* seg0 =
- (AliITSsegmentationSPD*)fDetTypeSim->GetSegmentationModel(0);
- seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
- s0->GetDz()*2.*kconv, // for now.
- s0->GetDy()*2.*kconv); // x,z,y full width in microns.
- seg0->SetNPads(256,160);// Number of Bins in x and z
- for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
- for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
- for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
- bz[ 31] = bz[ 32] = 625.0; // first chip boundry
- bz[ 63] = bz[ 64] = 625.0; // first chip boundry
- bz[ 95] = bz[ 96] = 625.0; // first chip boundry
- bz[127] = bz[128] = 625.0; // first chip boundry
- bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
- seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
- SetSegmentationModel(kSPD,seg0);
- // set digit and raw cluster classes to be used
- const char *kData0=(fDetTypeSim->GetCalibrationModel(
- GetITSgeom()->GetStartSPD()))->DataType();
- if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,
- "AliITSdigit");
- else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
- // SDD
- s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);
- // Get shape info. Do it this way for now.
-
- //AliITSCalibrationSDD* resp1=new AliITSCalibrationSDD("simulated");
- AliITSsegmentationSDD* seg1 =
- (AliITSsegmentationSDD*)fDetTypeSim->GetSegmentationModel(1);
- seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
- s1->GetDz()*2.*kconv, // for now.
- s1->GetDy()*2.*kconv); // x,z,y full width in microns.
- seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
- SetSegmentationModel(kSDD,seg1);
- const char *kData1=(fDetTypeSim->GetCalibrationModel(
- GetITSgeom()->GetStartSDD()))->DataType();
- AliITSCalibrationSDD* rsp =
- (AliITSCalibrationSDD*)fDetTypeSim->GetCalibrationModel(
- GetITSgeom()->GetStartSDD());
- const char *kopt=rsp->GetZeroSuppOption();
- if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
- fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
- } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
- // SSD Layer 5
-
- s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);
- // Get shape info. Do it this way for now.
-
-
- //SetCalibrationModel(GetITSgeom()->GetStartSSD(),
- // new AliITSCalibrationSSD("simulated"));
- AliITSsegmentationSSD* seg2 =
- (AliITSsegmentationSSD*)fDetTypeSim->GetSegmentationModel(2);
- seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
- s2->GetDz()*2.*kconv, // for now.
- s2->GetDy()*2.*kconv); // x,z,y full width in microns.
- seg2->SetPadSize(95.,0.); // strip x pitch in microns
- seg2->SetNPads(768,0); // number of strips on each side.
- seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
- seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
- seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
- SetSegmentationModel(kSSD,seg2);
- const char *kData2=(fDetTypeSim->GetCalibrationModel(
- GetITSgeom()->GetStartSSD()))->DataType();
- if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,
- "AliITSdigit");
- else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
if(fgkNTYPES>3){
Warning("SetDefaults",
"Only the four basic detector types are initialised!");
}// end if
return;
}
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::DrawModule() const{
// Draw a shaded view of the FMD version 10.
gMC->Gdhead(1111, "Inner Tracking System Version 1");
gMC->Gdman(17, 6, "MAN");
}
+
/*
//______________________________________________________________________
void AliITSvPPRasymmFMD::StepManager(){
}
*/
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::StepManager(){
// Called for every step in the ITS, then calles the AliITShit class
switch (kk){
case 0:case 1: // SPD
gMC->CurrentVolOffID(2,cpn2);
- gMC->CurrentVolOffID(3,cpn1);
- gMC->CurrentVolOffID(4,cpn0);
+ gMC->CurrentVolOffID(4,cpn1);
+ gMC->CurrentVolOffID(5,cpn0);
break;
case 2:case 3: // SDD
cpn2 = 1;
*/
return;
}
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::PrintAscii(ostream *os)const{
// Print out class data values in Ascii Form to output stream
os->flags(fmt); // reset back to old Formating.
return;
}
+
//______________________________________________________________________
void AliITSvPPRasymmFMD::ReadAscii(istream *is){
// Read in class data values in Ascii Form to output stream
fIgm.SetGeometryName("ITS PPR aymmetric services with course"
" cables on cones");
}
+
//______________________________________________________________________
ostream &operator<<(ostream &os,const AliITSvPPRasymmFMD &s){
// Standard output streaming function
s.PrintAscii(&os);
return os;
}
+
//______________________________________________________________________
istream &operator>>(istream &is,AliITSvPPRasymmFMD &s){
// Standard inputput streaming function