diff --git a/src/Detectors/AnasenEfficiency.cpp b/src/Detectors/AnasenArray.cpp similarity index 94% rename from src/Detectors/AnasenEfficiency.cpp rename to src/Detectors/AnasenArray.cpp index 8c6cd19..7e31045 100644 --- a/src/Detectors/AnasenEfficiency.cpp +++ b/src/Detectors/AnasenArray.cpp @@ -1,4 +1,4 @@ -#include "AnasenEfficiency.h" +#include "AnasenArray.h" #include #include #include @@ -6,8 +6,8 @@ #include "TFile.h" #include "TTree.h" -AnasenEfficiency::AnasenEfficiency() : - DetectorEfficiency(), m_detectorEloss({14}, {28}, {1}, s_detectorThickness) +AnasenArray::AnasenArray() : + DetectorArray(), m_detectorEloss({14}, {28}, {1}, s_detectorThickness) { for(int i=0; i r1_points; std::vector r2_points; @@ -230,7 +230,7 @@ double AnasenEfficiency::RunConsistencyCheck() } -DetectorResult AnasenEfficiency::IsRing1(Mask::Nucleus& nucleus) +DetectorResult AnasenArray::IsRing1(Mask::Nucleus& nucleus) { DetectorResult observation; double thetaIncident; @@ -255,7 +255,7 @@ DetectorResult AnasenEfficiency::IsRing1(Mask::Nucleus& nucleus) return observation; } -DetectorResult AnasenEfficiency::IsRing2(Mask::Nucleus& nucleus) +DetectorResult AnasenArray::IsRing2(Mask::Nucleus& nucleus) { DetectorResult observation; double thetaIncident; @@ -280,7 +280,7 @@ DetectorResult AnasenEfficiency::IsRing2(Mask::Nucleus& nucleus) return observation; } -DetectorResult AnasenEfficiency::IsQQQ(Mask::Nucleus& nucleus) +DetectorResult AnasenArray::IsQQQ(Mask::Nucleus& nucleus) { DetectorResult observation; double thetaIncident; @@ -324,7 +324,7 @@ DetectorResult AnasenEfficiency::IsQQQ(Mask::Nucleus& nucleus) return observation; } -DetectorResult AnasenEfficiency::IsAnasen(Mask::Nucleus& nucleus) +DetectorResult AnasenArray::IsAnasen(Mask::Nucleus& nucleus) { DetectorResult result; if(nucleus.GetKE() <= s_energyThreshold) @@ -339,7 +339,7 @@ DetectorResult AnasenEfficiency::IsAnasen(Mask::Nucleus& nucleus) return result; } -void AnasenEfficiency::CountCoincidences(const std::vector& data, std::vector& counts) +void AnasenArray::CountCoincidences(const std::vector& data, std::vector& counts) { if (data.size() == 3 && data[1].isDetected && data[2].isDetected) { @@ -417,11 +417,11 @@ void AnasenEfficiency::CountCoincidences(const std::vector& data, } } -void AnasenEfficiency::CalculateEfficiency(const std::string& inputname, const std::string& outputname, const std::string& statsname) { +void AnasenArray::CalculateEfficiency(const std::string& inputname, const std::string& outputname, const std::string& statsname) { if(!dmap.IsValid()) { - std::cerr<<"Invalid Dead Channel Map at AnasenEfficiency::CalculateEfficiency()! If you want to run with all possible"; + std::cerr<<"Invalid Dead Channel Map at AnasenArray::CalculateEfficiency()! If you want to run with all possible"; std::cerr<<"channels active, simply load an empty file."<Close(); output->Close(); stats.close(); diff --git a/src/Detectors/AnasenEfficiency.h b/src/Detectors/AnasenArray.h similarity index 81% rename from src/Detectors/AnasenEfficiency.h rename to src/Detectors/AnasenArray.h index 8337793..a492d98 100644 --- a/src/Detectors/AnasenEfficiency.h +++ b/src/Detectors/AnasenArray.h @@ -1,23 +1,23 @@ -#ifndef ANASEN_EFFICIENCY_H -#define ANASEN_EFFICIENCY_H +#ifndef ANASEN_ARRAY_H +#define ANASEN_ARRAY_H #include -#include "DetectorEfficiency.h" +#include "DetectorArray.h" #include "SX3Detector.h" #include "QQQDetector.h" #include "Target.h" #include "Nucleus.h" #include "AnasenDeadChannelMap.h" -class AnasenEfficiency : public DetectorEfficiency +class AnasenArray : public DetectorArray { public: - AnasenEfficiency(); - ~AnasenEfficiency(); - void CalculateEfficiency(const std::string& inputname, const std::string& outputname, const std::string& statsname) override; - void DrawDetectorSystem(const std::string& filename) override; - double RunConsistencyCheck() override; + AnasenArray(); + ~AnasenArray(); + virtual void CalculateEfficiency(const std::string& inputname, const std::string& outputname, const std::string& statsname) override; + virtual void DrawDetectorSystem(const std::string& filename) override; + virtual double RunConsistencyCheck() override; inline void SetDeadChannelMap(const std::string& filename) { dmap.LoadMapfile(filename); } private: @@ -27,7 +27,8 @@ private: DetectorResult IsAnasen(Mask::Nucleus& nucleus); void CountCoincidences(const std::vector& data, std::vector& counts); - std::vector m_Ring1, m_Ring2; + std::vector m_Ring1; + std::vector m_Ring2; std::vector m_forwardQQQs; std::vector m_backwardQQQs; diff --git a/src/Detectors/CMakeLists.txt b/src/Detectors/CMakeLists.txt index 3c949eb..12cb098 100644 --- a/src/Detectors/CMakeLists.txt +++ b/src/Detectors/CMakeLists.txt @@ -4,18 +4,18 @@ target_include_directories(Detectors PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_ target_sources(Detectors PUBLIC AnasenDeadChannelMap.cpp AnasenDeadChannelMap.h - AnasenEfficiency.cpp - AnasenEfficiency.h + AnasenArray.cpp + AnasenArray.h main.cpp - DetectorEfficiency.h + DetectorArray.h QQQDetector.cpp QQQDetector.h SabreDeadChannelMap.cpp SabreDeadChannelMap.h SabreDetector.cpp SabreDetector.h - SabreEfficiency.cpp - SabreEfficiency.h + SabreArray.cpp + SabreArray.h SX3Detector.cpp SX3Detector.h ) diff --git a/src/Detectors/DetectorEfficiency.h b/src/Detectors/DetectorArray.h similarity index 67% rename from src/Detectors/DetectorEfficiency.h rename to src/Detectors/DetectorArray.h index 7f3f292..5e7f37c 100644 --- a/src/Detectors/DetectorEfficiency.h +++ b/src/Detectors/DetectorArray.h @@ -1,5 +1,5 @@ -#ifndef DETECTOREFFICIENCY_H -#define DETECTOREFFICIENCY_H +#ifndef DETECTOR_ARRAY_H +#define DETECTOR_ARRAY_H #include #include @@ -14,18 +14,18 @@ struct DetectorResult std::string det_name = ""; }; -class DetectorEfficiency +class DetectorArray { public: - DetectorEfficiency() {}; - virtual ~DetectorEfficiency() {}; + DetectorArray() {}; + virtual ~DetectorArray() {}; virtual void CalculateEfficiency(const std::string& inputname, const std::string& outputname, const std::string& statsname) = 0; virtual void DrawDetectorSystem(const std::string& filename) = 0; virtual double RunConsistencyCheck() = 0; protected: - inline bool IsDoubleEqual(double x, double y) { return std::fabs(x-y) < s_epsilon ? true : false; }; + bool IsDoubleEqual(double x, double y) { return std::fabs(x-y) < s_epsilon ? true : false; }; static constexpr double s_epsilon = 1.0e-6; }; diff --git a/src/Detectors/SX3Detector.cpp b/src/Detectors/SX3Detector.cpp index 47688ae..c2b9c91 100644 --- a/src/Detectors/SX3Detector.cpp +++ b/src/Detectors/SX3Detector.cpp @@ -15,7 +15,7 @@ y */ -StripDetector::StripDetector(double centerPhi, double centerZ, double centerRho) : +SX3Detector::SX3Detector(double centerPhi, double centerZ, double centerRho) : m_centerPhi(centerPhi), m_centerZ(centerZ), m_centerRho(centerRho), m_norm(1.0,0.0,0.0), m_uniformFraction(0.0, 1.0), m_isSmearing(false) { m_zRotation.SetAngle(m_centerPhi); @@ -35,9 +35,9 @@ StripDetector::StripDetector(double centerPhi, double centerZ, double centerRho) } -StripDetector::~StripDetector() {} +SX3Detector::~SX3Detector() {} -void StripDetector::CalculateCorners() +void SX3Detector::CalculateCorners() { double y_min, y_max, z_min, z_max; for (int s=0; s= 0 && f < s_nStrips) ? true : false); }; diff --git a/src/Detectors/SabreEfficiency.cpp b/src/Detectors/SabreArray.cpp similarity index 94% rename from src/Detectors/SabreEfficiency.cpp rename to src/Detectors/SabreArray.cpp index 0ce0619..ca5a35e 100644 --- a/src/Detectors/SabreEfficiency.cpp +++ b/src/Detectors/SabreArray.cpp @@ -1,4 +1,4 @@ -#include "SabreEfficiency.h" +#include "SabreArray.h" #include #include #include @@ -7,8 +7,8 @@ #include "TTree.h" -SabreEfficiency::SabreEfficiency() : - DetectorEfficiency(), m_deadlayerEloss({14}, {28}, {1}, s_deadlayerThickness), +SabreArray::SabreArray() : + DetectorArray(), m_deadlayerEloss({14}, {28}, {1}, s_deadlayerThickness), m_detectorEloss({14}, {28}, {1}, s_detectorThickness), m_degraderEloss({73}, {181}, {1}, s_degraderThickness) { @@ -29,9 +29,9 @@ SabreEfficiency::SabreEfficiency() : m_activeDetectors[4] = false; } -SabreEfficiency::~SabreEfficiency() {} +SabreArray::~SabreArray() {} -void SabreEfficiency::CalculateEfficiency(const std::string& inputname, const std::string& outputname, const std::string& statsname) +void SabreArray::CalculateEfficiency(const std::string& inputname, const std::string& outputname, const std::string& statsname) { std::cout<<"----------SABRE Efficiency Calculation----------"<& data, std::vector& counts) +void SabreArray::CountCoincidences(const std::vector& data, std::vector& counts) { if (data.size() == 3 && data[1].isDetected && data[2].isDetected) { diff --git a/src/Detectors/SabreEfficiency.h b/src/Detectors/SabreArray.h similarity index 89% rename from src/Detectors/SabreEfficiency.h rename to src/Detectors/SabreArray.h index 7c43fb5..49eb313 100644 --- a/src/Detectors/SabreEfficiency.h +++ b/src/Detectors/SabreArray.h @@ -1,17 +1,17 @@ -#ifndef SABREEFFICIENCY_H -#define SABREEFFICIENCY_H +#ifndef SABRE_ARRAY_H +#define SABRE_ARRAY_H -#include "DetectorEfficiency.h" +#include "DetectorArray.h" #include "SabreDetector.h" #include "Target.h" #include "SabreDeadChannelMap.h" #include "Mask/Nucleus.h" -class SabreEfficiency : public DetectorEfficiency +class SabreArray : public DetectorArray { public: - SabreEfficiency(); - ~SabreEfficiency(); + SabreArray(); + ~SabreArray(); void SetDeadChannelMap(const std::string& filename) { m_deadMap.LoadMapfile(filename); }; void CalculateEfficiency(const std::string& inputname, const std::string& outputname, const std::string& statsname) override; void DrawDetectorSystem(const std::string& filename) override; diff --git a/src/Detectors/main.cpp b/src/Detectors/main.cpp index ba6f8f6..9ae677a 100644 --- a/src/Detectors/main.cpp +++ b/src/Detectors/main.cpp @@ -1,5 +1,5 @@ -#include "SabreEfficiency.h" -#include "AnasenEfficiency.h" +#include "SabreArray.h" +#include "AnasenArray.h" #include "KinematicsExceptions.h" #include #include @@ -24,7 +24,7 @@ int main(int argc, char** argv) std::string statsname = argv[3]; - SabreEfficiency sabre; + SabreArray sabre; std::string mapfile = "./etc/sabreDeadChannels_May2022.txt"; sabre.SetDeadChannelMap(mapfile); sabre.CalculateEfficiency(inputname, outputname, statsname); @@ -33,7 +33,7 @@ int main(int argc, char** argv) /* - AnasenEfficiency anasen; + AnasenArray anasen; std::string mapfile = "./etc/AnasenDeadChannels.txt"; anasen.SetDeadChannelMap(mapfile); anasen.CalculateEfficiency(inputname, outputname, statsname);