Skip to content
Snippets Groups Projects
Commit 48ee0f90 authored by Adrien Matta's avatar Adrien Matta :skull_crossbones:
Browse files

* Adding daysi chain of silicon detector in strasse

parent 9af24281
No related branches found
No related tags found
No related merge requests found
Pipeline #76552 passed
...@@ -123,8 +123,10 @@ using namespace Strasse_NS; ...@@ -123,8 +123,10 @@ using namespace Strasse_NS;
Strasse::Strasse(){ Strasse::Strasse(){
InitializeMaterial(); InitializeMaterial();
m_Event = new TStrasseData() ; m_Event = new TStrasseData() ;
m_InnerScorer = 0; m_InnerScorer1 = 0;
m_OuterScorer = 0; m_OuterScorer1 = 0;
m_InnerScorer2 = 0;
m_OuterScorer2 = 0;
m_InnerDetector=0; m_InnerDetector=0;
m_OuterDetector=0; m_OuterDetector=0;
m_Chamber=0; m_Chamber=0;
...@@ -269,20 +271,27 @@ G4LogicalVolume* Strasse::BuildInnerDetector(){ ...@@ -269,20 +271,27 @@ G4LogicalVolume* Strasse::BuildInnerDetector(){
0.5*Inner_Wafer_Thickness, 0.5*Inner_Wafer_Thickness,
0.5*m_Active_InnerWafer_Length); 0.5*m_Active_InnerWafer_Length);
G4LogicalVolume* logicActiveWafer = G4LogicalVolume* logicActiveWafer1 =
new G4LogicalVolume(ActiveWaferShape,m_MaterialSilicon,"logicActiveWafer", 0, 0, 0); new G4LogicalVolume(ActiveWaferShape,m_MaterialSilicon,"logicActiveWafer1", 0, 0, 0);
logicActiveWafer->SetVisAttributes(SiliconVisAtt); logicActiveWafer1->SetVisAttributes(SiliconVisAtt);
logicActiveWafer->SetSensitiveDetector(m_InnerScorer); logicActiveWafer1->SetSensitiveDetector(m_InnerScorer1);
G4LogicalVolume* logicActiveWafer2 =
new G4LogicalVolume(ActiveWaferShape,m_MaterialSilicon,"logicActiveWafer2", 0, 0, 0);
logicActiveWafer2->SetVisAttributes(SiliconVisAtt);
logicActiveWafer2->SetSensitiveDetector(m_InnerScorer2);
new G4PVPlacement(new G4RotationMatrix(0,0,0), new G4PVPlacement(new G4RotationMatrix(0,0,0),
G4ThreeVector(0,0,0.5*(Inner_Wafer_PADExternal-Inner_Wafer_PADInternal)), // assymetric pading for bounding G4ThreeVector(0,0,0.5*(Inner_Wafer_PADExternal-Inner_Wafer_PADInternal)), // assymetric pading for bounding
logicActiveWafer,"Strasse_Inner_ActiveWafer1",logicWafer1, logicActiveWafer1,"Strasse_Inner_ActiveWafer1",logicWafer1,
false,1); false,1);
new G4PVPlacement(new G4RotationMatrix(0,0,0), new G4PVPlacement(new G4RotationMatrix(0,0,0),
G4ThreeVector(0,0,-0.5*(Inner_Wafer_PADExternal-Inner_Wafer_PADInternal)), // assymetric pading for bounding G4ThreeVector(0,0,-0.5*(Inner_Wafer_PADExternal-Inner_Wafer_PADInternal)), // assymetric pading for bounding
logicActiveWafer,"Strasse_Inner_ActiveWafer2",logicWafer2, logicActiveWafer2,"Strasse_Inner_ActiveWafer2",logicWafer2,
false,1); false,2);
} }
return m_InnerDetector; return m_InnerDetector;
} }
...@@ -395,20 +404,26 @@ G4LogicalVolume* Strasse::BuildOuterDetector(){ ...@@ -395,20 +404,26 @@ G4LogicalVolume* Strasse::BuildOuterDetector(){
0.5*Outer_Wafer_Thickness, 0.5*Outer_Wafer_Thickness,
0.5*m_Active_OuterWafer_Length); 0.5*m_Active_OuterWafer_Length);
G4LogicalVolume* logicActiveWafer = G4LogicalVolume* logicActiveWafer1 =
new G4LogicalVolume(ActiveWaferShape,m_MaterialSilicon,"logicActiveWafer", 0, 0, 0); new G4LogicalVolume(ActiveWaferShape,m_MaterialSilicon,"logicActiveWafer1", 0, 0, 0);
logicActiveWafer->SetVisAttributes(SiliconVisAtt); logicActiveWafer1->SetVisAttributes(SiliconVisAtt);
logicActiveWafer->SetSensitiveDetector(m_OuterScorer); logicActiveWafer1->SetSensitiveDetector(m_OuterScorer1);
G4LogicalVolume* logicActiveWafer2 =
new G4LogicalVolume(ActiveWaferShape,m_MaterialSilicon,"logicActiveWafer2", 0, 0, 0);
logicActiveWafer2->SetVisAttributes(SiliconVisAtt);
logicActiveWafer2->SetSensitiveDetector(m_OuterScorer2);
new G4PVPlacement(new G4RotationMatrix(0,0,0), new G4PVPlacement(new G4RotationMatrix(0,0,0),
G4ThreeVector(0,0,0.5*(Outer_Wafer_PADExternal-Outer_Wafer_PADInternal)), // assymetric pading for bounding G4ThreeVector(0,0,0.5*(Outer_Wafer_PADExternal-Outer_Wafer_PADInternal)), // assymetric pading for bounding
logicActiveWafer,"Strasse_Outer_ActiveWafer1",logicWafer1, logicActiveWafer1,"Strasse_Outer_ActiveWafer1",logicWafer1,
false,1); false,1);
new G4PVPlacement(new G4RotationMatrix(0,0,0), new G4PVPlacement(new G4RotationMatrix(0,0,0),
G4ThreeVector(0,0,-0.5*(Outer_Wafer_PADExternal-Outer_Wafer_PADInternal)), // assymetric pading for bounding G4ThreeVector(0,0,-0.5*(Outer_Wafer_PADExternal-Outer_Wafer_PADInternal)), // assymetric pading for bounding
logicActiveWafer,"Strasse_Outer_ActiveWafer2",logicWafer2, logicActiveWafer2,"Strasse_Outer_ActiveWafer2",logicWafer2,
false,1); false,2);
} }
return m_OuterDetector; return m_OuterDetector;
} }
...@@ -608,51 +623,100 @@ void Strasse::ReadSensitive(const G4Event* ){ ...@@ -608,51 +623,100 @@ void Strasse::ReadSensitive(const G4Event* ){
/////////// ///////////
// Inner barrel scorer // Inner barrel scorer
DSSDScorers::PS_Rectangle* InnerScorer= (DSSDScorers::PS_Rectangle*) m_InnerScorer->GetPrimitive(0); DSSDScorers::PS_Rectangle* InnerScorer1= (DSSDScorers::PS_Rectangle*) m_InnerScorer1->GetPrimitive(0);
unsigned int sizeFront = InnerScorer1->GetWidthMult();
for(unsigned int i = 0 ; i < sizeFront ; i++){
double Energy = RandGauss::shoot(InnerScorer1->GetEnergyWidth(i), ResoEnergy);
if(Energy>EnergyThreshold){
int DetNbr = InnerScorer1->GetDetectorWidth(i);
int StripFront = InnerScorer1->GetStripWidth(i);
m_Event->SetInnerXE(DetNbr, StripFront, Energy);
}
}
unsigned int sizeBack = InnerScorer1->GetLengthMult();
for(unsigned int i = 0 ; i < sizeBack ; i++){
double Energy = RandGauss::shoot(InnerScorer1->GetEnergyLength(i), ResoEnergy);
if(Energy>EnergyThreshold){
int DetNbr = InnerScorer1->GetDetectorLength(i);
int StripBack= InnerScorer1->GetStripLength(i);
m_Event->SetInnerYE(DetNbr, StripBack, Energy);
}
}
InnerScorer1->clear();
// second silicon
DSSDScorers::PS_Rectangle* InnerScorer2= (DSSDScorers::PS_Rectangle*) m_InnerScorer2->GetPrimitive(0);
unsigned int sizeFront = InnerScorer->GetWidthMult(); sizeFront = InnerScorer2->GetWidthMult();
for(unsigned int i = 0 ; i < sizeFront ; i++){ for(unsigned int i = 0 ; i < sizeFront ; i++){
double Energy = RandGauss::shoot(InnerScorer->GetEnergyWidth(i), ResoEnergy); double Energy = RandGauss::shoot(InnerScorer2->GetEnergyWidth(i), ResoEnergy);
if(Energy>EnergyThreshold){ if(Energy>EnergyThreshold){
int DetNbr = InnerScorer->GetDetectorWidth(i); int DetNbr = InnerScorer2->GetDetectorWidth(i);
int StripFront = InnerScorer->GetStripWidth(i); int StripFront = InnerScorer2->GetStripWidth(i)+Inner_Wafer_FrontStrips;
m_Event->SetInnerXE(DetNbr, StripFront, Energy); m_Event->SetInnerXE(DetNbr, StripFront, Energy);
} }
} }
unsigned int sizeBack = InnerScorer->GetLengthMult(); sizeBack = InnerScorer2->GetLengthMult();
for(unsigned int i = 0 ; i < sizeBack ; i++){ for(unsigned int i = 0 ; i < sizeBack ; i++){
double Energy = RandGauss::shoot(InnerScorer->GetEnergyLength(i), ResoEnergy); double Energy = RandGauss::shoot(InnerScorer2->GetEnergyLength(i), ResoEnergy);
if(Energy>EnergyThreshold){ if(Energy>EnergyThreshold){
int DetNbr = InnerScorer->GetDetectorLength(i); int DetNbr = InnerScorer2->GetDetectorLength(i);
int StripBack= InnerScorer->GetStripLength(i); int StripBack= InnerScorer2->GetStripLength(i);
m_Event->SetInnerYE(DetNbr, StripBack, Energy); m_Event->SetInnerYE(DetNbr, StripBack, Energy);
} }
} }
InnerScorer->clear(); InnerScorer2->clear();
/////////// ///////////
// Outer barrel scorer // Outer barrel scorer
DSSDScorers::PS_Rectangle* OuterScorer= (DSSDScorers::PS_Rectangle*) m_OuterScorer->GetPrimitive(0); DSSDScorers::PS_Rectangle* OuterScorer1= (DSSDScorers::PS_Rectangle*) m_OuterScorer1->GetPrimitive(0);
sizeFront = OuterScorer->GetWidthMult(); sizeFront = OuterScorer1->GetWidthMult();
for(unsigned int i = 0 ; i < sizeFront ; i++){ for(unsigned int i = 0 ; i < sizeFront ; i++){
double Energy = RandGauss::shoot(OuterScorer->GetEnergyWidth(i), ResoEnergy); double Energy = RandGauss::shoot(OuterScorer1->GetEnergyWidth(i), ResoEnergy);
if(Energy>EnergyThreshold){ if(Energy>EnergyThreshold){
int DetNbr = OuterScorer->GetDetectorWidth(i); int DetNbr = OuterScorer1->GetDetectorWidth(i);
int StripFront = OuterScorer->GetStripWidth(i); int StripFront = OuterScorer1->GetStripWidth(i);
m_Event->SetOuterXE(DetNbr, StripFront, Energy); m_Event->SetOuterXE(DetNbr, StripFront, Energy);
} }
} }
sizeBack = OuterScorer->GetLengthMult(); sizeBack = OuterScorer1->GetLengthMult();
for(unsigned int i = 0 ; i < sizeBack ; i++){ for(unsigned int i = 0 ; i < sizeBack ; i++){
double Energy = RandGauss::shoot(OuterScorer->GetEnergyLength(i), ResoEnergy); double Energy = RandGauss::shoot(OuterScorer1->GetEnergyLength(i), ResoEnergy);
if(Energy>EnergyThreshold){ if(Energy>EnergyThreshold){
int DetNbr = OuterScorer->GetDetectorLength(i); int DetNbr = OuterScorer1->GetDetectorLength(i);
int StripBack= OuterScorer->GetStripLength(i); int StripBack= OuterScorer1->GetStripLength(i);
m_Event->SetOuterYE(DetNbr, StripBack, Energy); m_Event->SetOuterYE(DetNbr, StripBack, Energy);
} }
} }
OuterScorer->clear(); OuterScorer1->clear();
// Second silicon
DSSDScorers::PS_Rectangle* OuterScorer2= (DSSDScorers::PS_Rectangle*) m_OuterScorer2->GetPrimitive(0);
sizeFront = OuterScorer2->GetWidthMult();
for(unsigned int i = 0 ; i < sizeFront ; i++){
double Energy = RandGauss::shoot(OuterScorer2->GetEnergyWidth(i), ResoEnergy);
if(Energy>EnergyThreshold){
int DetNbr = OuterScorer2->GetDetectorWidth(i);
int StripFront = OuterScorer2->GetStripWidth(i)+Inner_Wafer_FrontStrips;
m_Event->SetOuterXE(DetNbr, StripFront, Energy);
}
}
sizeBack = OuterScorer2->GetLengthMult();
for(unsigned int i = 0 ; i < sizeBack ; i++){
double Energy = RandGauss::shoot(OuterScorer2->GetEnergyLength(i), ResoEnergy);
if(Energy>EnergyThreshold){
int DetNbr = OuterScorer2->GetDetectorLength(i);
int StripBack= OuterScorer2->GetStripLength(i);
m_Event->SetOuterYE(DetNbr, StripBack, Energy);
}
}
OuterScorer2->clear();
} }
...@@ -661,8 +725,11 @@ void Strasse::ReadSensitive(const G4Event* ){ ...@@ -661,8 +725,11 @@ void Strasse::ReadSensitive(const G4Event* ){
void Strasse::InitializeScorers() { void Strasse::InitializeScorers() {
// This check is necessary in case the geometry is reloaded // This check is necessary in case the geometry is reloaded
bool already_exist = false; bool already_exist = false;
m_InnerScorer = CheckScorer("InnerScorer",already_exist) ; m_InnerScorer1 = CheckScorer("InnerScorer1",already_exist) ;
m_OuterScorer = CheckScorer("OuterScorer",already_exist) ; m_OuterScorer1 = CheckScorer("OuterScorer1",already_exist) ;
m_InnerScorer2 = CheckScorer("InnerScorer2",already_exist) ;
m_OuterScorer2 = CheckScorer("OuterScorer2",already_exist) ;
if(already_exist) if(already_exist)
return ; return ;
...@@ -673,35 +740,61 @@ void Strasse::InitializeScorers() { ...@@ -673,35 +740,61 @@ void Strasse::InitializeScorers() {
Inner_Wafer_Length-Inner_Wafer_PADExternal-Inner_Wafer_PADInternal-Inner_Wafer_GuardRing; Inner_Wafer_Length-Inner_Wafer_PADExternal-Inner_Wafer_PADInternal-Inner_Wafer_GuardRing;
G4VPrimitiveScorer* InnerScorer = new DSSDScorers::PS_Rectangle("InnerScorer",2, G4VPrimitiveScorer* InnerScorer1 = new DSSDScorers::PS_Rectangle("InnerScorer1",2,
m_Active_InnerWafer_Width, m_Active_InnerWafer_Width,
m_Active_InnerWafer_Length, m_Active_InnerWafer_Length,
Inner_Wafer_FrontStrips, Inner_Wafer_FrontStrips,
Inner_Wafer_BackStrips,0,"xz"); Inner_Wafer_BackStrips,0,"xz");
G4VPrimitiveScorer* InnerScorer2 = new DSSDScorers::PS_Rectangle("InnerScorer2",2,
m_Active_InnerWafer_Width,
m_Active_InnerWafer_Length,
Inner_Wafer_FrontStrips,
Inner_Wafer_BackStrips,0,"xz");
m_Active_OuterWafer_Width=Outer_Wafer_Width-2.*Outer_Wafer_GuardRing; m_Active_OuterWafer_Width=Outer_Wafer_Width-2.*Outer_Wafer_GuardRing;
m_Active_OuterWafer_Length= m_Active_OuterWafer_Length=
Outer_Wafer_Length-Outer_Wafer_PADExternal-Outer_Wafer_PADInternal-Outer_Wafer_GuardRing; Outer_Wafer_Length-Outer_Wafer_PADExternal-Outer_Wafer_PADInternal-Outer_Wafer_GuardRing;
G4VPrimitiveScorer* OuterScorer = new DSSDScorers::PS_Rectangle("OuterScorer",2, G4VPrimitiveScorer* OuterScorer1 = new DSSDScorers::PS_Rectangle("OuterScorer1",2,
m_Active_OuterWafer_Width,
m_Active_OuterWafer_Length,
Outer_Wafer_FrontStrips,
Outer_Wafer_BackStrips,0,"xz");
G4VPrimitiveScorer* OuterScorer2 = new DSSDScorers::PS_Rectangle("OuterScorer2",2,
m_Active_OuterWafer_Width, m_Active_OuterWafer_Width,
m_Active_OuterWafer_Length, m_Active_OuterWafer_Length,
Outer_Wafer_FrontStrips, Outer_Wafer_FrontStrips,
Outer_Wafer_BackStrips,0,"xz"); Outer_Wafer_BackStrips,0,"xz");
G4VPrimitiveScorer* InteractionInner = new InteractionScorers::PS_Interactions("InteractionInner",ms_InterCoord,0);
G4VPrimitiveScorer* InteractionOuter = new InteractionScorers::PS_Interactions("InteractionOuter",ms_InterCoord,0);
G4VPrimitiveScorer* InteractionInner1 = new InteractionScorers::PS_Interactions("InteractionInner1",ms_InterCoord,0);
G4VPrimitiveScorer* InteractionOuter1 = new InteractionScorers::PS_Interactions("InteractionOuter1",ms_InterCoord,0);
G4VPrimitiveScorer* InteractionInner2 = new InteractionScorers::PS_Interactions("InteractionInner2",ms_InterCoord,0);
G4VPrimitiveScorer* InteractionOuter2 = new InteractionScorers::PS_Interactions("InteractionOuter2",ms_InterCoord,0);
// Register it to the multifunctionnal detector // Register it to the multifunctionnal detector
m_InnerScorer->RegisterPrimitive(InnerScorer); m_InnerScorer1->RegisterPrimitive(InnerScorer1);
m_InnerScorer->RegisterPrimitive(InteractionInner); m_InnerScorer1->RegisterPrimitive(InteractionInner1);
m_OuterScorer->RegisterPrimitive(OuterScorer); m_OuterScorer1->RegisterPrimitive(OuterScorer1);
m_OuterScorer->RegisterPrimitive(InteractionOuter); m_OuterScorer1->RegisterPrimitive(InteractionOuter1);
m_InnerScorer2->RegisterPrimitive(InnerScorer2);
m_InnerScorer2->RegisterPrimitive(InteractionInner2);
m_OuterScorer2->RegisterPrimitive(OuterScorer2);
m_OuterScorer2->RegisterPrimitive(InteractionOuter2);
G4SDManager::GetSDMpointer()->AddNewDetector(m_InnerScorer1);
G4SDManager::GetSDMpointer()->AddNewDetector(m_OuterScorer1);
G4SDManager::GetSDMpointer()->AddNewDetector(m_InnerScorer2);
G4SDManager::GetSDMpointer()->AddNewDetector(m_OuterScorer2);
G4SDManager::GetSDMpointer()->AddNewDetector(m_InnerScorer);
G4SDManager::GetSDMpointer()->AddNewDetector(m_OuterScorer);
} }
......
...@@ -110,8 +110,11 @@ class Strasse : public NPS::VDetector{ ...@@ -110,8 +110,11 @@ class Strasse : public NPS::VDetector{
void InitializeScorers() ; void InitializeScorers() ;
// Associated Scorer // Associated Scorer
G4MultiFunctionalDetector* m_InnerScorer ; G4MultiFunctionalDetector* m_InnerScorer1 ;
G4MultiFunctionalDetector* m_OuterScorer ; G4MultiFunctionalDetector* m_OuterScorer1 ;
G4MultiFunctionalDetector* m_InnerScorer2 ;
G4MultiFunctionalDetector* m_OuterScorer2 ;
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
///////////Event class to store Data//////////////// ///////////Event class to store Data////////////////
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment