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

more processes and metadata #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
set(LibraryVersion "1.0")
add_definitions(-DLIBRARY_VERSION="${LibraryVersion}")

COMPILELIB("")
set(deps detector)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is conceptually wrong to add dependencies to any legacy class or library

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, probably we just need the data members and the name of the class being preserved for data being read from previous ROOT files.


COMPILELIB(deps)

8 changes: 8 additions & 0 deletions inc/TRestDriftVolume.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef RestCore_TRestDriftVolume
#define RestCore_TRestDriftVolume

#include "TRestDetectorDriftVolume.h"

typedef TRestDetectorDriftVolume TRestDriftVolume;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class has been renamed? Not quite understand this class


#endif
9 changes: 9 additions & 0 deletions inc/TRestGainMap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef RestCore_TRestGainMap
#define RestCore_TRestGainMap


#include "TRestDetectorGainMap.h"

typedef TRestDetectorGainMap TRestGainMap;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here? The typedef shouldn't be included in TRestDetectorGainMap.h?


#endif
8 changes: 8 additions & 0 deletions inc/TRestGas.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef RestCore_TRestGas
#define RestCore_TRestGas

#include "TRestDetectorGas.h"

typedef TRestDetectorGas TRestGas;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same


#endif
90 changes: 90 additions & 0 deletions inc/TRestHitsEvent.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

#ifndef TRestSoft_TRestHitsEvent
#define TRestSoft_TRestHitsEvent

#include <TGraph.h>

#include <iostream>

#include "TArrayI.h"
#include "TAxis.h"
#include "TGraph2D.h"
#include "TH2F.h"
#include "TMath.h"
#include "TObject.h"
#include "TRestEvent.h"
#include "TRestHits.h"
#include "TVector3.h"

//! An event data type that register a vector of TRestHits,
//! allowing us to save a 3-coordinate position and energy.
class TRestHitsEvent : public TRestEvent {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that TRestHitsEvent should inherit from TRestLegacyEvent with some protection added

private:
/// An auxiliar TRestHits structure to register hits on XZ projection
TRestHits* fXZHits; //!
/// An auxiliar TRestHits structure to register hits on YZ projection
TRestHits* fYZHits; //!

/// An auxiliar TRestHits structure to register hits on XYZ projection
TRestHits* fXYZHits; //!

/// Stores the minimum x-position value. It is initialized by SetBoundaries.
Double_t fMinX; //!
/// Stores the maximum x-position value. It is initialized by SetBoundaries.
Double_t fMaxX; //!

/// Stores the minimum y-position value. It is initialized by SetBoundaries.
Double_t fMinY; //!
/// Stores the maximum y-position value. It is initialized by SetBoundaries.
Double_t fMaxY; //!

/// Stores the minimum z-position value. It is initialized by SetBoundaries.
Double_t fMinZ; //!
/// Stores the maximum z-position value. It is initialized by SetBoundaries.
Double_t fMaxZ; //!

protected:
// TODO These graphs should be placed in TRestHits?
// (following similar GetGraph implementation in TRestSignal)

/// An auxiliar TGraph pointer to visualize hits on XY-projection.
TGraph* fXYHitGraph; //!
/// An auxiliar TGraph pointer to visualize hits on XZ-projection.
TGraph* fXZHitGraph; //!
/// An auxiliar TGraph pointer to visualize hits on YZ-projection.
TGraph* fYZHitGraph; //!

/// An auxiliar TH2F histogram to visualize hits on XY-projection.
TH2F* fXYHisto; //!
/// An auxiliar TH2F histogram to visualize hits on YZ-projection.
TH2F* fYZHisto; //!
/// An auxiliar TH2F histogram to visualize hits on XZ-projection.
TH2F* fXZHisto; //!

TGraph2D* gxz = NULL; //!
TGraph2D* gyz = NULL; //!

/// An auxiliar TH1F histogram to visualize hits on X-projection.
TH1F* fXHisto; //!
/// An auxiliar TH1F histogram to visualize hits on Y-projection.
TH1F* fYHisto; //!
/// An auxiliar TH1F histogram to visualize hits on Z-projection.
TH1F* fZHisto; //!

/// The hits structure that is is saved to disk.
TRestHits fHits; //

public:
void Initialize() {
TRestEvent::Initialize();
fHits.RemoveHits();
}

// Construtor
TRestHitsEvent() {}
// Destructor
~TRestHitsEvent() {}

ClassDef(TRestHitsEvent, 2);
};
#endif
19 changes: 19 additions & 0 deletions inc/TRestLegacyProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,23 @@ class TRestLegacyProcess : public TRestEventProcess {

ClassDefOverride(TRestLegacyProcess, 0);
};

#define LegacyProcessDef(thisname, newname, n) \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not fan of macros and I don't understand the need of a macro here

any GetInputEvent() const final { return any((TRestEvent*)nullptr); } \
any GetOutputEvent() const final { return any((TRestEvent*)nullptr); } \
void InitProcess() final{}; \
TRestEvent* ProcessEvent(TRestEvent* eventInput) final { \
RESTError << "You are trying to execute a legacy process " #thisname << RESTendl; \
RESTError << "This is not allow, this class is kept for backward compatibility" << RESTendl; \
exit(1); \
return nullptr; \
} \
void EndProcess() final{}; \
const char* GetProcessName() const final { return #thisname; } \
thisname() { \
RESTWarning << "Creating legacy process " #thisname << RESTendl; \
RESTWarning << "This process is now implemented under" #newname << RESTendl; \
} \
ClassDef(thisname, n)

#endif
15 changes: 3 additions & 12 deletions inc/TRestRawZeroSuppresionProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "TRestLegacyProcess.h"

//! A process to identify signal and remove baseline noise from a TRestRawSignalEvent.
class TRestRawZeroSuppresionProcess : public TRestLegacyProcess {
class TRestRawZeroSuppresionProcess : public TRestEventProcess {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TRestRawZeroSuppresionProcess should inherit from TRestLegacyProcess

private:
/// The ADC range used for baseline offset definition
TVector2 fBaseLineRange;
Expand Down Expand Up @@ -54,7 +54,7 @@ class TRestRawZeroSuppresionProcess : public TRestLegacyProcess {

public:
/// It prints out the process parameters stored in the metadata structure
void PrintMetadata() override {
void PrintMetadata() {
BeginPrintProcess();
RESTMetadata << "Base line range definition : ( " << fBaseLineRange.X() << " , " << fBaseLineRange.Y()
<< " ) " << RESTendl;
Expand All @@ -71,15 +71,6 @@ class TRestRawZeroSuppresionProcess : public TRestLegacyProcess {
EndPrintProcess();
}

TRestRawZeroSuppresionProcess() {
RESTWarning << "Creating legacy process TRestRawZeroSuppresionProcess" << RESTendl;
RESTWarning << "This process is now implemented under TRestRawToDetectorSignalProcess" << RESTendl;
}
TRestRawZeroSuppresionProcess(char* cfgFileName) {
RESTWarning << "Creating legacy process TRestRawZeroSuppresionProcess" << RESTendl;
RESTWarning << "This process is now implemented under TRestRawToDetectorSignalProcess" << RESTendl;
}

ClassDefOverride(TRestRawZeroSuppresionProcess, 4);
LegacyProcessDef(TRestRawZeroSuppresionProcess, TRestRawToDetectorSignalProcess, 4);
};
#endif
36 changes: 36 additions & 0 deletions inc/TRestReadout.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*************************************************************************
* This file is part of the REST software framework. *
* *
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
* For more information see http://gifna.unizar.es/trex *
* *
* REST is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* REST is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have a copy of the GNU General Public License along with *
* REST in $REST_PATH/LICENSE. *
* If not, see http://www.gnu.org/licenses/. *
* For the list of contributors see $REST_PATH/CREDITS. *
*************************************************************************/

#ifndef RestCore_TRestReadout
#define RestCore_TRestReadout

#include <iostream>

#include "TObject.h"
#include "TRestMetadata.h"
#include "TRestDetectorReadout.h"

/// A metadata class to generate/store a readout description.
typedef TRestDetectorReadout TRestReadout;


#endif
35 changes: 35 additions & 0 deletions inc/TRestReadoutChannel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*************************************************************************
* This file is part of the REST software framework. *
* *
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
* For more information see http://gifna.unizar.es/trex *
* *
* REST is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* REST is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have a copy of the GNU General Public License along with *
* REST in $REST_PATH/LICENSE. *
* If not, see http://www.gnu.org/licenses/. *
* For the list of contributors see $REST_PATH/CREDITS. *
*************************************************************************/

#ifndef RestCore_TRestReadoutChannel
#define RestCore_TRestReadoutChannel

#include <iostream>

#include "TObject.h"
#include "TRestMetadata.h"

#include "TRestDetectorReadoutChannel.h"

typedef TRestDetectorReadoutChannel TRestReadoutChannel;

#endif
36 changes: 36 additions & 0 deletions inc/TRestReadoutMapping.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*************************************************************************
* This file is part of the REST software framework. *
* *
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
* For more information see http://gifna.unizar.es/trex *
* *
* REST is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* REST is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have a copy of the GNU General Public License along with *
* REST in $REST_PATH/LICENSE. *
* If not, see http://www.gnu.org/licenses/. *
* For the list of contributors see $REST_PATH/CREDITS. *
*************************************************************************/

#ifndef RestCore_TRestReadoutMapping
#define RestCore_TRestReadoutMapping

#include <iostream>

#include <TMatrixD.h>
#include <TObject.h>

#include "TRestDetectorReadoutMapping.h"

typedef TRestDetectorReadoutMapping TRestReadoutMapping;


#endif
37 changes: 37 additions & 0 deletions inc/TRestReadoutModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*************************************************************************
* This file is part of the REST software framework. *
* *
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
* For more information see http://gifna.unizar.es/trex *
* *
* REST is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* REST is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have a copy of the GNU General Public License along with *
* REST in $REST_PATH/LICENSE. *
* If not, see http://www.gnu.org/licenses/. *
* For the list of contributors see $REST_PATH/CREDITS. *
*************************************************************************/

#ifndef RestCore_TRestReadoutModule
#define RestCore_TRestReadoutModule

#include <iostream>

#include <TMath.h>
#include "TObject.h"

#include <TVector2.h>

#include "TRestDetectorReadoutModule.h"

typedef TRestDetectorReadoutModule TRestReadoutModule;

#endif
32 changes: 32 additions & 0 deletions inc/TRestReadoutPixel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*************************************************************************
* This file is part of the REST software framework. *
* *
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
* For more information see http://gifna.unizar.es/trex *
* *
* REST is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* REST is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have a copy of the GNU General Public License along with *
* REST in $REST_PATH/LICENSE. *
* If not, see http://www.gnu.org/licenses/. *
* For the list of contributors see $REST_PATH/CREDITS. *
*************************************************************************/

#ifndef RestCore_TRestReadoutPixel
#define RestCore_TRestReadoutPixel

#include <iostream>

#include "TRestDetectorReadoutPixel.h"

typedef TRestDetectorReadoutPixel TRestReadoutPixel;

#endif
Loading