Unpacks/packs the MC Legacy data originally produced by the GctBlockPacker class. More...
#include <GctFormatTranslateMCLegacy.h>
Public Member Functions | |
virtual bool | convertBlock (const unsigned char *d, const GctBlockHeader &hdr) |
Get digis from the block - will return true if it succeeds, false otherwise. More... | |
GctFormatTranslateMCLegacy (bool hltMode=false, bool unpackSharedRegions=false) | |
Constructor. More... | |
virtual GctBlockHeader | generateBlockHeader (const unsigned char *data) const |
Generate a block header from four 8-bit values. More... | |
void | writeAllRctCaloRegionBlock (unsigned char *d, const L1CaloRegionCollection *rctCalo) |
Writes the giant hack that is the RCT Calo Regions block. More... | |
void | writeGctOutEmAndEnergyBlock (unsigned char *d, const L1GctEmCandCollection *iso, const L1GctEmCandCollection *nonIso, const L1GctEtTotalCollection *etTotal, const L1GctEtHadCollection *etHad, const L1GctEtMissCollection *etMiss) |
Writes GCT output EM and energy sums block into an unsigned char array, starting at the position pointed to by d. More... | |
void | writeGctOutJetBlock (unsigned char *d, const L1GctJetCandCollection *cenJets, const L1GctJetCandCollection *forJets, const L1GctJetCandCollection *tauJets, const L1GctHFRingEtSumsCollection *hfRingSums, const L1GctHFBitCountsCollection *hfBitCounts, const L1GctHtMissCollection *htMiss) |
Writes GCT output jet cands and counts into an unsigned char array, starting at the position pointed to by d. More... | |
void | writeRctEmCandBlocks (unsigned char *d, const L1CaloEmCollection *rctEm) |
Writes the 4 RCT EM Candidate blocks. More... | |
virtual | ~GctFormatTranslateMCLegacy () |
Destructor. More... | |
Public Member Functions inherited from GctFormatTranslateBase | |
GctFormatTranslateBase (bool hltMode=false, bool unpackSharedRegions=false) | |
Constructor. More... | |
const std::string & | getBlockDescription (const GctBlockHeader &header) const |
Get block description. More... | |
void | setPackingBxId (uint32_t bxId) |
void | setPackingEventId (uint32_t eventId) |
void | setUnpackCollections (GctUnpackCollections *const collections) |
Set the pointer to the unpack collections. More... | |
virtual | ~GctFormatTranslateBase () |
Destructor. More... | |
Protected Member Functions | |
virtual BlockLengthMap & | blockLengthMap () |
get the static block ID to block-length map. More... | |
virtual const BlockLengthMap & | blockLengthMap () const |
get the static block ID to block-length map. More... | |
virtual BlockNameMap & | blockNameMap () |
get the static block ID to block-name map. More... | |
virtual const BlockNameMap & | blockNameMap () const |
get the static block ID to blockname map. More... | |
virtual uint32_t | generateRawHeader (const uint32_t blockId, const uint32_t nSamples, const uint32_t bxId, const uint32_t eventId) const |
Returns a raw 32-bit header word generated from the blockId, number of time samples, bunch-crossing and event IDs. More... | |
virtual BlockIdToEmCandIsoBoundMap & | internEmIsoBounds () |
get the static intern EM cand isolated boundary map. More... | |
virtual const BlockIdToEmCandIsoBoundMap & | internEmIsoBounds () const |
get the static intern EM cand isolated boundary map. More... | |
virtual BlkToRctCrateMap & | rctEmCrateMap () |
get the static block ID to RCT crate map for electrons. More... | |
virtual const BlkToRctCrateMap & | rctEmCrateMap () const |
get static the block ID to RCT crate map for electrons. More... | |
virtual BlkToRctCrateMap & | rctJetCrateMap () |
get the static block ID to RCT crate map for jets More... | |
virtual const BlkToRctCrateMap & | rctJetCrateMap () const |
get the static block ID to RCT crate map for jets More... | |
Protected Member Functions inherited from GctFormatTranslateBase | |
void | blockDoNothing (const unsigned char *d, const GctBlockHeader &hdr) |
The null unpack function - obviously common to all formats. More... | |
bool | checkBlock (const GctBlockHeader &hdr) const |
Performs checks on the block header to see if the block is possible to unpack or not. More... | |
GctUnpackCollections *const | colls () const |
Protected access to the GCT Unpack Collections. More... | |
L1GctJetCandCollection *const | gctJets (const unsigned cat) const |
Get a specific jet candandiate collection using the JetCandCategory enumeration. More... | |
bool | hltMode () const |
Protected interface to get HLT optimisation mode flag. More... | |
const uint32_t | packingBxId () const |
Get the BxId to be used when packing data. More... | |
const uint32_t | packingEventId () const |
Get the EventId to be used when packing data. More... | |
const SourceCardRouting & | srcCardRouting () const |
Protected interface to the unpackSharedRegions commissioning option. More... | |
bool | unpackSharedRegions () const |
void | writeRawHeader (unsigned char *data, uint32_t blockId, uint32_t nSamples) const |
Writes a raw block header into the raw data array for a given block ID and number of time-samples. More... | |
Private Types | |
typedef std::map< unsigned int, PtrToUnpackFn > | BlockIdToUnpackFnMap |
Typedef for a block ID to unpack function map. More... | |
typedef void(GctFormatTranslateMCLegacy::* | PtrToUnpackFn )(const unsigned char *, const GctBlockHeader &) |
Function pointer typdef to a block unpack function. More... | |
Private Member Functions | |
void | blockToAllRctCaloRegions (const unsigned char *d, const GctBlockHeader &hdr) |
Unpack All RCT Calo Regions ('orrible hack for DigiToRaw use) More... | |
void | blockToFibres (const unsigned char *d, const GctBlockHeader &hdr) |
unpack Fibres More... | |
void | blockToFibresAndToRctEmCand (const unsigned char *d, const GctBlockHeader &hdr) |
unpack Fibres and RCT EM Candidates More... | |
void | blockToGctEmCandsAndEnergySums (const unsigned char *d, const GctBlockHeader &hdr) |
unpack GCT EM Candidates and energy sums. More... | |
void | blockToGctJetCandsAndCounts (const unsigned char *d, const GctBlockHeader &hdr) |
Unpack GCT Jet Candidates and jet counts. More... | |
void | blockToRctEmCand (const unsigned char *d, const GctBlockHeader &hdr) |
unpack RCT EM Candidates More... | |
template<typename Collection > | |
bool | findBx0OffsetInCollection (unsigned &bx0Offset, const Collection *coll) |
Template function (used in packing) that will find the offset to first item in a collection vector where bx=0. More... | |
Static Private Attributes | |
static BlockLengthMap | m_blockLength = GctFormatTranslateMCLegacy::BlockLengthMap() |
Map to translate block number to fundamental size of a block (i.e. for 1 time-sample). More... | |
static BlockNameMap | m_blockName = GctFormatTranslateMCLegacy::BlockNameMap() |
Map to hold a description for each block number. More... | |
static BlockIdToUnpackFnMap | m_blockUnpackFn = GctFormatTranslateMCLegacy::BlockIdToUnpackFnMap() |
Block ID to unpack function map. More... | |
static BlockIdToEmCandIsoBoundMap | m_internEmIsoBounds = GctFormatTranslateMCLegacy::BlockIdToEmCandIsoBoundMap() |
static BlkToRctCrateMap | m_rctEmCrate = GctFormatTranslateMCLegacy::BlkToRctCrateMap() |
Map to relate capture block ID to the RCT crate the data originated from (for electrons). More... | |
static BlkToRctCrateMap | m_rctJetCrate = GctFormatTranslateMCLegacy::BlkToRctCrateMap() |
Map to relate capture block ID to the RCT crate the data originated from (for jets). More... | |
Additional Inherited Members | |
Protected Types inherited from GctFormatTranslateBase | |
typedef std::map< unsigned int, unsigned int > | BlkToRctCrateMap |
Typedef for mapping block ID to RCT crate. More... | |
typedef std::map< unsigned int, IsoBoundaryPair > | BlockIdToEmCandIsoBoundMap |
A typdef for mapping Block IDs to IsoBoundaryPairs. More... | |
typedef std::map< unsigned int, unsigned int > | BlockLengthMap |
Block ID to Block Length map. More... | |
typedef std::pair< unsigned int, unsigned int > | BlockLengthPair |
Block ID/length pair. More... | |
typedef std::map< unsigned int, std::string > | BlockNameMap |
Block ID to Block Description map. More... | |
typedef std::pair< unsigned int, std::string > | BlockNamePair |
Block ID/Description pair. More... | |
enum | EmCandCatagory { NON_ISO_EM_CANDS, ISO_EM_CANDS, NUM_EM_CAND_CATEGORIES } |
An enum of the EM candidate types. More... | |
typedef std::pair< unsigned int, unsigned int > | IsoBoundaryPair |
enum | JetCandCategory { TAU_JETS, FORWARD_JETS, CENTRAL_JETS, NUM_JET_CATEGORIES } |
Useful enumeration for jet candidate pack/unpack. More... | |
Unpacks/packs the MC Legacy data originally produced by the GctBlockPacker class.
The data produced by the legacy GctBlockPacker class should have a firmware version header that wasn't set to anything, i.e.: 0x00000000
Definition at line 22 of file GctFormatTranslateMCLegacy.h.
|
private |
Typedef for a block ID to unpack function map.
Definition at line 108 of file GctFormatTranslateMCLegacy.h.
|
private |
Function pointer typdef to a block unpack function.
Definition at line 106 of file GctFormatTranslateMCLegacy.h.
|
explicit |
Constructor.
hltMode | - set true to unpack only BX zero and GCT output data (i.e. to run as quick as possible). |
unpackSharedRegions | - this is a commissioning option to unpack the shared RCT calo regions. |
Definition at line 28 of file GctFormatTranslateMCLegacy.cc.
References GctFormatTranslateBase::blockDoNothing(), blockToAllRctCaloRegions(), blockToFibresAndToRctEmCand(), blockToGctEmCandsAndEnergySums(), blockToGctJetCandsAndCounts(), m_blockLength, m_blockName, m_blockUnpackFn, and m_rctEmCrate.
|
virtual |
|
inlineprotectedvirtual |
get the static block ID to block-length map.
Implements GctFormatTranslateBase.
Definition at line 77 of file GctFormatTranslateMCLegacy.h.
References m_blockLength.
Referenced by generateBlockHeader(), and writeRctEmCandBlocks().
|
inlineprotectedvirtual |
get the static block ID to block-length map.
Implements GctFormatTranslateBase.
Definition at line 78 of file GctFormatTranslateMCLegacy.h.
References m_blockLength.
|
inlineprotectedvirtual |
get the static block ID to block-name map.
Implements GctFormatTranslateBase.
Definition at line 80 of file GctFormatTranslateMCLegacy.h.
References m_blockName.
|
inlineprotectedvirtual |
get the static block ID to blockname map.
Implements GctFormatTranslateBase.
Definition at line 81 of file GctFormatTranslateMCLegacy.h.
References m_blockName.
|
private |
Unpack All RCT Calo Regions ('orrible hack for DigiToRaw use)
Definition at line 652 of file GctFormatTranslateMCLegacy.cc.
References GctFormatTranslateBase::colls(), GctFormatTranslateBase::hltMode(), errorMatrix2Lands_multiChannel::id, LogDebug, GctBlockHeader::nSamples(), and GctUnpackCollections::rctCalo().
Referenced by GctFormatTranslateMCLegacy().
|
private |
unpack Fibres
Definition at line 626 of file GctFormatTranslateMCLegacy.cc.
References GctBlockHeader::blockId(), GctBlockHeader::blockLength(), GctFormatTranslateBase::colls(), GctUnpackCollections::gctFibres(), GctFormatTranslateBase::hltMode(), i, LogDebug, GctBlockHeader::nSamples(), and AlCaHLTBitMon_ParallelJobs::p.
Referenced by blockToFibresAndToRctEmCand().
|
private |
unpack Fibres and RCT EM Candidates
Definition at line 646 of file GctFormatTranslateMCLegacy.cc.
References blockToFibres(), and blockToRctEmCand().
Referenced by GctFormatTranslateMCLegacy().
|
private |
unpack GCT EM Candidates and energy sums.
Definition at line 458 of file GctFormatTranslateMCLegacy.cc.
References GctBlockHeader::blockId(), GctFormatTranslateBase::colls(), GctUnpackCollections::gctEtHad(), GctUnpackCollections::gctEtMiss(), GctUnpackCollections::gctEtTot(), GctUnpackCollections::gctIsoEm(), GctUnpackCollections::gctNonIsoEm(), GctFormatTranslateBase::hltMode(), and GctBlockHeader::nSamples().
Referenced by GctFormatTranslateMCLegacy().
|
private |
Unpack GCT Jet Candidates and jet counts.
Definition at line 511 of file GctFormatTranslateMCLegacy.cc.
References GctBlockHeader::blockId(), GctFormatTranslateBase::colls(), GctFormatTranslateBase::FORWARD_JETS, L1GctHFBitCounts::fromConcHFBitCounts(), L1GctHFRingEtSums::fromConcRingSums(), GctUnpackCollections::gctHfBitCounts(), GctUnpackCollections::gctHfRingEtSums(), GctUnpackCollections::gctHtMiss(), GctFormatTranslateBase::gctJets(), GctFormatTranslateBase::hltMode(), fwrapper::jets, GctBlockHeader::nSamples(), GctFormatTranslateBase::NUM_JET_CATEGORIES, and GctFormatTranslateBase::TAU_JETS.
Referenced by GctFormatTranslateMCLegacy().
|
private |
unpack RCT EM Candidates
Definition at line 572 of file GctFormatTranslateMCLegacy.cc.
References GctBlockHeader::blockId(), GctBlockHeader::blockLength(), GctFormatTranslateBase::colls(), GctFormatTranslateBase::hltMode(), i, errorMatrix2Lands_multiChannel::id, LogDebug, GctBlockHeader::nSamples(), AlCaHLTBitMon_ParallelJobs::p, GctUnpackCollections::rctEm(), rctEmCrateMap(), SourceCardRouting::SFPtoEMU(), and GctFormatTranslateBase::srcCardRouting().
Referenced by blockToFibresAndToRctEmCand().
|
virtual |
Get digis from the block - will return true if it succeeds, false otherwise.
Implements GctFormatTranslateBase.
Definition at line 130 of file GctFormatTranslateMCLegacy.cc.
References GctBlockHeader::blockId(), GctFormatTranslateBase::checkBlock(), data, m_blockUnpackFn, GctBlockHeader::nSamples(), and edm::second().
|
private |
Template function (used in packing) that will find the offset to first item in a collection vector where bx=0.
Returns false if fails to find any item in the collection with bx=0
Definition at line 702 of file GctFormatTranslateMCLegacy.cc.
References findQualityFiles::size.
Referenced by writeGctOutEmAndEnergyBlock(), and writeGctOutJetBlock().
|
virtual |
Generate a block header from four 8-bit values.
Implements GctFormatTranslateBase.
Definition at line 102 of file GctFormatTranslateMCLegacy.cc.
References blockLengthMap(), and TrackValidation_HighPurity_cff::valid.
|
protectedvirtual |
Returns a raw 32-bit header word generated from the blockId, number of time samples, bunch-crossing and event IDs.
Implements GctFormatTranslateBase.
Definition at line 436 of file GctFormatTranslateMCLegacy.cc.
|
inlineprotectedvirtual |
get the static intern EM cand isolated boundary map.
Implements GctFormatTranslateBase.
Definition at line 89 of file GctFormatTranslateMCLegacy.h.
References m_internEmIsoBounds.
|
inlineprotectedvirtual |
get the static intern EM cand isolated boundary map.
Implements GctFormatTranslateBase.
Definition at line 90 of file GctFormatTranslateMCLegacy.h.
References m_internEmIsoBounds.
|
inlineprotectedvirtual |
get the static block ID to RCT crate map for electrons.
Implements GctFormatTranslateBase.
Definition at line 83 of file GctFormatTranslateMCLegacy.h.
References m_rctEmCrate.
Referenced by blockToRctEmCand(), and writeRctEmCandBlocks().
|
inlineprotectedvirtual |
get static the block ID to RCT crate map for electrons.
Implements GctFormatTranslateBase.
Definition at line 84 of file GctFormatTranslateMCLegacy.h.
References m_rctEmCrate.
|
inlineprotectedvirtual |
get the static block ID to RCT crate map for jets
Implements GctFormatTranslateBase.
Definition at line 86 of file GctFormatTranslateMCLegacy.h.
References m_rctJetCrate.
|
inlineprotectedvirtual |
get the static block ID to RCT crate map for jets
Implements GctFormatTranslateBase.
Definition at line 87 of file GctFormatTranslateMCLegacy.h.
References m_rctJetCrate.
void GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock | ( | unsigned char * | d, |
const L1CaloRegionCollection * | rctCalo | ||
) |
Writes the giant hack that is the RCT Calo Regions block.
Definition at line 382 of file GctFormatTranslateMCLegacy.cc.
References L1CaloRegion::bx(), L1CaloRegion::et(), L1CaloRegion::fineGrain(), i, L1CaloRegion::isHbHe(), LogDebug, L1CaloRegion::mip(), evf::evtn::offset(), L1CaloRegion::overFlow(), L1CaloRegion::quiet(), L1CaloRegion::rctCard(), L1CaloRegion::rctCrate(), L1CaloRegion::rctRegionIndex(), findQualityFiles::size, and GctFormatTranslateBase::writeRawHeader().
Referenced by GctDigiToRaw::produce().
void GctFormatTranslateMCLegacy::writeGctOutEmAndEnergyBlock | ( | unsigned char * | d, |
const L1GctEmCandCollection * | iso, | ||
const L1GctEmCandCollection * | nonIso, | ||
const L1GctEtTotalCollection * | etTotal, | ||
const L1GctEtHadCollection * | etHad, | ||
const L1GctEtMissCollection * | etMiss | ||
) |
Writes GCT output EM and energy sums block into an unsigned char array, starting at the position pointed to by d.
d | must be pointing at the position where the EM Output block header should be written! |
Definition at line 146 of file GctFormatTranslateMCLegacy.cc.
References findBx0OffsetInCollection(), GctFormatTranslateBase::ISO_EM_CANDS, LogDebug, GctFormatTranslateBase::NON_ISO_EM_CANDS, GctFormatTranslateBase::NUM_EM_CAND_CATEGORIES, evf::evtn::offset(), and GctFormatTranslateBase::writeRawHeader().
Referenced by GctDigiToRaw::produce().
void GctFormatTranslateMCLegacy::writeGctOutJetBlock | ( | unsigned char * | d, |
const L1GctJetCandCollection * | cenJets, | ||
const L1GctJetCandCollection * | forJets, | ||
const L1GctJetCandCollection * | tauJets, | ||
const L1GctHFRingEtSumsCollection * | hfRingSums, | ||
const L1GctHFBitCountsCollection * | hfBitCounts, | ||
const L1GctHtMissCollection * | htMiss | ||
) |
Writes GCT output jet cands and counts into an unsigned char array, starting at the position pointed to by d.
d | must be pointing at the position where the Jet Output block header should be written! |
Definition at line 218 of file GctFormatTranslateMCLegacy.cc.
References GctFormatTranslateBase::CENTRAL_JETS, L1GctHtMiss::et(), findBx0OffsetInCollection(), GctFormatTranslateBase::FORWARD_JETS, fwrapper::jets, LogDebug, GctFormatTranslateBase::NUM_JET_CATEGORIES, evf::evtn::offset(), L1GctHtMiss::overFlow(), L1GctHtMiss::phi(), GctFormatTranslateBase::TAU_JETS, tmp, and GctFormatTranslateBase::writeRawHeader().
Referenced by GctDigiToRaw::produce().
void GctFormatTranslateMCLegacy::writeRctEmCandBlocks | ( | unsigned char * | d, |
const L1CaloEmCollection * | rctEm | ||
) |
Writes the 4 RCT EM Candidate blocks.
Definition at line 299 of file GctFormatTranslateMCLegacy.cc.
References begin, blockLengthMap(), L1CaloEmCand::bx(), trackerHits::c, SourceCardRouting::EmuToSfpData::eIsoCardId, SourceCardRouting::EmuToSfpData::eIsoRank, SourceCardRouting::EmuToSfpData::eIsoRegionId, SourceCardRouting::EMUtoSFP(), end, SourceCardRouting::EmuToSfpData::eNonIsoCardId, SourceCardRouting::EmuToSfpData::eNonIsoRank, SourceCardRouting::EmuToSfpData::eNonIsoRegionId, i, L1CaloEmCand::index(), getHLTprescales::index, L1CaloEmCand::isolated(), LogDebug, L1CaloEmCand::rank(), L1CaloEmCand::rctCard(), L1CaloEmCand::rctCrate(), rctEmCrateMap(), L1CaloEmCand::rctRegion(), SourceCardRouting::EmuToSfpData::sfp, findQualityFiles::size, GctFormatTranslateBase::srcCardRouting(), and GctFormatTranslateBase::writeRawHeader().
Referenced by GctDigiToRaw::produce().
|
staticprivate |
Map to translate block number to fundamental size of a block (i.e. for 1 time-sample).
Definition at line 114 of file GctFormatTranslateMCLegacy.h.
Referenced by blockLengthMap(), and GctFormatTranslateMCLegacy().
|
staticprivate |
Map to hold a description for each block number.
Definition at line 117 of file GctFormatTranslateMCLegacy.h.
Referenced by blockNameMap(), and GctFormatTranslateMCLegacy().
|
staticprivate |
Block ID to unpack function map.
Definition at line 130 of file GctFormatTranslateMCLegacy.h.
Referenced by convertBlock(), and GctFormatTranslateMCLegacy().
|
staticprivate |
A map of Block IDs to IsoBoundaryPairs for storing the location of the isolated Internal EM cands in the pipeline, as this differs with Block ID.
Definition at line 127 of file GctFormatTranslateMCLegacy.h.
Referenced by internEmIsoBounds().
|
staticprivate |
Map to relate capture block ID to the RCT crate the data originated from (for electrons).
Definition at line 120 of file GctFormatTranslateMCLegacy.h.
Referenced by GctFormatTranslateMCLegacy(), and rctEmCrateMap().
|
staticprivate |
Map to relate capture block ID to the RCT crate the data originated from (for jets).
Definition at line 123 of file GctFormatTranslateMCLegacy.h.
Referenced by rctJetCrateMap().