From 6a39b717829769f8a3d83bbf6bdc7ce2cf1262b2 Mon Sep 17 00:00:00 2001 From: Sean Murray Date: Tue, 23 Nov 2021 18:32:55 +0100 Subject: [PATCH] TRD fix to get tracklets and digits out of sm16 and sm17 --- .../Detectors/TRD/include/DataFormatsTRD/RawDataStats.h | 1 + Detectors/TRD/reconstruction/src/DataReader.cxx | 2 ++ Detectors/TRD/reconstruction/src/TrackletsParser.cxx | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/DataFormats/Detectors/TRD/include/DataFormatsTRD/RawDataStats.h b/DataFormats/Detectors/TRD/include/DataFormatsTRD/RawDataStats.h index 36b518b3ee671..2b8d4f74d1f3a 100644 --- a/DataFormats/Detectors/TRD/include/DataFormatsTRD/RawDataStats.h +++ b/DataFormats/Detectors/TRD/include/DataFormatsTRD/RawDataStats.h @@ -89,6 +89,7 @@ enum OptionBits { TRDIgnoreDigitHCHeaderBit, TRDIgnoreTrackletHCHeaderBit, TRDEnableRootOutputBit, + TRDFixSM1617Bit, TRDGenerateStats }; diff --git a/Detectors/TRD/reconstruction/src/DataReader.cxx b/Detectors/TRD/reconstruction/src/DataReader.cxx index 59e9c6c59a68b..ce645a9337e10 100644 --- a/Detectors/TRD/reconstruction/src/DataReader.cxx +++ b/Detectors/TRD/reconstruction/src/DataReader.cxx @@ -52,6 +52,7 @@ void customize(std::vector& workflowOptions) {"halfchamberwords", VariantType::Int, 0, {"Fix half chamber for when it is version is 0.0 integer value of additional header words, ignored if version is not 0.0"}}, {"halfchambermajor", VariantType::Int, 0, {"Fix half chamber for when it is version is 0.0 integer value of major version, ignored if version is not 0.0"}}, {"ignore-digithcheader", VariantType::Bool, false, {"Ignore the digithalf chamber header for cross referencing, take rdh/cru as authorative."}}, + {"fixsm1617", VariantType::Bool, false, {"Fix the missing bit in the tracklet hc header of supermodules 16 and 17. Requires option tracklethcheader 2"}}, {"tracklethcheader", VariantType::Int, 2, {"Status of TrackletHalfChamberHeader 0 off always, 1 iff tracklet data, 2 on always"}}, {"histogramsfile", VariantType::String, "histos.root", {"Name of the histogram file, so one can run multiple per node"}}, //{"generate-stats", VariantType::Bool, true, {"Generate the state message sent to qc"}}, @@ -102,6 +103,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) binaryoptions[o2::trd::TRDIgnoreTrackletHCHeaderBit] = cfgc.options().get("ignore-tracklethcheader"); binaryoptions[o2::trd::TRDEnableRootOutputBit] = cfgc.options().get("enable-root-output"); binaryoptions[o2::trd::TRDByteSwapBit] = cfgc.options().get("trd-datareader-enablebyteswapdata"); + binaryoptions[o2::trd::TRDFixSM1617Bit] = cfgc.options().get("fixsm1617"); //binaryoptions[o2::trd::TRDGenerateStats] = cfgc.options().get("generate-stats"); binaryoptions[o2::trd::TRDGenerateStats] = true; //cfgc.options().get("generate-stats"); diff --git a/Detectors/TRD/reconstruction/src/TrackletsParser.cxx b/Detectors/TRD/reconstruction/src/TrackletsParser.cxx index 4ed0082bb87c5..620293b6e2c9a 100644 --- a/Detectors/TRD/reconstruction/src/TrackletsParser.cxx +++ b/Detectors/TRD/reconstruction/src/TrackletsParser.cxx @@ -201,6 +201,11 @@ int TrackletsParser::Parse() mWordsRead++; mState = StateTrackletMCMHeader; // now we should read a MCMHeader next time through loop } else { //not TrackletHCHeader + if (mState == StateTrackletHCHeader) { + if ((mFEEID.supermodule > 15) && mOptions[TRDFixSM1617Bit] && mTrackletHCHeaderState == 2) { + *word |= 1 << 11; //flip bit eleven for the tracklethcheader for the last 2 supermodules (bug/misconfiguration/broken/other) not sure why its like this yet, but it is. + } + } if (((*word) & 0x80000001) == 0x80000001 && mState == StateTrackletMCMHeader) { //TrackletMCMHeader has the bits on either end always 1 //mcmheader mTrackletMCMHeader = (TrackletMCMHeader*)&(*word);