7#include "GaudiKernel/MsgStream.h"
8#include "GaudiKernel/DataSvc.h"
26 return StatusCode::SUCCESS;
39 return StatusCode::FAILURE;
44 std::vector<HepMC::ConstGenParticlePtr> bQuarks;
45 for (itr = mcCollptr->
begin(); itr!=mcCollptr->
end(); ++itr) {
48 for (
auto pitr: *genEvt) {
49 int p_id = pitr->pdg_id();
50 if ( (std::abs(p_id)==5) && (pitr->status() == 62 || pitr->status() == 63) ) {
51 bQuarks.push_back(std::move(pitr));
56 if ( bQuarks.size()==0)
return StatusCode::FAILURE;
58 std::vector<HepMC::ConstGenParticlePtr>::iterator recordedBQuarkIt;
60 for (
auto bItr = bQuarks.begin(); bItr!=bQuarks.end(); ++bItr) {
61 double thisPt=(*bItr)->momentum().perp();
62 if (thisPt>lastPt) { recordedBQuarkIt=bItr; }
65 auto BQMom=(*recordedBQuarkIt)->momentum();
66 double b_pt = BQMom.perp();
67 double b_rapid = BQMom.pseudoRapidity();
68 double b_phi = BQMom.phi();
70 unsigned int nAccumulatedEvents =
bqKinematics[0].size();
72 for (
unsigned int i=0; i<nAccumulatedEvents; ++i) {
88 return StatusCode::SUCCESS;
96 ATH_MSG_INFO(
"Total number of unique events = " << uniqueEvents);
99 return StatusCode::SUCCESS;
Scalar phi() const
phi method
void clear()
Empty the pool.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
std::vector< double > bqKinematics[3]
StatusCode execute(const EventContext &ctx)
Execute method.
CheckCloningFactor(const std::string &name, ISvcLocator *pSvcLocator)
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
HepMC3::GenEvent GenEvent