|
ATLAS Offline Software
|
#include <L1JetCMXTools.h>
|
| L1JetCMXTools (const std::string &type, const std::string &name, const IInterface *parent) |
| Constructor. More...
|
|
virtual | ~L1JetCMXTools () |
| default destructor More...
|
|
virtual StatusCode | initialize () |
| standard Athena-Algorithm method More...
|
|
virtual void | formCMXJetTob (const xAOD::JEMTobRoIContainer *jemRoiVec, xAOD::CMXJetTobContainer *cmxTobVec) const |
| form CMX-Jet TOBs from RoIs - single slice More...
|
|
virtual void | formCMXJetTob (const std::vector< const xAOD::JEMTobRoIContainer * > &jemRoiColls, xAOD::CMXJetTobContainer *cmxTobVec, int peak) const |
| form CMX-Jet TOBs from RoIs - multiple slices More...
|
|
virtual void | formCMXJetHits (const xAOD::CMXJetTobContainer *cmxTobVec, xAOD::CMXJetHitsContainer *cmxHitsVec) const |
| form complete CMX-Jet hits from CMX-Jet TOBs More...
|
|
virtual void | formCMXJetHitsCrate (const xAOD::CMXJetTobContainer *cmxTobVec, xAOD::CMXJetHitsContainer *cmxHitsCrate) const |
| form partial CMX-Jet hits (crate) from CMX-Jet TOBs More...
|
|
virtual void | formCMXJetHitsSystem (const xAOD::CMXJetHitsContainer *cmxHitsCrate, xAOD::CMXJetHitsContainer *cmxHitsSys) const |
| form partial CMX-Jet hits (system) from crate CMX-Jet hits More...
|
|
virtual void | formCMXJetHitsTopo (const xAOD::CMXJetTobContainer *cmxTobVec, xAOD::CMXJetHitsContainer *cmxHitsTopo) const |
| form partial CMX-Jet hits (topo) from system CMX-Jet TOBs More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
void | getHits (const xAOD::CMXJetTob *tob, HitsVector &hit10, HitsVector &hit11, HitsVector &hit20, HitsVector &hit21) const |
| Get hit map. More...
|
|
void | addOverflow (ErrorVector &hitErr, const ErrorVector &tobErr) const |
| Add overflow bit. More...
|
|
void | addCMXJetHits (HitsVector &vec1, const HitsVector &vec2, HitsType type) const |
| Add hits from second vector to first. More...
|
|
unsigned int | addHits (unsigned int hitMult, unsigned int hitVec, int multBits, int vecBits, int nthresh) const |
| Increment JEM/CMX hit word. More...
|
|
void | mergeCMXJetHits (xAOD::CMXJetHitsContainer *cmxHitsVec1, xAOD::CMXJetHitsContainer *cmxHitsVec2) const |
| Merge CMX-Jet hits vectors. More...
|
|
void | saveCMXJetHits (xAOD::CMXJetHitsContainer *cmxHitsVec, const HitsVector &hits0, const HitsVector &hits1, const ErrorVector &err0, const ErrorVector &err1, int crate, int source, int peak) const |
| Save non-zero CMX-Jet hits. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
This is a tool to reconstruct the L1 JEM and CMX-Jet hits from RoIs. Used for offline monitoring and trigger reconstruction.
Useage: L1JetCMXTools->formJEMTobRoI() // convert to JEMTobRoI from other RoI classes L1JetCMXTools->formCMXJetTob() // form CMX-Jet TOBs from JEMTobRoIs L1JetCMXTools->formCMXJetHits() // form CMX-Jet hits from CMXJetTobs
@author Peter Faulkner
Definition at line 36 of file L1JetCMXTools.h.
◆ ErrorVector
◆ HitsVector
◆ StoreGateSvc_t
◆ HitsType
◆ L1JetCMXTools()
LVL1::L1JetCMXTools::L1JetCMXTools |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Constructor.
Definition at line 34 of file L1JetCMXTools.cxx.
39 declareInterface<IL1JetCMXTools>(
this);
◆ ~L1JetCMXTools()
LVL1::L1JetCMXTools::~L1JetCMXTools |
( |
| ) |
|
|
virtual |
◆ addCMXJetHits()
Add hits from second vector to first.
Definition at line 409 of file L1JetCMXTools.cxx.
411 int size1 = vec1.size();
412 int size2 =
vec2.size();
417 HitsVector::const_iterator pos2 =
vec2.begin();
418 HitsVector::const_iterator pose2 =
vec2.end();
419 for (; pos1 != pose1 && pos2 != pose2; ++pos1, ++pos2) {
421 *pos1 =
addHits(*pos1, *pos2, 15, 15, 5);
423 *pos1 =
addHits(*pos1, *pos2, 16, 16, 8);
◆ addHits()
unsigned int LVL1::L1JetCMXTools::addHits |
( |
unsigned int |
hitMult, |
|
|
unsigned int |
hitVec, |
|
|
int |
multBits, |
|
|
int |
vecBits, |
|
|
int |
nthresh |
|
) |
| const |
|
private |
Increment JEM/CMX hit word.
Definition at line 429 of file L1JetCMXTools.cxx.
433 msg(
MSG::DEBUG) <<
"addHits: Original hitMult = " << std::hex << hitMult
434 <<
". Add hitWord = " << hitVec << std::dec <<
endmsg;
436 int nbitsOut = multBits / nthresh;
437 int nbitsIn = vecBits / nthresh;
442 int max = (1 << nbitsOut) - 1;
443 unsigned int multMask =
max;
444 unsigned int hitMask = (1 << nbitsIn) - 1;
445 unsigned int shift = 0;
447 unsigned int hits = 0;
449 for (
int i = 0;
i < nthresh;
i++) {
450 int mult = (hitMult & multMask) + (hitVec & hitMask);
451 mult = ((mult <=
max) ? mult :
max);
452 hits += (mult << shift);
454 hitMult >>= nbitsOut;
◆ addOverflow()
Add overflow bit.
Definition at line 391 of file L1JetCMXTools.cxx.
393 const int timeslices = tobErr.size();
394 hitErr.resize(timeslices);
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ formCMXJetHits()
◆ formCMXJetHitsCrate()
form partial CMX-Jet hits (crate) from CMX-Jet TOBs
Implements LVL1::IL1JetCMXTools.
Definition at line 164 of file L1JetCMXTools.cxx.
168 std::vector<HitsVector> hitVecM(2 *
m_crates);
169 std::vector<HitsVector> hitVecF(2 *
m_crates);
170 std::vector<ErrorVector> errVecM(2 *
m_crates);
171 std::vector<ErrorVector> errVecF(2 *
m_crates);
176 for (;
pos != pose; ++
pos) {
184 getHits(tob, hit10, hit11, hit20, hit21);
195 const int peak = tob->
peak();
200 for (
int crate = 0; crate <
m_crates; ++crate) {
201 const int index = crate * 2;
◆ formCMXJetHitsSystem()
◆ formCMXJetHitsTopo()
form partial CMX-Jet hits (topo) from system CMX-Jet TOBs
Implements LVL1::IL1JetCMXTools.
Definition at line 263 of file L1JetCMXTools.cxx.
268 std::vector<HitsVector> hitVec(4 *
m_crates);
271 for (;
pos != pose; ++
pos) {
273 const int crate = tob->
crate();
274 const int jem = tob->
jem();
275 const int frame = tob->
frame();
277 const int index = crate * 4;
283 timeslices = energyLg.size();
288 checksum.resize(timeslices);
289 map.resize(timeslices);
290 countsLow.resize(timeslices);
291 countsHigh.resize(timeslices);
293 if (energyLg[
slice] == 0 && energySm[
slice] == 0)
298 const int overflow = 0;
300 jem + frame + loc + energyLg[
slice] + energySm[
slice] + overflow;
301 checksum[
slice] &= 0xffff;
303 map[
slice] |= (1 << jem);
306 countsLow[
slice] += (1 << (3 * jem));
308 countsHigh[
slice] += (1 << (3 * (jem - 8)));
311 const int peak = tob->
peak();
318 for (
int crate = 0; crate <
m_crates; ++crate) {
319 const int index = crate * 4;
◆ formCMXJetTob() [1/2]
form CMX-Jet TOBs from RoIs - multiple slices
Implements LVL1::IL1JetCMXTools.
Definition at line 64 of file L1JetCMXTools.cxx.
67 std::map<uint32_t, const xAOD::JEMTobRoI *> jemRoiMap;
68 std::map<int, xAOD::CMXJetTob *> cmxTobMap;
70 int timeslices = jemRoiColls.size();
80 const int crate = roi->
crate();
81 const int jem = roi->
jem();
83 const int presenceBit = roi->
frame();
84 presenceMaps[
index] |= (1 << presenceBit);
87 jemRoiMap.insert(std::make_pair(
key, roi));
89 std::map<uint32_t, const xAOD::JEMTobRoI *>::const_iterator mit =
91 std::map<uint32_t, const xAOD::JEMTobRoI *>::const_iterator mitE =
93 for (; mit != mitE; ++mit) {
95 const int crate = roi->
crate();
96 const int jem = roi->
jem();
97 const int frame = roi->
frame();
102 const unsigned int presence = presenceMaps[
index];
106 for (
int bit = 0; bit <= frame; ++bit)
107 count += (presence >> bit) & 0x1;
114 const int key = (((((crate << 4) | jem) << 3) | frame) << 2) | loc;
117 if (xit == cmxTobMap.end()) {
121 if (timeslices > 0) {
122 std::vector<uint16_t> vecU16(timeslices);
123 std::vector<uint32_t> vecU32(timeslices);
124 tob->
addTob(vecU16, vecU16, vecU32, vecU16);
127 cmxTobMap.insert(std::make_pair(
key, tob));
133 std::vector<uint32_t> errorVec(tob->
errorVec());
135 energyLgVec[
slice] = energyLg;
136 energySmVec[
slice] = energySm;
138 presenceMapVec[
slice] = presence;
139 tob->
addTob(energyLgVec, energySmVec, errorVec, presenceMapVec);
◆ formCMXJetTob() [2/2]
form CMX-Jet TOBs from RoIs - single slice
Implements LVL1::IL1JetCMXTools.
Definition at line 58 of file L1JetCMXTools.cxx.
60 std::vector<const xAOD::JEMTobRoIContainer *> jemRoiColls(1, jemRoiVec);
◆ getHits()
Get hit map.
Definition at line 330 of file L1JetCMXTools.cxx.
336 const int timeslices = energyLg.size();
339 hit10.assign(timeslices, 0);
340 hit11.assign(timeslices, 0);
341 hit20.assign(timeslices, 0);
342 hit21.assign(timeslices, 0);
346 hit10[
slice] = 0x7fff;
347 hit11[
slice] = 0x7fff;
348 hit20[
slice] = 0xffff;
349 hit21[
slice] = 0x3fff;
353 if (energyLg[
slice] == 0 && energySm[
slice] == 0)
364 unsigned int numThresholdsHalf = 5;
365 unsigned int numBitsPerCounter = 3;
367 for (
unsigned int i = 0;
i < numThresholdsHalf * 2; ++
i) {
368 if (roi.passedThreshold(
i)) {
369 HitsVector &hit =
i < numThresholdsHalf ? hit10 : hit11;
370 unsigned int ibit =
i < numThresholdsHalf ?
i :
i - numThresholdsHalf;
371 hit[
slice] |= (1 << (ibit * numBitsPerCounter));
375 numThresholdsHalf = 8;
376 numBitsPerCounter = 2;
378 for (
unsigned int i = 0;
i < numThresholdsHalf * 2; ++
i) {
379 if (roi.passedThreshold(10 +
i)) {
380 HitsVector &hit =
i < numThresholdsHalf ? hit20 : hit21;
381 unsigned int ibit =
i < numThresholdsHalf ?
i :
i - numThresholdsHalf;
382 hit[
slice] |= (1 << (ibit * numBitsPerCounter));
◆ initialize()
StatusCode LVL1::L1JetCMXTools::initialize |
( |
| ) |
|
|
virtual |
standard Athena-Algorithm method
Initialisation.
Definition at line 48 of file L1JetCMXTools.cxx.
53 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
const InterfaceID & LVL1::IL1JetCMXTools::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ mergeCMXJetHits()
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ saveCMXJetHits()
Save non-zero CMX-Jet hits.
Definition at line 483 of file L1JetCMXTools.cxx.
492 item->makePrivateStore();
493 item->initialize(crate,
source, hits0, hits1, err0, err1, peak);
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_crates
int LVL1::L1JetCMXTools::m_crates |
|
private |
◆ m_debug
bool LVL1::L1JetCMXTools::m_debug |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_L1MenuKey
◆ m_maxTobs
int LVL1::L1JetCMXTools::m_maxTobs |
|
private |
Maximum number of TOBs per module to CMXs.
Definition at line 107 of file L1JetCMXTools.h.
◆ m_modules
int LVL1::L1JetCMXTools::m_modules |
|
private |
◆ m_sysCrate
int LVL1::L1JetCMXTools::m_sysCrate |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
int energyLarge() const
Return energy large window size.
const std::vector< uint16_t > & energyLargeVec() const
get energyLargeVec
std::vector< D3PDTest::MyVec2 > vec2
Description of CMXJetHits_v1.
Const iterator class for DataVector/DataList.
void addTob(const std::vector< uint16_t > &energyLargeVec, const std::vector< uint16_t > &energySmallVec, const std::vector< uint32_t > &errorVec, const std::vector< uint16_t > &presenceMapVec)
add data to existing object
This class defines the reconstructed em/tau hadron ROI.
uint8_t peak() const
get peak
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
uint8_t jem() const
get jem
uint8_t crate() const
get crate
int jem() const
Return JEM number (0-15)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
void swapElement(size_type index, value_type newElem, reference oldElem)
Swap one element out of the container.
const std::vector< uint16_t > & energySmallVec() const
get energySmallVec
int energySmall() const
Return energy small window size.
CMXJetHitsContainer_v1 CMXJetHitsContainer
Define the latest version of the CMXJetHits class.
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
int frame() const
Return RoI frame number (0-7)
Forward iterator to traverse the main components of the trigger configuration.
CMXJetTob_v1 CMXJetTob
Define the latest version of the CMXJetTob class.
void set(ErrorBit bit, int value=1)
Set an error bit or data.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Description of CMXJetTob_v1.
void clear()
Erase all the elements in the collection.
int error() const
Return the full error word.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
uint8_t frame() const
get frame
int location() const
Return location (RoI local coords) (0-3)
uint32_t error() const
get errorVec at peak bunch crossing
value_type push_back(value_type pElem)
Add an element to the end of the collection.
void makePrivateStore()
Create a new (empty) private store for this object.
virtual void initialize(const uint8_t crate, const uint8_t jem, const uint8_t frame, const uint8_t loc)
initialize
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
uint32_t roiWord() const
get roiWord
Description of JEMTobRoI_v1.
const std::vector< uint16_t > & presenceMapVec() const
get presenceMapVec
uint8_t location() const
get location
virtual void initialize(const int crate, const int jem, const int frame, const int location, const int energyLarge, const int energySmall)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
const std::vector< uint32_t > & errorVec() const
get errorVec
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
int crate() const
Return crate number (0-1)
CMXJetHits_v1 CMXJetHits
Define the latest version of the CMXJetHits class.
void setPeak(uint8_t)
set peak
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.