Commit 5fc100f7 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 87aa82fb 737addac
Pipeline #122624 passed with stages
in 7 minutes and 12 seconds
add_custom_command(OUTPUT TPISTAPhysicsDict.cxx COMMAND ../../scripts/build_dict.sh TPISTAPhysics.h TPISTAPhysicsDict.cxx TPISTAPhysics.rootmap libNPPISTA.dylib DEPENDS TPISTAPhysics.h)
add_custom_command(OUTPUT TPISTADataDict.cxx COMMAND ../../scripts/build_dict.sh TPISTAData.h TPISTADataDict.cxx TPISTAData.rootmap libNPPISTA.dylib DEPENDS TPISTAData.h)
add_library(NPPISTA SHARED TPISTASpectra.cxx TPISTAData.cxx TPISTAPhysics.cxx TPISTADataDict.cxx TPISTAPhysicsDict.cxx )
target_link_libraries(NPPISTA ${ROOT_LIBRARIES} NPCore)
install(FILES TPISTAData.h TPISTAPhysics.h TPISTASpectra.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
......
add_custom_command(OUTPUT TSofiaPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofiaPhysics.h TSofiaPhysicsDict.cxx TSofiaPhysics.rootmap libNPSofia.dylib DEPENDS TSofiaPhysics.h)
add_custom_command(OUTPUT TSofiaDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofiaData.h TSofiaDataDict.cxx TSofiaData.rootmap libNPSofia.dylib DEPENDS TSofiaData.h)
add_library(NPSofia SHARED TSofiaSpectra.cxx TSofiaData.cxx TSofiaPhysics.cxx TSofiaDataDict.cxx TSofiaPhysicsDict.cxx )
target_link_libraries(NPSofia ${ROOT_LIBRARIES} NPCore)
install(FILES TSofiaData.h TSofiaPhysics.h TSofiaSpectra.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
add_custom_command(OUTPUT TSofSciDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofSciData.h TSofSciDataDict.cxx TSofSciData.rootmap libNPSofia.dylib DEPENDS TSofSciData.h)
add_custom_command(OUTPUT TSofTofWDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTofWData.h TSofTofWDataDict.cxx TSofTofWData.rootmap libNPSofia.dylib DEPENDS TSofTofWData.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 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 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 TSofTwimDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTwimData.h TSofTwimDataDict.cxx TSofTwimData.rootmap libNPSofia.dylib DEPENDS TSofTwimData.h)
add_library(NPSofia SHARED TSofSciData.cxx TSofSciDataDict.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)
target_link_libraries(NPSofia ${ROOT_LIBRARIES} NPCore NPPhysics)
install(FILES TSofSciData.h TSofMwpcData.h TSofAtData.h TSofTrimData.h TSofTrimPhysics.h TSofTwimData.h TSofTofWData.h TSofTofWPhysics.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
#ifndef TSofiaSPECTRA_H
#define TSofiaSPECTRA_H
/*****************************************************************************
* Copyright (C) 2009-2020 this file is part of the NPTool Project *
* *
......@@ -9,54 +7,58 @@
/*****************************************************************************
* Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr *
* *
* Creation Date : November 2020 *
* Creation Date : May 2021 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold Sofia Spectra *
* This class hold SofAt Raw data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "TSofAtData.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
ClassImp(TSofAtData)
//////////////////////////////////////////////////////////////////////
TSofAtData::TSofAtData() {
}
//////////////////////////////////////////////////////////////////////
TSofAtData::~TSofAtData() {
}
//////////////////////////////////////////////////////////////////////
void TSofAtData::Clear() {
fAT_AnodeNbr.clear();
fAT_Energy.clear();
fAT_Time.clear();
fAT_PileUp.clear();
fAT_Overflow.clear();
}
//////////////////////////////////////////////////////////////////////
void TSofAtData::Dump() const {
// This method is very useful for debuging and worth the dev.
cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TSofAtData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
// NPLib headers
#include "NPVSpectra.h"
#include "TSofiaData.h"
#include "TSofiaPhysics.h"
// Forward Declaration
class TSofiaPhysics;
class TSofiaSpectra : public VSpectra {
//////////////////////////////////////////////////////////////
// constructor and destructor
public:
TSofiaSpectra();
TSofiaSpectra(unsigned int NumberOfDetectors);
~TSofiaSpectra();
//////////////////////////////////////////////////////////////
// Initialization methods
private:
void InitRawSpectra();
void InitPreTreatedSpectra();
void InitPhysicsSpectra();
//////////////////////////////////////////////////////////////
// Filling methods
public:
void FillRawSpectra(TSofiaData*);
void FillPreTreatedSpectra(TSofiaData*);
void FillPhysicsSpectra(TSofiaPhysics*);
//////////////////////////////////////////////////////////////
// Detector parameters
private:
unsigned int fNumberOfDetectors;
};
#endif
// Energy
size_t mysize = fAT_AnodeNbr.size();
cout << "AT_Mult: " << GetMultiplicity() << endl;
}
#ifndef __SofiaDATA__
#define __SofiaDATA__
#ifndef __SofAtDATA__
#define __SofAtDATA__
/*****************************************************************************
* Copyright (C) 2009-2020 this file is part of the NPTool Project *
* *
......@@ -10,11 +10,11 @@
/*****************************************************************************
* Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr *
* *
* Creation Date : November 2020 *
* Creation Date : May 2021 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold Sofia Raw data *
* This class hold SofAt Raw data *
* *
*---------------------------------------------------------------------------*
* Comment: *
......@@ -29,32 +29,22 @@ using namespace std;
// ROOT
#include "TObject.h"
class TSofiaData : public TObject {
class TSofAtData : public TObject {
//////////////////////////////////////////////////////////////
// data members are hold into vectors in order
// to allow multiplicity treatment
private:
// TOF //
vector<int> fTOF_DetectorNbr;
vector<int> fTOF_PlasticNbr;
vector<double> fTOF_Energy;
vector<double> fTOF_Time;
// TWIN MUSIC //
vector<int> fTWIN_SectorNbr;
vector<int> fTWIN_AnodeNbr;
vector<double> fTWIN_AnodeEnergy;
vector<double> fTWIN_AnodeTime;
double fTWIN_Esum1;
double fTWIN_Esum2;
double fTWIN_Esum3;
double fTWIN_Esum4;
vector<int> fAT_AnodeNbr;
vector<double> fAT_Energy;
vector<double> fAT_Time;
vector<bool> fAT_PileUp;
vector<bool> fAT_Overflow;
//////////////////////////////////////////////////////////////
// Constructor and destructor
public:
TSofiaData();
~TSofiaData();
TSofAtData();
~TSofAtData();
//////////////////////////////////////////////////////////////
......@@ -72,44 +62,23 @@ class TSofiaData : public TObject {
// add //! to avoid ROOT creating dictionnary for the methods
public:
////////////////////// SETTERS ////////////////////////
// TOF
inline void SetDetectorNbr(int det){fTOF_DetectorNbr.push_back(det);};//!
inline void SetPlasticNbr(int plastic){fTOF_PlasticNbr.push_back(plastic);};//!
inline void SetEnergy(double Energy){fTOF_Energy.push_back(Energy);};//!
inline void SetTime(double Time){fTOF_Time.push_back(Time);};//!
// TWIN
inline void SetTwinSectorNbr(int Sector){fTWIN_SectorNbr.push_back(Sector);};//!
inline void SetTwinAnodeNbr(int Anode){fTWIN_AnodeNbr.push_back(Anode);};//!
inline void SetTwinAnodeEnergy(double Energy){fTWIN_AnodeEnergy.push_back(Energy);};//!
inline void SetTwinAnodeTime(double Time){fTWIN_AnodeTime.push_back(Time);};//!
inline void SetTwinEsum1(double E){fTWIN_Esum1=E;};//!
inline void SetTwinEsum2(double E){fTWIN_Esum2=E;};//!
inline void SetTwinEsum3(double E){fTWIN_Esum3=E;};//!
inline void SetTwinEsum4(double E){fTWIN_Esum4=E;};//!
inline void SetAnodeNbr(int det){fAT_AnodeNbr.push_back(det);};//!
inline void SetEnergy(double Energy){fAT_Energy.push_back(Energy);};//!
inline void SetTime(double Time){fAT_Time.push_back(Time);};//!
inline void SetPileUp(bool ispileup){fAT_PileUp.push_back(ispileup);};//!
inline void SetOverflow(bool isoverflow){fAT_Overflow.push_back(isoverflow);};//!
////////////////////// GETTERS ////////////////////////
// TOF
inline int GetMultiplicity() const {return fTOF_PlasticNbr.size();}//!
inline int GetDetectorNbr(const unsigned int &i) const {return fTOF_DetectorNbr[i];}//!
inline int GetPlasticNbr(const unsigned int &i) const {return fTOF_PlasticNbr[i];}//!
inline double GetEnergy(const unsigned int &i) const {return fTOF_Energy[i];}//!
inline double GetTime(const unsigned int &i) const {return fTOF_Time[i];}//!
// TWIN
inline int GetTwinMult() const {return fTWIN_AnodeNbr.size();}//!
inline int GetTwinSectorNbr(const unsigned int &i) const {return fTWIN_SectorNbr[i];}//!
inline int GetTwinAnodeNbr(const unsigned int &i) const {return fTWIN_AnodeNbr[i];}//!
inline double GetTwinAnodeEnergy(const unsigned int &i) const {return fTWIN_AnodeEnergy[i];}//!
inline double GetTwinAnodeTime(const unsigned int &i) const {return fTWIN_AnodeTime[i];}//!
inline double GetTwinEsum1() const {return fTWIN_Esum1;}//!
inline double GetTwinEsum2() const {return fTWIN_Esum2;}//!
inline double GetTwinEsum3() const {return fTWIN_Esum3;}//!
inline double GetTwinEsum4() const {return fTWIN_Esum4;}//!
inline int GetMultiplicity() const {return fAT_AnodeNbr.size();}//!
inline int GetAnodeNbr(const unsigned int &i) const {return fAT_AnodeNbr[i];}//!
inline double GetEnergy(const unsigned int &i) const {return fAT_Energy[i];}//!
inline double GetTime(const unsigned int &i) const {return fAT_Time[i];}//!
inline bool GetPileUp(const unsigned int &i) const {return fAT_PileUp[i];}//!
inline bool GetOverflow(const unsigned int &i) const {return fAT_Overflow[i];}//!
//////////////////////////////////////////////////////////////
// Required for ROOT dictionnary
ClassDef(TSofiaData,1) // SofiaData structure
ClassDef(TSofAtData,1) // SofAtData structure
};
#endif
......@@ -7,150 +7,57 @@
/*****************************************************************************
* Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr *
* *
* Creation Date : November 2020 *
* Creation Date : May 2021 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold Sofia Spectra *
* This class hold SofMwpc Raw data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "TSofMwpcData.h"
// class header
#include "TSofiaSpectra.h"
// STL
#include <iostream>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
// NPTool header
#include "NPOptionManager.h"
////////////////////////////////////////////////////////////////////////////////
TSofiaSpectra::TSofiaSpectra()
: fNumberOfDetectors(0) {
SetName("Sofia");
}
using namespace std;
ClassImp(TSofMwpcData)
////////////////////////////////////////////////////////////////////////////////
TSofiaSpectra::TSofiaSpectra(unsigned int NumberOfDetectors) {
if(NPOptionManager::getInstance()->GetVerboseLevel()>0)
cout << "************************************************" << endl
<< "TSofiaSpectra : Initalizing control spectra for "
<< NumberOfDetectors << " Detectors" << endl
<< "************************************************" << endl ;
SetName("Sofia");
fNumberOfDetectors = NumberOfDetectors;
InitRawSpectra();
InitPreTreatedSpectra();
InitPhysicsSpectra();
//////////////////////////////////////////////////////////////////////
TSofMwpcData::TSofMwpcData() {
}
////////////////////////////////////////////////////////////////////////////////
TSofiaSpectra::~TSofiaSpectra() {
//////////////////////////////////////////////////////////////////////
TSofMwpcData::~TSofMwpcData() {
}
////////////////////////////////////////////////////////////////////////////////
void TSofiaSpectra::InitRawSpectra() {
static string name;
for (unsigned int i = 0; i < fNumberOfDetectors; i++) { // loop on number of detectors
// Energy
name = "Sofia"+NPL::itoa(i+1)+"_ENERGY_RAW";
AddHisto1D(name, name, 4096, 0, 16384, "Sofia/RAW");
// Time
name = "Sofia"+NPL::itoa(i+1)+"_TIME_RAW";
AddHisto1D(name, name, 4096, 0, 16384, "Sofia/RAW");
} // end loop on number of detectors
//////////////////////////////////////////////////////////////////////
void TSofMwpcData::Clear() {
fMwpc_DetNbr.clear();
fMwpc_Plane.clear();
fMwpc_Pad.clear();
fMwpc_Charge.clear();
}
////////////////////////////////////////////////////////////////////////////////
void TSofiaSpectra::InitPreTreatedSpectra() {
static string name;
for (unsigned int i = 0; i < fNumberOfDetectors; i++) { // loop on number of detectors
// Energy
name = "Sofia"+NPL::itoa(i+1)+"_ENERGY_CAL";
AddHisto1D(name, name, 500, 0, 25, "Sofia/CAL");
// Time
name = "Sofia"+NPL::itoa(i+1)+"_TIME_CAL";
AddHisto1D(name, name, 500, 0, 25, "Sofia/CAL");
//////////////////////////////////////////////////////////////////////
void TSofMwpcData::Dump() const {
// This method is very useful for debuging and worth the dev.
cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TSofMwpcData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
} // end loop on number of detectors
// Energy
size_t mysize = fMwpc_Charge.size();
cout << "MWPC_Mult: " << GetMultiplicity() << endl;
}
////////////////////////////////////////////////////////////////////////////////
void TSofiaSpectra::InitPhysicsSpectra() {
static string name;
// Kinematic Plot
name = "Sofia_ENERGY_TIME";
AddHisto2D(name, name, 500, 0, 500, 500, 0, 50, "Sofia/PHY");
}
////////////////////////////////////////////////////////////////////////////////
void TSofiaSpectra::FillRawSpectra(TSofiaData* RawData) {
static string name;
static string family;
// Energy
unsigned int sizeE = RawData->GetMultiplicity();
for (unsigned int i = 0; i < sizeE; i++) {
name = "Sofia"+NPL::itoa(RawData->GetPlasticNbr(i))+"_ENERGY_RAW";
family = "Sofia/RAW";
FillSpectra(family,name,RawData->GetEnergy(i));
}
}
////////////////////////////////////////////////////////////////////////////////
void TSofiaSpectra::FillPreTreatedSpectra(TSofiaData* PreTreatedData) {
static string name;
static string family;
// Energy
unsigned int sizeE = PreTreatedData->GetMultiplicity();
for (unsigned int i = 0; i < sizeE; i++) {
name = "Sofia"+NPL::itoa(PreTreatedData->GetPlasticNbr(i))+"_ENERGY_CAL";
family = "Sofia/CAL";
FillSpectra(family,name,PreTreatedData->GetEnergy(i));
}
}
////////////////////////////////////////////////////////////////////////////////
void TSofiaSpectra::FillPhysicsSpectra(TSofiaPhysics* Physics) {
static string name;
static string family;
family= "Sofia/PHY";
// Energy vs time
unsigned int sizeE = Physics->Energy.size();
for(unsigned int i = 0 ; i < sizeE ; i++){
name = "Sofia_ENERGY_TIME";
FillSpectra(family,name,Physics->Energy[i],Physics->Time[i]);
}
}
#ifndef __SofMwpcDATA__
#define __SofMwpcDATA__
/*****************************************************************************
* 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 : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold SofMwpc Raw data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
// STL
#include <vector>
using namespace std;
// ROOT
#include "TObject.h"
class TSofMwpcData : public TObject {
//////////////////////////////////////////////////////////////
// data members are hold into vectors in order
// to allow multiplicity treatment
private:
vector<int> fMwpc_DetNbr;
vector<int> fMwpc_Plane;
vector<int> fMwpc_Pad;
vector<int> fMwpc_Charge;
//////////////////////////////////////////////////////////////
// Constructor and destructor
public:
TSofMwpcData();
~TSofMwpcData();
//////////////////////////////////////////////////////////////
// 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 ////////////////////////
inline void SetDetectorNbr(int det){fMwpc_DetNbr.push_back(det);};//!
inline void SetPlane(int p){fMwpc_Plane.push_back(p);};//!
inline void SetPad(int p){fMwpc_Pad.push_back(p);};//!
inline void SetCharge(int q){fMwpc_Charge.push_back(q);};//!
////////////////////// GETTERS ////////////////////////
inline int GetMultiplicity() const {return fMwpc_DetNbr.size();}//!
inline int GetDetectorNbr(const unsigned int &i) const {return fMwpc_DetNbr[i];}//!
inline int GetPlane(const unsigned int &i) const {return fMwpc_Plane[i];}//!
inline int GetPad(const unsigned int &i) const {return fMwpc_Pad[i];}//!
inline int GetCharge(const unsigned int &i) const {return fMwpc_Charge[i];}//!
//////////////////////////////////////////////////////////////
// Required for ROOT dictionnary
ClassDef(TSofMwpcData,1) // SofMwpcData 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 : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold SofSci Raw data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "TSofSciData.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
ClassImp(TSofSciData)
//////////////////////////////////////////////////////////////////////
TSofSciData::TSofSciData() {
}
//////////////////////////////////////////////////////////////////////
TSofSciData::~TSofSciData() {
}
//////////////////////////////////////////////////////////////////////
void TSofSciData::Clear() {
fSofSci_DetNbr.clear();
fSofSci_Pmt.clear();
fSofSci_CT.clear();
fSofSci_FT.clear();
}
//////////////////////////////////////////////////////////////////////
void TSofSciData::Dump() const {
// This method is very useful for debuging and worth the dev.
cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TSofSciData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
// Energy
size_t mysize = fSofSci_DetNbr.size();
cout << "SofSci_Mult: " << GetMultiplicity() << endl;
}
#ifndef __SofSciDATA__
#define __SofSciDATA__
/*****************************************************************************
* 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 : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold SofSci Raw data *
* *