Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 140 additions & 29 deletions charmdet/PixelModules.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ using namespace ShipUnit;

PixelModules::PixelModules()
: FairDetector("HighPrecisionTrackers",kTRUE, kPixelModules),
numSi(nSi),
fTrackID(-1),
fPdgCode(),
fVolumeID(-1),
Expand All @@ -63,6 +64,7 @@ PixelModules::PixelModules()

PixelModules::PixelModules(const char* name, const Double_t DX, const Double_t DY, const Double_t DZ, Bool_t Active,const char* Title)
: FairDetector(name, Active, kPixelModules),
numSi(nSi),
fTrackID(-1),
fPdgCode(),
fVolumeID(-1),
Expand Down Expand Up @@ -123,9 +125,10 @@ void PixelModules::SetBoxParam(Double_t SX, Double_t SY, Double_t SZ, Double_t z
Dim1Long = D1long;
}

void PixelModules::SetSiliconDZ(Double_t SiliconDZ)
void PixelModules::SetSiliconDZ(Double_t SiliconDZthin,Double_t SiliconDZthick)
{
DimZSi = SiliconDZ;
DimZSithin = SiliconDZthin;
DimZSithick= SiliconDZthick;
}


Expand All @@ -143,14 +146,15 @@ void PixelModules::SetSiliconStationAngles(Int_t nstation, Double_t anglex, Doub
zangle[nstation] = anglez;
}

void PixelModules::SetSiliconDetNumber(Int_t nSilicon)
void PixelModules::SetSiliconSlicesNumber(Int_t nSl)
{
nSi = nSilicon;
nSlices=nSl;
}




void PixelModules::ComputeDimZSlice(){
DimZThinSlice=DimZSithin/nSlices;
DimZThickSlice=DimZSithick/nSlices;
}


//
Expand All @@ -160,14 +164,23 @@ void PixelModules::ConstructGeometry()
TGeoMedium *air = gGeoManager->GetMedium("air");

InitMedium("iron");
TGeoMedium *Fe =gGeoManager->GetMedium("iron");

TGeoMedium *Fepton =gGeoManager->GetMedium("iron");

InitMedium("kapton");
TGeoMedium *kapton =gGeoManager->GetMedium("kapton");

InitMedium("silicon");
TGeoMedium *Silicon = gGeoManager->GetMedium("silicon");

InitMedium("aluminium");
TGeoMedium *Aluminium = gGeoManager->GetMedium("aluminium");

InitMedium("CoilCopper");
TGeoMedium *Cu = gGeoManager->GetMedium("CoilCopper");

InitMedium("copper");
TGeoMedium *copper = gGeoManager->GetMedium("copper");

InitMedium("CoilAluminium");
TGeoMedium *Al = gGeoManager->GetMedium("CoilAluminium");

Expand All @@ -181,39 +194,137 @@ void PixelModules::ConstructGeometry()

//computing the largest offsets in order to set PixelBox dimensions correctly
Double_t offsetxmax = 0., offsetymax = 0.;
for (int istation = 0; istation < 12; istation++){
for (int istation = 0; istation < nSi; istation++){
if (TMath::Abs(xs[istation]) > offsetxmax) offsetxmax = TMath::Abs(xs[istation]);
if (TMath::Abs(ys[istation]) > offsetymax) offsetymax = TMath::Abs(ys[istation]);
}
//Double_t DimZPixelBox = zs5 -zs0 +pairwisedistance + DimZSi;
TGeoBBox *PixelBox = new TGeoBBox("PixelBox", Dim1Long/2 + offsetxmax, Dim1Long/2 + offsetymax, DimZPixelBox/2.); //The box is symmetric, offsets are not. So we enlarge the offset by a factor two for coverage
TGeoVolume *volPixelBox = new TGeoVolume("volPixelBox",PixelBox,air);
Double_t inimodZoffset(zs[0]) ;//initial Z offset of Pixel Module 0 so as to avoid volume extrusion
Double_t inimodZoffset(zs[0]-DimZSithick) ;//initial Z offset of Pixel Module 0 so as to avoid volume extrusion
top->AddNode(volPixelBox, 1, new TGeoTranslation(0,0,zBoxPosition+ inimodZoffset)); //volume moved in


TGeoBBox *Pixely = new TGeoBBox("Pixely", Dim1Short/2, Dim1Long/2, DimZSi/2); //long along y
TGeoVolume *volPixely = new TGeoVolume("volPixely",Pixely,Silicon);
volPixely->SetLineColor(kBlue-5);
AddSensitiveVolume(volPixely);

TGeoBBox *Pixelx = new TGeoBBox("Pixelx", (Dim1Long)/2, (Dim1Short)/2, DimZSi/2); //long along x
TGeoVolume *volPixelx = new TGeoVolume("volPixelx",Pixelx,Silicon);
volPixelx->SetLineColor(kBlue-5);
AddSensitiveVolume(volPixelx);
TGeoBBox *Pixelythin = new TGeoBBox("Pixelythin", Dim1Short/2, Dim1Long/2, DimZThinSlice/2); //long along y
TGeoVolume *volPixelythin = new TGeoVolume("volPixelythin",Pixelythin,Silicon);
volPixelythin->SetLineColor(kBlue-5);
AddSensitiveVolume(volPixelythin);

TGeoBBox *Pixelxthin = new TGeoBBox("Pixelx", (Dim1Long)/2, (Dim1Short)/2, DimZThinSlice/2); //long along x
TGeoVolume *volPixelxthin = new TGeoVolume("volPixelxthin",Pixelxthin,Silicon);
volPixelxthin->SetLineColor(kBlue-5);
AddSensitiveVolume(volPixelxthin);

TGeoBBox *Pixelythick = new TGeoBBox("Pixelythick", Dim1Short/2, Dim1Long/2, DimZThickSlice/2); //long along y
TGeoVolume *volPixelythick = new TGeoVolume("volPixelythick",Pixelythick,Silicon);
volPixelythick->SetLineColor(kBlue-5);
AddSensitiveVolume(volPixelythick);

TGeoBBox *Pixelxthick = new TGeoBBox("Pixelx", (Dim1Long)/2, (Dim1Short)/2, DimZThickSlice/2); //long along x
TGeoVolume *volPixelxthick = new TGeoVolume("volPixelxthick",Pixelxthick,Silicon);
volPixelxthick->SetLineColor(kBlue-5);
AddSensitiveVolume(volPixelxthick);

///////////////////////////////////////////////////////Passive material///////////////////////////////////////////////////////

TGeoBBox *WindowBox = new TGeoBBox("WindowBox",Windowx/2, Windowy/2,DimZWindow/2);
TGeoVolume *volWindow = new TGeoVolume("volWindow",WindowBox,kapton);
volWindow->SetLineColor(kGray);
//AddSensitiveVolume(volWindow);

TGeoBBox *FrontEndSilix = new TGeoBBox("FrontEndSilix",Dim1Short/2,Dim1Long/2, DimZFE/2);
TGeoVolume *VolSiliFEx = new TGeoVolume("VolSiliFEx",FrontEndSilix,Silicon);
VolSiliFEx->SetLineColor(kGray);
// AddSensitiveVolume(VolSiliFEx);

TGeoBBox *FrontEndSiliy = new TGeoBBox("FrontEndSiliy",Dim1Short/2,Dim1Long/2, DimZFE/2);
TGeoVolume *VolSiliFEy = new TGeoVolume("VolSiliFEy",FrontEndSiliy,Silicon);
VolSiliFEy->SetLineColor(kGray);
//AddSensitiveVolume(VolSiliFEy);

TGeoBBox *ModuleCopperx = new TGeoBBox("ModuleCopperx",Dim1Short/2,Dim1Long/2, DimZCu/2);
TGeoVolume *VolModCux = new TGeoVolume("VolModCux",ModuleCopperx,copper);
VolModCux->SetLineColor(kGray);

TGeoBBox *ModuleCoppery = new TGeoBBox("ModuleCoppery",Dim1Short/2,Dim1Long/2, DimZCu/2);
TGeoVolume *VolModCuy = new TGeoVolume("VolModCuy",ModuleCoppery,copper);
VolModCux->SetLineColor(kGray);

TGeoBBox *ModuleKaptonx = new TGeoBBox("ModuleKaptonx",Dim1Short/2,Dim1Long/2, DimZKa/2);
TGeoVolume *VolModKax = new TGeoVolume("VolModKax",ModuleKaptonx,kapton);
VolModKax->SetLineColor(kGray);

TGeoBBox *ModuleKaptony = new TGeoBBox("ModuleKaptony",Dim1Short/2,Dim1Long/2, DimZKa/2);
TGeoVolume *VolModKay = new TGeoVolume("VolModKay",ModuleKaptony,kapton);
VolModKay->SetLineColor(kGray);
////////////////////////////////////////////////////////End passive material////////////////////////////////////////////////////////////////

//id convention: 1{a}{b}{c}, a = number of pair (from 1 to 6), b = element of the pair (1 or 2)
int chi=0;
Int_t PixelIDlist[nSi];
for(int i=1110;i<1130;i++){
PixelIDlist[chi]=i;
chi++;
}

for(int i=1210;i<1230;i++){
PixelIDlist[chi]=i;
chi++;
}

//id convention: 1{a}{b}, a = number of pair (from 1 to 6), b = element of the pair (1 or 2)
Int_t PixelIDlist[12] = {111,112,121,122,131,132,141,142,151,152,161,162};
for(int i=1310;i<1330;i++){
PixelIDlist[chi]=i;
chi++;
}
for(int i=1410;i<1430;i++){
PixelIDlist[chi]=i;
chi++;
}
for(int i=1510;i<1530;i++){
PixelIDlist[chi]=i;
chi++;
}
for(int i=1610;i<1630;i++){
PixelIDlist[chi]=i;
chi++;
}
//Alternated pixel stations optimized for y and x measurements
Bool_t vertical[12] = {kTRUE,kTRUE,kFALSE,kFALSE,kTRUE,kTRUE,kFALSE,kFALSE,kTRUE,kTRUE,kFALSE,kFALSE};

for (int ipixel = 0; ipixel < 12; ipixel++){
if (vertical[ipixel]) volPixelBox->AddNode(volPixely, PixelIDlist[ipixel], new TGeoTranslation(xs[ipixel],ys[ipixel],-DimZPixelBox/2.+ zs[ipixel]-inimodZoffset)); //compensation for the Node offset
else volPixelBox->AddNode(volPixelx, PixelIDlist[ipixel], new TGeoTranslation(xs[ipixel],ys[ipixel],-DimZPixelBox/2.+ zs[ipixel]-inimodZoffset));
Bool_t vertical[nSi];
for(int i=0;i<nSi;i++){
vertical[i]=kFALSE;
}
for(int i=0;i<3;i++){
for(int j =0;j<20;j++){
vertical[i*40+j]=kTRUE;
}
}

volWindow->AddNode(0,0,new TGeoTranslation(0,0,-DimZPixelBox/2.-inimodZoffset));

for (int ipixel = 0; ipixel < nSi; ipixel++){
if (vertical[ipixel]){
if(PixelIDlist[ipixel]) {
if(PixelIDlist[ipixel]<1130 || (PixelIDlist[ipixel]>1219 && PixelIDlist[ipixel]<1620)) volPixelBox->AddNode(volPixelythick, PixelIDlist[ipixel], new TGeoTranslation(xs[ipixel],ys[ipixel],-DimZPixelBox/2.+ zs[ipixel]-inimodZoffset)); //compensation for the Node offset
else volPixelBox->AddNode(volPixelythin, PixelIDlist[ipixel], new TGeoTranslation(xs[ipixel],ys[ipixel],-DimZPixelBox/2.+ zs[ipixel]-inimodZoffset)); //compensation for the Node offset
}
else volPixelBox->AddNode(volPixelythick, 9000, new TGeoTranslation(xs[ipixel],ys[ipixel],-DimZPixelBox/2.+ zs[ipixel]-inimodZoffset)); //else here used for debugging, if the number of slices isn't 10

if((ipixel+nSlices)%9==1) VolSiliFEx->AddNode(VolSiliFEx, 0,new TGeoTranslation(xs[ipixel],ys[ipixel],-DimZPixelBox/2.+ zs[ipixel]-inimodZoffset+DimZThickSlice));
}
else{
if(PixelIDlist[ipixel])
if(PixelIDlist[ipixel]<1130 || (PixelIDlist[ipixel]>1219 && PixelIDlist[ipixel]<1620))volPixelBox->AddNode(volPixelxthick, PixelIDlist[ipixel], new TGeoTranslation(xs[ipixel],ys[ipixel],-DimZPixelBox/2.+ zs[ipixel]-inimodZoffset));
else volPixelBox->AddNode(volPixelxthin, PixelIDlist[ipixel], new TGeoTranslation(xs[ipixel],ys[ipixel],-DimZPixelBox/2.+ zs[ipixel]-inimodZoffset));

else volPixelBox->AddNode(volPixelxthick, 9000, new TGeoTranslation(xs[ipixel],ys[ipixel],-DimZPixelBox/2.+ zs[ipixel]-inimodZoffset)); //debugging else for if nSlice!=10


if((ipixel+nSlices)%9==1)VolSiliFEy->AddNode(VolSiliFEy, 0,new TGeoTranslation(xs[ipixel],ys[ipixel],-DimZPixelBox/2.+ zs[ipixel]-inimodZoffset+DimZThickSlice));
}

}
}



Bool_t PixelModules::ProcessHits(FairVolume* vol)
{
/** This method is called from the MC stepping */
Expand Down
29 changes: 20 additions & 9 deletions charmdet/PixelModules.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ class PixelModules:public FairDetector
void ConstructGeometry();
void SetZsize(const Double_t MSsize);
void SetBoxParam(Double_t SX, Double_t SY, Double_t SZ, Double_t zBox,Double_t SZPixel, Double_t Dim1Short, Double_t Dim1Long);
void SetSiliconDZ(Double_t SiliconDZ);
void SetSiliconDZ(Double_t SiliconDZthin, Double_t SiliconDZthick);
void SetSiliconStationPositions(Int_t nstation, Double_t posx, Double_t posy, Double_t posz);
void SetSiliconStationAngles(Int_t nstation, Double_t anglex, Double_t angley, Double_t anglez);
void SetSiliconDetNumber(Int_t nSilicon);

void SetSiliconSlicesNumber(Int_t nSl);
void ComputeDimZSlice();
/** Initialization of the detector is done here */
virtual void Initialize();

Expand Down Expand Up @@ -85,6 +86,7 @@ class PixelModules:public FairDetector
Double32_t fTime; //! time
Double32_t fLength; //! length
Double32_t fELoss; //! energy loss
Int_t nSlices;

/** container for data points */
TClonesArray* fPixelModulesPointCollection;
Expand All @@ -97,7 +99,6 @@ class PixelModules:public FairDetector

Double_t Dim1Short, Dim1Long;


Double_t SBoxX = 0;
Double_t SBoxY = 0;
Double_t SBoxZ = 0;
Expand All @@ -110,16 +111,26 @@ class PixelModules:public FairDetector
Double_t DimX =0;
Double_t DimY =0;
Double_t DimZ = 0;
Double_t DimZCu = 0.001;
Double_t DimZKa = 0.0005;
Double_t DimZFE = 0.0015;

Double_t zSizeMS = 0; //dimension of the Magnetic PixelModules volume
Double_t DimZWindow=0.011;
Double_t Windowx=5;
Double_t Windowy=5;//estimation has to be measured

Double_t overlap;
Double_t overlap=0;
Double_t DimZPixelBox;

Int_t nSi;
Double_t DimZSi;

Double_t xs[12], ys[12], zs[12];
Double_t xangle[12], yangle[12], zangle[12];
static const Int_t nSi=120;
Int_t numSi;
Double_t DimZSithin;
Double_t DimZSithick;
Double_t DimZThinSlice;
Double_t DimZThickSlice;
Double_t xs[nSi], ys[nSi], zs[nSi];
Double_t xangle[nSi], yangle[nSi], zangle[nSi];

PixelModules(const PixelModules&);
PixelModules& operator=(const PixelModules&);
Expand Down
Loading