* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.2 2003/02/12 10:39:05 hristov
-Updated AliTrackReference class (S.Radomski)
-
-Revision 1.1 2002/12/05 20:07:25 nilsen
-Adding new SPD 2002 test-beam geometry, with Config file (setup for testing,
-50 pions in one event and not 50 events with one pion).
+/* $Id$ */
-*/
-#include <Riostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <TMath.h>
#include <TGeometry.h>
#include <TNode.h>
-#include <TTUBE.h>
-#include <TTUBS.h>
-#include <TPCON.h>
-#include <TFile.h> // only required for Tracking function?
-#include <TCanvas.h>
-#include <TObjArray.h>
#include <TLorentzVector.h>
-#include <TObjString.h>
#include <TClonesArray.h>
#include <TBRIK.h>
-#include <TSystem.h>
+#include <TGeoMatrix.h>
+#include <TVirtualMC.h>
#include "AliRun.h"
#include "AliMagF.h"
-#include "AliConst.h"
-#include "AliITSGeant3Geometry.h"
#include "AliTrackReference.h"
+
#include "AliITShit.h"
#include "AliITS.h"
#include "AliITSvSPD02.h"
#include "AliITSgeom.h"
#include "AliITSgeomSPD.h"
-#include "AliITSgeomSDD.h"
-#include "AliITSgeomSSD.h"
-#include "AliITSDetType.h"
-#include "AliITSresponseSPD.h"
-#include "AliITSresponseSDD.h"
-#include "AliITSresponseSSD.h"
+#include "AliITSDetTypeSim.h"
+#include "AliITSCalibrationSPD.h"
#include "AliITSsegmentationSPD.h"
-#include "AliITSsegmentationSDD.h"
-#include "AliITSsegmentationSSD.h"
#include "AliITSsimulationSPD.h"
-#include "AliITSsimulationSDD.h"
-#include "AliITSsimulationSSD.h"
-#include "AliITSClusterFinderSPD.h"
-#include "AliITSClusterFinderSDD.h"
-#include "AliITSClusterFinderSSD.h"
+#include "AliMC.h"
+///////////////////////////////////////////////////////////////////////
+// Step manager and
+// geometry class
+// for the ITS
+// SPD test beam
+// geometry of summer 2002
+//
+///////////////////////////////////////////////////////////////////////
ClassImp(AliITSvSPD02)
//______________________________________________________________________
-AliITSvSPD02::AliITSvSPD02() {
+AliITSvSPD02::AliITSvSPD02():
+AliITS(),
+fGeomDetOut(kFALSE),
+fGeomDetIn(kFALSE),
+fMajorVersion(1),
+fMinorVersion(2),
+fGeomNumber(2002),
+fEuclidGeomDet(),
+fRead(),
+fWrite(),
+fDet1(300.0),
+fDet2(300.0),
+fChip1(300.0),
+fChip2(300.0){
////////////////////////////////////////////////////////////////////////
// Standard default constructor for the ITS SPD test beam 2002 version 1.
// Inputs:
////////////////////////////////////////////////////////////////////////
Int_t i;
- fIdN = 0;
- fIdName = 0;
- fIdSens = 0;
- fEuclidOut = kFALSE; // Don't write Euclide file
- fGeomDetOut = kFALSE; // Don't write .det file
- fGeomDetIn = kFALSE; // Don't 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';
}
//______________________________________________________________________
-AliITSvSPD02::AliITSvSPD02(const char *title) : AliITS("ITS", title){
+AliITSvSPD02::AliITSvSPD02(const char *title,Int_t gn) : AliITS("ITS", title),
+fGeomDetOut(kFALSE),
+fGeomDetIn(kFALSE),
+fMajorVersion(1),
+fMinorVersion(2),
+fGeomNumber(2002),
+fEuclidGeomDet(),
+fRead(),
+fWrite(),
+fDet1(300.0),
+fDet2(300.0),
+fChip1(300.0),
+fChip2(300.0){
////////////////////////////////////////////////////////////////////////
// Standard constructor for the ITS SPD testbeam 2002 version 1.
// Inputs:
// const char *title title for this ITS geometry.
+ // Int_t gn Geometry version number (year) default 2002.
// Outputs:
// none.
// Return:
////////////////////////////////////////////////////////////////////////
Int_t i;
+ fGeomNumber = gn;
fIdN = 2;
fIdName = new TString[fIdN];
fIdName[0] = "IMBS";
fIdName[1] = "ITST";
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 = kFALSE; // Don't Read .det file
SetThicknessDet1();
SetThicknessDet2();
SetThicknessChip1();
strncpy(fWrite,fEuclidGeomDet,60);
}
//______________________________________________________________________
-AliITSvSPD02::AliITSvSPD02(const AliITSvSPD02 &source){
+AliITSvSPD02::~AliITSvSPD02() {
////////////////////////////////////////////////////////////////////////
- // Copy Constructor for ITS SPD test beam 2002 version 1.
- // This class is not to be copied. Function only dummy.
+ // Standard destructor for the ITS SPD test beam 2002 version 1.
// Inputs:
- // const AliITSvSPD02 &source The class to be copied
- // Outputs:
// none.
- // Return:
- // A warning message.
- ////////////////////////////////////////////////////////////////////////
- if(&source == this) return;
- Warning("Copy Constructor","Not allowed to copy AliITSvSPD02");
- return;
-}
-//______________________________________________________________________
-AliITSvSPD02& AliITSvSPD02::operator=(const AliITSvSPD02 &source){
- ////////////////////////////////////////////////////////////////////////
- // Assignment operator for the ITS SPD test beam 2002 version 1.
- // This class is not to be copied. Function only dummy.
- // Inputs:
- // const AliITSvSPD02 &source The class to be copied
// Outputs:
// none.
// Return:
- // A Warning message
+ // none.
////////////////////////////////////////////////////////////////////////
- if(&source == this) return *this;
- Warning("= operator","Not allowed to copy AliITSvSPD02");
- return *this;
}
//______________________________________________________________________
-AliITSvSPD02::~AliITSvSPD02() {
+void AliITSvSPD02::BuildGeometry(){
////////////////////////////////////////////////////////////////////////
- // Standard destructor for the ITS SPD test beam 2002 version 1.
+ // Geometry builder for the ITS SPD test beam 2002 version 1.
+ // ALIC ALICE Mother Volume
+ // |- ITSV ITS Mother Volume
+ // |- IDET Detector under Test
+ // | |- ITS0 SPD Si Chip
+ // | | |- ITST SPD Sensitivve Volume
+ // | |- IPC0 *5 Readout chip
+ // |- ITEL *4 SPD Telescope
+ // |- IMB0 SPD Si Chip
+ // | |- IMBS SPD Sensitive volume
+ // |- ICMB Chip MiniBus.
// Inputs:
// none.
// Outputs:
// Return:
// none.
////////////////////////////////////////////////////////////////////////
+ // Get the top alice volume.
+
+ switch (fGeomNumber){
+ case 2002:
+ BuildGeometry2002();
+ break;
+ default:
+ BuildGeometry2002();
+ break;
+ } // end switch
}
//______________________________________________________________________
-void AliITSvSPD02::BuildGeometry(){
+void AliITSvSPD02::BuildGeometry2002(){
////////////////////////////////////////////////////////////////////////
// Geometry builder for the ITS SPD test beam 2002 version 1.
// ALIC ALICE Mother Volume
// none.
////////////////////////////////////////////////////////////////////////
// Get the top alice volume.
- TNode *ALIC = gAlice->GetGeometry()->GetNode("alice");
- ALIC->cd();
+ TNode *aALIC = gAlice->GetGeometry()->GetNode("alice");
+ aALIC->cd();
// Define ITS Mother Volume
Float_t data[3];
Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
//Float_t yposition= 0.0;
TRotMatrix *r0 = new TRotMatrix("ITSidrotm0","ITSidrotm0",
- 90.0,0,0.0,0,90.0,270.0);
+ 90.0,0,0.0,0,90.0,270.0);
data[0] = 10.0;
data[1] = 50.0;
data[2] = 100.0;
- TBRIK *ITSVshape = new TBRIK("ITSVshape","ITS Logical Mother Volume","Air",
- data[0],data[1],data[2]);
- TNode *ITSV = new TNode("ITSV","ITS Mother Volume",ITSVshape,
- 0.0,0.0,0.0,0,0);
- ITSV->cd(); // set ourselve into ITSV subvolume of ALIC
+ TBRIK *iITSVshape = new TBRIK("ITSVshape",
+ "ITS Logical Mother Volume","Air",
+ data[0],data[1],data[2]);
+ TNode *iITSV = new TNode("ITSV","ITS Mother Volume",iITSVshape,
+ 0.0,0.0,0.0,0,0);
+ iITSV->cd(); // set ourselve into ITSV subvolume of aALIC
// SPD part of telescope (MiniBuS)
data[0] = 0.705;
data[1] = 0.5*ddettelescope;
data[2] = 3.536;
- TBRIK *IMB0shape = new TBRIK("IMB0shape","SPD wafer","Si",
+ TBRIK *iIMB0shape = new TBRIK("IMB0shape","SPD wafer","Si",
data[0],data[1],data[2]);
Float_t detMiniBusX,detMiniBusY,detMiniBusZ;
data[0] = detMiniBusX = 0.64;
data[1] = detMiniBusY = 0.5*ddettelescope;
data[2] = detMiniBusZ = 3.48;
- TBRIK *IMBSshape = new TBRIK("IMBSshape","SPD Sensitive volume","Si",
+ TBRIK *iIMBSshape = new TBRIK("IMBSshape","SPD Sensitive volume","Si",
data[0],data[1],data[2]);
Float_t chipMiniBusX,chipMiniBusY,chipMiniBusZ;
data[0] = chipMiniBusX = 0.793;
data[1] = chipMiniBusY = 0.5*dchipMiniBus;
data[2] = chipMiniBusZ = 0.68;
- TBRIK *ICMBshape = new TBRIK("ICMBshape","chip Minibus","Si",
+ TBRIK *iICMBshape = new TBRIK("ICMBshape","chip Minibus","Si",
data[0],data[1],data[2]);
data[0] = TMath::Max(detMiniBusX,chipMiniBusX);
data[1] = detMiniBusY+chipMiniBusY;
data[2] = TMath::Max(detMiniBusZ,chipMiniBusZ);
- TBRIK *ITELshape = new TBRIK("ITELshape","ITELshape","Air",
+ TBRIK *iITELshape = new TBRIK("ITELshape","ITELshape","Air",
data[0],data[1],data[2]);
// SPD under test
data[0] = 0.705;
data[1] = ddettest;
data[2] = 3.536;
- TBRIK *ITS0shape = new TBRIK("ITS0shape","SPD wafer","Si",
+ TBRIK *iITS0shape = new TBRIK("ITS0shape","SPD wafer","Si",
data[0],data[1],data[2]); // contains detector
data[0] = spdX = 0.64;
data[1] = spdY = ddettest;
data[2] = spdZ = 3.48;
- TBRIK *ITSTshape = new TBRIK("ITSTshape","SPD sensitive volume","Si",
+ TBRIK *iITSTshape = new TBRIK("ITSTshape","SPD sensitive volume","Si",
data[0],data[1],data[2]);
// ITS0 with no translation and unit rotation matrix.
data[0] = spdchipX = 0.793;
data[1] = spdchipY = dchiptest;
data[2] = spdchipZ = 0.68;
- TBRIK *IPC0shape = new TBRIK("IPC0shape","Readout Chips","Si",
+ TBRIK *iIPC0shape = new TBRIK("IPC0shape","Readout Chips","Si",
data[0],data[1],data[2]); // chip under test
data[0] = TMath::Max(spdchipX,spdX);
data[1] = spdY+spdchipY;
data[2] = TMath::Max(spdchipZ,spdZ);
- TBRIK *IDETshape = new TBRIK("IDETshape","Detector Under Test","Air",
+ TBRIK *iIDETshape = new TBRIK("IDETshape","Detector Under Test","Air",
data[0],data[1],data[2]);
// Place volumes in geometry
Int_t i,j;
pz[1] = pz[0]+2.0;
pz[2] = pz[1]+38.0+spdY+spdchipY+34.5;
pz[3] = pz[2]+2.0;
- TNode *ITEL[4],*ICMB[4],*IMB0[4],*IMBS[4];
- TNode *IDET = new TNode("IDET","Detector Under Test",IDETshape,
+ TNode *iITEL[4],*iICMB[4],*iIMB0[4],*iIMBS[4];
+ TNode *iIDET = new TNode("IDET","Detector Under Test",iIDETshape,
0.0,0.0,pz[1]+38.0,r0,0);
- IDET->cd();
- TNode *ITS0 = new TNode("ITS0","SPD Chip",ITS0shape,
- 0.0,IDETshape->GetDy()-spdY,0.0,0,0);
- TNode *IPC0[5];
+ iIDET->cd();
+ TNode *iITS0 = new TNode("ITS0","SPD Chip",iITS0shape,
+ 0.0,iIDETshape->GetDy()-spdY,0.0,0,0);
+ TNode *iIPC0[5];
for(i=0;i<5;i++) { //place readout chips on the back of SPD chip under test
- sprintf(name,"IPC0%d",i);
- sprintf(title,"Readout chip #%d",i+1);
- j = i-2;
- IPC0[i] = new TNode(name,title,IPC0shape,
- 0.0,spdchipY-IDETshape->GetDy(),
- j*2.0*spdchipZ+j*0.25*(spdZ-5.*spdchipZ),0,0);
+ sprintf(name,"IPC0%d",i);
+ sprintf(title,"Readout chip #%d",i+1);
+ j = i-2;
+ iIPC0[i] = new TNode(name,title,iIPC0shape,
+ 0.0,spdchipY-iIDETshape->GetDy(),
+ j*2.0*spdchipZ+j*0.25*(spdZ-5.*spdchipZ),0,0);
} // end for i
- ITS0->cd();
- TNode *ITST = new TNode("ITST","SPD sensitive volume",ITSTshape,
- 0.0,0.0,0.0,0,0);
+ iITS0->cd();
+ TNode *iITST = new TNode("ITST","SPD sensitive volume",iITSTshape,
+ 0.0,0.0,0.0,0,0);
for(Int_t i=0;i<4;i++){
- ITSV->cd();
- sprintf(name,"ITEL%d",i);
- sprintf(title,"Test beam telescope element #%d",i+1);
- ITEL[i] = new TNode(name,title,ITELshape,px,py,pz[i],r0,0);
- ITEL[i]->cd();
- ICMB[i] = new TNode("ICMB","Chip MiniBus",ICMBshape,
- 0.0,-ITELshape->GetDy()+detMiniBusY,0.0,0,0);
- IMB0[i] = new TNode("IMB0","Chip MiniBus",IMB0shape,
- 0.0, ITELshape->GetDy()-detMiniBusY,0.0,0,0);
- IMB0[i]->cd();
- IMBS[i] = new TNode("IMBS","IMBS",IMBSshape,0.0,0.0,0.0,0,0);
- // place IMBS inside IMB0 with no translation and unit rotation matrix.
+ iITSV->cd();
+ sprintf(name,"ITEL%d",i);
+ sprintf(title,"Test beam telescope element #%d",i+1);
+ iITEL[i] = new TNode(name,title,iITELshape,px,py,pz[i],r0,0);
+ iITEL[i]->cd();
+ iICMB[i] = new TNode("ICMB","Chip MiniBus",iICMBshape,
+ 0.0,-iITELshape->GetDy()+detMiniBusY,0.0,0,0);
+ iIMB0[i] = new TNode("IMB0","Chip MiniBus",iIMB0shape,
+ 0.0, iITELshape->GetDy()-detMiniBusY,0.0,0,0);
+ iIMB0[i]->cd();
+ iIMBS[i] = new TNode("IMBS","IMBS",iIMBSshape,0.0,0.0,0.0,0,0);
+ // place IMBS inside IMB0 with no translation and unit rotation matrix.
} // end for i
- ALIC->cd();
- ITST->SetLineColor(kYellow);
- fNodes->Add(ITST);
+ aALIC->cd();
+ iITST->SetLineColor(kYellow);
+ fNodes->Add(iITST);
for(i=0;i<4;i++){
- IMBS[i]->SetLineColor(kGreen);
- fNodes->Add(IMBS[i]);
+ iIMBS[i]->SetLineColor(kGreen);
+ fNodes->Add(iIMBS[i]);
} // end for i
}
//______________________________________________________________________
// Return:
// none.
////////////////////////////////////////////////////////////////////////
+
+ switch (fGeomNumber){
+ case 2002:
+ CreateGeometry2002();
+ break;
+ default:
+ CreateGeometry2002();
+ break;
+ } // end switch
+}
+//______________________________________________________________________
+void AliITSvSPD02::CreateGeometry2002(){
+ ////////////////////////////////////////////////////////////////////////
+ // This routine defines and Creates the geometry for version 1 of the ITS.
+ // ALIC ALICE Mother Volume
+ // |- ITSV ITS Mother Volume
+ // |- IDET Detector under Test
+ // | |- ITS0 SPD Si Chip
+ // | | |- ITST SPD Sensitivve Volume
+ // | |- IPC0 *5 Readout chip
+ // |- ITEL *4 SPD Telescope
+ // |- IMB0 SPD Si Chip
+ // | |- IMBS SPD Sensitive volume
+ // |- ICMB Chip MiniBus.
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+ ////////////////////////////////////////////////////////////////////////
Float_t data[49];
// Define media off-set
Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
Float_t yposition= 0.0;
+ if(gMC==0) return;
// Define Rotation-reflextion Matrixes needed
// 0 is the unit matrix
AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
// Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
// AliITSvSPD02.
// 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.
+ //
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+ /////////////////////////////////////////////////////////////////////////
+
+ switch (fGeomNumber){
+ case 2002:
+ CreateMaterials2002();
+ break;
+ default:
+ CreateMaterials2002();
+ break;
+ } // end switch
+}
+//______________________________________________________________________
+void AliITSvSPD02::CreateMaterials2002(){
+ ////////////////////////////////////////////////////////////////////////
+ //
+ // Create ITS SPD test beam materials
+ // This function defines the default materials used in the Geant
+ // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
+ // AliITSvSPD02.
+ // In general it is automatically replaced by
+ // 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 fieldm = gAlice->Field()->Max();
AliMaterial(1,"AIR$",0.14610E+02,0.73000E+01,0.12050E-02,
- 0.30423E+05,0.99900E+03);
+ 0.30423E+05,0.99900E+03);
AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
- epsilAir,stminAir);
+ epsilAir,stminAir);
AliMaterial(2,"SI$",0.28086E+02,0.14000E+02,0.23300E+01,
- 0.93600E+01,0.99900E+03);
+ 0.93600E+01,0.99900E+03);
AliMedium(2,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
- epsilSi,stminSi);
+ epsilSi,stminSi);
+}
+//______________________________________________________________________
+Int_t AliITSvSPD02::DecodeDetector(Int_t id,Int_t cpy,Int_t &lay,Int_t &lad,
+ Int_t &det)const{
+ // Based on the geometry tree defined in Geant 3.21, this
+ // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
+ // sturture.
+ // Inputs:
+ // Int_t id Detector volume id
+ // Int_t cpy Detector copy number
+ // Outputs:
+ // Int_t lay layer number
+ // Int_t lad ladder number
+ // Int_t det detector number
+ // Return:
+ // The module number
+ Int_t mod;
+
+ lad = det = 1;
+ lay = cpy;
+ if(cpy>2 && id==fIdSens[0]) lay = cpy + 1;
+ if(id==fIdSens[1]) lay = 3;
+ mod = lay - 1;
+ return mod;
}
//______________________________________________________________________
void AliITSvSPD02::InitAliITSgeom(){
// none.
// Return:
// none.
- 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 nlayers = 6;
- const Int_t ndeep = 5;
- Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
- Int_t nlad[nlayers],ndet[nlayers];
- 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[nlayers][ndeep][4];
- Int_t itsGeomTreeCopys[nlayers][ndeep];
- Char_t *namesA[nlayers][ndeep] = {
- {"ALIC","ITSV","ITEL","IMB0","IMBS"}, // lay=1
- {"ALIC","ITSV","IDET","ITS0","ITST"}};// Test SPD
- Int_t itsGeomTreeCopysA[nlayers][ndeep]= {{1,1,4,1,1},// lay=1
- {1,1,1,1,1}};//lay=2 TestSPD
- for(i=0;i<nlayers;i++)for(j=0;j<ndeep;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
- // 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<nlayers;i++)for(j=0;j<ndeep;j++)
- itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
- mod = 0;
- for(i=0;i<nlayers;i++){
- k = 1;
- for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
- k *= TMath::Abs(itsGeomTreeCopys[i][j]);
- mod += k;
- } // end for i
+ 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];
- if(fITSgeom!=0) delete fITSgeom;
- 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;
- for(lay=1;lay<=nlayers;lay++){
- for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
- for(j=0;j<ndeep;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(ndeep,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;
- } // end switch
- } // end for lay
+ par[0]=0.64;par[1]=0.5*300.0E-4;par[2]=3.48;
+ mod=5;
+ AliITSgeom* geom = new AliITSgeom(0,knlayers,knlad,kndet,mod);
+ SetITSgeom(geom);
+ for(i=0;i<kltypess;i++)for(cpy=1;cpy<=kitsGeomTreeCopys[i];cpy++){
+ path.Form(knames[i].Data(),cpy);
+ gMC->GetTransformation(path.Data(),matrix);
+ gMC->GetShape(path.Data(),shapeName,shapePar);
+ shapeParF.Set(shapePar.GetSize());
+ for(j=0;j<shapePar.GetSize();j++) shapeParF[j]=shapePar[j];
+ mod = DecodeDetector(fIdSens[i],cpy,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/
return;
}
//______________________________________________________________________
for(i=0;i<26;i++) cout << "*";
cout << " ITSvSPD02" << fMinorVersion << "_Init ";
for(i=0;i<25;i++) cout << "*";cout << endl;
-//
+
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);
+ if(GetITSgeom()!=0) SetITSgeom(0x0);
+ AliITSgeom* geom = new AliITSgeom();
+ SetITSgeom(geom);
+ if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead);
if(!fGeomDetIn) this->InitAliITSgeom();
- if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
+ if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
AliITS::Init();
-//
+
for(i=0;i<72;i++) cout << "*";
cout << endl;
- fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
+ if(gMC) fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
+ else fIDMother = 0;
}
//______________________________________________________________________
void AliITSvSPD02::SetDefaults(){
Info("SetDefaults","Setting up only SPD detector");
- AliITSDetType *iDetType;
+ if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
+ fDetTypeSim->SetITSgeom(GetITSgeom());
AliITSgeomSPD *s0;
Int_t i;
Float_t bx[256],bz[280];
-
+ fDetTypeSim->ResetCalibrationArray();
+ fDetTypeSim->ResetSegmentation();
+
//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);
+ // Get shape info. Do it this way for now.
+ s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);
+ AliITSCalibration *resp0=new AliITSCalibrationSPD();
+ resp0->SetTemperature();
+ resp0->SetDistanceOverVoltage();
+ SetCalibrationModel(0,resp0);
+
+ AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD();
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));
+ const char *kData0=(fDetTypeSim->GetCalibrationModel(0))->DataType();
+ if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
+ else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
+// SetSimulationModel(kSPD,new AliITSsimulationSPDdubna(seg0,resp0));
// iDetType->ReconstructionModel(new AliITSClusterFinderSPD());
+
+/*
+ SetResponseModel(kSDD,new AliITSCalibrationSDD());
+ SetSegmentationModel(kSDD,new AliITSsegmentationSDD());
+ DetType(kSDD)->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
- if(kNTYPES>3){
+ SetResponseModel(kSSD,new AliITSCalibrationSSD());
+ SetSegmentationModel(kSSD,new AliITSsegmentationSSD());
+ DetType(kSSD)->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
+*/
+ if(fgkNTYPES>3){
Warning("SetDefaults",
"Only the four basic detector types are initialised!");
}// end if
return;
}
//______________________________________________________________________
-void AliITSvSPD02::DrawModule(){
+void AliITSvSPD02::SetDefaultSimulation(){
+ // sets the default simulation.
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+
+ if(GetITSgeom()==0){
+ Warning("SetDefaultSimulation","ITS geometry is null!");
+ return;
+ }
+
+ if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
+ AliITSsimulation *sim;
+ //AliITSsegmentation *seg;
+ //AliITSCalibration *res;
+ if(fDetTypeSim){
+ sim = fDetTypeSim->GetSimulationModel(kSPD);
+ if (!sim) {
+ //seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
+ //res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD());
+ sim = new AliITSsimulationSPD(fDetTypeSim);
+ SetSimulationModel(kSPD,sim);
+ }else{ // simulation exists, make sure it is set up properly.
+ sim->SetCalibrationModel(GetITSgeom()->GetStartSPD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSPD()));
+ sim->SetSegmentationModel(kSPD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
+ sim->Init();
+ } // end if
+ } // end if iDetType
+
+ /*
+ if(fDetTypeSim){
+ sim = fDetTypeSim->GetSimulationModel(kSDD);
+ if (!sim) {
+ seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD);
+ res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD());
+ sim = new AliITSsimulationSDD(seg,res);
+ SetSimulationModel(kSDD,sim);
+ }else{ // simulation exists, make sure it is set up properly.
+ sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD()));
+ sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD));
+ sim->Init();
+ } //end if
+ } // end if iDetType
+ if(fDetTypeSim){
+ sim = fDetTypeSim->GetSimulationModel(kSSD);
+ if (!sim) {
+ seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD);
+ res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD());
+ sim = new AliITSsimulationSSD(seg,res);
+ SetSimulationModel(kSSD,sim);
+ }else{ // simulation exists, make sure it is set up properly.
+ sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD()));
+ sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD));
+ sim->Init();
+ } // end if
+ } //
+ */
+}
+//______________________________________________________________________
+void AliITSvSPD02::DrawModule() const {
////////////////////////////////////////////////////////////////////////
// Draw a shaded view of the ITS SPD test beam version 1.
// Inputs:
// Return:
// none.
////////////////////////////////////////////////////////////////////////
- Int_t copy, id;
+ Int_t copy=0, id;
TLorentzVector position, momentum;
static TLorentzVector position0;
static Int_t stat0=0;
if((id=gMC->CurrentVolID(copy) == fIDMother)&&
(gMC->IsTrackEntering()||gMC->IsTrackExiting())){
- copy = fTrackReferences->GetEntriesFast();
- TClonesArray &lTR = *fTrackReferences;
- // Fill TrackReference structure with this new TrackReference.
- new(lTR[copy]) AliTrackReference(gAlice->CurrentTrack(),gMC);
+ copy = fTrackReferences->GetEntriesFast();
+ TClonesArray &lTR = *fTrackReferences;
+ // Fill TrackReference structure with this new TrackReference.
+ new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->
+ GetCurrentTrackNumber());
} // if Outer ITS mother Volume
if(!(this->IsActive())){
- return;
+ return;
} // end if !Active volume.
Int_t vol[5];
TClonesArray &lhits = *fHits;
// Fill hit structure.
if(!(gMC->TrackCharge())) return;
id = gMC->CurrentVolID(copy);
- if(id==fIdSens[0]){
- vol[0] = vol[1] = 1; // Layer, ladder
- id = gMC->CurrentVolOffID(2,copy);
- //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
- vol[2] = copy; // detector
- } else if(id == fIdSens[1]){
- vol[0] = 1; // layer
- vol[1] = 2; // ladder
- id = gMC->CurrentVolOffID(2,copy);
- //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
- vol[2] = copy; // detector
+ if(id==fIdSens[0]){ // Volume name "IMBS"
+ vol[2] = vol[1] = 1; // Det, ladder
+ id = gMC->CurrentVolOffID(2,copy);
+ //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
+ vol[0] = copy; // Lay
+ if(copy>2) vol[0]++;
+ } else if(id == fIdSens[1]){ // Volume name "ITST"
+ vol[0] = 3; // layer
+ vol[1] = 1; // ladder
+ id = gMC->CurrentVolOffID(2,copy);
+ //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
+ vol[2] = 1; // detector
} else return; // end if
//
gMC->TrackPosition(position);
gMC->TrackMomentum(momentum);
vol[4] = stat0;
if(gMC->IsTrackEntering()){
- position0 = position;
- stat0 = vol[3];
+ position0 = position;
+ stat0 = vol[3];
+ return;
} // end if IsEntering
// Fill hit structure with this new hit only for non-entrerance hits.
- else new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,
- gMC->Edep(),gMC->TrackTime(),position,
- position0,momentum);
+ else new(lhits[fNhits++]) AliITShit(fIshunt,
+ gAlice->GetMCApp()->GetCurrentTrackNumber(),
+ vol,gMC->Edep(),gMC->TrackTime(),
+ position,position0,momentum);
//
position0 = position;
stat0 = vol[3];