CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MixingModule.cc
Go to the documentation of this file.
1 // File: MixingModule.cc
2 // Description: see MixingModule.h
3 // Author: Ursula Berthon, LLR Palaiseau, Bill Tanenbaum
4 //
5 //--------------------------------------------
6 
7 #include <functional>
8 #include <memory>
9 
10 #include "MixingModule.h"
11 #include "MixingWorker.h"
12 #include "Adjuster.h"
13 
36 
37 namespace edm {
38 
39  // Constructor
41  BMixingModule(ps_mix),
42  inputTagPlayback_(),
43  mixProdStep2_(ps_mix.getParameter<bool>("mixProdStep2")),
44  mixProdStep1_(ps_mix.getParameter<bool>("mixProdStep1")),
45  digiAccumulators_()
46  {
47  if (!mixProdStep1_ && !mixProdStep2_) LogInfo("MixingModule") << " The MixingModule was run in the Standard mode.";
48  if (mixProdStep1_) LogInfo("MixingModule") << " The MixingModule was run in the Step1 mode. It produces a mixed secondary source.";
49  if (mixProdStep2_) LogInfo("MixingModule") << " The MixingModule was run in the Step2 mode. It uses a mixed secondary source.";
50 
52  if (ps_mix.exists("useCurrentProcessOnly")) {
53  useCurrentProcessOnly_=ps_mix.getParameter<bool>("useCurrentProcessOnly");
54  LogInfo("MixingModule") <<" using given Parameter 'useCurrentProcessOnly' ="<<useCurrentProcessOnly_;
55  }
56  std::string labelPlayback;
57  if (ps_mix.exists("LabelPlayback")) {
58  labelPlayback = ps_mix.getParameter<std::string>("LabelPlayback");
59  }
60  if (labelPlayback.empty()) {
61  labelPlayback = ps_mix.getParameter<std::string>("@module_label");
62  }
63  if (playback_) {
65  consumes<CrossingFramePlaybackInfoNew>(inputTagPlayback_);
66  }
67 
68  ParameterSet ps=ps_mix.getParameter<ParameterSet>("mixObjects");
69  std::vector<std::string> names = ps.getParameterNames();
70  for(std::vector<std::string>::iterator it=names.begin();it!= names.end();++it) {
71  ParameterSet pset=ps.getParameter<ParameterSet>((*it));
72  if (!pset.exists("type")) continue; //to allow replacement by empty pset
73  std::string object = pset.getParameter<std::string>("type");
74  std::vector<InputTag> tags=pset.getParameter<std::vector<InputTag> >("input");
75 
76  //if (!mixProdStep2_) {
77 
78  InputTag tagCF = InputTag();
79  std::string labelCF = " ";
80 
81  if (object=="SimTrack") {
82  InputTag tag;
83  if (tags.size()>0) tag=tags[0];
85 
86  branchesActivate(TypeID(typeid(std::vector<SimTrack>)).friendlyClassName(),std::string(""),tag,label);
87  adjustersObjects_.push_back(new Adjuster<SimTrack>(tag));
88  bool makeCrossingFrame = pset.getUntrackedParameter<bool>("makeCrossingFrame", false);
89  if(makeCrossingFrame) {
91  produces<CrossingFrame<SimTrack> >(label);
92  consumes<std::vector<SimTrack> >(tag);
93  }
94 
95  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
96  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
97 
98  } else if (object=="RecoTrack") {
99  InputTag tag;
100  if (tags.size()>0) tag=tags[0];
102 
103  branchesActivate(TypeID(typeid(std::vector<reco::Track>)).friendlyClassName(),std::string(""),tag,label);
104  branchesActivate(TypeID(typeid(std::vector<reco::TrackExtra>)).friendlyClassName(),std::string(""),tag,label);
106  // note: no crossing frame is foreseen to be used for this object type
107 
108  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
109  //std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
110 
111  } else if (object=="SimVertex") {
112  InputTag tag;
113  if (tags.size()>0) tag=tags[0];
115 
116  branchesActivate(TypeID(typeid(std::vector<SimVertex>)).friendlyClassName(),std::string(""),tag,label);
117  adjustersObjects_.push_back(new Adjuster<SimVertex>(tag));
118  bool makeCrossingFrame = pset.getUntrackedParameter<bool>("makeCrossingFrame", false);
119  if(makeCrossingFrame) {
121  produces<CrossingFrame<SimVertex> >(label);
122  consumes<std::vector<SimVertex> >(tag);
123  }
124 
125  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag "<<tag.encode()<<", label will be "<<label;
126  // std::cout <<"Will mix "<<object<<"s with InputTag "<<tag.encode()<<", label will be "<<label<<std::endl;
127 
128  } else if (object=="HepMCProduct") {
129  InputTag tag;
130  if (tags.size()>0) tag=tags[0];
132 
133  branchesActivate(TypeID(typeid(HepMCProduct)).friendlyClassName(),std::string(""),tag,label);
134  bool makeCrossingFrame = pset.getUntrackedParameter<bool>("makeCrossingFrame", false);
135  if(makeCrossingFrame) {
137  produces<CrossingFrame<HepMCProduct> >(label);
138  }
139  consumes<HepMCProduct>(tag);
140 
141  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
142  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
143 
144  } else if (object=="PCaloHit") {
145  std::vector<std::string> subdets=pset.getParameter<std::vector<std::string> >("subdets");
146  std::vector<std::string> crossingFrames=pset.getUntrackedParameter<std::vector<std::string> >("crossingFrames", std::vector<std::string>());
147  sort_all(crossingFrames);
148  for (unsigned int ii=0;ii<subdets.size();++ii) {
149  InputTag tag;
150  if (tags.size()==1) tag=tags[0];
151  else if(tags.size()>1) tag=tags[ii];
153 
154  branchesActivate(TypeID(typeid(std::vector<PCaloHit>)).friendlyClassName(),subdets[ii],tag,label);
155  adjustersObjects_.push_back(new Adjuster<PCaloHit>(tag));
156  if(binary_search_all(crossingFrames, tag.instance())) {
157  workersObjects_.push_back(new MixingWorker<PCaloHit>(minBunch_,maxBunch_,bunchSpace_,subdets[ii],label,labelCF,maxNbSources_,tag,tagCF));
158  produces<CrossingFrame<PCaloHit> >(label);
159  consumes<std::vector<PCaloHit> >(tag);
160  }
161 
162  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
163  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
164 
165  }
166 
167  } else if (object=="PSimHit") {
168  std::vector<std::string> subdets=pset.getParameter<std::vector<std::string> >("subdets");
169  std::vector<std::string> crossingFrames=pset.getUntrackedParameter<std::vector<std::string> >("crossingFrames", std::vector<std::string>());
170  sort_all(crossingFrames);
171  for (unsigned int ii=0;ii<subdets.size();++ii) {
172  InputTag tag;
173  if (tags.size()==1) tag=tags[0];
174  else if(tags.size()>1) tag=tags[ii];
176 
177  branchesActivate(TypeID(typeid(std::vector<PSimHit>)).friendlyClassName(),subdets[ii],tag,label);
178  adjustersObjects_.push_back(new Adjuster<PSimHit>(tag));
179  if(binary_search_all(crossingFrames, tag.instance())) {
180  workersObjects_.push_back(new MixingWorker<PSimHit>(minBunch_,maxBunch_,bunchSpace_,subdets[ii],label,labelCF,maxNbSources_,tag,tagCF));
181  produces<CrossingFrame<PSimHit> >(label);
182  consumes<std::vector<PSimHit> >(tag);
183  }
184 
185  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
186  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
187  }
188  } else {
189  LogWarning("MixingModule") <<"You have asked to mix an unknown type of object("<<object<<").\n If you want to include it in mixing, please contact the authors of the MixingModule!";
190  }
191  //} //if for mixProdStep2
192  }//while over the mixObjects parameters
193 
195  for (unsigned int branch=0;branch<wantedBranches_.size();++branch) LogDebug("MixingModule")<<"Will keep branch "<<wantedBranches_[branch]<<" for mixing ";
196 
198 
199  produces<PileupMixingContent>();
200 
201  produces<CrossingFramePlaybackInfoNew>();
202 
204  // Create and configure digitizers
205  createDigiAccumulators(ps_mix, iC);
206  }
207 
208 
210  ParameterSet const& digiPSet = mixingPSet.getParameterSet("digitizers");
211  std::vector<std::string> digiNames = digiPSet.getParameterNames();
212  for(auto const& digiName : digiNames) {
213  ParameterSet const& pset = digiPSet.getParameterSet(digiName);
214  std::auto_ptr<DigiAccumulatorMixMod> accumulator = std::auto_ptr<DigiAccumulatorMixMod>(DigiAccumulatorMixModFactory::get()->makeDigiAccumulator(pset, *this, iC));
215  // Create appropriate DigiAccumulator
216  if(accumulator.get() != 0) {
217  digiAccumulators_.push_back(accumulator.release());
218  }
219  }
220  }
221 
223  //change the basic parameters.
225  setup.get<MixingRcd>().get(config);
226  minBunch_=config->minBunch();
227  maxBunch_=config->maxBunch();
228  bunchSpace_=config->bunchSpace();
229  //propagate to change the workers
230  for (unsigned int ii=0;ii<workersObjects_.size();++ii){
231  workersObjects_[ii]->reload(setup);
232  }
233  }
234 
236 
237  label=tag.label()+tag.instance();
238  wantedBranches_.push_back(friendlyName + '_' +
239  tag.label() + '_' +
240  tag.instance());
241 
242  //if useCurrentProcessOnly, we have to change the input tag
245  tag = InputTag(tag.label(),tag.instance(),processName);
246  }
247  }
248 
250  if (adjusters_.empty()){
251  for (auto const& adjuster : adjustersObjects_) {
252  if (adjuster->checkSignal(e)){
253  adjusters_.push_back(adjuster);
254  }
255  }
256  }
257  if (workers_.empty()){
258  for (auto const& worker : workersObjects_) {
259  if (worker->checkSignal(e)){
260  workers_.push_back(worker);
261  }
262  }
263  }
264  }
265 
267  //create playback info
269  //and CrossingFrames
270  for (unsigned int ii=0;ii<workers_.size();++ii){
271  workers_[ii]->createnewEDProduct();
272  }
273  }
274 
275  // Virtual destructor needed.
277  for (auto& worker : workersObjects_) {
278  delete worker;
279  }
280 
281  for (auto& adjuster : adjustersObjects_) {
282  delete adjuster;
283  }
284 
285  for (auto& digiAccumulator : digiAccumulators_) {
286  delete digiAccumulator;
287  }
288  }
289 
291 
292  LogDebug("MixingModule")<<"===============> adding signals for "<<e.id();
293 
294  accumulateEvent(e, setup);
295  // fill in signal part of CrossingFrame
296  for (unsigned int ii=0;ii<workers_.size();++ii) {
297  workers_[ii]->addSignals(e);
298  }
299  }
300 
301  void MixingModule::pileAllWorkers(EventPrincipal const& eventPrincipal,
302  ModuleCallingContext const* mcc,
303  int bunchCrossing, int eventId,
304  int& vertexOffset,
305  const edm::EventSetup& setup,
306  StreamID const& streamID) {
307 
308  InternalContext internalContext(eventPrincipal.id(), mcc);
309  ParentContext parentContext(&internalContext);
310  ModuleCallingContext moduleCallingContext(&moduleDescription());
311  ModuleContextSentry moduleContextSentry(&moduleCallingContext, parentContext);
312 
313  for (auto const& adjuster : adjusters_) {
314  adjuster->doOffset(bunchSpace_, bunchCrossing, eventPrincipal, &moduleCallingContext, eventId, vertexOffset);
315  }
316  PileUpEventPrincipal pep(eventPrincipal, &moduleCallingContext, bunchCrossing);
317  accumulateEvent(pep, setup, streamID);
318 
319  for (auto const& worker : workers_) {
320  LogDebug("MixingModule") <<" merging Event: id " << eventPrincipal.id();
321  // std::cout <<"PILEALLWORKERS merging Event: id " << eventPrincipal.id() << std::endl;
322 
323  worker->addPileups(eventPrincipal, &moduleCallingContext, eventId);
324  }
325  }
326 
328  using namespace std::placeholders;
329 
330  // Don't allocate because PileUp will do it for us.
331  std::vector<edm::SecondaryEventIDAndFileInfo> recordEventID;
332  std::vector<size_t> sizes;
333  sizes.reserve(maxNbSources_*(maxBunch_ + 1 - minBunch_));
334  size_t playbackCounter = 0U;
336  edm::Handle<CrossingFramePlaybackInfoExtended> oldFormatPlaybackInfo_H;
337  bool oldFormatPlayback = false;
338  if (playback_) {
339  bool got = e.getByLabel(inputTagPlayback_, playbackInfo_H);
340  if (!got) {
341  bool gotOld = e.getByLabel(inputTagPlayback_, oldFormatPlaybackInfo_H);
342  if (!gotOld) {
343  throw cms::Exception("MixingProductNotFound") << " No "
344  "CrossingFramePlaybackInfoNew on the input file, but playback "
345  "option set!!!!! Please change the input file if you really want "
346  "playback!!!!!!" << std::endl;
347  }
348  oldFormatPlayback = true;
349  }
350  }
351 
352  // source[0] is "real" pileup. Check to see that this is what we are doing.
353 
354  std::vector<int> PileupList;
355  PileupList.clear();
356  TrueNumInteractions_.clear();
357 
358  std::shared_ptr<PileUp> source0 = inputSources_[0];
359 
360  if((source0 && source0->doPileUp(0) ) && !playback_) {
361  // if((!inputSources_[0] || !inputSources_[0]->doPileUp()) && !playback_ )
362 
363  // Pre-calculate all pileup distributions before we go fishing for events
364 
365  source0->CalculatePileup(minBunch_, maxBunch_, PileupList, TrueNumInteractions_, e.streamID());
366 
367  }
368 
369  // for (int bunchIdx = minBunch_; bunchIdx <= maxBunch_; ++bunchIdx) {
370  // std::cout << " bunch ID, Pileup, True " << bunchIdx << " " << PileupList[bunchIdx-minBunch_] << " " << TrueNumInteractions_[bunchIdx-minBunch_] << std::endl;
371  //}
372 
373  for (int bunchIdx = minBunch_; bunchIdx <= maxBunch_; ++bunchIdx) {
374  for (size_t setBcrIdx=0; setBcrIdx<workers_.size(); ++setBcrIdx) {
375  workers_[setBcrIdx]->setBcrOffset();
376  }
377  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
378  (*accItr)->initializeBunchCrossing(e, setup, bunchIdx);
379  }
380 
381  for (size_t readSrcIdx=0; readSrcIdx<maxNbSources_; ++readSrcIdx) {
382  std::shared_ptr<PileUp> source = inputSources_[readSrcIdx]; // this looks like we create
383  // new PileUp objects for each
384  // source for each event?
385  // Why?
386  for (size_t setSrcIdx=0; setSrcIdx<workers_.size(); ++setSrcIdx) {
387  workers_[setSrcIdx]->setSourceOffset(readSrcIdx);
388  }
389 
390  if (!source || !source->doPileUp(bunchIdx)) {
391  sizes.push_back(0U);
392  if(playback_ && !oldFormatPlayback) {
393  playbackCounter += playbackInfo_H->getNumberOfEvents(bunchIdx, readSrcIdx);
394  }
395  continue;
396  }
397 
398  // int eventId = 0;
399  int vertexOffset = 0;
400 
402  if (!playback_) {
403  // non-minbias pileup only gets one event for now. Fix later if desired.
404  int numberOfEvents = (readSrcIdx == 0 ? PileupList[bunchIdx - minBunch_] : 1);
405  sizes.push_back(numberOfEvents);
406  inputSources_[readSrcIdx]->readPileUp(e.id(), recordEventID,
407  std::bind(&MixingModule::pileAllWorkers, std::ref(*this), _1, mcc, bunchIdx,
408  _2, vertexOffset, std::ref(setup), e.streamID()), numberOfEvents, e.streamID());
409  } else if(oldFormatPlayback) {
410  std::vector<edm::EventID> const& playEventID = oldFormatPlaybackInfo_H->getStartEventId(readSrcIdx, bunchIdx);
411  size_t numberOfEvents = playEventID.size();
412  if(readSrcIdx == 0) {
413  PileupList.push_back(numberOfEvents);
414  TrueNumInteractions_.push_back(numberOfEvents);
415  }
416  sizes.push_back(numberOfEvents);
417  std::vector<EventID>::const_iterator begin = playEventID.begin();
418  std::vector<EventID>::const_iterator end = playEventID.end();
419  inputSources_[readSrcIdx]->playOldFormatPileUp(
420  begin, end, recordEventID,
421  std::bind(&MixingModule::pileAllWorkers, std::ref(*this), _1, mcc, bunchIdx,
422  _2, vertexOffset, std::ref(setup), e.streamID()));
423  } else {
424  size_t numberOfEvents = playbackInfo_H->getNumberOfEvents(bunchIdx, readSrcIdx);
425  if(readSrcIdx == 0) {
426  PileupList.push_back(numberOfEvents);
427  TrueNumInteractions_.push_back(numberOfEvents);
428  }
429  sizes.push_back(numberOfEvents);
430  std::vector<SecondaryEventIDAndFileInfo>::const_iterator begin = playbackInfo_H->getEventId(playbackCounter);
431  playbackCounter += numberOfEvents;
432  std::vector<SecondaryEventIDAndFileInfo>::const_iterator end = playbackInfo_H->getEventId(playbackCounter);
433  inputSources_[readSrcIdx]->playPileUp(
434  begin, end, recordEventID,
435  std::bind(&MixingModule::pileAllWorkers, std::ref(*this), _1, mcc, bunchIdx,
436  _2, vertexOffset, std::ref(setup), e.streamID()));
437  }
438  }
439  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
440  (*accItr)->finalizeBunchCrossing(e, setup, bunchIdx);
441  }
442  }
443  // Save playback information
444 
445  std::vector<edm::EventID> eventInfoList;
446  for (auto const item : recordEventID) {
447  eventInfoList.emplace_back(item.eventID());
448  }
449 
450  // setInfo swaps recordEventID, so recordEventID is useless (empty) after the call.
451  playbackInfo_->setInfo(recordEventID, sizes);
452 
453  // Keep track of pileup accounting...
454 
455  std::auto_ptr<PileupMixingContent> PileupMixing_;
456 
457  std::vector<int> numInteractionList;
458  std::vector<int> bunchCrossingList;
459  std::vector<float> TrueInteractionList;
460 
461  //Makin' a list: Basically, we don't care about the "other" sources at this point.
462  for (int bunchCrossing=minBunch_;bunchCrossing<=maxBunch_;++bunchCrossing) {
463  bunchCrossingList.push_back(bunchCrossing);
464  if(!inputSources_[0] || !inputSources_[0]->doPileUp(0)) {
465  numInteractionList.push_back(0);
466  TrueInteractionList.push_back(0);
467  }
468  else {
469  numInteractionList.push_back(PileupList[bunchCrossing-minBunch_]);
470  TrueInteractionList.push_back((TrueNumInteractions_)[bunchCrossing-minBunch_]);
471  }
472  }
473 
474  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
475  (*accItr)->StorePileupInformation( bunchCrossingList,
476  numInteractionList,
477  TrueInteractionList,
478  eventInfoList,
479  bunchSpace_);
480  }
481 
482 
483  PileupMixing_ = std::auto_ptr<PileupMixingContent>(new PileupMixingContent(bunchCrossingList,
484  numInteractionList,
485  TrueInteractionList,
486  eventInfoList,
487  bunchSpace_));
488 
489  e.put(PileupMixing_);
490 
491  // we have to do the ToF transformation for PSimHits once all pileup has been added
492  for (unsigned int ii=0;ii<workers_.size();++ii) {
493  workers_[ii]->setTof();
494  workers_[ii]->put(e);
495  }
496  }
497 
499 
500  if (playbackInfo_) {
501  std::auto_ptr<CrossingFramePlaybackInfoNew> pOut(playbackInfo_);
502  e.put(pOut);
503  }
504  }
505 
507  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
508  (*accItr)->beginRun(run, setup);
509  }
510  BMixingModule::beginRun( run, setup);
511  }
512 
514  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
515  (*accItr)->endRun(run, setup);
516  }
517  BMixingModule::endRun( run, setup);
518  }
519 
521  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
522  (*accItr)->beginLuminosityBlock(lumi, setup);
523  }
525  }
526 
528  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
529  (*accItr)->endLuminosityBlock(lumi, setup);
530  }
532  }
533 
534  void
536  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
537  (*accItr)->initializeEvent(event, setup);
538  }
539  }
540 
541  void
543  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
544  (*accItr)->accumulate(event, setup);
545  }
546  }
547 
548  void
550  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
551  (*accItr)->accumulate(event, setup, streamID);
552  }
553  }
554 
555  void
557  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
558  (*accItr)->finalizeEvent(event, setup);
559  }
560  }
561 }//edm
#define LogDebug(id)
void setInfo(std::vector< edm::SecondaryEventIDAndFileInfo > &eventInfo, std::vector< size_t > &sizes)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void reload(const edm::EventSetup &)
virtual void beginRun(const edm::Run &r, const edm::EventSetup &setup) override
virtual ~MixingModule()
MixingModule(const edm::ParameterSet &ps)
Definition: MixingModule.cc:40
virtual void beginLuminosityBlock(LuminosityBlock const &l1, EventSetup const &c) override
static std::string const source("source")
static const HistoName names[]
virtual void createnewEDProduct()
tuple lumi
Definition: fjr2json.py:35
void createDigiAccumulators(const edm::ParameterSet &mixingPSet, edm::ConsumesCollector &iC)
std::vector< float > TrueNumInteractions_
Definition: BMixingModule.h:89
virtual void addSignals(const edm::Event &e, const edm::EventSetup &es)
EventID const & id() const
bool exists(std::string const &parameterName) const
checks if a parameter exists
int ii
Definition: cuy.py:588
std::auto_ptr< DigiAccumulatorMixMod > makeDigiAccumulator(ParameterSet const &, one::EDProducerBase &, ConsumesCollector &) const
ModuleDescription const & moduleDescription() const
std::string encode() const
Definition: InputTag.cc:164
virtual void endRun(const edm::Run &r, const edm::EventSetup &setup) override
virtual void put(edm::Event &e, const edm::EventSetup &es)
ModuleCallingContext const * moduleCallingContext() const
Definition: Event.h:217
virtual void checkSignal(const edm::Event &e)
std::string friendlyName(std::string const &iFullName)
virtual void endLuminosityBlock(LuminosityBlock const &l1, EventSetup const &c) override
std::vector< MixingWorkerBase * > workers_
Definition: MixingModule.h:97
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
Accumulators digiAccumulators_
Definition: MixingModule.h:103
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
static const std::string kSkipCurrentProcess
Definition: InputTag.h:56
std::vector< AdjusterBase * > adjusters_
Definition: MixingModule.h:95
static const unsigned int maxNbSources_
Definition: BMixingModule.h:86
#define end
Definition: vmac.h:37
std::vector< MixingWorkerBase * > workersObjects_
Definition: MixingModule.h:98
virtual void beginRun(Run const &r1, EventSetup const &c) override
std::vector< std::string > getParameterNames() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
char const * subdets[11]
CrossingFramePlaybackInfoNew * playbackInfo_
Definition: MixingModule.h:93
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:405
virtual void branchesActivate(const std::string &friendlyName, const std::string &subdet, InputTag &tag, std::string &label)
tuple tags
Definition: o2o.py:248
void finalizeEvent(Event &event, EventSetup const &setup)
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
ParameterSet const & getParameterSet(std::string const &) const
const T & get() const
Definition: EventSetup.h:55
std::vector< std::string > wantedBranches_
Definition: MixingModule.h:99
std::vector< AdjusterBase * > adjustersObjects_
Definition: MixingModule.h:96
InputTag inputTagPlayback_
Definition: MixingModule.h:90
std::string const & label() const
Definition: InputTag.h:42
edm::EventID id() const
Definition: EventBase.h:60
#define begin
Definition: vmac.h:30
void accumulateEvent(Event const &event, EventSetup const &setup)
std::vector< std::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:94
StreamID streamID() const
Definition: Event.h:72
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
Definition: Algorithms.h:76
void dropUnwantedBranches(std::vector< std::string > const &wantedBranches)
virtual void beginLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
static DigiAccumulatorMixModFactory const * get()
void initializeEvent(Event const &event, EventSetup const &setup)
std::string const & instance() const
Definition: InputTag.h:43
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
virtual void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
virtual void doPileUp(edm::Event &e, const edm::EventSetup &es) override
Definition: Run.h:41
void pileAllWorkers(EventPrincipal const &ep, ModuleCallingContext const *, int bcr, int id, int &offset, const edm::EventSetup &setup, edm::StreamID const &)
virtual void endRun(Run const &r1, EventSetup const &c) override