Skip to content
Snippets Groups Projects
Commit 08847a8d authored by Hugo Jacob's avatar Hugo Jacob
Browse files

Merge branch 'NPTool.2.dev' of gitlab.in2p3.fr:np/nptool into NPTool.2.dev

parents 9fae8953 7a1fa9bf
No related branches found
No related tags found
1 merge request!27Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline #321865 passed
Showing
with 3030 additions and 359 deletions
......@@ -134,14 +134,13 @@ void TFPMWPhysics::BuildPhysicalEvent() {
//double PosX = FittedHyperbolicSecant(MaxQX[DetN],MapX[DetN]);
//double PosY = FittedHyperbolicSecant(MaxQY[DetN],MapY[DetN]);
if(DetN==0 || DetN==1){
PosX = PosX - DetPosX[DetN];
PosY = PosY - DetPosY[DetN];
if(DetN==1 || DetN==2){
PosX = PosX - DetPosX[DetN-1];
PosY = PosY - DetPosY[DetN-1];
}
else if(DetN==2 || DetN==3){
PosX = -PosX - DetPosX[DetN];
PosY = PosY - DetPosY[DetN];
else if(DetN==3 || DetN==4){
PosX = -PosX - DetPosX[DetN-1];
PosY = PosY - DetPosY[DetN-1];
}
int sx0 = (int) PosX;
......@@ -326,7 +325,14 @@ void TFPMWPhysics::PreTreat() {
int det = m_EventData->GetFPMW_DetX(i);
int strip = m_EventData->GetFPMW_StripX(i);
double QX = m_EventData->GetFPMW_ChargeX(i);
double Qcal = Cal->ApplyCalibration("FPMW/DET"+NPL::itoa(det)+"_STRIP"+NPL::itoa(strip),QX);
double a0 = Cal->GetValue("FPMW/DET"+NPL::itoa(det)+"_STRIPX"+NPL::itoa(strip),0);
double a1 = Cal->GetValue("FPMW/DET"+NPL::itoa(det)+"_STRIPX"+NPL::itoa(strip),1);
double a2 = Cal->GetValue("FPMW/DET"+NPL::itoa(det)+"_STRIPX"+NPL::itoa(strip),2);
double scale = Cal->GetValue("FPMW/DET"+NPL::itoa(det)+"_STRIPX"+NPL::itoa(strip),3);
double Qcal = (QX-a0)*a1 + pow(QX-a0,2)*a2;
Qcal = scale*Qcal;
m_PreTreatedData->SetFPMW_DetX(det);
m_PreTreatedData->SetFPMW_StripX(strip);
m_PreTreatedData->SetFPMW_ChargeX(Qcal);
......@@ -337,7 +343,14 @@ void TFPMWPhysics::PreTreat() {
int det = m_EventData->GetFPMW_DetY(i);
int strip = m_EventData->GetFPMW_StripY(i);
double QY = m_EventData->GetFPMW_ChargeY(i);
double Qcal = Cal->ApplyCalibration("FPMW/DET"+NPL::itoa(det)+"_STRIP"+NPL::itoa(strip),QY);
double a0 = Cal->GetValue("FPMW/DET"+NPL::itoa(det)+"_STRIPY"+NPL::itoa(strip),0);
double a1 = Cal->GetValue("FPMW/DET"+NPL::itoa(det)+"_STRIPY"+NPL::itoa(strip),1);
double a2 = Cal->GetValue("FPMW/DET"+NPL::itoa(det)+"_STRIPY"+NPL::itoa(strip),2);
double scale = Cal->GetValue("FPMW/DET"+NPL::itoa(det)+"_STRIPY"+NPL::itoa(strip),3);
double Qcal = (QY-a0)*a1 + pow(QY-a0,2)*a2;
Qcal = scale*Qcal;
m_PreTreatedData->SetFPMW_DetY(det);
m_PreTreatedData->SetFPMW_StripY(strip);
m_PreTreatedData->SetFPMW_ChargeY(Qcal);
......@@ -479,7 +492,8 @@ void TFPMWPhysics::AddParameterToCalibrationManager() {
for(int i = 0; i < m_NumberOfDetectors; i++){
for(int s = 0; s < 996; s++){
Cal->AddParameter("FPMW","DET"+NPL::itoa(i)+"_STRIP"+NPL::itoa(s),"FPMW_DET"+NPL::itoa(i)+"_STRIP"+NPL::itoa(s));
Cal->AddParameter("FPMW","DET"+NPL::itoa(i+1)+"_STRIPX"+NPL::itoa(s+1),"FPMW_DET"+NPL::itoa(i+1)+"_STRIPX"+NPL::itoa(s+1));
Cal->AddParameter("FPMW","DET"+NPL::itoa(i+1)+"_STRIPY"+NPL::itoa(s+1),"FPMW_DET"+NPL::itoa(i+1)+"_STRIPY"+NPL::itoa(s+1));
}
}
}
......
......@@ -56,7 +56,8 @@ ClassImp(TPISTAPhysics)
m_StripEnergyMatching = 0.050;
m_DistanceBetweenDEandE = 4;
m_Back_E_Time_min = 0;
m_Back_E_Time_max = 3000;
m_Back_E_Time_max = 100000;
m_CALIB_BACK_E_PER_STRIP= 0;
}
///////////////////////////////////////////////////////////////////////////
......@@ -419,7 +420,7 @@ void TPISTAPhysics::PreTreat() {
double StripT = m_EventData->GetPISTA_DE_StripTime(i);
double ped = Cal->GetValue("PISTA/T"+NPL::itoa(DetNbr)+"_STRIP"+NPL::itoa(StripNbr)+"_DE_PEDESTAL",0);
double CalStripE = Cal->ApplyCalibration("PISTA/T"+NPL::itoa(DetNbr)+"_STRIP"+NPL::itoa(StripNbr)+"_DE_ENERGY",StripE-ped);
double CalStripE = Cal->ApplyCalibration("PISTA/T"+NPL::itoa(DetNbr)+"_STRIP"+NPL::itoa(StripNbr)+"_DE_ENERGY",StripE);
if(sizeDE_back==0 && CalStripE > m_E_Threshold){
m_PreTreatedData->SetPISTA_DE(DetNbr, StripNbr, CalStripE, -100, StripT, -100);
......@@ -452,14 +453,20 @@ void TPISTAPhysics::PreTreat() {
double StripT = m_EventData->GetPISTA_E_StripTime(i);
double ped = Cal->GetValue("PISTA/T"+NPL::itoa(DetNbr)+"_STRIP"+NPL::itoa(StripNbr)+"_E_PEDESTAL",0);
double CalStripE = Cal->ApplyCalibration("PISTA/T"+NPL::itoa(DetNbr)+"_STRIP"+NPL::itoa(StripNbr)+"_E_ENERGY",StripE-ped);
double CalStripE = Cal->ApplyCalibration("PISTA/T"+NPL::itoa(DetNbr)+"_STRIP"+NPL::itoa(StripNbr)+"_E_ENERGY",StripE);
for(UShort_t j = 0; j< sizeE_back; j++){
double BackE = m_EventData->GetPISTA_E_BackEnergy(j);
double BackT = m_EventData->GetPISTA_E_BackTime(j);
int BackDet = m_EventData->GetPISTA_E_BackDetector(j);
double CalBackE = Cal->ApplyCalibration("PISTA/T"+NPL::itoa(DetNbr)+"_BACK_E",BackE);
double CalBackE;
if(m_CALIB_BACK_E_PER_STRIP==1){
CalBackE = Cal->ApplyCalibration("PISTA/T"+NPL::itoa(DetNbr)+"_BACK_E_STRIP"+NPL::itoa(StripNbr),BackE);
}
else{
CalBackE = Cal->ApplyCalibration("PISTA/T"+NPL::itoa(DetNbr)+"_BACK_E",BackE);
}
if (CalStripE > m_E_Threshold && DetNbr==BackDet) {
m_PreTreatedData->SetPISTA_E(DetNbr, StripNbr, CalStripE, CalBackE, StripT, BackT);
......@@ -541,6 +548,12 @@ void TPISTAPhysics::ReadAnalysisConfig() {
m_Back_E_Time_max = atof(DataBuffer.c_str());
cout << whatToDo << " " << m_Back_E_Time_max << endl;
}
else if (whatToDo=="CALIB_BACK_E_PER_STRIP") {
AnalysisConfigFile >> DataBuffer;
m_CALIB_BACK_E_PER_STRIP = atoi(DataBuffer.c_str());
cout << whatToDo << " " << m_CALIB_BACK_E_PER_STRIP << endl;
}
......@@ -737,6 +750,7 @@ void TPISTAPhysics::AddParameterToCalibrationManager() {
for(int j=0; j<m_NumberOfStripsX; j++){
Cal->AddParameter("PISTA", "T"+ NPL::itoa(i+1)+"_STRIP"+NPL::itoa(j+1)+"_E_ENERGY","PISTA_T"+ NPL::itoa(i+1)+"_STRIP"+NPL::itoa(j+1)+"_E_ENERGY");
Cal->AddParameter("PISTA", "T"+ NPL::itoa(i+1)+"_STRIP"+NPL::itoa(j+1)+"_E_PEDESTAL","PISTA_T"+ NPL::itoa(i+1)+"_STRIP"+NPL::itoa(j+1)+"_E_PEDESTAL");
Cal->AddParameter("PISTA", "T"+ NPL::itoa(i+1)+"_BACK_E_STRIP"+NPL::itoa(j+1),"PISTA_T"+ NPL::itoa(i+1)+"_BACK_E_STRIP"+NPL::itoa(j+1));
}
......@@ -783,14 +797,14 @@ NPL::VDetector* TPISTAPhysics::Construct() {
// Registering the construct method to the factory //
////////////////////////////////////////////////////////////////////////////////
extern "C"{
class proxy_PISTA{
public:
proxy_PISTA(){
NPL::DetectorFactory::getInstance()->AddToken("PISTA","PISTA");
NPL::DetectorFactory::getInstance()->AddDetector("PISTA",TPISTAPhysics::Construct);
}
};
class proxy_PISTA{
public:
proxy_PISTA(){
NPL::DetectorFactory::getInstance()->AddToken("PISTA","PISTA");
NPL::DetectorFactory::getInstance()->AddDetector("PISTA",TPISTAPhysics::Construct);
}
};
proxy_PISTA p_PISTA;
proxy_PISTA p_PISTA;
}
......@@ -219,6 +219,7 @@ class TPISTAPhysics : public TObject, public NPL::VDetector {
double m_E_Threshold; //!
double m_Back_E_Time_min; //!
double m_Back_E_Time_max; //!
int m_CALIB_BACK_E_PER_STRIP; //!
private:
unsigned int m_MaximumStripMultiplicityAllowed;//
......
......@@ -55,30 +55,30 @@ using namespace CLHEP;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace GAGG_NS {
// Energy and time Resolution
const double EnergyThreshold = 0.1 * MeV;
const double ResoTime = 4.5 * ns;
// const double ResoEnergy = 20*keV ;
const double ResoEnergy = 4.2 / 100.;
// const double ResoEnergy = 0.00001*keV ;
const double Radius = 20 * mm;
const double Width = 40 * mm;
const double Thickness = 80 * mm;
const string Material = "GAGG";
// const string Material = "CsI";
// Energy and time Resolution
const double EnergyThreshold = 0.1 * MeV;
const double ResoTime = 4.5 * ns;
// const double ResoEnergy = 20*keV ;
const double ResoEnergy = 4.2 / 100.;
// const double ResoEnergy = 0.00001*keV ;
// const double Radius = 20 * mm;
// const double Width = 40 * mm;
// const double Thickness = 80 * mm;
const string Material = "GAGG";
// const string Material = "CsI";
} // namespace GAGG_NS
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// GAGG Specific Method
GAGG::GAGG() {
m_Event = new TGAGGData();
m_GAGGScorer = 0;
m_SquareDetector = 0;
m_Event = new TGAGGData();
m_GAGGScorer = 0;
m_SquareDetector = 0;
m_CylindricalDetector = 0;
// RGB Color + Transparency
m_VisSquare = new G4VisAttributes(G4Colour(1, 1, 0, 0.5));
m_VisSquare = new G4VisAttributes(G4Colour(1, 1, 0, 0.5));
m_VisCylinder = new G4VisAttributes(G4Colour(1, 1, 0, 0.5));
}
......@@ -94,45 +94,42 @@ void GAGG::AddDetector(G4ThreeVector POS, string Shape) {
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void GAGG::AddDetector(double R, double Theta, double Phi, string Shape) {
void GAGG::AddDetector(double R, double Theta, double Phi, string Shape, double Width, double Height, double Thickness) {
m_R.push_back(R);
m_Theta.push_back(Theta);
m_Phi.push_back(Phi);
m_Shape.push_back(Shape);
m_Width.push_back(Width);
m_Height.push_back(Height);
m_Thickness.push_back(Thickness);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* GAGG::BuildSquareDetector() {
if (!m_SquareDetector) {
G4Box* box = new G4Box("GAGG_Box", GAGG_NS::Width * 0.5,
GAGG_NS::Width * 0.5, GAGG_NS::Thickness * 0.5);
G4Material* DetectorMaterial
= MaterialManager::getInstance()->GetMaterialFromLibrary(
GAGG_NS::Material);
m_SquareDetector
= new G4LogicalVolume(box, DetectorMaterial, "logic_GAGG_Box", 0, 0, 0);
G4LogicalVolume* GAGG::BuildSquareDetector(int DetectorNumber) {
// if (!m_SquareDetector) {
std::string str_det = std::to_string(DetectorNumber);
std::string box_name = "GAGG_Box" + str_det;
G4Box* box = new G4Box(box_name.c_str(), m_Width[DetectorNumber] * 0.5, m_Height[DetectorNumber] * 0.5, m_Thickness[DetectorNumber] * 0.5);
G4Material* DetectorMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary(GAGG_NS::Material);
m_SquareDetector = new G4LogicalVolume(box, DetectorMaterial, "logic_GAGG_Box", 0, 0, 0);
m_SquareDetector->SetVisAttributes(m_VisSquare);
m_SquareDetector->SetSensitiveDetector(m_GAGGScorer);
}
// }
return m_SquareDetector;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* GAGG::BuildCylindricalDetector() {
if (!m_CylindricalDetector) {
G4Tubs* tub = new G4Tubs("GAGG_Cyl", 0, GAGG_NS::Radius,
GAGG_NS::Thickness * 0.5, 0, 360 * deg);
G4Material* DetectorMaterial
= MaterialManager::getInstance()->GetMaterialFromLibrary(
GAGG_NS::Material);
m_CylindricalDetector
= new G4LogicalVolume(tub, DetectorMaterial, "logic_GAGG_tub", 0, 0, 0);
m_CylindricalDetector->SetVisAttributes(m_VisSquare);
m_CylindricalDetector->SetSensitiveDetector(m_GAGGScorer);
}
return m_CylindricalDetector;
}
// G4LogicalVolume* GAGG::BuildCylindricalDetector() {
// if (!m_CylindricalDetector) {
// G4Tubs* tub = new G4Tubs("GAGG_Cyl", 0, GAGG_NS::Radius, GAGG_NS::Thickness * 0.5, 0, 360 * deg);
// G4Material* DetectorMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary(GAGG_NS::Material);
// m_CylindricalDetector = new G4LogicalVolume(tub, DetectorMaterial, "logic_GAGG_tub", 0, 0, 0);
// m_CylindricalDetector->SetVisAttributes(m_VisSquare);
// m_CylindricalDetector->SetSensitiveDetector(m_GAGGScorer);
// }
// return m_CylindricalDetector;
// }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -147,26 +144,30 @@ void GAGG::ReadConfiguration(NPL::InputParser parser) {
cout << "//// " << blocks.size() << " detectors found " << endl;
vector<string> cart = {"POS", "Shape"};
vector<string> sphe = {"R", "Theta", "Phi", "Shape"};
vector<string> sphe = {"R", "Theta", "Phi", "Shape", "Width", "Height", "Thickness"};
for (unsigned int i = 0; i < blocks.size(); i++) {
if (blocks[i]->HasTokenList(cart)) {
if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// GAGG " << i + 1 << endl;
G4ThreeVector Pos
= NPS::ConvertVector(blocks[i]->GetTVector3("POS", "mm"));
G4ThreeVector Pos = NPS::ConvertVector(blocks[i]->GetTVector3("POS", "mm"));
string Shape = blocks[i]->GetString("Shape");
AddDetector(Pos, Shape);
} else if (blocks[i]->HasTokenList(sphe)) {
}
else if (blocks[i]->HasTokenList(sphe)) {
if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// GAGG " << i + 1 << endl;
double R = blocks[i]->GetDouble("R", "mm");
double R = blocks[i]->GetDouble("R", "mm");
double Theta = blocks[i]->GetDouble("Theta", "deg");
double Phi = blocks[i]->GetDouble("Phi", "deg");
double Phi = blocks[i]->GetDouble("Phi", "deg");
double Width = blocks[i]->GetDouble("Width", "mm");
double Height = blocks[i]->GetDouble("Height", "mm");
double Thickness = blocks[i]->GetDouble("Thickness", "mm");
string Shape = blocks[i]->GetString("Shape");
AddDetector(R, Theta, Phi, Shape);
} else {
AddDetector(R, Theta, Phi, Shape, Width, Height, Thickness);
}
else {
cout << "ERROR: check your input file formatting " << endl;
exit(1);
}
......@@ -180,34 +181,31 @@ void GAGG::ReadConfiguration(NPL::InputParser parser) {
void GAGG::ConstructDetector(G4LogicalVolume* world) {
for (unsigned short i = 0; i < m_R.size(); i++) {
G4double wX = m_R[i] * sin(m_Theta[i]) * cos(m_Phi[i]);
G4double wY = m_R[i] * sin(m_Theta[i]) * sin(m_Phi[i]);
G4double wZ = m_R[i] * cos(m_Theta[i]);
G4double wX = m_R[i] * sin(m_Theta[i]) * cos(m_Phi[i]);
G4double wY = m_R[i] * sin(m_Theta[i]) * sin(m_Phi[i]);
G4double wZ = m_R[i] * cos(m_Theta[i]);
G4ThreeVector Det_pos = G4ThreeVector(wX, wY, wZ);
// So the face of the detector is at R instead of the middle
Det_pos += Det_pos.unit() * GAGG_NS::Thickness * 0.5;
Det_pos += Det_pos.unit() * m_Thickness[i] * 0.5;
// Building Detector reference frame
G4double ii = cos(m_Theta[i]) * cos(m_Phi[i]);
G4double jj = cos(m_Theta[i]) * sin(m_Phi[i]);
G4double kk = -sin(m_Theta[i]);
G4double ii = cos(m_Theta[i]) * cos(m_Phi[i]);
G4double jj = cos(m_Theta[i]) * sin(m_Phi[i]);
G4double kk = -sin(m_Theta[i]);
G4ThreeVector Y(ii, jj, kk);
G4ThreeVector w = Det_pos.unit();
G4ThreeVector u = w.cross(Y);
G4ThreeVector v = w.cross(u);
v = v.unit();
u = u.unit();
v = v.unit();
u = u.unit();
G4RotationMatrix* Rot = new G4RotationMatrix(u, v, w);
if (m_Shape[i] == "Cylindrical") {
new G4PVPlacement(G4Transform3D(*Rot, Det_pos),
BuildCylindricalDetector(), "GAGG", world, false,
i + 1);
// new G4PVPlacement(G4Transform3D(*Rot, Det_pos), BuildCylindricalDetector(), "GAGG", world, false, i + 1);
}
else if (m_Shape[i] == "Square") {
new G4PVPlacement(G4Transform3D(*Rot, Det_pos), BuildSquareDetector(),
"GAGG", world, false, i + 1);
new G4PVPlacement(G4Transform3D(*Rot, Det_pos), BuildSquareDetector(i), "GAGG", world, false, i + 1);
}
}
}
......@@ -216,7 +214,7 @@ void GAGG::ConstructDetector(G4LogicalVolume* world) {
// Called After DetecorConstruction::AddDetector Method
void GAGG::InitializeRootOutput() {
RootOutput* pAnalysis = RootOutput::getInstance();
TTree* pTree = pAnalysis->GetTree();
TTree* pTree = pAnalysis->GetTree();
if (!pTree->FindBranch("GAGG")) {
pTree->Branch("GAGG", "TGAGGData", &m_Event);
}
......@@ -231,18 +229,15 @@ void GAGG::ReadSensitive(const G4Event*) {
///////////
// Calorimeter scorer
CalorimeterScorers::PS_Calorimeter* Scorer
= (CalorimeterScorers::PS_Calorimeter*)m_GAGGScorer->GetPrimitive(0);
CalorimeterScorers::PS_Calorimeter* Scorer = (CalorimeterScorers::PS_Calorimeter*)m_GAGGScorer->GetPrimitive(0);
unsigned int size = Scorer->GetMult();
for (unsigned int i = 0; i < size; i++) {
vector<unsigned int> level = Scorer->GetLevel(i);
double Energy
= RandGauss::shoot(Scorer->GetEnergy(i),
GAGG_NS::ResoEnergy / 2.35 * Scorer->GetEnergy(i));
double Energy = RandGauss::shoot(Scorer->GetEnergy(i), GAGG_NS::ResoEnergy / 2.35 * Scorer->GetEnergy(i));
if (Energy > GAGG_NS::EnergyThreshold) {
double Time = RandGauss::shoot(Scorer->GetTime(i), GAGG_NS::ResoTime);
int DetectorNbr = level[0];
int DetectorNbr = level[0];
m_Event->SetEnergy(DetectorNbr, Energy);
m_Event->SetTime(DetectorNbr, Time);
}
......@@ -254,7 +249,7 @@ void GAGG::ReadSensitive(const G4Event*) {
void GAGG::InitializeScorers() {
// This check is necessary in case the geometry is reloaded
bool already_exist = false;
m_GAGGScorer = CheckScorer("GAGGScorer", already_exist);
m_GAGGScorer = CheckScorer("GAGGScorer", already_exist);
if (already_exist)
return;
......@@ -262,10 +257,8 @@ void GAGG::InitializeScorers() {
// Otherwise the scorer is initialised
vector<int> level;
level.push_back(0);
G4VPrimitiveScorer* Calorimeter
= new CalorimeterScorers::PS_Calorimeter("Calorimeter", level, 0);
G4VPrimitiveScorer* Interaction = new InteractionScorers::PS_Interactions(
"Interaction", ms_InterCoord, 0);
G4VPrimitiveScorer* Calorimeter = new CalorimeterScorers::PS_Calorimeter("Calorimeter", level, 0);
G4VPrimitiveScorer* Interaction = new InteractionScorers::PS_Interactions("Interaction", ms_InterCoord, 0);
// and register it to the multifunctionnal detector
m_GAGGScorer->RegisterPrimitive(Calorimeter);
m_GAGGScorer->RegisterPrimitive(Interaction);
......@@ -286,7 +279,7 @@ NPS::VDetector* GAGG::Construct() { return (NPS::VDetector*)new GAGG(); }
////////////////////////////////////////////////////////////////////////////////
extern "C" {
class proxy_nps_GAGG {
public:
public:
proxy_nps_GAGG() {
NPS::DetectorFactory::getInstance()->AddToken("GAGG", "GAGG");
NPS::DetectorFactory::getInstance()->AddDetector("GAGG", GAGG::Construct);
......
......@@ -27,91 +27,93 @@
using namespace std;
// G4 headers
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
#include "G4LogicalVolume.hh"
#include "G4MultiFunctionalDetector.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
// NPTool header
#include "NPInputParser.h"
#include "NPSVDetector.hh"
#include "TGAGGData.h"
#include "NPInputParser.h"
class GAGG : public NPS::VDetector{
class GAGG : public NPS::VDetector {
////////////////////////////////////////////////////
/////// Default Constructor and Destructor /////////
////////////////////////////////////////////////////
public:
GAGG() ;
virtual ~GAGG() ;
////////////////////////////////////////////////////
/////// Specific Function of this Class ///////////
////////////////////////////////////////////////////
public:
// Cartesian
void AddDetector(G4ThreeVector POS, string Shape);
// Spherical
void AddDetector(double R,double Theta,double Phi,string Shape);
G4LogicalVolume* BuildSquareDetector();
G4LogicalVolume* BuildCylindricalDetector();
private:
G4LogicalVolume* m_SquareDetector;
G4LogicalVolume* m_CylindricalDetector;
////////////////////////////////////////////////////
////// Inherite from NPS::VDetector class /////////
////////////////////////////////////////////////////
public:
// Read stream at Configfile to pick-up parameters of detector (Position,...)
// Called in DetecorConstruction::ReadDetextorConfiguration Method
void ReadConfiguration(NPL::InputParser) ;
// Construct detector and inialise sensitive part.
// Called After DetecorConstruction::AddDetector Method
void ConstructDetector(G4LogicalVolume* world) ;
// Add Detector branch to the EventTree.
// Called After DetecorConstruction::AddDetector Method
void InitializeRootOutput() ;
// Read sensitive part and fill the Root tree.
// Called at in the EventAction::EndOfEventAvtion
void ReadSensitive(const G4Event* event) ;
public: // Scorer
// Initialize all Scorer used by the MUST2Array
void InitializeScorers() ;
// Associated Scorer
G4MultiFunctionalDetector* m_GAGGScorer ;
////////////////////////////////////////////////////
///////////Event class to store Data////////////////
////////////////////////////////////////////////////
private:
TGAGGData* m_Event ;
////////////////////////////////////////////////////
///////////////Private intern Data//////////////////
////////////////////////////////////////////////////
private: // Geometry
// Detector Coordinate
vector<double> m_R;
vector<double> m_Theta;
vector<double> m_Phi;
// Shape type
vector<string> m_Shape ;
// Visualisation Attribute
G4VisAttributes* m_VisSquare;
G4VisAttributes* m_VisCylinder;
public:
GAGG();
virtual ~GAGG();
////////////////////////////////////////////////////
/////// Specific Function of this Class ///////////
////////////////////////////////////////////////////
public:
// Cartesian
void AddDetector(G4ThreeVector POS, string Shape);
// Spherical
void AddDetector(double R, double Theta, double Phi, string Shape, double Width, double Height, double Thickness);
G4LogicalVolume* BuildSquareDetector(int DetectorNumber);
// G4LogicalVolume* BuildCylindricalDetector();
private:
G4LogicalVolume* m_SquareDetector;
G4LogicalVolume* m_CylindricalDetector;
////////////////////////////////////////////////////
////// Inherite from NPS::VDetector class /////////
////////////////////////////////////////////////////
public:
// Read stream at Configfile to pick-up parameters of detector (Position,...)
// Called in DetecorConstruction::ReadDetextorConfiguration Method
void ReadConfiguration(NPL::InputParser);
// Construct detector and inialise sensitive part.
// Called After DetecorConstruction::AddDetector Method
void ConstructDetector(G4LogicalVolume* world);
// Add Detector branch to the EventTree.
// Called After DetecorConstruction::AddDetector Method
void InitializeRootOutput();
// Read sensitive part and fill the Root tree.
// Called at in the EventAction::EndOfEventAvtion
void ReadSensitive(const G4Event* event);
public: // Scorer
// Initialize all Scorer used by the MUST2Array
void InitializeScorers();
// Associated Scorer
G4MultiFunctionalDetector* m_GAGGScorer;
////////////////////////////////////////////////////
///////////Event class to store Data////////////////
////////////////////////////////////////////////////
private:
TGAGGData* m_Event;
////////////////////////////////////////////////////
///////////////Private intern Data//////////////////
////////////////////////////////////////////////////
private: // Geometry
// Detector Coordinate
vector<double> m_R;
vector<double> m_Theta;
vector<double> m_Phi;
vector<double> m_Width;
vector<double> m_Height;
vector<double> m_Thickness;
// Shape type
vector<string> m_Shape;
// Visualisation Attribute
G4VisAttributes* m_VisSquare;
G4VisAttributes* m_VisCylinder;
// Needed for dynamic loading of the library
public:
static NPS::VDetector* Construct();
public:
static NPS::VDetector* Construct();
};
#endif
......@@ -68,7 +68,7 @@ namespace PISTA_NS{
const double TrapezoidBaseSmall = 41.0*mm;
const double TrapezoidHeight = 57.7*mm;
const double TrapezoidLength = 1*cm;
const double FirstStageThickness = 200*um;
const double FirstStageThickness = 300*um;
const double SecondStageThickness = 1.5*mm;
const double DistanceBetweenSi = 4*mm;
const double FirstStageNbrOfStrips = 91;
......
......@@ -60,12 +60,18 @@ using namespace CLHEP;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace Vendeta_NS{
// Energy and time Resolution
const double EnergyThreshold = 0.1*MeV;
const double ResoTime = 0.4/2.35*ns ;
const double ResoEnergy = 0.1*MeV ;
//const double Thickness = 51.*mm ;
const double Thickness = 30.*mm ;
const double EnergyThreshold = 0.01*MeV;
const double ResoTime = 0.454*ns ; // reso Cf
/* const double ResoTime = 0.61*ns ; // reso U8 */
/* const double ResoTime = 0.*ns ; // reso U8 */
const double ResoEnergyLG = 0.43*MeV ;
const double ResoEnergyHG = 0.255*MeV ;
const double Thickness = 51.*mm ;
const double Radius = 127./2*mm ;
// Lead shield
const double Lead_Radius = 9*cm;
const double Lead_Thickness = 9*mm;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -78,6 +84,8 @@ Vendeta::Vendeta(){
m_SensitiveCell = 0;
m_MecanicalStructure = 0;
m_Build_MecanicalStructure = 0;
m_LeadShield = 0;
m_BuildLeadShield = 1;
// RGB Color + Transparency
m_VisAl = new G4VisAttributes(G4Colour(0.5, 0.5, 0.5));
......@@ -86,6 +94,7 @@ Vendeta::Vendeta(){
m_VisPyrex = new G4VisAttributes(G4Colour(0.1, 0.5, 0.7, 1));
m_VisEJ560 = new G4VisAttributes(G4Colour(0.6, 0.6, 0.2, 1));
m_VisInox = new G4VisAttributes(G4Colour(0.6, 0.5, 0.6, 1));
m_VisLeadShield = new G4VisAttributes(G4Colour(0.2, 0.2, 0.2, 1));
// Material definition
m_Vacuum = MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum");
......@@ -141,6 +150,7 @@ G4AssemblyVolume* Vendeta::BuildVendetaDetector(){
Rot->rotateX(90*deg);
if(!m_VendetaDetector){
m_VendetaDetector = new G4AssemblyVolume();
// *** Sensitive Volume *** //
......@@ -200,6 +210,18 @@ G4AssemblyVolume* Vendeta::BuildVendetaDetector(){
LogicVolume->SetVisAttributes(m_VisPyrex);
m_VendetaDetector->AddPlacedVolume(LogicVolume,Pos,Rot);
if(m_BuildLeadShield){
G4Tubs* lead = new G4Tubs("lead_shield", 0, Vendeta_NS::Lead_Radius, Vendeta_NS::Lead_Thickness*0.5, 0, 360*deg);
G4Material* LeadMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary("Pb");
m_LeadShield = new G4LogicalVolume(lead, LeadMaterial, "logic_lead_shield",0,0,0);
m_LeadShield->SetVisAttributes(m_VisLeadShield);
Pos.setX(0);
Pos.setY(0);
Pos.setZ( Vendeta_NS::Lead_Thickness*0.5-5*mm);
m_VendetaDetector->AddPlacedVolume(m_LeadShield, Pos, 0);
}
}
return m_VendetaDetector;
}
......@@ -212,31 +234,32 @@ G4AssemblyVolume* Vendeta::BuildMecanicalStructure()
G4RotationMatrix* Rot = new G4RotationMatrix();
G4ThreeVector Pos = G4ThreeVector(0,0,0);
string basepath = getenv("NPTOOL");
// *** Steel part of the strucutre *** //
string path = basepath + "/NPSimulation/Detectors/Vendeta/Structure_meca_stl/Structure_Acier.stl";
auto mesh = CADMesh::TessellatedMesh::FromSTL((char*) path.c_str());
mesh->SetScale(mm);
auto cad_solid = mesh->GetSolid();
m_MecanicalStructure_Steel = new G4LogicalVolume(cad_solid,m_Inox,"Structure_Steel",0,0,0);
m_MecanicalStructure_Steel->SetVisAttributes(m_VisInox);
m_MecanicalStructure->AddPlacedVolume(m_MecanicalStructure_Steel,Pos,Rot);
// *** Aluminium part *** //
path = basepath + "/NPSimulation/Detectors/Vendeta/Structure_meca_stl/Structure_Alu.stl";
mesh = CADMesh::TessellatedMesh::FromSTL((char*) path.c_str());
mesh->SetScale(mm);
cad_solid = mesh->GetSolid();
m_MecanicalStructure_Al = new G4LogicalVolume(cad_solid,m_Al,"Structure_Al",0,0,0);
m_MecanicalStructure_Al->SetVisAttributes(m_VisAl);
m_MecanicalStructure->AddPlacedVolume(m_MecanicalStructure_Al,Pos,Rot);
}
return m_MecanicalStructure;
......@@ -260,7 +283,7 @@ void Vendeta::ReadConfiguration(NPL::InputParser parser){
if(blocks[i]->HasTokenList(cart)){
if(NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// Vendeta " << i+1 << endl;
G4ThreeVector Pos = NPS::ConvertVector(blocks[i]->GetTVector3("POS","mm"));
AddDetector(Pos);
}
......@@ -316,6 +339,14 @@ void Vendeta::ConstructDetector(G4LogicalVolume* world){
BuildMecanicalStructure()->MakeImprint(world,PosMeca,RotMeca);
}
G4double platformWidth = 3.0 * m;
G4double platformLength = 3.0 * m;
G4double platformThickness = 1.2 * cm;
G4ThreeVector *platformPosition = new G4ThreeVector(0,0,-1000);
G4Box* platformSolid = new G4Box("PlatformSolid", platformWidth / 2.0, platformThickness / 2.0, platformLength / 2.0);
G4LogicalVolume* platformLogical = new G4LogicalVolume(platformSolid, m_Al, "PlatformLogical");
G4PVPlacement* platformPhysical = new G4PVPlacement(0, G4ThreeVector(0,-1000,0), platformLogical, "PlatformPhysical",world,0,false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Add Detector branch to the EventTree.
......@@ -342,22 +373,29 @@ void Vendeta::ReadSensitive(const G4Event* ){
unsigned int size = Scorer->GetMult();
for(unsigned int i = 0 ; i < size ; i++){
vector<unsigned int> level = Scorer->GetLevel(i);
double Energy = RandGauss::shoot(Scorer->GetEnergy(i),Vendeta_NS::ResoEnergy);
if(Energy>Vendeta_NS::EnergyThreshold){
/* double Energy =Scorer->GetEnergy(i); */
double EnergyLG = RandGauss::shoot(Scorer->GetEnergy(i),Vendeta_NS::ResoEnergyLG);
double EnergyHG = RandGauss::shoot(Scorer->GetEnergy(i),Vendeta_NS::ResoEnergyHG);
//Convert enrgy deposit to Light Output thanks the F. Pino et al. formula
double LightOutHG = 0.62*EnergyHG-1.3*(1-exp(-0.39*pow(EnergyHG,0.97))); // F. Pino et al
double LightOutLG = 0.62*EnergyLG-1.3*(1-exp(-0.39*pow(EnergyLG,0.97))); // F. Pino et al
// Apply Resolution on Charge measured on Vendeta data
/* LightOut = RandGauss::shoot(LightOut, Vendeta_NS::ResoEnergy); */
if( EnergyHG > Vendeta_NS::EnergyThreshold){
double Time = RandGauss::shoot(Scorer->GetTime(i),Vendeta_NS::ResoTime);
int DetectorNbr = level[0]-1;
// Filling HG
m_Event->SetHGDetectorNbr(DetectorNbr);
m_Event->SetHGQ1(Energy);
m_Event->SetHGQ2(Energy);
m_Event->SetHGQ1(LightOutHG*50000);
m_Event->SetHGQ2(LightOutHG*50000);
m_Event->SetHGTime(Time);
m_Event->SetHGQmax(0);
// Filling LG
m_Event->SetLGDetectorNbr(DetectorNbr);
m_Event->SetLGQ1(Energy);
m_Event->SetLGQ2(Energy);
m_Event->SetLGQ1(LightOutLG*20000);
m_Event->SetLGQ2(LightOutLG*20000);
m_Event->SetLGTime(Time);
m_Event->SetLGQmax(0);
......@@ -379,7 +417,7 @@ void Vendeta::ReadSensitive(const G4Event* ){
m_Event->SetHGIsSat(0);
m_Event->SetLGIsSat(0);
}
}
//for(unsigned int i=0; i<ProcessMult; i++){
// string particle_name = Process_scorer->GetParticleName(i);
......
......@@ -61,11 +61,13 @@ class Vendeta : public NPS::VDetector{
G4AssemblyVolume* BuildMecanicalStructure();
private:
G4AssemblyVolume* m_VendetaDetector;
G4LogicalVolume* m_SensitiveCell;
G4AssemblyVolume* m_MecanicalStructure;
G4LogicalVolume* m_MecanicalStructure_Al;
G4LogicalVolume* m_MecanicalStructure_Steel;
G4LogicalVolume* m_LeadShield;
////////////////////////////////////////////////////
////// Inherite from NPS::VDetector class /////////
......@@ -107,7 +109,8 @@ class Vendeta : public NPS::VDetector{
vector<double> m_R;
vector<double> m_Theta;
vector<double> m_Phi;
bool m_BuildLeadShield;
int m_Build_MecanicalStructure;
// Visualisation Attribute
......@@ -117,6 +120,7 @@ class Vendeta : public NPS::VDetector{
G4VisAttributes* m_VisMuMetal;
G4VisAttributes* m_VisPyrex;
G4VisAttributes* m_VisEJ560;
G4VisAttributes* m_VisLeadShield;
G4Material* m_Vacuum;
G4Material* m_Al;
......
File moved
void compare2(){
auto fz = new TFile("root/zaihong/run0582_RIG20210424_6He.root");
auto tz = (TTree*) fz->FindObjectAny("rig");
auto fl = new TFile("root/analysis/result582.root");
auto tl = (TTree*) fl->FindObjectAny("PhysicsTree");
tl->AddFriend(tz);
auto cfdc0= new TCanvas();
cfdc0->Divide(2,1);
cfdc0->cd(1);
tl->Draw("FDC0_X>>h1(1000,-100,100)","");
tl->Draw("SamuraiFDC0.PosX>>hh1(1000,-100,100)","","same");
cfdc0->cd(2);
tl->Draw("FDC0_Y>>h2(1000,-100,100)","");
tl->Draw("SamuraiFDC0.PosY>>hh2(1000,-100,100)","Minos.Tracks_P0@.size()>1","same");
auto h1=(TH1*)gDirectory->FindObjectAny("h1");
h1->SetLineColor(kOrange+7);
auto hh1=(TH1*)gDirectory->FindObjectAny("hh1");
hh1->SetLineColor(kAzure+7);
auto h2=(TH1*)gDirectory->FindObjectAny("h2");
h2->SetLineColor(kOrange+7);
auto hh2=(TH1*)gDirectory->FindObjectAny("hh2");
hh2->SetLineColor(kAzure+7);
auto cfdc2= new TCanvas();
cfdc2->Divide(2,1);
cfdc2->cd(1);
tl->Draw("FDC2_X>>h3(1000,-2000,2000)","");
tl->Draw("SamuraiFDC2.PosX+252>>hh3(1000,-2000,2000)","Minos.Tracks_P0@.size()>1","same");
cfdc2->cd(2);
tl->Draw("FDC2_Y>>h4(1000,-2000,2000)","");
tl->Draw("SamuraiFDC2.PosY>>hh4(1000,-2000,2000)","Minos.Tracks_P0@.size()>1","same");
auto h3=(TH1*)gDirectory->FindObjectAny("h3");
h3->SetLineColor(kOrange+7);
auto hh3=(TH1*)gDirectory->FindObjectAny("hh3");
hh3->SetLineColor(kAzure+7);
hh3->Scale(h3->Integral()/hh3->Integral());
auto h4=(TH1*)gDirectory->FindObjectAny("h4");
h4->SetLineColor(kOrange+7);
auto hh4=(TH1*)gDirectory->FindObjectAny("hh4");
hh4->SetLineColor(kAzure+7);
hh4->Scale(h4->Integral()/hh4->Integral());
}
This diff is collapsed.
......@@ -11,22 +11,36 @@ void testB2(){
//auto h=new TH1D("dB","dB",1000,-2e-1,2e-1);
// new TCanvas();
auto h=new TH1D("dB","dB",1000,-0.1,0.1);
auto hX=new TH2D("dBX","dBX",500,-100,100,500,-0.01,0.01);
auto hY=new TH2D("dBY","dBY",500,-100,100,500,-0.01,0.01);
double r = gRandom->Uniform(-1,1);
for(unsigned int i = 0 ; i < 100 ; i++){
TVector3 p(gRandom->Uniform(-5,5),gRandom->Uniform(-5,5),-3500);
TVector3 d(gRandom->Uniform(-0.05,0.05),gRandom->Uniform(-0.05,0.05),1);
double X = gRandom->Uniform(-100,100);
double Y = gRandom->Uniform(-100,100);
TVector3 p(X,Y,-3500);
//TVector3 d(gRandom->Uniform(-0.05,0.05),gRandom->Uniform(-0.05,0.05),1);
//
//TVector3 p(0,0,-3500);
//TVector3 d(0,0,1);
TVector3 d(0,0,1);
double b = gRandom->Uniform(3,7);
std::vector< TVector3 > track = field.Propagate(b,p,d,false);
// rotate from lab angle to FDC2 frame
track.back().RotateY(-fdc2angle+angle);
double br=field.FindBrho(p,d,track.back(),d);
double pc = 100*(br-b)/b;
cout <<" " << 100*(br-b)/b << " " << br << " " << b << endl;
//double pc = 100*(br-b)/b;
double pc = br-b;
// cout <<" " << 100*(br-b)/b << " " << br << " " << b << endl;
h->Fill(pc);
hX->Fill(X,pc);
hY->Fill(Y,pc);
}
h->Draw();
new TCanvas();
hX->Draw("colz");
new TCanvas();
hY->Draw("colz");
}
void windows(){
auto fileM= new TFile("root/analysis/test824.root");
auto treeM= (TTree*) fileM->FindObjectAny("PhysicsTree");
auto fileR= new TFile("root/mrdc/run824/run824_MINOS.root");
auto treeR= (TTree*) fileR->FindObjectAny("RawTree");
treeM->AddFriend(treeR);
auto c = new TCanvas();
c->Divide(2,1);
c->cd(1);
treeM->Draw("Y_Vertex:X_Vertex>>h1(100,-100,100,100,-100,100)","","colx");
c->cd(2);
treeM->Draw("Y_Vertex:X_Vertex>>h2(100,-100,100,100,-100,100)","(Trigger&0x00ff)<64","col");
}
This diff is collapsed.
......@@ -31,6 +31,7 @@
#include "TInteractionCoordinates.h"
#include "NPEnergyLoss.h"
#include "NPReaction.h"
#include "NPParticle.h"
#include "TRandom3.h"
#include "TSpline.h"
#include "TChain.h"
......@@ -48,6 +49,8 @@ class Analysis: public NPL::VAnalysis{
void InitInputBranch();
void ReInitValue();
void LoadCalibParameter();
void PistaAnalysis();
void VamosAnalysis();
void TwoAlphaAnalysis();
void ReadAnalysisConfig();
......@@ -59,6 +62,9 @@ class Analysis: public NPL::VAnalysis{
double m_ZTarget_offset;
double m_Beam_ThetaX;
double m_Beam_ThetaY;
double m_BeamEnergy;
double m_Brho_ref;
double m_Vamos_Angle;
private:
double BeamEnergy;
double Xcalc;
......@@ -72,6 +78,8 @@ class Analysis: public NPL::VAnalysis{
int strip_DE;
int strip_E;
double Time_E;
double Pista_Time_Target;
double Vamos_Time_Target;
double DeltaE;
double DeltaEcorr;
double Eres;
......@@ -84,6 +92,11 @@ class Analysis: public NPL::VAnalysis{
double Ex238U;
double PID;
ULong64_t fVAMOS_TS_sec;
ULong64_t fPISTA_TS_sec;
double VAMOS_TS_hour;
double PISTA_TS_hour;
int FPMW_Section;
double FF_Brho;
double FF_Path;
......@@ -134,7 +147,10 @@ class Analysis: public NPL::VAnalysis{
NPL::Reaction* Transfer8Be;
NPL::Reaction* Transfer14C;
NPL::Reaction* Elastic;
NPL::Particle* C12;
NPL::Particle* Be10;
TVector3 PositionOnTarget;
TRandom3 Rand;
double ThetaNormalTarget;
......@@ -142,8 +158,16 @@ class Analysis: public NPL::VAnalysis{
double TargetThickness;
NPL::EnergyLoss C12C;
NPL::EnergyLoss C12Al;
NPL::EnergyLoss Be10C;
NPL::EnergyLoss Be10Al;
NPL::EnergyLoss U238C;
TGraph *geloss_C12C;
TGraph *geloss_C12Al;
TGraph *geloss_Be10C;
TGraph *geloss_Be10Al;
float T13;
float T14;
......@@ -157,9 +181,16 @@ class Analysis: public NPL::VAnalysis{
double Exogam_Energy;
int Exogam_Crystal;
private:
double Xmean;
double Ymean;
double Xmean_iter;
double Ymean_iter;
int iteration;
double m_Q_p0[20];
double m_Q_p1[20];
private:
TPISTAPhysics* PISTA;
TFPMWPhysics* FPMW;
......
AnalysisConfig
VAMOS_ANGLE 20
BRHO_REF 1.1
XTARGET_OFFSET -0.34
YTARGET_OFFSET -0.17
ZTARGET_OFFSET 0.62
CalibrationFilePath
./Calibration/Energy/PISTA1_E.cal
./Calibration/Energy/PISTA2_E.cal
./Calibration/Energy/PISTA3_E.cal
./Calibration/Energy/PISTA4_E.cal
./Calibration/Energy/PISTA5_E.cal
./Calibration/Energy/PISTA6_E.cal
./Calibration/Energy/PISTA7_E.cal
./Calibration/Energy/PISTA8_E.cal
./Calibration/Energy/PISTA1_DE.ped
./Calibration/Energy/PISTA2_DE.ped
./Calibration/Energy/PISTA3_DE.ped
./Calibration/Energy/PISTA4_DE.ped
./Calibration/Energy/PISTA5_DE.ped
./Calibration/Energy/PISTA6_DE.ped
./Calibration/Energy/PISTA7_DE.ped
./Calibration/Energy/PISTA8_DE.ped
./Calibration/Energy/PISTA1_DE.cal
./Calibration/Energy/PISTA2_DE.cal
./Calibration/Energy/PISTA3_DE.cal
./Calibration/Energy/PISTA4_DE.cal
./Calibration/Energy/PISTA5_DE.cal
./Calibration/Energy/PISTA6_DE.cal
./Calibration/Energy/PISTA7_DE.cal
./Calibration/Energy/PISTA8_DE.cal
./Calibration/Energy/PISTA_BACK_DE.cal
./Calibration/Energy/PISTA_BACK_E_min.cal
%./Calibration/pista/e850_2023/part1/PISTA1_E.cal
%./Calibration/pista/e850_2023/part1/PISTA2_E.cal
%./Calibration/pista/e850_2023/part1/PISTA3_E.cal
%./Calibration/pista/e850_2023/part1/PISTA4_E.cal
%./Calibration/pista/e850_2023/part1/PISTA5_E.cal
%./Calibration/pista/e850_2023/part1/PISTA6_E.cal
%./Calibration/pista/e850_2023/part1/PISTA7_E.cal
%./Calibration/pista/e850_2023/part1/PISTA8_E.cal
./Calibration/pista/e850_2023/part1/PISTA1_DE.cal
./Calibration/pista/e850_2023/part1/PISTA2_DE.cal
./Calibration/pista/e850_2023/part1/PISTA3_DE.cal
./Calibration/pista/e850_2023/part1/PISTA4_DE.cal
./Calibration/pista/e850_2023/part1/PISTA5_DE.cal
./Calibration/pista/e850_2023/part1/PISTA6_DE.cal
./Calibration/pista/e850_2023/part1/PISTA7_DE.cal
./Calibration/pista/e850_2023/part1/PISTA8_DE.cal
./Calibration/pista/e850_2023/part1/PISTA_BACK_DE.cal
./Calibration/pista/e850_2023/part1/PISTA_BACK_E_min.cal
%./Calibration/pista/e850_2023/part1/pol2/PISTA1_backE.cal
%./Calibration/pista/e850_2023/part1/pol2/PISTA2_backE.cal
%./Calibration/pista/e850_2023/part1/pol2/PISTA3_backE.cal
%./Calibration/pista/e850_2023/part1/pol2/PISTA4_backE.cal
%./Calibration/pista/e850_2023/part1/pol2/PISTA5_backE.cal
%./Calibration/pista/e850_2023/part1/pol2/PISTA6_backE.cal
%./Calibration/pista/e850_2023/part1/pol2/PISTA7_backE.cal
%./Calibration/pista/e850_2023/part1/pol2/PISTA8_backE.cal
./Calibration/VAMOS/CHIO/Chio_E_sec5.cal
./Calibration/VAMOS/CHIO/Chio_E_sec6.cal
./Calibration/VAMOS/CHIO/Chio_E_sec7.cal
......@@ -40,3 +40,12 @@ CalibrationFilePath
./Calibration/VAMOS/CHIO/Chio_E_sec17.cal
./Calibration/VAMOS/CHIO/Chio_E_sec18.cal
./Calibration/VAMOS/CHIO/Chio_E_sec19.cal
./Calibration/VAMOS/FPMW/npformat/FPMW1_X.cal
./Calibration/VAMOS/FPMW/npformat/FPMW1_Y.cal
./Calibration/VAMOS/FPMW/npformat/FPMW2_X.cal
./Calibration/VAMOS/FPMW/npformat/FPMW2_Y.cal
./Calibration/VAMOS/FPMW/npformat/FPMW3_X.cal
./Calibration/VAMOS/FPMW/npformat/FPMW3_Y.cal
./Calibration/VAMOS/FPMW/npformat/FPMW4_X.cal
./Calibration/VAMOS/FPMW/npformat/FPMW4_Y.cal
void GAnaToNPTool(){
string rootfilename = "/home/morfouacep/Physics/ganil/pista/analysisenv-e850-2023/Calibs/";
ifstream ifile;
string list_filename[8];
list_filename[0] = "TMW1_X.cal";
list_filename[1] = "TMW1_Y.cal";
list_filename[2] = "TMW2_X.cal";
list_filename[3] = "TMW2_Y.cal";
list_filename[4] = "FPMW0_X.cal";
list_filename[5] = "FPMW0_Y.cal";
list_filename[6] = "FPMW1_X.cal";
list_filename[7] = "FPMW1_Y.cal";
for(int i=4; i<8; i++){
string input_filename = rootfilename + list_filename[i];
ifile.open(input_filename.c_str());
string XorY;
if(i==0 || i==2 || i==4 || i==6) XorY = "X";
else if(i==1 || i==3 || i==5 || i==7) XorY = "Y";
int det;
if(i==0 || i==1) det=1;
else if(i==2 || i==3) det=2;
else if(i==4 || i==5) det=3;
else if(i==6 || i==7) det=4;
ofstream ofile;
string output_filename = "npformat/FPMW" + to_string(det) + "_" + XorY + ".cal";
ofile.open(output_filename.c_str());
string buffer;
getline(ifile,buffer);
getline(ifile,buffer);
getline(ifile,buffer);
getline(ifile,buffer);
double p0, p1, p2, scale;
int strip=0;
while(ifile>>p0>>p1>>p2>>scale>>buffer>>buffer){
strip++;
string token = "FPMW_DET" + to_string(det) + "_STRIP"+ XorY + to_string(strip);
ofile << token << " " << p0 << " " << p1 << " " << p2 << " " << scale << endl;
}
ifile.close();
ofile.close();
}
}
Table from Geant4 generate using NPSimulation Particle: Be10 Material: NPS_Al
0 0
0.001 0.115169
0.002 0.12746
0.003 0.134674
0.004 0.139965
0.005 0.144307
0.006 0.148076
0.007 0.151472
0.008 0.154833
0.009 0.157861
0.01 0.16061
0.011 0.163371
0.012 0.166129
0.013 0.168706
0.014 0.171153
0.015 0.173873
0.016 0.176465
0.017 0.178938
0.018 0.181305
0.019 0.183573
0.02 0.18575
0.021 0.18788
0.022 0.190255
0.023 0.192557
0.024 0.194791
0.025 0.196962
0.026 0.199072
0.027 0.201125
0.028 0.203154
0.029 0.205321
0.03 0.207439
0.031 0.209512
0.033 0.213528
0.035 0.21741
0.037 0.221401
0.039 0.225259
0.041 0.228998
0.043 0.232779
0.045 0.236558
0.047 0.240236
0.049 0.243821
0.051 0.247318
0.053 0.250732
0.055 0.254068
0.057 0.257467
0.059 0.260877
0.061 0.264219
0.063 0.267499
0.065 0.270718
0.067 0.27388
0.069 0.276987
0.071 0.280171
0.073 0.28337
0.075 0.28652
0.077 0.289624
0.079 0.292684
0.081 0.2957
0.083 0.298676
0.085 0.301611
0.089 0.307368
0.093 0.312982
0.097 0.318461
0.101 0.323814
0.105 0.329097
0.109 0.334609
0.113 0.340015
0.117 0.34532
0.121 0.350531
0.125 0.355651
0.129 0.360684
0.133 0.365636
0.137 0.370509
0.141 0.375307
0.145 0.380033
0.149 0.384691
0.153 0.389282
0.157 0.393808
0.161 0.398273
0.165 0.40268
0.169 0.407029
0.173 0.411323
0.177 0.415565
0.181 0.419755
0.185 0.423897
0.193 0.432037
0.201 0.439997
0.209 0.447789
0.217 0.455746
0.225 0.463551
0.233 0.471214
0.241 0.478742
0.249 0.486103
0.257 0.492313
0.265 0.498522
0.273 0.504731
0.281 0.510969
0.289 0.517275
0.297 0.523582
0.305 0.529888
0.313 0.536194
0.321 0.54161
0.329 0.547015
0.345 0.557825
0.361 0.56872
0.377 0.579638
0.393 0.590557
0.409 0.599356
0.425 0.608034
0.441 0.616762
0.457 0.625489
0.473 0.634217
0.489 0.642945
0.505 0.650458
0.521 0.656995
0.537 0.663533
0.569 0.676655
0.601 0.689859
0.633 0.702099
0.665 0.711663
0.697 0.721228
0.729 0.730892
0.761 0.740555
0.793 0.749465
0.825 0.755599
0.889 0.767866
0.953 0.780133
1.017 0.789742
1.081 0.795858
1.209 0.808199
1.337 0.819141
1.465 0.829596
1.593 0.839007
1.721 0.843798
1.977 0.853302
2.233 0.855819
2.745 0.8554
3.769 0.836865
4.793 0.807133
5.817 0.773908
6.841 0.740965
7.865 0.708548
8.889 0.679475
9.913 0.650528
10.937 0.627686
11.961 0.604861
12.985 0.582878
14.009 0.561676
15.033 0.540491
16.057 0.52111
17.081 0.504799
18.105 0.488488
19.129 0.472177
20.153 0.467331
21.177 0.453053
22.201 0.439598
23.225 0.426909
24.249 0.414921
25.273 0.403691
26.297 0.393355
27.321 0.383562
28.345 0.374175
29.369 0.365286
30.393 0.356762
31.417 0.348636
32.441 0.340898
33.465 0.333538
34.489 0.326458
35.513 0.31969
36.537 0.313217
37.561 0.307019
38.585 0.301081
39.609 0.295351
40.633 0.289772
41.657 0.284434
42.681 0.279311
43.705 0.27439
44.729 0.26966
45.753 0.265108
46.777 0.260726
47.801 0.256503
48.825 0.252437
49.849 0.248523
50.873 0.244743
51.897 0.241092
52.921 0.237562
53.945 0.234148
54.969 0.230843
55.993 0.227644
57.017 0.224547
58.041 0.221547
59.065 0.218629
60.089 0.215755
61.113 0.212966
62.137 0.210258
63.161 0.207627
64.185 0.20507
65.209 0.202583
66.233 0.200164
67.257 0.197809
68.281 0.195516
69.305 0.193283
70.329 0.191106
71.353 0.188989
72.377 0.186936
73.401 0.184932
74.425 0.182976
75.449 0.181066
76.473 0.179201
77.497 0.177378
78.521 0.175597
79.545 0.173855
81.593 0.170487
83.641 0.167266
85.689 0.164179
87.737 0.161219
89.785 0.158377
91.833 0.155647
93.881 0.153022
95.929 0.150495
97.977 0.148061
100.025 0.145638
102.073 0.143252
104.121 0.140949
106.169 0.138726
108.217 0.136578
110.265 0.134501
112.313 0.132492
114.361 0.130547
116.409 0.128663
118.457 0.126837
120.505 0.125067
122.553 0.123349
124.601 0.121676
126.649 0.12005
128.697 0.118471
130.745 0.116936
132.793 0.115444
134.841 0.113992
136.889 0.112579
138.937 0.111203
140.985 0.109975
143.033 0.108791
145.081 0.107634
147.129 0.106504
149.177 0.105399
151.225 0.104319
153.273 0.103263
155.321 0.102231
157.369 0.101221
161.465 0.0992136
165.561 0.0973411
169.657 0.0955451
173.753 0.0938209
177.849 0.0921643
181.945 0.0905712
186.041 0.0890383
190.137 0.0875621
194.233 0.0861394
198.329 0.0847674
202.425 0.0834435
206.521 0.082165
210.617 0.0809245
214.713 0.0797247
218.809 0.0785641
222.905 0.0774407
227.001 0.0763528
231.097 0.0752987
235.193 0.0742769
239.289 0.0732854
243.385 0.072323
247.481 0.0713887
251.577 0.0704812
255.673 0.0695994
259.769 0.0687422
263.865 0.0679086
267.961 0.0670976
272.057 0.0663083
276.153 0.0655398
280.249 0.0647913
284.345 0.064062
288.441 0.0633511
292.537 0.062658
296.633 0.0619805
300.729 0.0613189
304.825 0.0606732
308.921 0.0600429
313.017 0.0594272
317.113 0.0588259
321.209 0.0582383
329.401 0.0571024
337.593 0.056016
345.785 0.054976
353.977 0.0539794
362.169 0.0530233
370.361 0.0521054
378.553 0.0512234
386.745 0.0503751
394.937 0.0495586
403.129 0.0487722
411.321 0.0480141
419.513 0.0472829
427.705 0.0465771
435.897 0.0458942
444.089 0.0452341
452.281 0.0445958
460.473 0.043978
468.665 0.0433799
476.857 0.0428005
485.049 0.0422388
493.241 0.0416942
501.433 0.0411658
509.625 0.0406529
517.817 0.0401547
526.009 0.0396708
534.201 0.0392004
542.393 0.038743
550.585 0.038298
558.777 0.037865
566.969 0.0374434
575.161 0.0370328
583.353 0.0366328
591.545 0.0362429
599.737 0.0358628
607.929 0.0354921
616.121 0.0351305
624.313 0.0347775
632.505 0.034433
648.889 0.0337679
665.273 0.0331331
681.657 0.0325263
698.041 0.0319458
714.425 0.03139
730.809 0.0308573
747.193 0.0303461
763.577 0.0298552
779.961 0.0293835
796.345 0.0289297
812.729 0.0284929
829.113 0.028072
845.497 0.0276664
861.881 0.027275
878.265 0.0268971
894.649 0.0265321
911.033 0.0261793
927.417 0.025838
943.801 0.0255077
960.185 0.0251879
976.569 0.024878
992.953 0.0245777
1009.34 0.0242864
1025.72 0.0240037
1042.11 0.0237294
1058.49 0.0234629
1074.87 0.023204
1091.26 0.0229523
1107.64 0.0227076
1124.03 0.0224696
1140.41 0.022238
1156.79 0.0220125
1173.18 0.0217929
1205.95 0.0213706
1238.71 0.0209693
1271.48 0.0205875
1304.25 0.0202238
1337.02 0.019877
1369.79 0.0195459
1402.55 0.0192294
1435.32 0.0189265
1468.09 0.0186365
1500.86 0.0183585
1533.63 0.0180917
1566.39 0.0178355
1599.16 0.0175892
1631.93 0.0173523
1664.7 0.0171243
1697.47 0.0169046
1730.23 0.0166928
1763 0.0164885
1795.77 0.0162913
1828.54 0.0161009
1861.31 0.0159169
1894.07 0.0157389
1926.84 0.0155668
1959.61 0.0154002
1992.38 0.0152388
2025.15 0.0150825
2057.91 0.014931
2090.68 0.014784
2156.22 0.0145031
2221.75 0.0142382
2287.29 0.013988
2352.83 0.0137513
2418.36 0.0135272
2483.9 0.0133146
2549.43 0.0131127
2614.97 0.0129207
2680.51 0.0127379
2746.04 0.0125638
2811.58 0.0123976
2877.11 0.0122389
2942.65 0.0120872
3008.19 0.0119421
3073.72 0.0118031
3139.26 0.0116699
3204.79 0.0115422
3270.33 0.0114195
3335.87 0.0113017
3401.4 0.0111885
3466.94 0.0110796
3598.01 0.0108738
3729.08 0.0106826
3860.15 0.0105046
3991.23 0.0103385
4122.3 0.0101832
4253.37 0.0100378
4384.44 0.00990129
4515.51 0.009773
4646.59 0.00965223
4777.66 0.00953839
4908.73 0.00943092
5039.8 0.00932935
5170.87 0.00923323
5301.95 0.00914217
5564.09 0.00897382
5826.23 0.00882179
6088.38 0.00868401
6350.52 0.0085587
6612.67 0.00844439
6874.81 0.00833981
7136.95 0.0082439
7399.1 0.00815624
7661.24 0.00807725
8185.53 0.00793685
8709.82 0.00781636
9234.11 0.00771237
9758.39 0.00762218
10282.7 0.00754362
10807 0.00747495
11855.5 0.00736183
12904.1 0.00727412
13952.7 0.00720574
16049.8 0.00711061
18147 0.00705344
22341.3 0.00700515
30729.9 0.00702694
47507.1 0.00718867
64284.3 0.00735755
81061.6 0.00750546
97838.8 0.00763294
114616 0.00774375
131393 0.00784102
148170 0.00792727
164948 0.00800453
198502 0.00813794
232057 0.00825008
265611 0.00834635
299165 0.00843036
332720 0.00850469
399829 0.00863145
466938 0.00873685
534046 0.00882679
601155 0.00890497
735373 0.00903526
869591 0.0091404
1 1.40334
2 2.42778
3 3.42469
4 4.41244
5 5.39708
6 6.38095
7 7.36498
8 8.34981
9 9.3357
10 10.3223
11 11.3115
12 12.3004
13 13.2898
14 14.2795
15 15.2692
16 16.2599
17 17.2521
18 18.2441
19 19.2362
20 20.2338
21 21.227
22 22.2204
23 23.2142
24 24.2083
25 25.2028
26 26.1977
27 27.1928
28 28.1882
29 29.1838
30 30.1796
31 31.1756
32 32.1718
33 33.1681
34 34.1646
35 35.1613
36 36.158
37 37.155
38 38.152
39 39.1492
40 40.1464
41 41.1437
42 42.1412
43 43.1387
44 44.1363
45 45.1341
46 46.1319
47 47.1298
48 48.1277
49 49.1258
50 50.1239
51 51.122
52 52.1203
53 53.1185
54 54.1169
55 55.1153
56 56.1137
57 57.1122
58 58.1108
59 59.1093
60 60.1079
61 61.1066
62 62.1052
63 63.104
64 64.1027
65 65.1015
66 66.1003
67 67.0991
68 68.098
69 69.0969
70 70.0958
71 71.0948
72 72.0938
73 73.0928
74 74.0918
75 75.0909
76 76.09
77 77.0891
78 78.0882
79 79.0874
80 80.0865
81 81.0857
82 82.0849
83 83.0841
84 84.0833
85 85.0826
86 86.0818
87 87.0811
88 88.0804
89 89.0797
90 90.079
91 91.0783
92 92.0777
93 93.077
94 94.0764
95 95.0758
96 96.0752
97 97.0746
98 98.074
99 99.0734
100 100.073
101 101.072
102 102.072
103 103.071
104 104.071
105 105.07
106 106.069
107 107.069
108 108.068
109 109.068
110 110.067
111 111.067
112 112.066
113 113.066
114 114.065
115 115.065
116 116.065
117 117.064
118 118.064
119 119.063
120 120.063
121 121.062
122 122.062
123 123.061
124 124.061
125 125.061
126 126.06
127 127.06
128 128.059
129 129.059
130 130.059
131 131.058
132 132.058
133 133.058
134 134.057
135 135.057
136 136.057
137 137.056
138 138.056
139 139.056
140 140.055
141 141.055
142 142.055
143 143.054
144 144.054
145 145.054
146 146.054
147 147.053
148 148.053
149 149.053
150 150.052
151 151.052
152 152.052
153 153.052
154 154.051
155 155.051
156 156.051
157 157.051
158 158.05
159 159.05
160 160.05
161 161.05
162 162.049
163 163.049
164 164.049
165 165.049
166 166.049
167 167.048
168 168.048
169 169.048
170 170.048
171 171.047
172 172.047
173 173.047
174 174.047
175 175.047
176 176.046
177 177.046
178 178.046
179 179.046
180 180.046
181 181.045
182 182.045
183 183.045
184 184.045
185 185.045
186 186.045
187 187.044
188 188.044
189 189.044
190 190.044
191 191.044
192 192.043
193 193.043
194 194.043
195 195.043
196 196.043
197 197.043
198 198.042
199 199.042
200 200.042
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