// See AliITSvPPRasymmFMD::StepManager().
-#include <Riostream.h>
-// #include <stdio.h>
-// #include <stdlib.h>
-
-// #include <TBRIK.h>
-// #include <TCanvas.h>
#include <TClonesArray.h>
-// #include <TFile.h> // only required for Tracking function?
#include <TGeometry.h>
#include <TLorentzVector.h>
-#include <TMath.h>
+#include <TGeoMatrix.h>
+#include <TGeoPhysicalNode.h>
+#include <TArrayD.h>
+#include <TArrayF.h>
+#include <TString.h>
#include <TNode.h>
-// #include <TObjArray.h>
-// #include <TObjString.h>
-// #include <TPCON.h>
-// #include <TSystem.h>
#include <TTUBE.h>
-// #include <TTUBS.h>
-// #include <TVirtualMC.h>
+#include <TGeoManager.h>
+#include <TGeoVolume.h>
+#include <TVirtualMC.h>
-// #include "AliConst.h"
#include "AliITS.h"
-// #include "AliITSClusterFinderSDD.h"
-// #include "AliITSClusterFinderSPD.h"
-// #include "AliITSClusterFinderSSD.h"
-#include "AliITSDetType.h"
-#include "AliITSGeant3Geometry.h"
+#include "AliITSDetTypeSim.h"
#include "AliITSgeom.h"
#include "AliITSgeomSDD.h"
#include "AliITSgeomSPD.h"
#include "AliITSgeomSSD.h"
#include "AliITShit.h"
#include "AliITSresponseSDD.h"
-#include "AliITSresponseSPD.h"
-#include "AliITSresponseSSD.h"
+#include "AliITSCalibrationSDD.h"
+#include "AliITSCalibrationSPD.h"
+#include "AliITSCalibrationSSD.h"
#include "AliITSsegmentationSDD.h"
#include "AliITSsegmentationSPD.h"
#include "AliITSsegmentationSSD.h"
-// #include "AliITSsimulationSDD.h"
-// #include "AliITSsimulationSPD.h"
-// #include "AliITSsimulationSSD.h"
#include "AliITSvPPRasymmFMD.h"
+#include "AliLog.h"
+#include "AliMC.h"
#include "AliMagF.h"
#include "AliRun.h"
#include "AliTrackReference.h"
-#include "AliMC.h"
+
#define GEANTGEOMETRY kTRUE
ClassImp(AliITSvPPRasymmFMD)
//______________________________________________________________________
-AliITSvPPRasymmFMD::AliITSvPPRasymmFMD() {
+AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(): AliITS(),
+fGeomDetOut(kFALSE),
+fGeomDetIn(kFALSE),
+fByThick(kTRUE),
+fMajorVersion(IsVersion()),
+fMinorVersion(-1),
+fDet1(0),
+fDet2(0),
+fChip1(0),
+fChip2(0),
+fRails(0),
+fFluid(0),
+fIDMother(0)
+ {
// Standard default constructor for the ITS version 10.
// Inputs:
// none.
// Return:
// none.
Int_t i;
-
- fIdN = 0;
- fIdName = 0;
- fIdSens = 0;
- fEuclidOut = kFALSE; // Don't write Euclide file
- fGeomDetOut = kFALSE; // Don't write .det file
- fGeomDetIn = kTRUE; // Read .det file
- fMajorVersion = IsVersion();
- fMinorVersion = -1;
for(i=0;i<60;i++) fRead[i] = '\0';
for(i=0;i<60;i++) fWrite[i] = '\0';
for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
}
//______________________________________________________________________
AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const char *name, const char *title)
- : AliITS("ITS", title){
+ : AliITS("ITS", title),
+ fGeomDetOut(kFALSE),
+ fGeomDetIn(kFALSE),
+ fByThick(kTRUE),
+ fMajorVersion(IsVersion()),
+ fMinorVersion(2),
+ fDet1(0),
+ fDet2(0),
+ fChip1(0),
+ fChip2(0),
+ fRails(0),
+ fFluid(0),
+ fIDMother(0) {
// Standard constructor for the ITS version 10.
// Inputs:
// const char * name Ignored, set to "ITS"
fIdName[5] = "ITS6";
fIdSens = new Int_t[fIdN];
for(i=0;i<fIdN;i++) fIdSens[i] = 0;
- fMajorVersion = IsVersion();
- fMinorVersion = 2;
- fEuclidOut = kFALSE; // Don't write Euclide file
- fGeomDetOut = kFALSE; // Don't write .det file
- fGeomDetIn = kTRUE; // Read .det file
SetThicknessDet1();
SetThicknessDet2();
SetThicknessChip1();
strncpy(fRead,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det",60);
}
//______________________________________________________________________
-AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const AliITSvPPRasymmFMD &source) :
- AliITS(source){
- // Copy Constructor for ITS version 10. This function is not to be
- // used. If any other instance of this function, other than "this" is
- // passed, an error message is returned.
- // Inputs:
- // const AliITSvPPRasymmFMD &source This class
- // Outputs:
- // none.
- // Return:
- // an error message
-
- if(&source == this) return;
- Warning("Copy Constructor","Not allowed to copy AliITSvPPRasymmFMD");
- return;
-}
-//______________________________________________________________________
-AliITSvPPRasymmFMD& AliITSvPPRasymmFMD::operator=(const AliITSvPPRasymmFMD
- &source){
- // Assignment operator for the ITS version 10. This function is not
- // to be used. If any other instance of this function, other than "this"
- // is passed, an error message is returned.
- // Inputs:
- // const AliITSvPPRasymmFMD &source This class
- // Outputs:
- // none.
- // Return:
- // an error message
-
- if(&source == this) return *this;
- Warning("= operator","Not allowed to copy AliITSvPPRasymmFMD");
- return *this;
-}
-//______________________________________________________________________
AliITSvPPRasymmFMD::~AliITSvPPRasymmFMD() {
// Standard destructor for the ITS version 10.
// Inputs:
// none.
}
//______________________________________________________________________
+void AliITSvPPRasymmFMD::AddAlignableVolumes() const
+{
+ //
+ // Creates entries for alignable volumes associating the symbolic volume
+ // name with the corresponding volume path.
+ //
+ // Records in the alignable entries the transformation matrices converting
+ // TGeo local coordinates (in the RS of alignable volumes) to the tracking
+ // system
+ // For this, this function has to run before the misalignment because we
+ // are using the ideal positions in the AliITSgeom object.
+
+ AliInfo("Add ITS alignable volumes");
+
+ if (!gGeoManager) {
+ AliFatal("TGeoManager doesn't exist !");
+ return;
+ }
+
+ if( !gGeoManager->SetAlignableEntry("ITS","ALIC_1/ITSV_1") )
+ AliFatal("Unable to set alignable entry!!");
+
+ Double_t al, *gtrans, rotMatrix[9];
+
+ TString strSPD = "ITS/SPD";
+ TString strSDD = "ITS/SDD";
+ TString strSSD = "ITS/SSD";
+ TString strStave = "/Stave";
+ TString strLadder = "/Ladder";
+ TString strSector = "/Sector";
+ TString strSensor = "/Sensor";
+ TString strEntryName1;
+ TString strEntryName2;
+ TString strEntryName3;
+
+ //===== SPD layer1 =====
+ {
+ TString str0 = "ALIC_1/ITSV_1/ITSD_1/IT12_1/I12B_";
+ TString str1 = "/I10B_";
+ TString str2 = "/I107_";
+
+ TString sector;
+ TString stave;
+ TString module;
+
+ for(Int_t c1 = 1; c1<=10; c1++){
+
+ sector = str0;
+ sector += c1; // this is one full sector
+ strEntryName1 = strSPD;
+ strEntryName1 += 0;
+ 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());
+
+ for(Int_t c2 =1; c2<=2; c2++){
+
+ stave = sector;
+ stave += str1;
+ stave += c2;
+ 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;
+ 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]);
+ 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);
+ }
+ }
+ }
+ }
+
+ //===== 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++){
+
+ sector = str0;
+ sector += c1; // 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());
+
+ for(Int_t c2 =1; c2<=4; c2++){
+
+ stave = sector;
+ stave += str1;
+ stave += c2;
+ 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;
+ 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);
+ }
+ }
+ }
+ }
+
+ //===== SDD layer1 =====
+ {
+ 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++){
+
+ ladder = str0;
+ ladder += c1; // the set of wafers from one ladder
+ strEntryName1 = strSDD;
+ strEntryName1 += 2;
+ strEntryName1 +=strLadder;
+ strEntryName1 += (c1-1);
+ if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data()))
+ AliFatal("Unable to set alignable entry!!");
+ //printf("%s == %s\n",strEntryName1.Data(),ladder.Data());
+
+ for(Int_t c2 =1; c2<=6; c2++){
+
+ wafer = ladder;
+ wafer += str1;
+ wafer += c2; // one wafer
+ strEntryName2 = strEntryName1;
+ strEntryName2 += strSensor;
+ strEntryName2 += (c2-1);
+ if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data()))
+ 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();
+ 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) );
+ matLtoT->SetDy( 0 );
+ 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 layer2 =====
+ {
+ 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++){
+
+ ladder = str0;
+ ladder += c1; // the set of wafers from one ladder
+ strEntryName1 = strSDD;
+ strEntryName1 += 3;
+ strEntryName1 +=strLadder;
+ strEntryName1 += (c1-1);
+ if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data()))
+ AliFatal("Unable to set alignable entry!!");
+ //printf("%s == %s\n",strEntryName1.Data(),ladder.Data());
+
+ for(Int_t c2 =1; c2<=8; c2++){
+
+ wafer = ladder;
+ wafer += str1;
+ wafer += c2; // one wafer
+ strEntryName2 = strEntryName1;
+ strEntryName2 += strSensor;
+ strEntryName2 += (c2-1);
+ if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data()))
+ 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();
+ 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) );
+ matLtoT->SetDy( 0 );
+ 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);
+ }
+ }
+ }
+
+ //===== SSD layer1 =====
+ {
+ 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++){
+
+ ladder = str0;
+ ladder += c1; // the set of wafers from one ladder
+ strEntryName1 = strSSD;
+ strEntryName1 += 4;
+ strEntryName1 +=strLadder;
+ strEntryName1 += (c1-1);
+ if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data()))
+ AliFatal("Unable to set alignable entry!!");
+ //printf("%s == %s\n",strEntryName1.Data(),ladder.Data());
+
+ for(Int_t c2 = 1; c2<=22; c2++){
+
+ wafer = ladder;
+ wafer += str1;
+ wafer += c2; // one wafer
+ strEntryName2 = strEntryName1;
+ strEntryName2 += strSensor;
+ strEntryName2 += (c2-1);
+ if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data()))
+ 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();
+ 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) );
+ matLtoT->SetDy( 0 );
+ 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);
+ }
+ }
+ }
+
+ //===== SSD layer2 =====
+ {
+ 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++){
+
+ ladder = str0;
+ ladder += c1; // the set of wafers from one ladder
+ strEntryName1 = strSSD;
+ strEntryName1 += 5;
+ strEntryName1 +=strLadder;
+ strEntryName1 += (c1-1);
+ if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data()))
+ AliFatal("Unable to set alignable entry!!");
+ //printf("%s == %s\n",strEntryName1.Data(),ladder.Data());
+
+ for(Int_t c2 = 1; c2<=25; c2++){
+
+ wafer = ladder;
+ wafer += str1;
+ wafer += c2; // one wafer
+ strEntryName2 = strEntryName1;
+ strEntryName2 += strSensor;
+ strEntryName2 += (c2-1);
+ if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data()))
+ 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();
+ 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) );
+ matLtoT->SetDy( 0 );
+ 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);
+ }
+ }
+ }
+}
+//______________________________________________________________________
void AliITSvPPRasymmFMD::BuildGeometry(){
// Geometry builder for the ITS version 10. Event Display geometry.
// Inputs:
dchip2 = GetThicknessChip2();
if(ddet1 < 100. || ddet1 > 300.) {
- cout << "ITS - WARNING: the detector thickness for layer 1 is outside "
- "the range of [100,300] microns. The default value of 200 microns "
- "will be used." << endl;
+ AliWarning("The detector thickness for layer 1 is outside ");
+ AliWarning("the range of [100,300] microns. The default value of 200 microns ");
+ AliWarning("will be used.");
ddet1=200.;
} // end if
if(ddet2 < 100. || ddet2 > 300.) {
- cout << "ITS - WARNING: the detector thickness for layer 2 is outside "
- "the range of [100,300] microns. The default value of 200 microns "
- "will be used." << endl;
+ AliWarning("The detector thickness for layer 2 is outside ");
+ AliWarning("the range of [100,300] microns. The default value of 200 microns ");
+ AliWarning("will be used.");
ddet2=200.;
}// end if
if(dchip1 < 100. || dchip1 > 300.) {
- cout << "ITS - WARNING: the chip thickness for layer 1 is outside "
- "the range of [100,300] microns. The default value of 200 microns "
- "will be used." << endl;
- dchip1=200.;
+ AliWarning("The chip thickness for layer 1 is outside");
+ AliWarning("the range of [100,300] microns. The default value of 200 microns");
+ AliWarning("will be used.");
+ dchip1=200.;
}// end if
if(dchip2 < 100. || dchip2 > 300.) {
- cout << "ITS - WARNING: the chip thickness for layer 2 is outside "
- "the range of [100,300] microns. The default value of 200 microns"
- " will be used." << endl;
- dchip2=200.;
+ AliWarning("The chip thickness for layer 2 is outside");
+ AliWarning("the range of [100,300] microns. The default value of 200 microns");
+ AliWarning("will be used");
+ dchip2=200.;
}// end if
Int_t rails = 1; // flag for rails (1 --> rails in; 0 --> rails out)
fluid = GetCoolingFluid();
if(rails != 0 && rails != 1) {
- cout << "ITS - WARNING: the switch for rails is not set neither "
- "to 0 (rails out) nor to 1 (rails in). The default value of "
- "1 (rails in) will be used." << endl;
+ AliWarning("The switch for rails is not set neither");
+ AliWarning("to 0 (rails out) nor to 1 (rails in). The default value of");
+ AliWarning("1 (rails in) will be used");
+ rails=1;
}// end if
- cout << "ITS: Detector thickness on layer 1 is set to " <<
- ddet1 << " microns." << endl;
- cout << "ITS: Chip thickness on layer 1 is set to " <<
- dchip1 << " microns." << endl;
- cout << "ITS: Detector thickness on layer 2 is set to " <<
- ddet2 << " microns." << endl;
- cout << "ITS: Chip thickness on layer 2 is set to " <<
- dchip2 << " microns." << endl;
+ AliDebug(1,Form("Detector thickness on layer 1 is set to %f microns",ddet1));
+ AliDebug(1,Form("Chip thickness on layer 1 is set to %f microns",dchip1));
+ AliDebug(1,Form("Detector thickness on layer 2 is set to %f microns",ddet2));
+ AliDebug(1,Form("Chip thickness on layer 2 is set to %f microns",dchip2));
if(rails == 0 ) {
- cout << "ITS: Rails are out." << endl;
+ AliDebug(1,"Rails are out.");
} else {
- cout << "ITS: Rails are in." << endl;
+ AliDebug(1,"Rails are in.");
}// end if
ddet1 = ddet1*0.0001/2.; // conversion from tot length in um to half in cm
AliMatrix(idrotm[218],90.0,337.003998,90.0,67.003998,0.0,0.0);
AliMatrix(idrotm[219],90.0,247.000305,90.0,337.000305,0.0,0.0);
AliMatrix(idrotm[220],90.0,305.633514,90.0,35.633499,0.0,0.0);
+
AliMatrix(idrotm[221],90.0,58.000198,90.0,148.000198,0.0,0.0);
AliMatrix(idrotm[222],90.0,327.997101,90.0,57.997101,0.0,0.0);
AliMatrix(idrotm[223],90.0,237.994202,90.0,327.994202,0.0,0.0);
dgh[46] = 62;
dgh[47] = 85.;
dgh[48] = ztpc+4.+0.1;
- dgh[49] = 62.4;
+ dgh[49] = 62.0;//62.4;
dgh[50] = 85.;
gMC->Gsvolu("ITSV", "PCON", idtmed[205], dgh, 51);
dits[4] = 75.261;
gMC->Gsvolu("I137", "TUBS", idtmed[253], dits, 5);
+
dits[0] = 1.3401;
dits[1] = 0.01;
dits[2] = 24;
cos30 = cos(30.*3.14159/180.);
sin30 = sin(30.*3.14159/180.);
-
+ Double_t maxRadius = 28.5;
dits[0] = 0;
dits[1] = 360;
dits[2] = 6;
dits[3] = -34.6;
dits[4] = 23.49;
- dits[5] = 28;
+ dits[5] = maxRadius;
dits[6] = -27.35;
dits[7] = 23.49;
- dits[8] = 28;
+ dits[8] = maxRadius;
dits[9] = -27.35;
dits[10] = 14.59;
- dits[11] = 28;
+ dits[11] = maxRadius;
dits[12] = 27.35;
dits[13] = 14.59;
- dits[14] = 28;
+ dits[14] = maxRadius;
dits[15] = 27.35;
dits[16] = 23.49;
- dits[17] = 28;
+ dits[17] = maxRadius;
dits[18] = 34.6;
dits[19] = 23.49;
- dits[20] = 28;
+ dits[20] = maxRadius;
gMC->Gsvolu("IT34", "PCON", idtmed[209], dits, 21);
// block of the SDD electronics and related ladder frame
dits[18] = 57.45;
dits[19] = 43.6;
dits[20] = 48;
- gMC->Gsvolu("IT56", "PCON", idtmed[220], dits, 21);
+ //gMC->Gsvolu("IT56", "PCON", idtmed[220], dits, 21); // SSD air
+ gMC->Gsvolu("IT56", "PCON", idtmed[204], dits, 21); // air
dits[0] = 3.4;
dits[1] = 1.955;
gMC->Gspos("I116",1,"I113",0.0,0.0042,0.0,0,"ONLY");
gMC->Gspos("I111",1,"I113",-0.1318,-0.0008,0.0,idrotm[204],"ONLY");
gMC->Gspos("I112",1,"I113",-0.25,0.02,0.0,idrotm[203],"ONLY");
- gMC->Gspos("I106",1,"I107",0.0,-dchip1,-1.4,0,"ONLY");
- gMC->Gspos("I106",2,"I107",0.0,-dchip1,0.0,0,"ONLY");
- gMC->Gspos("I106",3,"I107",0.0,-dchip1,1.4,0,"ONLY");
- gMC->Gspos("I106",4,"I107",0.0,-dchip1,2.8,0,"ONLY");
- gMC->Gspos("I106",5,"I107",0.0,-dchip1,-2.8,0,"ONLY");
- gMC->Gspos("I101",1,"I107",0.0,ddet1,0.0,0,"ONLY");
- gMC->Gspos("I1D6",1,"I1D7",0.0,-dchip2,-1.4,0,"ONLY");
- gMC->Gspos("I1D6",2,"I1D7",0.0,-dchip2,0.0,0,"ONLY");
- gMC->Gspos("I1D6",3,"I1D7",0.0,-dchip2,1.4,0,"ONLY");
- gMC->Gspos("I1D6",4,"I1D7",0.0,-dchip2,2.8,0,"ONLY");
- gMC->Gspos("I1D6",5,"I1D7",0.0,-dchip2,-2.8,0,"ONLY");
- gMC->Gspos("I1D1",1,"I1D7",0.0,ddet2,0.0,0,"ONLY");
+ gMC->Gspos("I106",1,"I107",0.0,-ddet1,-1.4,0,"ONLY");
+ gMC->Gspos("I106",2,"I107",0.0,-ddet1,0.0,0,"ONLY");
+ gMC->Gspos("I106",3,"I107",0.0,-ddet1,1.4,0,"ONLY");
+ gMC->Gspos("I106",4,"I107",0.0,-ddet1,2.8,0,"ONLY");
+ gMC->Gspos("I106",5,"I107",0.0,-ddet1,-2.8,0,"ONLY");
+ gMC->Gspos("I101",1,"I107",0.0,dchip1,0.0,0,"ONLY");
+ gMC->Gspos("I1D6",1,"I1D7",0.0,-ddet2,-1.4,0,"ONLY");
+ gMC->Gspos("I1D6",2,"I1D7",0.0,-ddet2,0.0,0,"ONLY");
+ gMC->Gspos("I1D6",3,"I1D7",0.0,-ddet2,1.4,0,"ONLY");
+ gMC->Gspos("I1D6",4,"I1D7",0.0,-ddet2,2.8,0,"ONLY");
+ gMC->Gspos("I1D6",5,"I1D7",0.0,-ddet2,-2.8,0,"ONLY");
+ gMC->Gspos("I1D1",1,"I1D7",0.0,dchip2,0.0,0,"ONLY");
gMC->Gspos("I117",1,"I116",0.0,0.0,0.0,0,"ONLY");
gMC->Gspos("ITS1",1,"I101",0.0,0.0,0.0,0,"ONLY");
gMC->Gspos("ITS2",1,"I1D1",0.0,0.0,0.0,0,"ONLY");
gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
}
+
+ {
+ if (!gGeoManager) {
+ AliError("TGeoManager doesn't exist !");
+ return;
+ }
+
+ //====== Converting mother volumes of alignable objects
+ //====== into TGeoAssemblies :
+
+ TObjArray *list = gGeoManager->GetListOfVolumes();
+
+ {
+ char spdLaddName[20] = "I10B";
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(spdLaddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(spdLaddName,toTransform->GetName()) == 0);
+ }
+
+ // SPD 2
+ {
+ char spdLaddName[20] = "I20B";
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(spdLaddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(spdLaddName, toTransform->GetName()) == 0);
+ }
+
+ //---
+
+ // SPD 1
+ {
+ char spdLaddName[20] = "I107"; // "I107"
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(spdLaddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(spdLaddName,toTransform->GetName()) == 0);
+ }
+
+ // SPD 2
+ {
+ char spdLaddName[20] = "I1D7"; // "I1D7"
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(spdLaddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(spdLaddName, toTransform->GetName()) == 0);
+ }
+
+ // SDD 1
+ {
+ char sddLaddName[20] = "I004";// "I302"
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(sddLaddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(sddLaddName, toTransform->GetName()) == 0);
+ }
+
+ // SDD 2
+ {
+ char sddLaddName[20] = "I005";// "I402"
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(sddLaddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(sddLaddName, toTransform->GetName()) == 0);
+ }
+
+
+ // SSD 1
+ {
+ char ssdLaddName[20] = "I565";// "I562"
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(ssdLaddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(ssdLaddName,toTransform->GetName()) == 0);
+ }
+
+ // SSD 2
+ {
+ char ssdLaddName[20] = "I569";// "I566"
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(ssdLaddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(ssdLaddName, toTransform->GetName()) == 0);
+ }
+
+
+ //====== Converting some virtual volumes to assemblies in order
+ //====== to avoid overlaps :
+
+ {
+ char sddName[20] = "I047";
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(sddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(sddName, toTransform->GetName()) == 0);
+ }
+
+ {
+ char sddName[20] = "I048";
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(sddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(sddName, toTransform->GetName()) == 0);
+ }
+
+ {
+ char sddName[20] = "I018";
+
+ TGeoVolume *toTransform = gGeoManager->FindVolumeFast(sddName);
+ Int_t index = list->IndexOf(toTransform);
+ do {
+ TGeoVolume *transformed = 0; // this will be in fact TGeoVolumeAssembly
+ if (toTransform)
+ transformed = TGeoVolumeAssembly::MakeAssemblyFromVolume(toTransform);
+ if (transformed)
+ gGeoManager->ReplaceVolume(toTransform, transformed);
+ index++;
+ toTransform = (TGeoVolume*)list->At(index);
+ }
+ while (strcmp(sddName, toTransform->GetName()) == 0);
+ }
+
+
+ }
+
}
//______________________________________________________________________
void AliITSvPPRasymmFMD::CreateMaterials(){
// Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
// AliITSvPPRasymmFMD.
// In general it is automatically replaced by
- // the CreatMaterials routine defined in AliITSv?. Should the function
+ // the CreateMaterials routine defined in AliITSv?. Should the function
// CreateMaterials not exist for the geometry version you are using this
// one is used. See the definition found in AliITSv5 or the other routine
// for a complete definition.
Float_t wAlOxide[2] = {0.4707, 0.5293};
Float_t dAlOxide = 3.97;
-
AliMaterial(1,"SI$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
AliMedium(1,"SI$",1,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
AliMaterial(75,"ELASTO SIL$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
AliMedium(75,"ELASTO SIL$",75,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
- AliMaterial(76,"SPDBUS(AL+KPT+EPOX)$",0.19509E+02,0.96502E+01,0.19060E+01,0.15413E+02,0.99900E+03);
+ // SPD bus (data from Petra Riedler)
+ Float_t aSPDbus[5] = {1.00794,12.0107,14.01,15.9994,26.982 };
+ Float_t zSPDbus[5] = {1.,6.,7.,8.,13.};
+ Float_t wSPDbus[5] = {0.023523,0.318053,0.009776,0.078057,0.570591};
+ Float_t dSPDbus = 2.128505;
+
+ // AliMaterial(76,"SPDBUS(AL+KPT+EPOX)$",0.19509E+02,0.96502E+01,0.19060E+01,0.15413E+02,0.99900E+03);
+ AliMixture(76,"SPDBUS(AL+KPT+EPOX)$",aSPDbus,zSPDbus,dSPDbus,5,wSPDbus);
AliMedium(76,"SPDBUS(AL+KPT+EPOX)$",76,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
AliMixture(77,"SDD X7R capacitors$",aX7R,zX7R,dX7R,7,wX7R);
AliMixture(83,"SDD anode microcab$",aALVm,zALVm,dALVm,5,wALVm);
AliMedium(83,"SDD anode microcab$",83,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
-
- AliMaterial(84,"SDD/SSD rings$",0.123565E+02,0.64561E+01,0.18097E+01,0.229570E+02,0.99900E+03);
+ Float_t aDSring[4]={12.0107, 1.00794, 14.0067, 15.9994};
+ Float_t zDSring[4]={ 6., 1., 7., 8.};
+ Float_t wDSring[4]={ 0.854323888, 0.026408778, 0.023050265, 0.096217069};
+ Float_t dDSring = 0.2875;
+ AliMixture(84,"SDD/SSD rings$",aDSring,zDSring,dDSring,4,wDSring);
AliMedium(84,"SDD/SSD rings$",84,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
AliMixture(85,"inox/alum$",aInAl,zInAl,dInAl,5,wInAl);
AliMaterial(90,"SPD shield$", 12.011, 6., 1.93/10. , 22.1*10., 999);
AliMedium(90,"SPD shield$",90,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
- AliMaterial(91, "SPD End ladder$", 47.0447, 21.7963, 3.6374, 4.4711, 999);
+ // SPD End Ladder (data from Petra Riedler)
+ Float_t aSPDel[5] = {1.00794,12.0107,14.01,15.9994,63.54 };
+ Float_t zSPDel[5] = {1.,6.,7.,8.,29.};
+ Float_t wSPDel[5] = {0.004092,0.107274,0.011438,0.032476,0.844719};
+ Float_t dSPDel = 3.903403;
+
+ // AliMaterial(91, "SPD End ladder$", 47.0447, 21.7963, 3.6374, 4.4711, 999);
+ AliMixture(91,"SPD End ladder$",aSPDel,zSPDel,dSPDel,5,wSPDel);
AliMedium(91,"SPD End ladder$",91,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
AliMaterial(92, "SPD cone$",28.0855, 14., 2.33, 9.36, 999);
// none.
// Return:
// none.
-//#if GEANTGEOMETRY
- if(strcmp(gMC->GetName(),"TGeant3")) {
- Error("InitAliITSgeom",
- "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
- return;
- } // end if
- cout << "Reading Geometry transformation directly from Geant 3." << endl;
const Int_t knlayers = 6;
- const Int_t kndeep = 9;
- Int_t itsGeomTreeNames[knlayers][kndeep],lnam[20],lnum[20];
- Int_t nlad[knlayers],ndet[knlayers];
- Double_t t[3],r[10];
- Float_t par[20],att[20];
- Int_t npar,natt,idshape,imat,imed;
- AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
- Int_t mod,lay,lad,det,i,j,k;
- Char_t names[knlayers][kndeep][4];
- Int_t itsGeomTreeCopys[knlayers][kndeep];
- if(fMinorVersion == 1){ // Option A
- const char *namesA[knlayers][kndeep] = {
- {"ALIC","ITSV","ITSD","IT12","I12A","I10A","I103","I101","ITS1"}, // lay=1
- {"ALIC","ITSV","ITSD","IT12","I12A","I20A","I1D3","I1D1","ITS2"}, // lay=2
- {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"," "," "}, // lay=3
- {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"," "," "}, // lay=4
- {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"," "," "}, // lay=5
- {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"," "," "}};// lay=6
- Int_t itsGeomTreeCopysA[knlayers][kndeep]= {{1,1,1,1,10, 2, 4,1,1},// lay=1
- {1,1,1,1,10, 4, 4,1,1},// lay=2
- {1,1,1,1,14, 6, 1,0,0},// lay=3
- {1,1,1,1,22, 8, 1,0,0},// lay=4
- {1,1,1,1,34,22, 1,0,0},// lay=5
- {1,1,1,1,38,25, 1,0,0}};//lay=6
- for(i=0;i<knlayers;i++)for(j=0;j<kndeep;j++){
- for(k=0;k<4;k++) names[i][j][k] = namesA[i][j][k];
- itsGeomTreeCopys[i][j] = itsGeomTreeCopysA[i][j];
- } // end for i,j
- }else if(fMinorVersion == 2){ // Option B
- const char *namesB[knlayers][kndeep] = {
- {"ALIC","ITSV","ITSD","IT12","I12B","I10B","I107","I101","ITS1"}, // lay=1
- {"ALIC","ITSV","ITSD","IT12","I12B","I20B","I1D7","I1D1","ITS2"}, // lay=2
- {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"," "," "}, // lay=3
- {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"," "," "}, // lay=4
- {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"," "," "}, // lay=5
- {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"," "," "}};// lay=6
- Int_t itsGeomTreeCopysB[knlayers][kndeep]= {{1,1,1,1,10, 2, 4,1,1},// lay=1
- {1,1,1,1,10, 4, 4,1,1},// lay=2
- {1,1,1,1,14, 6, 1,0,0},// lay=3
- {1,1,1,1,22, 8, 1,0,0},// lay=4
- {1,1,1,1,34,22, 1,0,0},// lay=5
- {1,1,1,1,38,25, 1,0,0}};//lay=6
- for(i=0;i<knlayers;i++)for(j=0;j<kndeep;j++){
- for(k=0;k<4;k++) names[i][j][k] = namesB[i][j][k];
- itsGeomTreeCopys[i][j] = itsGeomTreeCopysB[i][j];
- } // end for i,j
- } // end if fMinorVersion
- // Sorry, but this is not very pritty code. It should be replaced
- // at some point with a version that can search through the geometry
- // tree its self.
- cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
- for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
- for(i=0;i<knlayers;i++)for(j=0;j<kndeep;j++)
- strncpy((char*) &itsGeomTreeNames[i][j],names[i][j],4);
- // itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
+ const Int_t kndeep = 3;
+ const AliITSDetector kidet[knlayers]={kSPD,kSPD,kSDD,kSDD,kSSD,kSSD};
+ const TString knames[2][knlayers] = {
+ {"/ALIC_1/ITSV_1/ITSD_1/IT12_1/I12A_%d/I10A_%d/I103_%d/I101_1/ITS1_1", // lay=1
+ "/ALIC_1/ITSV_1/ITSD_1/IT12_1/I12A_%d/I20A_%d/I1D3_%d/I1D1_1/ITS2_1", // lay=2
+ "/ALIC_1/ITSV_1/ITSD_1/IT34_1/I004_%d/I302_%d/ITS3_%d", // lay=3
+ "/ALIC_1/ITSV_1/ITSD_1/IT34_1/I005_%d/I402_%d/ITS4_%d", // lay=4
+ "/ALIC_1/ITSV_1/ITSD_1/IT56_1/I565_%d/I562_%d/ITS5_%d", // lay=5
+ "/ALIC_1/ITSV_1/ITSD_1/IT56_1/I569_%d/I566_%d/ITS6_%d"},// lay=6
+ {"/ALIC_1/ITSV_1/ITSD_1/IT12_1/I12B_%d/I10B_%d/I107_%d/I101_1/ITS1_1", // lay=1
+ "/ALIC_1/ITSV_1/ITSD_1/IT12_1/I12B_%d/I20B_%d/I1D7_%d/I1D1_1/ITS2_1", // lay=2
+ "/ALIC_1/ITSV_1/ITSD_1/IT34_1/I004_%d/I302_%d/ITS3_%d", // lay=3
+ "/ALIC_1/ITSV_1/ITSD_1/IT34_1/I005_%d/I402_%d/ITS4_%d", // lay=4
+ "/ALIC_1/ITSV_1/ITSD_1/IT56_1/I565_%d/I562_%d/ITS5_%d", // lay=5
+ "/ALIC_1/ITSV_1/ITSD_1/IT56_1/I569_%d/I566_%d/ITS6_%d"}
+ };
+ const Int_t kitsGeomTreeCopys[knlayers][kndeep]= {{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 nlad[knlayers],ndet[knlayers];
+ Int_t mod,lay,lad=0,det=0,i,j,k,cp0,cp1,cp2;
+ TString path,shapeName;
+ TGeoHMatrix materix;
+ Double_t trans[3]={3*0.0},rot[10]={9*0.0,1.0};
+ TArrayD shapePar;
+ TArrayF shapeParF;
+ Bool_t shapeDefined[3]={kFALSE,kFALSE,kFALSE};
+
+ AliDebug(1,"Reading Geometry transformation directly from Modler.");
mod = 0;
for(i=0;i<knlayers;i++){
- k = 1;
- for(j=0;j<kndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
- k *= TMath::Abs(itsGeomTreeCopys[i][j]);
- mod += k;
+ k = 1;
+ for(j=0;j<kndeep;j++) if(kitsGeomTreeCopys[i][j]!=0)
+ k *= TMath::Abs(kitsGeomTreeCopys[i][j]);
+ mod += k;
} // end for i
- if(fITSgeom!=0) delete fITSgeom;
+ SetITSgeom(0);
nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
- ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=22;ndet[5]=25;
- fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
- mod = -1;
+ ndet[0]= 4;ndet[1]= 4;ndet[2]= 6;ndet[3]= 8;ndet[4]=22;ndet[5]=25;
+ AliITSgeom* geom = new AliITSgeom(0,6,nlad,ndet,mod);
+ SetITSgeom(geom);
+ mod = 0;
for(lay=1;lay<=knlayers;lay++){
- for(j=0;j<kndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
- for(j=0;j<kndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
- switch (lay){
- case 1: case 2: // layers 1 and 2 are a bit special
- lad = 0;
- for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
- lnum[4] = j;
- for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
- lad++;
- lnum[5] = k;
- for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
- lnum[6] = det;
- mod++;
- ig->GetGeometry(kndeep,lnam,lnum,t,r,idshape,npar,natt,
- par,att,imat,imed);
- fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
- if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
- fITSgeom->ReSetShape(kSPD,
- new AliITSgeomSPD425Short(npar,par));
- } // end for det
- } // end for k
- } // end for j
- break;
- case 3: case 4: case 5: case 6: // layers 3-6
- lnum[6] = 1;
- for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
- lnum[4] = lad;
- for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
- lnum[5] = det;
- mod++;
- ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
- par,att,imat,imed);
- switch (lay){
- case 3: case 4:
- fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
- if(!(fITSgeom->IsShapeDefined(kSDD)))
- fITSgeom->ReSetShape(kSDD,
- new AliITSgeomSDD256(npar,par));
- break;
- case 5:
- fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
- if(!(fITSgeom->IsShapeDefined(kSSD)))
- fITSgeom->ReSetShape(kSSD,
- new AliITSgeomSSD275and75(npar,par));
- break;
- case 6:
- fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
- if(!(fITSgeom->IsShapeDefined(kSSD)))
- fITSgeom->ReSetShape(kSSD,
- new AliITSgeomSSD75and275(npar,par));
- break;
- } // end switch
- } // end for det
- } // end for lad
- break;
- } // end switch
+ for(cp0=1;cp0<=kitsGeomTreeCopys[lay-1][0];cp0++){
+ for(cp1=1;cp1<=kitsGeomTreeCopys[lay-1][1];cp1++){
+ for(cp2=1;cp2<=kitsGeomTreeCopys[lay-1][2];cp2++){
+ path.Form(knames[fMinorVersion-1][lay-1].Data(),
+ cp0,cp1,cp2);
+ switch (lay){
+ case 1:{
+ det = cp2;
+ lad = cp1+2*(cp0-1);
+ }break;
+ case 2:{
+ det = cp2;
+ lad = cp1+4*(cp0-1);
+ } break;
+ case 3: case 4: case 5: case 6:{
+ det = cp1;
+ lad = cp0;
+ } break;
+ } // end switch
+ //AliInfo(Form("path=%s lay=%d lad=%d det=%d",
+ // path.Data(),lay,lad,det));
+ gMC->GetTransformation(path.Data(),materix);
+ gMC->GetShape(path.Data(),shapeName,shapePar);
+ shapeParF.Set(shapePar.GetSize());
+ for(i=0;i<shapePar.GetSize();i++) shapeParF[i]=shapePar[i];
+ geom->CreateMatrix(mod,lay,lad,det,kidet[lay-1],trans,rot);
+ geom->SetTrans(mod,materix.GetTranslation());
+ geom->SetRotMatrix(mod,materix.GetRotationMatrix());
+ geom->GetGeomMatrix(mod)->SetPath(path.Data());
+ switch (lay){
+ case 1: case 2:
+ if(!shapeDefined[kSPD]){
+ geom->ReSetShape(kSPD,new AliITSgeomSPD425Short(
+ shapeParF.GetSize(),shapeParF.GetArray()));
+ shapeDefined[kSPD] = kTRUE;
+ }break;
+ case 3: case 4:
+ if(!shapeDefined[kSDD]){
+ geom->ReSetShape(kSDD,new AliITSgeomSDD256(
+ shapeParF.GetSize(),shapeParF.GetArray()));
+ shapeDefined[kSDD] = kTRUE;
+ }break;
+ case 5: case 6:
+ if(!shapeDefined[kSSD]){
+ geom->ReSetShape(kSSD,new AliITSgeomSSD75and275(
+ shapeParF.GetSize(),shapeParF.GetArray()));
+ shapeDefined[kSSD] = kTRUE;
+ }break;
+ default:{
+ }break;
+ } // end switch
+ mod++;
+ } /// end for cp2
+ } // end for cp1
+ } // end for cp0
} // end for lay
-//#endif
return;
}
//______________________________________________________________________
// none.
// Return:
// none.
- Int_t i;
- cout << endl;
- for(i=0;i<26;i++) cout << "*";
- cout << " ITSvPPRasymmFMD" << fMinorVersion << "_Init ";
- for(i=0;i<25;i++) cout << "*";cout << endl;
+ AliDebug(1,Form("Init: Major version %d Minor version %d",fMajorVersion,
+ fMinorVersion));
//
+ /* obsolete initialization of AliITSgeom from external "det" file
if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
- if(fITSgeom!=0) delete fITSgeom;
- fITSgeom = new AliITSgeom();
- if(fGeomDetIn) fITSgeom->ReadNewFile(fRead);
+ AliITSgeom* geom = new AliITSgeom();
+ SetITSgeom(geom);
+ if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead);
else this->InitAliITSgeom();
- if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
+ */
+ UpdateInternalGeometry();
AliITS::Init();
+ if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
+
//
- for(i=0;i<72;i++) cout << "*";
- cout << endl;
fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
}
//______________________________________________________________________
// none.
// Return:
// none.
+
const Float_t kconv = 1.0e+04; // convert cm to microns
- cout << "AliITSvPPRasymmFMD::SetDefaults" << endl;
+ if(!fDetTypeSim){
+ Warning("SetDefaults","Error fDetTypeSim not defined");
+ return;
+ }
- AliITSDetType *iDetType;
AliITSgeomSPD *s0;
AliITSgeomSDD *s1;
AliITSgeomSSD *s2;
Int_t i;
Float_t bx[256],bz[280];
+ fDetTypeSim->SetDefaults();
+
//SPD
- iDetType=DetType(kSPD);
- s0 = (AliITSgeomSPD*) fITSgeom->GetShape(kSPD);// Get shape info. Do it this way for now.
- AliITSresponse *resp0=new AliITSresponseSPD();
- SetResponseModel(kSPD,resp0);
- AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom);
+ 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->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
SetSegmentationModel(kSPD,seg0);
// set digit and raw cluster classes to be used
- const char *kData0=(iDetType->GetResponseModel())->DataType();
- if (strstr(kData0,"real")) iDetType->ClassNames("AliITSdigit",
- "AliITSRawClusterSPD");
- else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD");
-// SetSimulationModel(kSPD,new AliITSsimulationSPD(seg0,resp0));
-// iDetType->ReconstructionModel(new AliITSClusterFinderSPD());
-
+ const char *kData0=(fDetTypeSim->GetCalibrationModel(
+ GetITSgeom()->GetStartSPD()))->DataType();
+ if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,
+ "AliITSdigit");
+ else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
// SDD
- iDetType=DetType(kSDD);
- s1 = (AliITSgeomSDD*) fITSgeom->GetShape(kSDD);// Get shape info. Do it this way for now.
- AliITSresponseSDD *resp1=new AliITSresponseSDD("simulated");
- SetResponseModel(kSDD,resp1);
- AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(fITSgeom,resp1);
+ 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=(iDetType->GetResponseModel())->DataType();
- const char *kopt=iDetType->GetResponseModel()->ZeroSuppOption();
+ 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") ){
- iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD");
- } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
-// SetSimulationModel(kSDD,new AliITSsimulationSDD(seg1,resp1));
-// iDetType->ReconstructionModel(new AliITSClusterFinderSDD());
-
+ fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
+ } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
// SSD Layer 5
- iDetType=DetType(kSSD);
- s2 = (AliITSgeomSSD*) fITSgeom->GetShape(kSSD);// Get shape info. Do it this way for now.
- AliITSresponse *resp2=new AliITSresponseSSD("simulated");
- SetResponseModel(kSSD,resp2);
- AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom);
+
+ 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->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=(iDetType->GetResponseModel())->DataType();
- if(strstr(kData2,"real") ) iDetType->ClassNames("AliITSdigit",
- "AliITSRawClusterSSD");
- else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
-// SetSimulationModel(kSSD,new AliITSsimulationSSD(seg2,resp2));
-// iDetType->ReconstructionModel(new AliITSClusterFinderSSD());
-
- if(kNTYPES>3){
+ 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
// none.
// Return:
// none.
+
Int_t copy, id;
TLorentzVector position, momentum;
static TLorentzVector position0;
return;
} // end if IsEntering
// Fill hit structure with this new hit.
+
new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
gMC->Edep(),gMC->TrackTime(),position,
position0,momentum);
- //
+
position0 = position;
stat0 = vol[3];