Abstract interface for RawToDigi/DigiToRaw conversions of GCT data. More...
#include <GctFormatTranslateBase.h>
Public Member Functions | |
virtual bool | convertBlock (const unsigned char *d, const GctBlockHeader &hdr)=0 |
Get digis from the block - will return true if it succeeds, false otherwise. More... | |
GctFormatTranslateBase (bool hltMode=false, bool unpackSharedRegions=false) | |
Constructor. More... | |
virtual GctBlockHeader | generateBlockHeader (const unsigned char *data) const =0 |
Generate a block header from four 8-bit values. 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 Types | |
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... | |
Protected Member Functions | |
void | blockDoNothing (const unsigned char *d, const GctBlockHeader &hdr) |
The null unpack function - obviously common to all formats. More... | |
virtual const BlockLengthMap & | blockLengthMap () const =0 |
get the static block ID to block-length map. More... | |
virtual const BlockNameMap & | blockNameMap () const =0 |
get the static block ID to blockname map. 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... | |
virtual uint32_t | generateRawHeader (const uint32_t blockId, const uint32_t nSamples, const uint32_t bxId, const uint32_t eventId) const =0 |
Returns a raw 32-bit header word generated from the blockId, number of time samples, bunch-crossing and event IDs. More... | |
bool | hltMode () const |
Protected interface to get HLT optimisation mode flag. More... | |
virtual const BlockIdToEmCandIsoBoundMap & | internEmIsoBounds () const =0 |
get the static intern EM cand isolated boundary map. 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... | |
virtual const BlkToRctCrateMap & | rctEmCrateMap () const =0 |
get static the block ID to RCT crate map for electrons. More... | |
virtual const BlkToRctCrateMap & | rctJetCrateMap () const =0 |
get the static block ID to RCT crate map for jets 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 Attributes | |
GctUnpackCollections * | m_collections |
Pointer to the output collections object. More... | |
bool | m_hltMode |
If true, unpack only BX zero and GCT output data (i.e. to run as quickly as possible) More... | |
uint32_t | m_packingBxId |
The bunch-crossing ID to be used by the data packing methods. More... | |
uint32_t | m_packingEventId |
The event ID to be used by the data packing methods. More... | |
SourceCardRouting | m_srcCardRouting |
Source card mapping info. More... | |
bool | m_unpackSharedRegions |
If true, the shared RCT Calo regions will be unpacked also. More... | |
Static Private Attributes | |
static const std::string | INVALID_BLOCK_HEADER_STR = "UNKNOWN/INVALID BLOCK HEADER" |
Abstract interface for RawToDigi/DigiToRaw conversions of GCT data.
This class provides the common interface/functionality for the various concrete classes that can translate to/from specific RAW formats.
Definition at line 25 of file GctFormatTranslateBase.h.
|
protected |
Typedef for mapping block ID to RCT crate.
Definition at line 69 of file GctFormatTranslateBase.h.
|
protected |
A typdef for mapping Block IDs to IsoBoundaryPairs.
Definition at line 79 of file GctFormatTranslateBase.h.
|
protected |
Block ID to Block Length map.
Definition at line 63 of file GctFormatTranslateBase.h.
|
protected |
Block ID/length pair.
Definition at line 64 of file GctFormatTranslateBase.h.
|
protected |
Block ID to Block Description map.
Definition at line 65 of file GctFormatTranslateBase.h.
|
protected |
Block ID/Description pair.
Definition at line 66 of file GctFormatTranslateBase.h.
|
protected |
A typedef that holds the inclusive lower and upper bounds of pipeline gct trigger object pair number for isolated EM candidates. I.e. if the first and second trig object pair in the pipeline payload are isolated cands (4 iso in total), then the IsoBoundaryPair would be (0,1).
Definition at line 76 of file GctFormatTranslateBase.h.
|
protected |
An enum of the EM candidate types.
Note that the order here mimicks the order in the RAW data format.
Enumerator | |
---|---|
NON_ISO_EM_CANDS | |
ISO_EM_CANDS | |
NUM_EM_CAND_CATEGORIES |
Definition at line 57 of file GctFormatTranslateBase.h.
|
protected |
Useful enumeration for jet candidate pack/unpack.
Note that the order here mimicks the order in the RAW data format.
Enumerator | |
---|---|
TAU_JETS | |
FORWARD_JETS | |
CENTRAL_JETS | |
NUM_JET_CATEGORIES |
Definition at line 61 of file GctFormatTranslateBase.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 11 of file GctFormatTranslateBase.cc.
|
virtual |
|
inlineprotected |
The null unpack function - obviously common to all formats.
Definition at line 128 of file GctFormatTranslateBase.h.
|
protectedpure virtual |
get the static block ID to block-length map.
Implemented in GctFormatTranslateMCLegacy, GctFormatTranslateV38, and GctFormatTranslateV35.
|
protectedpure virtual |
get the static block ID to blockname map.
Implemented in GctFormatTranslateMCLegacy, GctFormatTranslateV38, and GctFormatTranslateV35.
Referenced by getBlockDescription().
|
protected |
Performs checks on the block header to see if the block is possible to unpack or not.
Definition at line 47 of file GctFormatTranslateBase.cc.
References LogDebug, GctBlockHeader::nSamples(), and GctBlockHeader::valid().
Referenced by GctFormatTranslateV35::convertBlock(), GctFormatTranslateV38::convertBlock(), and GctFormatTranslateMCLegacy::convertBlock().
|
inlineprotected |
Protected access to the GCT Unpack Collections.
Definition at line 97 of file GctFormatTranslateBase.h.
References m_collections.
Referenced by GctFormatTranslateMCLegacy::blockToAllRctCaloRegions(), GctFormatTranslateV35::blockToFibres(), GctFormatTranslateV38::blockToFibres(), GctFormatTranslateMCLegacy::blockToFibres(), GctFormatTranslateV35::blockToGctEmCandsAndEnergySums(), GctFormatTranslateV38::blockToGctEmCandsAndEnergySums(), GctFormatTranslateMCLegacy::blockToGctEmCandsAndEnergySums(), GctFormatTranslateV35::blockToGctInternEmCand(), GctFormatTranslateV38::blockToGctInternEmCand(), GctFormatTranslateV35::blockToGctInternEtSums(), GctFormatTranslateV38::blockToGctInternEtSums(), GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster(), GctFormatTranslateV38::blockToGctInternEtSumsAndJetCluster(), GctFormatTranslateV38::blockToGctInternHtMissPostWheel(), GctFormatTranslateV38::blockToGctInternHtMissPreWheel(), GctFormatTranslateV35::blockToGctInternRingSums(), GctFormatTranslateV38::blockToGctInternRingSums(), GctFormatTranslateV35::blockToGctJetCandsAndCounts(), GctFormatTranslateV38::blockToGctJetCandsAndCounts(), GctFormatTranslateMCLegacy::blockToGctJetCandsAndCounts(), GctFormatTranslateV35::blockToGctJetClusterMinimal(), GctFormatTranslateV38::blockToGctJetClusterMinimal(), GctFormatTranslateV35::blockToGctJetPreCluster(), GctFormatTranslateV38::blockToGctJetPreCluster(), GctFormatTranslateV35::blockToGctTrigObjects(), GctFormatTranslateV38::blockToGctTrigObjects(), GctFormatTranslateV35::blockToGctWheelInputInternEtAndRingSums(), GctFormatTranslateV38::blockToGctWheelInputInternEtAndRingSums(), GctFormatTranslateV35::blockToGctWheelOutputInternEtAndRingSums(), GctFormatTranslateV38::blockToGctWheelOutputInternEtAndRingSums(), GctFormatTranslateV35::blockToRctCaloRegions(), GctFormatTranslateV38::blockToRctCaloRegions(), GctFormatTranslateV35::blockToRctEmCand(), GctFormatTranslateV38::blockToRctEmCand(), GctFormatTranslateMCLegacy::blockToRctEmCand(), and gctJets().
|
pure virtual |
Get digis from the block - will return true if it succeeds, false otherwise.
Implemented in GctFormatTranslateMCLegacy, GctFormatTranslateV38, and GctFormatTranslateV35.
Referenced by GctRawToDigi::unpack().
|
protected |
Get a specific jet candandiate collection using the JetCandCategory enumeration.
Definition at line 30 of file GctFormatTranslateBase.cc.
References eostools::cat(), colls(), FORWARD_JETS, GctUnpackCollections::gctCenJets(), GctUnpackCollections::gctForJets(), GctUnpackCollections::gctTauJets(), and TAU_JETS.
Referenced by GctFormatTranslateV35::blockToGctJetCandsAndCounts(), GctFormatTranslateV38::blockToGctJetCandsAndCounts(), and GctFormatTranslateMCLegacy::blockToGctJetCandsAndCounts().
|
pure virtual |
Generate a block header from four 8-bit values.
Implemented in GctFormatTranslateMCLegacy, GctFormatTranslateV38, and GctFormatTranslateV35.
Referenced by GctRawToDigi::unpack().
|
protectedpure virtual |
Returns a raw 32-bit header word generated from the blockId, number of time samples, bunch-crossing and event IDs.
Implemented in GctFormatTranslateMCLegacy, GctFormatTranslateV38, and GctFormatTranslateV35.
Referenced by writeRawHeader().
const std::string & GctFormatTranslateBase::getBlockDescription | ( | const GctBlockHeader & | header | ) | const |
Get block description.
Definition at line 21 of file GctFormatTranslateBase.cc.
References blockNameMap(), RecoTauValidation_cfi::header, INVALID_BLOCK_HEADER_STR, and edm::second().
Referenced by GctRawToDigi::doVerboseOutput().
|
inlineprotected |
Protected interface to get HLT optimisation mode flag.
Definition at line 100 of file GctFormatTranslateBase.h.
References m_hltMode.
Referenced by GctFormatTranslateMCLegacy::blockToAllRctCaloRegions(), GctFormatTranslateV35::blockToFibres(), GctFormatTranslateV38::blockToFibres(), GctFormatTranslateMCLegacy::blockToFibres(), GctFormatTranslateV35::blockToGctEmCandsAndEnergySums(), GctFormatTranslateMCLegacy::blockToGctEmCandsAndEnergySums(), GctFormatTranslateV35::blockToGctInternEmCand(), GctFormatTranslateV38::blockToGctInternEmCand(), GctFormatTranslateV35::blockToGctInternEtSums(), GctFormatTranslateV38::blockToGctInternEtSums(), GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster(), GctFormatTranslateV38::blockToGctInternEtSumsAndJetCluster(), GctFormatTranslateV38::blockToGctInternHtMissPostWheel(), GctFormatTranslateV38::blockToGctInternHtMissPreWheel(), GctFormatTranslateV35::blockToGctInternRingSums(), GctFormatTranslateV38::blockToGctInternRingSums(), GctFormatTranslateV35::blockToGctJetCandsAndCounts(), GctFormatTranslateMCLegacy::blockToGctJetCandsAndCounts(), GctFormatTranslateV35::blockToGctJetClusterMinimal(), GctFormatTranslateV38::blockToGctJetClusterMinimal(), GctFormatTranslateV35::blockToGctJetPreCluster(), GctFormatTranslateV38::blockToGctJetPreCluster(), GctFormatTranslateV35::blockToGctTrigObjects(), GctFormatTranslateV38::blockToGctTrigObjects(), GctFormatTranslateV35::blockToGctWheelInputInternEtAndRingSums(), GctFormatTranslateV38::blockToGctWheelInputInternEtAndRingSums(), GctFormatTranslateV35::blockToGctWheelOutputInternEtAndRingSums(), GctFormatTranslateV38::blockToGctWheelOutputInternEtAndRingSums(), GctFormatTranslateV35::blockToRctCaloRegions(), GctFormatTranslateV38::blockToRctCaloRegions(), GctFormatTranslateV35::blockToRctEmCand(), GctFormatTranslateV38::blockToRctEmCand(), and GctFormatTranslateMCLegacy::blockToRctEmCand().
|
protectedpure virtual |
get the static intern EM cand isolated boundary map.
Implemented in GctFormatTranslateMCLegacy, GctFormatTranslateV38, and GctFormatTranslateV35.
|
inlineprotected |
Get the BxId to be used when packing data.
Definition at line 107 of file GctFormatTranslateBase.h.
References m_packingBxId.
Referenced by writeRawHeader().
|
inlineprotected |
Get the EventId to be used when packing data.
Definition at line 108 of file GctFormatTranslateBase.h.
References m_packingEventId.
Referenced by writeRawHeader().
|
protectedpure virtual |
get static the block ID to RCT crate map for electrons.
Implemented in GctFormatTranslateMCLegacy, GctFormatTranslateV38, and GctFormatTranslateV35.
|
protectedpure virtual |
get the static block ID to RCT crate map for jets
Implemented in GctFormatTranslateMCLegacy, GctFormatTranslateV38, and GctFormatTranslateV35.
|
inline |
Definition at line 38 of file GctFormatTranslateBase.h.
References m_packingBxId.
Referenced by GctDigiToRaw::produce().
|
inline |
Definition at line 41 of file GctFormatTranslateBase.h.
References m_packingEventId.
Referenced by GctDigiToRaw::produce().
|
inline |
Set the pointer to the unpack collections.
Definition at line 35 of file GctFormatTranslateBase.h.
References oniaPATMuonsWithTrigger_cff::collections, and m_collections.
Referenced by GctRawToDigi::unpack().
|
inlineprotected |
Protected interface to the unpackSharedRegions commissioning option.
Protected access to SourceCardRouting.
Definition at line 104 of file GctFormatTranslateBase.h.
References m_srcCardRouting.
Referenced by GctFormatTranslateV35::blockToRctEmCand(), GctFormatTranslateV38::blockToRctEmCand(), GctFormatTranslateMCLegacy::blockToRctEmCand(), and GctFormatTranslateMCLegacy::writeRctEmCandBlocks().
|
inlineprotected |
Definition at line 101 of file GctFormatTranslateBase.h.
References m_unpackSharedRegions.
Referenced by GctFormatTranslateV38::blockToRctCaloRegions().
|
protected |
Writes a raw block header into the raw data array for a given block ID and number of time-samples.
BxId and EventId values for the raw header are set via the setPackingBxId() and setPackingEventId() methods.
Definition at line 41 of file GctFormatTranslateBase.cc.
References data, generateRawHeader(), PresampleTask_cfi::nSamples, AlCaHLTBitMon_ParallelJobs::p, packingBxId(), and packingEventId().
Referenced by GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock(), GctFormatTranslateMCLegacy::writeGctOutEmAndEnergyBlock(), GctFormatTranslateMCLegacy::writeGctOutJetBlock(), and GctFormatTranslateMCLegacy::writeRctEmCandBlocks().
|
staticprivate |
Definition at line 132 of file GctFormatTranslateBase.h.
Referenced by getBlockDescription().
|
private |
Pointer to the output collections object.
Definition at line 137 of file GctFormatTranslateBase.h.
Referenced by colls(), and setUnpackCollections().
|
private |
If true, unpack only BX zero and GCT output data (i.e. to run as quickly as possible)
Definition at line 140 of file GctFormatTranslateBase.h.
Referenced by hltMode().
|
private |
The bunch-crossing ID to be used by the data packing methods.
Definition at line 150 of file GctFormatTranslateBase.h.
Referenced by packingBxId(), and setPackingBxId().
|
private |
The event ID to be used by the data packing methods.
Definition at line 153 of file GctFormatTranslateBase.h.
Referenced by packingEventId(), and setPackingEventId().
|
private |
Source card mapping info.
Definition at line 147 of file GctFormatTranslateBase.h.
Referenced by srcCardRouting().
|
private |
If true, the shared RCT Calo regions will be unpacked also.
This is a commissioning option only - may not be relevant to all concrete implementations!
Definition at line 144 of file GctFormatTranslateBase.h.
Referenced by unpackSharedRegions().