Commit c9371077 authored by Adrien Matta's avatar Adrien Matta
Browse files

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

parents 5e2753a8 459248cf
Pipeline #126471 passed with stages
in 11 minutes
...@@ -167,13 +167,20 @@ void TBigRIPSPPACPhysics::PreTreat(){ ...@@ -167,13 +167,20 @@ void TBigRIPSPPACPhysics::PreTreat(){
multiHit.push_back(Nmulti); multiHit.push_back(Nmulti);
//Calculate TSum, TDiff and X/Y //Calculate TSum, TDiff and X/Y
double TSumX_tmp, TSumY_tmp;
double TDiffX_tmp, TDiffY_tmp; double TDiffX_tmp, TDiffY_tmp;
double X_tmp, Y_tmp; double X_tmp, Y_tmp;
if(tmp.HasTXs() && tmp.HasTA()){TSumX.push_back(TX1[0]+TX2[0]-2*TA[0]);} if(tmp.HasTXs() && tmp.HasTA()){
else {TSumX.push_back(-99999);} TSumX_tmp = TX1[0]+TX2[0]-2*TA[0];
TSumX.push_back(TSumX_tmp);
}else {
TSumX_tmp = -99999;
TSumX.push_back(TSumX_tmp);
}
if(tmp.HasTXs()){ if(tmp.HasTXs() && ( ignore_txsum_cut[id] ||
(TSumX_tmp >= txsum_min[id] && TSumX_tmp <= txsum_max[id]) ) ){
TDiffX_tmp = (TX1[0] - TX2[0] - xns_off[id]); TDiffX_tmp = (TX1[0] - TX2[0] - xns_off[id]);
TDiffX.push_back(TDiffX_tmp); TDiffX.push_back(TDiffX_tmp);
X_tmp = -1*((TDiffX_tmp * x_ns2mm[id])/2. - x_offset[id] - xpos_offset[id]); X_tmp = -1*((TDiffX_tmp * x_ns2mm[id])/2. - x_offset[id] - xpos_offset[id]);
...@@ -183,10 +190,16 @@ void TBigRIPSPPACPhysics::PreTreat(){ ...@@ -183,10 +190,16 @@ void TBigRIPSPPACPhysics::PreTreat(){
X.push_back(-99999); X.push_back(-99999);
} }
if(tmp.HasTYs() && tmp.HasTA()) {TSumY.push_back(TY1[0]+TY2[0]-2*TA[0]);} if(tmp.HasTYs() && tmp.HasTA()) {
else {TSumY.push_back(-99999);} TSumY_tmp = TY1[0]+TY2[0]-2*TA[0];
TSumY.push_back(TSumY_tmp);
} else {
TSumY_tmp = -99999;
TSumY.push_back(TSumY_tmp);
}
if(tmp.HasTYs()) { if(tmp.HasTYs() && (ignore_tysum_cut[id] ||
(TSumY_tmp >= tysum_min[id] && TSumY_tmp <= tysum_max[id])) ){
TDiffY_tmp = (TY1[0] - TY2[0] - yns_off[id]); TDiffY_tmp = (TY1[0] - TY2[0] - yns_off[id]);
TDiffY.push_back(TDiffY_tmp); TDiffY.push_back(TDiffY_tmp);
Y_tmp = ((TDiffY_tmp * y_ns2mm[id])/2. - y_offset[id] - ypos_offset[id]); Y_tmp = ((TDiffY_tmp * y_ns2mm[id])/2. - y_offset[id] - ypos_offset[id]);
...@@ -302,6 +315,14 @@ void TBigRIPSPPACPhysics::AddPPACs(string name, NPL::XmlParser& xml){ ...@@ -302,6 +315,14 @@ void TBigRIPSPPACPhysics::AddPPACs(string name, NPL::XmlParser& xml){
y_offset[ID] = b[i]->AsDouble("yoffset"); y_offset[ID] = b[i]->AsDouble("yoffset");
xpos_offset[ID] = b[i]->AsDouble("xpos_off"); xpos_offset[ID] = b[i]->AsDouble("xpos_off");
ypos_offset[ID] = b[i]->AsDouble("ypos_off"); ypos_offset[ID] = b[i]->AsDouble("ypos_off");
txsum_min[ID] = b[i]->AsDouble("txsum_min");
txsum_max[ID] = b[i]->AsDouble("txsum_max");
tysum_min[ID] = b[i]->AsDouble("tysum_min");
tysum_max[ID] = b[i]->AsDouble("tysum_max");
ignore_txsum_cut[ID] = false;
if(txsum_min[ID] >= txsum_max[ID]) ignore_txsum_cut[ID] = true;
ignore_tysum_cut[ID] = false;
if(tysum_min[ID] >= tysum_max[ID]) ignore_tysum_cut[ID] = true;
} }
} }
} }
......
...@@ -81,19 +81,25 @@ class TBigRIPSPPACPhysics : public TObject, public NPL::VDetector{ ...@@ -81,19 +81,25 @@ class TBigRIPSPPACPhysics : public TObject, public NPL::VDetector{
map<int,double> RawUpperLimit;//! Upper Value of TDC range considered for a PPAC map<int,double> RawUpperLimit;//! Upper Value of TDC range considered for a PPAC
map<int,double> RawLowerLimit;//! Lower Value of TDC range considered for a PPAC map<int,double> RawLowerLimit;//! Lower Value of TDC range considered for a PPAC
map<int,int> IDtoFP;//! Focal plane where the PPAC is located map<int,int> IDtoFP;//! Focal plane where the PPAC is located
map<int,double> ch2ns_TX1; map<int,double> ch2ns_TX1;//!
map<int,double> ch2ns_TX2; map<int,double> ch2ns_TX2;//!
map<int,double> ch2ns_TY1; map<int,double> ch2ns_TY1;//!
map<int,double> ch2ns_TY2; map<int,double> ch2ns_TY2;//!
map<int,double> ch2ns_TA; map<int,double> ch2ns_TA;//!
map<int,double> xns_off; map<int,double> xns_off;//!
map<int,double> yns_off; map<int,double> yns_off;//!
map<int,double> x_offset; map<int,double> x_offset;//!
map<int,double> xpos_offset; map<int,double> xpos_offset;//!
map<int,double> x_ns2mm; map<int,double> x_ns2mm;//!
map<int,double> y_offset; map<int,bool> ignore_txsum_cut;//!
map<int,double> ypos_offset; map<int,double> txsum_min;//!
map<int,double> y_ns2mm; map<int,double> txsum_max;//!
map<int,double> y_offset;//!
map<int,double> ypos_offset;//!
map<int,double> y_ns2mm;//!
map<int,bool> ignore_tysum_cut;//!
map<int,double> tysum_min;//!
map<int,double> tysum_max;//!
public: // Innherited from VDetector Class public: // Innherited from VDetector Class
...@@ -141,7 +147,7 @@ class TBigRIPSPPACPhysics : public TObject, public NPL::VDetector{ ...@@ -141,7 +147,7 @@ class TBigRIPSPPACPhysics : public TObject, public NPL::VDetector{
// Write Spectra to file // Write Spectra to file
void WriteSpectra(); void WriteSpectra();
public: // Specific to SamuraiFDC2 Array public: // Specific
// Clear The PreTeated object // Clear The PreTeated object
void ClearPreTreatedData() {m_PreTreatedData->Clear();} void ClearPreTreatedData() {m_PreTreatedData->Clear();}
......
...@@ -7,6 +7,7 @@ add_custom_command(OUTPUT TSofTofWPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/sc ...@@ -7,6 +7,7 @@ add_custom_command(OUTPUT TSofTofWPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/sc
add_custom_command(OUTPUT TSofMwpcDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofMwpcData.h TSofMwpcDataDict.cxx TSofMwpcData.rootmap libNPSofia.dylib DEPENDS TSofMwpcData.h) add_custom_command(OUTPUT TSofMwpcDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofMwpcData.h TSofMwpcDataDict.cxx TSofMwpcData.rootmap libNPSofia.dylib DEPENDS TSofMwpcData.h)
add_custom_command(OUTPUT TSofAtDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofAtData.h TSofAtDataDict.cxx TSofAtData.rootmap libNPSofia.dylib DEPENDS TSofAtData.h) add_custom_command(OUTPUT TSofAtDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofAtData.h TSofAtDataDict.cxx TSofAtData.rootmap libNPSofia.dylib DEPENDS TSofAtData.h)
add_custom_command(OUTPUT TSofAtPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofAtPhysics.h TSofAtPhysicsDict.cxx TSofAtPhysics.rootmap libNPSofia.dylib DEPENDS TSofAtPhysics.h)
add_custom_command(OUTPUT TSofTrimDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTrimData.h TSofTrimDataDict.cxx TSofTrimData.rootmap libNPSofia.dylib DEPENDS TSofTrimData.h) add_custom_command(OUTPUT TSofTrimDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTrimData.h TSofTrimDataDict.cxx TSofTrimData.rootmap libNPSofia.dylib DEPENDS TSofTrimData.h)
add_custom_command(OUTPUT TSofTrimPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTrimPhysics.h TSofTrimPhysicsDict.cxx TSofTrimPhysics.rootmap libNPSofia.dylib DEPENDS TSofTrimPhysics.h) add_custom_command(OUTPUT TSofTrimPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTrimPhysics.h TSofTrimPhysicsDict.cxx TSofTrimPhysics.rootmap libNPSofia.dylib DEPENDS TSofTrimPhysics.h)
...@@ -16,9 +17,11 @@ add_custom_command(OUTPUT TSofTwimPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/sc ...@@ -16,9 +17,11 @@ add_custom_command(OUTPUT TSofTwimPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/sc
add_custom_command(OUTPUT TSofBeamIDDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofBeamID.h TSofBeamIDDict.cxx TSofBeamID.rootmap libNPSofia.dylib DEPENDS TSofBeamID.h) add_custom_command(OUTPUT TSofBeamIDDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofBeamID.h TSofBeamIDDict.cxx TSofBeamID.rootmap libNPSofia.dylib DEPENDS TSofBeamID.h)
add_library(NPSofia SHARED TSofSciData.cxx TSofSciDataDict.cxx TSofSciPhysics.cxx TSofSciPhysicsDict.cxx TSofMwpcData.cxx TSofMwpcDataDict.cxx TSofAtData.cxx TSofAtDataDict.cxx TSofTrimData.cxx TSofTrimDataDict.cxx TSofTrimPhysics.cxx TSofTrimPhysicsDict.cxx TSofTwimData.cxx TSofTwimDataDict.cxx TSofTwimPhysics.cxx TSofTwimPhysicsDict.cxx TSofTofWData.cxx TSofTofWDataDict.cxx TSofTofWPhysics.cxx TSofTofWPhysicsDict.cxx TSofBeamID.cxx TSofBeamIDDict.cxx) add_custom_command(OUTPUT TSofFissionFragmentDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofFissionFragment.h TSofFissionFragmentDict.cxx TSofFissionFragment.rootmap libNPSofia.dylib DEPENDS TSofFissionFragment.h)
add_library(NPSofia SHARED TSofSciData.cxx TSofSciDataDict.cxx TSofSciPhysics.cxx TSofSciPhysicsDict.cxx TSofMwpcData.cxx TSofMwpcDataDict.cxx TSofAtData.cxx TSofAtDataDict.cxx TSofAtPhysics.cxx TSofAtPhysicsDict.cxx TSofTrimData.cxx TSofTrimDataDict.cxx TSofTrimPhysics.cxx TSofTrimPhysicsDict.cxx TSofTwimData.cxx TSofTwimDataDict.cxx TSofTwimPhysics.cxx TSofTwimPhysicsDict.cxx TSofTofWData.cxx TSofTofWDataDict.cxx TSofTofWPhysics.cxx TSofTofWPhysicsDict.cxx TSofBeamID.cxx TSofBeamIDDict.cxx TSofFissionFragment.cxx TSofFissionFragmentDict.cxx)
target_link_libraries(NPSofia ${ROOT_LIBRARIES} NPCore NPPhysics) target_link_libraries(NPSofia ${ROOT_LIBRARIES} NPCore NPPhysics)
install(FILES TSofSciData.h TSofSciPhysics.h TSofMwpcData.h TSofAtData.h TSofTrimData.h TSofTrimPhysics.h TSofTwimData.h TSofTwimPhysics.h TSofTofWData.h TSofTofWPhysics.h TSofBeamID.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY}) install(FILES TSofSciData.h TSofSciPhysics.h TSofMwpcData.h TSofAtData.h TSofAtPhysics.h TSofTrimData.h TSofTrimPhysics.h TSofTwimData.h TSofTwimPhysics.h TSofTofWData.h TSofTofWPhysics.h TSofBeamID.h TSofFissionFragment.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
/*****************************************************************************
* 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 : November 2020 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold SofAt Treated data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "TSofAtPhysics.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(TSofAtPhysics)
///////////////////////////////////////////////////////////////////////////
TSofAtPhysics::TSofAtPhysics()
: m_EventData(new TSofAtData),
m_PreTreatedData(new TSofAtData),
m_EventPhysics(this),
m_NumberOfDetectors(0){
}
///////////////////////////////////////////////////////////////////////////
/// A usefull method to bundle all operation to add a detector
void TSofAtPhysics::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 TSofAtPhysics::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);
}
///////////////////////////////////////////////////////////////////////////
void TSofAtPhysics::BuildSimplePhysicalEvent() {
BuildPhysicalEvent();
}
///////////////////////////////////////////////////////////////////////////
void TSofAtPhysics::BuildPhysicalEvent() {
PreTreat();
unsigned int mysizeE = m_PreTreatedData->GetMultiplicity();
for (UShort_t e = 0; e < mysizeE ; e++) {
if(m_PreTreatedData->GetPileUp(e) != 1 && m_PreTreatedData->GetOverflow(e) != 1){
AnodeNbr.push_back(m_PreTreatedData->GetAnodeNbr(e));
Energy.push_back(m_PreTreatedData->GetEnergy(e));
}
}
}
///////////////////////////////////////////////////////////////////////////
void TSofAtPhysics::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();
unsigned int mysize = m_EventData->GetMultiplicity();
for (unsigned int i = 0; i < mysize ; ++i) {
//double Energy = Cal->ApplyCalibration("SofAt/SEC"+NPL::itoa(m_EventData->GetSectionNbr(i))+"_ANODE"+NPL::itoa(m_EventData->GetAnodeNbr(i))+"_ENERGY",m_EventData->GetEnergy(i));
m_PreTreatedData->SetAnodeNbr(m_EventData->GetAnodeNbr(i));
m_PreTreatedData->SetEnergy(m_EventData->GetEnergy(i));
m_PreTreatedData->SetPileUp(m_EventData->GetPileUp(i));
m_PreTreatedData->SetOverflow(m_EventData->GetOverflow(i));
}
}
///////////////////////////////////////////////////////////////////////////
void TSofAtPhysics::ReadAnalysisConfig() {
bool ReadingStatus = false;
// path to file
string FileName = "./configs/ConfigSofAt.dat";
// open analysis config file
ifstream AnalysisConfigFile;
AnalysisConfigFile.open(FileName.c_str());
if (!AnalysisConfigFile.is_open()) {
cout << " No ConfigSofAt.dat found: Default parameter loaded for Analayis " << FileName << endl;
return;
}
cout << " Loading user parameter for Analysis from ConfigSofAt.dat " << endl;
// Save it in a TAsciiFile
TAsciiFile* asciiConfig = RootOutput::getInstance()->GetAsciiFileAnalysisConfig();
asciiConfig->AppendLine("%%% ConfigSofAt.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 = "ConfigSofAt";
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_THRESHOLD") {
AnalysisConfigFile >> DataBuffer;
m_E_Threshold = atof(DataBuffer.c_str());
cout << whatToDo << " " << m_E_Threshold << endl;
}
else {
ReadingStatus = false;
}
}
}
}
///////////////////////////////////////////////////////////////////////////
void TSofAtPhysics::Clear() {
AnodeNbr.clear();
Energy.clear();
}
///////////////////////////////////////////////////////////////////////////
void TSofAtPhysics::ReadConfiguration(NPL::InputParser parser) {
vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("SofAt");
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 << "//// SofAt " << i+1 << endl;
TVector3 Pos = blocks[i]->GetTVector3("POS","mm");
AddDetector(Pos);
}
else if(blocks[i]->HasTokenList(sphe)){
if(NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// SofAt " << 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);
}
}
ReadAnalysisConfig();
}
///////////////////////////////////////////////////////////////////////////
void TSofAtPhysics::AddParameterToCalibrationManager() {
CalibrationManager* Cal = CalibrationManager::getInstance();
for(int sec = 0; sec < m_NumberOfDetectors; sec++){
Cal->AddParameter("SofAt","SEC"+NPL::itoa(sec+1)+"_ALIGN","SofAt_SEC"+NPL::itoa(sec+1)+"_ALIGN");
}
}
///////////////////////////////////////////////////////////////////////////
void TSofAtPhysics::InitializeRootInputRaw() {
TChain* inputChain = RootInput::getInstance()->GetChain();
inputChain->SetBranchStatus("SofAt", true );
inputChain->SetBranchAddress("SofAt", &m_EventData );
}
///////////////////////////////////////////////////////////////////////////
void TSofAtPhysics::InitializeRootInputPhysics() {
TChain* inputChain = RootInput::getInstance()->GetChain();
inputChain->SetBranchAddress("SofAt", &m_EventPhysics);
}
///////////////////////////////////////////////////////////////////////////
void TSofAtPhysics::InitializeRootOutput() {
TTree* outputTree = RootOutput::getInstance()->GetTree();
outputTree->Branch("SofAt", "TSofAtPhysics", &m_EventPhysics);
}
////////////////////////////////////////////////////////////////////////////////
// Construct Method to be pass to the DetectorFactory //
////////////////////////////////////////////////////////////////////////////////
NPL::VDetector* TSofAtPhysics::Construct() {
return (NPL::VDetector*) new TSofAtPhysics();
}
////////////////////////////////////////////////////////////////////////////////
// Registering the construct method to the factory //
////////////////////////////////////////////////////////////////////////////////
extern "C"{
class proxy_SofAt{
public:
proxy_SofAt(){
NPL::DetectorFactory::getInstance()->AddToken("SofAt","SofAt");
NPL::DetectorFactory::getInstance()->AddDetector("SofAt",TSofAtPhysics::Construct);
}
};
proxy_SofAt p_SofAt;
}
#ifndef TSofAtPHYSICS_H
#define TSofAtPHYSICS_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 : November 2020 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold SofAt 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"
#include "TSpline.h"
// NPTool headers
#include "TSofAtData.h"
#include "NPCalibrationManager.h"
#include "NPVDetector.h"
#include "NPInputParser.h"
class TSofAtPhysics : public TObject, public NPL::VDetector {
//////////////////////////////////////////////////////////////
// constructor and destructor
public:
TSofAtPhysics();
~TSofAtPhysics() {};
//////////////////////////////////////////////////////////////
// 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> AnodeNbr;
vector<double> Energy;
/// A usefull method to bundle all operation to add a detector
void AddDetector(TVector3 POS);
void AddDetector(double R, double Theta, double Phi);
//////////////////////////////////////////////////////////////
// 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();}
//////////////////////////////////////////////////////////////
// specific methods to SofAt 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 TSofAtData object to TSofAtPhysics.
// needed for online analysis for example
void SetRawDataPointer(TSofAtData* rawDataPointer) {m_EventData = rawDataPointer;}
// objects are not written in the TTree
private:
TSofAtData* m_EventData; //!
TSofAtData* m_PreTreatedData; //!
TSofAtPhysics* m_EventPhysics; //!
// getters for raw and pre-treated data object
public:
TSofAtData* GetRawData() const {return m_EventData;}
TSofAtData* GetPreTreatedData() const {return m_PreTreatedData;}
// parameters used in the analysis
private:
double m_E_Threshold; //!
// number of detectors
private:
int m_NumberOfDetectors; //!
// Static constructor to be passed to the Detector Factory
public:
static NPL::VDetector* Construct();
ClassDef(TSofAtPhysics,1) // SofAtPhysics structure
};
#endif
/*****************************************************************************
* 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 : May 2021 *
* Last update : *
*---------------------------------------------------------------------------*