Commit 9af24281 authored by Adrien Matta's avatar Adrien Matta
Browse files

* functionnal strasse scorer and data classe

parent 19135d1b
Pipeline #76546 passed with stages
in 74 minutes and 54 seconds
......@@ -54,13 +54,13 @@ void TStrasseData::Clear() {
fInner_YE_Energy.clear();
// Energy X
fOutter_XE_DetectorNbr.clear();
fOutter_XE_StripNbr.clear();
fOutter_XE_Energy.clear();
fOuter_XE_DetectorNbr.clear();
fOuter_XE_StripNbr.clear();
fOuter_XE_Energy.clear();
// Energy Y
fOutter_YE_DetectorNbr.clear();
fOutter_YE_StripNbr.clear();
fOutter_YE_Energy.clear();
fOuter_YE_DetectorNbr.clear();
fOuter_YE_StripNbr.clear();
fOuter_YE_Energy.clear();
}
......
......@@ -44,13 +44,13 @@ class TStrasseData : public TObject {
vector<double> fInner_YE_Energy;
// Second Stage Front Energy
vector<unsigned short> fOutter_XE_DetectorNbr;
vector<unsigned short> fOutter_XE_StripNbr;
vector<double> fOutter_XE_Energy;
vector<unsigned short> fOuter_XE_DetectorNbr;
vector<unsigned short> fOuter_XE_StripNbr;
vector<double> fOuter_XE_Energy;
// Second Stage Back Energy
vector<unsigned short> fOutter_YE_DetectorNbr;
vector<unsigned short> fOutter_YE_StripNbr;
vector<double> fOutter_YE_Energy;
vector<unsigned short> fOuter_YE_DetectorNbr;
vector<unsigned short> fOuter_YE_StripNbr;
vector<double> fOuter_YE_Energy;
//////////////////////////////////////////////////////////////
......@@ -76,13 +76,13 @@ class TStrasseData : public TObject {
public:
////////////////////// SETTERS ////////////////////////
// First Stage Energy Front
inline void SetInnerXE(const UShort_t& DetNbr, const UShort_t& StripNbr, const Double_t& Energy){
inline void SetInnerXE(const unsigned short& DetNbr, const unsigned short& StripNbr, const Double_t& Energy){
fInner_XE_DetectorNbr.push_back(DetNbr);
fInner_XE_StripNbr.push_back(StripNbr);
fInner_XE_Energy.push_back(Energy);
};//!
// First Stage Energy Back
inline void SetInnerYE(const UShort_t& DetNbr, const UShort_t& StripNbr, const Double_t& Energy){
inline void SetInnerYE(const unsigned short& DetNbr, const unsigned short& StripNbr, const Double_t& Energy){
fInner_YE_DetectorNbr.push_back(DetNbr);
fInner_YE_StripNbr.push_back(StripNbr);
fInner_YE_Energy.push_back(Energy);
......@@ -90,57 +90,57 @@ class TStrasseData : public TObject {
//////
// Second Stage Energy Front
inline void SetOutterXE(const UShort_t& DetNbr, const UShort_t& StripNbr, const Double_t& Energy){
fOutter_XE_DetectorNbr.push_back(DetNbr);
fOutter_XE_StripNbr.push_back(StripNbr);
fOutter_XE_Energy.push_back(Energy);
inline void SetOuterXE(const unsigned short& DetNbr, const unsigned short& StripNbr, const Double_t& Energy){
fOuter_XE_DetectorNbr.push_back(DetNbr);
fOuter_XE_StripNbr.push_back(StripNbr);
fOuter_XE_Energy.push_back(Energy);
};//!
// Second Stage Energy Back
inline void SetOutterYE(const UShort_t& DetNbr, const UShort_t& StripNbr, const Double_t& Energy){
fOutter_YE_DetectorNbr.push_back(DetNbr);
fOutter_YE_StripNbr.push_back(StripNbr);
fOutter_YE_Energy.push_back(Energy);
inline void SetOuterYE(const unsigned short& DetNbr, const unsigned short& StripNbr, const Double_t& Energy){
fOuter_YE_DetectorNbr.push_back(DetNbr);
fOuter_YE_StripNbr.push_back(StripNbr);
fOuter_YE_Energy.push_back(Energy);
};//!
////////////////////// GETTERS ////////////////////////
// First Stage Energy X
inline UShort_t GetInnerMultXEnergy() const
inline unsigned short GetInnerMultXEnergy() const
{return fInner_XE_DetectorNbr.size();}
inline UShort_t GetInner_XE_DetectorNbr(const unsigned int &i) const
inline unsigned short GetInner_XE_DetectorNbr(const unsigned int &i) const
{return fInner_XE_DetectorNbr[i];}//!
inline UShort_t GetInner_XE_StripNbr(const unsigned int &i) const
inline unsigned short GetInner_XE_StripNbr(const unsigned int &i) const
{return fInner_XE_StripNbr[i];}//!
inline Double_t GetInner_XE_Energy(const unsigned int &i) const
{return fInner_XE_Energy[i];}//!
// First Stage Energy Y
inline UShort_t GetInnerMultYEnergy() const
inline unsigned short GetInnerMultYEnergy() const
{return fInner_YE_DetectorNbr.size();}
inline UShort_t GetInner_YE_DetectorNbr(const unsigned int &i) const
inline unsigned short GetInner_YE_DetectorNbr(const unsigned int &i) const
{return fInner_YE_DetectorNbr[i];}//!
inline UShort_t GetInner_YE_StripNbr(const unsigned int &i) const
inline unsigned short GetInner_YE_StripNbr(const unsigned int &i) const
{return fInner_YE_StripNbr[i];}//!
inline Double_t GetInner_YE_Energy(const unsigned int &i) const
{return fInner_YE_Energy[i];}//!
//////
// Second Stage Energy X
inline UShort_t GetOutterMultXEnergy() const
{return fOutter_XE_DetectorNbr.size();}
inline UShort_t GetOutter_XE_DetectorNbr(const unsigned int &i) const
{return fOutter_XE_DetectorNbr[i];}//!
inline UShort_t GetOutter_XE_StripNbr(const unsigned int &i) const
{return fOutter_XE_StripNbr[i];}//!
inline Double_t GetOutter_XE_Energy(const unsigned int &i) const
{return fOutter_XE_Energy[i];}//!
inline unsigned short GetOuterMultXEnergy() const
{return fOuter_XE_DetectorNbr.size();}
inline unsigned short GetOuter_XE_DetectorNbr(const unsigned int &i) const
{return fOuter_XE_DetectorNbr[i];}//!
inline unsigned short GetOuter_XE_StripNbr(const unsigned int &i) const
{return fOuter_XE_StripNbr[i];}//!
inline Double_t GetOuter_XE_Energy(const unsigned int &i) const
{return fOuter_XE_Energy[i];}//!
// Second Stage Energy Y
inline UShort_t GetOutterMultYEnergy() const
{return fOutter_YE_DetectorNbr.size();}
inline UShort_t GetOutter_YE_DetectorNbr(const unsigned int &i) const
{return fOutter_YE_DetectorNbr[i];}//!
inline UShort_t GetOutter_YE_StripNbr(const unsigned int &i) const
{return fOutter_YE_StripNbr[i];}//!
inline Double_t GetOutter_YE_Energy(const unsigned int &i) const
{return fOutter_YE_Energy[i];}//!
inline unsigned short GetOuterMultYEnergy() const
{return fOuter_YE_DetectorNbr.size();}
inline unsigned short GetOuter_YE_DetectorNbr(const unsigned int &i) const
{return fOuter_YE_DetectorNbr[i];}//!
inline unsigned short GetOuter_YE_StripNbr(const unsigned int &i) const
{return fOuter_YE_StripNbr[i];}//!
inline Double_t GetOuter_YE_Energy(const unsigned int &i) const
{return fOuter_YE_Energy[i];}//!
//////////////////////////////////////////////////////////////
// Required for ROOT dictionnary
......
......@@ -199,11 +199,11 @@ void TStrassePhysics::BuildPhysicalEvent() {
PosY.push_back(GetPositionOfInteraction(i).y());
PosZ.push_back(GetPositionOfInteraction(i).z());
int OutterMult = m_PreTreatedData->GetOutterMultXEnergy();
for(unsigned int j=0; j<OutterMult; j++){
if(m_PreTreatedData->GetOutter_XE_DetectorNbr(j)==N){
double XDE = m_PreTreatedData->GetOutter_XE_Energy(j);
double YDE = m_PreTreatedData->GetOutter_YE_Energy(j);
int OuterMult = m_PreTreatedData->GetOuterMultXEnergy();
for(unsigned int j=0; j<OuterMult; j++){
if(m_PreTreatedData->GetOuter_XE_DetectorNbr(j)==N){
double XDE = m_PreTreatedData->GetOuter_XE_Energy(j);
double YDE = m_PreTreatedData->GetOuter_YE_Energy(j);
E.push_back(XDE);
}
......@@ -297,23 +297,23 @@ void TStrassePhysics::PreTreat() {
//////
// Second Stage Energy
sizeFront = m_EventData->GetOutterMultXEnergy();
sizeFront = m_EventData->GetOuterMultXEnergy();
for (UShort_t i = 0; i < sizeFront ; ++i) {
if (m_EventData->GetOutter_XE_Energy(i) > m_E_RAW_Threshold) {
Double_t Energy = m_EventData->GetOutter_XE_Energy(i);
//Double_t Energy = Cal->ApplyCalibration("Strasse/ENERGY"+NPL::itoa(m_EventData->GetOutter_XE_DetectorNbr(i)),m_EventData->GetOutter_XE_Energy(i));
if (m_EventData->GetOuter_XE_Energy(i) > m_E_RAW_Threshold) {
Double_t Energy = m_EventData->GetOuter_XE_Energy(i);
//Double_t Energy = Cal->ApplyCalibration("Strasse/ENERGY"+NPL::itoa(m_EventData->GetOuter_XE_DetectorNbr(i)),m_EventData->GetOuter_XE_Energy(i));
if (Energy > m_E_Threshold) {
m_PreTreatedData->SetOutterXE(m_EventData->GetOutter_XE_DetectorNbr(i), m_EventData->GetOutter_XE_StripNbr(i), Energy);
m_PreTreatedData->SetOuterXE(m_EventData->GetOuter_XE_DetectorNbr(i), m_EventData->GetOuter_XE_StripNbr(i), Energy);
}
}
}
sizeBack = m_EventData->GetOutterMultXEnergy();
sizeBack = m_EventData->GetOuterMultXEnergy();
for (UShort_t i = 0; i < sizeBack ; ++i) {
if (m_EventData->GetOutter_YE_Energy(i) > m_E_RAW_Threshold) {
Double_t Energy = m_EventData->GetOutter_YE_Energy(i);
//Double_t Energy = Cal->ApplyCalibration("Strasse/ENERGY"+NPL::itoa(m_EventData->GetOutter_YE_DetectorNbr(i)),m_EventData->GetOutter_YE_Energy(i));
if (m_EventData->GetOuter_YE_Energy(i) > m_E_RAW_Threshold) {
Double_t Energy = m_EventData->GetOuter_YE_Energy(i);
//Double_t Energy = Cal->ApplyCalibration("Strasse/ENERGY"+NPL::itoa(m_EventData->GetOuter_YE_DetectorNbr(i)),m_EventData->GetOuter_YE_Energy(i));
if (Energy > m_E_Threshold) {
m_PreTreatedData->SetOutterYE(m_EventData->GetOutter_YE_DetectorNbr(i), m_EventData->GetOutter_YE_StripNbr(i), Energy);
m_PreTreatedData->SetOuterYE(m_EventData->GetOuter_YE_DetectorNbr(i), m_EventData->GetOuter_YE_StripNbr(i), Energy);
}
}
}
......
......@@ -6,7 +6,7 @@
*****************************************************************************/
/*****************************************************************************
* Original Author: F.Flavigny contact address: flavigny@lpccaen.in2p3.fr *
* Original Author: A. Matta contact address: matta@lpccaen.in2p3.fr *
* *
* Creation Date : July 2020 *
* Last update : *
......@@ -264,10 +264,10 @@ G4LogicalVolume* Strasse::BuildInnerDetector(){
false,0);
// Sub volume Active Wafer
G4Box* ActiveWaferShape = new G4Box("ActiveWaferShape",
Inner_Wafer_Width*0.5-Inner_Wafer_GuardRing,
Inner_Wafer_Thickness*0.5,
0.5*(Inner_Wafer_Length-Inner_Wafer_PADExternal-Inner_Wafer_PADInternal-Inner_Wafer_GuardRing));
G4Box* ActiveWaferShape = new G4Box("InnerActiveWaferShape",
0.5*m_Active_InnerWafer_Width,
0.5*Inner_Wafer_Thickness,
0.5*m_Active_InnerWafer_Length);
G4LogicalVolume* logicActiveWafer =
new G4LogicalVolume(ActiveWaferShape,m_MaterialSilicon,"logicActiveWafer", 0, 0, 0);
......@@ -390,10 +390,10 @@ G4LogicalVolume* Strasse::BuildOuterDetector(){
false,0);
// Sub volume Active Wafer
G4Box* ActiveWaferShape = new G4Box("ActiveWaferShape",
Outer_Wafer_Width*0.5-Outer_Wafer_GuardRing,
Outer_Wafer_Thickness*0.5,
0.5*(Outer_Wafer_Length-Outer_Wafer_PADExternal-Outer_Wafer_PADInternal-Outer_Wafer_GuardRing));
G4Box* ActiveWaferShape = new G4Box("OuterActiveWaferShape",
0.5*m_Active_OuterWafer_Width,
0.5*Outer_Wafer_Thickness,
0.5*m_Active_OuterWafer_Length);
G4LogicalVolume* logicActiveWafer =
new G4LogicalVolume(ActiveWaferShape,m_MaterialSilicon,"logicActiveWafer", 0, 0, 0);
......@@ -610,23 +610,22 @@ void Strasse::ReadSensitive(const G4Event* ){
// Inner barrel scorer
DSSDScorers::PS_Rectangle* InnerScorer= (DSSDScorers::PS_Rectangle*) m_InnerScorer->GetPrimitive(0);
unsigned int sizeFront = InnerScorer->GetLengthMult();
unsigned int sizeFront = InnerScorer->GetWidthMult();
for(unsigned int i = 0 ; i < sizeFront ; i++){
double Energy = RandGauss::shoot(InnerScorer->GetEnergyLength(i), ResoEnergy);
double Energy = RandGauss::shoot(InnerScorer->GetEnergyWidth(i), ResoEnergy);
if(Energy>EnergyThreshold){
int DetNbr = InnerScorer->GetDetectorLength(i);
int StripFront = InnerScorer->GetStripLength(i);
// m_Event->SetInnerXE(DetNbr, StripFront, Energy);
std::cout << DetNbr << " " << StripFront << " " << Energy/keV << std::endl;
int DetNbr = InnerScorer->GetDetectorWidth(i);
int StripFront = InnerScorer->GetStripWidth(i);
m_Event->SetInnerXE(DetNbr, StripFront, Energy);
}
}
unsigned int sizeBack = InnerScorer->GetWidthMult();
unsigned int sizeBack = InnerScorer->GetLengthMult();
for(unsigned int i = 0 ; i < sizeBack ; i++){
double Energy = RandGauss::shoot(InnerScorer->GetEnergyWidth(i), ResoEnergy);
double Energy = RandGauss::shoot(InnerScorer->GetEnergyLength(i), ResoEnergy);
if(Energy>EnergyThreshold){
int DetNbr = InnerScorer->GetDetectorWidth(i);
int StripFront = InnerScorer->GetStripWidth(i);
// m_Event->SetInnerYE(DetNbr, StripFront, Energy);
int DetNbr = InnerScorer->GetDetectorLength(i);
int StripBack= InnerScorer->GetStripLength(i);
m_Event->SetInnerYE(DetNbr, StripBack, Energy);
}
}
InnerScorer->clear();
......@@ -635,23 +634,22 @@ void Strasse::ReadSensitive(const G4Event* ){
// Outer barrel scorer
DSSDScorers::PS_Rectangle* OuterScorer= (DSSDScorers::PS_Rectangle*) m_OuterScorer->GetPrimitive(0);
sizeFront = OuterScorer->GetLengthMult();
sizeFront = OuterScorer->GetWidthMult();
for(unsigned int i = 0 ; i < sizeFront ; i++){
double Energy = RandGauss::shoot(OuterScorer->GetEnergyLength(i), ResoEnergy);
double Energy = RandGauss::shoot(OuterScorer->GetEnergyWidth(i), ResoEnergy);
if(Energy>EnergyThreshold){
int DetNbr = OuterScorer->GetDetectorLength(i);
int StripFront = OuterScorer->GetStripLength(i);
// m_Event->SetOuterXE(DetNbr, StripFront, Energy);
int DetNbr = OuterScorer->GetDetectorWidth(i);
int StripFront = OuterScorer->GetStripWidth(i);
m_Event->SetOuterXE(DetNbr, StripFront, Energy);
}
}
sizeBack = OuterScorer->GetWidthMult();
sizeBack = OuterScorer->GetLengthMult();
for(unsigned int i = 0 ; i < sizeBack ; i++){
double Energy = RandGauss::shoot(OuterScorer->GetEnergyWidth(i), ResoEnergy);
double Energy = RandGauss::shoot(OuterScorer->GetEnergyLength(i), ResoEnergy);
if(Energy>EnergyThreshold){
int DetNbr = OuterScorer->GetDetectorWidth(i);
int StripFront = OuterScorer->GetStripWidth(i);
// m_Event->SetOuterYE(DetNbr, StripFront, Energy);
int DetNbr = OuterScorer->GetDetectorLength(i);
int StripBack= OuterScorer->GetStripLength(i);
m_Event->SetOuterYE(DetNbr, StripBack, Energy);
}
}
OuterScorer->clear();
......@@ -670,17 +668,28 @@ void Strasse::InitializeScorers() {
return ;
// Otherwise the scorer is initialised
m_Active_InnerWafer_Width= Inner_Wafer_Width-2.*Inner_Wafer_GuardRing;
m_Active_InnerWafer_Length=
Inner_Wafer_Length-Inner_Wafer_PADExternal-Inner_Wafer_PADInternal-Inner_Wafer_GuardRing;
G4VPrimitiveScorer* InnerScorer = new DSSDScorers::PS_Rectangle("InnerScorer",2,
Inner_Wafer_Length,
Inner_Wafer_Width,
m_Active_InnerWafer_Width,
m_Active_InnerWafer_Length,
Inner_Wafer_FrontStrips,
Inner_Wafer_BackStrips);
Inner_Wafer_BackStrips,0,"xz");
m_Active_OuterWafer_Width=Outer_Wafer_Width-2.*Outer_Wafer_GuardRing;
m_Active_OuterWafer_Length=
Outer_Wafer_Length-Outer_Wafer_PADExternal-Outer_Wafer_PADInternal-Outer_Wafer_GuardRing;
G4VPrimitiveScorer* OuterScorer = new DSSDScorers::PS_Rectangle("OuterScorer",2,
Outer_Wafer_Length,
Outer_Wafer_Width,
m_Active_OuterWafer_Width,
m_Active_OuterWafer_Length,
Outer_Wafer_FrontStrips,
Outer_Wafer_BackStrips);
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);
......
......@@ -8,7 +8,7 @@
*****************************************************************************/
/*****************************************************************************
* Original Author: F. Flavigny contact address: flavigny@lpccaen.in2p3.fr *
* Original Author: A. Matta contact address: matta@lpccaen.in2p3.fr *
* *
* Creation Date : July 2020 *
* Last update : *
......@@ -78,6 +78,11 @@ class Strasse : public NPS::VDetector{
G4Material* m_MaterialVacuum ;
G4Material* m_MaterialPCB ;
// calculated dimension
double m_Active_InnerWafer_Width;
double m_Active_InnerWafer_Length;
double m_Active_OuterWafer_Width;
double m_Active_OuterWafer_Length;
////////////////////////////////////////////////////
......
EmPhysicsList Option4
DefaultCutOff 10000000000
IonBinaryCascadePhysics 0
NPIonInelasticPhysics 0
EmExtraPhysics 0
HadronElasticPhysics 0
StoppingPhysics 0
OpticalPhysics 0
HadronPhysicsINCLXX 0
HadronPhysicsQGSP_BIC_HP 0
Decay 1
......@@ -13,7 +13,7 @@ Target
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1
Strasse Info
Inner_Wafer_Length= 124 mm
Inner_Wafer_Width= 30 mm
Inner_Wafer_Width= 25 mm
Inner_Wafer_Thickness= 300 micrometer
Inner_Wafer_AlThickness= 0.4 micrometer
Inner_Wafer_PADExternal= 1 mm
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment