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
2 changes: 2 additions & 0 deletions r3bdata/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set(SRCS
alpideData/R3BAlpideHitData.cxx
alpideData/R3BAlpideMappedData.cxx
alpideData/R3BAlpidePoint.cxx
alpideData/R3BHmpMappedData.cxx
amsData/R3BAmsHitData.cxx
amsData/R3BAmsMappedData.cxx
amsData/R3BAmsStripCalData.cxx
Expand Down Expand Up @@ -170,6 +171,7 @@ set(HEADERS
alpideData/R3BAlpideHitData.h
alpideData/R3BAlpideMappedData.h
alpideData/R3BAlpidePoint.h
alpideData/R3BHmpMappedData.h
amsData/R3BAmsHitData.h
amsData/R3BAmsMappedData.h
amsData/R3BAmsStripCalData.h
Expand Down
1 change: 1 addition & 0 deletions r3bdata/DataLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#pragma link C++ class R3BAlpideMappedData+;
#pragma link C++ class R3BAlpideCalData+;
#pragma link C++ class R3BAlpideHitData+;
#pragma link C++ class R3BHmpMappedData+;
#pragma link C++ class R3BRpcMappedData+;
#pragma link C++ class R3BRpcPreCalData+;
#pragma link C++ class R3BRpcCalData+;
Expand Down
68 changes: 68 additions & 0 deletions r3bdata/alpideData/R3BHmpMappedData.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/******************************************************************************
* Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2022-2023 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
* copied verbatim in the file "LICENSE". *
* *
* In applying this license GSI does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
******************************************************************************/

// --------------------------------------------------------------------
// ----- R3BHmpMappedData source file -----
// --------------------------------------------------------------------

#include "R3BHmpMappedData.h"
#include <fmt/core.h>

R3BHmpMappedData::R3BHmpMappedData(uint32_t TSYS_LO,
uint32_t TSYS_HI,
uint32_t volt1,
uint32_t curr1,
uint32_t volt2,
uint32_t curr2,
uint32_t volt3,
uint32_t curr3,
uint32_t volt4,
uint32_t curr4)
: fTSLO(TSYS_LO)
, fTSHI(TSYS_HI)
, fVolt1(volt1)
, fCurr1(curr1)
, fVolt2(volt2)
, fCurr2(curr2)
, fVolt3(volt3)
, fCurr3(curr3)
, fVolt4(volt4)
, fCurr4(curr4)
{
}

std::string R3BHmpMappedData::toString() const
{
return fmt::format("TSLO: {}, Region: {}, TSHI: {}, Volt1: {}, Curr1: {}, Volt2: {}, Curr2: {}, Volt3: {}, Curr3: "
"{}, Volt4: {}, Curr4: {}",
GetTSLO(),
GetTSHI(),
GetVolt1(),
GetCurr1(),
GetVolt2(),
GetCurr2(),
GetVolt3(),
GetCurr3(),
GetVolt4(),
GetCurr4());
}

void R3BHmpMappedData::Print(const Option_t*) const { std::cout << *this << std::endl; }

std::ostream& operator<<(std::ostream& os, const R3BHmpMappedData& data)
{
os << data.toString();
return os;
}

ClassImp(R3BHmpMappedData)
92 changes: 92 additions & 0 deletions r3bdata/alpideData/R3BHmpMappedData.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/******************************************************************************
* Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2022-2024 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
* copied verbatim in the file "LICENSE". *
* *
* In applying this license GSI does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
******************************************************************************/

// ---------------------------------------------------------------
// ----- R3BHmpMappedData -----
// ----- Created 17/04/2025 by L. Rose -----
// ---------------------------------------------------------------

#pragma once

#include <TObject.h>
#include <cstdint>
#include <iostream>
#include <string>

class R3BHmpMappedData : public TObject
{
public:
// Default Constructor
R3BHmpMappedData() = default;

/** Standard Constructor
HMP_TSYS_LO // Slow control computer time Low bits
HMP_TSYS_HI // Slow control computer time High bits
HMP_VOLT1 // Voltage channel 1
HMP_VOLT2 // Voltage channel 2
HMP_VOLT3 // Voltage channel 3
HMP_VOLT4 // Voltage channel 4
HMP_CURR1 // Current channel 1
HMP_CURR2 // Current channel 2
HMP_CURR3 // Current channel 3
HMP_CURR4 // Current channel 4
**/

explicit R3BHmpMappedData(uint32_t TSYS_LO,
uint32_t TSYS_HI,
uint32_t volt1,
uint32_t curr1,
uint32_t volt2,
uint32_t curr2,
uint32_t volt3,
uint32_t curr3,
uint32_t volt4,
uint32_t curr4);

// Destructor
virtual ~R3BHmpMappedData() = default;

// Accessors with [[nodiscard]]
[[nodiscard]] inline const uint32_t GetTSLO() const { return fTSLO; }
[[nodiscard]] inline const uint32_t GetTSHI() const { return fTSHI; }
[[nodiscard]] inline const uint32_t GetVolt1() const { return fVolt1; }
[[nodiscard]] inline const uint32_t GetCurr1() const { return fCurr1; }
[[nodiscard]] inline const uint32_t GetVolt2() const { return fVolt2; }
[[nodiscard]] inline const uint32_t GetCurr2() const { return fCurr2; }
[[nodiscard]] inline const uint32_t GetVolt3() const { return fVolt3; }
[[nodiscard]] inline const uint32_t GetCurr3() const { return fCurr3; }
[[nodiscard]] inline const uint32_t GetVolt4() const { return fVolt4; }
[[nodiscard]] inline const uint32_t GetCurr4() const { return fCurr4; }

// Support for printing
[[nodiscard]] std::string toString() const;
void Print(const Option_t*) const override;

protected:
uint32_t fTSLO = 0;
uint32_t fTSHI = 0;
uint32_t fVolt1 = 0;
uint32_t fCurr1 = 0;
uint32_t fVolt2 = 0;
uint32_t fCurr2 = 0;
uint32_t fVolt3 = 0;
uint32_t fCurr3 = 0;
uint32_t fVolt4 = 0;
uint32_t fCurr4 = 0;

public:
ClassDefOverride(R3BHmpMappedData, 1); // NOLINT
};

// Operator overloading for printing R3BHmpMappedData
std::ostream& operator<<(std::ostream& os, const R3BHmpMappedData& data);
3 changes: 3 additions & 0 deletions r3bsource/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ set(SRCS
foot/R3BFootSiReader.cxx
alpide/R3BAlpideReader.cxx
alpide/R3BMosaicReader.cxx
alpide/R3BHmpReader.cxx
music/R3BMusicReader.cxx
rpc/R3BRpcReader.cxx
twim/R3BTwimReader.cxx
Expand Down Expand Up @@ -172,6 +173,7 @@ set(STRUCT_HEADERS
foot/ext_h101_foot.h
alpide/ext_h101_alpide.h
alpide/ext_h101_mosaic.h
alpide/ext_h101_hmp.h
music/ext_h101_music.h
twim/ext_h101_twim.h
tttx/ext_h101_ttt10.h
Expand Down Expand Up @@ -245,6 +247,7 @@ set(HEADERS
foot/R3BFootSiReader.h
alpide/R3BAlpideReader.h
alpide/R3BMosaicReader.h
alpide/R3BHmpReader.h
music/R3BMusicReader.h
rpc/R3BRpcReader.h
tttx/R3BTttxReader.h
Expand Down
2 changes: 2 additions & 0 deletions r3bsource/SourceLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#pragma link C++ class R3BFootReader+;
#pragma link C++ class R3BFootSiReader+;
#pragma link C++ class R3BAlpideReader+;
#pragma link C++ class R3BHmpReader+;
#pragma link C++ class R3BCalifaJulichReader+;
#pragma link C++ class R3BRpcReader+;
#pragma link C++ class R3BTwimReader+;
Expand Down Expand Up @@ -147,6 +148,7 @@
#pragma link C++ class EXT_STR_h101_RPC_t;
#pragma link C++ class EXT_STR_h101_SYNC_CHECK_t;
#pragma link C++ class EXT_STR_h101_MOSAIC_onion_t;
#pragma link C++ class EXT_STR_h101_HMP_onion_t;
#pragma link C++ class EXT_STR_h101_ACTAF_onion_t;

#endif
2 changes: 1 addition & 1 deletion r3bsource/alpide/R3BAlpideReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ void R3BAlpideReader::Reset()
}
}

ClassImp(R3BAlpideReader);
ClassImp(R3BAlpideReader)
92 changes: 92 additions & 0 deletions r3bsource/alpide/R3BHmpReader.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/******************************************************************************
* Copyright (C) 2025 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2025 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
* copied verbatim in the file "LICENSE". *
* *
* In applying this license GSI does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
******************************************************************************/

#include <FairRootManager.h>

#include "R3BHmpMappedData.h"
#include "R3BHmpReader.h"
#include "R3BLogger.h"

#include "ext_data_struct_info.hh"
#include <TClonesArray.h>

/**
** ext_h101_hmp.h was created by running
** $unpacker --ntuple=STRUCT_HH,RAW:HMP,id=h101_HMP,NOTRIGEVENTNO,ext_h101_hmp.h
**/

extern "C"
{
#include "ext_data_client.h"
#include "ext_h101_hmp.h"
}

R3BHmpReader::R3BHmpReader(EXT_STR_h101_HMP_onion* data, size_t offset)
: R3BReader("R3BHmpReader")
, fData(data)
, fArray(new TClonesArray("R3BHmpMappedData"))
{
}

R3BHmpReader::~R3BHmpReader()
{
R3BLOG(debug1, "");
if (fArray)
{
delete fArray;
}
}

Bool_t R3BHmpReader::Init(ext_data_struct_info* a_struct_info)
{
Int_t okay = 0;
R3BLOG(info, "");
EXT_STR_h101_HMP_ITEMS_INFO(okay, *a_struct_info, fOffset, EXT_STR_h101_HMP, 0);

R3BLOG_IF(fatal, !okay, "Failed to setup structure information.");

// Register output array in tree
FairRootManager::Instance()->Register("HmpMappedData", "HMP_Map", fArray, !fOnline);
Reset();
memset(fData, 0, sizeof(*fData));

return kTRUE;
}

Bool_t R3BHmpReader::R3BRead()
{
R3BLOG(debug1, "Event data: " << fNEvent);
new ((*fArray)[fArray->GetEntriesFast()]) R3BHmpMappedData(fData->HMP_TSYS_LO,
fData->HMP_TSYS_HI,
fData->HMP_VOLT[0],
fData->HMP_CURR[0],
fData->HMP_VOLT[1],
fData->HMP_CURR[1],
fData->HMP_VOLT[2],
fData->HMP_CURR[2],
fData->HMP_VOLT[3],
fData->HMP_CURR[3]);
fNEvent++;
return kTRUE;
}

void R3BHmpReader::Reset()
{
// Reset the output array
if (fArray)
{
fArray->Clear();
}
}

ClassImp(R3BHmpReader)
67 changes: 67 additions & 0 deletions r3bsource/alpide/R3BHmpReader.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/******************************************************************************
* Copyright (C) 2025 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2025 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
* copied verbatim in the file "LICENSE". *
* *
* In applying this license GSI does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
******************************************************************************/

// ---------------------------------------------------------------------
// ----- R3BHmpReader -----
// ----- Created 17/04/2025 by L. Rose -----
// ---------------------------------------------------------------------

#pragma once

#include "R3BReader.h"
#include <stdint.h>

class TClonesArray;

struct EXT_STR_h101_HMP_t;
typedef struct EXT_STR_h101_HMP_t EXT_STR_h101_HMP;
typedef struct EXT_STR_h101_HMP_onion_t EXT_STR_h101_HMP_onion;
class ext_data_struct_info;

class R3BHmpReader : public R3BReader
{
public:
// Standard constructor
R3BHmpReader(EXT_STR_h101_HMP_onion*, size_t);

// Destructor
virtual ~R3BHmpReader();

// Setup structure information
virtual Bool_t Init(ext_data_struct_info*) override;

// Read data from full event structure
virtual Bool_t R3BRead() override;

// Reset
virtual void Reset() override;

// Accessor to select online mode
void SetOnline(bool option = true) { fOnline = option; }

private:
// An event counter
unsigned int fNEvent = 0;
// Number of HMP sensors
// Reader specific data structure from ucesb
EXT_STR_h101_HMP_onion* fData;
// Data offset
size_t fOffset = 0;
// Don't store data for online
bool fOnline = false;
// Output array
TClonesArray* fArray = nullptr;

public:
ClassDefOverride(R3BHmpReader, 1); // NOLINT
};
Loading
Loading