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

TRestRawSignalRecoverChannelsProcess: removed #ifdef REST_DetectorLib… #67

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 2 additions & 4 deletions inc/TRestRawSignalRecoverChannelsProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#ifndef RestCore_TRestRawSignalRecoverChannelsProcess
#define RestCore_TRestRawSignalRecoverChannelsProcess

#ifdef REST_DetectorLib
// #ifdef REST_DetectorLib
#include <TRestDetectorReadout.h>
#endif
// #endif
#include <TRestEventProcess.h>

#include "TRestRawSignalEvent.h"
Expand All @@ -39,10 +39,8 @@ class TRestRawSignalRecoverChannelsProcess : public TRestEventProcess {
/// A pointer to the specific TRestRawSignalEvent input
TRestRawSignalEvent* fOutputSignalEvent; //!

#ifdef REST_DetectorLib
/// A pointer to the readout previously defined inside REST.
TRestDetectorReadout* fReadout; //!
#endif

void Initialize() override;

Expand Down
19 changes: 10 additions & 9 deletions src/TRestRawSignalRecoverChannelsProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,18 @@ void TRestRawSignalRecoverChannelsProcess::LoadConfig(const string& configFilena
/// TRestDetectorReadout.
///
void TRestRawSignalRecoverChannelsProcess::InitProcess() {
#ifdef REST_DetectorLib
// #ifdef REST_DetectorLib
fReadout = GetMetadata<TRestDetectorReadout>();

if (fReadout == nullptr) {
cout << "REST ERROR: Readout has not been initialized" << endl;
exit(-1);
}
#else
RESTError << "TRestRawSignalRecoverChannelsProcess will not be active." << RESTendl;
RESTError << "REST was not compiled with detectorlib" << RESTendl;
RESTError << "Please, remove this process or compile REST with detector library" << RESTendl;
#endif
// #else
// RESTError << "TRestRawSignalRecoverChannelsProcess will not be active." << RESTendl;
// RESTError << "REST was not compiled with detectorlib" << RESTendl;
// RESTError << "Please, remove this process or compile REST with detector library" << RESTendl;
// #endif
}

///////////////////////////////////////////////
Expand All @@ -175,7 +175,8 @@ TRestEvent* TRestRawSignalRecoverChannelsProcess::ProcessEvent(TRestEvent* evInp
// cout << "Channel id : " << fChannelIds[x] << " Left : " << idL << " Right
// : " << idR << endl;

if( fOutputSignalEvent->GetSignalIndex(fChannelIds[x])> 0 ) fOutputSignalEvent->RemoveSignalWithId(fChannelIds[x]);
if (fOutputSignalEvent->GetSignalIndex(fChannelIds[x]) > 0)
fOutputSignalEvent->RemoveSignalWithId(fChannelIds[x]);

if (idL == -1 || idR == -1) continue;

Expand Down Expand Up @@ -223,7 +224,7 @@ TRestEvent* TRestRawSignalRecoverChannelsProcess::ProcessEvent(TRestEvent* evInp

void TRestRawSignalRecoverChannelsProcess::GetAdjacentSignalIds(Int_t signalId, Int_t& idLeft,
Int_t& idRight) {
#ifdef REST_DetectorLib
// #ifdef REST_DetectorLib
for (int p = 0; p < fReadout->GetNumberOfReadoutPlanes(); p++) {
TRestDetectorReadoutPlane* plane = fReadout->GetReadoutPlane(p);
for (int m = 0; m < plane->GetNumberOfModules(); m++) {
Expand All @@ -242,7 +243,7 @@ void TRestRawSignalRecoverChannelsProcess::GetAdjacentSignalIds(Int_t signalId,
}
}
}
#endif
// #endif

idLeft = -1;
idRight = -1;
Expand Down