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),
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) {
72  ParameterSet pset=ps.getParameter<ParameterSet>((*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));
89  bool makeCrossingFrame = pset.getUntrackedParameter<bool>("makeCrossingFrame", false);
90  if(makeCrossingFrame) {
92  produces<CrossingFrame<SimTrack> >(label);
93  consumes<std::vector<SimTrack> >(tag);
94  }
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);
107  InputTag mvatag(tag.label(),"MVAVals");
108  branchesActivate(TypeID(typeid(edm::ValueMap<float>)).friendlyClassName(),std::string(""),mvatag,label);
110  // note: no crossing frame is foreseen to be used for this object type
111 
112  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
113  //std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
114 
115  } else if (object=="SimVertex") {
116  InputTag tag;
117  if (tags.size()>0) tag=tags[0];
119 
120  branchesActivate(TypeID(typeid(std::vector<SimVertex>)).friendlyClassName(),std::string(""),tag,label);
121  adjustersObjects_.push_back(new Adjuster<std::vector<SimVertex> >(tag));
122  bool makeCrossingFrame = pset.getUntrackedParameter<bool>("makeCrossingFrame", false);
123  if(makeCrossingFrame) {
125  produces<CrossingFrame<SimVertex> >(label);
126  consumes<std::vector<SimVertex> >(tag);
127  }
128 
129  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag "<<tag.encode()<<", label will be "<<label;
130  // std::cout <<"Will mix "<<object<<"s with InputTag "<<tag.encode()<<", label will be "<<label<<std::endl;
131 
132  } else if (object=="HepMCProduct") {
133  InputTag tag;
134  if (tags.size()>0) tag=tags[0];
136 
137  branchesActivate(TypeID(typeid(HepMCProduct)).friendlyClassName(),std::string(""),tag,label);
138  bool makeCrossingFrame = pset.getUntrackedParameter<bool>("makeCrossingFrame", false);
139  if(makeCrossingFrame) {
141  produces<CrossingFrame<HepMCProduct> >(label);
142  }
143  consumes<HepMCProduct>(tag);
144 
145  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
146  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
147 
148  } else if (object=="PCaloHit") {
149  std::vector<std::string> subdets=pset.getParameter<std::vector<std::string> >("subdets");
150  std::vector<std::string> crossingFrames=pset.getUntrackedParameter<std::vector<std::string> >("crossingFrames", std::vector<std::string>());
151  sort_all(crossingFrames);
152  for (unsigned int ii=0;ii<subdets.size();++ii) {
153  InputTag tag;
154  if (tags.size()==1) tag=tags[0];
155  else if(tags.size()>1) tag=tags[ii];
157 
158  branchesActivate(TypeID(typeid(std::vector<PCaloHit>)).friendlyClassName(),subdets[ii],tag,label);
159  adjustersObjects_.push_back(new Adjuster<std::vector<PCaloHit> >(tag));
160  if(binary_search_all(crossingFrames, tag.instance())) {
161  workersObjects_.push_back(new MixingWorker<PCaloHit>(minBunch_,maxBunch_,bunchSpace_,subdets[ii],label,labelCF,maxNbSources_,tag,tagCF));
162  produces<CrossingFrame<PCaloHit> >(label);
163  consumes<std::vector<PCaloHit> >(tag);
164  }
165 
166  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
167  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
168 
169  }
170 
171  } else if (object=="PSimHit") {
172  std::vector<std::string> subdets=pset.getParameter<std::vector<std::string> >("subdets");
173  std::vector<std::string> crossingFrames=pset.getUntrackedParameter<std::vector<std::string> >("crossingFrames", std::vector<std::string>());
174  sort_all(crossingFrames);
175  for (unsigned int ii=0;ii<subdets.size();++ii) {
176  InputTag tag;
177  if (tags.size()==1) tag=tags[0];
178  else if(tags.size()>1) tag=tags[ii];
180 
181  branchesActivate(TypeID(typeid(std::vector<PSimHit>)).friendlyClassName(),subdets[ii],tag,label);
182  adjustersObjects_.push_back(new Adjuster<std::vector<PSimHit> >(tag));
183  if(binary_search_all(crossingFrames, tag.instance())) {
184  workersObjects_.push_back(new MixingWorker<PSimHit>(minBunch_,maxBunch_,bunchSpace_,subdets[ii],label,labelCF,maxNbSources_,tag,tagCF));
185  produces<CrossingFrame<PSimHit> >(label);
186  consumes<std::vector<PSimHit> >(tag);
187  }
188 
189  LogInfo("MixingModule") <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label;
190  // std::cout <<"Will mix "<<object<<"s with InputTag= "<<tag.encode()<<", label will be "<<label<<std::endl;
191  }
192  } else {
193  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!";
194  }
195  //} //if for mixProdStep2
196  }//while over the mixObjects parameters
197 
199  for (unsigned int branch=0;branch<wantedBranches_.size();++branch) LogDebug("MixingModule")<<"Will keep branch "<<wantedBranches_[branch]<<" for mixing ";
200 
202 
203  produces<PileupMixingContent>();
204 
205  produces<CrossingFramePlaybackInfoNew>();
206 
208  // Create and configure digitizers
209  createDigiAccumulators(ps_mix, iC);
210  }
211 
212 
214  ParameterSet const& digiPSet = mixingPSet.getParameterSet("digitizers");
215  std::vector<std::string> digiNames = digiPSet.getParameterNames();
216  for(auto const& digiName : digiNames) {
217  ParameterSet const& pset = digiPSet.getParameterSet(digiName);
218  std::auto_ptr<DigiAccumulatorMixMod> accumulator = std::auto_ptr<DigiAccumulatorMixMod>(DigiAccumulatorMixModFactory::get()->makeDigiAccumulator(pset, *this, iC));
219  // Create appropriate DigiAccumulator
220  if(accumulator.get() != 0) {
221  digiAccumulators_.push_back(accumulator.release());
222  }
223  }
224  }
225 
227  //change the basic parameters.
229  setup.get<MixingRcd>().get(config);
230  minBunch_=config->minBunch();
231  maxBunch_=config->maxBunch();
232  bunchSpace_=config->bunchSpace();
233  //propagate to change the workers
234  for (unsigned int ii=0;ii<workersObjects_.size();++ii){
235  workersObjects_[ii]->reload(setup);
236  }
237  }
238 
240 
241  label=tag.label()+tag.instance();
242  wantedBranches_.push_back(friendlyName + '_' +
243  tag.label() + '_' +
244  tag.instance());
245 
246  //if useCurrentProcessOnly, we have to change the input tag
249  tag = InputTag(tag.label(),tag.instance(),processName);
250  }
251  }
252 
254  if (adjusters_.empty()){
255  for (auto const& adjuster : adjustersObjects_) {
256  if (adjuster->checkSignal(e)){
257  adjusters_.push_back(adjuster);
258  }
259  }
260  }
261  if (workers_.empty()){
262  for (auto const& worker : workersObjects_) {
263  if (worker->checkSignal(e)){
264  workers_.push_back(worker);
265  }
266  }
267  }
268  }
269 
271  //create playback info
273  //and CrossingFrames
274  for (unsigned int ii=0;ii<workers_.size();++ii){
275  workers_[ii]->createnewEDProduct();
276  }
277  }
278 
279  // Virtual destructor needed.
281  for (auto& worker : workersObjects_) {
282  delete worker;
283  }
284 
285  for (auto& adjuster : adjustersObjects_) {
286  delete adjuster;
287  }
288 
289  for (auto& digiAccumulator : digiAccumulators_) {
290  delete digiAccumulator;
291  }
292  }
293 
295 
296  LogDebug("MixingModule")<<"===============> adding signals for "<<e.id();
297 
298  accumulateEvent(e, setup);
299  // fill in signal part of CrossingFrame
300  for (unsigned int ii=0;ii<workers_.size();++ii) {
301  workers_[ii]->addSignals(e);
302  }
303  }
304 
305  void MixingModule::pileAllWorkers(EventPrincipal const& eventPrincipal,
306  ModuleCallingContext const* mcc,
307  int bunchCrossing, int eventId,
308  int& vertexOffset,
309  const edm::EventSetup& setup,
310  StreamID const& streamID) {
311 
312 
313  InternalContext internalContext(eventPrincipal.id(), mcc);
314  ParentContext parentContext(&internalContext);
315  ModuleCallingContext moduleCallingContext(&moduleDescription());
316  ModuleContextSentry moduleContextSentry(&moduleCallingContext, parentContext);
317 
318  for (auto const& adjuster : adjusters_) {
319  adjuster->doOffset(bunchSpace_, bunchCrossing, eventPrincipal, &moduleCallingContext, eventId, vertexOffset);
320  }
321  PileUpEventPrincipal pep(eventPrincipal, &moduleCallingContext, bunchCrossing);
322  accumulateEvent(pep, setup, streamID);
323 
324  for (auto const& worker : workers_) {
325  LogDebug("MixingModule") <<" merging Event: id " << eventPrincipal.id();
326  // std::cout <<"PILEALLWORKERS merging Event: id " << eventPrincipal.id() << std::endl;
327 
328  worker->addPileups(eventPrincipal, &moduleCallingContext, eventId);
329  }
330  }
331 
333  using namespace std::placeholders;
334 
335  // Don't allocate because PileUp will do it for us.
336  std::vector<edm::SecondaryEventIDAndFileInfo> recordEventID;
337  std::vector<size_t> sizes;
338  sizes.reserve(maxNbSources_*(maxBunch_ + 1 - minBunch_));
339  size_t playbackCounter = 0U;
341  edm::Handle<CrossingFramePlaybackInfoExtended> oldFormatPlaybackInfo_H;
342  bool oldFormatPlayback = false;
343  if (playback_) {
344  bool got = e.getByLabel(inputTagPlayback_, playbackInfo_H);
345  if (!got) {
346  bool gotOld = e.getByLabel(inputTagPlayback_, oldFormatPlaybackInfo_H);
347  if (!gotOld) {
348  throw cms::Exception("MixingProductNotFound") << " No "
349  "CrossingFramePlaybackInfoNew on the input file, but playback "
350  "option set!!!!! Please change the input file if you really want "
351  "playback!!!!!!" << std::endl;
352  }
353  oldFormatPlayback = true;
354  }
355  }
356 
357  // source[0] is "real" pileup. Check to see that this is what we are doing.
358 
359  std::vector<int> PileupList;
360  PileupList.clear();
361  TrueNumInteractions_.clear();
362 
363  std::shared_ptr<PileUp> source0 = inputSources_[0];
364 
365  if((source0 && source0->doPileUp(0) ) && !playback_) {
366  // if((!inputSources_[0] || !inputSources_[0]->doPileUp()) && !playback_ )
367 
368  // Pre-calculate all pileup distributions before we go fishing for events
369 
370  source0->CalculatePileup(minBunch_, maxBunch_, PileupList, TrueNumInteractions_, e.streamID());
371 
372  }
373 
374  // for (int bunchIdx = minBunch_; bunchIdx <= maxBunch_; ++bunchIdx) {
375  // std::cout << " bunch ID, Pileup, True " << bunchIdx << " " << PileupList[bunchIdx-minBunch_] << " " << TrueNumInteractions_[bunchIdx-minBunch_] << std::endl;
376  //}
377 
378  for (int bunchIdx = minBunch_; bunchIdx <= maxBunch_; ++bunchIdx) {
379  for (size_t setBcrIdx=0; setBcrIdx<workers_.size(); ++setBcrIdx) {
380  workers_[setBcrIdx]->setBcrOffset();
381  }
382  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
383  (*accItr)->initializeBunchCrossing(e, setup, bunchIdx);
384  }
385 
386  for (size_t readSrcIdx=0; readSrcIdx<maxNbSources_; ++readSrcIdx) {
387  std::shared_ptr<PileUp> source = inputSources_[readSrcIdx]; // this looks like we create
388  // new PileUp objects for each
389  // source for each event?
390  // Why?
391  for (size_t setSrcIdx=0; setSrcIdx<workers_.size(); ++setSrcIdx) {
392  workers_[setSrcIdx]->setSourceOffset(readSrcIdx);
393  }
394 
395  if (!source || !source->doPileUp(bunchIdx)) {
396  sizes.push_back(0U);
397  if(playback_ && !oldFormatPlayback) {
398  playbackCounter += playbackInfo_H->getNumberOfEvents(bunchIdx, readSrcIdx);
399  }
400  continue;
401  }
402 
403  // int eventId = 0;
404  int vertexOffset = 0;
405 
407  if (!playback_) {
408  // non-minbias pileup only gets one event for now. Fix later if desired.
409  int numberOfEvents = (readSrcIdx == 0 ? PileupList[bunchIdx - minBunch_] : 1);
410  sizes.push_back(numberOfEvents);
411  inputSources_[readSrcIdx]->readPileUp(e.id(), recordEventID,
412  std::bind(&MixingModule::pileAllWorkers, std::ref(*this), _1, mcc, bunchIdx,
413  _2, vertexOffset, std::ref(setup), e.streamID()), numberOfEvents, e.streamID());
414  } else if(oldFormatPlayback) {
415  std::vector<edm::EventID> const& playEventID = oldFormatPlaybackInfo_H->getStartEventId(readSrcIdx, bunchIdx);
416  size_t numberOfEvents = playEventID.size();
417  if(readSrcIdx == 0) {
418  PileupList.push_back(numberOfEvents);
419  TrueNumInteractions_.push_back(numberOfEvents);
420  }
421  sizes.push_back(numberOfEvents);
422  std::vector<EventID>::const_iterator begin = playEventID.begin();
423  std::vector<EventID>::const_iterator end = playEventID.end();
424  inputSources_[readSrcIdx]->playOldFormatPileUp(
425  begin, end, recordEventID,
426  std::bind(&MixingModule::pileAllWorkers, std::ref(*this), _1, mcc, bunchIdx,
427  _2, vertexOffset, std::ref(setup), e.streamID()));
428  } else {
429  size_t numberOfEvents = playbackInfo_H->getNumberOfEvents(bunchIdx, readSrcIdx);
430  if(readSrcIdx == 0) {
431  PileupList.push_back(numberOfEvents);
432  TrueNumInteractions_.push_back(numberOfEvents);
433  }
434  sizes.push_back(numberOfEvents);
435  std::vector<SecondaryEventIDAndFileInfo>::const_iterator begin = playbackInfo_H->getEventId(playbackCounter);
436  playbackCounter += numberOfEvents;
437  std::vector<SecondaryEventIDAndFileInfo>::const_iterator end = playbackInfo_H->getEventId(playbackCounter);
438  inputSources_[readSrcIdx]->playPileUp(
439  begin, end, recordEventID,
440  std::bind(&MixingModule::pileAllWorkers, std::ref(*this), _1, mcc, bunchIdx,
441  _2, vertexOffset, std::ref(setup), e.streamID()));
442  }
443  }
444  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
445  (*accItr)->finalizeBunchCrossing(e, setup, bunchIdx);
446  }
447  }
448  // Save playback information
449 
450  std::vector<edm::EventID> eventInfoList;
451  for (auto const item : recordEventID) {
452  eventInfoList.emplace_back(item.eventID());
453  }
454 
455  // setInfo swaps recordEventID, so recordEventID is useless (empty) after the call.
456  playbackInfo_->setInfo(recordEventID, sizes);
457 
458  // Keep track of pileup accounting...
459 
460  std::auto_ptr<PileupMixingContent> PileupMixing_;
461 
462  std::vector<int> numInteractionList;
463  std::vector<int> bunchCrossingList;
464  std::vector<float> TrueInteractionList;
465 
466  //Makin' a list: Basically, we don't care about the "other" sources at this point.
467  for (int bunchCrossing=minBunch_;bunchCrossing<=maxBunch_;++bunchCrossing) {
468  bunchCrossingList.push_back(bunchCrossing);
469  if(!inputSources_[0] || !inputSources_[0]->doPileUp(0)) {
470  numInteractionList.push_back(0);
471  TrueInteractionList.push_back(0);
472  }
473  else {
474  numInteractionList.push_back(PileupList[bunchCrossing-minBunch_]);
475  TrueInteractionList.push_back((TrueNumInteractions_)[bunchCrossing-minBunch_]);
476  }
477  }
478 
479  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
480  (*accItr)->StorePileupInformation( bunchCrossingList,
481  numInteractionList,
482  TrueInteractionList,
483  eventInfoList,
484  bunchSpace_);
485  }
486 
487 
488  PileupMixing_ = std::auto_ptr<PileupMixingContent>(new PileupMixingContent(bunchCrossingList,
489  numInteractionList,
490  TrueInteractionList,
491  eventInfoList,
492  bunchSpace_));
493 
494  e.put(PileupMixing_);
495 
496  // we have to do the ToF transformation for PSimHits once all pileup has been added
497  for (unsigned int ii=0;ii<workers_.size();++ii) {
498  workers_[ii]->setTof();
499  workers_[ii]->put(e);
500  }
501  }
502 
504 
505  if (playbackInfo_) {
506  std::auto_ptr<CrossingFramePlaybackInfoNew> pOut(playbackInfo_);
507  e.put(pOut);
508  }
509  }
510 
512  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
513  (*accItr)->beginRun(run, setup);
514  }
515  BMixingModule::beginRun( run, setup);
516  }
517 
519  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
520  (*accItr)->endRun(run, setup);
521  }
522  BMixingModule::endRun( run, setup);
523  }
524 
526  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
527  (*accItr)->beginLuminosityBlock(lumi, setup);
528  }
530  }
531 
533  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
534  (*accItr)->endLuminosityBlock(lumi, setup);
535  }
537  }
538 
539  void
541  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
542  (*accItr)->initializeEvent(event, setup);
543  }
544  }
545 
546  void
548  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
549  (*accItr)->accumulate(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, streamID);
557  }
558  }
559 
560  void
562  for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
563  (*accItr)->finalizeEvent(event, setup);
564  }
565  }
566 }//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:41
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