2#ifndef DETDESCR_SIMSPECIALID_H
3#define DETDESCR_SIMSPECIALID_H
6#include "DetDescr/DetectorID.h"
22 static const RawValue SUBTYPE_MASK{0xF};
23 static const RawValue SUBTYPE_SHIFT{22};
24 static const RawValue SUBTYPE_DATA_MASK{0x3FFFFF};
27 static const RawValue PLANE_MASK{
29 static const RawValue PLANE_SHIFT{0};
40 SUBDETECTORID_TEST(
"SimSpecialID", SD_SIM_SPECIAL);
47 SUBDETECTORID_TEST(
"SimSpecialID", SD_SIM_SPECIAL);
55 id_ |= ((sst & SUBTYPE_MASK) << SUBTYPE_SHIFT);
56 id_ |= rawfield & SUBTYPE_DATA_MASK;
79 return (getSubtype() == SCORING_PLANE) ? ((
id_ >> PLANE_SHIFT) & PLANE_MASK)
88 static void createInterpreters();
Defines a 32-bit packed ID for uniquely identifying hits and detector components.
RawValue id_
The raw, packed value of the ID.
Implements detector ids for special simulation-derived hits like scoring planes.
SimSpecialID(SimSpecialType sst, RawValue rawfield)
Create from a subtype number and raw field.
SimSpecialID(RawValue rawid)
Create from raw number.
SimSpecialID()
Empty id (but not null!)
static SimSpecialID ScoringPlaneID(int plane)
Create a scoring id from pieces.
int plane() const
Get the value of the plane field from the ID, if it is a scoring plane.
RawValue subtypePayload() const
Get the raw payload contents.
SimSpecialID(const DetectorID id)
Create from a DetectorID, but check.
SimSpecialType
Encodes which of several possible special types this SimSpecial ID is.