diff --git a/NPLib/Detectors/ChiNu/CMakeLists.txt b/NPLib/Detectors/ChiNu/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..0f6ba26c30cd0f776af2ff4ff52e58411ee94456 --- /dev/null +++ b/NPLib/Detectors/ChiNu/CMakeLists.txt @@ -0,0 +1,6 @@ +add_custom_command(OUTPUT TChiNuPhysicsDict.cxx COMMAND ../../scripts/build_dict.sh TChiNuPhysics.h TChiNuPhysicsDict.cxx TChiNuPhysics.rootmap libNPChiNu.dylib DEPENDS TChiNuPhysics.h) +add_custom_command(OUTPUT TChiNuDataDict.cxx COMMAND ../../scripts/build_dict.sh TChiNuData.h TChiNuDataDict.cxx TChiNuData.rootmap libNPChiNu.dylib DEPENDS TChiNuData.h) +add_library(NPChiNu SHARED TChiNuSpectra.cxx TChiNuData.cxx TChiNuPhysics.cxx TChiNuDataDict.cxx TChiNuPhysicsDict.cxx ) +target_link_libraries(NPChiNu ${ROOT_LIBRARIES} NPCore) +install(FILES TChiNuData.h TChiNuPhysics.h TChiNuSpectra.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY}) + diff --git a/NPLib/Detectors/ChiNu/TChiNuData.cxx b/NPLib/Detectors/ChiNu/TChiNuData.cxx new file mode 100644 index 0000000000000000000000000000000000000000..93290619cafb5eb0dbd74ee5f8716ea514a8b213 --- /dev/null +++ b/NPLib/Detectors/ChiNu/TChiNuData.cxx @@ -0,0 +1,79 @@ +/***************************************************************************** + * Copyright (C) 2009-2019 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr * + * * + * Creation Date : February 2019 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class hold ChiNu Raw data * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ +#include "TChiNuData.h" + +#include <iostream> +#include <fstream> +#include <sstream> +#include <string> +using namespace std; + +ClassImp(TChiNuData) + + +////////////////////////////////////////////////////////////////////// +TChiNuData::TChiNuData() { +} + + + +////////////////////////////////////////////////////////////////////// +TChiNuData::~TChiNuData() { +} + + + +////////////////////////////////////////////////////////////////////// +void TChiNuData::Clear() { + // Energy + fChiNu_E_DetectorNbr.clear(); + fChiNu_Energy.clear(); + // Time + fChiNu_T_DetectorNbr.clear(); + fChiNu_Time.clear(); +} + + + +////////////////////////////////////////////////////////////////////// +void TChiNuData::Dump() const { + // This method is very useful for debuging and worth the dev. + cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TChiNuData::Dump()] XXXXXXXXXXXXXXXXX" << endl; + + // Energy + size_t mysize = fChiNu_E_DetectorNbr.size(); + cout << "ChiNu_E_Mult: " << mysize << endl; + + for (size_t i = 0 ; i < mysize ; i++){ + cout << "DetNbr: " << fChiNu_E_DetectorNbr[i] + << " Energy: " << fChiNu_Energy[i]; + } + + // Time + mysize = fChiNu_T_DetectorNbr.size(); + cout << "ChiNu_T_Mult: " << mysize << endl; + + for (size_t i = 0 ; i < mysize ; i++){ + cout << "DetNbr: " << fChiNu_T_DetectorNbr[i] + << " Time: " << fChiNu_Time[i]; + } +} diff --git a/NPLib/Detectors/ChiNu/TChiNuData.h b/NPLib/Detectors/ChiNu/TChiNuData.h new file mode 100644 index 0000000000000000000000000000000000000000..c4b01d371fe718e5dff20a9bb40a1f2c2f4fc030 --- /dev/null +++ b/NPLib/Detectors/ChiNu/TChiNuData.h @@ -0,0 +1,104 @@ +#ifndef __ChiNuDATA__ +#define __ChiNuDATA__ +/***************************************************************************** + * Copyright (C) 2009-2019 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr * + * * + * Creation Date : February 2019 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class hold ChiNu Raw data * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ + +// STL +#include <vector> +using namespace std; + +// ROOT +#include "TObject.h" + +class TChiNuData : public TObject { + ////////////////////////////////////////////////////////////// + // data members are hold into vectors in order + // to allow multiplicity treatment + private: + // Energy + vector<UShort_t> fChiNu_E_DetectorNbr; + vector<Double_t> fChiNu_Energy; + + // Time + vector<UShort_t> fChiNu_T_DetectorNbr; + vector<Double_t> fChiNu_Time; + + + ////////////////////////////////////////////////////////////// + // Constructor and destructor + public: + TChiNuData(); + ~TChiNuData(); + + + ////////////////////////////////////////////////////////////// + // Inherited from TObject and overriden to avoid warnings + public: + void Clear(); + void Clear(const Option_t*) {}; + void Dump() const; + + + ////////////////////////////////////////////////////////////// + // Getters and Setters + // Prefer inline declaration to avoid unnecessary called of + // frequently used methods + // add //! to avoid ROOT creating dictionnary for the methods + public: + ////////////////////// SETTERS //////////////////////// + // Energy + inline void SetEnergy(const UShort_t& DetNbr,const Double_t& Energy){ + fChiNu_E_DetectorNbr.push_back(DetNbr); + fChiNu_Energy.push_back(Energy); + };//! + + // Time + inline void SetTime(const UShort_t& DetNbr,const Double_t& Time) { + fChiNu_T_DetectorNbr.push_back(DetNbr); + fChiNu_Time.push_back(Time); + };//! + + + ////////////////////// GETTERS //////////////////////// + // Energy + inline UShort_t GetMultEnergy() const + {return fChiNu_E_DetectorNbr.size();} + inline UShort_t GetE_DetectorNbr(const unsigned int &i) const + {return fChiNu_E_DetectorNbr[i];}//! + inline Double_t Get_Energy(const unsigned int &i) const + {return fChiNu_Energy[i];}//! + + // Time + inline UShort_t GetMultTime() const + {return fChiNu_T_DetectorNbr.size();} + inline UShort_t GetT_DetectorNbr(const unsigned int &i) const + {return fChiNu_T_DetectorNbr[i];}//! + inline Double_t Get_Time(const unsigned int &i) const + {return fChiNu_Time[i];}//! + + + ////////////////////////////////////////////////////////////// + // Required for ROOT dictionnary + ClassDef(TChiNuData,1) // ChiNuData structure +}; + +#endif diff --git a/NPLib/Detectors/ChiNu/TChiNuPhysics.cxx b/NPLib/Detectors/ChiNu/TChiNuPhysics.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bb1d4c3e8023a0a19155eb0bc9cac0bca5d0493b --- /dev/null +++ b/NPLib/Detectors/ChiNu/TChiNuPhysics.cxx @@ -0,0 +1,343 @@ +/***************************************************************************** + * Copyright (C) 2009-2019 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr * + * * + * Creation Date : February 2019 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class hold ChiNu Treated data * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ + +#include "TChiNuPhysics.h" + +// STL +#include <sstream> +#include <iostream> +#include <cmath> +#include <stdlib.h> +#include <limits> +using namespace std; + +// NPL +#include "RootInput.h" +#include "RootOutput.h" +#include "NPDetectorFactory.h" +#include "NPOptionManager.h" + +// ROOT +#include "TChain.h" + +ClassImp(TChiNuPhysics) + + +/////////////////////////////////////////////////////////////////////////// +TChiNuPhysics::TChiNuPhysics() + : m_EventData(new TChiNuData), + m_PreTreatedData(new TChiNuData), + m_EventPhysics(this), + m_Spectra(0), + m_E_RAW_Threshold(0), // adc channels + m_E_Threshold(0), // MeV + m_NumberOfDetectors(0) { +} + +/////////////////////////////////////////////////////////////////////////// +/// A usefull method to bundle all operation to add a detector +void TChiNuPhysics::AddDetector(TVector3){ + // In That simple case nothing is done + // Typically for more complex detector one would calculate the relevant + // positions (stripped silicon) or angles (gamma array) + m_NumberOfDetectors++; +} + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::AddDetector(double R, double Theta, double Phi){ + // Compute the TVector3 corresponding + TVector3 Pos(R*sin(Theta)*cos(Phi),R*sin(Theta)*sin(Phi),R*cos(Theta)); + // Call the cartesian method + AddDetector(Pos); + m_DetectorPosition.push_back(Pos); +} + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::BuildSimplePhysicalEvent() { + BuildPhysicalEvent(); +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::BuildPhysicalEvent() { + // apply thresholds and calibration + PreTreat(); + + // match energy and time together + unsigned int mysizeE = m_PreTreatedData->GetMultEnergy(); + unsigned int mysizeT = m_PreTreatedData->GetMultTime(); + for (UShort_t e = 0; e < mysizeE ; e++) { + for (UShort_t t = 0; t < mysizeT ; t++) { + if (m_PreTreatedData->GetE_DetectorNbr(e) == m_PreTreatedData->GetT_DetectorNbr(t)) { + DetectorNumber.push_back(m_PreTreatedData->GetE_DetectorNbr(e)); + Energy.push_back(m_PreTreatedData->Get_Energy(e)); + Time.push_back(m_PreTreatedData->Get_Time(t)); + } + } + } +} + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::PreTreat() { + // This method typically applies thresholds and calibrations + // Might test for disabled channels for more complex detector + + // clear pre-treated object + ClearPreTreatedData(); + + // instantiate CalibrationManager + static CalibrationManager* Cal = CalibrationManager::getInstance(); + + // Energy + unsigned int mysize = m_EventData->GetMultEnergy(); + for (UShort_t i = 0; i < mysize ; ++i) { + if (m_EventData->Get_Energy(i) > m_E_RAW_Threshold) { + Double_t Energy = Cal->ApplyCalibration("ChiNu/ENERGY"+NPL::itoa(m_EventData->GetE_DetectorNbr(i)),m_EventData->Get_Energy(i)); + if (Energy > m_E_Threshold) { + m_PreTreatedData->SetEnergy(m_EventData->GetE_DetectorNbr(i), Energy); + } + } + } + + // Time + mysize = m_EventData->GetMultTime(); + for (UShort_t i = 0; i < mysize; ++i) { + Double_t Time= Cal->ApplyCalibration("ChiNu/TIME"+NPL::itoa(m_EventData->GetT_DetectorNbr(i)),m_EventData->Get_Time(i)); + m_PreTreatedData->SetTime(m_EventData->GetT_DetectorNbr(i), Time); + } +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::ReadAnalysisConfig() { + bool ReadingStatus = false; + + // path to file + string FileName = "./configs/ConfigChiNu.dat"; + + // open analysis config file + ifstream AnalysisConfigFile; + AnalysisConfigFile.open(FileName.c_str()); + + if (!AnalysisConfigFile.is_open()) { + cout << " No ConfigChiNu.dat found: Default parameter loaded for Analayis " << FileName << endl; + return; + } + cout << " Loading user parameter for Analysis from ConfigChiNu.dat " << endl; + + // Save it in a TAsciiFile + TAsciiFile* asciiConfig = RootOutput::getInstance()->GetAsciiFileAnalysisConfig(); + asciiConfig->AppendLine("%%% ConfigChiNu.dat %%%"); + asciiConfig->Append(FileName.c_str()); + asciiConfig->AppendLine(""); + // read analysis config file + string LineBuffer,DataBuffer,whatToDo; + while (!AnalysisConfigFile.eof()) { + // Pick-up next line + getline(AnalysisConfigFile, LineBuffer); + + // search for "header" + string name = "ConfigChiNu"; + if (LineBuffer.compare(0, name.length(), name) == 0) + ReadingStatus = true; + + // loop on tokens and data + while (ReadingStatus ) { + whatToDo=""; + AnalysisConfigFile >> whatToDo; + + // Search for comment symbol (%) + if (whatToDo.compare(0, 1, "%") == 0) { + AnalysisConfigFile.ignore(numeric_limits<streamsize>::max(), '\n' ); + } + + else if (whatToDo=="E_RAW_THRESHOLD") { + AnalysisConfigFile >> DataBuffer; + m_E_RAW_Threshold = atof(DataBuffer.c_str()); + cout << whatToDo << " " << m_E_RAW_Threshold << endl; + } + + else if (whatToDo=="E_THRESHOLD") { + AnalysisConfigFile >> DataBuffer; + m_E_Threshold = atof(DataBuffer.c_str()); + cout << whatToDo << " " << m_E_Threshold << endl; + } + + else { + ReadingStatus = false; + } + } + } +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::Clear() { + DetectorNumber.clear(); + Energy.clear(); + Time.clear(); +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::ReadConfiguration(NPL::InputParser parser) { + vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("ChiNu"); + if(NPOptionManager::getInstance()->GetVerboseLevel()) + cout << "//// " << blocks.size() << " detectors found " << endl; + + vector<string> cart = {"POS"}; + vector<string> sphe = {"R","Theta","Phi"}; + + for(unsigned int i = 0 ; i < blocks.size() ; i++){ + if(blocks[i]->HasTokenList(cart)){ + if(NPOptionManager::getInstance()->GetVerboseLevel()) + cout << endl << "//// ChiNu " << i+1 << endl; + + TVector3 Pos = blocks[i]->GetTVector3("POS","mm"); + AddDetector(Pos); + } + else if(blocks[i]->HasTokenList(sphe)){ + if(NPOptionManager::getInstance()->GetVerboseLevel()) + cout << endl << "//// ChiNu " << i+1 << endl; + double R = blocks[i]->GetDouble("R","mm"); + double Theta = blocks[i]->GetDouble("Theta","deg"); + double Phi = blocks[i]->GetDouble("Phi","deg"); + AddDetector(R,Theta,Phi); + } + else{ + cout << "ERROR: check your input file formatting " << endl; + exit(1); + } + } +} + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::InitSpectra() { + m_Spectra = new TChiNuSpectra(m_NumberOfDetectors); +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::FillSpectra() { + m_Spectra -> FillRawSpectra(m_EventData); + m_Spectra -> FillPreTreatedSpectra(m_PreTreatedData); + m_Spectra -> FillPhysicsSpectra(m_EventPhysics); +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::CheckSpectra() { + m_Spectra->CheckSpectra(); +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::ClearSpectra() { + // To be done +} + + + +/////////////////////////////////////////////////////////////////////////// +map< string , TH1*> TChiNuPhysics::GetSpectra() { + if(m_Spectra) + return m_Spectra->GetMapHisto(); + else{ + map< string , TH1*> empty; + return empty; + } +} + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::WriteSpectra() { + m_Spectra->WriteSpectra(); +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::AddParameterToCalibrationManager() { + CalibrationManager* Cal = CalibrationManager::getInstance(); + for (int i = 0; i < m_NumberOfDetectors; ++i) { + Cal->AddParameter("ChiNu", "D"+ NPL::itoa(i+1)+"_ENERGY","ChiNu_D"+ NPL::itoa(i+1)+"_ENERGY"); + Cal->AddParameter("ChiNu", "D"+ NPL::itoa(i+1)+"_TIME","ChiNu_D"+ NPL::itoa(i+1)+"_TIME"); + } +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::InitializeRootInputRaw() { + TChain* inputChain = RootInput::getInstance()->GetChain(); + inputChain->SetBranchStatus("ChiNu", true ); + inputChain->SetBranchAddress("ChiNu", &m_EventData ); +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::InitializeRootInputPhysics() { + TChain* inputChain = RootInput::getInstance()->GetChain(); + inputChain->SetBranchAddress("ChiNu", &m_EventPhysics); +} + + + +/////////////////////////////////////////////////////////////////////////// +void TChiNuPhysics::InitializeRootOutput() { + TTree* outputTree = RootOutput::getInstance()->GetTree(); + outputTree->Branch("ChiNu", "TChiNuPhysics", &m_EventPhysics); +} + + + +//////////////////////////////////////////////////////////////////////////////// +// Construct Method to be pass to the DetectorFactory // +//////////////////////////////////////////////////////////////////////////////// +NPL::VDetector* TChiNuPhysics::Construct() { + return (NPL::VDetector*) new TChiNuPhysics(); +} + + + +//////////////////////////////////////////////////////////////////////////////// +// Registering the construct method to the factory // +//////////////////////////////////////////////////////////////////////////////// +extern "C"{ +class proxy_ChiNu{ + public: + proxy_ChiNu(){ + NPL::DetectorFactory::getInstance()->AddToken("ChiNu","ChiNu"); + NPL::DetectorFactory::getInstance()->AddDetector("ChiNu",TChiNuPhysics::Construct); + } +}; + +proxy_ChiNu p_ChiNu; +} + diff --git a/NPLib/Detectors/ChiNu/TChiNuPhysics.h b/NPLib/Detectors/ChiNu/TChiNuPhysics.h new file mode 100644 index 0000000000000000000000000000000000000000..6afd1af4956f7936823b704fdf265f066c3cefa4 --- /dev/null +++ b/NPLib/Detectors/ChiNu/TChiNuPhysics.h @@ -0,0 +1,182 @@ +#ifndef TChiNuPHYSICS_H +#define TChiNuPHYSICS_H +/***************************************************************************** + * Copyright (C) 2009-2019 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr * + * * + * Creation Date : February 2019 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class hold ChiNu Treated data * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ + +// C++ headers +#include <vector> +#include <map> +#include <string> +using namespace std; + +// ROOT headers +#include "TObject.h" +#include "TH1.h" +#include "TVector3.h" +// NPTool headers +#include "TChiNuData.h" +#include "TChiNuSpectra.h" +#include "NPCalibrationManager.h" +#include "NPVDetector.h" +#include "NPInputParser.h" +// forward declaration +class TChiNuSpectra; + + + +class TChiNuPhysics : public TObject, public NPL::VDetector { + ////////////////////////////////////////////////////////////// + // constructor and destructor + public: + TChiNuPhysics(); + ~TChiNuPhysics() {}; + + + ////////////////////////////////////////////////////////////// + // Inherited from TObject and overriden to avoid warnings + public: + void Clear(); + void Clear(const Option_t*) {}; + + + ////////////////////////////////////////////////////////////// + // data obtained after BuildPhysicalEvent() and stored in + // output ROOT file + public: + vector<int> DetectorNumber; + vector<double> Energy; + vector<double> Time; + + /// A usefull method to bundle all operation to add a detector + void AddDetector(TVector3 POS); + void AddDetector(double R, double Theta, double Phi); + + double GetDetectorPosition(int DetNumber) {return m_DetectorPosition[DetNumber-1].Mag();} + TVector3 GetVectorDetectorPosition(int DetNumber) {return m_DetectorPosition[DetNumber-1];} + ////////////////////////////////////////////////////////////// + // methods inherited from the VDetector ABC class + public: + // read stream from ConfigFile to pick-up detector parameters + void ReadConfiguration(NPL::InputParser); + + // add parameters to the CalibrationManger + void AddParameterToCalibrationManager(); + + // method called event by event, aiming at extracting the + // physical information from detector + void BuildPhysicalEvent(); + + // same as BuildPhysicalEvent() method but with a simpler + // treatment + void BuildSimplePhysicalEvent(); + + // same as above but for online analysis + void BuildOnlinePhysicalEvent() {BuildPhysicalEvent();}; + + // activate raw data object and branches from input TChain + // in this method mother branches (Detector) AND daughter leaves + // (fDetector_parameter) have to be activated + void InitializeRootInputRaw(); + + // activate physics data object and branches from input TChain + // in this method mother branches (Detector) AND daughter leaves + // (fDetector_parameter) have to be activated + void InitializeRootInputPhysics(); + + // create branches of output ROOT file + void InitializeRootOutput(); + + // clear the raw and physical data objects event by event + void ClearEventPhysics() {Clear();} + void ClearEventData() {m_EventData->Clear();} + + // methods related to the TChiNuSpectra class + // instantiate the TChiNuSpectra class and + // declare list of histograms + void InitSpectra(); + + // fill the spectra + void FillSpectra(); + + // used for Online mainly, sanity check for histograms and + // change their color if issues are found, for example + void CheckSpectra(); + + // used for Online only, clear all the spectra + void ClearSpectra(); + + // write spectra to ROOT output file + void WriteSpectra(); + + + ////////////////////////////////////////////////////////////// + // specific methods to ChiNu array + public: + // remove bad channels, calibrate the data and apply thresholds + void PreTreat(); + + // clear the pre-treated object + void ClearPreTreatedData() {m_PreTreatedData->Clear();} + + // read the user configuration file. If no file is found, load standard one + void ReadAnalysisConfig(); + + // give and external TChiNuData object to TChiNuPhysics. + // needed for online analysis for example + void SetRawDataPointer(TChiNuData* rawDataPointer) {m_EventData = rawDataPointer;} + + // objects are not written in the TTree + private: + TChiNuData* m_EventData; //! + TChiNuData* m_PreTreatedData; //! + TChiNuPhysics* m_EventPhysics; //! + + // getters for raw and pre-treated data object + public: + TChiNuData* GetRawData() const {return m_EventData;} + TChiNuData* GetPreTreatedData() const {return m_PreTreatedData;} + + // parameters used in the analysis + private: + // thresholds + double m_E_RAW_Threshold; //! + double m_E_Threshold; //! + + // number of detectors + private: + int m_NumberOfDetectors; //! + vector<TVector3> m_DetectorPosition; //! + // spectra class + private: + TChiNuSpectra* m_Spectra; // ! + + // spectra getter + public: + map<string, TH1*> GetSpectra(); + + // Static constructor to be passed to the Detector Factory + public: + static NPL::VDetector* Construct(); + + ClassDef(TChiNuPhysics,1) // ChiNuPhysics structure +}; +#endif diff --git a/NPLib/Detectors/ChiNu/TChiNuSpectra.cxx b/NPLib/Detectors/ChiNu/TChiNuSpectra.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d4a25eb35dbd1c77f5b914e1343aa77402e165f4 --- /dev/null +++ b/NPLib/Detectors/ChiNu/TChiNuSpectra.cxx @@ -0,0 +1,174 @@ +/***************************************************************************** + * Copyright (C) 2009-2020 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr * + * * + * Creation Date : April 2020 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class hold ChiNu Spectra * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ + +// class header +#include "TChiNuSpectra.h" + +// STL +#include <iostream> +#include <string> +using namespace std; + +// NPTool header +#include "NPOptionManager.h" + + + +//////////////////////////////////////////////////////////////////////////////// +TChiNuSpectra::TChiNuSpectra() + : fNumberOfDetectors(0) { + SetName("ChiNu"); +} + + + +//////////////////////////////////////////////////////////////////////////////// +TChiNuSpectra::TChiNuSpectra(unsigned int NumberOfDetectors) { + if(NPOptionManager::getInstance()->GetVerboseLevel()>0) + cout << "************************************************" << endl + << "TChiNuSpectra : Initalizing control spectra for " + << NumberOfDetectors << " Detectors" << endl + << "************************************************" << endl ; + SetName("ChiNu"); + fNumberOfDetectors = NumberOfDetectors; + + InitRawSpectra(); + InitPreTreatedSpectra(); + InitPhysicsSpectra(); +} + + + +//////////////////////////////////////////////////////////////////////////////// +TChiNuSpectra::~TChiNuSpectra() { +} + + + +//////////////////////////////////////////////////////////////////////////////// +void TChiNuSpectra::InitRawSpectra() { + static string name; + for (unsigned int i = 0; i < fNumberOfDetectors; i++) { // loop on number of detectors + // Energy + name = "ChiNu"+NPL::itoa(i+1)+"_ENERGY_RAW"; + AddHisto1D(name, name, 4096, 0, 16384, "ChiNu/RAW"); + // Time + name = "ChiNu"+NPL::itoa(i+1)+"_TIME_RAW"; + AddHisto1D(name, name, 4096, 0, 16384, "ChiNu/RAW"); + } // end loop on number of detectors +} + + + +//////////////////////////////////////////////////////////////////////////////// +void TChiNuSpectra::InitPreTreatedSpectra() { + static string name; + for (unsigned int i = 0; i < fNumberOfDetectors; i++) { // loop on number of detectors + // Energy + name = "ChiNu"+NPL::itoa(i+1)+"_ENERGY_CAL"; + AddHisto1D(name, name, 500, 0, 25, "ChiNu/CAL"); + // Time + name = "ChiNu"+NPL::itoa(i+1)+"_TIME_CAL"; + AddHisto1D(name, name, 500, 0, 25, "ChiNu/CAL"); + + + } // end loop on number of detectors +} + + + +//////////////////////////////////////////////////////////////////////////////// +void TChiNuSpectra::InitPhysicsSpectra() { + static string name; + // Kinematic Plot + name = "ChiNu_ENERGY_TIME"; + AddHisto2D(name, name, 500, 0, 500, 500, 0, 50, "ChiNu/PHY"); +} + + + +//////////////////////////////////////////////////////////////////////////////// +void TChiNuSpectra::FillRawSpectra(TChiNuData* RawData) { + static string name; + static string family; + + // Energy + unsigned int sizeE = RawData->GetMultEnergy(); + for (unsigned int i = 0; i < sizeE; i++) { + name = "ChiNu"+NPL::itoa(RawData->GetE_DetectorNbr(i))+"_ENERGY_RAW"; + family = "ChiNu/RAW"; + + FillSpectra(family,name,RawData->Get_Energy(i)); + } + + // Time + unsigned int sizeT = RawData->GetMultTime(); + for (unsigned int i = 0; i < sizeT; i++) { + name = "ChiNu"+NPL::itoa(RawData->GetT_DetectorNbr(i))+"_TIME_RAW"; + family = "ChiNu/RAW"; + + FillSpectra(family,name,RawData->Get_Time(i)); + } +} + + + +//////////////////////////////////////////////////////////////////////////////// +void TChiNuSpectra::FillPreTreatedSpectra(TChiNuData* PreTreatedData) { + static string name; + static string family; + + // Energy + unsigned int sizeE = PreTreatedData->GetMultEnergy(); + for (unsigned int i = 0; i < sizeE; i++) { + name = "ChiNu"+NPL::itoa(PreTreatedData->GetE_DetectorNbr(i))+"_ENERGY_CAL"; + family = "ChiNu/CAL"; + + FillSpectra(family,name,PreTreatedData->Get_Energy(i)); + } + + // Time + unsigned int sizeT = PreTreatedData->GetMultTime(); + for (unsigned int i = 0; i < sizeT; i++) { + name = "ChiNu"+NPL::itoa(PreTreatedData->GetT_DetectorNbr(i))+"_TIME_CAL"; + family = "ChiNu/CAL"; + + FillSpectra(family,name,PreTreatedData->Get_Time(i)); + } +} + + + +//////////////////////////////////////////////////////////////////////////////// +void TChiNuSpectra::FillPhysicsSpectra(TChiNuPhysics* Physics) { + static string name; + static string family; + family= "ChiNu/PHY"; + + // Energy vs time + unsigned int sizeE = Physics->Energy.size(); + for(unsigned int i = 0 ; i < sizeE ; i++){ + name = "ChiNu_ENERGY_TIME"; + FillSpectra(family,name,Physics->Energy[i],Physics->Time[i]); + } +} + diff --git a/NPLib/Detectors/ChiNu/TChiNuSpectra.h b/NPLib/Detectors/ChiNu/TChiNuSpectra.h new file mode 100644 index 0000000000000000000000000000000000000000..3b74c1496344cefcf95864b651e8be86878e0caf --- /dev/null +++ b/NPLib/Detectors/ChiNu/TChiNuSpectra.h @@ -0,0 +1,62 @@ +#ifndef TChiNuSPECTRA_H +#define TChiNuSPECTRA_H +/***************************************************************************** + * Copyright (C) 2009-2020 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr * + * * + * Creation Date : April 2020 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class hold ChiNu Spectra * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ + +// NPLib headers +#include "NPVSpectra.h" +#include "TChiNuData.h" +#include "TChiNuPhysics.h" + +// Forward Declaration +class TChiNuPhysics; + + +class TChiNuSpectra : public VSpectra { + ////////////////////////////////////////////////////////////// + // constructor and destructor + public: + TChiNuSpectra(); + TChiNuSpectra(unsigned int NumberOfDetectors); + ~TChiNuSpectra(); + + ////////////////////////////////////////////////////////////// + // Initialization methods + private: + void InitRawSpectra(); + void InitPreTreatedSpectra(); + void InitPhysicsSpectra(); + + ////////////////////////////////////////////////////////////// + // Filling methods + public: + void FillRawSpectra(TChiNuData*); + void FillPreTreatedSpectra(TChiNuData*); + void FillPhysicsSpectra(TChiNuPhysics*); + + ////////////////////////////////////////////////////////////// + // Detector parameters + private: + unsigned int fNumberOfDetectors; +}; + +#endif diff --git a/NPSimulation/Detectors/ChiNu/CMakeLists.txt b/NPSimulation/Detectors/ChiNu/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..34f8184209c62387d4a4617a70963203bf3d37d8 --- /dev/null +++ b/NPSimulation/Detectors/ChiNu/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(NPSChiNu SHARED ChiNu.cc) +target_link_libraries(NPSChiNu NPSCore ${ROOT_LIBRARIES} ${Geant4_LIBRARIES} ${NPLib_LIBRARIES} -lNPChiNu) diff --git a/NPSimulation/Detectors/ChiNu/ChiNu.cc b/NPSimulation/Detectors/ChiNu/ChiNu.cc new file mode 100644 index 0000000000000000000000000000000000000000..0dca0a96482d8576f6b57929ea2f9c09cc1f8f3a --- /dev/null +++ b/NPSimulation/Detectors/ChiNu/ChiNu.cc @@ -0,0 +1,532 @@ +/***************************************************************************** + * Copyright (C) 2009-2019 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr * + * * + * Creation Date : February 2019 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class describe ChiNu simulation * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + *****************************************************************************/ + +// C++ headers +#include <sstream> +#include <cmath> +#include <limits> +//G4 Geometry object +#include "G4Tubs.hh" +#include "G4Box.hh" +#include "G4Cons.hh" +#include "G4Sphere.hh" +#include "G4Polycone.hh" + +//G4 sensitive +#include "G4SDManager.hh" +#include "G4MultiFunctionalDetector.hh" + +//G4 various object +#include "G4Material.hh" +#include "G4Transform3D.hh" +#include "G4PVPlacement.hh" +#include "G4VisAttributes.hh" +#include "G4Colour.hh" +#include "G4SubtractionSolid.hh" + +// NPTool header +#include "ChiNu.hh" +#include "CalorimeterScorers.hh" +#include "InteractionScorers.hh" +#include "RootOutput.h" +#include "MaterialManager.hh" +#include "NPSDetectorFactory.hh" +#include "NPOptionManager.h" +#include "NPSHitsMap.hh" +// CLHEP header +#include "CLHEP/Random/RandGauss.h" + +using namespace std; +using namespace CLHEP; + + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +namespace ChiNu_NS{ + // EJ309 Scintillator - Energy and time Resolution + const double EnergyThreshold = 0.*MeV; + const double ResoTime = 1*ns ; + const double ResoEnergy = 0.1*MeV ; + const double Radius = 8.90*cm ; + const double Thickness = 5.08*cm ; + const string Material = "EJ309"; + + // PMT + const double PMT_Height = 392*mm; + const string PMT_Material = "Al"; + + // Light guide + const double LG_Rmin1 = 0*mm; + const double LG_Rmax1 = Radius; + const double LG_Rmin2 = 0*mm; + const double LG_Rmax2 = 50*mm; + const double LG_Thickness = 30*mm; + const string LG_Material = "PMMA"; + + // Pyrex Window + const double Pyrex_radius = Radius; + const double Pyrex_thickness = 6.4*mm; + const string Pyrex_material = "Pyrex"; + + // Lead shield + const double Lead_Radius = 9*cm; + const double Lead_Thickness = 2*mm; + + // Fission Chamber + const string FCWall_Material = "CH2"; + const double Cu_Thickness = 17*micrometer; + const double Al_Thickness = 12*micrometer; + const double Kapton_Thickness = 50*micrometer; +} +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +// ChiNu Specific Method +ChiNu::ChiNu(){ + m_Event = new TChiNuData() ; + m_ChiNuScorer = 0; + m_PMT = 0; + m_LightGuide = 0; + m_CylindricalDetector = 0; + m_LeadShield = 0; + m_AssemblyVolume = 0; + + m_BuildLeadShield = 0; + + m_FissionChamberWall = 0; + m_FissionChamberVolume = 0; + + // RGB Color + Transparency + m_VisCylinder = new G4VisAttributes(G4Colour(0.0, 0.5, 1, 1)); + m_VisPMT = new G4VisAttributes(G4Colour(0.3, 0.1, 0.1, 0.3)); + m_VisLightGuide = new G4VisAttributes(G4Colour(0.1,0.5,0.7,1)); + m_VisPyrex = new G4VisAttributes(G4Colour(0.1,0.5,0.7,0.7)); + m_VisLeadShield = new G4VisAttributes(G4Colour(0.2,0.2,0.2,1)); + m_VisFCWall = new G4VisAttributes(G4Colour(0.1,0.5,0.7,1)); + m_VisAl = new G4VisAttributes(G4Colour(0.839,0.803,0.803,1)); + m_VisTi = new G4VisAttributes(G4Colour(0.776,0.662,0.662,0.5)); + m_VisCu = new G4VisAttributes(G4Colour(0.70, 0.40, 0. ,1)); + m_VisRogers4003C = new G4VisAttributes(G4Colour(0.60, 0.60, 0.2 ,1)); +} + +ChiNu::~ChiNu(){ +} +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +void ChiNu::AddDetector(G4ThreeVector POS){ + // Convert the POS value to R theta Phi as Spherical coordinate is easier in G4 + m_R.push_back(POS.mag()); + m_Theta.push_back(POS.theta()); + m_Phi.push_back(POS.phi()); +} + + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +void ChiNu::AddDetector(double R, double Theta, double Phi){ + m_R.push_back(R); + m_Theta.push_back(Theta); + m_Phi.push_back(Phi); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +G4AssemblyVolume* ChiNu::BuildFissionChamber(){ + if(!m_FissionChamberVolume){ + m_FissionChamberVolume = new G4AssemblyVolume(); + + G4RotationMatrix *Rv=new G4RotationMatrix(0,0,0); + G4ThreeVector Tv; + Tv.setX(0); Tv.setY(0); Tv.setZ(0); + + // Bottom PCB plate // + double PCB_width = 18.*cm; + double PCB_length = 33.*cm; + double PCB_Rogers_height = 1.6*mm; + double PCB_Cu_height = 6*35.*um; + double PCB_PosY = -8.5*cm; + // Cu layers + G4Box* PCB_Cu_solid = new G4Box("PCB_Cu_solid",0.5*PCB_width,0.5*PCB_Cu_height,0.5*PCB_length); + G4Material* Cu_material = MaterialManager::getInstance()->GetMaterialFromLibrary("Cu"); + G4LogicalVolume* PCB_Cu_vol = new G4LogicalVolume(PCB_Cu_solid, Cu_material,"PCB_Cu_logic",0,0,0); + PCB_Cu_vol->SetVisAttributes(m_VisCu); + Tv.setY(PCB_PosY); + m_FissionChamberVolume->AddPlacedVolume(PCB_Cu_vol, Tv, Rv); + + // Rogers 4003C layers + G4Box* PCB_Rogers_solid = new G4Box("PCB_Rogers_solid",0.5*PCB_width,0.5*PCB_Rogers_height,0.5*PCB_length); + G4Material* Rogers_material = MaterialManager::getInstance()->GetMaterialFromLibrary("Rogers4003C"); + G4LogicalVolume* PCB_Rogers_vol = new G4LogicalVolume(PCB_Rogers_solid, Rogers_material,"PCB_Rogers_logic",0,0,0); + PCB_Rogers_vol->SetVisAttributes(m_VisRogers4003C); + Tv.setY(PCB_PosY + 0.5*PCB_Cu_height + 0.5*PCB_Rogers_height); + m_FissionChamberVolume->AddPlacedVolume(PCB_Rogers_vol, Tv, Rv); + + //Al frame // + double frame1_width = 18.*cm; + double frame1_height = 5.*mm; + double frame1_length = 33.*cm; + double frame2_width = 15.2*cm; + double frame2_height = 5.1*mm; + double frame2_length = 30.2*cm; + + G4Box* frame1 = new G4Box("frame1", 0.5*frame1_width, 0.5*frame1_height, 0.5*frame1_length); + G4Box* frame2 = new G4Box("frame2", 0.5*frame2_width, 0.5*frame2_height, 0.5*frame2_length); + G4VSolid* Al_frame = (G4VSolid*) new G4SubtractionSolid("Al_frame",frame1,frame2,0,G4ThreeVector(0,0,0)); + G4Material* Al_material = MaterialManager::getInstance()->GetMaterialFromLibrary("Al"); + G4LogicalVolume* Al_frame_vol = new G4LogicalVolume(Al_frame,Al_material,"Al_frame_logic",0,0,0); + Al_frame_vol->SetVisAttributes(m_VisAl); + Tv.setY(PCB_PosY+ 0.5*PCB_Cu_height + PCB_Rogers_height + 0.5*frame1_height); + m_FissionChamberVolume->AddPlacedVolume(Al_frame_vol, Tv, Rv); + Tv.setY(PCB_PosY- 0.5*PCB_Cu_height - 0.5*frame1_height); + m_FissionChamberVolume->AddPlacedVolume(Al_frame_vol, Tv, Rv); + + double box1_width = 15.*cm; + double box1_height = 16.*cm; + double box1_length = 30.*cm; + double box2_width = 14.8*cm; + double box2_height = 15.8*cm; + double box2_length = 29.8*cm; + double box3_width = 12.5*cm; + double box3_height = 11.7*cm; + double box3_length = 30.1*cm; + double box4_width = 15.1*cm; + double box4_height = 11.8*cm; + double box4_length = 27.4*cm; + double box5_width = 12.4*cm; + double box5_height = 16.1*cm; + double box5_length = 27.4*cm; + + G4Box* box1 = new G4Box("box1", 0.5*box1_width, 0.5*box1_height, 0.5*box1_length); + G4Box* box2 = new G4Box("box2", 0.5*box2_width, 0.5*box2_height, 0.5*box2_length); + G4Box* box3 = new G4Box("box3", 0.5*box3_width, 0.5*box3_height, 0.5*box3_length); + G4Box* box4 = new G4Box("box4", 0.5*box4_width, 0.5*box4_height, 0.5*box4_length); + G4Box* box5 = new G4Box("box5", 0.5*box5_width, 0.5*box5_height, 0.5*box5_length); + + G4VSolid* box_int1 = (G4VSolid*) new G4SubtractionSolid("box_int1",box1,box2,0,G4ThreeVector(0,0,0)); + G4VSolid* box_int2 = (G4VSolid*) new G4SubtractionSolid("box_int2",box_int1,box3,0,G4ThreeVector(0,0,0)); + G4VSolid* box_int3 = (G4VSolid*) new G4SubtractionSolid("box_int3",box_int2,box4,0,G4ThreeVector(0,0,0)); + G4VSolid* box_int4 = (G4VSolid*) new G4SubtractionSolid("box_int4",box_int3,box5,0,G4ThreeVector(0,0,0)); + + G4LogicalVolume* full_box_vol = new G4LogicalVolume(box_int4, Al_material, "full_box_logic", 0,0,0); + full_box_vol->SetVisAttributes(m_VisAl); + Tv.setY(0); + m_FissionChamberVolume->AddPlacedVolume(full_box_vol, Tv, Rv); + + // Ti foils // + double foil1_width = 13*cm; + double foil1_length = 29*cm; + double foil1_thickness = 100*um; + double foil2_width = 13*cm; + double foil2_height = 14*cm; + double foil2_thickness = 50*um; + + G4Material* Ti_material = MaterialManager::getInstance()->GetMaterialFromLibrary("Ti"); + G4Box* foil1_solid = new G4Box("foil1", 0.5*foil1_width, 0.5*foil1_thickness, 0.5*foil1_length); + G4LogicalVolume* foil1_vol = new G4LogicalVolume(foil1_solid, Ti_material, "foil1_logic", 0, 0, 0); + foil1_vol->SetVisAttributes(m_VisTi); + Tv.setY(0.5*box2_height); + m_FissionChamberVolume->AddPlacedVolume(foil1_vol, Tv, Rv); + Tv.setY(0); + Tv.setX(-0.5*box2_width); + Rv->rotateZ(90*deg); + m_FissionChamberVolume->AddPlacedVolume(foil1_vol, Tv, Rv); + Tv.setX(0.5*box2_width); + m_FissionChamberVolume->AddPlacedVolume(foil1_vol, Tv, Rv); + + G4Box* foil2_solid = new G4Box("foil2", 0.5*foil2_width, 0.5*foil2_height, 0.5*foil2_thickness); + G4LogicalVolume* foil2_vol = new G4LogicalVolume(foil2_solid, Ti_material, "foil2_logic", 0, 0, 0); + foil2_vol->SetVisAttributes(m_VisTi); + Tv.setX(0);Tv.setY(0);Tv.setZ(-0.5*box2_length); + m_FissionChamberVolume->AddPlacedVolume(foil2_vol, Tv, Rv); + Tv.setZ(0.5*box2_length); + m_FissionChamberVolume->AddPlacedVolume(foil2_vol, Tv, Rv); + + // Cathode and Anode // + BuildCathode(-27.5); + double origine_anode = -25*mm; + double origine_cathode = -22.5*mm; + for(int i=0; i<11; i++){ + BuildAnode(origine_anode+i*5*mm); + } + for(int i=0; i<10; i++){ + BuildCathode(origine_cathode+i*5*mm); + } + BuildCathode(27.5); + + + } + return m_FissionChamberVolume; +} +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +void ChiNu::BuildCathode(double Zpos){ + // Al plate: 12 um + G4Tubs* Al_plate_solid = new G4Tubs("Al_plate",0,40*mm,12*micrometer,0,360*deg); + G4Material* Al_material = MaterialManager::getInstance()->GetMaterialFromLibrary("Al"); + G4LogicalVolume* Al_vol = new G4LogicalVolume(Al_plate_solid, Al_material,"logic_Al",0,0,0); + Al_vol->SetVisAttributes(m_VisAl); + + G4RotationMatrix *Rv=new G4RotationMatrix(0,0,0); + G4ThreeVector Tv; + Tv.setX(0); Tv.setY(0); Tv.setZ(0); + + Tv.setZ(Zpos); + m_FissionChamberVolume->AddPlacedVolume(Al_vol, Tv, Rv); + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +void ChiNu::BuildAnode(double Zpos){ + // Cu plate: 17 um + G4Tubs* Cu_plate_solid = new G4Tubs("Cu_plate",0,40*mm,0.5*ChiNu_NS::Cu_Thickness,0,360*deg); + G4Material* Cu_material = MaterialManager::getInstance()->GetMaterialFromLibrary("Cu"); + G4LogicalVolume* Cu_vol = new G4LogicalVolume(Cu_plate_solid, Cu_material,"logic_Cu",0,0,0); + Cu_vol->SetVisAttributes(m_VisCu); + + // Kapton: 50 um + G4Tubs* Kapton_solid = new G4Tubs("Kapton",0,40*mm,0.5*ChiNu_NS::Kapton_Thickness,0,360*deg); + G4Material* Kapton_material = MaterialManager::getInstance()->GetMaterialFromLibrary("Kapton"); + G4LogicalVolume* Kapton_vol = new G4LogicalVolume(Kapton_solid, Kapton_material,"logic_Kapton",0,0,0); + Kapton_vol->SetVisAttributes(m_VisFCWall); + + G4RotationMatrix *Rv=new G4RotationMatrix(0,0,0); + G4ThreeVector Tv; + Tv.setX(0); Tv.setY(0); Tv.setZ(0); + + Tv.setZ(Zpos); + m_FissionChamberVolume->AddPlacedVolume(Kapton_vol, Tv, Rv); + Tv.setZ(Zpos-0.5*ChiNu_NS::Kapton_Thickness-0.5*ChiNu_NS::Cu_Thickness); + m_FissionChamberVolume->AddPlacedVolume(Cu_vol, Tv, Rv); + Tv.setZ(Zpos+0.5*ChiNu_NS::Kapton_Thickness+0.5*ChiNu_NS::Cu_Thickness); + m_FissionChamberVolume->AddPlacedVolume(Cu_vol, Tv, Rv); + + +} +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +G4AssemblyVolume* ChiNu::BuildDetector(){ + if(!m_CylindricalDetector){ + m_AssemblyVolume = new G4AssemblyVolume(); + G4RotationMatrix *Rv=new G4RotationMatrix(0,0,0); + G4ThreeVector Tv; + Tv.setX(0); Tv.setY(0); Tv.setZ(0); + + // Scintillator + G4Tubs* tub = new G4Tubs("ChiNu_Cyl",0,ChiNu_NS::Radius,ChiNu_NS::Thickness*0.5,0,360*deg); + G4Material* DetectorMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary(ChiNu_NS::Material); + m_CylindricalDetector = new G4LogicalVolume(tub,DetectorMaterial,"logic_ChiNu_tub",0,0,0); + m_CylindricalDetector->SetVisAttributes(m_VisCylinder); + m_CylindricalDetector->SetSensitiveDetector(m_ChiNuScorer); + m_AssemblyVolume->AddPlacedVolume(m_CylindricalDetector, Tv, Rv); + + // Pyrex Window + G4Tubs* Pyrex_tub = new G4Tubs("Pyrex_tub",0,ChiNu_NS::Pyrex_radius, ChiNu_NS::Pyrex_thickness*0.5, 0 , 360*deg); + G4Material* PyrexMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary(ChiNu_NS::Pyrex_material); + G4LogicalVolume* LogPyrex = new G4LogicalVolume(Pyrex_tub, PyrexMaterial,"logic_pyrex",0,0,0); + LogPyrex->SetVisAttributes(m_VisPyrex); + Tv.setZ(ChiNu_NS::Thickness*0.5 + ChiNu_NS::Pyrex_thickness*0.5); + m_AssemblyVolume->AddPlacedVolume(LogPyrex, Tv, Rv); + + + // Light guide + G4Cons* LGsolid = new G4Cons("light_guide", ChiNu_NS::LG_Rmin1, ChiNu_NS::LG_Rmax1, ChiNu_NS::LG_Rmin2, ChiNu_NS::LG_Rmax2, ChiNu_NS::LG_Thickness*0.5,0,360*deg); + G4Material* LGMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary(ChiNu_NS::LG_Material); + m_LightGuide = new G4LogicalVolume(LGsolid,LGMaterial,"logic_light_guide",0,0,0); + m_LightGuide->SetVisAttributes(m_VisLightGuide); + Tv.setZ(ChiNu_NS::Thickness*0.5 + ChiNu_NS::Pyrex_thickness + ChiNu_NS::LG_Thickness*0.5); + m_AssemblyVolume->AddPlacedVolume(m_LightGuide, Tv, Rv); + + // PMT + //G4Tubs* pmt = new G4Tubs("ChiNu_pmt",ChiNu_NS::PMT_InnerDiameter*0.5,ChiNu_NS::PMT_OuterDiameter*0.5,ChiNu_NS::PMT_Thickness*0.5,0,360*deg); + + double zplane[4] ={0, 18*cm, 24*cm, ChiNu_NS::PMT_Height}; + double rin[4] = {ChiNu_NS::Radius+0.2*mm, ChiNu_NS::Radius+0.2*mm, 40*mm, 40*mm}; + double rout[4] = {ChiNu_NS::Radius+2.2*mm, ChiNu_NS::Radius+2.2*mm, 42*mm, 42*mm}; + G4Polycone* pmt = new G4Polycone("ChiNu_PMT", 0, 360*deg, 4, zplane, rin, rout); + G4Material* pmtMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary(ChiNu_NS::PMT_Material); + m_PMT = new G4LogicalVolume(pmt,pmtMaterial,"logic_pmt_tub",0,0,0); + m_PMT->SetVisAttributes(m_VisPMT); + //Tv.setZ(ChiNu_NS::Thickness*0.5 + ChiNu_NS::LG_Thickness + ChiNu_NS::Pyrex_thickness + ChiNu_NS::PMT_Height*0.5); + Tv.setZ(-ChiNu_NS::Thickness*0.5); + m_AssemblyVolume->AddPlacedVolume(m_PMT, Tv, Rv); + + // Lead shield + if(m_BuildLeadShield){ + G4Tubs* lead = new G4Tubs("lead_shield", 0, ChiNu_NS::Lead_Radius, ChiNu_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); + Tv.setZ(-ChiNu_NS::Thickness*0.5 - ChiNu_NS::Lead_Thickness*0.5-10*mm); + m_AssemblyVolume->AddPlacedVolume(m_LeadShield, Tv, Rv); + } + + } + return m_AssemblyVolume; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +// Virtual Method of NPS::VDetector class + +// Read stream at Configfile to pick-up parameters of detector (Position,...) +// Called in DetecorConstruction::ReadDetextorConfiguration Method +void ChiNu::ReadConfiguration(NPL::InputParser parser){ + vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("ChiNu"); + if(NPOptionManager::getInstance()->GetVerboseLevel()) + cout << "//// " << blocks.size() << " detectors found " << endl; + + vector<string> cart = {"POS"}; + vector<string> sphe = {"R","Theta","Phi"}; + + for(unsigned int i = 0 ; i < blocks.size() ; i++){ + if(blocks[i]->HasTokenList(cart)){ + if(NPOptionManager::getInstance()->GetVerboseLevel()) + cout << endl << "//// ChiNu " << i+1 << endl; + + G4ThreeVector Pos = NPS::ConvertVector(blocks[i]->GetTVector3("POS","mm")); + AddDetector(Pos); + } + else if(blocks[i]->HasTokenList(sphe)){ + if(NPOptionManager::getInstance()->GetVerboseLevel()) + cout << endl << "//// ChiNu " << i+1 << endl; + double R = blocks[i]->GetDouble("R","mm"); + double Theta = blocks[i]->GetDouble("Theta","deg"); + double Phi = blocks[i]->GetDouble("Phi","deg"); + m_BuildLeadShield = blocks[i]->GetInt("LeadShield"); + AddDetector(R,Theta,Phi); + } + else{ + cout << "ERROR: check your input file formatting " << endl; + exit(1); + } + } +} + + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +// Construct detector and inialise sensitive part. +// Called After DetecorConstruction::AddDetector Method +void ChiNu::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] ) ; + 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()*ChiNu_NS::Thickness*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]); + 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(); + + G4RotationMatrix* Rot = new G4RotationMatrix(u,v,w); + BuildDetector()->MakeImprint(world,Det_pos,Rot,i); + } + + /*G4RotationMatrix* Rot_FC = new G4RotationMatrix(0,0,0); + G4ThreeVector Pos_FC = G4ThreeVector(0,0,0) ; + BuildFissionChamber()->MakeImprint(world,Pos_FC,Rot_FC,0); +*/ + +} +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +// Add Detector branch to the EventTree. +// Called After DetecorConstruction::AddDetector Method +void ChiNu::InitializeRootOutput(){ + RootOutput *pAnalysis = RootOutput::getInstance(); + TTree *pTree = pAnalysis->GetTree(); + if(!pTree->FindBranch("ChiNu")){ + pTree->Branch("ChiNu", "TChiNuData", &m_Event) ; + } + pTree->SetBranchAddress("ChiNu", &m_Event) ; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +// Read sensitive part and fill the Root tree. +// Called at in the EventAction::EndOfEventAvtion +void ChiNu::ReadSensitive(const G4Event* ){ + m_Event->Clear(); + + /////////// + // Calorimeter scorer + CalorimeterScorers::PS_Calorimeter* Scorer= (CalorimeterScorers::PS_Calorimeter*) m_ChiNuScorer->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),ChiNu_NS::ResoEnergy); + if(Energy>ChiNu_NS::EnergyThreshold){ + double Time = RandGauss::shoot(Scorer->GetTime(i),ChiNu_NS::ResoTime); + int DetectorNbr = level[0]; + m_Event->SetEnergy(DetectorNbr,Energy); + m_Event->SetTime(DetectorNbr,Time); + } + } +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//////////////////////////////////////////////////////////////// +void ChiNu::InitializeScorers() { + // This check is necessary in case the geometry is reloaded + bool already_exist = false; + m_ChiNuScorer = CheckScorer("ChiNuScorer",already_exist) ; + + if(already_exist) + return ; + + // 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) ; + //and register it to the multifunctionnal detector + m_ChiNuScorer->RegisterPrimitive(Calorimeter); + m_ChiNuScorer->RegisterPrimitive(Interaction); + G4SDManager::GetSDMpointer()->AddNewDetector(m_ChiNuScorer) ; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//////////////////////////////////////////////////////////////////////////////// +// Construct Method to be pass to the DetectorFactory // +//////////////////////////////////////////////////////////////////////////////// +NPS::VDetector* ChiNu::Construct(){ + return (NPS::VDetector*) new ChiNu(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//////////////////////////////////////////////////////////////////////////////// +// Registering the construct method to the factory // +//////////////////////////////////////////////////////////////////////////////// +extern"C" { + class proxy_nps_ChiNu{ + public: + proxy_nps_ChiNu(){ + NPS::DetectorFactory::getInstance()->AddToken("ChiNu","ChiNu"); + NPS::DetectorFactory::getInstance()->AddDetector("ChiNu",ChiNu::Construct); + } + }; + + proxy_nps_ChiNu p_nps_ChiNu; +} diff --git a/NPSimulation/Detectors/ChiNu/ChiNu.hh b/NPSimulation/Detectors/ChiNu/ChiNu.hh new file mode 100644 index 0000000000000000000000000000000000000000..879f101ae910fae1745f4d8625a7f3f303830ade --- /dev/null +++ b/NPSimulation/Detectors/ChiNu/ChiNu.hh @@ -0,0 +1,132 @@ +#ifndef ChiNu_h +#define ChiNu_h 1 +/***************************************************************************** + * Copyright (C) 2009-2019 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr * + * * + * Creation Date : February 2019 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class describe ChiNu simulation * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + *****************************************************************************/ + +// C++ header +#include <string> +#include <vector> +using namespace std; + +// G4 headers +#include "G4ThreeVector.hh" +#include "G4RotationMatrix.hh" +#include "G4LogicalVolume.hh" +#include "G4AssemblyVolume.hh" +#include "G4MultiFunctionalDetector.hh" + +// NPTool header +#include "NPSVDetector.hh" +#include "TChiNuData.h" +#include "NPInputParser.h" + +class ChiNu : public NPS::VDetector{ + //////////////////////////////////////////////////// + /////// Default Constructor and Destructor ///////// + //////////////////////////////////////////////////// + public: + ChiNu() ; + virtual ~ChiNu() ; + + //////////////////////////////////////////////////// + /////// Specific Function of this Class /////////// + //////////////////////////////////////////////////// + public: + // Cartesian + void AddDetector(G4ThreeVector POS); + // Spherical + void AddDetector(double R,double Theta,double Phi); + + + G4AssemblyVolume* BuildDetector(); + G4AssemblyVolume* BuildFissionChamber(); + void BuildAnode(double PosZ); + void BuildCathode(double PosZ); + + private: + G4LogicalVolume* m_CylindricalDetector; + G4LogicalVolume* m_PMT; + G4LogicalVolume* m_LightGuide; + G4LogicalVolume* m_LeadShield; + G4AssemblyVolume* m_AssemblyVolume; + + G4LogicalVolume* m_FissionChamberWall; + G4AssemblyVolume* m_FissionChamberVolume; + + //////////////////////////////////////////////////// + ////// 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_ChiNuScorer ; + //////////////////////////////////////////////////// + ///////////Event class to store Data//////////////// + //////////////////////////////////////////////////// + private: + TChiNuData* m_Event ; + + //////////////////////////////////////////////////// + ///////////////Private intern Data////////////////// + //////////////////////////////////////////////////// + private: // Geometry + // Detector Coordinate + vector<double> m_R; + vector<double> m_Theta; + vector<double> m_Phi; + bool m_BuildLeadShield; + + // Visualisation Attribute + G4VisAttributes* m_VisCylinder; + G4VisAttributes* m_VisPMT; + G4VisAttributes* m_VisLightGuide; + G4VisAttributes* m_VisPyrex; + G4VisAttributes* m_VisLeadShield; + G4VisAttributes* m_VisFCWall; + G4VisAttributes* m_VisAl; + G4VisAttributes* m_VisCu; + G4VisAttributes* m_VisTi; + G4VisAttributes* m_VisRogers4003C; + + // Needed for dynamic loading of the library + public: + static NPS::VDetector* Construct(); +}; +#endif diff --git a/Projects/ChiNu/Analysis.cxx b/Projects/ChiNu/Analysis.cxx new file mode 100644 index 0000000000000000000000000000000000000000..be359e9223a11e235eb1eb0000740d856e20cb67 --- /dev/null +++ b/Projects/ChiNu/Analysis.cxx @@ -0,0 +1,131 @@ +/***************************************************************************** + * Copyright (C) 2009-2014 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Adrien MATTA contact address: a.matta@surrey.ac.uk * + * * + * Creation Date : march 2025 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * Class describing the property of an Analysis object * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ +#include<iostream> +using namespace std; +#include"Analysis.h" +#include"NPAnalysisFactory.h" +#include"NPDetectorManager.h" +#include"NPOptionManager.h" +#include"RootOutput.h" +#include"RootInput.h" +//////////////////////////////////////////////////////////////////////////////// +Analysis::Analysis(){ +} +//////////////////////////////////////////////////////////////////////////////// +Analysis::~Analysis(){ +} + +//////////////////////////////////////////////////////////////////////////////// +void Analysis::Init(){ + m_ChiNu= (TChiNuPhysics*) m_DetectorManager->GetDetector("ChiNu"); + InitialConditions = new TInitialConditions(); + InteractionCoordinates = new TInteractionCoordinates(); + + InitInputBranch(); + InitOutputBranch(); + + neutron = new NPL::Nucleus("1n"); +} + +//////////////////////////////////////////////////////////////////////////////// +void Analysis::TreatEvent(){ + ReInitValue(); + Einit = InitialConditions->GetKineticEnergy(0); + + double Xtarget = InitialConditions->GetIncidentPositionX(); + double Ytarget = InitialConditions->GetIncidentPositionY(); + double Ztarget = InitialConditions->GetIncidentPositionZ(); + TVector3 TargetPos = TVector3(Xtarget,Ytarget,Ztarget); + + for(int i=0; i<m_ChiNu->Energy.size(); i++){ + if(m_ChiNu->Energy.size()>0){ + double Rdet, R; + Rdet = m_ChiNu->GetDetectorPosition(m_ChiNu->DetectorNumber[i]); + TVector3 DetPos = m_ChiNu->GetVectorDetectorPosition(m_ChiNu->DetectorNumber[i]); + TVector3 HitPos = DetPos-TargetPos; + R= HitPos.Mag()*1e-3; + Distance.push_back(R); + Det.push_back(m_ChiNu->DetectorNumber[i]); + T.push_back(m_ChiNu->Time[i]); + neutron->SetTimeOfFlight(m_ChiNu->Time[i]*1e-9/R); + E.push_back(m_ChiNu->Energy[i]); + Elab.push_back(neutron->GetEnergy()); + } + } + + + +} + +/////////////////////////////////////////////////////////////////////////////// +void Analysis::InitOutputBranch() { + RootOutput::getInstance()->GetTree()->Branch("Einit",&Einit,"Einit/D"); + RootOutput::getInstance()->GetTree()->Branch("Elab",&Elab); + RootOutput::getInstance()->GetTree()->Branch("E",&E); + RootOutput::getInstance()->GetTree()->Branch("T",&T); + RootOutput::getInstance()->GetTree()->Branch("Distance",&Distance); + RootOutput::getInstance()->GetTree()->Branch("Det",&Det); +} + +//////////////////////////////////////////////////////////////////////////////// +void Analysis::InitInputBranch(){ + RootInput:: getInstance()->GetChain()->SetBranchStatus("InitialConditions",true ); + RootInput:: getInstance()->GetChain()->SetBranchStatus("fIC_*",true ); + RootInput:: getInstance()->GetChain()->SetBranchAddress("InitialConditions",&InitialConditions); +} + +//////////////////////////////////////////////////////////////////////////////// +void Analysis::ReInitValue(){ + Einit = -100; + Elab.clear(); + E.clear(); + T.clear(); + Distance.clear(); + Det.clear(); +} + +//////////////////////////////////////////////////////////////////////////////// +void Analysis::End(){ +} + + +//////////////////////////////////////////////////////////////////////////////// +// Construct Method to be pass to the DetectorFactory // +//////////////////////////////////////////////////////////////////////////////// +NPL::VAnalysis* Analysis::Construct(){ + return (NPL::VAnalysis*) new Analysis(); +} + +//////////////////////////////////////////////////////////////////////////////// +// Registering the construct method to the factory // +//////////////////////////////////////////////////////////////////////////////// +extern "C"{ +class proxy{ + public: + proxy(){ + NPL::AnalysisFactory::getInstance()->SetConstructor(Analysis::Construct); + } +}; + +proxy p; +} + diff --git a/Projects/ChiNu/Analysis.h b/Projects/ChiNu/Analysis.h new file mode 100644 index 0000000000000000000000000000000000000000..20a13db1427585cb46a1b2c9cc97eeb7f301275b --- /dev/null +++ b/Projects/ChiNu/Analysis.h @@ -0,0 +1,60 @@ +#ifndef Analysis_h +#define Analysis_h +/***************************************************************************** + * Copyright (C) 2009-2014 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Adrien MATTA contact address: a.matta@surrey.ac.uk * + * * + * Creation Date : march 2025 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * Class describing the property of an Analysis object * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ +#include "NPVAnalysis.h" +#include "TChiNuPhysics.h" +#include "TInitialConditions.h" +#include "TInteractionCoordinates.h" +#include "NPNucleus.h" + +class Analysis: public NPL::VAnalysis{ + public: + Analysis(); + ~Analysis(); + + public: + void Init(); + void TreatEvent(); + void End(); + void InitOutputBranch(); + void InitInputBranch(); + void ReInitValue(); + static NPL::VAnalysis* Construct(); + +private: + double Einit; + vector<double> Elab; + vector<double> E; + vector<double> T; + vector<double> Distance; + vector<int> Det; + + private: + TChiNuPhysics* m_ChiNu; + TInitialConditions* InitialConditions; + TInteractionCoordinates* InteractionCoordinates; + + NPL::Nucleus* neutron; + +}; +#endif diff --git a/Projects/ChiNu/CMakeLists.txt b/Projects/ChiNu/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..22c74affdfc45019bdda2594f8439c52d4ab97ec --- /dev/null +++ b/Projects/ChiNu/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required (VERSION 2.8) +# Setting the policy to match Cmake version +cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) +# include the default NPAnalysis cmake file +include("../../NPLib/ressources/CMake/NPAnalysis.cmake") diff --git a/Projects/ChiNu/ChiNu.detector b/Projects/ChiNu/ChiNu.detector new file mode 100644 index 0000000000000000000000000000000000000000..e3dc317cfd3c66051de7c31a390462c5bbfef330 --- /dev/null +++ b/Projects/ChiNu/ChiNu.detector @@ -0,0 +1,353 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%Target +% THICKNESS= 10 micrometer +% RADIUS= 20 mm +% MATERIAL= CD2 +% ANGLE= 0 deg +% X= 0 mm +% Y= 0 mm +% Z= 0 mm + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LI +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 150 deg + PHI= 0 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 135 deg + PHI= 0 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 120 deg + PHI= 0 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 105 deg + PHI= 0 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 90 deg + PHI= 0 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 75 deg + PHI= 0 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 60 deg + PHI= 0 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 45 deg + PHI= 0 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 30 deg + PHI= 0 deg + LeadShield= 1 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LII +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 150 deg + PHI= 30 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 135 deg + PHI= 30 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 120 deg + PHI= 30 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 105 deg + PHI= 30 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 90 deg + PHI= 30 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 75 deg + PHI= 30 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 60 deg + PHI= 30 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 45 deg + PHI= 30 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 30 deg + PHI= 30 deg + LeadShield= 1 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LIII +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 150 deg + PHI= 60 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 135 deg + PHI= 60 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 120 deg + PHI= 60 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 105 deg + PHI= 60 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 90 deg + PHI= 60 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 75 deg + PHI= 60 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 60 deg + PHI= 60 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 45 deg + PHI= 60 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 30 deg + PHI= 60 deg + LeadShield= 1 + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% RI +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 150 deg + PHI= 180 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 135 deg + PHI= 180 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 120 deg + PHI= 180 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 105 deg + PHI= 180 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 90 deg + PHI= 180 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 75 deg + PHI= 180 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 60 deg + PHI= 180 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 45 deg + PHI= 180 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 30 deg + PHI= 180 deg + LeadShield= 1 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% RII +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 150 deg + PHI= 150 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 135 deg + PHI= 150 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 120 deg + PHI= 150 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 105 deg + PHI= 150 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 90 deg + PHI= 150 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 75 deg + PHI= 150 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 60 deg + PHI= 150 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 45 deg + PHI= 150 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 30 deg + PHI= 150 deg + LeadShield= 1 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% RIII +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 150 deg + PHI= 120 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 135 deg + PHI= 120 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 120 deg + PHI= 120 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 105 deg + PHI= 120 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 90 deg + PHI= 120 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 75 deg + PHI= 120 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 60 deg + PHI= 120 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 45 deg + PHI= 120 deg + LeadShield= 1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ChiNu + R= 1000 mm + THETA= 30 deg + PHI= 120 deg + LeadShield= 1 +