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 | Protected Member Functions | Private Member Functions | Private Attributes | Friends
edm::one::OutputModuleBase Class Referenceabstract

#include <OutputModuleBase.h>

Inheritance diagram for edm::one::OutputModuleBase:
edm::EDConsumerBase edm::one::OutputModule< T > edm::one::outputmodule::InputFileWatcher edm::one::outputmodule::LuminosityBlockWatcher edm::one::outputmodule::RunWatcher edm::one::OutputModule< one::WatchRuns, one::WatchLuminosityBlocks > edm::one::OutputModule< WatchInputFiles > edm::one::OutputModule<> edm::StreamerOutputModuleBase edm::PoolOutputModule DQMRootOutputModule edm::StreamerOutputModule< Consumer > evf::RecoEventOutputModuleForFU< Consumer > edm::TimeoutPoolOutputModule dqmservices::JsonWritingTimeoutPoolOutputModule

Public Types

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

Public Member Functions

BranchIDLists const * branchIDLists ()
 
std::array< bool,
NumBranchTypes > const & 
hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType
const & 
keptProducts () const
 
int maxEvents () const
 
const ModuleDescriptionmoduleDescription () const
 
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &)
 
ThinnedAssociationsHelper const * thinnedAssociationsHelper () const
 
bool wantAllEvents () const
 
virtual ~OutputModuleBase ()
 
- 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 fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
bool doEndRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
std::map< BranchID::value_type,
BranchID::value_type > const & 
droppedBranchIDToKeptBranchID ()
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
 
- 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)
 

Private Member Functions

virtual void beginJob ()
 
virtual SharedResourcesAcquirer createAcquirer ()
 
virtual void doBeginLuminosityBlock_ (LuminosityBlockPrincipal const &, ModuleCallingContext const *)
 
virtual void doBeginRun_ (RunPrincipal const &, ModuleCallingContext const *)
 
void doCloseFile ()
 Tell the OutputModule that is must end the current file. More...
 
virtual void doEndLuminosityBlock_ (LuminosityBlockPrincipal const &, ModuleCallingContext const *)
 
virtual void doEndRun_ (RunPrincipal const &, ModuleCallingContext const *)
 
void doOpenFile (FileBlock const &fb)
 
void doPostForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)
 
void doPreForkReleaseResources ()
 
void doRegisterThinnedAssociations (ProductRegistry const &, ThinnedAssociationsHelper &)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
virtual void doRespondToCloseInputFile_ (FileBlock const &)
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
virtual void doRespondToOpenInputFile_ (FileBlock const &)
 
void doWriteLuminosityBlock (LuminosityBlockPrincipal const &lbp, ModuleCallingContext const *)
 
void doWriteRun (RunPrincipal const &rp, ModuleCallingContext const *)
 
virtual void endJob ()
 
virtual bool isFileOpen () const
 
void keepThisBranch (BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
 
bool limitReached () const
 
void maybeOpenFile ()
 
virtual void openFile (FileBlock const &)
 
virtual void postForkReacquireResources (unsigned int, unsigned int)
 
virtual void preForkReleaseResources ()
 
bool prePrefetchSelection (StreamID id, EventPrincipal const &, ModuleCallingContext const *)
 
virtual void reallyCloseFile ()
 
virtual void reallyOpenFile ()
 
void registerProductsAndCallbacks (OutputModuleBase const *, ProductRegistry const *)
 
void setModuleDescription (ModuleDescription const &md)
 
virtual bool shouldWeCloseFile () const
 Ask the OutputModule if we should end the current file. More...
 
std::string workerType () const
 
virtual void write (EventPrincipal const &e, ModuleCallingContext const *)=0
 
virtual void writeLuminosityBlock (LuminosityBlockPrincipal const &, ModuleCallingContext const *)=0
 
virtual void writeRun (RunPrincipal const &, ModuleCallingContext const *)=0
 

Private Attributes

edm::propagate_const
< std::unique_ptr
< BranchIDLists > > 
branchIDLists_
 
std::map< BranchID::value_type,
BranchID::value_type
droppedBranchIDToKeptBranchID_
 
std::array< bool, NumBranchTypeshasNewlyDroppedBranch_
 
std::map< BranchID, bool > keepAssociation_
 
SelectedProductsForBranchType keptProducts_
 
int maxEvents_
 
ModuleDescription moduleDescription_
 
std::mutex mutex_
 
BranchIDLists const * origBranchIDLists_
 
std::string process_name_
 
ProductSelector productSelector_
 
ProductSelectorRules productSelectorRules_
 
std::atomic< int > remainingEvents_
 
SharedResourcesAcquirer resourcesAcquirer_
 
ParameterSet selectEvents_
 
ParameterSetID selector_config_id_
 
std::vector
< detail::TriggerResultsBasedEventSelector
selectors_
 
edm::propagate_const
< std::unique_ptr
< ThinnedAssociationsHelper > > 
thinnedAssociationsHelper_
 
bool wantAllEvents_
 

Friends

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

Detailed Description

Definition at line 63 of file OutputModuleBase.h.

Member Typedef Documentation

Definition at line 68 of file OutputModuleBase.h.

Constructor & Destructor Documentation

OutputModuleBase::OutputModuleBase ( ParameterSet const &  pset)
explicit

Definition at line 42 of file OutputModuleBase.cc.

References edm::detail::configureEventSelector(), edm::getAllTriggerNames(), edm::ParameterSet::getUntrackedParameterSet(), hasNewlyDroppedBranch_, edm::ParameterSet::id(), process_name_, edm::ParameterSet::registerIt(), selectEvents_, selector_config_id_, selectors_, and wantAllEvents_.

42  :
43  maxEvents_(-1),
45  keptProducts_(),
47  process_name_(),
48  productSelectorRules_(pset, "outputCommands", "OutputModule"),
51  wantAllEvents_(false),
52  selectors_(),
56  origBranchIDLists_(nullptr),
57  thinnedAssociationsHelper_(new ThinnedAssociationsHelper) {
58 
59  hasNewlyDroppedBranch_.fill(false);
60 
62  process_name_ = tns->getProcessName();
63 
65  pset.getUntrackedParameterSet("SelectEvents", ParameterSet());
66 
67  selectEvents_.registerIt(); // Just in case this PSet is not registered
68 
70 
71  //need to set wantAllEvents_ in constructor
72  // we will make the remaining selectors once we know how many streams
73  selectors_.resize(1);
77  selectors_[0]);
78 
79  }
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
SelectedProductsForBranchType keptProducts_
ModuleDescription moduleDescription_
ParameterSetID id() const
ProductSelectorRules productSelectorRules_
std::atomic< int > remainingEvents_
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
std::vector< detail::TriggerResultsBasedEventSelector > selectors_
std::vector< std::string > const & getAllTriggerNames()
BranchIDLists const * origBranchIDLists_
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
ProductSelector productSelector_
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector)
ParameterSet const & registerIt()
ParameterSetID selector_config_id_
edm::propagate_const< std::unique_ptr< BranchIDLists > > branchIDLists_
OutputModuleBase::~OutputModuleBase ( )
virtual

Definition at line 180 of file OutputModuleBase.cc.

180 { }
edm::one::OutputModuleBase::OutputModuleBase ( OutputModuleBase const &  )
delete

Member Function Documentation

const std::string & OutputModuleBase::baseType ( )
static

Definition at line 378 of file OutputModuleBase.cc.

References edm::one::kBaseType().

378  {
379  return kBaseType;
380  }
static const std::string kBaseType("EDAnalyzer")
virtual void edm::one::OutputModuleBase::beginJob ( void  )
inlineprivatevirtual
BranchIDLists const * OutputModuleBase::branchIDLists ( )

Definition at line 324 of file OutputModuleBase.cc.

References branchIDLists_, droppedBranchIDToKeptBranchID_, and origBranchIDLists_.

Referenced by edm::StreamerOutputModuleBase::serializeRegistry().

324  {
325  if(!droppedBranchIDToKeptBranchID_.empty()) {
326  // Make a private copy of the BranchIDLists.
328  // Check for branches dropped while an EDAlias was kept.
329  for(BranchIDList& branchIDList : *branchIDLists_) {
330  for(BranchID::value_type& branchID : branchIDList) {
331  // Replace BranchID of each dropped branch with that of the kept alias, so the alias branch will have the product ID of the original branch.
332  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter = droppedBranchIDToKeptBranchID_.find(branchID);
333  if(iter != droppedBranchIDToKeptBranchID_.end()) {
334  branchID = iter->second;
335  }
336  }
337  }
338  return branchIDLists_.get();
339  }
340  return origBranchIDLists_;
341  }
unsigned int value_type
Definition: BranchID.h:16
std::vector< BranchID::value_type > BranchIDList
Definition: BranchIDList.h:18
BranchIDLists const * origBranchIDLists_
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
edm::propagate_const< std::unique_ptr< BranchIDLists > > branchIDLists_
void OutputModuleBase::configure ( OutputModuleDescription const &  desc)
protected
SharedResourcesAcquirer OutputModuleBase::createAcquirer ( )
privatevirtual

Definition at line 182 of file OutputModuleBase.cc.

Referenced by doBeginJob().

182  {
183  return SharedResourcesAcquirer{};
184  }
ModuleDescription const & OutputModuleBase::description ( ) const
protected
void OutputModuleBase::doBeginJob ( )
protected

Definition at line 203 of file OutputModuleBase.cc.

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

203  {
205  this->beginJob();
206  }
SharedResourcesAcquirer resourcesAcquirer_
virtual SharedResourcesAcquirer createAcquirer()
bool OutputModuleBase::doBeginLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protected

Definition at line 261 of file OutputModuleBase.cc.

References doBeginLuminosityBlock_().

263  {
264  doBeginLuminosityBlock_(lbp, mcc);
265  return true;
266  }
virtual void doBeginLuminosityBlock_(LuminosityBlockPrincipal const &, ModuleCallingContext const *)
virtual void edm::one::OutputModuleBase::doBeginLuminosityBlock_ ( LuminosityBlockPrincipal const &  ,
ModuleCallingContext const *   
)
inlineprivatevirtual

Reimplemented in edm::one::outputmodule::LuminosityBlockWatcher.

Definition at line 235 of file OutputModuleBase.h.

Referenced by doBeginLuminosityBlock().

235 {}
bool OutputModuleBase::doBeginRun ( RunPrincipal const &  rp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protected

Definition at line 239 of file OutputModuleBase.cc.

References doBeginRun_().

241  {
242  doBeginRun_(rp, mcc);
243  return true;
244  }
virtual void doBeginRun_(RunPrincipal const &, ModuleCallingContext const *)
virtual void edm::one::OutputModuleBase::doBeginRun_ ( RunPrincipal const &  ,
ModuleCallingContext const *   
)
inlineprivatevirtual

Reimplemented in edm::one::outputmodule::RunWatcher.

Definition at line 233 of file OutputModuleBase.h.

Referenced by doBeginRun().

233 {}
void OutputModuleBase::doCloseFile ( )
private

Tell the OutputModule that is must end the current file.

Definition at line 314 of file OutputModuleBase.cc.

References isFileOpen(), and reallyCloseFile().

314  {
315  if(isFileOpen()) {
316  reallyCloseFile();
317  }
318  }
virtual bool isFileOpen() const
void OutputModuleBase::doEndJob ( )
protected

Definition at line 208 of file OutputModuleBase.cc.

References endJob().

208  {
209  endJob();
210  }
bool OutputModuleBase::doEndLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protected

Definition at line 269 of file OutputModuleBase.cc.

References doEndLuminosityBlock_().

271  {
272  doEndLuminosityBlock_(lbp, mcc);
273  return true;
274  }
virtual void doEndLuminosityBlock_(LuminosityBlockPrincipal const &, ModuleCallingContext const *)
virtual void edm::one::OutputModuleBase::doEndLuminosityBlock_ ( LuminosityBlockPrincipal const &  ,
ModuleCallingContext const *   
)
inlineprivatevirtual

Reimplemented in edm::one::outputmodule::LuminosityBlockWatcher.

Definition at line 236 of file OutputModuleBase.h.

Referenced by doEndLuminosityBlock().

236 {}
bool OutputModuleBase::doEndRun ( RunPrincipal const &  rp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protected

Definition at line 247 of file OutputModuleBase.cc.

References doEndRun_().

249  {
250  doEndRun_(rp, mcc);
251  return true;
252  }
virtual void doEndRun_(RunPrincipal const &, ModuleCallingContext const *)
virtual void edm::one::OutputModuleBase::doEndRun_ ( RunPrincipal const &  ,
ModuleCallingContext const *   
)
inlineprivatevirtual

Reimplemented in edm::one::outputmodule::RunWatcher.

Definition at line 234 of file OutputModuleBase.h.

Referenced by doEndRun().

234 {}
bool OutputModuleBase::doEvent ( EventPrincipal const &  ep,
EventSetup const &  c,
ActivityRegistry act,
ModuleCallingContext const *  mcc 
)
protected

Definition at line 219 of file OutputModuleBase.cc.

References mutex_, remainingEvents_, resourcesAcquirer_, and write().

222  {
223 
224  {
225  std::lock_guard<std::mutex> guard(mutex_);
226  {
227  std::lock_guard<SharedResourcesAcquirer> guard(resourcesAcquirer_);
228  EventSignalsSentry sentry(act,mcc);
229  write(ep, mcc);
230  }
231  }
232  if(remainingEvents_ > 0) {
234  }
235  return true;
236  }
std::atomic< int > remainingEvents_
SharedResourcesAcquirer resourcesAcquirer_
virtual void write(EventPrincipal const &e, ModuleCallingContext const *)=0
void OutputModuleBase::doOpenFile ( FileBlock const &  fb)
private

Definition at line 281 of file OutputModuleBase.cc.

References openFile().

281  {
282  openFile(fb);
283  }
virtual void openFile(FileBlock const &)
void OutputModuleBase::doPostForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)
private

Definition at line 299 of file OutputModuleBase.cc.

References postForkReacquireResources().

299  {
300  postForkReacquireResources(iChildIndex, iNumberOfChildren);
301  }
virtual void postForkReacquireResources(unsigned int, unsigned int)
void OutputModuleBase::doPreallocate ( PreallocationConfiguration const &  iPC)
protected

Definition at line 186 of file OutputModuleBase.cc.

References edm::detail::configureEventSelector(), edm::getAllTriggerNames(), edm::PreallocationConfiguration::numberOfStreams(), process_name_, alignCSCRings::s, selectEvents_, and selectors_.

186  {
187  auto nstreams = iPC.numberOfStreams();
188  selectors_.resize(nstreams);
189 
190  bool seenFirst = false;
191  for(auto& s : selectors_) {
192  if(seenFirst) {
196  s);
197  } else {
198  seenFirst = true;
199  }
200  }
201  }
std::vector< detail::TriggerResultsBasedEventSelector > selectors_
std::vector< std::string > const & getAllTriggerNames()
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector)
void OutputModuleBase::doPreForkReleaseResources ( )
private

Definition at line 294 of file OutputModuleBase.cc.

References preForkReleaseResources().

294  {
296  }
virtual void preForkReleaseResources()
void edm::one::OutputModuleBase::doRegisterThinnedAssociations ( ProductRegistry const &  ,
ThinnedAssociationsHelper  
)
inlineprivate

Definition at line 197 of file OutputModuleBase.h.

198  { }
void OutputModuleBase::doRespondToCloseInputFile ( FileBlock const &  fb)
private

Definition at line 289 of file OutputModuleBase.cc.

References doRespondToCloseInputFile_().

289  {
291  }
virtual void doRespondToCloseInputFile_(FileBlock const &)
virtual void edm::one::OutputModuleBase::doRespondToCloseInputFile_ ( FileBlock const &  )
inlineprivatevirtual

Reimplemented in edm::one::outputmodule::InputFileWatcher.

Definition at line 238 of file OutputModuleBase.h.

Referenced by doRespondToCloseInputFile().

238 {}
void OutputModuleBase::doRespondToOpenInputFile ( FileBlock const &  fb)
private

Definition at line 285 of file OutputModuleBase.cc.

References doRespondToOpenInputFile_().

285  {
287  }
virtual void doRespondToOpenInputFile_(FileBlock const &)
virtual void edm::one::OutputModuleBase::doRespondToOpenInputFile_ ( FileBlock const &  )
inlineprivatevirtual

Reimplemented in edm::one::outputmodule::InputFileWatcher.

Definition at line 237 of file OutputModuleBase.h.

Referenced by doRespondToOpenInputFile().

237 {}
void OutputModuleBase::doWriteLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
ModuleCallingContext const *  mcc 
)
private

Definition at line 276 of file OutputModuleBase.cc.

References writeLuminosityBlock().

277  {
278  writeLuminosityBlock(lbp, mcc);
279  }
virtual void writeLuminosityBlock(LuminosityBlockPrincipal const &, ModuleCallingContext const *)=0
void OutputModuleBase::doWriteRun ( RunPrincipal const &  rp,
ModuleCallingContext const *  mcc 
)
private

Definition at line 255 of file OutputModuleBase.cc.

References writeRun().

256  {
257  writeRun(rp, mcc);
258  }
virtual void writeRun(RunPrincipal const &, ModuleCallingContext const *)=0
std::map<BranchID::value_type, BranchID::value_type> const& edm::one::OutputModuleBase::droppedBranchIDToKeptBranchID ( )
inlineprotected

Definition at line 132 of file OutputModuleBase.h.

References droppedBranchIDToKeptBranchID_.

132  {
134  }
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
virtual void edm::one::OutputModuleBase::endJob ( void  )
inlineprivatevirtual

Reimplemented in edm::StreamerOutputModuleBase.

Definition at line 223 of file OutputModuleBase.h.

Referenced by doEndJob().

223 {}
void OutputModuleBase::fillDescription ( ParameterSetDescription desc)
static

Definition at line 366 of file OutputModuleBase.cc.

References edm::ProductSelectorRules::fillDescription(), and edm::EventSelector::fillDescription().

366  {
367  ProductSelectorRules::fillDescription(desc, "outputCommands");
369  }
static void fillDescription(ParameterSetDescription &desc, char const *parameterName)
static void fillDescription(ParameterSetDescription &desc)
void OutputModuleBase::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 359 of file OutputModuleBase.cc.

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

359  {
361  desc.setUnknown();
362  descriptions.addDefault(desc);
363  }
std::array<bool, NumBranchTypes> const& edm::one::OutputModuleBase::hasNewlyDroppedBranch ( ) const
inline

Definition at line 89 of file OutputModuleBase.h.

References hasNewlyDroppedBranch_.

89 {return hasNewlyDroppedBranch_;}
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
virtual bool edm::one::OutputModuleBase::isFileOpen ( ) const
inlineprivatevirtual

Reimplemented in DQMRootOutputModule, and edm::PoolOutputModule.

Definition at line 227 of file OutputModuleBase.h.

Referenced by doCloseFile(), and maybeOpenFile().

227 { return true; }
void OutputModuleBase::keepThisBranch ( BranchDescription const &  desc,
std::map< BranchID, BranchDescription const * > &  trueBranchIDToKeptBranchDesc,
std::set< BranchID > &  keptProductsInEvent 
)
private

Definition at line 135 of file OutputModuleBase.cc.

References assert(), edm::BranchDescription::branchID(), edm::BranchDescription::branchType(), edm::ProductSelector::checkForDuplicateKeptBranch(), edm::EDConsumerBase::consumes(), edm::InEvent, edm::InLumi, HLT_FULL_cff::InputTag, edm::InRun, keptProducts_, edm::BranchDescription::moduleLabel(), edm::BranchDescription::originalBranchID(), edm::BranchDescription::processName(), edm::BranchDescription::produced(), edm::PRODUCT_TYPE, edm::BranchDescription::productInstanceName(), and edm::BranchDescription::unwrappedTypeID().

Referenced by selectProducts().

137  {
138 
140  trueBranchIDToKeptBranchDesc);
141 
142  switch (desc.branchType()) {
143  case InEvent:
144  {
145  if(desc.produced()) {
146  keptProductsInEvent.insert(desc.originalBranchID());
147  } else {
148  keptProductsInEvent.insert(desc.branchID());
149  }
150  consumes(TypeToGet{desc.unwrappedTypeID(),PRODUCT_TYPE},
151  InputTag{desc.moduleLabel(),
152  desc.productInstanceName(),
153  desc.processName()});
154  break;
155  }
156  case InLumi:
157  {
158  consumes<InLumi>(TypeToGet{desc.unwrappedTypeID(),PRODUCT_TYPE},
159  InputTag(desc.moduleLabel(),
160  desc.productInstanceName(),
161  desc.processName()));
162  break;
163  }
164  case InRun:
165  {
166  consumes<InRun>(TypeToGet{desc.unwrappedTypeID(),PRODUCT_TYPE},
167  InputTag(desc.moduleLabel(),
168  desc.productInstanceName(),
169  desc.processName()));
170  break;
171  }
172  default:
173  assert(false);
174  break;
175  }
176  // Now put it in the list of selected branches.
177  keptProducts_[desc.branchType()].push_back(&desc);
178  }
SelectedProductsForBranchType keptProducts_
assert(m_qm.get())
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
SelectedProductsForBranchType const& edm::one::OutputModuleBase::keptProducts ( ) const
inline

Definition at line 88 of file OutputModuleBase.h.

References keptProducts_.

Referenced by edm::PoolOutputModule::fillSelectedItemList().

88 {return keptProducts_;}
SelectedProductsForBranchType keptProducts_
bool edm::one::OutputModuleBase::limitReached ( ) const
inlineprivate

Definition at line 248 of file OutputModuleBase.h.

References remainingEvents_.

248 {return remainingEvents_ == 0;}
std::atomic< int > remainingEvents_
int edm::one::OutputModuleBase::maxEvents ( ) const
inline

Accessor for maximum number of events to be written. -1 is used for unlimited.

Definition at line 78 of file OutputModuleBase.h.

References maxEvents_.

void OutputModuleBase::maybeOpenFile ( )
private

Tell the OutputModule to open an output file, if one is not already open.

Definition at line 310 of file OutputModuleBase.cc.

References isFileOpen(), and reallyOpenFile().

310  {
311  if(!isFileOpen()) reallyOpenFile();
312  }
virtual bool isFileOpen() const
const ModuleDescription& edm::one::OutputModuleBase::moduleDescription ( ) const
inline
virtual void edm::one::OutputModuleBase::openFile ( FileBlock const &  )
inlineprivatevirtual
OutputModuleBase& edm::one::OutputModuleBase::operator= ( OutputModuleBase const &  )
delete
void OutputModuleBase::postForkReacquireResources ( unsigned int  ,
unsigned int   
)
privatevirtual

Reimplemented in DQMRootOutputModule, and edm::PoolOutputModule.

Definition at line 307 of file OutputModuleBase.cc.

Referenced by doPostForkReacquireResources().

307 {}
void OutputModuleBase::preForkReleaseResources ( )
privatevirtual

Definition at line 304 of file OutputModuleBase.cc.

Referenced by doPreForkReleaseResources().

304 {}
bool OutputModuleBase::prePrefetchSelection ( StreamID  id,
EventPrincipal const &  ep,
ModuleCallingContext const *  mcc 
)
private

Definition at line 212 of file OutputModuleBase.cc.

References or, alignCSCRings::s, selectors_, and wantAllEvents_.

212  {
213 
214  auto& s = selectors_[id.value()];
215  return wantAllEvents_ or s.wantEvent(ep,mcc);
216  }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< detail::TriggerResultsBasedEventSelector > selectors_
void OutputModuleBase::prevalidate ( ConfigurationDescriptions )
static

Definition at line 372 of file OutputModuleBase.cc.

372  {
373  }
std::string const& edm::one::OutputModuleBase::processName ( ) const
inline
void OutputModuleBase::reallyCloseFile ( )
privatevirtual

Reimplemented in DQMRootOutputModule, and edm::PoolOutputModule.

Definition at line 320 of file OutputModuleBase.cc.

Referenced by doCloseFile().

320  {
321  }
virtual void edm::one::OutputModuleBase::reallyOpenFile ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 228 of file OutputModuleBase.h.

Referenced by maybeOpenFile().

228 {}
void edm::one::OutputModuleBase::registerProductsAndCallbacks ( OutputModuleBase const *  ,
ProductRegistry const *   
)
inlineprivate

Definition at line 209 of file OutputModuleBase.h.

209 {}
int edm::one::OutputModuleBase::remainingEvents ( ) const
inline

Accessor for remaining number of events to be written. -1 is used for unlimited.

Definition at line 82 of file OutputModuleBase.h.

References remainingEvents_.

Referenced by edm::PoolOutputModule::beginInputFile().

82 {return remainingEvents_;}
std::atomic< int > remainingEvents_
bool OutputModuleBase::selected ( BranchDescription const &  desc) const

Definition at line 354 of file OutputModuleBase.cc.

References productSelector_, and edm::ProductSelector::selected().

Referenced by selectProducts().

354  {
355  return productSelector_.selected(desc);
356  }
bool selected(BranchDescription const &desc) const
ProductSelector productSelector_
ParameterSetID edm::one::OutputModuleBase::selectorConfig ( ) const
inlineprotected

Definition at line 109 of file OutputModuleBase.h.

References selector_config_id_.

Referenced by edm::StreamerOutputModuleBase::serializeEvent().

109 { return selector_config_id_; }
ParameterSetID selector_config_id_
void OutputModuleBase::selectProducts ( ProductRegistry const &  preg,
ThinnedAssociationsHelper const &  thinnedAssociationsHelper 
)

Definition at line 86 of file OutputModuleBase.cc.

References edm::ProductRegistry::allBranchDescriptions(), edm::BranchDescription::branchType(), droppedBranchIDToKeptBranchID_, edm::ProductSelector::fillDroppedToKept(), hasNewlyDroppedBranch_, edm::ProductSelector::initialize(), edm::ProductSelector::initialized(), keepAssociation_, keepThisBranch(), edm::BranchDescription::present(), edm::BranchDescription::produced(), edm::ProductRegistry::productList(), productSelector_, productSelectorRules_, edm::ThinnedAssociationsHelper::selectAssociationProducts(), selected(), thinnedAssociationsHelper_, edm::BranchDescription::transient(), and edm::BranchDescription::unwrappedType().

87  {
88  if(productSelector_.initialized()) return;
89  productSelector_.initialize(productSelectorRules_, preg.allBranchDescriptions());
90 
91  // TODO: See if we can collapse keptProducts_ and productSelector_ into a
92  // single object. See the notes in the header for ProductSelector
93  // for more information.
94 
95  std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
96  std::vector<BranchDescription const*> associationDescriptions;
97  std::set<BranchID> keptProductsInEvent;
98 
99  for(auto const& it : preg.productList()) {
100  BranchDescription const& desc = it.second;
101  if(desc.transient()) {
102  // if the class of the branch is marked transient, output nothing
103  } else if(!desc.present() && !desc.produced()) {
104  // else if the branch containing the product has been previously dropped,
105  // output nothing
106  } else if(desc.unwrappedType() == typeid(ThinnedAssociation)) {
107  associationDescriptions.push_back(&desc);
108  } else if(selected(desc)) {
109  keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
110  } else {
111  // otherwise, output nothing,
112  // and mark the fact that there is a newly dropped branch of this type.
113  hasNewlyDroppedBranch_[desc.branchType()] = true;
114  }
115  }
116 
118  keptProductsInEvent,
120 
121  for(auto association : associationDescriptions) {
122  if(keepAssociation_[association->branchID()]) {
123  keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
124  } else {
125  hasNewlyDroppedBranch_[association->branchType()] = true;
126  }
127  }
128 
129  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
131 
133  }
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
static void fillDroppedToKept(ProductRegistry const &preg, std::map< BranchID, BranchDescription const * > const &trueBranchIDToKeptBranchDesc, std::map< BranchID::value_type, BranchID::value_type > &droppedBranchIDToKeptBranchID_)
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
ProductSelectorRules productSelectorRules_
void selectAssociationProducts(std::vector< BranchDescription const * > const &associationDescriptions, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const
bool selected(BranchDescription const &desc) const
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
bool initialized() const
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
preg
Definition: Schedule.cc:374
ProductSelector productSelector_
std::map< BranchID, bool > keepAssociation_
void OutputModuleBase::setEventSelectionInfo ( std::map< std::string, std::vector< std::pair< std::string, int > > > const &  outputModulePathPositions,
bool  anyProductProduced 
)
protected

Definition at line 383 of file OutputModuleBase.cc.

References description(), edm::getParameterSet(), edm::detail::registerProperSelectionInfo(), and selector_config_id_.

384  {
386  description().moduleLabel(),
387  outputModulePathPositions,
388  anyProductProduced);
389  }
ModuleDescription const & description() const
ParameterSet const & getParameterSet(ParameterSetID const &id)
ParameterSetID registerProperSelectionInfo(edm::ParameterSet const &iInitial, std::string const &iLabel, std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
ParameterSetID selector_config_id_
void edm::one::OutputModuleBase::setModuleDescription ( ModuleDescription const &  md)
inlineprivate

Definition at line 244 of file OutputModuleBase.h.

References popcon2dropbox_job_conf::md, and moduleDescription_.

244  {
246  }
ModuleDescription moduleDescription_
virtual bool edm::one::OutputModuleBase::shouldWeCloseFile ( ) const
inlineprivatevirtual

Ask the OutputModule if we should end the current file.

Reimplemented in edm::PoolOutputModule, and edm::TimeoutPoolOutputModule.

Definition at line 219 of file OutputModuleBase.h.

219 {return false;}
ThinnedAssociationsHelper const * OutputModuleBase::thinnedAssociationsHelper ( ) const

Definition at line 344 of file OutputModuleBase.cc.

References thinnedAssociationsHelper_.

Referenced by edm::StreamerOutputModuleBase::serializeRegistry().

344  {
345  return thinnedAssociationsHelper_.get();
346  }
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
bool edm::one::OutputModuleBase::wantAllEvents ( ) const
inline

Definition at line 96 of file OutputModuleBase.h.

References wantAllEvents_.

Referenced by edm::PoolOutputModule::PoolOutputModule().

std::string edm::one::OutputModuleBase::workerType ( ) const
inlineprivate

Definition at line 200 of file OutputModuleBase.h.

200 {return "WorkerT<edm::one::OutputModuleBase>";}
virtual void edm::one::OutputModuleBase::write ( EventPrincipal const &  e,
ModuleCallingContext const *   
)
privatepure virtual
virtual void edm::one::OutputModuleBase::writeLuminosityBlock ( LuminosityBlockPrincipal const &  ,
ModuleCallingContext const *   
)
privatepure virtual
virtual void edm::one::OutputModuleBase::writeRun ( RunPrincipal const &  ,
ModuleCallingContext const *   
)
privatepure virtual

Friends And Related Function Documentation

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

Definition at line 67 of file OutputModuleBase.h.

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

Definition at line 66 of file OutputModuleBase.h.

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

Definition at line 65 of file OutputModuleBase.h.

Member Data Documentation

edm::propagate_const<std::unique_ptr<BranchIDLists> > edm::one::OutputModuleBase::branchIDLists_
private

Definition at line 174 of file OutputModuleBase.h.

Referenced by branchIDLists().

std::map<BranchID::value_type, BranchID::value_type> edm::one::OutputModuleBase::droppedBranchIDToKeptBranchID_
private
std::array<bool, NumBranchTypes> edm::one::OutputModuleBase::hasNewlyDroppedBranch_
private

Definition at line 157 of file OutputModuleBase.h.

Referenced by hasNewlyDroppedBranch(), OutputModuleBase(), and selectProducts().

std::map<BranchID, bool> edm::one::OutputModuleBase::keepAssociation_
private

Definition at line 179 of file OutputModuleBase.h.

Referenced by selectProducts().

SelectedProductsForBranchType edm::one::OutputModuleBase::keptProducts_
private

Definition at line 156 of file OutputModuleBase.h.

Referenced by keepThisBranch(), and keptProducts().

int edm::one::OutputModuleBase::maxEvents_
private

Definition at line 138 of file OutputModuleBase.h.

Referenced by configure(), and maxEvents().

ModuleDescription edm::one::OutputModuleBase::moduleDescription_
private

Definition at line 162 of file OutputModuleBase.h.

Referenced by description(), moduleDescription(), and setModuleDescription().

std::mutex edm::one::OutputModuleBase::mutex_
private

Definition at line 182 of file OutputModuleBase.h.

Referenced by doEvent().

BranchIDLists const* edm::one::OutputModuleBase::origBranchIDLists_
private

Definition at line 175 of file OutputModuleBase.h.

Referenced by branchIDLists(), and configure().

std::string edm::one::OutputModuleBase::process_name_
private

Definition at line 159 of file OutputModuleBase.h.

Referenced by doPreallocate(), OutputModuleBase(), and processName().

ProductSelector edm::one::OutputModuleBase::productSelector_
private

Definition at line 161 of file OutputModuleBase.h.

Referenced by selected(), and selectProducts().

ProductSelectorRules edm::one::OutputModuleBase::productSelectorRules_
private

Definition at line 160 of file OutputModuleBase.h.

Referenced by selectProducts().

std::atomic<int> edm::one::OutputModuleBase::remainingEvents_
private

Definition at line 139 of file OutputModuleBase.h.

Referenced by configure(), doEvent(), limitReached(), and remainingEvents().

SharedResourcesAcquirer edm::one::OutputModuleBase::resourcesAcquirer_
private

Definition at line 181 of file OutputModuleBase.h.

Referenced by doBeginJob(), and doEvent().

ParameterSet edm::one::OutputModuleBase::selectEvents_
private

Definition at line 166 of file OutputModuleBase.h.

Referenced by doPreallocate(), and OutputModuleBase().

ParameterSetID edm::one::OutputModuleBase::selector_config_id_
private

Definition at line 169 of file OutputModuleBase.h.

Referenced by OutputModuleBase(), selectorConfig(), and setEventSelectionInfo().

std::vector<detail::TriggerResultsBasedEventSelector> edm::one::OutputModuleBase::selectors_
private

Definition at line 165 of file OutputModuleBase.h.

Referenced by doPreallocate(), OutputModuleBase(), and prePrefetchSelection().

edm::propagate_const<std::unique_ptr<ThinnedAssociationsHelper> > edm::one::OutputModuleBase::thinnedAssociationsHelper_
private

Definition at line 178 of file OutputModuleBase.h.

Referenced by selectProducts(), and thinnedAssociationsHelper().

bool edm::one::OutputModuleBase::wantAllEvents_
private

Definition at line 164 of file OutputModuleBase.h.

Referenced by OutputModuleBase(), prePrefetchSelection(), and wantAllEvents().