-
Notifications
You must be signed in to change notification settings - Fork 4
adding const where needed #83
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ class AdvMuFilterHit : public SndlhcHit | |
|
|
||
| // Constructor from MuFilterPoint | ||
| AdvMuFilterHit(Int_t detID, const std::vector<AdvMuFilterPoint*>&); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| AdvMuFilterHit(Int_t detID, const std::vector<const AdvMuFilterPoint*>&); | ||
|
|
||
| /** Destructor **/ | ||
| ~AdvMuFilterHit() = default; | ||
|
|
@@ -24,14 +25,14 @@ class AdvMuFilterHit : public SndlhcHit | |
| bool isValid() const { return flag; } | ||
| bool isMasked(Int_t i) const { return fMasked[i]; } | ||
| void SetMasked(Int_t i) { fMasked[i] = kTRUE; } | ||
| int constexpr GetLayer() { return fDetectorID >> 17; } | ||
| int constexpr GetPlane() { return (fDetectorID >> 16) % 2; } // 0 is X-plane, 1 is Y-pane | ||
| int constexpr GetRow() { return (fDetectorID >> 13) % 8; } | ||
| int constexpr GetColumn() { return (fDetectorID >> 11) % 4; } | ||
| int constexpr GetSensor() { return (fDetectorID >> 10) % 2; } | ||
| int constexpr GetStrip() { return (fDetectorID) % 1024; } | ||
| int constexpr GetModule() { return advsnd::hcal::columns * GetRow() + 1 + GetColumn(); } | ||
| bool constexpr isVertical() { return GetPlane() == 1; }; | ||
| int constexpr GetLayer() const { return fDetectorID >> 17; } | ||
| int constexpr GetPlane() const { return (fDetectorID >> 16) % 2; } // 0 is X-plane, 1 is Y-pane | ||
| int constexpr GetRow() const { return (fDetectorID >> 13) % 8; } | ||
| int constexpr GetColumn() const { return (fDetectorID >> 11) % 4; } | ||
| int constexpr GetSensor() const { return (fDetectorID >> 10) % 2; } | ||
| int constexpr GetStrip() const { return (fDetectorID) % 1024; } | ||
| int constexpr GetModule() const { return advsnd::hcal::columns * GetRow() + 1 + GetColumn(); } | ||
| bool constexpr isVertical() const { return GetPlane() == 1; }; | ||
|
|
||
| private: | ||
| bool flag; ///< flag | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,16 @@ AdvTargetHit::AdvTargetHit(Int_t detID, const std::vector<AdvTargetPoint*>& V) | |
| LOG(DEBUG) << "signal created"; | ||
| } | ||
|
|
||
| AdvTargetHit::AdvTargetHit(Int_t detID, const std::vector<const AdvTargetPoint*>& V) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as for the constructor in AdvMuFilter |
||
| : SndlhcHit(detID) | ||
| { | ||
| flag = true; | ||
| for (Int_t i = 0; i < 16; i++) { | ||
| fMasked[i] = kFALSE; | ||
| } | ||
| LOG(DEBUG) << "signal created"; | ||
| } | ||
|
|
||
| // ----- Public method Print ------------------------------------------- | ||
| void AdvTargetHit::Print() const | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ class AdvTargetHit : public SndlhcHit | |
|
|
||
| // Constructor from AdvTargetPoint | ||
| AdvTargetHit(Int_t detID, const std::vector<AdvTargetPoint*>&); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as for the constructor in AdvMuFilter |
||
| AdvTargetHit(Int_t detID, const std::vector<const AdvTargetPoint*>&); | ||
|
|
||
| /** Destructor **/ | ||
| ~AdvTargetHit() = default; | ||
|
|
@@ -24,14 +25,14 @@ class AdvTargetHit : public SndlhcHit | |
| bool isValid() const { return flag; } | ||
| bool isMasked(Int_t i) const { return fMasked[i]; } | ||
| void SetMasked(Int_t i) { fMasked[i] = kTRUE; } | ||
| int constexpr GetLayer() { return fDetectorID >> 17; } | ||
| int constexpr GetPlane() { return (fDetectorID >> 16) % 2; } // 0 is X-plane, 1 is Y-pane | ||
| int constexpr GetRow() { return (fDetectorID >> 13) % 8; } | ||
| int constexpr GetColumn() { return (fDetectorID >> 11) % 4; } | ||
| int constexpr GetSensor() { return (fDetectorID >> 10) % 2; } | ||
| int constexpr GetStrip() { return (fDetectorID) % 1024; } | ||
| int constexpr GetModule() { return advsnd::target::columns * GetRow() + 1 + GetColumn(); } | ||
| bool constexpr isVertical() { return GetPlane() == 1; }; | ||
| int constexpr GetLayer() const { return fDetectorID >> 17; } | ||
| int constexpr GetPlane() const { return (fDetectorID >> 16) % 2; } // 0 is X-plane, 1 is Y-pane | ||
| int constexpr GetRow() const { return (fDetectorID >> 13) % 8; } | ||
| int constexpr GetColumn() const { return (fDetectorID >> 11) % 4; } | ||
| int constexpr GetSensor() const { return (fDetectorID >> 10) % 2; } | ||
| int constexpr GetStrip() const { return (fDetectorID) % 1024; } | ||
| int constexpr GetModule() const { return advsnd::target::columns * GetRow() + 1 + GetColumn(); } | ||
| bool constexpr isVertical() const { return GetPlane() == 1; }; | ||
|
|
||
| private: | ||
| bool flag; ///< flag | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can safely remove the previous version of this constructor in the lines above
AdvMuFilterHit::AdvMuFilterHit(Int_t detID, const std::vector<AdvMuFilterPoint*>& V)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait a sec, shouldn't this be
const std::vector<AdvMuFilterPoint>&?AFAIK the recommended way to store and read classes in TTree and RNTuple is as
std::vector<T>unless not possible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I did not remove it because i feared it would brake the current digitization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be my ideal implementation too, as a minimal change from the current digitization i kept the pointers (also if we implement this as the only constructor the current digitization would definetly break)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, then go ahead with your ideal, also advised, implementation, changing also the digitization.
Lets have all that in the PR.