Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of custom typedef any since it is misleading with std::any #100

Merged
merged 2 commits into from
Sep 6, 2023
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
4 changes: 2 additions & 2 deletions inc/TRestDetectorAvalancheProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class TRestDetectorAvalancheProcess : public TRestEventProcess {
TRestDetectorGas* fGas; //!

public:
any GetInputEvent() const override { return fHitsInputEvent; }
any GetOutputEvent() const override { return fHitsOutputEvent; }
RESTValue GetInputEvent() const override { return fHitsInputEvent; }
RESTValue GetOutputEvent() const override { return fHitsOutputEvent; }

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorDaqChannelSwitchingProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class TRestDetectorDaqChannelSwitchingProcess : public TRestEventProcess {
void Initialize() override;

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

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorElectronDiffusionProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class TRestDetectorElectronDiffusionProcess : public TRestEventProcess {
Double_t fSeed = 0;

public:
any GetInputEvent() const override { return fInputHitsEvent; }
any GetOutputEvent() const override { return fOutputHitsEvent; }
RESTValue GetInputEvent() const override { return fInputHitsEvent; }
RESTValue GetOutputEvent() const override { return fOutputHitsEvent; }

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorFiducializationProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class TRestDetectorFiducializationProcess : public TRestEventProcess {

protected:
public:
any GetInputEvent() const override { return fInputHitsEvent; }
any GetOutputEvent() const override { return fOutputHitsEvent; }
RESTValue GetInputEvent() const override { return fInputHitsEvent; }
RESTValue GetOutputEvent() const override { return fOutputHitsEvent; }

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorGarfieldDriftProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class TRestDetectorGarfieldDriftProcess : public TRestEventProcess {

#endif
public:
any GetInputEvent() const override { return fInputHitsEvent; }
any GetOutputEvent() const override { return fOutputHitsEvent; }
RESTValue GetInputEvent() const override { return fInputHitsEvent; }
RESTValue GetOutputEvent() const override { return fOutputHitsEvent; }

TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;

Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorHits3DReconstructionProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class TRestDetectorHits3DReconstructionProcess : public TRestEventProcess {
void Initialize() override;

public:
any GetInputEvent() const override { return fInputHitsEvent; }
any GetOutputEvent() const override { return fOutputHitsEvent; }
RESTValue GetInputEvent() const override { return fInputHitsEvent; }
RESTValue GetOutputEvent() const override { return fOutputHitsEvent; }

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorHitsAnalysisProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class TRestDetectorHitsAnalysisProcess : public TRestEventProcess {
Double_t fFid_theta;

public:
any GetInputEvent() const override { return fInputHitsEvent; }
any GetOutputEvent() const override { return fOutputHitsEvent; }
RESTValue GetInputEvent() const override { return fInputHitsEvent; }
RESTValue GetOutputEvent() const override { return fOutputHitsEvent; }

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorHitsGaussAnalysisProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class TRestDetectorHitsGaussAnalysisProcess : public TRestEventProcess {
Int_t fNHitsMin = 100000;

public:
any GetInputEvent() const override { return fInputHitsEvent; }
any GetOutputEvent() const override { return fOutputHitsEvent; }
RESTValue GetInputEvent() const override { return fInputHitsEvent; }
RESTValue GetOutputEvent() const override { return fOutputHitsEvent; }

TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;

Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorHitsNormalizationProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class TRestDetectorHitsNormalizationProcess : public TRestEventProcess {
Double_t fFactor;

public:
any GetInputEvent() const override { return fHitsInputEvent; }
any GetOutputEvent() const override { return fHitsOutputEvent; }
RESTValue GetInputEvent() const override { return fHitsInputEvent; }
RESTValue GetOutputEvent() const override { return fHitsOutputEvent; }

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorHitsReductionProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class TRestDetectorHitsReductionProcess : public TRestEventProcess {
Double_t fMaxNodes;

public:
any GetInputEvent() const override { return fInputHitsEvent; }
any GetOutputEvent() const override { return fOutputHitsEvent; }
RESTValue GetInputEvent() const override { return fInputHitsEvent; }
RESTValue GetOutputEvent() const override { return fOutputHitsEvent; }

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorHitsShuffleProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class TRestDetectorHitsShuffleProcess : public TRestEventProcess {
Int_t fIterations;

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

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorHitsSmearingProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class TRestDetectorHitsSmearingProcess : public TRestEventProcess {
ULong_t fSeed = 0; //<

public:
any GetInputEvent() const override { return fInputEvent; }
any GetOutputEvent() const override { return fOutputEvent; }
RESTValue GetInputEvent() const override { return fInputEvent; }
RESTValue GetOutputEvent() const override { return fOutputEvent; }

TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;

Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorHitsToSignalProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class TRestDetectorHitsToSignalProcess : public TRestEventProcess {
Double_t fDriftVelocity = -1; // mm/us

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

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
8 changes: 4 additions & 4 deletions inc/TRestDetectorPositionMappingProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class TRestDetectorPositionMappingProcess : public TRestEventProcess {
TH2F* fAreaGainMap; //!

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

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand All @@ -69,8 +69,8 @@ class TRestDetectorPositionMappingProcess : public TRestEventProcess {
RESTMetadata << (fCreateGainMap ? "> " : " ")
<< "Create new correction std::map for each position" << RESTendl;
RESTMetadata << "output mapping file: " << fMappingSave << RESTendl;
RESTMetadata << "Energy cut for Threshold integral: " << any(fEnergyCutRange) << RESTendl;
RESTMetadata << "Energy cut for NGoodSignals: " << any(fNHitsCutRange) << RESTendl;
RESTMetadata << "Energy cut for Threshold integral: " << RESTValue(fEnergyCutRange) << RESTendl;
RESTMetadata << "Energy cut for NGoodSignals: " << RESTValue(fNHitsCutRange) << RESTendl;
RESTMetadata << "Binning: " << fNBinsX << ", " << fNBinsY << ", " << fNBinsZ << RESTendl;

EndPrintProcess();
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorSignalChannelActivityProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ class TRestDetectorSignalChannelActivityProcess : public TRestEventProcess {
TH1D* fReadoutChannelsHisto_MultiSignals_High; //!

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

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorSignalRecoveryProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class TRestDetectorSignalRecoveryProcess : public TRestEventProcess {
int GetAdjacentSignalIds(Int_t signalId, Int_t& idLeft, Int_t& idRight);

public:
any GetInputEvent() const override { return fInputSignalEvent; }
any GetOutputEvent() const override { return fOutputSignalEvent; }
RESTValue GetInputEvent() const override { return fInputSignalEvent; }
RESTValue GetOutputEvent() const override { return fOutputSignalEvent; }

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* eventInput) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorSignalToHitsProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class TRestDetectorSignalToHitsProcess : public TRestEventProcess {
Double_t fThreshold = 100.;

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

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorSignalViewerProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class TRestDetectorSignalViewerProcess : public TRestEventProcess {
// add here the members of your event process

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

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
10 changes: 5 additions & 5 deletions inc/TRestDetectorSingleChannelAnalysisProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class TRestDetectorSingleChannelAnalysisProcess : public TRestEventProcess {
std::map<int, double> fChannelGainError; // [MM id, channel gain error]

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

void FitChannelGain();
// See comments on CXX
Expand All @@ -66,9 +66,9 @@ class TRestDetectorSingleChannelAnalysisProcess : public TRestEventProcess {
RESTMetadata << (fCreateGainMap ? "> " : " ")
<< "Create new correction std::map for each channel" << RESTendl;
RESTMetadata << "output mapping file: " << fCalibSave << RESTendl;
RESTMetadata << "Energy cut for Threshold integral: " << any(fThrIntegralCutRange) << RESTendl;
RESTMetadata << "Energy cut for NGoodSignals: " << any(fNGoodSignalsCutRange) << RESTendl;
RESTMetadata << "Fit range for the spectra: " << any(fSpecFitRange) << RESTendl;
RESTMetadata << "Energy cut for Threshold integral: " << RESTValue(fThrIntegralCutRange) << RESTendl;
RESTMetadata << "Energy cut for NGoodSignals: " << RESTValue(fNGoodSignalsCutRange) << RESTendl;
RESTMetadata << "Fit range for the spectra: " << RESTValue(fSpecFitRange) << RESTendl;

EndPrintProcess();
}
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorTriggerAnalysisProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ class TRestDetectorTriggerAnalysisProcess : public TRestEventProcess {

public:
/// Returns a pointer to the input signal event
any GetInputEvent() const override { return fSignalEvent; }
RESTValue GetInputEvent() const override { return fSignalEvent; }

/// Returns a pointer to the input signal event
any GetOutputEvent() const override { return fSignalEvent; }
RESTValue GetOutputEvent() const override { return fSignalEvent; }

void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
Expand Down
2 changes: 1 addition & 1 deletion src/TRestDetector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ClassImp(TRestDetector);

void TRestDetector::PrintMetadata() {
TRestMetadata::PrintMetadata();
any cl = any(this, this->ClassName());
auto cl = RESTValue(this, this->ClassName());
for (int i = 0; i < cl.GetNumberOfDataMembers(); i++) {
if (cl.GetDataMember(i).name == "fgIsA") continue;
if (cl.GetDataMember(i).ToString() != "-1")
Expand Down