CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
TestAlpakaAnalyzer Class Reference
Inheritance diagram for TestAlpakaAnalyzer:
edm::stream::EDAnalyzer<> edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &event, edm::EventSetup const &) override
 
 TestAlpakaAnalyzer (edm::ParameterSet const &config)
 
- Public Member Functions inherited from edm::stream::EDAnalyzer<>
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
 EDAnalyzerBase (const EDAnalyzerBase &)=delete
 
ModuleDescription const & moduleDescription () const
 
const EDAnalyzerBaseoperator= (const EDAnalyzerBase &)=delete
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::InputTag source_
 
const edm::EDGetTokenT< portabletest::TestHostCollectiontoken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 76 of file TestAlpakaAnalyzer.cc.

Constructor & Destructor Documentation

◆ TestAlpakaAnalyzer()

TestAlpakaAnalyzer::TestAlpakaAnalyzer ( edm::ParameterSet const &  config)
inline

Definition at line 78 of file TestAlpakaAnalyzer.cc.

79  : source_{config.getParameter<edm::InputTag>("source")}, token_{consumes(source_)} {}
const edm::EDGetTokenT< portabletest::TestHostCollection > token_
Definition: config.py:1
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::InputTag source_

Member Function Documentation

◆ analyze()

void TestAlpakaAnalyzer::analyze ( edm::Event const &  event,
edm::EventSetup const &   
)
inlineoverridevirtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 81 of file TestAlpakaAnalyzer.cc.

References python.cmstools::all(), cms::cuda::assert(), PortableHostCollection< T >::buffer(), PortableHostCollection< T >::const_view(), edm::InputTag::encode(), mps_fire::i, makeMuonMisalignmentScenario::matrix, mps_check::msg, source_, token_, and PortableHostCollection< T >::view().

81  {
82  portabletest::TestHostCollection const& product = event.get(token_);
83  auto const& view = product.const_view();
84  auto& mview = product.view();
85  auto const& cmview = product.view();
86 
87  {
88  edm::LogInfo msg("TestAlpakaAnalyzer");
89  msg << source_.encode() << ".size() = " << view.metadata().size() << '\n';
90  msg << " data @ " << product.buffer().data() << ",\n"
91  << " x @ " << view.metadata().addressOf_x() << " = " << Column(view.x(), view.metadata().size()) << ",\n"
92  << " y @ " << view.metadata().addressOf_y() << " = " << Column(view.y(), view.metadata().size()) << ",\n"
93  << " z @ " << view.metadata().addressOf_z() << " = " << Column(view.z(), view.metadata().size()) << ",\n"
94  << " id @ " << view.metadata().addressOf_id() << " = " << Column(view.id(), view.metadata().size())
95  << ",\n"
96  << " r @ " << view.metadata().addressOf_r() << " = " << view.r() << '\n'
97  << " m @ " << view.metadata().addressOf_m() << " = { ... {" << view[1].m()(1, Eigen::all)
98  << " } ... } \n";
99  msg << std::hex << " [y - x] = 0x"
100  << reinterpret_cast<intptr_t>(view.metadata().addressOf_y()) -
101  reinterpret_cast<intptr_t>(view.metadata().addressOf_x())
102  << " [z - y] = 0x"
103  << reinterpret_cast<intptr_t>(view.metadata().addressOf_z()) -
104  reinterpret_cast<intptr_t>(view.metadata().addressOf_y())
105  << " [id - z] = 0x"
106  << reinterpret_cast<intptr_t>(view.metadata().addressOf_id()) -
107  reinterpret_cast<intptr_t>(view.metadata().addressOf_z())
108  << " [r - id] = 0x"
109  << reinterpret_cast<intptr_t>(view.metadata().addressOf_r()) -
110  reinterpret_cast<intptr_t>(view.metadata().addressOf_id())
111  << " [m - r] = 0x"
112  << reinterpret_cast<intptr_t>(view.metadata().addressOf_m()) -
113  reinterpret_cast<intptr_t>(view.metadata().addressOf_r());
114  }
115 
116  checkViewAddresses(view);
117  checkViewAddresses(mview);
118  checkViewAddresses(cmview);
119 
120  const portabletest::Matrix matrix{{1, 2, 3, 4, 5, 6}, {2, 4, 6, 8, 10, 12}, {3, 6, 9, 12, 15, 18}};
121  assert(view.r() == 1.);
122  for (int32_t i = 0; i < view.metadata().size(); ++i) {
123  auto vi = view[i];
124  assert(vi.x() == 0.);
125  assert(vi.y() == 0.);
126  assert(vi.z() == 0.);
127  assert(vi.id() == i);
128  assert(vi.m() == matrix * i);
129  }
130  }
const edm::EDGetTokenT< portabletest::TestHostCollection > token_
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
std::string encode() const
Definition: InputTag.cc:159
Eigen::Matrix< double, 3, 6 > Matrix
Definition: TestSoA.h:13
assert(be >=bs)
ConstView const & const_view() const
const edm::InputTag source_
tuple msg
Definition: mps_check.py:286

◆ fillDescriptions()

static void TestAlpakaAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Member Data Documentation

◆ source_

const edm::InputTag TestAlpakaAnalyzer::source_
private

◆ token_

const edm::EDGetTokenT<portabletest::TestHostCollection> TestAlpakaAnalyzer::token_
private

Definition at line 140 of file TestAlpakaAnalyzer.cc.

Referenced by analyze().