Skip to content
Merged
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
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ MAKEFLAGS += --no-builtin-rules --no-print-directory

.SUFFIXES:
#.SUFFIXES: .cxx .h .o .so
.PHONY: all n nuclearizer megalib apps clean
.PHONY: all n nuclearizer megalib apps clean unittests
.EXPORT_ALL_VARIABLES:
#.NOTPARALLEL: megalib
.SILENT:
Expand Down Expand Up @@ -76,6 +76,7 @@ CXXFLAGS += -I$(IN) -I$(MEGALIB)/include -I/opt/local/include $(H5CXXFLAGS) $(CC
LIBS += $(H5LIBS) $(CCFITSLIBS)

# Definitions
NUCLEARIZER := $(TOPLEVEL)
NUCLEARIZER_DIR := $(NUCLEARIZER)
NUCLEARIZER_PRG := $(BN)/nuclearizer
NUCLEARIZER_CXX_MAIN := $(NUCLEARIZER_DIR)/src/MNuclearizerMain.cxx
Expand Down Expand Up @@ -105,6 +106,10 @@ NUCLEARIZER_CXX_MAIN := $(NUCLEARIZER)/src/MNuclearizerMain.cxx
ALLLIBS = -L$(LB) -lResponseCreator -lFretalonBase -lSivan -lRevanGui -lRevan -lMimrec -lGeomega -lSpectralyzeGui -lSpectralyze -lCommonMisc -lCommonGui -L$(MEGALIB)/lib -L$(LB)


CXX_UT := $(wildcard $(NUCLEARIZER_DIR)/unittests/*.cxx)
EXE_UT := $(patsubst %.cxx,%,$(CXX_UT))
EXE_UT := $(patsubst $(NUCLEARIZER_DIR)/unittests/%,$(BN)/%,$(EXE_UT))

NUCLEARIZER_DICT_NAME=Nuclearizer_Dictionary
NUCLEARIZER_DICT=$(LB)/$(NUCLEARIZER_DICT_NAME).cxx
NUCLEARIZER_DICT_LIB=$(LB)/$(NUCLEARIZER_DICT_NAME).o
Expand All @@ -129,7 +134,10 @@ apps:
@$(MAKE) $(NUCLEARIZER_SHARED_LIB)
@$(MAKE) -C apps

unittests: $(NUCLEARIZER_SHARED_LIB) $(EXE_UT)

clean:
@-rm -f $(EXE_UT)
@-rm -f $(MEGALIB)/include/MAssembly.h $(MEGALIB)/include/MReadOutAssembly.h
@-rm -f $(FRETALON_LIBS) $(FRETALON_DEP_FILES)
@-rm -f $(NUCLEARIZER_SHARED_LIB) $(NUCLEARIZER_LIBS) $(NUCLEARIZER_DEP_FILES)
Expand Down Expand Up @@ -186,6 +194,10 @@ $(NUCLEARIZER_PRG): $(NUCLEARIZER_SHARED_LIB) $(NUCLEARIZER_CXX_MAIN)
@echo "Linking and compiling $(subst $(BN)/,,$(NUCLEARIZER_PRG)) ... Please stand by ... "
@$(CXX) $(CXXFLAGS) $(LDFLAGS) $(NUCLEARIZER_CXX_MAIN) $(NUCLEARIZER_SHARED_LIB) $(ALLLIBS) $(GLIBS) $(LIBS) -o $(NUCLEARIZER_PRG)

$(EXE_UT): $(BN)/%: $(NUCLEARIZER_DIR)/unittests/%.cxx $(NUCLEARIZER_SHARED_LIB)
@echo "Compiling and linking $(subst $(BN)/,,$@) ..."
@$(CXX) $(CXXFLAGS) $(LDFLAGS) $< $(NUCLEARIZER_SHARED_LIB) $(ALLLIBS) $(GLIBS) $(LIBS) -o $@


ifneq ($(MAKECMDGOALS),clean)
-include $(NUCLEARIZER_DEP_FILES)
Expand Down
9 changes: 2 additions & 7 deletions include/MHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ class MHit
//! Parse some content from a line
bool Parse(MString &Line, int Version = 1);

// protected methods:
protected:
//MHit() {};
//MHit(const MHit& NCTHit) {};

Comment thread
fhagemann marked this conversation as resolved.
// private methods:
private:

Expand Down Expand Up @@ -194,9 +189,9 @@ class MHit
bool m_GuardRingHit;

//! true if hit contains strip that was hit multiple times on X
bool m_StripHitMultipleTimesX = false;
bool m_StripHitMultipleTimesX;
//! true if hit contains strip that was hit multiple times on Y
bool m_StripHitMultipleTimesY = false;
bool m_StripHitMultipleTimesY;

//! true if hit contains charge sharing
bool m_ChargeSharing;
Expand Down
20 changes: 11 additions & 9 deletions include/MReadOutAssembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class MReadOutAssembly : public MReadOutSequence
//! Default destructor
virtual ~MReadOutAssembly();

//! Copying is disabled - the assembly owns raw pointers
MReadOutAssembly(const MReadOutAssembly&) = delete;
MReadOutAssembly& operator=(const MReadOutAssembly&) = delete;

//! Reset all data
virtual void Clear();

Expand Down Expand Up @@ -131,14 +135,14 @@ class MReadOutAssembly : public MReadOutSequence
//! Return guardring hit i
MGuardringHit* GetGuardringHit(unsigned int i);
//! Add a guardring hit
void AddGuardringHit(MGuardringHit* GuardringHit) { return m_GuardringHits.push_back(GuardringHit); }
void AddGuardringHit(MGuardringHit* GuardringHit) { if (GuardringHit != nullptr) m_GuardringHits.push_back(GuardringHit); }

//! Return the number of hits
unsigned int GetNHits() const { return m_Hits.size(); }
//! Return hit i
MHit* GetHit(unsigned int i);
//! Add a hit
void AddHit(MHit* Hit) { return m_Hits.push_back(Hit); }
void AddHit(MHit* Hit) { if (Hit != nullptr) m_Hits.push_back(Hit); }
//! Remove a hit
void RemoveHit(unsigned int i);

Expand All @@ -164,29 +168,29 @@ class MReadOutAssembly : public MReadOutSequence
//! Return the physical event
MPhysicalEvent* GetPhysicalEvent() { return m_PhysicalEvent; }

//! Set the physical event from event reconstruction
void SetSimulatedEvent(MSimEvent* Event) { m_SimEvent = Event; }
//! Set the simulated event; the ROA takes ownership of the pointer and deletes it
void SetSimulatedEvent(MSimEvent* Event) { if (Event != m_SimEvent) { delete m_SimEvent; m_SimEvent = Event; } }
//! Return the simulated event
MSimEvent* GetSimulatedEvent() { return m_SimEvent; }

//! Return the number of low-voltage DEE strip hits
unsigned int GetNDEEStripHitsLV() const { return m_DEEStripHitsLV.size(); }
//! Return low-voltage DEE Strip hit at position i
void AddDEEStripHitLV(MDEEStripHit& DEEStripHit) { return m_DEEStripHitsLV.push_back(DEEStripHit); }
void AddDEEStripHitLV(const MDEEStripHit& DEEStripHit) { m_DEEStripHitsLV.push_back(DEEStripHit); }
//! Get a reference to the list of strip hits for direct manipulation
list<MDEEStripHit>& GetDEEStripHitLVListReference() { return m_DEEStripHitsLV; }

//! Return the number of high-voltage DEE strip hits
unsigned int GetNDEEStripHitsHV() const { return m_DEEStripHitsHV.size(); }
//! Add a high-voltage DEE Strip hit
void AddDEEStripHitHV(MDEEStripHit DEEStripHit) { return m_DEEStripHitsHV.push_back(DEEStripHit); }
void AddDEEStripHitHV(const MDEEStripHit& DEEStripHit) { m_DEEStripHitsHV.push_back(DEEStripHit); }
//! Get a reference to the list of strip hits for direct manipulation
list<MDEEStripHit>& GetDEEStripHitHVListReference() { return m_DEEStripHitsHV; }

//! Return the number of crystal hits
unsigned int GetNDEECrystalHits() const { return m_DEECrystalHits.size(); }
//! Add a crystal hit
void AddDEECrystalHit(MDEECrystalHit DEECrystalHit) { return m_DEECrystalHits.push_back(DEECrystalHit); }
void AddDEECrystalHit(const MDEECrystalHit& DEECrystalHit) { m_DEECrystalHits.push_back(DEECrystalHit); }
//! Get a reference to the list of crystal hits for direct manipulation
list<MDEECrystalHit>& GetDEECrystalHitListReference() { return m_DEECrystalHits; }

Expand Down Expand Up @@ -282,8 +286,6 @@ class MReadOutAssembly : public MReadOutSequence

// protected methods:
protected:
//MReadOutAssembly() {};
//MReadOutAssembly(const MReadOutAssembly& ReadOutAssembly) {};

// private methods:
private:
Expand Down
9 changes: 4 additions & 5 deletions include/MStripHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
// Nuclearizer libs
#include "MReadOutElement.h"
#include "MReadOutElementDoubleStrip.h"
#include "MStripHit.h"

// Forward declarations:

Expand All @@ -50,14 +49,14 @@ class MStripHit
MReadOutElement* GetReadOutElement() const { return m_ReadOutElement; }

//! Set the Detector ID
void SetDetectorID(int DetectorID) { m_ReadOutElement->SetDetectorID(DetectorID); }
void SetDetectorID(unsigned int DetectorID) { m_ReadOutElement->SetDetectorID(DetectorID); }
//! Return the Detector ID
int GetDetectorID() const { return m_ReadOutElement->GetDetectorID(); }
unsigned int GetDetectorID() const { return m_ReadOutElement->GetDetectorID(); }

//! Set the Strip ID
void SetStripID(int StripID) { m_ReadOutElement->SetStripID(StripID); }
void SetStripID(unsigned int StripID) { m_ReadOutElement->SetStripID(StripID); }
//! Return the Strip ID
int GetStripID() const { return m_ReadOutElement->GetStripID(); }
unsigned int GetStripID() const { return m_ReadOutElement->GetStripID(); }

//! Set the strip type (x/y)
void IsXStrip(bool PositiveStrip) { m_ReadOutElement->IsLowVoltageStrip(PositiveStrip); }
Expand Down
60 changes: 60 additions & 0 deletions resource/unittestdata/406-1/hdf5-to-tra.nuclearizer.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<NuclearizerData>
<Version>1</Version>
<ModuleSequence>
<ModuleSequenceItem>XmlTagMeasurementLoaderHDF</ModuleSequenceItem>
<ModuleSequenceItem>EnergyCalibration</ModuleSequenceItem>
<ModuleSequenceItem>XmlTagTACcut</ModuleSequenceItem>
<ModuleSequenceItem>XmlTagStripPairingMultiRoundChiSquare</ModuleSequenceItem>
<ModuleSequenceItem>DepthCalibration</ModuleSequenceItem>
<ModuleSequenceItem>XmlTagRevan</ModuleSequenceItem>
<ModuleSequenceItem>XmlTagEventSaver</ModuleSequenceItem>
</ModuleSequence>
<GeometryFileName>$(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.simplified.geo.setup</GeometryFileName>
<ModuleOptions>
<XmlTagMeasurementLoaderHDF>
<FileNameHDF5>$(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.gse_20260217T124025.hdf5</FileNameHDF5>
<LoadContinuationFiles>true</LoadContinuationFiles>
<FileNameStripMap>$(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.stripmap.map</FileNameStripMap>
<IncludeNearestNeighbor>false</IncludeNearestNeighbor>
</XmlTagMeasurementLoaderHDF>
<EnergyCalibration>
<FileName>$(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.full.ecal</FileName>
<SlowThresholdCutMode>1</SlowThresholdCutMode>
<SlowThresholdCutFixedValue>20</SlowThresholdCutFixedValue>
<SlowThresholdCutThresholdFileName />
<NearestNeighborCutMode>100</NearestNeighborCutMode>
<NearestNeighborThreshold>-1000</NearestNeighborThreshold>
</EnergyCalibration>
<XmlTagStripPairingMultiRoundChiSquare />
<DepthCalibration>
<CoeffsFileName>$(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.coeffs.csv</CoeffsFileName>
<SplinesFileName>$(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.splines.csv</SplinesFileName>
<MaskMetrology>false</MaskMetrology>
<MaskMetrologyFileName />
<UCSDOverride>false</UCSDOverride>
</DepthCalibration>
<XmlTagEventSaver>
<FileName>$(NUCLEARIZER)/resource/unittestdata/406-1/hdf5-to-tra.tra</FileName>
<Mode>3</Mode>
<SaveBadEvents>true</SaveBadEvents>
<SaveVetoEvents>true</SaveVetoEvents>
<AddTimeTag>false</AddTimeTag>
<SplitFile>false</SplitFile>
<SplitFileTime>600</SplitFileTime>
<RoaWithADCs>true</RoaWithADCs>
<RoaWithTACs>true</RoaWithTACs>
<RoaWithEnergies>false</RoaWithEnergies>
<RoaWithTimings>false</RoaWithTimings>
<RoaWithFlags>true</RoaWithFlags>
<RoaWithOrigins>false</RoaWithOrigins>
<RoaWithNearestNeighbors>true</RoaWithNearestNeighbors>
</XmlTagEventSaver>
<XmlTagRevan>
<RevanConfigurationFileName>$(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.revan.cfg</RevanConfigurationFileName>
</XmlTagRevan>
<XmlTagTACcut>
<TACCalFileName>$(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.taccal.csv</TACCalFileName>
<TACCutFileName>$(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.taccut.csv</TACCutFileName>
</XmlTagTACcut>
</ModuleOptions>
</NuclearizerData>
Loading