| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -38,15 +38,28 @@ using ArrayADC = std::array<ADC_t, constants::TIMEBINS>; | |
| // this negates the need for need alternate indexing strategies. | ||
| // if you are trying to go from mcm/rob/adc to pad/row and back to mcm/rob/adc , | ||
| // you may not end up in the same place, you need to remember to manually check for shared pads. | ||
| // Pre Trigger phase: | ||
| // LHC clock runs at 40.08MHz, ADC run at 1/4 or 10MHz and the trap runs at 120MHz or LHC*3. | ||
| // The phase then has 4 values although it has 4 bits, which is rather confusing. | ||
| // The trap clock can therefore be in 1 of 12 positions relative to the ADC clock. | ||
| // Only 4 of those positions are valid, hence there is 4 values for pre trigger, 0,3,7,11. | ||
| // vaguely graphically below: | ||
| // LHC ___---___---___---___---___---___---___---___---___---___---___---___---___---___---___---___---___---___---___---___---___---___---___ | ||
| // TRAP _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ | ||
| // ADC ___------------____________------------____________------------____________------------____________------------____________------------ | ||
| // _________------------____________------------____________------------____________------------____________------------____________------ | ||
| // ---____________------------____________------------____________------------____________------------____________------------____________ | ||
| // ---------____________------------____________------------____________------------____________------------____________------------______ | ||
| // PreTrig _________------________________________------________________________------________________________------________________________------ | ||
|
|
||
| class Digit | ||
| { | ||
| public: | ||
| Digit() = default; | ||
| ~Digit() = default; | ||
| Digit(const int det, const int row, const int pad, const ArrayADC adc); | ||
| Digit(const int det, const int row, const int pad); // add adc data in a seperate step | ||
| Digit(const int det, const int rob, const int mcm, const int channel, const ArrayADC adc); | ||
| Digit(const int det, const int row, const int pad, const ArrayADC adc, const uint8_t phase = 0); | ||
| Digit(const int det, const int row, const int pad); // add adc data, and pretrigger phase in a seperate step | ||
| Digit(const int det, const int rob, const int mcm, const int channel, const ArrayADC adc, const uint8_t phase = 0); | ||
| Digit(const int det, const int rob, const int mcm, const int channel); // add adc data in a seperate step | ||
|
|
||
| // Copy | ||
| Expand All | @@ -59,17 +72,19 @@ class Digit | |
| void setROB(int row, int col) { mROB = HelperMethods::getROBfromPad(row, col); } // set ROB from pad row, column | ||
| void setMCM(int row, int col) { mMCM = HelperMethods::getMCMfromPad(row, col); } // set MCM from pad row, column | ||
| void setChannel(int channel) { mChannel = channel; } | ||
| void setDetector(int det) { mDetector = det; } | ||
| void setDetector(int det) { mDetector = ((mDetector & 0xf000) | (det & 0xfff)); } | ||
| void setADC(ArrayADC const& adc) { mADC = adc; } | ||
| void setADC(const gsl::span<ADC_t>& adc) { std::copy(adc.begin(), adc.end(), mADC.begin()); } | ||
| void setPreTrigPhase(const unsigned int phase) { mDetector = (((phase & 0xf) << 12) | (mDetector & 0xfff)); } | ||
| // Get methods | ||
| int getDetector() const { return mDetector; } | ||
| int getHCId() const { return mDetector * 2 + (mROB % 2); } | ||
| int getDetector() const { return mDetector & 0xfff; } | ||
| int getHCId() const { return (mDetector & 0xfff) * 2 + (mROB % 2); } | ||
| int getPadRow() const { return HelperMethods::getPadRowFromMCM(mROB, mMCM); } | ||
| int getPadCol() const { return HelperMethods::getPadColFromADC(mROB, mMCM, mChannel); } | ||
| int getROB() const { return mROB; } | ||
| int getMCM() const { return mMCM; } | ||
| int getChannel() const { return mChannel; } | ||
| int getPreTrigPhase() const { return ((mDetector >> 12) & 0xf); } | ||
| bool isSharedDigit() const; | ||
|
|
||
| ArrayADC const& getADC() const { return mADC; } | ||
| Expand All | @@ -83,13 +98,13 @@ class Digit | |
| } | ||
|
|
||
| private: | ||
| std::uint16_t mDetector{0}; // detector, the chamber [0-539] | ||
| std::uint16_t mDetector{0}; // detector, the chamber [0-539] ; detector value is in 0-11 [0-1023], 12-15 is the phase of the trigger from the digit hc header. | ||
|
Comment thread
Copy link
Copy Markdown
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. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitycould you make this comment a bit clearer please? I am confused by the 0-1023. Maybe you can put explicitly which bits are used for what and the valid ranges for both.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
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. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityAlso, please increase ClassDef version
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Collaborator
Author
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. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitydone
Sorry, something went wrong.
All reactions
|
||
| std::uint8_t mROB{0}; // read out board within chamber [0-7] [0-5] depending on C0 or C1 | ||
| std::uint8_t mMCM{0}; // MCM chip this digit is attached [0-15] | ||
| std::uint8_t mChannel{0}; // channel of this chip the digit is attached to, see TDP chapter ?? TODO fill in later the figure number of ROB to MCM mapping picture | ||
|
|
||
| ArrayADC mADC{}; // ADC vector (30 time-bins) | ||
| ClassDefNV(Digit, 3); | ||
| ClassDefNV(Digit, 4); | ||
| }; | ||
|
|
||
| std::ostream& operator<<(std::ostream& stream, const Digit& d); | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitywhich one is it now, 4 or 12 values?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIt can have one of 12 values as per drawing, but only 4 are valid.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.