|
ATLAS Offline Software
|
ByteStream converter for HLTResultMT.
More...
#include <HLTResultMTByteStreamCnv.h>
|
struct | Cache |
| Cache tracking memory allocation for serialised stream tag data and ROBFragment objects. More...
|
|
|
double | phiCorr (double phi) |
|
void | ipCorr (double d0, double z0, double &d0c, double &z0c, double phi0, double eta, double pt) |
|
◆ HLTResultMTByteStreamCnv()
HLT::HLTResultMTByteStreamCnv::HLTResultMTByteStreamCnv |
( |
ISvcLocator * |
svcLoc | ) |
|
◆ ~HLTResultMTByteStreamCnv()
HLT::HLTResultMTByteStreamCnv::~HLTResultMTByteStreamCnv |
( |
| ) |
|
|
virtual |
◆ addTrack()
◆ classID()
const CLID & HLT::HLTResultMTByteStreamCnv::classID |
( |
| ) |
|
|
static |
◆ clear()
void Converter::clear |
( |
| ) |
|
|
inlineinherited |
◆ createObj()
StatusCode HLT::HLTResultMTByteStreamCnv::createObj |
( |
IOpaqueAddress * |
pAddr, |
|
|
DataObject *& |
pObj |
|
) |
| |
|
overridevirtual |
◆ createRep()
StatusCode HLT::HLTResultMTByteStreamCnv::createRep |
( |
DataObject * |
pObj, |
|
|
IOpaqueAddress *& |
pAddr |
|
) |
| |
|
overridevirtual |
Create ByteStream from RDO (HLTResultMT)
Definition at line 94 of file HLTResultMTByteStreamCnv.cxx.
107 if (!castSuccessful || !hltResult) {
108 ATH_MSG_ERROR(
"Failed to convert DataObject to HLTResultMT");
109 return StatusCode::FAILURE;
116 return StatusCode::FAILURE;
119 const uint16_t hltRodMinorVersion16 = (hltRodMinorVersion.first << 8
u) | hltRodMinorVersion.second;
120 ATH_MSG_DEBUG(
"HLT ROD minor version is " << hltRodMinorVersion.first <<
"." << hltRodMinorVersion.second
121 <<
" (0x" << MSG::hex << hltRodMinorVersion16 << MSG::dec <<
")");
126 ATH_MSG_ERROR(
"Failed to obtain a pointer to RawEventWrite");
127 return StatusCode::FAILURE;
135 std::set<eformat::helper::SourceIdentifier> resultIdsToWrite;
136 bool debugEvent=
false;
137 std::string unknownTypeStreams;
138 for (
const eformat::helper::StreamTag& st : hltResult->
getStreamTags()) {
140 if (isUnknownStreamTag(st)) {
141 unknownTypeStreams += st.type +
"_" + st.name +
" ";
144 if (isDebugStreamTag(st)) debugEvent=
true;
146 if (st.robs.empty() && st.dets.empty()) {
147 eformat::helper::SourceIdentifier sid(eformat::SubDetector::TDAQ_HLT, fullResultModuleId);
148 resultIdsToWrite.insert(sid);
151 for (
const uint32_t robid : st.robs) {
152 eformat::helper::SourceIdentifier sid(robid);
153 if (sid.subdetector_id() == eformat::SubDetector::TDAQ_HLT)
154 resultIdsToWrite.insert(sid);
158 if (!debugEvent && !unknownTypeStreams.empty()) {
159 ATH_MSG_ERROR(
"Found stream tag(s) with unknown type: " << unknownTypeStreams);
160 return StatusCode::FAILURE;
167 writableStreamTags.erase(
168 std::remove_if(writableStreamTags.begin(),writableStreamTags.end(),std::not_fn(isDebugStreamTag)),
169 writableStreamTags.end()
171 for (eformat::helper::StreamTag& st : writableStreamTags) {
179 cache->streamTagData = std::make_unique<uint32_t[]>(nStreamTagWords);
185 ATH_MSG_ERROR(
"StreamTag encoding failed, caught an unexpected std::exception " <<
e.what());
186 return StatusCode::FAILURE;
189 ATH_MSG_ERROR(
"StreamTag encoding failed, caught an unexpected exception");
190 return StatusCode::FAILURE;
193 re->stream_tag(nStreamTagWords, cache->streamTagData.get());
197 re->hlt_info(hltBits.size(), hltBits.data());
200 ATH_MSG_DEBUG(
"Iterating over " << resultIdsToWrite.size() <<
" HLT result IDs to assemble output data");
201 const std::unordered_map<uint16_t, std::vector<uint32_t>>& serialisedData = hltResult->
getSerialisedData();
202 for (
const eformat::helper::SourceIdentifier& resultId : resultIdsToWrite) {
204 const auto it = serialisedData.find(resultId.module_id());
205 if (
it==serialisedData.end()) {
207 ATH_MSG_DEBUG(
"HLT result with ID 0x" << MSG::hex << resultId.code() << MSG::dec
208 <<
" requested by a debug stream tag, but missing in the serialised data - skipping this result");
211 ATH_MSG_ERROR(
"HLT result with ID 0x" << MSG::hex << resultId.code() << MSG::dec
212 <<
" requested by a stream tag, but missing in the serialised data");
213 return StatusCode::FAILURE;
215 const std::vector<uint32_t>&
data =
it->second;
218 auto hltROB = std::make_unique<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment>(
223 re->lvl1_trigger_type(),
229 hltROB->rod_minor_version(hltRodMinorVersion16);
234 re->append(hltROB.get());
235 cache->robFragments.push_back(std::move(hltROB));
236 ATH_MSG_DEBUG(
"Appended data for HLT result ID 0x" << MSG::hex << resultId.code() << MSG::dec <<
" with "
237 <<
data.size() <<
" words of serialised payload to the output full event");
241 if ( pAddr !=
nullptr ) pAddr->release();
243 pAddr =
static_cast<IOpaqueAddress*
>(bsAddr);
247 return StatusCode::SUCCESS;
◆ finalize()
StatusCode HLT::HLTResultMTByteStreamCnv::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode HLT::HLTResultMTByteStreamCnv::initialize |
( |
| ) |
|
|
overridevirtual |
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ ipCorr()
void Converter::ipCorr |
( |
double |
d0, |
|
|
double |
z0, |
|
|
double & |
d0c, |
|
|
double & |
z0c, |
|
|
double |
phi0, |
|
|
double |
eta, |
|
|
double |
pt |
|
) |
| |
|
inlineprotectedinherited |
Definition at line 257 of file Converter.h.
261 double sd0 = (
d0 != 0 ?
d0/fabs(
d0) : 1);
262 double spt = (
pt != 0 ?
pt/fabs(
pt) : 1);
270 double rc = fabs(
pt)*15.0/(9.0*1.042);
276 double xd01,yd01,xd02,yd02;
279 xd01 = 0; yd01 =
rc+yc;
280 xd02 = 0; yd02 = -
rc+yc;
282 xd01 = xc+yc/xc*yc+sqrt(
pow((xc+yc/xc*yc),2)-xc*xc-yc*yc+rc*rc); yd01 = yc/xc*xd01;
283 xd02 = xc+yc/xc*yc-sqrt(
pow((xc+yc/xc*yc),2)-xc*xc-yc*yc+rc*rc); yd02 = yc/xc*xd02;
286 double r1 = sqrt(xd01*xd01+yd01*yd01);
287 double r2 = sqrt(xd02*xd02+yd02*yd02);
292 phiV = atan2(yd01,xd01);
294 phiV = atan2(yd02,xd02);
304 d0c = fabs(sqrt(xc*xc+yc*yc)-rc)*
sin(phiV-newphi);
307 double theta_save=
theta;
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ phiCorr()
double Converter::phiCorr |
( |
double |
phi | ) |
|
|
inlineprotectedinherited |
Definition at line 248 of file Converter.h.
250 if (
phi < -TMath::Pi())
phi += 2*TMath::Pi();
251 if (
phi > TMath::Pi())
phi -= 2*TMath::Pi();
◆ repSvcType()
long HLT::HLTResultMTByteStreamCnv::repSvcType |
( |
| ) |
const |
|
inlineoverride |
◆ selectTracks() [1/3]
Definition at line 177 of file Converter.h.
179 static int hpmap[20] = { 0, 1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
184 while(muonitr!=muonend) {
186 bool hasInDet = (*muonitr)->hasInDetTrackParticle();
188 if(hasInDet) trackitr=(*muonitr)->inDetTrackParticle();
190 if(!hasInDet)
continue;
194 CLHEP::HepVector perigeeParams = measPer->parameters();
195 double pT = measPer->pT();
196 double eta = measPer->eta();
223 double dof = quality->quality->
numberDoF();
227 for (
int ih=0 ; ih<20 ; ih++ ) {
236 deta, dphi, dz0, dd0, dpT,
238 nStrawHits, nTrHits, bitmap, 0,
◆ selectTracks() [2/3]
Definition at line 111 of file Converter.h.
116 static int hpmap[20] = { 0, 1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
118 while ( trackitr!=trackend ) {
122 CLHEP::HepVector perigeeParams = measPer->parameters();
123 double pT = measPer->pT();
124 double eta = measPer->eta();
147 bool expectBL =
false;
155 for (
int ih=0 ; ih<20 ; ih++ ) {
164 deta, dphi, dz0, dd0, dpT,
166 nStrawHits, nTrHits, bitmap, 0,
◆ selectTracks() [3/3]
Definition at line 56 of file Converter.h.
61 while ( trackitr!=trackend ) {
63 double eta = (*trackitr)->param()->eta();
64 double phi = (*trackitr)->param()->phi0();
65 double z0 = (*trackitr)->param()->z0();
66 double pT = (*trackitr)->param()->pT();
67 double d0 = (*trackitr)->param()->a0();
70 double deta = (*trackitr)->param()->eeta();
71 double dphi = (*trackitr)->param()->ephi0();
72 double dz0 = (*trackitr)->param()->ez0();
73 double dpT = (*trackitr)->param()->epT();
74 double dd0 = (*trackitr)->param()->ea0();
76 int algoid = (*trackitr)->algorithmId();
78 int nBlayerHits = ((*trackitr)->HitPattern() & 0x1);
79 int nPixelHits = 2*(*trackitr)->NPixelSpacePoints();
80 int nSctHits = 2*(*trackitr)->NSCT_SpacePoints();
81 int nStrawHits = (*trackitr)->NStrawHits();
82 int nTrHits = (*trackitr)->NTRHits();
85 bool expectBL =
false;
87 unsigned hitPattern = (*trackitr)->HitPattern();
88 unsigned multiPattern = 0;
90 double chi2 = (*trackitr)->chi2();
98 deta, dphi, dz0, dd0, dpT,
100 nStrawHits, nTrHits, hitPattern, multiPattern,
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ storageType()
long HLT::HLTResultMTByteStreamCnv::storageType |
( |
| ) |
|
|
static |
◆ tracks()
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_beamX
double Converter::m_beamX |
|
protectedinherited |
◆ m_beamY
double Converter::m_beamY |
|
protectedinherited |
◆ m_beamZ
double Converter::m_beamZ |
|
protectedinherited |
◆ m_ByteStreamEventAccess
◆ m_cache
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_tracks
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
@ numberOfPixelHits
number of pixel layers on track with absence of hits
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
char data[hepevt_bytes_allocation_ATLAS]
void ipCorr(double d0, double z0, double &d0c, double &z0c, double phi0, double eta, double pt)
const std::vector< eformat::helper::StreamTag > & getStreamTags() const
Const-getter for stream tags.
Const iterator class for DataVector/DataList.
@ numberOfTRTHighThresholdHits
total number of TRT hits which pass the high threshold
Scalar phi() const
phi method
ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess
Helper to obtain the RawEvent pointer.
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
Scalar eta() const
pseudorapidity method
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Scalar theta() const
theta method
const TrackSummary * trackSummary() const
accessor function for TrackSummary.
A container class for data required to build online output from HLT.
#define ATH_MSG_VERBOSE(x)
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
float nPixelHits(const U &p)
@ u
Enums for curvilinear frames.
IMessageSvc * getMessageSvc(bool quiet=false)
@ numberOfBLayerHits
these are the hits in the 0th pixel layer?
double phiCorr(double phi)
static const CLID & ID()
the CLID of T
AthMessaging()
Default constructor:
const std::vector< uint32_t > & getRobStatus(uint16_t moduleId) const
Status words for ROB with given moduleId.
number_type encode(double weight)
msgSvc
Provide convenience handles for various services.
@ numberOfSCTHits
number of SCT holes
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
const FitQuality * fitQuality() const
accessor function for FitQuality.
double chi2(TH1 *h0, TH1 *h1)
static long storageType()
Storage type used by this converter.
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
RODMinorVersion getVersion() const
ROD minor version getter.
MsgStream & msg() const
The standard message stream.
void addTrack(TIDA::Track *t)
@ numberOfTRTHits
number of TRT outliers
static constexpr long storageType()
A summary of the information contained by a track.
const std::unordered_map< uint16_t, std::vector< uint32_t > > & getSerialisedData() const
Serialised data getter.
SG::SlotSpecificObj< Cache > m_cache
std::vector< eformat::helper::StreamTag > & getStreamTagsNonConst()
Non-const-getter for stream tags needed by the result maker to remove disabled ROBs/SubDets.
const Trk::Perigee * measuredPerigee() const
Accessor method for Perigee.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DetectorType
enumerates the various detector types currently accessible from the isHit() method.
std::pair< uint8_t, uint8_t > RODMinorVersion
Type to store decoded ROD minor version (16-bit version split into two 8-bit numbers)
#define ATH_MSG_WARNING(x)
std::string m_nm
Message source name.
const boost::regex re(r_e)
const std::vector< uint32_t > & getStatus() const
Full event status reference getter (1 bit-mask status word + error code words)
double chiSquared() const
returns the of the overall track fit
static const CLID & classID()
CLID of the class HLTResultMT converted by this converter.
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
void initMessaging() const
Initialize our message level and MessageSvc.
const std::vector< uint32_t > & getHltBitsAsWords() const
Const-getter for HLT bits as uint32_t array. Ordering: PassRaw, Prescaled.
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
std::vector< TIDA::Track * > m_tracks
float nSiHits(const U &p)
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.