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
3 changes: 3 additions & 0 deletions include/MModuleEventSaver.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ using namespace std;
#include "MGlobal.h"
#include "MString.h"
#include "MFile.h"
#include "MReadOutFileFormat.h"

// Nuclearizer libs:
#include "MModule.h"
Expand Down Expand Up @@ -233,6 +234,8 @@ class MModuleEventSaver : public MModule
bool m_RoaWithOrigins;
//! True if we should include next neighbors in the data stream
bool m_RoaWithNearestNeighbors;
//! The read-out units of the roa file
MReadOutFileFormat m_RoaFileFormat;

//! Main output stream for file
MFile m_Out;
Expand Down
3 changes: 3 additions & 0 deletions include/MReadOutAssembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ class MReadOutAssembly : public MReadOutSequence

//! Stream the BD flags
void StreamBDFlags(ostream& S);
//! Parse a BD, QA, or PQ line as written by StreamBDFlags
//! Return false if the flag is unknown
bool ParseBDFlags(const MString& Line);

//! Build the next MReadOutAssembly from a `.dat` file
bool GetNextFromDatFile(MFile& F);
Expand Down
111 changes: 111 additions & 0 deletions include/MReadOutDataFlags.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* MReadOutDataFlags.h
*
* Copyright (C) by Andreas Zoglauer.
* All rights reserved.
*
* Please see the source-file for the copyright-notice.
*
*/


#ifndef __MReadOutDataFlags__
#define __MReadOutDataFlags__


////////////////////////////////////////////////////////////////////////////////


// Standard libs:
#include <iostream>
using namespace std;

// ROOT libs:

// MEGAlib libs:
#include "MGlobal.h"
#include "MTokenizer.h"
#include "MReadOutData.h"

// Forward declarations:


////////////////////////////////////////////////////////////////////////////////


//! Read-out data consisting of the hit flags as bit mask
class MReadOutDataFlags : public MReadOutData
{
// public interface:
public:
//! The type name --- must be unique
static const MString m_Type;
//! The type name ID --- must be unique
static const long m_TypeID;

//! Default constructor
MReadOutDataFlags();
//! Constructor given the data
MReadOutDataFlags(MReadOutData* Data);
//! Simple default destructor
virtual ~MReadOutDataFlags();

//! Return the type of this read-out data --- hard coded to save space
virtual MString GetType() const { return m_Type; }
//! Return the type ID of this read-out data --- hard coded to save memory
virtual long GetTypeID() const { return m_TypeID; }

//! Clear the content of this read-out data element
virtual void Clear();

//! Set the flags
void SetFlags(unsigned int Flags) { m_Flags = Flags; }
//! Get the flags
unsigned int GetFlags() const { return m_Flags; }

//! Clone this data element - the returned element must be deleted
virtual MReadOutDataFlags* Clone() const;

//! Return the number of parsable elements
virtual unsigned int GetNumberOfParsableElements() const;
//! Return the data as parsable string
virtual MString ToParsableString(bool WithDescriptor = false) const;
//! Parse the data from the tokenizer
virtual bool Parse(const MTokenizer& T, unsigned int StartElement);

//! Dump a string
virtual MString ToString() const;


// protected methods:
protected:

// private methods:
private:



// protected members:
protected:
//! The flags as bit mask
unsigned int m_Flags;

// private members:
private:



#ifdef ___CLING___
public:
ClassDef(MReadOutDataFlags, 0) // Read-out data flags
#endif

};

//! Streamify the read-out data
ostream& operator<<(ostream& os, const MReadOutDataFlags& R);

#endif


////////////////////////////////////////////////////////////////////////////////
32 changes: 32 additions & 0 deletions resource/unittestdata/406-1/hdf5-to-roa.nuclearizer.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<NuclearizerData>
<Version>1</Version>
<ModuleSequence>
<ModuleSequenceItem>XmlTagMeasurementLoaderHDF</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>
<XmlTagEventSaver>
<FileName>$(NUCLEARIZER)/resource/unittestdata/406-1/hdf5-to-roa.roa</FileName>
<Mode>0</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>
</ModuleOptions>
</NuclearizerData>
Loading
Loading