Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/MDEEStripHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ struct MDEEStripHit
unsigned int m_TAC;
//! The calibrated timing in ns
double m_Timing;
//! The drift time in ns since creation of event
double m_DriftTime;
Comment on lines +91 to +92

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the name m_DriftTime might not be correct.
It is essentially the time between the creation of the electron-hole pairs until the fast shaper on a non-charge-sharing main strip would peak, minus some offset accounting for the delay in peaking...
For non-charge-sharing main strips, this value should correspond to the drift time, but it's not the case for charge-sharing strips or nearest neighbors. Suggestions welcome ^^

//! The measured temperature value
double m_Temperature;

Expand Down
28 changes: 11 additions & 17 deletions include/MModuleDEESMEX.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// MEGAlib libs:
#include "MGlobal.h"

// Nuclearizer libs
// Nuclearizer libs:
#include "MModule.h"
#include "MSubModuleDEEIntake.h"
#include "MSubModuleRandomCoincidence.h"
Expand Down Expand Up @@ -105,26 +105,14 @@ class MModuleDEESMEX : public MModule
}

//! Set depth coefficients file name
void SetDepthCoefficientsFileName(const MString& FileName)
{
m_DepthReadout.SetDepthCoefficientsFileName(FileName);
}
void SetDepthCoefficientsFileName(const MString& FileName) { m_DepthCoefficientsFileName = FileName; }
//! Get depth coefficients file name
MString GetDepthCoefficientsFileName() const
{
return m_DepthReadout.GetDepthCoefficientsFileName();
}
MString GetDepthCoefficientsFileName() const { return m_DepthCoefficientsFileName; }

//! Set depth splines file name
void SetDepthSplinesFileName(const MString& FileName)
{
m_DepthReadout.SetDepthSplinesFileName(FileName);
}
void SetDepthSplinesFileName(const MString& FileName) { m_DepthSplinesFileName = FileName; }
//! Get depth splines file name
MString GetDepthSplinesFileName() const
{
return m_DepthReadout.GetDepthSplinesFileName();
}
MString GetDepthSplinesFileName() const { return m_DepthSplinesFileName;}

//! Set TAC calibration file name
void SetTACCalFileName(const MString& FileName)
Expand Down Expand Up @@ -223,6 +211,12 @@ class MModuleDEESMEX : public MModule
//! The sub module handling the output of the DEE in to the standard nuclearizer classes
MSubModuleDEEOutput m_Output;

//! The file name of the simulated CTD and drift time splines
MString m_DepthSplinesFileName;

//! The file name of the depth-calibration coefficients
MString m_DepthCoefficientsFileName;

//! Option to add noise to the strip energies
bool m_ApplyResolutionCalibration;
//! Option to enable shield veto effects
Expand Down
30 changes: 30 additions & 0 deletions include/MSubModuleChargeTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// Standard libs:

// ROOT libs:
#include "TSpline.h"

// MEGAlib libs:
#include "MGlobal.h"
Expand Down Expand Up @@ -48,6 +49,15 @@ class MSubModuleChargeTransport : public MSubModule
//! No move operators
MSubModuleChargeTransport& operator=(MSubModuleChargeTransport&&) = delete;

//! Set filename for CTD->Depth splines
void SetDepthSplinesFileName( const MString& FileName) { m_DepthSplinesFileName = FileName; }
//! Get filename for CTD->Depth splines
MString GetDepthSplinesFileName() const {return m_DepthSplinesFileName; }
//! Set filename for coefficients file
void SetDepthCoefficientsFileName( const MString& FileName) { m_DepthCoefficientsFileName = FileName; }
//! Get filename for coefficients file
MString GetDepthCoefficientsFileName() const { return m_DepthCoefficientsFileName; }

//! Default destructor
virtual ~MSubModuleChargeTransport();

Expand Down Expand Up @@ -101,6 +111,26 @@ class MSubModuleChargeTransport : public MSubModule

list<MDEEStripHit> m_ChargeTransportHits;

//! Filename of the depth calibration coefficients (stretch, offset, timing noise, ...)
MString m_DepthCoefficientsFileName;

//! Map of the depth calibration coefficients
unordered_map<int, vector<double>> m_Coeffs;

//! Filename of CTD->Depth splines
MString m_DepthSplinesFileName;

// Analog of the CTD-to-depth splines in MModuleDepthCalibration:
//! Map: detector ID (int) -> vector containing depth values
unordered_map<int, vector<double>> m_DepthGrid;
//! Map: detector ID (int) -> simulated electron drift times (+ electronics) for the depth values in m_DepthGrid
unordered_map<int, vector<double>> m_ElectronDriftTimes;
//! The corresponding electron-drift-time interpolation spline
unordered_map<int, TSpline3*> m_ElectronDriftSplines;
//! Map: detector ID (int) -> simulated hole drift times (+ electronics) for the depth values in m_DepthGrid
unordered_map<int, vector<double>> m_HoleDriftTimes;
//! The corresponding hole-drift-time interpolation spline
unordered_map<int, TSpline3*> m_HoleDriftSplines;

// private members:
private:
Expand Down
28 changes: 0 additions & 28 deletions include/MSubModuleDepthReadout.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ class MSubModuleDepthReadout : public MSubModule
//! Default destructor
virtual ~MSubModuleDepthReadout();

//! Set geometry
void SetGeometry(MDGeometryQuest* Geometry) { m_Geometry = Geometry; }

//! Initialize the module
virtual bool Initialize();

Expand All @@ -66,11 +63,6 @@ class MSubModuleDepthReadout : public MSubModule
//! Get filename for coefficients file
MString GetDepthCoefficientsFileName() const { return m_DepthCoefficientsFileName; }

//! Set filename for CTD->Depth splines
void SetDepthSplinesFileName( const MString& FileName) { m_DepthSplinesFileName = FileName; }
//! Get filename for CTD->Depth splines
MString GetDepthSplinesFileName() const {return m_DepthSplinesFileName; }

//! Set filename for TAC calibration
void SetTACCalFileName( const MString& FileName) { m_TACCalFileName = FileName; }
//! Get filename for TAC calibration
Expand All @@ -92,9 +84,6 @@ class MSubModuleDepthReadout : public MSubModule
// protected methods:
protected:

//! Load the splines file
bool LoadSplinesFile(MString FileName);


// private methods:
private:
Expand All @@ -104,31 +93,14 @@ class MSubModuleDepthReadout : public MSubModule
// protected members:
protected:

//! The geometry
MDGeometryQuest* m_Geometry;

//! Filename of the depth calibration coefficients (stretch, offset, timing noise, ...)
MString m_DepthCoefficientsFileName;

//! Map of the depth calibration coefficients
unordered_map<int, vector<double>> m_Coeffs;

//! Reference energy of the depth calibration coefficients
double m_Coeffs_Energy;

//! Filename of CTD->Depth splines
MString m_DepthSplinesFileName;

// Analog of the CTD-to-depth splines in MModuleDepthCalibration:
//! Map: detector ID (int) -> vector containing depth values
unordered_map<int, vector<double>> m_DepthGrid;
//! Map: detector ID (int) -> simulated CTD values for the depth values in m_DepthGrid
unordered_map<int, vector<double>> m_CTDMap;
//! Map: detector ID (int) -> simulated electron drift times (+ electronics) for the depth values in m_DepthGrid
unordered_map<int, vector<double>> m_ElectronDriftTimes;
//! Map: detector ID (int) -> simulated hole drift times (+ electronics) for the depth values in m_DepthGrid
unordered_map<int, vector<double>> m_HoleDriftTimes;

//! Filename of the TAC calibration file
MString m_TACCalFileName;

Expand Down
20 changes: 18 additions & 2 deletions src/MModuleDEESMEX.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ bool MModuleDEESMEX::Initialize()

// Set the geometry to the SubModules using it
m_ChargeTransport.SetGeometry(m_Geometry);
m_DepthReadout.SetGeometry(m_Geometry);

m_StripReadout.SetApplyResolutionCalibration(m_ApplyResolutionCalibration);
m_DepthReadout.SetApplyTimingResolutionCalibration(m_ApplyTimingResolutionCalibration);

// Initialize the module
// Pass the depth-calibration-related files to the SubModules using it
m_ChargeTransport.SetDepthSplinesFileName(m_DepthSplinesFileName);
m_ChargeTransport.SetDepthCoefficientsFileName(m_DepthCoefficientsFileName);
m_DepthReadout.SetDepthCoefficientsFileName(m_DepthCoefficientsFileName);

// Each Initialize() should handle its own error messaging
if (m_Intake.Initialize() == false) return false;
Expand Down Expand Up @@ -294,6 +296,16 @@ bool MModuleDEESMEX::ReadXmlConfiguration(MXmlNode* Node)
m_StripTrigger.ReadXmlConfiguration(Node);
m_DepthReadout.ReadXmlConfiguration(Node);
m_Output.ReadXmlConfiguration(Node);

// Add depth-calibration-related file names (used by several submodules)
MXmlNode* DepthSplineFile = Node->GetNode("DepthSplineFileName");
if (DepthSplineFile != nullptr) {
m_DepthSplinesFileName = DepthSplineFile->GetValue();
}
MXmlNode* DepthCoefficientsFileName = Node->GetNode("DepthCoefficientsFileName");
if (DepthCoefficientsFileName != nullptr) {
m_DepthCoefficientsFileName = DepthCoefficientsFileName->GetValue();
}

// Add noise button for energies
MXmlNode* ResolutionCalibrationNode = Node->GetNode("ApplyResolutionCalibration");
Expand Down Expand Up @@ -339,6 +351,10 @@ MXmlNode* MModuleDEESMEX::CreateXmlConfiguration()
m_DepthReadout.CreateXmlConfiguration(Node);
m_Output.CreateXmlConfiguration(Node);

// Add depth-calibration-related file names (used by several submodules)
new MXmlNode(Node, "DepthSplineFileName", m_DepthSplinesFileName);
new MXmlNode(Node, "DepthCoefficientsFileName", m_DepthCoefficientsFileName);

// Add noise button for energies
new MXmlNode(Node, "ApplyResolutionCalibration", m_ApplyResolutionCalibration);
// Add shield veto effects button
Expand Down
Loading