9#include "GaudiKernel/MsgStream.h"
13using CLHEP::Hep3Vector;
19 declareProperty(
"CollectionName",m_key);
35 MsgStream log(msgSvc(), name());
46 return StatusCode::SUCCESS;
50 MsgStream log(msgSvc(), name());
57 log << MSG::WARNING <<
"TrackRecordCollection with key " <<
m_key <<
" not found" <<
endmsg;
60 return StatusCode::SUCCESS;
65 for (
const TrackRecord& trackRecord : *trackRecordCollection) {
66 const int pdgCode=trackRecord.GetPDGCode();
67 Hep3Vector p=trackRecord.GetMomentum();
68 double pr=sqrt(p.y()*p.y()+p.z()*p.z());
69 double alpha=atan(pr/p.x());
71 m_PhotEne->push_back(trackRecord.GetEnergy());
75 else if (pdgCode==11 || pdgCode==-11) {
76 m_ElecEne->push_back(trackRecord.GetEnergy());
81 log << MSG::INFO <<
"Found particle code " << pdgCode <<
endmsg;
84 return StatusCode::SUCCESS;
89 return StatusCode::SUCCESS;
98 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
AtlasHitsVector< TrackRecord > TrackRecordCollection
ServiceHandle< StoreGateSvc > & evtStore()
void addBranch(const std::string &branchname, T &obj, const std::string &leaflist)
virtual ~CBNT_UpstreamMat()
virtual StatusCode CBNT_finalize() override
virtual StatusCode CBNT_execute() override
std::vector< float > * m_PhotEne
std::vector< float > * m_ElecAng
std::vector< float > * m_ElecEne
virtual StatusCode CBNT_clear() override
virtual StatusCode CBNT_initialize() override
std::vector< float > * m_PhotAng
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring