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 
37 
38 namespace edm {
39 
40  // Constructor
42  BMixingModule(ps_mix, globalConf),
43  inputTagPlayback_(),
44  mixProdStep2_(ps_mix.getParameter<bool>("mixProdStep2")),
45  mixProdStep1_(ps_mix.getParameter<bool>("mixProdStep1")),
46  digiAccumulators_()
47  {
48  if (!mixProdStep1_ && !mixProdStep2_) LogInfo("MixingModule") << " The MixingModule was run in the Standard mode.";
49  if (mixProdStep1_) LogInfo("MixingModule") << " The MixingModule was run in the Step1 mode. It produces a mixed secondary source.";
50  if (mixProdStep2_) LogInfo("MixingModule") << " The MixingModule was run in the Step2 mode. It uses a mixed secondary source.";
51 
53  if (ps_mix.exists("useCurrentProcessOnly")) {
54  useCurrentProcessOnly_=ps_mix.getParameter<bool>("useCurrentProcessOnly");
55  LogInfo("MixingModule") <<" using given Parameter 'useCurrentProcessOnly' ="<<useCurrentProcessOnly_;
56  }
57  std::string labelPlayback;
58  if (ps_mix.exists("LabelPlayback")) {
59  labelPlayback = ps_mix.getParameter<std::string>("LabelPlayback");
60  }
61  if (labelPlayback.empty()) {
62  labelPlayback = ps_mix.getParameter<std::string>("@module_label");
63  }
64  if (playback_) {
66  consumes<CrossingFramePlaybackInfoNew>(inputTagPlayback_);
67  }
68 
69  ParameterSet ps=ps_mix.getParameter<ParameterSet>("mixObjects");
70  std::vector<std::string> names = ps.getParameterNames();
71  for(std::vector<std::string>::iterator it=names.begin();it!= names.end();++it) {
73  if (!pset.exists("type")) continue; //to allow replacement by empty pset
74  std::string object = pset.getParameter<std::string>("type");
75  std::vector<InputTag> tags=pset.getParameter<std::vector<InputTag> >("input");
76 
77  //if (!mixProdStep2_) {
78 
79  InputTag tagCF = InputTag();
80  std::string labelCF = " ";
81 
82  if (object=="SimTrack") {
83  InputTag tag;
84  if (tags.size()>0) tag=tags[0];
86 
87  branchesActivate(TypeID(typeid(std::vector<SimTrack>)).friendlyClassName(),std::string(""),tag,label);
88  adjustersObjects_.push_back(new Adjuster<std::vector<SimTrack> >(tag, consumesCollector()));
89  bool makeCrossingFrame = pset.getUntrackedParameter<bool>("makeCrossingFrame", false);
90  if(makeCrossingFrame) {
92  produces<CrossingFrame<SimTrack> >(label);
93  }
94  consumes<std::vector<SimTrack> >(tag);
95 
96  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
97  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
98 
99  } else if (object=="RecoTrack") {
100  InputTag tag;
101  if (tags.size()>0) tag=tags[0];
103 
104  branchesActivate(TypeID(typeid(std::vector<reco::Track>)).friendlyClassName(),std::string(""),tag,label);
105  branchesActivate(TypeID(typeid(std::vector<reco::TrackExtra>)).friendlyClassName(),std::string(""),tag,label);
108  // note: no crossing frame is foreseen to be used for this object type
109 
110  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
111  //std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
112 
113  } else if (object=="SimVertex") {
114  InputTag tag;
115  if (tags.size()>0) tag=tags[0];
117 
118  branchesActivate(TypeID(typeid(std::vector<SimVertex>)).friendlyClassName(),std::string(""),tag,label);
119  adjustersObjects_.push_back(new Adjuster<std::vector<SimVertex> >(tag, consumesCollector()));
120  bool makeCrossingFrame = pset.getUntrackedParameter<bool>("makeCrossingFrame", false);
121  if(makeCrossingFrame) {
123  produces<CrossingFrame<SimVertex> >(label);
124  }
125  consumes<std::vector<SimVertex> >(tag);
126 
127  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag "<<tag.encode()<<", label will be "<<label;
128  // std::cout <<"Will mix "<<object<<"s with InputTag "<<tag.encode()<<", label will be "<<label<<std::endl;
129 
130  } else if (object=="HepMCProduct") {
131  InputTag tag;
132  if (tags.size()>0) tag=tags[0];
134 
135  branchesActivate(TypeID(typeid(HepMCProduct)).friendlyClassName(),std::string(""),tag,label);
136  bool makeCrossingFrame = pset.getUntrackedParameter<bool>("makeCrossingFrame", false);
137  if(makeCrossingFrame) {
138  workersObjects_.push_back(new MixingWorker<HepMCProduct>(minBunch_,maxBunch_,bunchSpace_,std::string(""),label,labelCF,maxNbSources_,tag,tagCF,tags));
139  produces<CrossingFrame<HepMCProduct> >(label);
140  }
141  consumes<HepMCProduct>(tag);
142 
143  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
144  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
145  for(size_t i = 1; i < tags.size(); ++i) {
146  InputTag fallbackTag = tags[i];
147  std::string fallbackLabel;
148  branchesActivate(TypeID(typeid(HepMCProduct)).friendlyClassName(),std::string(""),fallbackTag,fallbackLabel);
149  mayConsume<HepMCProduct>(fallbackTag);
150  }
151 
152  } else if (object=="PCaloHit") {
153  std::vector<std::string> subdets=pset.getParameter<std::vector<std::string> >("subdets");
154  std::vector<std::string> crossingFrames=pset.getUntrackedParameter<std::vector<std::string> >("crossingFrames", std::vector<std::string>());
155  sort_all(crossingFrames);
156  for (unsigned int ii=0;ii<subdets.size();++ii) {
157  InputTag tag;
158  if (tags.size()==1) tag=tags[0];
159  else if(tags.size()>1) tag=tags[ii];
161 
162  branchesActivate(TypeID(typeid(std::vector<PCaloHit>)).friendlyClassName(),subdets[ii],tag,label);
163  adjustersObjects_.push_back(new Adjuster<std::vector<PCaloHit> >(tag, consumesCollector()));
164  if(binary_search_all(crossingFrames, tag.instance())) {
165  workersObjects_.push_back(new MixingWorker<PCaloHit>(minBunch_,maxBunch_,bunchSpace_,subdets[ii],label,labelCF,maxNbSources_,tag,tagCF));
166  produces<CrossingFrame<PCaloHit> >(label);
167  consumes<std::vector<PCaloHit> >(tag);
168  }
169 
170  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
171  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
172 
173  }
174 
175  } else if (object=="PSimHit") {
176  std::vector<std::string> subdets=pset.getParameter<std::vector<std::string> >("subdets");
177  std::vector<std::string> crossingFrames=pset.getUntrackedParameter<std::vector<std::string> >("crossingFrames", std::vector<std::string>());
178  sort_all(crossingFrames);
179  for (unsigned int ii=0;ii<subdets.size();++ii) {
180  InputTag tag;
181  if (tags.size()==1) tag=tags[0];
182  else if(tags.size()>1) tag=tags[ii];
184 
185  branchesActivate(TypeID(typeid(std::vector<PSimHit>)).friendlyClassName(),subdets[ii],tag,label);
186  adjustersObjects_.push_back(new Adjuster<std::vector<PSimHit> >(tag, consumesCollector()));
187  if(binary_search_all(crossingFrames, tag.instance())) {
188  workersObjects_.push_back(new MixingWorker<PSimHit>(minBunch_,maxBunch_,bunchSpace_,subdets[ii],label,labelCF,maxNbSources_,tag,tagCF));
189  produces<CrossingFrame<PSimHit> >(label);
190  consumes<std::vector<PSimHit> >(tag);
191  }
192 
193  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
194  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
195  }
196  } else {
197  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!";
198  }
199  //} //if for mixProdStep2
200  }//while over the mixObjects parameters
201 
203  for (unsigned int branch=0;branch<wantedBranches_.size();++branch) LogDebug("MixingModule")<<"Will keep branch "<<wantedBranches_[branch]<<" for mixing ";
204 
206 
207  produces<PileupMixingContent>();
208 
209  produces<CrossingFramePlaybackInfoNew>();
210 
212  // Create and configure digitizers
213  createDigiAccumulators(ps_mix, iC);
214  }
215 
216 
218  ParameterSet const& digiPSet = mixingPSet.getParameterSet("digitizers");
219  std::vector<std::string> digiNames = digiPSet.getParameterNames();
220  for(auto const& digiName : digiNames) {
221  ParameterSet const& pset = digiPSet.getParameterSet(digiName);
222  if(pset.existsAs<edm::InputTag>("HepMCProductLabel")) {
223  consumes<HepMCProduct>(pset.getParameter<edm::InputTag>("HepMCProductLabel"));
224  }
225  std::auto_ptr<DigiAccumulatorMixMod> accumulator = std::auto_ptr<DigiAccumulatorMixMod>(DigiAccumulatorMixModFactory::get()->makeDigiAccumulator(pset, *this, iC));
226  // Create appropriate DigiAccumulator
227  if(accumulator.get() != 0) {
228  digiAccumulators_.push_back(accumulator.release());
229  }
230  }
231  }
232 
234  //change the basic parameters.
236  setup.get<MixingRcd>().get(config);
237  minBunch_=config->minBunch();
238  maxBunch_=config->maxBunch();
239  bunchSpace_=config->bunchSpace();
240  //propagate to change the workers
241  for (unsigned int ii=0;ii<workersObjects_.size();++ii){
242  workersObjects_[ii]->reload(setup);
243  }
244  }
245 
247 
248  label=tag.label()+tag.instance();
249  wantedBranches_.push_back(friendlyName + '_' +
250  tag.label() + '_' +
251  tag.instance());
252 
253  //if useCurrentProcessOnly, we have to change the input tag
256  tag = InputTag(tag.label(),tag.instance(),processName);
257  }
258  }
259 
261  if (adjusters_.empty()){
262  for (auto const& adjuster : adjustersObjects_) {
263  if (adjuster->checkSignal(e)){
264  adjusters_.push_back(adjuster);
265  }
266  }
267  }
268  if (workers_.empty()){
269  for (auto const& worker : workersObjects_) {
270  if (worker->checkSignal(e)){
271  workers_.push_back(worker);
272  }
273  }
274  }
275  }
276 
278  //create playback info
280  //and CrossingFrames
281  for (unsigned int ii=0;ii<workers_.size();++ii){
282  workers_[ii]->createnewEDProduct();
283  }
284  }
285 
286  // Virtual destructor needed.
288  for (auto& worker : workersObjects_) {
289  delete worker;
290  }
291 
292  for (auto& adjuster : adjustersObjects_) {
293  delete adjuster;
294  }
295 
296  for (auto& digiAccumulator : digiAccumulators_) {
297  delete digiAccumulator;
298  }
299  }
300 
302 
303  LogDebug("MixingModule")<<"===============> adding signals for "<<e.id();
304 
305  accumulateEvent(e, setup);
306  // fill in signal part of CrossingFrame
307  for (unsigned int ii=0;ii<workers_.size();++ii) {
308  workers_[ii]->addSignals(e);
309  }
310  }
311 
312  void MixingModule::pileAllWorkers(EventPrincipal const& eventPrincipal,
313  ModuleCallingContext const* mcc,
314  int bunchCrossing, int eventId,
315  int& vertexOffset,
316  const edm::EventSetup& setup,
317  StreamID const& streamID) {
318 
319 
320  InternalContext internalContext(eventPrincipal.id(), mcc);
321  ParentContext parentContext(&internalContext);
322  ModuleCallingContext moduleCallingContext(&moduleDescription());
323  ModuleContextSentry moduleContextSentry(&moduleCallingContext, parentContext);
324 
325  for (auto const& adjuster : adjusters_) {
326  adjuster->doOffset(bunchSpace_, bunchCrossing, eventPrincipal, &moduleCallingContext, eventId, vertexOffset);
327  }
328  PileUpEventPrincipal pep(eventPrincipal, &moduleCallingContext, bunchCrossing);
329  accumulateEvent(pep, setup, streamID);
330 
331  for (auto const& worker : workers_) {
332  LogDebug("MixingModule") <<" merging Event: id " << eventPrincipal.id();
333  // std::cout <<"PILEALLWORKERS merging Event: id " << eventPrincipal.id() << std::endl;
334 
335  worker->addPileups(eventPrincipal, &moduleCallingContext, eventId);
336  }
337  }
338 
340  using namespace std::placeholders;
341 
342  // Don't allocate because PileUp will do it for us.
343  std::vector<edm::SecondaryEventIDAndFileInfo> recordEventID;
344  std::vector<size_t> sizes;
345  sizes.reserve(maxNbSources_*(maxBunch_ + 1 - minBunch_));
346  size_t playbackCounter = 0U;
348  edm::Handle<CrossingFramePlaybackInfoExtended> oldFormatPlaybackInfo_H;
349  bool oldFormatPlayback = false;
350  if (playback_) {
351  bool got = e.getByLabel(inputTagPlayback_, playbackInfo_H);
352  if (!got) {
353  bool gotOld = e.getByLabel(inputTagPlayback_, oldFormatPlaybackInfo_H);
354  if (!gotOld) {
355  throw cms::Exception("MixingProductNotFound") << " No "
356  "CrossingFramePlaybackInfoNew on the input file, but playback "
357  "option set!!!!! Please change the input file if you really want "
358  "playback!!!!!!" << std::endl;
359  }
360  oldFormatPlayback = true;
361  }
362  }
363 
364  // source[0] is "real" pileup. Check to see that this is what we are doing.
365 
366  std::vector<int> PileupList;
367  PileupList.clear();
368  TrueNumInteractions_.clear();
369 
370  std::shared_ptr<PileUp> source0 = inputSources_[0];
371 
372  if((source0 && source0->doPileUp(0) ) && !playback_) {
373  // if((!inputSources_[0] || !inputSources_[0]->doPileUp()) && !playback_ )
374 
375  // Pre-calculate all pileup distributions before we go fishing for events
376 
377  source0->CalculatePileup(minBunch_, maxBunch_, PileupList, TrueNumInteractions_, e.streamID());
378 
379  }
380 
381  // for (int bunchIdx = minBunch_; bunchIdx <= maxBunch_; ++bunchIdx) {
382  // std::cout << " bunch ID, Pileup, True " << bunchIdx << " " << PileupList[bunchIdx-minBunch_] << " " << TrueNumInteractions_[bunchIdx-minBunch_] << std::endl;
383  //}
384 
385  for (int bunchIdx = minBunch_; bunchIdx <= maxBunch_; ++bunchIdx) {
386  for (size_t setBcrIdx=0; setBcrIdx<workers_.size(); ++setBcrIdx) {
387  workers_[setBcrIdx]->setBcrOffset();
388  }
389  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
390  (*accItr)->initializeBunchCrossing(e, setup, bunchIdx);
391  }
392 
393  for (size_t readSrcIdx=0; readSrcIdx<maxNbSources_; ++readSrcIdx) {
394  std::shared_ptr<PileUp> source = inputSources_[readSrcIdx]; // this looks like we create
395  // new PileUp objects for each
396  // source for each event?
397  // Why?
398  for (size_t setSrcIdx=0; setSrcIdx<workers_.size(); ++setSrcIdx) {
399  workers_[setSrcIdx]->setSourceOffset(readSrcIdx);
400  }
401 
402  if (!source || !source->doPileUp(bunchIdx)) {
403  sizes.push_back(0U);
404  if(playback_ && !oldFormatPlayback) {
405  playbackCounter += playbackInfo_H->getNumberOfEvents(bunchIdx, readSrcIdx);
406  }
407  continue;
408  }
409 
410  // int eventId = 0;
411  int vertexOffset = 0;
412 
414  if (!playback_) {
415  // non-minbias pileup only gets one event for now. Fix later if desired.
416  int numberOfEvents = (readSrcIdx == 0 ? PileupList[bunchIdx - minBunch_] : 1);
417  sizes.push_back(numberOfEvents);
418  inputSources_[readSrcIdx]->readPileUp(e.id(), recordEventID,
419  std::bind(&MixingModule::pileAllWorkers, std::ref(*this), _1, mcc, bunchIdx,
420  _2, vertexOffset, std::ref(setup), e.streamID()), numberOfEvents, e.streamID());
421  } else if(oldFormatPlayback) {
422  std::vector<edm::EventID> const& playEventID = oldFormatPlaybackInfo_H->getStartEventId(readSrcIdx, bunchIdx);
423  size_t numberOfEvents = playEventID.size();
424  if(readSrcIdx == 0) {
425  PileupList.push_back(numberOfEvents);
426  TrueNumInteractions_.push_back(numberOfEvents);
427  }
428  sizes.push_back(numberOfEvents);
429  std::vector<EventID>::const_iterator begin = playEventID.begin();
430  std::vector<EventID>::const_iterator end = playEventID.end();
431  inputSources_[readSrcIdx]->playOldFormatPileUp(
432  begin, end, recordEventID,
433  std::bind(&MixingModule::pileAllWorkers, std::ref(*this), _1, mcc, bunchIdx,
434  _2, vertexOffset, std::ref(setup), e.streamID()));
435  } else {
436  size_t numberOfEvents = playbackInfo_H->getNumberOfEvents(bunchIdx, readSrcIdx);
437  if(readSrcIdx == 0) {
438  PileupList.push_back(numberOfEvents);
439  TrueNumInteractions_.push_back(numberOfEvents);
440  }
441  sizes.push_back(numberOfEvents);
442  std::vector<SecondaryEventIDAndFileInfo>::const_iterator begin = playbackInfo_H->getEventId(playbackCounter);
443  playbackCounter += numberOfEvents;
444  std::vector<SecondaryEventIDAndFileInfo>::const_iterator end = playbackInfo_H->getEventId(playbackCounter);
445  inputSources_[readSrcIdx]->playPileUp(
446  begin, end, recordEventID,
447  std::bind(&MixingModule::pileAllWorkers, std::ref(*this), _1, mcc, bunchIdx,
448  _2, vertexOffset, std::ref(setup), e.streamID()));
449  }
450  }
451  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
452  (*accItr)->finalizeBunchCrossing(e, setup, bunchIdx);
453  }
454  }
455  // Save playback information
456 
457  std::vector<edm::EventID> eventInfoList;
458  for (auto const item : recordEventID) {
459  eventInfoList.emplace_back(item.eventID());
460  }
461 
462  // setInfo swaps recordEventID, so recordEventID is useless (empty) after the call.
463  playbackInfo_->setInfo(recordEventID, sizes);
464 
465  // Keep track of pileup accounting...
466 
467  std::auto_ptr<PileupMixingContent> PileupMixing_;
468 
469  std::vector<int> numInteractionList;
470  std::vector<int> bunchCrossingList;
471  std::vector<float> TrueInteractionList;
472 
473  //Makin' a list: Basically, we don't care about the "other" sources at this point.
474  for (int bunchCrossing=minBunch_;bunchCrossing<=maxBunch_;++bunchCrossing) {
475  bunchCrossingList.push_back(bunchCrossing);
476  if(!inputSources_[0] || !inputSources_[0]->doPileUp(0)) {
477  numInteractionList.push_back(0);
478  TrueInteractionList.push_back(0);
479  }
480  else {
481  numInteractionList.push_back(PileupList[bunchCrossing-minBunch_]);
482  TrueInteractionList.push_back((TrueNumInteractions_)[bunchCrossing-minBunch_]);
483  }
484  }
485 
486  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
487  (*accItr)->StorePileupInformation( bunchCrossingList,
488  numInteractionList,
489  TrueInteractionList,
490  eventInfoList,
491  bunchSpace_);
492  }
493 
494 
495  PileupMixing_ = std::auto_ptr<PileupMixingContent>(new PileupMixingContent(bunchCrossingList,
496  numInteractionList,
497  TrueInteractionList,
498  eventInfoList,
499  bunchSpace_));
500 
501  e.put(PileupMixing_);
502 
503  // we have to do the ToF transformation for PSimHits once all pileup has been added
504  for (unsigned int ii=0;ii<workers_.size();++ii) {
505  workers_[ii]->setTof();
506  workers_[ii]->put(e);
507  }
508  }
509 
511 
512  if (playbackInfo_) {
513  std::auto_ptr<CrossingFramePlaybackInfoNew> pOut(playbackInfo_);
514  e.put(pOut);
515  }
516  }
517 
519  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
520  (*accItr)->beginRun(run, setup);
521  }
522  BMixingModule::beginRun( run, setup);
523  }
524 
526  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
527  (*accItr)->endRun(run, setup);
528  }
529  BMixingModule::endRun( run, setup);
530  }
531 
533  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
534  (*accItr)->beginLuminosityBlock(lumi, setup);
535  }
537  }
538 
540  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
541  (*accItr)->endLuminosityBlock(lumi, setup);
542  }
544  }
545 
546  void
548  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
549  (*accItr)->initializeEvent(event, setup);
550  }
551  }
552 
553  void
555  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
556  (*accItr)->accumulate(event, setup);
557  }
558  }
559 
560  void
562  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
563  (*accItr)->accumulate(event, setup, streamID);
564  }
565  }
566 
567  void
569  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
570  (*accItr)->finalizeEvent(event, setup);
571  }
572  }
573 }//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
int i
Definition: DBlmapReader.cc:9
virtual void reload(const edm::EventSetup &)
virtual void beginRun(const edm::Run &r, const edm::EventSetup &setup) override
virtual ~MixingModule()
virtual void beginLuminosityBlock(LuminosityBlock const &l1, EventSetup const &c) override
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
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_
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::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:225
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:121
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:50
MixingModule(const edm::ParameterSet &ps, MixingCache::Config const *globalConf)
Definition: MixingModule.cc:41
std::vector< AdjusterBase * > adjusters_
Definition: MixingModule.h:95
static const unsigned int maxNbSources_
#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:418
ModuleDescription const & moduleDescription() const
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:56
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:36
edm::EventID id() const
Definition: EventBase.h:59
#define begin
Definition: vmac.h:30
void accumulateEvent(Event const &event, EventSetup const &setup)
std::vector< std::shared_ptr< PileUp > > inputSources_
StreamID streamID() const
Definition: Event.h:80
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
Definition: Algorithms.h:76
std::auto_ptr< DigiAccumulatorMixMod > makeDigiAccumulator(ParameterSet const &, stream::EDProducerBase &, ConsumesCollector &) const
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:37
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:43
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