diff --git a/NPSimulation/Detectors/Catana/Catana.cc b/NPSimulation/Detectors/Catana/Catana.cc index c12302a11979d24739ea178a8bf61f04652555c3..b8f07f624f0ea709d6139d079384d1ec9b2edbf5 100644 --- a/NPSimulation/Detectors/Catana/Catana.cc +++ b/NPSimulation/Detectors/Catana/Catana.cc @@ -96,7 +96,7 @@ Catana::~Catana(){ } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -void Catana::AddDetector(double X,double Y, double Z, double Theta, double Phi, int ID, int Type){ +void Catana::AddDetector(double X,double Y, double Z, double Theta, double Phi, int ID, int Type,double Rshift){ m_X.push_back(X); m_Y.push_back(Y); m_Z.push_back(Z); @@ -104,10 +104,11 @@ void Catana::AddDetector(double X,double Y, double Z, double Theta, double Phi, m_Phi.push_back(Phi); m_ID.push_back(ID); m_Type.push_back(Type); + m_Rshift.push_back(Rshift); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -void Catana::ReadCSV(string path){ +void Catana::ReadCSV(string path,double Rshift){ std::ifstream csv(path); if(!csv.is_open()){ std::ostringstream message; @@ -122,7 +123,7 @@ void Catana::ReadCSV(string path){ getline(csv,buffer); while(csv >> ID >> buffer >> type >> buffer >> layer >> buffer >> X >> buffer >> Y >> buffer >> Z >> buffer >> Theta >> buffer >> Phi){ if(type<6) - AddDetector(X,Y,Z,Theta*deg,Phi*deg,ID,type); + AddDetector(X,Y,Z,Theta*deg,Phi*deg,ID,type,Rshift); else{ // ignore other type for which I don't have the geometry } @@ -390,14 +391,15 @@ void Catana::ReadConfiguration(NPL::InputParser parser){ if(NPOptionManager::getInstance()->GetVerboseLevel()) cout << "//// " << blocks.size() << " CSV block found " << endl; - vector<string> token = {"Path"}; + vector<string> token = {"Path","Rshift"}; for(unsigned int i = 0 ; i < blocks.size() ; i++){ if(blocks[i]->HasTokenList(token)){ if(NPOptionManager::getInstance()->GetVerboseLevel()) cout << endl << "//// Catana " << i+1 << endl; string path = blocks[i]->GetString("Path"); - ReadCSV(path); + double Rshift = blocks[i]->GetDouble("Rshift","micrometer"); + ReadCSV(path,Rshift); } else{ cout << "ERROR: check your input file formatting " << endl; @@ -450,7 +452,7 @@ void Catana::ConstructDetector(G4LogicalVolume* world){ Det_dir.unit(); // had to add a 70micron in radius to avoid overlap when using official // csv simulation file - Det_dir.setMag(m_Zoffset[m_Type[i]]+0.07); + Det_dir.setMag(m_Zoffset[m_Type[i]]+m_Rshift[i]); Det_pos+=Det_dir; G4RotationMatrix* Rot = new G4RotationMatrix(); Rot->rotateX(-m_Theta[i]); diff --git a/NPSimulation/Detectors/Catana/Catana.hh b/NPSimulation/Detectors/Catana/Catana.hh index d5680e98d353812da6449ad64ea645a052abeb25..5528daf562070b2f5b2e03553af3b1cd047ccbd2 100644 --- a/NPSimulation/Detectors/Catana/Catana.hh +++ b/NPSimulation/Detectors/Catana/Catana.hh @@ -52,8 +52,8 @@ class Catana : public NPS::VDetector{ //////////////////////////////////////////////////// public: // Cartesian - void AddDetector(double X, double Y, double Z, double Theta, double Phi, int ID,int Type); - void ReadCSV(string path); + void AddDetector(double X, double Y, double Z, double Theta, double Phi, int ID,int Type,double Rshift=0); + void ReadCSV(string path,double Rshift); G4LogicalVolume* BuildDetector(int Type); @@ -109,6 +109,12 @@ class Catana : public NPS::VDetector{ vector<double> m_Phi; vector<int> m_ID; vector<int> m_Type; + // this parameter is here because some csv file have very small overlap + // due to difference between mechanical design and reality of the detector + // a shift is apply to the position of the crystal to slightly icrease the radius + // and avoid shift. Typical value shoulde be < 100um + vector<double> m_Rshift;// additional shift to apply to csv file + // relative shift of crystal w/r to the housing map<int,double> m_Zoffset; // Visualisation Attribute diff --git a/Projects/Catana/Catana.detector b/Projects/Catana/Catana.detector index 6d7a466ccb9262cce56cc4d50a64431c709199be..6615ad6f1dfd7356112667fbb89fe58e2bcc27df 100644 --- a/Projects/Catana/Catana.detector +++ b/Projects/Catana/Catana.detector @@ -11,6 +11,7 @@ Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Catana CSV Path= Catana.csv + Rshift= 70 micrometer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Catana Detector