CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
SonicOneEDAnalyzer< Client, Capabilities > Class Template Referenceabstract

#include <SonicOneEDAnalyzer.h>

Inheritance diagram for SonicOneEDAnalyzer< Client, Capabilities >:
edm::one::EDAnalyzer< Capabilities... > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef Client::Input Input
 
typedef Client::Output Output
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

virtual void acquire (edm::Event const &iEvent, edm::EventSetup const &iSetup, Input &iInput)=0
 
void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) final
 
virtual void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup, Output const &iOutput)=0
 
void beginJob () override
 
 SonicOneEDAnalyzer (edm::ParameterSet const &cfg, bool verbose=true)
 
 ~SonicOneEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDAnalyzer< Capabilities... >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~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)
 

Protected Member Functions

void makeClient ()
 
- 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)
 

Protected Attributes

std::unique_ptr< Client > client_
 
edm::ParameterSet clientPset_
 
std::string debugName_
 
bool verbose_
 

Additional Inherited Members

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

Detailed Description

template<typename Client, typename... Capabilities>
class SonicOneEDAnalyzer< Client, Capabilities >

Definition at line 18 of file SonicOneEDAnalyzer.h.

Member Typedef Documentation

◆ Input

template<typename Client, typename... Capabilities>
typedef Client::Input SonicOneEDAnalyzer< Client, Capabilities >::Input

Definition at line 21 of file SonicOneEDAnalyzer.h.

◆ Output

template<typename Client, typename... Capabilities>
typedef Client::Output SonicOneEDAnalyzer< Client, Capabilities >::Output

Definition at line 22 of file SonicOneEDAnalyzer.h.

Constructor & Destructor Documentation

◆ SonicOneEDAnalyzer()

template<typename Client, typename... Capabilities>
SonicOneEDAnalyzer< Client, Capabilities >::SonicOneEDAnalyzer ( edm::ParameterSet const &  cfg,
bool  verbose = true 
)
inline

Definition at line 24 of file SonicOneEDAnalyzer.h.

25  : clientPset_(cfg.getParameterSet("Client")),
26  debugName_(cfg.getParameter<std::string>("@module_label")),
27  verbose_(clientPset_.getUntrackedParameter<bool>("verbose")) {
28  //ExternalWork is not compatible with one modules, so Sync mode is enforced
29  if (clientPset_.getParameter<std::string>("mode") != "Sync") {
30  edm::LogWarning("ResetClientMode") << "Resetting client mode to Sync for SonicOneEDAnalyzer";
31  clientPset_.addParameter<std::string>("mode", "Sync");
32  }
33  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet clientPset_
T getUntrackedParameter(std::string const &, T const &) const
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:135
Log< level::Warning, false > LogWarning

◆ ~SonicOneEDAnalyzer()

template<typename Client, typename... Capabilities>
SonicOneEDAnalyzer< Client, Capabilities >::~SonicOneEDAnalyzer ( )
overridedefault

Member Function Documentation

◆ acquire()

template<typename Client, typename... Capabilities>
virtual void SonicOneEDAnalyzer< Client, Capabilities >::acquire ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup,
Input iInput 
)
pure virtual

◆ analyze() [1/2]

template<typename Client, typename... Capabilities>
void SonicOneEDAnalyzer< Client, Capabilities >::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
inlinefinalvirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 44 of file SonicOneEDAnalyzer.h.

Referenced by SonicOneEDAnalyzer< TritonClient, Capabilities... >::analyze().

44  {
46  acquire(iEvent, iSetup, client_->input());
47  if (verbose_)
48  sonic_utils::printDebugTime(debugName_, "acquire() time: ", t0);
49 
50  //pattern similar to ExternalWork, but blocking
52  client_->dispatch();
53 
54  //measure time between acquire and produce
55  if (verbose_)
56  sonic_utils::printDebugTime(debugName_, "dispatch() time: ", t1);
57 
59  analyze(iEvent, iSetup, client_->output());
60  if (verbose_)
61  sonic_utils::printDebugTime(debugName_, "analyze() time: ", t2);
62 
63  //reset client data
64  client_->reset();
65  }
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) final
virtual void acquire(edm::Event const &iEvent, edm::EventSetup const &iSetup, Input &iInput)=0
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< Client > client_
void printDebugTime(std::string_view debugName, std::string_view msg, const TimePoint &t0)
Definition: sonic_utils.cc:8

◆ analyze() [2/2]

template<typename Client, typename... Capabilities>
virtual void SonicOneEDAnalyzer< Client, Capabilities >::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup,
Output const &  iOutput 
)
pure virtual

◆ beginJob()

template<typename Client, typename... Capabilities>
void SonicOneEDAnalyzer< Client, Capabilities >::beginJob ( void  )
inlineoverridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 39 of file SonicOneEDAnalyzer.h.

39 { makeClient(); }

◆ makeClient()

template<typename Client, typename... Capabilities>
void SonicOneEDAnalyzer< Client, Capabilities >::makeClient ( )
inlineprotected

Definition at line 70 of file SonicOneEDAnalyzer.h.

Referenced by SonicOneEDAnalyzer< TritonClient, Capabilities... >::beginJob().

70 { client_ = std::make_unique<Client>(clientPset_, debugName_); }
edm::ParameterSet clientPset_
std::unique_ptr< Client > client_

Member Data Documentation

◆ client_

template<typename Client, typename... Capabilities>
std::unique_ptr<Client> SonicOneEDAnalyzer< Client, Capabilities >::client_
protected

◆ clientPset_

template<typename Client, typename... Capabilities>
edm::ParameterSet SonicOneEDAnalyzer< Client, Capabilities >::clientPset_
protected

◆ debugName_

template<typename Client, typename... Capabilities>
std::string SonicOneEDAnalyzer< Client, Capabilities >::debugName_
protected

◆ verbose_

template<typename Client, typename... Capabilities>
bool SonicOneEDAnalyzer< Client, Capabilities >::verbose_
protected