Commit 8448d636 authored by flavigny's avatar flavigny
Browse files

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

parents f0eed48a 9e20a24a
Pipeline #129281 passed with stages
in 6 minutes and 31 seconds
...@@ -268,7 +268,7 @@ void NPL::DetectorManager::BuildPhysicalEvent(){ ...@@ -268,7 +268,7 @@ void NPL::DetectorManager::BuildPhysicalEvent(){
(it->second->*m_ClearEventPhysicsPtr)(); (it->second->*m_ClearEventPhysicsPtr)();
(it->second->*m_BuildPhysicalPtr)(); (it->second->*m_BuildPhysicalPtr)();
(it->second->*m_FillSpectra)(); (it->second->*m_FillSpectra)();
if(m_CheckSpectra) if(m_CheckSpectra) {
(it->second->*m_CheckSpectra)(); (it->second->*m_CheckSpectra)();
} }
} }
......
...@@ -57,18 +57,18 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector ...@@ -57,18 +57,18 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector
// DSSD // DSSD
int EventMultiplicity; int EventMultiplicity;
vector<int> EventType; vector<int> EventType;
//vector<int> TowerNumber; vector<int> TowerNumber;//
vector<int> DetectorNumber; vector<int> DetectorNumber;
vector<int> Strip_Front; vector<int> Strip_Front;
vector<int> Strip_Back; vector<int> Strip_Back;
//vector<double> Strip_E; vector<double> Strip_E;//
vector<double> Strip_T; vector<double> Strip_T;
vector<double> Front_Energy; vector<double> Front_Energy;
vector<double> Back_Energy; vector<double> Back_Energy;
//vector<double> Half_Energy; vector<double> Half_Energy;//
vector<double> Front_Time; vector<double> Front_Time;
vector<double> Back_Time; vector<double> Back_Time;
//vector<bool> Same_FBTime; vector<bool> Same_FBTime;//
// Calorimeter // Calorimeter
vector<double> Calor_E; vector<double> Calor_E;
vector<double> Calor_T; vector<double> Calor_T;
...@@ -240,8 +240,8 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector ...@@ -240,8 +240,8 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector
Int_t m_CounterEvt[50]; //! Int_t m_CounterEvt[50]; //!
Int_t m_CounterHit[50]; //! Int_t m_CounterHit[50]; //!
// physical events // physical events
vector<int> TowerNumber; //vector<int> TowerNumber;
vector<double> Half_Energy; //vector<double> Half_Energy;
//vector<bool> Same_FBTime; //vector<bool> Same_FBTime;
}; };
......
...@@ -5,6 +5,7 @@ add_custom_command(OUTPUT TSofTofWDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scrip ...@@ -5,6 +5,7 @@ add_custom_command(OUTPUT TSofTofWDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scrip
add_custom_command(OUTPUT TSofTofWPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTofWPhysics.h TSofTofWPhysicsDict.cxx TSofTofWPhysics.rootmap libNPSofia.dylib DEPENDS TSofTofWPhysics.h) add_custom_command(OUTPUT TSofTofWPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTofWPhysics.h TSofTofWPhysicsDict.cxx TSofTofWPhysics.rootmap libNPSofia.dylib DEPENDS TSofTofWPhysics.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 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 TSofMwpcPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofMwpcPhysics.h TSofMwpcPhysicsDict.cxx TSofMwpcPhysics.rootmap libNPSofia.dylib DEPENDS TSofMwpcPhysics.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 TSofAtPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofAtPhysics.h TSofAtPhysicsDict.cxx TSofAtPhysics.rootmap libNPSofia.dylib DEPENDS TSofAtPhysics.h)
...@@ -19,9 +20,9 @@ add_custom_command(OUTPUT TSofBeamIDDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts ...@@ -19,9 +20,9 @@ add_custom_command(OUTPUT TSofBeamIDDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts
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_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) add_library(NPSofia SHARED TSofSciData.cxx TSofSciDataDict.cxx TSofSciPhysics.cxx TSofSciPhysicsDict.cxx TSofMwpcData.cxx TSofMwpcDataDict.cxx TSofMwpcPhysics.cxx TSofMwpcPhysicsDict.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 TSofAtPhysics.h TSofTrimData.h TSofTrimPhysics.h TSofTwimData.h TSofTwimPhysics.h TSofTofWData.h TSofTofWPhysics.h TSofBeamID.h TSofFissionFragment.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY}) install(FILES TSofSciData.h TSofSciPhysics.h TSofMwpcData.h TSofMwpcPhysics.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})
...@@ -80,19 +80,10 @@ void TSofAtPhysics::BuildPhysicalEvent() { ...@@ -80,19 +80,10 @@ void TSofAtPhysics::BuildPhysicalEvent() {
PreTreat(); PreTreat();
unsigned int mysizeE = m_PreTreatedData->GetMultiplicity(); unsigned int mysizeE = m_PreTreatedData->GetMultiplicity();
if(mysizeE != 4)
return;
double E[4]={-1,-1,-1,-1};
for (UShort_t e = 0; e < mysizeE ; e++) { for (UShort_t e = 0; e < mysizeE ; e++) {
E[m_PreTreatedData->GetAnodeNbr(e)-1] = m_PreTreatedData->GetEnergy(e); AnodeNbr.push_back(m_PreTreatedData->GetAnodeNbr(e));
} Energy.push_back(m_PreTreatedData->GetEnergy(e));
if(E[0]>0 && E[1]>0 && E[2]>0 && E[3]>0){
for(int i=0; i<4; i++){
AnodeNbr.push_back(i+1);
Energy.push_back(E[i]);
}
} }
} }
......
...@@ -52,6 +52,7 @@ void TSofBeamID::Clear() { ...@@ -52,6 +52,7 @@ void TSofBeamID::Clear() {
fBeam_Brho = -1; fBeam_Brho = -1;
fBeam_XS2 = -1000; fBeam_XS2 = -1000;
fBeam_XCC = -1000; fBeam_XCC = -1000;
fBeam_YCC = -1000;
} }
...@@ -70,5 +71,6 @@ void TSofBeamID::Dump() const { ...@@ -70,5 +71,6 @@ void TSofBeamID::Dump() const {
cout << "fBeam_Brho: " << fBeam_Brho << endl; cout << "fBeam_Brho: " << fBeam_Brho << endl;
cout << "fBeam_XS2: " << fBeam_XS2 << endl; cout << "fBeam_XS2: " << fBeam_XS2 << endl;
cout << "fBeam_XCC: " << fBeam_XCC << endl; cout << "fBeam_XCC: " << fBeam_XCC << endl;
cout << "fBeam_YCC: " << fBeam_YCC << endl;
} }
...@@ -43,6 +43,7 @@ class TSofBeamID : public TObject { ...@@ -43,6 +43,7 @@ class TSofBeamID : public TObject {
double fBeam_Brho; double fBeam_Brho;
double fBeam_XS2; double fBeam_XS2;
double fBeam_XCC; double fBeam_XCC;
double fBeam_YCC;
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructor and destructor // Constructor and destructor
...@@ -75,6 +76,7 @@ class TSofBeamID : public TObject { ...@@ -75,6 +76,7 @@ class TSofBeamID : public TObject {
inline void SetBrho(double val){fBeam_Brho = val;};//! inline void SetBrho(double val){fBeam_Brho = val;};//!
inline void SetXS2(double val){fBeam_XS2 = val;};//! inline void SetXS2(double val){fBeam_XS2 = val;};//!
inline void SetXCC(double val){fBeam_XCC = val;};//! inline void SetXCC(double val){fBeam_XCC = val;};//!
inline void SetYCC(double val){fBeam_YCC = val;};//!
////////////////////// GETTERS //////////////////////// ////////////////////// GETTERS ////////////////////////
inline double GetZbeam() const {return fBeam_Z;}//! inline double GetZbeam() const {return fBeam_Z;}//!
...@@ -86,6 +88,7 @@ class TSofBeamID : public TObject { ...@@ -86,6 +88,7 @@ class TSofBeamID : public TObject {
inline double GetBrho() const {return fBeam_Brho;}//! inline double GetBrho() const {return fBeam_Brho;}//!
inline double GetXS2() const {return fBeam_XS2;}//! inline double GetXS2() const {return fBeam_XS2;}//!
inline double GetXCC() const {return fBeam_XCC;}//! inline double GetXCC() const {return fBeam_XCC;}//!
inline double GetYCC() const {return fBeam_YCC;}//!
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Required for ROOT dictionnary // Required for ROOT dictionnary
......
/*****************************************************************************
* 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 SofMwpc Treated data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "TSofMwpcPhysics.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(TSofMwpcPhysics)
///////////////////////////////////////////////////////////////////////////
TSofMwpcPhysics::TSofMwpcPhysics()
: m_EventData(new TSofMwpcData),
m_PreTreatedData(new TSofMwpcData),
m_EventPhysics(this),
m_NumberOfDetectors(0){
}
///////////////////////////////////////////////////////////////////////////
/// A usefull method to bundle all operation to add a detector
void TSofMwpcPhysics::AddDetector(TVector3 Pos){
// In That simple case nothing is done
// Typically for more complex detector one would calculate the relevant
// positions (stripped silicon) or angles (gamma array)
DetPosX.push_back(Pos.X());
DetPosY.push_back(Pos.Y());
DetPosZ.push_back(Pos.Z());
m_NumberOfDetectors++;
}
///////////////////////////////////////////////////////////////////////////
void TSofMwpcPhysics::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 TSofMwpcPhysics::BuildSimplePhysicalEvent() {
BuildPhysicalEvent();
}
///////////////////////////////////////////////////////////////////////////
void TSofMwpcPhysics::BuildPhysicalEvent() {
PreTreat();
unsigned int mysizeE = m_PreTreatedData->GetMultiplicity();
vector<double> ChargeArray;
ChargeArray.resize(288,0);
int StripMaxX1[4]={0,0,0,0};
int StripMaxX2[4]={0,0,0,0};
int StripMaxY[4] ={0,0,0,0};
double ChargeMaxX1[4]={0,0,0,0};
double ChargeMaxX2[4]={0,0,0,0};
double ChargeMaxY[4] ={0,0,0,0};
for(int i=0; i<m_NumberOfDetectors; i++){
Buffer_X1_Q.push_back(ChargeArray);
Buffer_X2_Q.push_back(ChargeArray);
Buffer_Y_Q.push_back(ChargeArray);
}
for (UShort_t e = 0; e < mysizeE ; e++) {
int det = m_PreTreatedData->GetDetectorNbr(e);
int plane = m_PreTreatedData->GetPlane(e);
int strip = m_PreTreatedData->GetPad(e);// starts at 0
double charge = m_PreTreatedData->GetCharge(e);
// Xup for MWPC2 and 3 and X for MWPC1 and 4
if(plane==1){
Buffer_X1_Q[det-1][strip] = charge;
if(charge>ChargeMaxX1[det-1]){
ChargeMaxX1[det-1] = charge;
StripMaxX1[det-1] = strip;
}
}
// Xdown for MWPC2 and 3 and nothing for MWPC1 and 4
else if(plane==2){
Buffer_X2_Q[det-1][strip] = charge;
if(charge>ChargeMaxX2[det-1]){
ChargeMaxX2[det-1] = charge;
StripMaxX2[det-1] = strip;
}
}
// Y for all MWPCx
if(plane==3){
Buffer_Y_Q[det-1][strip] = charge;
if(charge>ChargeMaxY[det-1]){
ChargeMaxY[det-1] = charge;
StripMaxY[det-1] = strip;
}
}
}
double X1 = -100;
double X2 = -100;
double Y = -100;
for(int i=0; i<m_NumberOfDetectors; i++){
double qleft = Buffer_X1_Q[i][StripMaxX1[i]-1];
double qright = Buffer_X1_Q[i][StripMaxX1[i]+1];
if(qleft>0 && qright>0){
X1 = GetPositionX(ChargeMaxX1[i], StripMaxX1[i], qleft, qright);
X1 = X1 - DetPosX[i];
}
qleft = Buffer_X2_Q[i][StripMaxX2[i]-1];
qright = Buffer_X2_Q[i][StripMaxX2[i]+1];
if(qleft>0 && qright>0){
X2 = GetPositionX(ChargeMaxX2[i], StripMaxX2[i], qleft, qright);
X2 = X2 - DetPosX[i];
}
double qdown = Buffer_Y_Q[i][StripMaxY[i]-1];
double qup = Buffer_Y_Q[i][StripMaxY[i]+1];
if(qdown>0 && qup>0){
Y = GetPositionY(ChargeMaxY[i], StripMaxY[i], qdown, qup);
Y = Y - DetPosY[i];
}
DetectorNbr.push_back(i+1);
PositionX1.push_back(X1);
PositionX2.push_back(X2);
PositionY.push_back(Y);
}
}
///////////////////////////////////////////////////////////////////////////
double TSofMwpcPhysics::GetPositionX(double qmax, int padmax, double qleft, double qright){
double fwx = 3.125;
double fSize = 200.0;
double a3 = TMath::Pi() * fwx / (TMath::ACosH(0.5 * (TMath::Sqrt(qmax / qleft) + TMath::Sqrt(qmax / qright))));
Double_t a2 = (a3 / TMath::Pi()) * TMath::ATanH((TMath::Sqrt(qmax / qleft) - TMath::Sqrt(qmax / qright)) /
(2 * TMath::SinH(TMath::Pi() * fwx / a3)));
return (-1. * padmax * fwx + (fSize / 2) - (fwx / 2) - a2); // Left is positive and right negative
}
///////////////////////////////////////////////////////////////////////////
double TSofMwpcPhysics::GetPositionY(double qmax, int padmax, double qdown, double qup){
double fwy = 3.125;
double fSize = 200.0;
double a3 = TMath::Pi() * fwy / (TMath::ACosH(0.5 * (TMath::Sqrt(qmax / qdown) + TMath::Sqrt(qmax / qup))));
Double_t a2 = (a3 / TMath::Pi()) * TMath::ATanH((TMath::Sqrt(qmax / qdown) - TMath::Sqrt(qmax / qup)) /
(2 * TMath::SinH(TMath::Pi() * fwy / a3)));
return (padmax * fwy - (fSize / 2) + (fwy / 2) + a2);
}
///////////////////////////////////////////////////////////////////////////
void TSofMwpcPhysics::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) {
m_PreTreatedData->SetDetectorNbr(m_EventData->GetDetectorNbr(i));
m_PreTreatedData->SetPlane(m_EventData->GetPlane(i));
m_PreTreatedData->SetPad(m_EventData->GetPad(i));
m_PreTreatedData->SetCharge(m_EventData->GetCharge(i));
}
}
///////////////////////////////////////////////////////////////////////////
void TSofMwpcPhysics::ReadAnalysisConfig() {
bool ReadingStatus = false;
// path to file
string FileName = "./configs/ConfigSofMwpc.dat";
// open analysis config file
ifstream AnalysisConfigFile;
AnalysisConfigFile.open(FileName.c_str());
if (!AnalysisConfigFile.is_open()) {
cout << " No ConfigSofMwpc.dat found: Default parameter loaded for Analayis " << FileName << endl;
return;
}
cout << " Loading user parameter for Analysis from ConfigSofMwpc.dat " << endl;
// Save it in a TAsciiFile
TAsciiFile* asciiConfig = RootOutput::getInstance()->GetAsciiFileAnalysisConfig();
asciiConfig->AppendLine("%%% ConfigSofMwpc.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 = "ConfigSofMwpc";
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 TSofMwpcPhysics::Clear() {
DetectorNbr.clear();
PositionX1.clear();
PositionX2.clear();
PositionY.clear();
Buffer_X1_Q.clear();
Buffer_X2_Q.clear();
Buffer_Y_Q.clear();
}
///////////////////////////////////////////////////////////////////////////
void TSofMwpcPhysics::ReadConfiguration(NPL::InputParser parser) {
vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("SofMwpc");
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 << "//// SofMwpc " << i+1 << endl;
TVector3 Pos = blocks[i]->GetTVector3("POS","mm");
AddDetector(Pos);
}
else if(blocks[i]->HasTokenList(sphe)){
if(NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// SofMwpc " << 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 TSofMwpcPhysics::AddParameterToCalibrationManager() {
CalibrationManager* Cal = CalibrationManager::getInstance();
for(int sec = 0; sec < m_NumberOfDetectors; sec++){
Cal->AddParameter("SofMwpc","SEC"+NPL::itoa(sec+1)+"_ALIGN","SofMwpc_SEC"+NPL::itoa(sec+1)+"_ALIGN");
}
}
///////////////////////////////////////////////////////////////////////////
void TSofMwpcPhysics::InitializeRootInputRaw() {
TChain* inputChain = RootInput::getInstance()->GetChain();
inputChain->SetBranchStatus("SofMwpc", true );
inputChain->SetBranchAddress("SofMwpc", &m_EventData );
}
///////////////////////////////////////////////////////////////////////////
void TSofMwpcPhysics::InitializeRootInputPhysics() {
TChain* inputChain = RootInput::getInstance()->GetChain();
inputChain->SetBranchAddress("SofMwpc", &m_EventPhysics);
}
///////////////////////////////////////////////////////////////////////////
void TSofMwpcPhysics::InitializeRootOutput() {
TTree* outputTree = RootOutput::getInstance()->GetTree();
outputTree->Branch("SofMwpc", "TSofMwpcPhysics", &m_EventPhysics);
}
////////////////////////////////////////////////////////////////////////////////
// Construct Method to be pass to the DetectorFactory //
////////////////////////////////////////////////////////////////////////////////
NPL::VDetector* TSofMwpcPhysics::Construct() {
return (NPL::VDetector*) new TSofMwpcPhysics();
}
////////////////////////////////////////////////////////////////////////////////
// Registering the construct method to the factory //
////////////////////////////////////////////////////////////////////////////////
extern "C"{
class proxy_SofMwpc{
public:
proxy_SofMwpc(){
NPL::DetectorFactory::getInstance()->AddToken("SofMwpc","SofMwpc");
NPL::DetectorFactory::getInstance()->AddDetector("SofMwpc",TSofMwpcPhysics::Construct);
}
};
proxy_SofMwpc p_SofMwpc;
}
#ifndef TSofMwpcPHYSICS_H
#define TSofMwpcPHYSICS_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 SofMwpc Treated data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
// C++ headers
#include <vector>
#include <map>
#include <string>