Commit 738773eb authored by Adrien Matta's avatar Adrien Matta
Browse files

* adding strasse shift option

parent 6d774a7d
Pipeline #76598 passed with stages
in 23 minutes and 50 seconds
......@@ -149,17 +149,19 @@ Strasse::~Strasse(){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Strasse::AddInnerDetector(double R, double Z, double Phi){
void Strasse::AddInnerDetector(double R, double Z, double Phi, double Shift){
m_Inner_R.push_back(R);
m_Inner_Z.push_back(Z);
m_Inner_Phi.push_back(Phi);
m_Inner_Shift.push_back(Shift);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Strasse::AddOuterDetector(double R, double Z, double Phi){
void Strasse::AddOuterDetector(double R, double Z, double Phi, double Shift){
m_Outer_R.push_back(R);
m_Outer_Z.push_back(Z);
m_Outer_Phi.push_back(Phi);
m_Outer_Shift.push_back(Shift);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -530,7 +532,7 @@ void Strasse::ReadConfiguration(NPL::InputParser parser){
if(NPOptionManager::getInstance()->GetVerboseLevel())
cout << "//// " << blocks_inner.size() << " inner detectors found " << endl;
vector<string> coord = {"Radius","Z","Phi"};
vector<string> coord = {"Radius","Z","Phi","Shift"};
for(unsigned int i = 0 ; i < blocks_inner.size() ; i++){
if(blocks_inner[i]->HasTokenList(coord)){
......@@ -540,10 +542,11 @@ void Strasse::ReadConfiguration(NPL::InputParser parser){
double R = blocks_inner[i]->GetDouble("Radius","mm");
double Z= blocks_inner[i]->GetDouble("Z","mm");
double Phi = blocks_inner[i]->GetDouble("Phi","deg");
AddInnerDetector(R,Z,Phi);
double Shift = blocks_inner[i]->GetDouble("Shift","mm");
AddInnerDetector(R,Z,Phi,Shift);
}
else{
cout << "ERROR: check your input file formatting " << endl;
cout << "ERROR: check your input file formatting on " << i+1 << " inner block " <<endl;
exit(1);
}
}
......@@ -561,10 +564,12 @@ void Strasse::ReadConfiguration(NPL::InputParser parser){
double R = blocks_outer[i]->GetDouble("Radius","mm");
double Z= blocks_outer[i]->GetDouble("Z","mm");
double Phi = blocks_outer[i]->GetDouble("Phi","deg");
AddOuterDetector(R,Z,Phi);
double Shift = blocks_outer[i]->GetDouble("Shift","mm");
AddOuterDetector(R,Z,Phi,Shift);
}
else{
cout << "ERROR: check your input file formatting " << endl;
cout << "ERROR: check your input file formatting on " << i+1 << " outer block " <<endl;
exit(1);
}
}
......@@ -580,7 +585,7 @@ void Strasse::ConstructDetector(G4LogicalVolume* world){
// Inner Barrel
for (unsigned short i = 0 ; i < m_Inner_R.size() ; i++) {
G4ThreeVector Det_pos = G4ThreeVector(0,m_Inner_R[i],m_Inner_Z[i]) ;
G4ThreeVector Det_pos = G4ThreeVector(m_Inner_Shift[i],m_Inner_R[i],m_Inner_Z[i]) ;
Det_pos.rotate(-m_Inner_Phi[i],G4ThreeVector(0,0,1));
G4RotationMatrix* Rot = new G4RotationMatrix(0*deg,0*deg,m_Inner_Phi[i]);
......@@ -591,7 +596,7 @@ void Strasse::ConstructDetector(G4LogicalVolume* world){
// Outer Barrel
for (unsigned short i = 0 ; i < m_Outer_R.size() ; i++) {
G4ThreeVector Det_pos = G4ThreeVector(0,m_Outer_R[i],m_Outer_Z[i]) ;
G4ThreeVector Det_pos = G4ThreeVector(m_Outer_Shift[i],m_Outer_R[i],m_Outer_Z[i]) ;
Det_pos.rotate(-m_Outer_Phi[i],G4ThreeVector(0,0,1));
G4RotationMatrix* Rot = new G4RotationMatrix(0*deg,0*deg,m_Outer_Phi[i]);
......
......@@ -50,8 +50,8 @@ class Strasse : public NPS::VDetector{
////////////////////////////////////////////////////
public:
// Cylindrical coordinate
void AddInnerDetector(double R,double Z,double Phi);
void AddOuterDetector(double R,double Z,double Phi);
void AddInnerDetector(double R,double Z,double Phi, double Shift);
void AddOuterDetector(double R,double Z,double Phi, double Shift);
G4LogicalVolume* BuildInnerDetector();
G4LogicalVolume* BuildOuterDetector();
......@@ -129,9 +129,12 @@ class Strasse : public NPS::VDetector{
vector<double> m_Inner_R;
vector<double> m_Inner_Z;
vector<double> m_Inner_Phi;
vector<double> m_Inner_Shift;
vector<double> m_Outer_R;
vector<double> m_Outer_Z;
vector<double> m_Outer_Phi;
vector<double> m_Outer_Shift;
// Visualisation Attribute
......
......@@ -50,70 +50,82 @@ Strasse Inner
Radius= 30 mm
Z= 100 mm
Phi= 0 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%2
Strasse Inner
Radius= 30 mm
Z= 100 mm
Phi= 60 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%3
Strasse Inner
Radius= 30 mm
Z= 100 mm
Phi= 120 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%4
Strasse Inner
Radius= 30 mm
Z= 100 mm
Phi= 180 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
Strasse Inner
Radius= 30 mm
Z= 100 mm
Phi= 240 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%6
Strasse Inner
Radius= 30 mm
Z= 100 mm
Phi= 300 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1
Strasse Outer
Radius= 60 mm
Z= 129 mm
Phi= 0 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%2
Strasse Outer
Radius= 60 mm
Z= 129 mm
Phi= 60 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%3
Strasse Outer
Radius= 60 mm
Z= 129 mm
Phi= 120 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%4
Strasse Outer
Radius= 60 mm
Z= 129 mm
Phi= 180 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
Strasse Outer
Radius= 60 mm
Z= 129 mm
Phi= 240 deg
Shift= 5 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%6
Strasse Outer
Radius= 60 mm
Z= 129 mm
Phi= 300 deg
Shift= 5 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