Skip to content

Commit 63530bc

Browse files
committed
Revert "merge TRestHits update"
This reverts commit edb4033, reversing changes made to 8f7f6c5.
1 parent 24e7bb6 commit 63530bc

17 files changed

+140
-206
lines changed

source/events/addons/src/TRestMesh.cxx

+1-4
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,8 @@ Int_t TRestMesh::GetNodeZ(Double_t z) {
128128
}
129129

130130
void TRestMesh::SetNodesFromHits(TRestHits* hits) {
131-
double nan = numeric_limits<double>::quiet_NaN();
132131
for (int hit = 0; hit < hits->GetNumberOfHits(); hit++) {
133-
REST_HitType type = hits->GetType(hit);
134-
this->AddNode(type == YZ ? nan : hits->GetX(hit), type == XZ ? nan : hits->GetY(hit),
135-
hits->GetZ(hit));
132+
this->AddNode(hits->GetX(hit), hits->GetY(hit), hits->GetZ(hit));
136133
}
137134

138135
Regrouping();

source/events/general/inc/TRestHits.h

+11-12
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
#include "TMatrixD.h"
3131
#include "TObject.h"
3232

33-
34-
enum REST_HitType { unknown = -1, X = 2, Y = 3, Z = 5, XY = 6, XZ = 10, YZ = 15, XYZ = 30 };
3533
//! It let save an event as a set of punctual deposition.
3634
//! It saves a 3-coordinate position and an energy for each punctual deposition.
3735
class TRestHits : public TObject {
3836
private:
37+
enum REST_HitType { unknown = -1, XZ = 1, YZ = 2, XY = 3, XYZ = 0 };
38+
3939
public:
4040
Int_t fNHits; ///< Number of punctual energy depositions, it is the lenght
4141
///< for all the array
@@ -51,7 +51,7 @@ class TRestHits : public TObject {
5151
// (units us, 0 is time of decay)
5252
std::vector<Float_t> fEnergy; // [fNHits] Energy deposited at each
5353
// 3-coordinate position (units keV)
54-
std::vector <REST_HitType> fType; //
54+
REST_HitType fType; //!
5555
//! Changes the origin of the Cartesian coordinate system
5656
void Translate(Int_t n, Double_t x, Double_t y, Double_t z);
5757
/// Event is rotated in XYZ.
@@ -63,8 +63,8 @@ class TRestHits : public TObject {
6363
TVector3 vMean); // vMean is the mean position of the event from
6464
// GetMeanPosition()
6565

66-
void AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t t = 0, REST_HitType type = XYZ);
67-
void AddHit(TVector3 pos, Double_t en, Double_t t = 0, REST_HitType type = XYZ);
66+
void AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t t = 0);
67+
void AddHit(TVector3 pos, Double_t en, Double_t t = 0);
6868
void AddHit(TRestHits& hits, Int_t n);
6969

7070
void RemoveHits();
@@ -78,10 +78,10 @@ class TRestHits : public TObject {
7878
virtual void SwapHits(Int_t i, Int_t j);
7979
virtual void RemoveHit(int n);
8080

81-
virtual Bool_t areXY();
82-
virtual Bool_t areXZ();
83-
virtual Bool_t areYZ();
84-
virtual Bool_t areXYZ();
81+
Bool_t areXY();
82+
Bool_t areXZ();
83+
Bool_t areYZ();
84+
Bool_t areXYZ();
8585

8686
Bool_t isNaN(Int_t n);
8787

@@ -103,7 +103,6 @@ class TRestHits : public TObject {
103103
Double_t GetY(int n) { return ((Double_t)fY[n]); } // return value in mm
104104
Double_t GetZ(int n) { return ((Double_t)fZ[n]); } // return value in mm
105105
Double_t GetTime(int n) { return ((Double_t)fT[n]); } // return value in us
106-
REST_HitType GetType(int n) { return fType[n]; }
107106

108107
TVector3 GetPosition(int n);
109108
TVector3 GetVector(int i, int j);
@@ -184,11 +183,11 @@ class TRestHits : public TObject {
184183

185184
virtual void PrintHits(Int_t nHits = -1);
186185

187-
// Construtor
186+
// Constructor
188187
TRestHits();
189188
// Destructor
190189
~TRestHits();
191190

192-
ClassDef(TRestHits, 5);
191+
ClassDef(TRestHits, 4);
193192
};
194193
#endif

source/events/general/inc/TRestHitsEvent.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class TRestHitsEvent : public TRestEvent {
7373
TRestHits* fHits; //->
7474

7575
public:
76-
void AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t t = 0, REST_HitType type = XYZ);
77-
void AddHit(TVector3 pos, Double_t en, Double_t t = 0, REST_HitType type = XYZ);
76+
void AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t t = 0);
77+
void AddHit(TVector3 pos, Double_t en, Double_t t = 0);
7878

7979
void RemoveHits();
8080

@@ -96,8 +96,6 @@ class TRestHitsEvent : public TRestEvent {
9696
/// Returns the Z-coordinate of hit entry `n` in mm.
9797
Double_t GetZ(int n) { return fHits->GetZ(n); }
9898

99-
REST_HitType GetType(int n) { return fHits->GetType(n); }
100-
10199
/// Returns the squared distance between hits `n` and `m`.
102100
Double_t GetDistance2(int n, int m) { return fHits->GetDistance2(n, m); }
103101

source/events/general/inc/TRestVolumeHits.h

+15-13
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
/// TRestVolumeHits.h
99
///
1010
/// Event class to store signals form simulation and acquisition
11-
/// events. We should make sure that all the hit points in it is
12-
/// with same type. e.g. all XZ hits
11+
/// events
1312
///
1413
/// oct 2015: First concept
1514
/// Created as part of the conceptualization of existing REST
@@ -33,24 +32,27 @@ class TRestVolumeHits : public TRestHits {
3332
std::vector<Float_t> fSigmaZ; // [fNHits] Sigma on Z axis for each volume hit (units microms)
3433

3534
public:
36-
void AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t time, REST_HitType type, Double_t sigmax, Double_t sigmay,
35+
void AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t sigmax, Double_t sigmay,
3736
Double_t sigmaz);
38-
void AddHit(TVector3 pos, Double_t en, Double_t time, REST_HitType type, TVector3 sigma);
39-
void AddHit(TRestVolumeHits& hits, Int_t n);
37+
void AddHit(TVector3 pos, Double_t en, TVector3 sigma);
38+
void AddHit(TRestVolumeHits& hits, Int_t n) {
39+
Double_t x = hits.GetX(n);
40+
Double_t y = hits.GetY(n);
41+
Double_t z = hits.GetZ(n);
42+
Double_t en = hits.GetEnergy(n);
43+
Double_t sx = hits.GetSigmaX(n);
44+
Double_t sy = hits.GetSigmaY(n);
45+
Double_t sz = hits.GetSigmaZ(n);
46+
47+
AddHit(x, y, z, en, sx, sy, sz);
48+
}
4049

4150
void RemoveHits();
4251
void MergeHits(Int_t n, Int_t m);
4352

4453
void RemoveHit(int n);
4554
void SortByEnergy();
4655
void SwapHits(Int_t i, Int_t j);
47-
48-
49-
Bool_t areXY();
50-
Bool_t areXZ();
51-
Bool_t areYZ();
52-
Bool_t areXYZ();
53-
5456
// Setters
5557

5658
// Getters
@@ -72,6 +74,6 @@ class TRestVolumeHits : public TRestHits {
7274
// Destructor
7375
~TRestVolumeHits();
7476

75-
ClassDef(TRestVolumeHits, 2);
77+
ClassDef(TRestVolumeHits, 1);
7678
};
7779
#endif

0 commit comments

Comments
 (0)