Commit a222a38b 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 23f6640a cf0dcf9c
Pipeline #123751 passed with stages
in 4 minutes and 48 seconds
......@@ -12,12 +12,13 @@ add_custom_command(OUTPUT TSofTrimDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scrip
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 TSofTwimDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTwimData.h TSofTwimDataDict.cxx TSofTwimData.rootmap libNPSofia.dylib DEPENDS TSofTwimData.h)
add_custom_command(OUTPUT TSofTwimPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTwimPhysics.h TSofTwimPhysicsDict.cxx TSofTwimPhysics.rootmap libNPSofia.dylib DEPENDS TSofTwimPhysics.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 TSofTofWData.cxx TSofTofWDataDict.cxx TSofTofWPhysics.cxx TSofTofWPhysicsDict.cxx TSofBeamID.cxx TSofBeamIDDict.cxx)
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)
target_link_libraries(NPSofia ${ROOT_LIBRARIES} NPCore NPPhysics)
install(FILES TSofSciData.h TSofSciPhysics.h TSofMwpcData.h TSofAtData.h TSofTrimData.h TSofTrimPhysics.h TSofTwimData.h TSofTofWData.h TSofTofWPhysics.h TSofBeamID.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
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})
......@@ -235,7 +235,7 @@ double TSofSciPhysics::CalculateTimeNs(int det, int pmt, int ft, int ct){
double par = Cal->GetValue("SofSci/DET"+NPL::itoa(det)+"_SIGNAL"+NPL::itoa(pmt)+"_TIME",ft);
double r = (double)rand.Rndm()-0.5;
double ClockOffset = Cal->GetValue("SofSci/DET"+NPL::itoa(det)+"_SIGNAL"+NPL::itoa(pmt)+"_CLOCKOFFSET",0);
double ict_ns = ((double)ct - ClockOffset) * 5.; // to do... take care of the clock offset
double ict_ns = ((double)ct - ClockOffset) * 5.;
double ift_ns;
if(r<0){
......
......@@ -49,6 +49,9 @@ TSofTofWPhysics::TSofTofWPhysics()
m_EventPhysics(this),
m_E_RAW_Threshold(0), // adc channels
m_E_Threshold(0), // MeV
m_NumberOfPlastics(28),
m_StartTime(-1),
m_TofAlignedValue(0), // ns
m_NumberOfDetectors(0) {
}
......@@ -79,14 +82,88 @@ void TSofTofWPhysics::BuildSimplePhysicalEvent() {
///////////////////////////////////////////////////////////////////////////
void TSofTofWPhysics::BuildPhysicalEvent() {
// apply thresholds and calibration
if(m_StartTime == -1)
return;
PreTreat();
// match energy and time together
double T1[28][10], T2[28][10];
int mult1[28], mult2[28];
for(int i=0; i<28; i++){
mult1[i] = 0;
mult2[i] = 0;
for(int j=0; j<10; j++){
T1[i][j] = 0;
T2[i][j] = 0;
}
}
unsigned int mysizeE = m_PreTreatedData->GetMultiplicity();
for (UShort_t e = 0; e < mysizeE ; e++) {
PlasticNumber.push_back(m_PreTreatedData->GetPlasticNbr(e));
Energy.push_back(m_PreTreatedData->GetEnergy(e));
for (UShort_t i = 0; i < mysizeE ; i++) {
int plastic = m_PreTreatedData->GetPlasticNbr(i);
int pmt = m_PreTreatedData->GetPmt(i);
int FT = m_PreTreatedData->GetFineTime(i);
int CT = m_PreTreatedData->GetCoarseTime(i);
double T = CalculateTimeNs(plastic, pmt, FT, CT);
if(pmt==1){
T1[plastic-1][mult1[plastic-1]] = T;
mult1[plastic-1]++;
}
else if(pmt==2){
T2[plastic-1][mult2[plastic-1]] = T;
mult2[plastic-1]++;
}
}
static CalibrationManager* Cal = CalibrationManager::getInstance();
for(int p=0; p<m_NumberOfPlastics; p++){
if(mult1[p]==1 && mult2[p]==1){
for(int i=0; i<mult1[p]; i++){
for(int j=0; j<mult2[p]; j++){
double time_ns = 0.5*(T1[p][i] + T2[p][j]);
double rawpos = T1[p][i] - T2[p][j];
double calpos = Cal->ApplyCalibration("SofTofW/TOFW"+NPL::itoa(p+1)+"_POSPAR",rawpos);
double rawtof = time_ns - m_StartTime;
double caltof = Cal->ApplyCalibration("SofTofW/TOFW"+NPL::itoa(p+1)+"_TOFPAR",rawtof) + m_TofAlignedValue;
PlasticNbr.push_back(p+1);
TimeNs.push_back(time_ns);
RawPosY.push_back(rawpos);
CalPosY.push_back(calpos);
RawTof.push_back(rawtof);
CalTof.push_back(caltof);
}
}
}
}
m_StartTime = -1;
}
///////////////////////////////////////////////////////////////////////////
double TSofTofWPhysics::CalculateTimeNs(int det, int pmt, int ft, int ct){
static CalibrationManager* Cal = CalibrationManager::getInstance();
double par = Cal->GetValue("SofTofW/TOFW"+NPL::itoa(det)+"_PMT"+NPL::itoa(pmt)+"_TIME",ft);
double r = (double)rand.Rndm()-0.5;
double ClockOffset = Cal->GetValue("SofTofW/TOFW"+NPL::itoa(det)+"_PMT"+NPL::itoa(pmt)+"_CLOCKOFFSET",0);
double ict_ns = ((double)ct - ClockOffset) * 5.;
double ift_ns;
if(r<0){
double par_prev = Cal->GetValue("SofTofW/TOFW"+NPL::itoa(det)+"_PMT"+NPL::itoa(pmt)+"_TIME",ft-1);
ift_ns = par + r*(par - par_prev);
}
else{
double par_next = Cal->GetValue("SofSci/TOFW"+NPL::itoa(det)+"_PMT"+NPL::itoa(pmt)+"_TIME",ft+1);
ift_ns = par + r*(par_next - par);
}
double time_ns = (double)ict_ns - ift_ns;
return time_ns;
}
///////////////////////////////////////////////////////////////////////////
......@@ -103,13 +180,11 @@ void TSofTofWPhysics::PreTreat() {
// Energy
unsigned int mysize = m_EventData->GetMultiplicity();
for (UShort_t i = 0; i < mysize ; ++i) {
if (m_EventData->GetEnergy(i) > m_E_RAW_Threshold) {
Double_t Energy = Cal->ApplyCalibration("SofTofW/ENERGY"+NPL::itoa(m_EventData->GetPlasticNbr(i)),m_EventData->GetEnergy(i));
if (Energy > m_E_Threshold) {
m_PreTreatedData->SetPlasticNbr(m_EventData->GetPlasticNbr(i));
m_PreTreatedData->SetEnergy(Energy);
}
}
m_PreTreatedData->SetPlasticNbr(m_EventData->GetPlasticNbr(i));
m_PreTreatedData->SetPmt(m_EventData->GetPmt(i));
m_PreTreatedData->SetCoarseTime(m_EventData->GetCoarseTime(i));
m_PreTreatedData->SetFineTime(m_EventData->GetFineTime(i));
m_PreTreatedData->SetWhichFlag(m_EventData->GetWhichFlag(i));
}
}
......@@ -181,10 +256,12 @@ void TSofTofWPhysics::ReadAnalysisConfig() {
///////////////////////////////////////////////////////////////////////////
void TSofTofWPhysics::Clear() {
PlasticNumber.clear();
Energy.clear();
Time.clear();
PosY.clear();
PlasticNbr.clear();
TimeNs.clear();
RawPosY.clear();
CalPosY.clear();
RawTof.clear();
CalTof.clear();
}
......@@ -225,9 +302,14 @@ void TSofTofWPhysics::ReadConfiguration(NPL::InputParser parser) {
///////////////////////////////////////////////////////////////////////////
void TSofTofWPhysics::AddParameterToCalibrationManager() {
CalibrationManager* Cal = CalibrationManager::getInstance();
for (int i = 0; i < m_NumberOfDetectors; ++i) {
Cal->AddParameter("SofTofW", "D"+ NPL::itoa(i+1)+"_ENERGY","SofTofW_D"+ NPL::itoa(i+1)+"_ENERGY");
Cal->AddParameter("SofTofW", "D"+ NPL::itoa(i+1)+"_TIME","SofTofW_D"+ NPL::itoa(i+1)+"_TIME");
for (int i = 0; i < m_NumberOfPlastics; ++i) {
Cal->AddParameter("SofTofW", "TOFW"+ NPL::itoa(i+1)+"_POSPAR","SofTofW_TOFW"+ NPL::itoa(i+1)+"_POSPAR");
Cal->AddParameter("SofTofW", "TOFW"+ NPL::itoa(i+1)+"_TOFPAR","SofTofW_TOFW"+ NPL::itoa(i+1)+"_TOFPAR");
for(int j = 0; j < 2; j++){
Cal->AddParameter("SofTofW", "TOFW"+ NPL::itoa(i+1)+"_PMT"+NPL::itoa(j+1)+"_TIME","SofTofW_TOFW"+ NPL::itoa(i+1)+"_PMT"+NPL::itoa(j+1)+"_TIME");
Cal->AddParameter("SofTofW", "TOFW"+ NPL::itoa(i+1)+"_PMT"+NPL::itoa(j+1)+"_CLOCKOFFSET","SofTofW_TOFW"+ NPL::itoa(i+1)+"_PMT"+NPL::itoa(j+1)+"_CLOCKOFFSET");
}
}
}
......
......@@ -32,6 +32,7 @@ using namespace std;
#include "TObject.h"
#include "TH1.h"
#include "TVector3.h"
#include "TRandom3.h"
// NPTool headers
#include "TSofTofWData.h"
#include "NPCalibrationManager.h"
......@@ -59,10 +60,12 @@ class TSofTofWPhysics : public TObject, public NPL::VDetector {
// data obtained after BuildPhysicalEvent() and stored in
// output ROOT file
public:
vector<int> PlasticNumber;
vector<double> Energy;
vector<double> Time;
vector<double> PosY;
vector<int> PlasticNbr;
vector<double> TimeNs;
vector<double> RawPosY;
vector<double> CalPosY;
vector<double> RawTof;
vector<double> CalTof;
/// A usefull method to bundle all operation to add a detector
void AddDetector(TVector3 POS);
......@@ -105,6 +108,11 @@ class TSofTofWPhysics : public TObject, public NPL::VDetector {
void ClearEventPhysics() {Clear();}
void ClearEventData() {m_EventData->Clear();}
double CalculateTimeNs(int, int, int, int);
double GetStartTime() {return m_StartTime;}
double GetTofAlignedValue() {return m_TofAlignedValue;}
void SetStartTime(double val) {m_StartTime = val;}
void SetTofAlignedValue(double val) {m_TofAlignedValue = val;}
//////////////////////////////////////////////////////////////
// specific methods to SofTofW array
......@@ -135,10 +143,13 @@ class TSofTofWPhysics : public TObject, public NPL::VDetector {
// parameters used in the analysis
private:
// thresholds
double m_StartTime; //!
double m_TofAlignedValue; //!
int m_NumberOfPlastics; //!
double m_E_RAW_Threshold; //!
double m_E_Threshold; //!
TRandom3 rand; //!
// number of detectors
private:
int m_NumberOfDetectors; //!
......
/*****************************************************************************
* 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 SofTwim Treated data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "TSofTwimPhysics.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(TSofTwimPhysics)
///////////////////////////////////////////////////////////////////////////
TSofTwimPhysics::TSofTwimPhysics()
: m_EventData(new TSofTwimData),
m_PreTreatedData(new TSofTwimData),
m_EventPhysics(this),
m_NumberOfDetectors(0),
m_Beta(-1),
m_BetaNorm(0.838),
m_NumberOfSections(4),
m_NumberOfAnodesPerSection(16) {
}
///////////////////////////////////////////////////////////////////////////
/// A usefull method to bundle all operation to add a detector
void TSofTwimPhysics::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 TSofTwimPhysics::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 TSofTwimPhysics::BuildSimplePhysicalEvent() {
if(m_Beta>0)
BuildPhysicalEvent();
}
///////////////////////////////////////////////////////////////////////////
void TSofTwimPhysics::BuildPhysicalEvent() {
//if(m_Beta<0)
// return;
// apply thresholds and calibration
PreTreat();
if(m_PreTreatedData->GetMultiplicity() != 32){
//m_Beta = -1;
return;
}
vector<double> anode_energy_sec1;
vector<double> anode_energy_sec2;
vector<double> anode_energy_sec3;
vector<double> anode_energy_sec4;
vector<double> anode_dt_sec1;
vector<double> anode_dt_sec2;
vector<double> anode_dt_sec3;
vector<double> anode_dt_sec4;
unsigned int mysizeE = m_PreTreatedData->GetMultiplicity();
for (UShort_t e = 0; e < mysizeE ; e++) {
int SectionNbr = m_PreTreatedData->GetSectionNbr(e);
int AnodeNbr = m_PreTreatedData->GetAnodeNbr(e);
double Energy = m_PreTreatedData->GetEnergy(e);
double DT = m_PreTreatedData->GetDriftTime(e);
if(SectionNbr==1){
anode_energy_sec1.push_back(Energy);
anode_dt_sec1.push_back(DT);
}
if(SectionNbr==2){
anode_energy_sec2.push_back(Energy);
anode_dt_sec2.push_back(DT);
}
if(SectionNbr==3){
anode_energy_sec3.push_back(Energy);
anode_dt_sec3.push_back(DT);
}
if(SectionNbr==4){
anode_energy_sec4.push_back(Energy);
anode_dt_sec4.push_back(DT);
}
}
double Esec1=0;
double Esec2=0;
double Esec3=0;
double Esec4=0;
double DTsec1=0;
double DTsec2=0;
double DTsec3=0;
double DTsec4=0;
for(int i=0; i<anode_energy_sec1.size(); i++){
Esec1 += anode_energy_sec1[i];
DTsec1 += anode_dt_sec1[i];
}
for(int i=0; i<anode_energy_sec2.size(); i++){
Esec2 += anode_energy_sec2[i];
DTsec2 += anode_dt_sec2[i];
}
for(int i=0; i<anode_energy_sec3.size(); i++){
Esec3 += anode_energy_sec3[i];
DTsec3 += anode_dt_sec3[i];
}
for(int i=0; i<anode_energy_sec4.size(); i++){
Esec4 += anode_energy_sec4[i];
DTsec4 += anode_dt_sec4[i];
}
if(Esec1>0){
Esec1 = Esec1 / anode_energy_sec1.size();
DTsec1 = DTsec1 / anode_dt_sec1.size();
EnergySection.push_back(Esec1);
DriftTime.push_back(DTsec1);
SectionNbr.push_back(1);
}
if(Esec2>0){
Esec2 = Esec2 / anode_energy_sec2.size();
DTsec2 = DTsec2 / anode_dt_sec2.size();
EnergySection.push_back(Esec2);
DriftTime.push_back(DTsec2);
SectionNbr.push_back(2);
}
if(Esec3>0){
Esec3 = Esec3 / anode_energy_sec3.size();
DTsec3 = DTsec3 / anode_dt_sec3.size();
EnergySection.push_back(Esec3);
DriftTime.push_back(DTsec3);
SectionNbr.push_back(3);
}
if(Esec4>0){
Esec4 = Esec4 / anode_energy_sec4.size();
DTsec4 = DTsec4 / anode_dt_sec4.size();
EnergySection.push_back(Esec4);
DriftTime.push_back(DTsec4);
SectionNbr.push_back(4);
}
m_Beta = -1;
}
///////////////////////////////////////////////////////////////////////////
void TSofTwimPhysics::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("SofTwim/SEC"+NPL::itoa(m_EventData->GetSectionNbr(i))+"_ANODE"+NPL::itoa(m_EventData->GetAnodeNbr(i))+"_ENERGY",m_EventData->GetEnergy(i));
double DT = Cal->ApplyCalibration("SofTwim/SEC"+NPL::itoa(m_EventData->GetSectionNbr(i))+"_ANODE"+NPL::itoa(m_EventData->GetAnodeNbr(i))+"_TIME",m_EventData->GetDriftTime(i));
m_PreTreatedData->SetSectionNbr(m_EventData->GetSectionNbr(i));
m_PreTreatedData->SetAnodeNbr(m_EventData->GetAnodeNbr(i));
m_PreTreatedData->SetEnergy(Energy);
m_PreTreatedData->SetDriftTime(DT);
m_PreTreatedData->SetPileUp(m_EventData->GetPileUp(i));
m_PreTreatedData->SetOverflow(m_EventData->GetOverflow(i));
}
}
///////////////////////////////////////////////////////////////////////////
void TSofTwimPhysics::ReadAnalysisConfig() {
bool ReadingStatus = false;
// path to file
string FileName = "./configs/ConfigSofTwim.dat";
// open analysis config file
ifstream AnalysisConfigFile;
AnalysisConfigFile.open(FileName.c_str());
if (!AnalysisConfigFile.is_open()) {
cout << " No ConfigSofTwim.dat found: Default parameter loaded for Analayis " << FileName << endl;
return;
}
cout << " Loading user parameter for Analysis from ConfigSofTwim.dat " << endl;
// Save it in a TAsciiFile
TAsciiFile* asciiConfig = RootOutput::getInstance()->GetAsciiFileAnalysisConfig();
asciiConfig->AppendLine("%%% ConfigSofTwim.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 = "ConfigSofTwim";
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=="SPLINE_SECTION_BETA_PATH") {
AnalysisConfigFile >> DataBuffer;
m_SPLINE_SECTION_BETA_PATH = DataBuffer;
cout << "*** Loading Spline for Beta correction per section ***" << endl;
LoadSplineBeta();
}
else if (whatToDo=="E_THRESHOLD") {
AnalysisConfigFile >> DataBuffer;
m_E_Threshold = atof(DataBuffer.c_str());
cout << whatToDo << " " << m_E_Threshold << endl;
}
else {
ReadingStatus = false;
}
}
}
}
///////////////////////////////////////////////////////////////////////////
void TSofTwimPhysics::LoadSplineBeta(){
TString filename = m_SPLINE_SECTION_BETA_PATH;
TFile* ifile = new TFile(filename,"read");
if(ifile->IsOpen()){
cout << "Loading splines..." << endl;
for(int s=0; s<m_NumberOfSections; s++){
TString splinename = Form("spline_sec%i",s+1);
fcorr_beta_sec[s] = (TSpline3*) ifile->FindObjectAny(splinename);
cout << fcorr_beta_sec[s]->GetName() << endl;
}
}
else
cout << "File " << filename << " not found!" << endl;
ifile->Close();
}
///////////////////////////////////////////////////////////////////////////
void TSofTwimPhysics::Clear() {
SectionNbr.clear();
EnergySection.clear();
DriftTime.clear();
}
///////////////////////////////////////////////////////////////////////////
void TSofTwimPhysics::ReadConfiguration(NPL::InputParser parser) {
vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("SofTwim");
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 << "//// SofTwim " << i+1 << endl;
TVector3 Pos = blocks[i]->GetTVector3("POS","mm");
AddDetector(Pos);
}
else if(blocks[i]->HasTokenList(sphe)){
if(NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// SofTwim " << 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 TSofTwimPhysics::AddParameterToCalibrationManager() {
CalibrationManager* Cal = CalibrationManager::getInstance();
for(int sec = 0; sec < m_NumberOfSections; sec++){
Cal->AddParameter("SofTwim","SEC"+NPL::itoa(sec+1)+"_ALIGN","SofTwim_SEC"+NPL::itoa(sec+1)+"_ALIGN");
for(int anode = 0; anode < m_NumberOfAnodesPerSection; anode++){
Cal->AddParameter("SofTwim","SEC"+NPL::itoa(sec+1)+"_ANODE"+NPL::itoa(anode+1)+"_ENERGY","SofTwim_SEC"+NPL::itoa(sec+1)+"_ANODE"+NPL::itoa(anode+1)+"_ENERGY");
Cal->AddParameter("SofTwim","SEC"+NPL::