Skip to content
Snippets Groups Projects
Commit a27c3a90 authored by Dinyar Rabady's avatar Dinyar Rabady Committed by Dinyar Rabady
Browse files

Micro optimisations

parent 0f0b3919
No related branches found
No related tags found
No related merge requests found
......@@ -137,7 +137,7 @@ inline std::pair<uint32_t, bool> StreamProcessor::ProcessOrbitHeader(
// Goes through orbit worth of data and fills the output memory with the calo
// data corresponding to the non-empty bunchcrossings, as marked in bx_vect
StreamProcessor::fillOrbitMetadata StreamProcessor::FillOrbitCalo(
std::vector<unsigned int> &bx_vect, char *rd_ptr, char *wr_ptr) {
const std::vector<unsigned int> &bx_vect, char *rd_ptr, char *wr_ptr) {
std::pair<uint32_t, bool> orbit_header = std::pair<uint32_t, bool>{
ProcessOrbitHeader(rd_ptr)}; //.second is the warning test enable bit
rd_ptr += 32; // +32 to account for orbit header
......@@ -153,7 +153,7 @@ StreamProcessor::fillOrbitMetadata StreamProcessor::FillOrbitCalo(
uint32_t bx = uint32_t{bx_vect[relbx]};
uint32_t orbit_ = uint32_t{orbit_header.first};
if (bx > 3554) {
orbit_--;
--orbit_;
} // fix for the fact that bx 3555 - 3564 are from the previous orbit
uint32_t header =
uint32_t{orbit_header.second}; // header can be added to later
......@@ -250,7 +250,7 @@ uint32_t StreamProcessor::FillBril(char *rd_ptr, char *wr_ptr, char *end_ptr) {
// Goes through orbit worth of data and fills the output memory with the muons
// corresponding to the non-empty bunchcrossings, as marked in bx_vect
StreamProcessor::fillOrbitMetadata StreamProcessor::FillOrbitMuon(
std::vector<unsigned int> &bx_vect, char *rd_ptr, char *wr_ptr) {
const std::vector<unsigned int> &bx_vect, char *rd_ptr, char *wr_ptr) {
std::pair<uint32_t, bool> orbit_header = std::pair<uint32_t, bool>{
ProcessOrbitHeader(rd_ptr)}; //.second is the warning test enable bit
rd_ptr += 32; // +32 to account for orbit header
......@@ -269,7 +269,7 @@ StreamProcessor::fillOrbitMetadata StreamProcessor::FillOrbitMuon(
bool BblocksOn[8];
uint32_t bx = uint32_t{bx_vect[relbx]};
if (bx > 3554) {
orbit--;
--orbit;
} // fix for the fact that bx 3555 - 3564 are from the previous orbit
for (unsigned int i = 0; i < 8; i++) {
uint32_t bxA = (bl->bx[i] >> shifts::bx) & masks::bx;
......@@ -393,10 +393,9 @@ void StreamProcessor::process(Slice &input, Slice &out) {
return;
}
while (endofpacket == false) {
std::vector<unsigned int> bx_vect;
uint32_t orbitCount = 0;
bool trailerError = false;
bx_vect = CountBX(input, rd_ptr, trailerError);
std::vector<unsigned int> bx_vect = CountBX(input, rd_ptr, trailerError);
if (trailerError == true) {
stats.orbit_trailer_error_count++;
LOG(WARNING)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment