Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <MuCalStreamerTool.h>
|
| MuCalStreamerTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual StatusCode | initialize () override |
|
const std::string & | instanceName () const |
|
void | setInstanceName (const std::string &name) |
|
void | setBufferName (const std::string &buffName) |
|
StatusCode | openStream (int calBufferSize) |
|
StatusCode | closeStream () |
|
bool | isStreamOpen () |
|
StatusCode | createRoiFragment (const xAOD::MuonRoI *roi, TrigL2MuonSA::TrackPattern &trackPattern, TrigL2MuonSA::MdtHits &mdtHits, TrigL2MuonSA::RpcHits &rpcHits, TrigL2MuonSA::TgcHits &tgcHits, std::vector< uint32_t > &localBuffer, bool doDataScouting, const EventContext &ctx) const |
|
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 |
|
|
Gaudi::Property< bool > | m_writeToFile { this, "WriteToFile", false, "" } |
|
SG::ReadHandleKey< TgcRdoContainer > | m_tgcRdoKey {this, "TgcRdoContainer", "TGCRDO", "Tgc RDO Input"} |
|
SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfoKey { this, "EventInfoKey", "EventInfo", "" } |
|
SG::ReadHandleKey< RpcPadContainer > | m_rpcPadKey {this, "RpcPadContainerKey", "RPCPAD", "RpcPad container fro MuCalStreamerTool"} |
|
std::string | m_calBufferName |
|
std::string | m_algInstanceName |
|
std::ofstream | m_outputFile |
|
ToolHandle< IRegSelTool > | m_regSel_MDT {this, "RegSel_MDT", "RegSelTool/RegSelTool_MDT", "MDT Region Selector Tool"} |
|
ToolHandle< IRegSelTool > | m_regSel_TGC {this, "RegSel_TGC", "RegSelTool/RegSelTool_TGC", "TGC Region Selector Tool"} |
|
SG::ReadCondHandleKey< RpcCablingCondData > | m_readKey {this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"} |
|
TrigL2MuonSA::MuCalCircClient * | m_circ = nullptr |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 54 of file MuCalStreamerTool.h.
◆ StoreGateSvc_t
◆ MuCalStreamerTool()
TrigL2MuonSA::MuCalStreamerTool::MuCalStreamerTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ closeStream()
StatusCode TrigL2MuonSA::MuCalStreamerTool::closeStream |
( |
| ) |
|
◆ createMdtFragment()
StatusCode TrigL2MuonSA::MuCalStreamerTool::createMdtFragment |
( |
TrigL2MuonSA::MdtHits & |
mdtHits, |
|
|
LVL2_MUON_CALIBRATION::MdtCalibFragment & |
mdtFragment, |
|
|
float |
phi |
|
) |
| const |
|
private |
Definition at line 266 of file MuCalStreamerTool.cxx.
271 TrigL2MuonSA::MdtHits::const_iterator
it = mdtHits.begin();
272 for ( ;
it != mdtHits.end() ; ++
it ) {
277 int multilayer = (*it).Multilayer;
278 int layer = (*it).TubeLayer;
279 int tube = (*it).Tube;
282 stationEta,stationPhi,multilayer,
layer,
tube);
284 uint16_t leadingCoarseTime = (*it).LeadingCoarseTime;
285 uint16_t leadingFineTime = (*it).LeadingFineTime;
286 uint16_t trailingCoarseTime = (*it).TrailingCoarseTime;
287 uint16_t trailingFineTime = (*it).TrailingFineTime;
290 LVL2_MUON_CALIBRATION::MdtCalibData mdt(
ID,leadingCoarseTime,leadingFineTime,
291 trailingCoarseTime,trailingFineTime,
adc
300 return StatusCode::SUCCESS;
◆ createRoiFragment()
Definition at line 106 of file MuCalStreamerTool.cxx.
119 unsigned int totalHits = mdtHits.size()+rpcHits.size()+tgcHits.size();
120 if ( totalHits > 500 ) {
122 return StatusCode::SUCCESS;
128 return StatusCode::FAILURE;
143 float phi = (
float)
track.phiVtx;
148 std::vector<uint32_t> robIdList_MDT;
151 double phi_roi = roi->
phi();
152 double phiMin = roi->
phi()-0.05;
153 double phiMax = roi->
phi()+0.05;
154 if( phi_roi < 0 ) phi_roi += 2*
M_PI;
155 if( phiMin < 0 ) phiMin += 2*
M_PI;
156 if( phiMax < 0 ) phiMax += 2*
M_PI;
161 m_regSel_MDT->lookup( ctx )->ROBIDList(*iroi,robIdList_MDT);
164 ATH_MSG_DEBUG(
"Size of the MDT rob list: " << robIdList_MDT.size());
165 int isize = robIdList_MDT.size()<5 ? robIdList_MDT.size() : 4;
166 for (
int ii = 0 ; ii<isize ; ++ii ) {
167 ATH_MSG_DEBUG(
"robId: 0x" << std::hex << robIdList_MDT.at(ii) << std::dec);
168 mrods[ii] = robIdList_MDT.at(ii);
172 std::vector<uint32_t> robIdList_TGC;
173 m_regSel_TGC->lookup(ctx)->ROBIDList(*iroi,robIdList_TGC);
174 ATH_MSG_DEBUG(
"Size of the TGC rob list: " << robIdList_TGC.size());
177 LVL2_MUON_CALIBRATION::CalibEvent
event(1,
runId,lvl1Id,1,1,mrods,
name().c_str(),eta,phi,
pt);
178 LVL2_MUON_CALIBRATION::MdtCalibFragment mdtFragment;
181 if ( mdtHits.size()>0 ) {
185 event << mdtFragment;
189 return StatusCode::SUCCESS;
193 if ( rpcHits.size() > 0 ) {
194 LVL2_MUON_CALIBRATION::RpcCalibFragment rpcFragment;
197 ATH_MSG_WARNING(
"Could not create the Rpc fragment of the calibration stream");
200 ATH_MSG_DEBUG(
"Adding the RPC fragment to the calibration stream");
201 event << rpcFragment;
205 if ( tgcHits.size() > 0 ) {
206 LVL2_MUON_CALIBRATION::TgcCalibFragment tgcFragment;
209 ATH_MSG_ERROR(
"Could not create the Tgc fragment of the calibration stream");
212 ATH_MSG_DEBUG(
"Adding the TGC fragment to the calibration stream");
213 event << tgcFragment;
227 if (doDataScouting) {
229 uint16_t eventSize_ds =
event.size();
230 if (eventSize_ds>1000)
return StatusCode::SUCCESS;
232 std::unique_ptr<uint8_t[]> buff_ds = std::make_unique<uint8_t[]>(eventSize_ds);
235 uint16_t eventSize8bits = eventSize_ds;
236 uint16_t eventSize32bits = eventSize8bits/4;
237 event.dumpWords(buff_ds.get(),eventSize_ds);
242 ATH_MSG_DEBUG(
"Size of the DATASCOUTING buffer in 32 bits words: " << eventSize32bits);
250 uint32_t dataWord = (byte4 << 24) + (byte3 << 16) + (byte2 << 8) + byte1 ;
252 ATH_MSG_DEBUG(
"Data word " <<
words <<
" = " << std::hex <<
"0x" << dataWord << std::dec);
254 localBuffer.push_back(dataWord);
260 return StatusCode::SUCCESS;
◆ createRpcFragment()
StatusCode TrigL2MuonSA::MuCalStreamerTool::createRpcFragment |
( |
const xAOD::MuonRoI * |
roi, |
|
|
LVL2_MUON_CALIBRATION::RpcCalibFragment & |
rpcFragment, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
private |
Definition at line 308 of file MuCalStreamerTool.cxx.
314 if ( roi->
getSource() != 0 )
return StatusCode::SUCCESS;
329 unsigned int padIdHash;
330 if (readCdo->give_PAD_address(
side, sector,
roiNumber, padIdHash)) {
333 if( itPad==
nullptr ) {
335 return StatusCode::FAILURE;
337 const RpcPad* rpcPad = itPad;
340 uint16_t sysId = (sector<32)? 0x66 : 0x65;
346 LVL2_MUON_CALIBRATION::RpcCalibFragment frag(sysId,secId,padId,
status,
error);
349 for (; it3!=rpcPad->
end() ; ++it3) {
357 LVL2_MUON_CALIBRATION::RpcCalibData
matrix(cmaId,fel1Id,febcId,crc);
361 for (; it5 != (*it3)->end() ; ++it5) {
381 ATH_MSG_WARNING(
"Can't get the pad address from the RpcCablingCondData");
382 return StatusCode::FAILURE;
385 return StatusCode::SUCCESS;
◆ createTgcFragment()
StatusCode TrigL2MuonSA::MuCalStreamerTool::createTgcFragment |
( |
std::vector< uint32_t > & |
tgcRobIdList, |
|
|
LVL2_MUON_CALIBRATION::TgcCalibFragment & |
tgcFragment |
|
) |
| const |
|
private |
Definition at line 393 of file MuCalStreamerTool.cxx.
398 if ( robIdList_TGC.size()<1 ) {
400 return StatusCode::SUCCESS;
406 uint16_t subSystemId = ( (robIdList_TGC.at(0) & 0xff0000) >> 16 );
407 uint16_t rdoId = ( robIdList_TGC.at(0) & 0xff );
411 tgcFragment = LVL2_MUON_CALIBRATION::TgcCalibFragment(
systemId,subSystemId,rdoId,
roiNumber);
415 if (!rdoRH.isValid()) {
417 return StatusCode::FAILURE;
425 LVL2_MUON_CALIBRATION::TgcCalibData tgc_payload;
428 for ( ;
it != tgcRdoContainer->
end() ; ++
it ) {
436 for ( ; itRaw != (*it)->end() ; ++itRaw ) {
439 LVL2_MUON_CALIBRATION::TGC_BYTESTREAM_READOUTHIT roh;
440 LVL2_MUON_CALIBRATION::TGC_BYTESTREAM_READOUTTRIPLETSTRIP tps;
441 LVL2_MUON_CALIBRATION::TGC_BYTESTREAM_READOUTTRACKLET rot;
442 LVL2_MUON_CALIBRATION::TGC_BYTESTREAM_HIPT hpt;
443 LVL2_MUON_CALIBRATION::TGC_BYTESTREAM_SL sl;
446 switch (raw->
type()) {
449 roh.channel = raw->
channel()-40;
450 roh.sbId = raw->
slbId();
453 roh.ldbId = raw->
sswId();
465 tps.sbId = raw->
slbId();
466 tps.ldbId = raw->
sswId();
476 rot.delta = raw->
delta();
477 rot.sbId = raw->
slbId();
478 rot.ldbId = raw->
sswId();
488 hpt.delta = raw->
delta();
489 hpt.hitId = raw->
hitId();
491 hpt.cand = raw->
index();
492 hpt.chip = raw->
chip();
493 hpt.sector = raw->
sector();
505 sl.cand = raw->
index();
506 sl.sector = raw->
sector();
515 return StatusCode::FAILURE;
519 tgc_payload.getHit(roh,tps,rot,hpt,sl);
524 tgcFragment << tgc_payload;
526 return StatusCode::SUCCESS;
◆ 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
◆ initialize()
StatusCode TrigL2MuonSA::MuCalStreamerTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ 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.
◆ instanceName()
const std::string& TrigL2MuonSA::MuCalStreamerTool::instanceName |
( |
| ) |
const |
|
inline |
◆ isStreamOpen()
bool TrigL2MuonSA::MuCalStreamerTool::isStreamOpen |
( |
| ) |
|
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ openStream()
StatusCode TrigL2MuonSA::MuCalStreamerTool::openStream |
( |
int |
calBufferSize | ) |
|
Definition at line 49 of file MuCalStreamerTool.cxx.
64 <<
name <<
" buffer size=" << calBufferSize);
67 ATH_MSG_INFO(
"Opening muon calibration stream. Buffer name: "
68 <<
name <<
" buffer size: " << calBufferSize);
71 return StatusCode::SUCCESS;
◆ 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()
◆ setBufferName()
void TrigL2MuonSA::MuCalStreamerTool::setBufferName |
( |
const std::string & |
buffName | ) |
|
|
inline |
◆ setInstanceName()
void TrigL2MuonSA::MuCalStreamerTool::setInstanceName |
( |
const std::string & |
name | ) |
|
|
inline |
◆ 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_algInstanceName
std::string TrigL2MuonSA::MuCalStreamerTool::m_algInstanceName |
|
private |
◆ m_calBufferName
std::string TrigL2MuonSA::MuCalStreamerTool::m_calBufferName |
|
private |
◆ m_circ
◆ m_detStore
◆ m_eventInfoKey
◆ m_evtStore
◆ m_outputFile
std::ofstream TrigL2MuonSA::MuCalStreamerTool::m_outputFile |
|
private |
◆ m_readKey
◆ m_regSel_MDT
◆ m_regSel_TGC
◆ m_rpcPadKey
◆ m_tgcRdoKey
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeToFile
Gaudi::Property< bool > TrigL2MuonSA::MuCalStreamerTool::m_writeToFile { this, "WriteToFile", false, "" } |
|
private |
The documentation for this class was generated from the following files:
constexpr uint8_t stationPhi
station Phi 1 to 8
Const iterator class for DataVector/DataList.
std::vector< Identifier > ID
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
float eta() const
The pseudorapidity ( ) of the muon candidate.
std::vector< SG::VarHandleKeyArray * > m_vhka
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Hemisphere getHemisphere() const
Returns the hemisphere that detected the muon candidate.
virtual void setOwner(IDataHandleHolder *o)=0
uint16_t subMatrix() const
bool dumpToCirc(LVL2_MUON_CALIBRATION::CalibEvent &event) const
POOL::TEvent event(POOL::TEvent::kClassAccess)
Describes the API of the Region of Ineterest geometry.
uint16_t tracklet() const
Class describing a LVL1 muon region of interest.
RoISource getSource() const
Returns the system that detected the muon candidate.
const_iterator end() const
return const_iterator for end of container
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
const_iterator begin() const
return const_iterator for first entry
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
int getRoI() const
Get the "RoI number" (position inside the sector)
unsigned bcBitmap(uint16_t bcTag)
uint16_t position() const
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
uint16_t threshold() const
setTeId setLumiBlock setRoiId setRoiSubsystem roiNumber
StatusCode initialize(bool used=true)
setEventNumber setTimeStamp bcid
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
def time(flags, cells_name, *args, **kw)
#define ATH_MSG_WARNING(x)
An unit object of TGC ROD output.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
bool trackPhi(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
int getSectorID() const
Get the sector ID number.
constexpr uint8_t stationEta
1 to 3
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Use IdentifiableContainer with RpcPad.
float phi() const
The azimuthal angle ( ) of the muon candidate.