Skip to content
Snippets Groups Projects
Commit 9fc7f71c authored by Adrien Matta's avatar Adrien Matta :skull_crossbones:
Browse files

* updating nebula data class

parent 565079cc
No related branches found
No related tags found
No related merge requests found
Pipeline #114254 failed
...@@ -45,19 +45,30 @@ TNebulaData::~TNebulaData() { ...@@ -45,19 +45,30 @@ TNebulaData::~TNebulaData() {
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void TNebulaData::Clear() { void TNebulaData::Clear() {
// Energy // UP //
fNebula_E_DetectorNbr.clear(); // Charge
fNebula_Energy.clear(); fNebula_Qu_ID.clear();
// Time fNebula_Qu_Charge.clear();
fNebula_T_DetectorNbr.clear();
fNebula_Time.clear(); // Time
fNebula_Tu_ID.clear();
fNebula_Tu_Time.clear();
// DOWN //
// Charge
fNebula_Qd_ID.clear();
fNebula_Qd_Charge.clear();
// Time
fNebula_Td_ID.clear();
fNebula_Td_Time.clear();
} }
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void TNebulaData::Dump() const { void TNebulaData::Dump() const {
// This method is very useful for debuging and worth the dev. /* // This method is very useful for debuging and worth the dev.
cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TNebulaData::Dump()] XXXXXXXXXXXXXXXXX" << endl; cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TNebulaData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
// Energy // Energy
...@@ -77,4 +88,5 @@ void TNebulaData::Dump() const { ...@@ -77,4 +88,5 @@ void TNebulaData::Dump() const {
cout << "DetNbr: " << fNebula_T_DetectorNbr[i] cout << "DetNbr: " << fNebula_T_DetectorNbr[i]
<< " Time: " << fNebula_Time[i]; << " Time: " << fNebula_Time[i];
} }
*/
} }
...@@ -34,14 +34,24 @@ class TNebulaData : public TObject { ...@@ -34,14 +34,24 @@ class TNebulaData : public TObject {
// data members are hold into vectors in order // data members are hold into vectors in order
// to allow multiplicity treatment // to allow multiplicity treatment
private: private:
// Energy // UP //
vector<UShort_t> fNebula_E_DetectorNbr; // Charge
vector<Double_t> fNebula_Energy; vector<UShort_t> fNebula_Qu_ID;
vector<Double_t> fNebula_Qu_Charge;
// Time // Time
vector<UShort_t> fNebula_T_DetectorNbr; vector<UShort_t> fNebula_Tu_ID;
vector<Double_t> fNebula_Time; vector<Double_t> fNebula_Tu_Time;
// DOWN //
// Charge
vector<UShort_t> fNebula_Qd_ID;
vector<Double_t> fNebula_Qd_Charge;
// Time
vector<UShort_t> fNebula_Td_ID;
vector<Double_t> fNebula_Td_Time;
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructor and destructor // Constructor and destructor
...@@ -65,19 +75,32 @@ class TNebulaData : public TObject { ...@@ -65,19 +75,32 @@ class TNebulaData : public TObject {
// add //! to avoid ROOT creating dictionnary for the methods // add //! to avoid ROOT creating dictionnary for the methods
public: public:
////////////////////// SETTERS //////////////////////// ////////////////////// SETTERS ////////////////////////
// Energy // UP //
inline void SetEnergy(const UShort_t& DetNbr,const Double_t& Energy){ // Charge
fNebula_E_DetectorNbr.push_back(DetNbr); inline void SetChargeUp(const Double_t& ID, const Double_t& Charge){
fNebula_Energy.push_back(Energy); fNebula_Qu_ID.push_back(ID);
fNebula_Qu_Charge.push_back(Charge);
};//! };//!
// Time // Time
inline void SetTime(const UShort_t& DetNbr,const Double_t& Time) { inline void SetTimeUp(const Double_t& ID, const Double_t& Time){
fNebula_T_DetectorNbr.push_back(DetNbr); fNebula_Tu_ID.push_back(ID);
fNebula_Time.push_back(Time); fNebula_Tu_Time.push_back(Time);
};//! };//!
// DOWN //
// Charge
inline void SetChargeDown(const Double_t& ID, const Double_t& Charge){
fNebula_Qd_ID.push_back(ID);
fNebula_Qd_Charge.push_back(Charge);
};//!
// Time
inline void SetTimeDown(const Double_t& ID, const Double_t& Time){
fNebula_Td_ID.push_back(ID);
fNebula_Td_Time.push_back(Time);
};//!
/*
////////////////////// GETTERS //////////////////////// ////////////////////// GETTERS ////////////////////////
// Energy // Energy
inline UShort_t GetMultEnergy() const inline UShort_t GetMultEnergy() const
...@@ -94,7 +117,7 @@ class TNebulaData : public TObject { ...@@ -94,7 +117,7 @@ class TNebulaData : public TObject {
{return fNebula_T_DetectorNbr[i];}//! {return fNebula_T_DetectorNbr[i];}//!
inline Double_t Get_Time(const unsigned int &i) const inline Double_t Get_Time(const unsigned int &i) const
{return fNebula_Time[i];}//! {return fNebula_Time[i];}//!
*/
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Required for ROOT dictionnary // Required for ROOT dictionnary
......
...@@ -81,7 +81,7 @@ void TNebulaPhysics::BuildSimplePhysicalEvent() { ...@@ -81,7 +81,7 @@ void TNebulaPhysics::BuildSimplePhysicalEvent() {
void TNebulaPhysics::BuildPhysicalEvent() { void TNebulaPhysics::BuildPhysicalEvent() {
// apply thresholds and calibration // apply thresholds and calibration
PreTreat(); PreTreat();
/*
// match energy and time together // match energy and time together
unsigned int mysizeE = m_PreTreatedData->GetMultEnergy(); unsigned int mysizeE = m_PreTreatedData->GetMultEnergy();
unsigned int mysizeT = m_PreTreatedData->GetMultTime(); unsigned int mysizeT = m_PreTreatedData->GetMultTime();
...@@ -93,7 +93,7 @@ void TNebulaPhysics::BuildPhysicalEvent() { ...@@ -93,7 +93,7 @@ void TNebulaPhysics::BuildPhysicalEvent() {
Time.push_back(m_PreTreatedData->Get_Time(t)); Time.push_back(m_PreTreatedData->Get_Time(t));
} }
} }
} }*/
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -106,7 +106,7 @@ void TNebulaPhysics::PreTreat() { ...@@ -106,7 +106,7 @@ void TNebulaPhysics::PreTreat() {
// instantiate CalibrationManager // instantiate CalibrationManager
static CalibrationManager* Cal = CalibrationManager::getInstance(); static CalibrationManager* Cal = CalibrationManager::getInstance();
/*
// Energy // Energy
unsigned int mysize = m_EventData->GetMultEnergy(); unsigned int mysize = m_EventData->GetMultEnergy();
for (UShort_t i = 0; i < mysize ; ++i) { for (UShort_t i = 0; i < mysize ; ++i) {
...@@ -124,6 +124,7 @@ void TNebulaPhysics::PreTreat() { ...@@ -124,6 +124,7 @@ void TNebulaPhysics::PreTreat() {
Double_t Time= Cal->ApplyCalibration("Nebula/TIME"+NPL::itoa(m_EventData->GetT_DetectorNbr(i)),m_EventData->Get_Time(i)); Double_t Time= Cal->ApplyCalibration("Nebula/TIME"+NPL::itoa(m_EventData->GetT_DetectorNbr(i)),m_EventData->Get_Time(i));
m_PreTreatedData->SetTime(m_EventData->GetT_DetectorNbr(i), Time); m_PreTreatedData->SetTime(m_EventData->GetT_DetectorNbr(i), Time);
} }
*/
} }
...@@ -334,8 +335,8 @@ extern "C"{ ...@@ -334,8 +335,8 @@ extern "C"{
class proxy_Nebula{ class proxy_Nebula{
public: public:
proxy_Nebula(){ proxy_Nebula(){
NPL::DetectorFactory::getInstance()->AddToken("Nebula","Nebula"); NPL::DetectorFactory::getInstance()->AddToken("NEBULA","Nebula");
NPL::DetectorFactory::getInstance()->AddDetector("Nebula",TNebulaPhysics::Construct); NPL::DetectorFactory::getInstance()->AddDetector("NEBULA",TNebulaPhysics::Construct);
} }
}; };
......
/***************************************************************************** /*****************************************************************************
* Copyright (C) 2009-2019 this file is part of the NPTool Project * * Copyright (C) 2009-2019 this file is part of the NPTool Project *
* * * *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence * * For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors * * For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/ *****************************************************************************/
/***************************************************************************** /*****************************************************************************
* Original Author: Adrien Matta contact address: matta@lpccaen.in2p3.fr * * Original Author: Adrien Matta contact address: matta@lpccaen.in2p3.fr *
* * * *
* Creation Date : December 2019 * * Creation Date : December 2019 *
* Last update : * * Last update : *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Decription: * * Decription: *
* This class hold Nebula Spectra * * This class hold Nebula Spectra *
* * * *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Comment: * * Comment: *
...@@ -108,7 +108,7 @@ void TNebulaSpectra::InitPhysicsSpectra() { ...@@ -108,7 +108,7 @@ void TNebulaSpectra::InitPhysicsSpectra() {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void TNebulaSpectra::FillRawSpectra(TNebulaData* RawData) { void TNebulaSpectra::FillRawSpectra(TNebulaData* RawData) {
static string name; /* static string name;
static string family; static string family;
// Energy // Energy
...@@ -127,14 +127,14 @@ void TNebulaSpectra::FillRawSpectra(TNebulaData* RawData) { ...@@ -127,14 +127,14 @@ void TNebulaSpectra::FillRawSpectra(TNebulaData* RawData) {
family = "Nebula/RAW"; family = "Nebula/RAW";
FillSpectra(family,name,RawData->Get_Time(i)); FillSpectra(family,name,RawData->Get_Time(i));
} }*/
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void TNebulaSpectra::FillPreTreatedSpectra(TNebulaData* PreTreatedData) { void TNebulaSpectra::FillPreTreatedSpectra(TNebulaData* PreTreatedData) {
static string name; /* static string name;
static string family; static string family;
// Energy // Energy
...@@ -153,14 +153,14 @@ void TNebulaSpectra::FillPreTreatedSpectra(TNebulaData* PreTreatedData) { ...@@ -153,14 +153,14 @@ void TNebulaSpectra::FillPreTreatedSpectra(TNebulaData* PreTreatedData) {
family = "Nebula/CAL"; family = "Nebula/CAL";
FillSpectra(family,name,PreTreatedData->Get_Time(i)); FillSpectra(family,name,PreTreatedData->Get_Time(i));
} }*/
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void TNebulaSpectra::FillPhysicsSpectra(TNebulaPhysics* Physics) { void TNebulaSpectra::FillPhysicsSpectra(TNebulaPhysics* Physics) {
static string name; /* static string name;
static string family; static string family;
family= "Nebula/PHY"; family= "Nebula/PHY";
...@@ -169,6 +169,6 @@ void TNebulaSpectra::FillPhysicsSpectra(TNebulaPhysics* Physics) { ...@@ -169,6 +169,6 @@ void TNebulaSpectra::FillPhysicsSpectra(TNebulaPhysics* Physics) {
for(unsigned int i = 0 ; i < sizeE ; i++){ for(unsigned int i = 0 ; i < sizeE ; i++){
name = "Nebula_ENERGY_TIME"; name = "Nebula_ENERGY_TIME";
FillSpectra(family,name,Physics->Energy[i],Physics->Time[i]); FillSpectra(family,name,Physics->Energy[i],Physics->Time[i]);
} }*/
} }
...@@ -126,6 +126,11 @@ namespace NPL{ ...@@ -126,6 +126,11 @@ namespace NPL{
Particle* GetParticle2() {return &fParticle2;} Particle* GetParticle2() {return &fParticle2;}
Particle* GetParticle3() {return &fParticle3;} Particle* GetParticle3() {return &fParticle3;}
Particle* GetParticle4() {return &fParticle4;} Particle* GetParticle4() {return &fParticle4;}
Particle* GetNucleus1() {return GetParticle1();}
Particle* GetNucleus2() {return GetParticle2();}
Particle* GetNucleus3() {return GetParticle3();}
Particle* GetNucleus4() {return GetParticle4();}
TH1F* GetCrossSectionHist() const {return fCrossSectionHist;} TH1F* GetCrossSectionHist() const {return fCrossSectionHist;}
int GetVerboseLevel() const {return fVerboseLevel;} int GetVerboseLevel() const {return fVerboseLevel;}
bool GetShoot3() const {return fshoot3;} bool GetShoot3() const {return fshoot3;}
......
...@@ -51,8 +51,8 @@ void NPToolLogon(){ ...@@ -51,8 +51,8 @@ void NPToolLogon(){
// Create the NPTool Stype // Create the NPTool Stype
std::string NPLPath = gSystem->Getenv("NPTOOL"); std::string NPLPath = gSystem->Getenv("NPTOOL");
gROOT->ProcessLine(Form(".x %s/NPLib/scripts/Style_nptool.C+",NPLPath.c_str())); gROOT->ProcessLine(Form(".x %s/NPLib/scripts/Style_nptool.C",NPLPath.c_str()));
gROOT->ProcessLine(Form(".x %s/NPLib/scripts/Style_nponline.C+",NPLPath.c_str())); gROOT->ProcessLine(Form(".x %s/NPLib/scripts/Style_nponline.C",NPLPath.c_str()));
// Change the standard random generator to TRandom2 // Change the standard random generator to TRandom2
//gRandom = new TRandom2(); //gRandom = new TRandom2();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment