CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
edm::one::EDAnalyzerBase Class Referenceabstract

#include <EDAnalyzerBase.h>

Inheritance diagram for edm::one::EDAnalyzerBase:
edm::EDConsumerBase edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzer< edm::one::WatchLuminosityBlocks > edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks > edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzer< one::WatchRuns, one::WatchLuminosityBlocks > edm::one::EDAnalyzer<> edm::one::EDAnalyzer< T >

Public Types

typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void analyze (Event const &, EventSetup const &)=0
 
virtual void beginJob ()
 
virtual SharedResourcesAcquirer createAcquirer ()
 
void doBeginJob ()
 
void doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
virtual void doBeginLuminosityBlock_ (LuminosityBlock const &lbp, EventSetup const &c)
 
void doBeginRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
virtual void doBeginRun_ (Run const &rp, EventSetup const &c)
 
void doEndJob ()
 
void doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
virtual void doEndLuminosityBlock_ (LuminosityBlock const &lbp, EventSetup const &c)
 
void doEndRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
virtual void doEndRun_ (Run const &rp, EventSetup const &c)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
 
void doPostForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)
 
void doPreallocate (PreallocationConfiguration const &)
 
void doPreForkReleaseResources ()
 
void doRegisterThinnedAssociations (ProductRegistry const &, ThinnedAssociationsHelper &)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
virtual void endJob ()
 
virtual void postForkReacquireResources (unsigned int, unsigned int)
 
virtual void preForkReleaseResources ()
 
void registerProductsAndCallbacks (EDAnalyzerBase const *module, ProductRegistry *reg)
 
void setModuleDescription (ModuleDescription const &md)
 
std::string workerType () const
 

Private Attributes

std::function< void(BranchDescription
const &)> 
callWhenNewProductsRegistered_
 
ModuleDescription moduleDescription_
 
std::mutex mutex_
 
SharedResourcesAcquirer resourcesAcquirer_
 

Friends

template<typename T >
class edm::maker::ModuleHolderT
 
template<typename T >
class edm::WorkerT
 

Additional Inherited Members

- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 46 of file EDAnalyzerBase.h.

Member Typedef Documentation

Definition at line 53 of file EDAnalyzerBase.h.

Constructor & Destructor Documentation

EDAnalyzerBase::EDAnalyzerBase ( )

Definition at line 42 of file EDAnalyzerBase.cc.

42  :
43  moduleDescription_() { }
ModuleDescription moduleDescription_
EDAnalyzerBase::~EDAnalyzerBase ( )
virtual

Definition at line 45 of file EDAnalyzerBase.cc.

46  {
47  }

Member Function Documentation

virtual void edm::one::EDAnalyzerBase::analyze ( Event const &  ,
EventSetup const &   
)
privatepure virtual
const std::string & EDAnalyzerBase::baseType ( )
static

Definition at line 162 of file EDAnalyzerBase.cc.

References edm::one::kBaseType().

162  {
163  return kBaseType;
164  }
static const std::string kBaseType("EDAnalyzer")
virtual void edm::one::EDAnalyzerBase::beginJob ( void  )
inlineprivatevirtual
void EDAnalyzerBase::callWhenNewProductsRegistered ( std::function< void(BranchDescription const &)> const &  func)

Definition at line 50 of file EDAnalyzerBase.cc.

References callWhenNewProductsRegistered_, and RecoJets_EventContent_cff::func.

50  {
52  }
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
SharedResourcesAcquirer EDAnalyzerBase::createAcquirer ( )
privatevirtual

Definition at line 70 of file EDAnalyzerBase.cc.

Referenced by doBeginJob().

70  {
71  return SharedResourcesAcquirer{};
72  }
void EDAnalyzerBase::doBeginJob ( )
private

Definition at line 75 of file EDAnalyzerBase.cc.

References beginJob(), createAcquirer(), and resourcesAcquirer_.

75  {
77 
78  this->beginJob();
79  }
virtual SharedResourcesAcquirer createAcquirer()
SharedResourcesAcquirer resourcesAcquirer_
void EDAnalyzerBase::doBeginLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
private

Definition at line 105 of file EDAnalyzerBase.cc.

References doBeginLuminosityBlock_(), moduleDescription_, and edm::LuminosityBlock::setConsumer().

106  {
107  LuminosityBlock lb(lbp, moduleDescription_, mcc);
108  lb.setConsumer(this);
109  LuminosityBlock const& cnstLb = lb;
110  this->doBeginLuminosityBlock_(cnstLb, c);
111  }
ModuleDescription moduleDescription_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
void EDAnalyzerBase::doBeginLuminosityBlock_ ( LuminosityBlock const &  lbp,
EventSetup const &  c 
)
privatevirtual

Definition at line 144 of file EDAnalyzerBase.cc.

Referenced by doBeginLuminosityBlock().

144 {}
void EDAnalyzerBase::doBeginRun ( RunPrincipal const &  rp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
private

Definition at line 87 of file EDAnalyzerBase.cc.

References doBeginRun_(), moduleDescription_, alignCSCRings::r, and edm::Run::setConsumer().

88  {
89  Run r(rp, moduleDescription_, mcc);
90  r.setConsumer(this);
91  Run const& cnstR = r;
92  this->doBeginRun_(cnstR, c);
93  }
ModuleDescription moduleDescription_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
void EDAnalyzerBase::doBeginRun_ ( Run const &  rp,
EventSetup const &  c 
)
privatevirtual

Definition at line 142 of file EDAnalyzerBase.cc.

Referenced by doBeginRun().

142 {}
void EDAnalyzerBase::doEndJob ( )
private

Definition at line 82 of file EDAnalyzerBase.cc.

References endJob().

82  {
83  this->endJob();
84  }
void EDAnalyzerBase::doEndLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
private

Definition at line 114 of file EDAnalyzerBase.cc.

References doEndLuminosityBlock_(), moduleDescription_, and edm::LuminosityBlock::setConsumer().

115  {
116  LuminosityBlock lb(lbp, moduleDescription_, mcc);
117  lb.setConsumer(this);
118  LuminosityBlock const& cnstLb = lb;
119  this->doEndLuminosityBlock_(cnstLb, c);
120  }
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
ModuleDescription moduleDescription_
void EDAnalyzerBase::doEndLuminosityBlock_ ( LuminosityBlock const &  lbp,
EventSetup const &  c 
)
privatevirtual

Definition at line 145 of file EDAnalyzerBase.cc.

Referenced by doEndLuminosityBlock().

145 {}
void EDAnalyzerBase::doEndRun ( RunPrincipal const &  rp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
private

Definition at line 96 of file EDAnalyzerBase.cc.

References doEndRun_(), moduleDescription_, alignCSCRings::r, and edm::Run::setConsumer().

97  {
98  Run r(rp, moduleDescription_, mcc);
99  r.setConsumer(this);
100  Run const& cnstR = r;
101  this->doEndRun_(cnstR, c);
102  }
virtual void doEndRun_(Run const &rp, EventSetup const &c)
ModuleDescription moduleDescription_
void EDAnalyzerBase::doEndRun_ ( Run const &  rp,
EventSetup const &  c 
)
privatevirtual

Definition at line 143 of file EDAnalyzerBase.cc.

Referenced by doEndRun().

143 {}
bool EDAnalyzerBase::doEvent ( EventPrincipal const &  ep,
EventSetup const &  c,
ActivityRegistry act,
ModuleCallingContext const *  mcc 
)
private

Definition at line 55 of file EDAnalyzerBase.cc.

References analyze(), alignCSCRings::e, moduleDescription_, mutex_, resourcesAcquirer_, edm::Event::setConsumer(), and edm::Event::setSharedResourcesAcquirer().

57  {
58  Event e(ep, moduleDescription_, mcc);
59  e.setConsumer(this);
60  {
61  std::lock_guard<std::mutex> guard(mutex_);
62  std::lock_guard<SharedResourcesAcquirer> guardResources(resourcesAcquirer_);
63  e.setSharedResourcesAcquirer(&resourcesAcquirer_);
64  EventSignalsSentry sentry(act,mcc);
65  this->analyze(e, c);
66  }
67  return true;
68  }
virtual void analyze(Event const &, EventSetup const &)=0
SharedResourcesAcquirer resourcesAcquirer_
ModuleDescription moduleDescription_
void EDAnalyzerBase::doPostForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)
private

Definition at line 138 of file EDAnalyzerBase.cc.

References postForkReacquireResources().

138  {
139  postForkReacquireResources(iChildIndex, iNumberOfChildren);
140  }
virtual void postForkReacquireResources(unsigned int, unsigned int)
void edm::one::EDAnalyzerBase::doPreallocate ( PreallocationConfiguration const &  )
inlineprivate

Definition at line 72 of file EDAnalyzerBase.h.

72 {}
void EDAnalyzerBase::doPreForkReleaseResources ( )
private

Definition at line 133 of file EDAnalyzerBase.cc.

References preForkReleaseResources().

133  {
135  }
virtual void preForkReleaseResources()
void edm::one::EDAnalyzerBase::doRegisterThinnedAssociations ( ProductRegistry const &  ,
ThinnedAssociationsHelper  
)
inlineprivate

Definition at line 91 of file EDAnalyzerBase.h.

92  { }
void EDAnalyzerBase::doRespondToCloseInputFile ( FileBlock const &  fb)
private

Definition at line 128 of file EDAnalyzerBase.cc.

128  {
129  //respondToCloseInputFile(fb);
130  }
void EDAnalyzerBase::doRespondToOpenInputFile ( FileBlock const &  fb)
private

Definition at line 123 of file EDAnalyzerBase.cc.

123  {
124  //respondToOpenInputFile(fb);
125  }
virtual void edm::one::EDAnalyzerBase::endJob ( void  )
inlineprivatevirtual
void EDAnalyzerBase::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 148 of file EDAnalyzerBase.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

148  {
150  desc.setUnknown();
151  descriptions.addDefault(desc);
152  }
ModuleDescription const& edm::one::EDAnalyzerBase::moduleDescription ( ) const
inline

Definition at line 64 of file EDAnalyzerBase.h.

References moduleDescription_.

64 { return moduleDescription_; }
ModuleDescription moduleDescription_
virtual void edm::one::EDAnalyzerBase::postForkReacquireResources ( unsigned  int,
unsigned  int 
)
inlineprivatevirtual

Definition at line 102 of file EDAnalyzerBase.h.

Referenced by doPostForkReacquireResources().

102 {}
virtual void edm::one::EDAnalyzerBase::preForkReleaseResources ( )
inlineprivatevirtual

Definition at line 101 of file EDAnalyzerBase.h.

Referenced by doPreForkReleaseResources().

101 {}
void EDAnalyzerBase::prevalidate ( ConfigurationDescriptions descriptions)
static

Definition at line 155 of file EDAnalyzerBase.cc.

References edm::edmodule_mightGet_config().

155  {
156  edmodule_mightGet_config(iConfig);
157  }
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
void EDAnalyzerBase::registerProductsAndCallbacks ( EDAnalyzerBase const *  module,
ProductRegistry reg 
)
private

Definition at line 167 of file EDAnalyzerBase.cc.

References edm::ProductRegistry::callForEachBranch(), and callWhenNewProductsRegistered_.

167  {
168 
170 
171  reg->callForEachBranch(callWhenNewProductsRegistered_);
172 
174  regService->watchProductAdditions(callWhenNewProductsRegistered_);
175  }
176  }
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
void edm::one::EDAnalyzerBase::setModuleDescription ( ModuleDescription const &  md)
inlineprivate

Definition at line 112 of file EDAnalyzerBase.h.

References moduleDescription_.

112  {
113  moduleDescription_ = md;
114  }
ModuleDescription moduleDescription_
std::string edm::one::EDAnalyzerBase::workerType ( ) const
inlineprivate

Definition at line 95 of file EDAnalyzerBase.h.

95 {return "WorkerT<EDAnalyzer>";}

Friends And Related Function Documentation

template<typename T >
friend class edm::maker::ModuleHolderT
friend

Definition at line 51 of file EDAnalyzerBase.h.

template<typename T >
friend class edm::WorkerT
friend

Definition at line 50 of file EDAnalyzerBase.h.

Member Data Documentation

std::function<void(BranchDescription const&)> edm::one::EDAnalyzerBase::callWhenNewProductsRegistered_
private
ModuleDescription edm::one::EDAnalyzerBase::moduleDescription_
private
std::mutex edm::one::EDAnalyzerBase::mutex_
private

Definition at line 119 of file EDAnalyzerBase.h.

Referenced by doEvent().

SharedResourcesAcquirer edm::one::EDAnalyzerBase::resourcesAcquirer_
private

Definition at line 118 of file EDAnalyzerBase.h.

Referenced by doBeginJob(), and doEvent().