Skip to content

Commit

Permalink
add skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Aug 24, 2023
1 parent 45515e5 commit 39de08b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
22 changes: 22 additions & 0 deletions inc/TRestRawReadoutMetadataProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@
#ifndef REST_TRESTRAWREADOUTMETADATAPROCESS_H
#define REST_TRESTRAWREADOUTMETADATAPROCESS_H

#include <TRestDetectorReadout.h>
#include <TRestEventProcess.h>
#include <TRestRawReadoutMetadata.h>
#include <TRestRawSignalEvent.h>

class TRestRawReadoutMetadataProcess : public TRestEventProcess {
private:
TRestRawSignalEvent* fSignalEvent; //!
TRestDetectorReadout* fReadout; //!

public:
any GetInputEvent() const override { return fSignalEvent; }
any GetOutputEvent() const override { return fSignalEvent; }

void InitProcess() override;

const char* GetProcessName() const override { return "readoutMetadata"; }

TRestRawReadoutMetadataProcess() = default;
~TRestRawReadoutMetadataProcess() = default;

ClassDefOverride(TRestRawReadoutMetadataProcess, 1);
};

#endif // REST_TRESTRAWREADOUTMETADATAPROCESS_H
22 changes: 5 additions & 17 deletions src/TRestRawReadoutMetadataProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

#include <TRestDetectorReadout.h>

#include <set>

#include "TRestRawReadoutMetadata.h"

using namespace std;

ClassImp(TRestRawReadoutMetadataProcess);

void TRestRawReadoutMetadata::InitializeFromReadout(TRestDetectorReadout* readout) {
if (!readout) {
cerr << "TRestRawReadoutMetadata::InitializeFromReadout: readout is null" << endl;
Expand Down Expand Up @@ -41,19 +41,7 @@ void TRestRawReadoutMetadata::InitializeFromReadout(TRestDetectorReadout* readou
}
}

void TRestRawReadoutMetadata::PrintMetadata() const {
cout << "Number of channels: " << fChannelInfo.size() << endl;
map<string, int> typesCount;
for (const auto& channel : fChannelInfo) {
const auto& info = channel.second;
typesCount[info.type]++;
}
cout << "Channel types:" << endl;
for (const auto& type : typesCount) {
cout << type.first << ": " << type.second << endl;
}

for (const auto& [channelId, info] : fChannelInfo) {
cout << "Channel " << channelId << ": " << info.type << " " << info.name << endl;
}
void TRestRawReadoutMetadataProcess::InitProcess() {
//
//
}

0 comments on commit 39de08b

Please sign in to comment.