Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 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
10 changes: 10 additions & 0 deletions shipLHC/AdvMuFilterHit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ AdvMuFilterHit::AdvMuFilterHit(Int_t detID, const std::vector<AdvMuFilterPoint*>
LOG(DEBUG) << "signal created";
}

AdvMuFilterHit::AdvMuFilterHit(Int_t detID, const std::vector<const AdvMuFilterPoint*>& V)
Copy link
Contributor

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)

Copy link
Contributor

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.

Copy link
Author

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)

I agree, I did not remove it because i feared it would brake the current digitization

Copy link
Author

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.

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)

Copy link
Contributor

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)

I agree, I did not remove it because i feared it would brake the current digitization
ok, then we can drop that removal for now, especially since we have a large PR by Nayana that relies on the old format.
We can factorize all these updates.

Copy link
Contributor

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.

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)

hm, then go ahead with your ideal, also advised, implementation, changing also the digitization.
Lets have all that in the PR.

: SndlhcHit(detID)
{
flag = true;
for (Int_t i = 0; i < 16; i++) {
fMasked[i] = kFALSE;
}
LOG(DEBUG) << "signal created";
}

// ----- Public method Print -------------------------------------------
void AdvMuFilterHit::Print() const
{
Expand Down
17 changes: 9 additions & 8 deletions shipLHC/AdvMuFilterHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class AdvMuFilterHit : public SndlhcHit

// Constructor from MuFilterPoint
AdvMuFilterHit(Int_t detID, const std::vector<AdvMuFilterPoint*>&);
Copy link
Contributor

Choose a reason for hiding this comment

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

AdvMuFilterHit(Int_t detID, const std::vector<AdvMuFilterPoint*>&);
this is no longer needed if we have the new version with const pointers

AdvMuFilterHit(Int_t detID, const std::vector<const AdvMuFilterPoint*>&);

/** Destructor **/
~AdvMuFilterHit() = default;
Expand All @@ -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
Expand Down
19 changes: 8 additions & 11 deletions shipLHC/AdvMuFilterPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,18 @@ class AdvMuFilterPoint : public FairMCPoint
virtual void Print(const Option_t* opt) const;

Int_t PdgCode() const { return fPdgCode; }
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:
Int_t fPdgCode;

/** Copy constructor **/
AdvMuFilterPoint(const AdvMuFilterPoint& point);
AdvMuFilterPoint operator=(const AdvMuFilterPoint& point);
ClassDef(AdvMuFilterPoint, 1)
};

Expand Down
10 changes: 10 additions & 0 deletions shipLHC/AdvTargetHit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The 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
{
Expand Down
17 changes: 9 additions & 8 deletions shipLHC/AdvTargetHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class AdvTargetHit : public SndlhcHit

// Constructor from AdvTargetPoint
AdvTargetHit(Int_t detID, const std::vector<AdvTargetPoint*>&);
Copy link
Contributor

Choose a reason for hiding this comment

The 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;
Expand All @@ -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
Expand Down
19 changes: 8 additions & 11 deletions shipLHC/AdvTargetPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ class AdvTargetPoint : public FairMCPoint
virtual void Print(const Option_t* opt) const;

Int_t PdgCode() const { return fPdgCode; }
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; };
TVector3 GetEntryPoint() const { return TVector3(2 * fX - fExitX, 2 * fY - fExitY, 2 * fZ - fExitZ); }
TVector3 GetExitPoint() const { return TVector3(fExitX, fExitY, fExitZ); }

Expand All @@ -59,9 +59,6 @@ class AdvTargetPoint : public FairMCPoint
Double_t fExitY;
Double_t fExitZ;

/** Copy constructor **/
AdvTargetPoint(const AdvTargetPoint& point);
AdvTargetPoint operator=(const AdvTargetPoint& point);
ClassDef(AdvTargetPoint, 1)
};

Expand Down
4 changes: 2 additions & 2 deletions shipdata/SndlhcHit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ SndlhcHit::SndlhcHit(Int_t detID,Int_t nP,Int_t nS)
}
}

Float_t SndlhcHit::GetSignal(Int_t nChannel)
Float_t SndlhcHit::GetSignal(Int_t nChannel) const
{
return signals[nChannel];
}
Float_t SndlhcHit::GetTime(Int_t nChannel)
Float_t SndlhcHit::GetTime(Int_t nChannel) const
{
return times[nChannel];
}
Expand Down
12 changes: 6 additions & 6 deletions shipdata/SndlhcHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ class SndlhcHit : public TObject

/** Accessors **/
Int_t GetDetectorID() const { return fDetectorID; };
Float_t GetSignal(Int_t nChannel=0);
Float_t GetTime(Int_t nChannel=0);
Float_t GetSignal(Int_t nChannel=0) const;
Float_t GetTime(Int_t nChannel=0) const;
Int_t GetnSiPMs() const { return nSiPMs; };
Int_t GetnSides() const { return nSides; };
/** Modifiers **/
void SetDigi(Float_t s, Float_t t,Int_t i=0) { signals[i]=trunc(100*s)/100;times[i]=trunc(1000*t)/1000.; }
void SetDetectorID(Int_t detID) { fDetectorID = detID; }
void SetDaqID(Int_t i, Int_t k, Int_t board_id, Int_t tofpet_id, Int_t tofpet_channel) { fDaqID[i] = k*100000 + board_id * 1000 + tofpet_id * 100 + tofpet_channel; }
Int_t GetBoardID(Int_t i) { return int((fDaqID[i]%100000)/1000);}
Int_t GetTofpetID(Int_t i) { return int((fDaqID[i]%1000)/100);}
Int_t Getchannel(Int_t i) { return fDaqID[i]%100;}
Int_t GetRawHitIndex(Int_t i=0) { return int(fDaqID[i]/100000);}
Int_t GetBoardID(Int_t i) const { return int((fDaqID[i]%100000)/1000);}
Int_t GetTofpetID(Int_t i) const { return int((fDaqID[i]%1000)/100);}
Int_t Getchannel(Int_t i) const { return fDaqID[i]%100;}
Int_t GetRawHitIndex(Int_t i=0) const { return int(fDaqID[i]/100000);}

// to be implemented by the subdetector

Expand Down