Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
8484f5b
TRestDetectorReadoutPlane. Added fAxisX and fAxisY. Renamed fPlaneVec…
jgalan Jun 7, 2023
ecb8590
Increasing library version to 2.0
jgalan Jun 7, 2023
5737989
Adding default values
jgalan Jun 7, 2023
cba956e
TRestDetectorReadoutPlane. Adding Setters/Getters
jgalan Jun 7, 2023
949bb89
TRestDetectorReadout. Reading out plane axis Y and Y
jgalan Jun 7, 2023
14b5923
TRestDetectorReadoutPlane. Updating Print information
jgalan Jun 7, 2023
f0af64b
Updating processes to renamed TRestDetectorReadoutPlane::GetNormal() …
jgalan Jun 7, 2023
6ec8fcc
TRestDetectorReadoutPlane::Print. Fixing typo
jgalan Jun 7, 2023
ca7f8a2
Updating readout
jgalan Jun 7, 2023
87f4cb3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 7, 2023
da5c462
TRestDetectorReadout. X and Y plane axis are determined only by norma…
jgalan Jun 7, 2023
6c633c6
Merge branch 'jgalan-readoutplane-update' of github.com:rest-for-phys…
jgalan Jun 7, 2023
6b01b08
fix typos
lobis Jun 8, 2023
507c96d
remove fNModules field
lobis Jun 8, 2023
7fe541f
fix typos
lobis Jun 8, 2023
4f06a6e
Using single parameter height instead of TVector3 cathode position
lobis Jun 8, 2023
af6b85f
simplified initialization
lobis Jun 8, 2023
0368727
remove #pragma region (local IDE settings should not be committed)
lobis Jun 8, 2023
2af0c73
TRestDetectorReadout. Changing the sign of x-axis
jgalan Jun 8, 2023
7a05e4e
Readout updates
jgalan Jun 8, 2023
d003735
Merge branch 'jgalan-readoutplane-update' of github.com:rest-for-phys…
jgalan Jun 8, 2023
d1482dd
Fixing compilation issues
jgalan Jun 8, 2023
00ce0c5
compareFiles.py now validates only numeric values
jgalan Jun 8, 2023
536b3e3
compareFiles.py adding debug output
jgalan Jun 8, 2023
84ab6ec
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 8, 2023
131ee1e
compareFiles.py removing color codes
jgalan Jun 8, 2023
6d3dece
Merge branch 'jgalan-readoutplane-update' of github.com:rest-for-phys…
jgalan Jun 8, 2023
5c30eee
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 8, 2023
e998e63
compareFiles.py fixing typo
jgalan Jun 8, 2023
1e0b296
Merge branch 'jgalan-readoutplane-update' of github.com:rest-for-phys…
jgalan Jun 8, 2023
c50db37
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 8, 2023
7d41f20
updating compareFiles.py
jgalan Jun 8, 2023
7225451
Merge branch 'jgalan-readoutplane-update' of github.com:rest-for-phys…
jgalan Jun 8, 2023
33e2a74
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 8, 2023
f062893
Updating pr-badge.yml
jgalan Jun 8, 2023
0e67550
Merge branch 'jgalan-readoutplane-update' of github.com:rest-for-phys…
jgalan Jun 8, 2023
318ad25
Updating pipeline branch validation
jgalan Jun 8, 2023
1097ce4
use const refs
lobis Jun 9, 2023
3d21748
add TRestDetectorReadoutPlane::UpdateAxes, update how local reference…
lobis Jun 9, 2023
02348eb
Remove redundant TRestDetectorReadoutPlane::GetDistanceTo method
lobis Jun 9, 2023
05cab64
SetHeight with bad parameter raises exception
lobis Jun 9, 2023
97a0e26
TRestDetectorReadout. Adding rotation parameter
jgalan Jun 9, 2023
db710ad
use radians as angular unit
lobis Jun 9, 2023
6462b9b
TRestDetectorReadoutModule::fModuleRotation is now in radians
jgalan Jun 9, 2023
9babbdf
TRestDetectorReadoutModule::fModuleRotation renamed to fRotation
jgalan Jun 9, 2023
18327cb
TRestDetectorReadoutModule. Increasing class version
jgalan Jun 9, 2023
49679cb
renamed some parameters to be coherent with changes in TRestReadoutPlane
lobis Jun 9, 2023
5db58fd
use single parameter for min and max daq ids (daqidrange)
lobis Jun 9, 2023
844841b
remove confusing `GetSizeZ` method (should be called Y?). Single inte…
lobis Jun 9, 2023
da3356b
TRestDetectorReadoutPlane. Increasing class version
jgalan Jun 9, 2023
9d3b51d
TRestDetectorReadoutPlane. Recovering fAxisX and fAxisY
jgalan Jun 11, 2023
e0f4578
remove #pragma region directive
lobis Jun 12, 2023
d1521c2
TRestDetectorReadoutPlane. Fixing a piece of code where module rotati…
jgalan Jun 12, 2023
e78c227
prevent user from setting zero vector as normal
lobis Jun 12, 2023
8e40b13
verify axes and normal are orthonormal reference frame
lobis Jun 12, 2023
cc014aa
handle case when normal is exactly opposite to originalNormal. Add ad…
lobis Jun 12, 2023
2cd0ca7
update axes initialization. Add tests for axes
lobis Jun 12, 2023
65a2f67
TRestDetectorReadout. Adding default values for rotation and chargeCo…
jgalan Jun 13, 2023
95b166f
generateReadout.rml removing units from normal definition
jgalan Jun 13, 2023
a9831e7
TRestDetectorReadout. Charge collection default value removed
jgalan Jun 13, 2023
9a67237
readout/validation.txt Fixing validation axis orientation
jgalan Jun 13, 2023
05dafc9
pipeline/generateReadout.rml adding units
jgalan Jun 13, 2023
5a21b30
methods to go from/to global/local coords
lobis Jun 13, 2023
0fe6b35
rotation is now saved as a value from 0 to 2pi
lobis Jun 13, 2023
b244133
add method to set plane x-axis explicitly. Add validation
lobis Jun 13, 2023
a5159dc
rename originalNormal to zUnit (internal method)
lobis Jun 13, 2023
92da00a
Transferring basic-readouts validation
jgalan Jun 14, 2023
df24542
Merge branch 'jgalan-readoutplane-update' of github.com:rest-for-phys…
jgalan Jun 14, 2023
ee94ffb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 14, 2023
4c9606b
Updating to master validation
jgalan Jun 14, 2023
c912c30
Merge branch 'jgalan-readoutplane-update' of github.com:rest-for-phys…
jgalan Jun 14, 2023
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: 1 addition & 1 deletion .github/pr-badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
message: "Ok: $additions"
color: "green"
when: "$additions < 100"
- imageUrl: "https://github.com/rest-for-physics/detectorlib/actions/workflows/validation.yml/badge.svg?branch=$branchName"
- imageUrl: "https://github.com/rest-for-physics/detectorlib/actions/workflows/frameworkValidation.yml/badge.svg?branch=$branchName"
url: "https://github.com/rest-for-physics/detectorlib/commits/$branchName"
37 changes: 23 additions & 14 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Build and install
uses: rest-for-physics/framework/.github/actions/build@master
with:
cmake-flags: "-DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DREST_WELCOME=ON -DRESTLIB_DETECTOR=ON"
cmake-flags: "-DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DREST_WELCOME=ON -DRESTLIB_DETECTOR=ON -DREST_GARFIELD=ON"
branch: ${{ env.BRANCH_NAME }}
- name: Load REST libraries
run: |
Expand All @@ -68,6 +68,19 @@ jobs:
key: ${{ env.BRANCH_NAME }}-${{ github.sha }}
path: ${{ env.REST_PATH }}

#- name: Load Gas
# run: |
#source ${{ env.REST_PATH }}/thisREST.sh
#cd framework/pipeline/metadata/gas/
#restRoot -b -q LoadGasFromServerAndValidate.C
# Not working, not used in gitlab pipeline
#- name: Generate Gas
# run: |
# source ${{ env.REST_PATH }}/thisREST.sh
# source $(root-config --bindir)/thisroot.sh
# cd framework/pipeline/metadata/gas/
# restRoot -b -q GenerateDummyGas.C

readout:
name: "Readout"
runs-on: ubuntu-latest
Expand All @@ -86,19 +99,7 @@ jobs:
with:
key: ${{ env.BRANCH_NAME }}-${{ github.sha }}
path: ${{ env.REST_PATH }}
#- name: Load Gas
# run: |
#source ${{ env.REST_PATH }}/thisREST.sh
#cd framework/pipeline/metadata/gas/
#restRoot -b -q LoadGasFromServerAndValidate.C
# Not working, not used in gitlab pipeline
#- name: Generate Gas
# run: |
# source ${{ env.REST_PATH }}/thisREST.sh
# source $(root-config --bindir)/thisroot.sh
# cd framework/pipeline/metadata/gas/
# restRoot -b -q GenerateDummyGas.C
- name: Generate Readout
- name: Manager readout generation
run: |
source ${{ env.REST_PATH }}/thisREST.sh
cd ${{ env.DETECTOR_LIB_PATH }}/pipeline/readout
Expand All @@ -108,6 +109,14 @@ jobs:
ls
echo "Validating"
python3 compareFiles.py
- name: Basic Readout repository tests
run: |
source ${{ env.REST_PATH }}/thisREST.sh
git clone https://github.com/rest-for-physics/basic-readouts.git
cd basic-readouts/
restRoot -b -q GenerateReadouts.C'("basic.root")'
restRoot -b -q BasicValidation.C'("basic.root", "pixelDecoding")'

# We need to introduce basic validation here
# - diff validation.txt print.txt
# - name: Basic Readout
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LibraryVersion "1.9")
set(LibraryVersion "2.0")
add_definitions(-DLIBRARY_VERSION="${LibraryVersion}")

# find garfield libs and includes
Expand Down
85 changes: 36 additions & 49 deletions inc/TRestDetectorReadoutModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,19 @@
/// allows to integrate any number of independent readout channels.
class TRestDetectorReadoutModule {
private:
Int_t fModuleID; ///< The module id given by the readout definition.
Int_t fId = -1; ///< The module id given by the readout definition.

TString fModuleName; ///< The assigned module name.
std::string fName; ///< The assigned module name.

TVector2 fModuleOrigin; ///< The module (x, y) position relative to the readout plane position.
TVector2 fOrigin = {0, 0}; ///< The module (x, y) position relative to the readout plane position.

TVector2 fModuleSize; ///< The module (x, y) size. All pixels should be contained within this size.
TVector2 fSize = {0, 0}; ///< The module (x, y) size. All pixels should be contained within this size.

Double_t fModuleRotation; ///< The rotation of the module around the
///< position=(fModuleOriginX, fModuleOriginY) in
///< degrees.
/// The rotation of the module around the module origin (fModuleOriginX, fModuleOriginY) in radians.
Double_t fRotation = 0; //<

Int_t fMinimumDaqId; ///< The minimum daq channel id associated to the
///< module.
Int_t fMaximumDaqId; ///< The maximum daq channel id associated to the module.
std::pair<Int_t, Int_t> fDaqIdRange = {
-1, -1}; ///< The minimum and maximum daq channel ids associated to the module.

std::vector<TRestDetectorReadoutChannel>
fReadoutChannel; ///< A std::vector of the instances of TRestDetectorReadoutChannel
Expand All @@ -68,8 +66,8 @@ class TRestDetectorReadoutModule {
/// Converts the coordinates (xPhys,yPhys) in the readout plane reference
/// system to the readout module reference system.
inline TVector2 TransformToModuleCoordinates(const TVector2& xyPhysical) const {
auto coords = xyPhysical - fModuleOrigin;
TVector2 rot = coords.Rotate(-fModuleRotation * TMath::Pi() / 180.);
auto coords = xyPhysical - fOrigin;
TVector2 rot = coords.Rotate(-fRotation);

return rot;
}
Expand All @@ -79,8 +77,8 @@ class TRestDetectorReadoutModule {
inline TVector2 TransformToPlaneCoordinates(Double_t xMod, Double_t yMod) const {
TVector2 coords(xMod, yMod);

coords = coords.Rotate(fModuleRotation * TMath::Pi() / 180.);
coords += fModuleOrigin;
coords = coords.Rotate(fRotation);
coords += fOrigin;

return coords;
}
Expand All @@ -90,22 +88,19 @@ class TRestDetectorReadoutModule {
// Setters

/// Sets the module by id definition
inline void SetModuleID(Int_t modID) { fModuleID = modID; }
inline void SetModuleID(Int_t modID) { fId = modID; }

/// Sets the module size by definition using TVector2 input
inline void SetSize(const TVector2& size) { fModuleSize = size; }
inline void SetSize(const TVector2& size) { fSize = size; }

/// Sets the module origin by definition using TVector2 input
inline void SetOrigin(const TVector2& origin) { fModuleOrigin = origin; }

/// Sets the module origin by definition using (x,y) coordinates
inline void SetOrigin(Double_t x, Double_t y) { SetOrigin({x, y}); }
inline void SetOrigin(const TVector2& origin) { fOrigin = origin; }

/// Sets the module rotation in degrees
inline void SetRotation(Double_t rotation) { fModuleRotation = rotation; }
inline void SetRotation(Double_t rotation) { fRotation = rotation; }

/// Sets the name of the readout module
inline void SetName(const TString& name) { fModuleName = name; }
inline void SetName(const std::string& name) { fName = name; }

/// Sets the tolerance for independent pixel overlaps
inline void SetTolerance(Double_t tolerance) { fTolerance = tolerance; }
Expand All @@ -114,42 +109,32 @@ class TRestDetectorReadoutModule {
inline Double_t GetTolerance() const { return fTolerance; }

/// Returns the minimum daq id number
inline Int_t GetMinDaqID() const { return fMinimumDaqId; }
inline Int_t GetMinDaqID() const { return fDaqIdRange.first; }

/// Returns the maximum daq id number
inline Int_t GetMaxDaqID() const { return fMaximumDaqId; }
inline Int_t GetMaxDaqID() const { return fDaqIdRange.second; }

/// Returns the physical readout channel index for a given daq id channel
/// number
/// Returns the physical readout channel index for a given daq id channel number
inline Int_t DaqToReadoutChannel(Int_t daqChannel) {
for (size_t n = 0; n < GetNumberOfChannels(); n++)
if (GetChannel(n)->GetDaqID() == daqChannel) return n;
for (size_t n = 0; n < GetNumberOfChannels(); n++) {
if (GetChannel(n)->GetDaqID() == daqChannel) {
return n;
}
}
return -1;
}

/// Returns the module id
inline Int_t GetModuleID() const { return fModuleID; }

/// Returns the module x-coordinate origin
inline Double_t GetModuleOriginX() const { return fModuleOrigin.X(); }

/// Returns the module y-coordinate origin
inline Double_t GetModuleOriginY() const { return fModuleOrigin.Y(); }

/// Returns the module x-coordinate origin
inline Double_t GetOriginX() const { return fModuleOrigin.X(); }

/// Returns the module y-coordinate origin
inline Double_t GetOriginY() const { return fModuleOrigin.Y(); }
inline Int_t GetModuleID() const { return fId; }

/// Returns the module size x-coordinate
inline Double_t GetModuleSizeX() const { return fModuleSize.X(); }
/// Returns the module origin position
inline TVector2 GetOrigin() const { return fOrigin; }

/// Returns the module size y-coordinate
inline Double_t GetModuleSizeY() const { return fModuleSize.Y(); }
/// Returns the module size (x, y) in mm
inline TVector2 GetSize() const { return fSize; }

/// Returns the module rotation in degrees
inline Double_t GetModuleRotation() const { return fModuleRotation; }
inline Double_t GetRotation() const { return fRotation; }

/// Converts the coordinates given by TVector2 in the readout plane reference
/// system to the readout module reference system.
Expand All @@ -160,7 +145,7 @@ class TRestDetectorReadoutModule {
TVector2 GetPlaneCoordinates(const TVector2& p) { return TransformToPlaneCoordinates(p.X(), p.Y()); }

/// Returns the module name
inline const char* GetName() const { return fModuleName.Data(); }
inline const char* GetName() const { return fName.c_str(); }

/// Returns a pointer to the readout mapping
inline TRestDetectorReadoutMapping* GetMapping() { return &fMapping; }
Expand All @@ -169,7 +154,9 @@ class TRestDetectorReadoutModule {

/// Returns a pointer to a readout channel by index
inline TRestDetectorReadoutChannel* GetChannel(size_t n) {
if (n >= GetNumberOfChannels()) return nullptr;
if (n >= GetNumberOfChannels()) {
return nullptr;
}
return &fReadoutChannel[n];
}

Expand Down Expand Up @@ -226,6 +213,6 @@ class TRestDetectorReadoutModule {
// Destructor
virtual ~TRestDetectorReadoutModule();

ClassDef(TRestDetectorReadoutModule, 2);
ClassDef(TRestDetectorReadoutModule, 3);
};
#endif
Loading