Skip to content
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

Add new data members to EventHeader #33

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 5 additions & 2 deletions artdaq-core-mu2e/Data/EventHeader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ namespace mu2e {

os << "EWT: " << std::setw(ewt_decimal_digits) << eh.ewt
<< " Event Mode: " << buf1
<< " RF_Marker_TDC: " << int(eh.rfmTDC)
<< " Flags: " << buf2;
<< " RF0_est: " << unsigned(eh.rfmTDC_est)
<< " Flags: " << buf2
<< " Duration: " << unsigned(eh.eventDuration)
<< " RF0_meas: " << unsigned(eh.rfmTDC_measured);

return os;
}

Expand Down
33 changes: 25 additions & 8 deletions artdaq-core-mu2e/Data/EventHeader.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
//
// Notes:
// 1) See Mu2e-doc-4914 for the definition of the informaton in the Heartbeat packet.
// See Mu2e-doc-19095, page 22 for the definition of the propose CFO Event Window Data Record.
// 2) EventWindowTag is redundant with the art::EventId but having it will be useful for
// consistency checking, particularly during commissioning and after major
// upgrades to TDAQ.
// Cost to keep this: about 200 GB in Raw data files summed over nominal Mu2e running.
// Estimate O(10) times that summed over all derived data products.
// 3) Did not use std::bitset for flags since, in g++ 9.3.0, it allocates space in chunks of 32 bits.
// 4) Fixme: add additional named bits in flags and EventMode as they are defined; maybe create
// 4) Fixme: add additional named bits in flags and EventMode as they are defined; maybe create
// separate classes for these?
// 5) Fixme: in the member function isFlagBit set, the code with thrown an exception if the requested
// bit is out of range. Is this the behaviour we want?
Expand Down Expand Up @@ -41,13 +42,29 @@ struct EventHeader {
rnr_check(rnrCheck), ndtc_check(ndtcCheck), dtc_check(dtcCheck), ewt_check(ewtCheck) {
}

EWT ewt = 0; // Event Window Tag
uint32_t mode = 0; // Event Mode
uint8_t rfmTDC = 0; // RF Marker TDC
uint8_t flags = 0; // on-spill bit and reserved flags
EventHeader( EWT ewt, uint32_t mode, uint8_t rfmTDC_est, uint8_t flags, uint16_t eventDuration, uint8_t rfmTDC_measured ):
ewt(ewt), mode(mode), rfmTDC_est(rfmTDC_est), flags(flags), eventDuration(eventDuration), rfmTDC_measured(rfmTDC_measured),
rnr_check(0), ndtc_check(0), dtc_check(0), ewt_check(0) {
}

EventHeader( EWT ewt, uint32_t mode, uint8_t rfmTDC_est, uint8_t flags, uint16_t eventDuration, uint8_t rfmTDC_measured,
uint8_t rnrCheck, uint8_t ndtcCheck, uint8_t dtcCheck, uint8_t ewtCheck):
ewt(ewt), mode(mode), rfmTDC_est(rfmTDC_est), flags(flags), eventDuration(eventDuration), rfmTDC_measured(rfmTDC_measured),
rnr_check(rnrCheck), ndtc_check(ndtcCheck), dtc_check(dtcCheck), ewt_check(ewtCheck) {
}

// Information from the Heartbeat Packet
EWT ewt = 0; // Event Window Tag
uint32_t mode = 0; // Event Mode
uint8_t rfmTDC_est = 0; // RF Marker TDC
uint8_t flags = 0; // on-spill bit and reserved flags

// Information from the CFO Event Window Data Record
uint16_t eventDuration = 0;
uint8_t rfmTDC_measured = 0;

uint8_t rnr_check : 1; //Round-robin check
uint8_t ndtc_check : 1; //cehck if nDTCs used in the event matches the configured value
uint8_t ndtc_check : 1; //check if nDTCs used in the event matches the configured value
uint8_t dtc_check : 1; //Check we have all the DTCs used in the event
uint8_t ewt_check : 1; //eventHeader EWT consistency with the subEvents header

Expand All @@ -60,11 +77,11 @@ struct EventHeader {
}

bool isFlagBitSet( int bit) const;

void initErrorChecks(){
rnr_check = 1;
dtc_check = 1;
ndtc_check = 1;
ndtc_check = 1;
ewt_check = 1;
}
};
Expand Down