CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MixCollectionValidation Class Reference

#include <MixCollectionValidation.h>

Inheritance diagram for MixCollectionValidation:
DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 MixCollectionValidation (const edm::ParameterSet &)
 
 ~MixCollectionValidation () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

template<class T1 , class T2 >
void fillCaloHitTime (T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
 
template<class T1 , class T2 >
void fillGenParticleMulti (T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
 
template<class T1 , class T2 >
void fillMultiplicity (T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
 
template<class T1 , class T2 >
void fillSimHitTime (T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
 

Private Attributes

std::map< std::string, MonitorElement * > CaloHitNrmap_
 
std::map< std::string, MonitorElement * > CaloHitTimemap_
 
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > crossingFrame_Hep_Token_
 
std::vector< edm::EDGetTokenT< CrossingFrame< PCaloHit > > > crossingFrame_PCaloHit_Tokens_
 
std::vector< edm::EDGetTokenT< CrossingFrame< PSimHit > > > crossingFrame_PSimHit_Tokens_
 
edm::EDGetTokenT< CrossingFrame< SimTrack > > crossingFrame_SimTr_Token_
 
edm::EDGetTokenT< CrossingFrame< SimVertex > > crossingFrame_SimVtx_Token_
 
std::vector< edm::InputTagHepMCProductTags_
 
int maxbunch_
 
int minbunch_
 
edm::ParameterSet mixObjextsSet_
 
int nbin_
 
MonitorElementnrHepMCProductH_
 
MonitorElementnrSimTrackH_
 
MonitorElementnrSimVertexH_
 
std::string outputFile_
 
std::vector< edm::InputTagPCaloHitTags_
 
std::vector< edm::InputTagPSimHitTags_
 
std::map< std::string, MonitorElement * > SimHitNrmap_
 
std::map< std::string, MonitorElement * > SimHitTimemap_
 
std::vector< edm::InputTagSimTrackTags_
 
std::vector< edm::InputTagSimVertexTags_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 33 of file MixCollectionValidation.h.

Constructor & Destructor Documentation

MixCollectionValidation::MixCollectionValidation ( const edm::ParameterSet iConfig)
explicit

Definition at line 21 of file MixCollectionValidation.cc.

References edm::ParameterSet::getParameter(), and mixObjextsSet_.

22  : minbunch_(iConfig.getParameter<int>("minBunch")),
23  maxbunch_(iConfig.getParameter<int>("maxBunch")),
24  verbose_(iConfig.getUntrackedParameter<bool>("verbose", false)),
25  nbin_(maxbunch_ - minbunch_ + 1) {
26  // Histograms will be defined according to the configuration
27  ParameterSet mixObjextsSet_ = iConfig.getParameter<ParameterSet>("mixObjects");
28 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MixCollectionValidation::~MixCollectionValidation ( )
override

Definition at line 30 of file MixCollectionValidation.cc.

30  {
31  // do anything here that needs to be done at desctruction time
32  // (e.g. close files, deallocate resources etc.)
33 }

Member Function Documentation

void MixCollectionValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iConfig 
)
override

Definition at line 116 of file MixCollectionValidation.cc.

References CaloHitNrmap_, CaloHitTimemap_, crossingFrame_Hep_Token_, crossingFrame_PCaloHit_Tokens_, crossingFrame_PSimHit_Tokens_, crossingFrame_SimTr_Token_, crossingFrame_SimVtx_Token_, fillCaloHitTime(), fillGenParticleMulti(), fillMultiplicity(), fillSimHitTime(), edm::Event::getByToken(), HepMCProductTags_, mps_fire::i, instance, createfilelist::int, nrHepMCProductH_, nrSimTrackH_, nrSimVertexH_, PCaloHitTags_, edm::Handle< T >::product(), PSimHitTags_, SimHitNrmap_, FastTrackerRecHitCombiner_cfi::simHits, SimHitTimemap_, TrackCandidateProducer_cfi::simTracks, SimTrackTags_, SimVertexTags_, and AlCaHLTBitMon_QueryRunRegistry::string.

116  {
117  using namespace edm;
118 
119  if (!HepMCProductTags_.empty()) {
120  bool gotHepMCProduct;
122  gotHepMCProduct = iEvent.getByToken(crossingFrame_Hep_Token_, crossingFrame);
123 
124  if (gotHepMCProduct) {
125  std::unique_ptr<MixCollection<HepMCProduct>> hepMCProduct(
126  new MixCollection<HepMCProduct>(crossingFrame.product()));
128 
129  fillGenParticleMulti(hitItr, hepMCProduct, nrHepMCProductH_);
130  }
131  }
132 
133  if (!SimTrackTags_.empty()) {
134  bool gotSimTrack;
136  gotSimTrack = iEvent.getByToken(crossingFrame_SimTr_Token_, crossingFrame);
137 
138  if (gotSimTrack) {
139  std::unique_ptr<MixCollection<SimTrack>> simTracks(new MixCollection<SimTrack>(crossingFrame.product()));
141 
143  }
144  }
145 
146  if (!SimVertexTags_.empty()) {
147  bool gotSimVertex;
149  std::string SimVertexLabel = SimVertexTags_[0].label();
150  gotSimVertex = iEvent.getByToken(crossingFrame_SimVtx_Token_, crossingFrame);
151 
152  if (gotSimVertex) {
153  std::unique_ptr<MixCollection<SimVertex>> simVerteces(new MixCollection<SimVertex>(crossingFrame.product()));
155 
156  fillMultiplicity(hitItr, simVerteces, nrSimVertexH_);
157  }
158  }
159 
160  if (!PSimHitTags_.empty()) {
161  edm::Handle<CrossingFrame<PSimHit>> crossingFrame;
162 
163  for (int i = 0; i < (int)PSimHitTags_.size(); i++) {
164  bool gotPSimHit;
165  gotPSimHit = iEvent.getByToken(crossingFrame_PSimHit_Tokens_[i], crossingFrame);
166 
167  if (gotPSimHit) {
168  std::unique_ptr<MixCollection<PSimHit>> simHits(new MixCollection<PSimHit>(crossingFrame.product()));
169 
171 
173 
175  }
176  }
177  }
178 
179  if (!PCaloHitTags_.empty()) {
181 
182  for (int i = 0; i < (int)PCaloHitTags_.size(); i++) {
183  bool gotPCaloHit;
184  std::string PCaloHitLabel = PCaloHitTags_[i].label() + PCaloHitTags_[i].instance();
185  gotPCaloHit = iEvent.getByToken(crossingFrame_PCaloHit_Tokens_[i], crossingFrame);
186 
187  if (gotPCaloHit) {
188  std::unique_ptr<MixCollection<PCaloHit>> caloHits(new MixCollection<PCaloHit>(crossingFrame.product()));
189 
191 
192  fillMultiplicity(hitItr, caloHits, CaloHitNrmap_[PCaloHitTags_[i].instance()]);
193 
194  fillCaloHitTime(hitItr, caloHits, CaloHitTimemap_[PCaloHitTags_[i].instance()]);
195  }
196  }
197  }
198 }
std::map< std::string, MonitorElement * > SimHitNrmap_
std::vector< edm::EDGetTokenT< CrossingFrame< PSimHit > > > crossingFrame_PSimHit_Tokens_
std::map< std::string, MonitorElement * > CaloHitTimemap_
std::vector< edm::InputTag > HepMCProductTags_
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::vector< edm::EDGetTokenT< CrossingFrame< PCaloHit > > > crossingFrame_PCaloHit_Tokens_
std::map< std::string, MonitorElement * > CaloHitNrmap_
void fillCaloHitTime(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
edm::EDGetTokenT< CrossingFrame< SimVertex > > crossingFrame_SimVtx_Token_
void fillMultiplicity(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
std::vector< edm::InputTag > PSimHitTags_
void fillSimHitTime(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
std::map< std::string, MonitorElement * > SimHitTimemap_
edm::EDGetTokenT< CrossingFrame< SimTrack > > crossingFrame_SimTr_Token_
std::vector< edm::InputTag > PCaloHitTags_
std::vector< edm::InputTag > SimTrackTags_
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > crossingFrame_Hep_Token_
T const * product() const
Definition: Handle.h:69
std::vector< edm::InputTag > SimVertexTags_
HLT enums.
void fillGenParticleMulti(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
void MixCollectionValidation::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 35 of file MixCollectionValidation.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::bookProfile(), CaloHitNrmap_, CaloHitTimemap_, edm::EDConsumerBase::consumes(), crossingFrame_Hep_Token_, crossingFrame_PCaloHit_Tokens_, crossingFrame_PSimHit_Tokens_, crossingFrame_SimTr_Token_, crossingFrame_SimVtx_Token_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), HepMCProductTags_, cuy::ii, HLT_2018_cff::InputTag, label, maxbunch_, minbunch_, mixObjextsSet_, Skims_PA_cff::name, names, nbin_, nrHepMCProductH_, nrSimTrackH_, nrSimVertexH_, resolutioncreator_cfi::object, PCaloHitTags_, muonDTDigis_cfi::pset, PSimHitTags_, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), SimHitNrmap_, SimHitTimemap_, SimTrackTags_, SimVertexTags_, AlCaHLTBitMon_QueryRunRegistry::string, fireworks::subdets, triggerMatcherToHLTDebug_cfi::tags, and overlapproblemtsosanalyzer_cfi::title.

37  {
38  iBooker.setCurrentFolder("MixingV/Mixing");
39 
40  std::vector<std::string> names = mixObjextsSet_.getParameterNames();
41 
42  for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
44  if (!pset.exists("type"))
45  continue; // to allow replacement by empty pset
46  std::string object = pset.getParameter<std::string>("type");
47  std::vector<InputTag> tags = pset.getParameter<std::vector<InputTag>>("input");
48 
49  if (object == "HepMCProduct") {
50  std::string title = "Log10 Number of GenParticle in " + object;
51  std::string name = "NumberOf" + object;
52  nrHepMCProductH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.);
53 
55  if (!HepMCProductTags_.empty()) {
57  consumes<CrossingFrame<HepMCProduct>>(edm::InputTag("mix", HepMCProductTags_[0].label()));
58  }
59  } else if (object == "SimTrack") {
60  std::string title = "Log10 Number of " + object;
61  std::string name = "NumberOf" + object;
62  nrSimTrackH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.);
63 
65  if (!SimTrackTags_.empty()) {
66  crossingFrame_SimTr_Token_ = consumes<CrossingFrame<SimTrack>>(edm::InputTag("mix", SimTrackTags_[0].label()));
67  }
68  } else if (object == "SimVertex") {
69  std::string title = "Log10 Number of " + object;
70  std::string name = "NumberOf" + object;
71  nrSimVertexH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.);
72 
74  if (!SimVertexTags_.empty()) {
76  consumes<CrossingFrame<SimVertex>>(edm::InputTag("mix", SimVertexTags_[0].label()));
77  }
78  } else if (object == "PSimHit") {
79  std::vector<std::string> subdets = pset.getParameter<std::vector<std::string>>("subdets");
80  for (unsigned int ii = 0; ii < subdets.size(); ii++) {
81  std::string title = "Log10 Number of " + subdets[ii];
82  std::string name = "NumberOf" + subdets[ii];
83  SimHitNrmap_[subdets[ii]] = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.);
84 
85  title = "Time of " + subdets[ii];
86  name = "TimeOf" + subdets[ii];
87  SimHitTimemap_[subdets[ii]] =
88  iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, -125., 375.);
89  }
90 
92  for (auto const &it : PSimHitTags_)
94  consumes<CrossingFrame<PSimHit>>(edm::InputTag("mix", it.label() + it.instance())));
95  } else if (object == "PCaloHit") {
96  std::vector<std::string> subdets = pset.getParameter<std::vector<std::string>>("subdets");
97  for (unsigned int ii = 0; ii < subdets.size(); ii++) {
98  std::string title = "Log10 Number of " + subdets[ii];
99  std::string name = "NumberOf" + subdets[ii];
100  CaloHitNrmap_[subdets[ii]] = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.);
101 
102  title = "Time of " + subdets[ii];
103  name = "TimeOf" + subdets[ii];
104  CaloHitTimemap_[subdets[ii]] =
105  iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, -125., 375.);
106  }
107 
109  for (auto const &it : PCaloHitTags_)
111  consumes<CrossingFrame<PCaloHit>>(edm::InputTag("mix", it.label() + it.instance())));
112  }
113  }
114 }
T getParameter(std::string const &) const
std::map< std::string, MonitorElement * > SimHitNrmap_
std::vector< edm::EDGetTokenT< CrossingFrame< PSimHit > > > crossingFrame_PSimHit_Tokens_
std::map< std::string, MonitorElement * > CaloHitTimemap_
std::vector< edm::InputTag > HepMCProductTags_
std::vector< edm::EDGetTokenT< CrossingFrame< PCaloHit > > > crossingFrame_PCaloHit_Tokens_
std::map< std::string, MonitorElement * > CaloHitNrmap_
bool exists(std::string const &parameterName) const
checks if a parameter exists
const std::string names[nVars_]
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
char const * label
edm::EDGetTokenT< CrossingFrame< SimVertex > > crossingFrame_SimVtx_Token_
std::vector< edm::InputTag > PSimHitTags_
std::map< std::string, MonitorElement * > SimHitTimemap_
edm::EDGetTokenT< CrossingFrame< SimTrack > > crossingFrame_SimTr_Token_
std::vector< std::string > getParameterNames() const
std::vector< edm::InputTag > PCaloHitTags_
ii
Definition: cuy.py:590
std::vector< edm::InputTag > SimTrackTags_
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > crossingFrame_Hep_Token_
std::vector< edm::InputTag > SimVertexTags_
static const std::string subdets[7]
Definition: TrackUtils.cc:60
template<class T1 , class T2 >
void MixCollectionValidation::fillCaloHitTime ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Definition at line 253 of file MixCollectionValidation.cc.

References dqm::impl::MonitorElement::Fill(), minbunch_, nbin_, and ntuplemaker::time.

Referenced by analyze().

253  {
254  for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
255  int bunch = (*theItr_).eventId().bunchCrossing();
256  float time = (*theItr_).time();
257  int index = bunch - minbunch_;
258  if (index >= 0 && index < nbin_) {
259  theProfile_->Fill(float(bunch + 0.5), time);
260  } else {
261  edm::LogWarning("MixCollectionValidation") << "fillCaloHitTime: bunch number " << bunch << " out of range";
262  }
263  }
264 }
void Fill(long long x)
template<class T1 , class T2 >
void MixCollectionValidation::fillGenParticleMulti ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Definition at line 220 of file MixCollectionValidation.cc.

References dqm::impl::MonitorElement::Fill(), mps_fire::i, SiStripPI::max, minbunch_, and nbin_.

Referenced by analyze().

220  {
221  std::vector<int> theMult(nbin_);
222 
223  for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
224  int bunch = theItr_.bunch();
225  int index = bunch - minbunch_;
226  if (index >= 0 && index < nbin_) {
227  theMult[index] += (*theItr_).GetEvent()->particles_size();
228  } else {
229  edm::LogWarning("MixCollectionValidation") << "fillMultiplicity: bunch number " << bunch << " out of range";
230  }
231  }
232 
233  for (int i = 0; i < nbin_; i++) {
234  theProfile_->Fill(float(i + minbunch_ + 0.5), std::log10(std::max(float(0.1), float(theMult[i]))));
235  }
236 }
void Fill(long long x)
template<class T1 , class T2 >
void MixCollectionValidation::fillMultiplicity ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Definition at line 201 of file MixCollectionValidation.cc.

References dqm::impl::MonitorElement::Fill(), mps_fire::i, SiStripPI::max, minbunch_, and nbin_.

Referenced by analyze().

201  {
202  std::vector<int> theMult(nbin_);
203 
204  for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
205  int bunch = (*theItr_).eventId().bunchCrossing();
206  int index = bunch - minbunch_;
207  if (index >= 0 && index < nbin_) {
208  theMult[index] += 1;
209  } else {
210  edm::LogWarning("MixCollectionValidation") << "fillMultiplicity: bunch number " << bunch << " out of range";
211  }
212  }
213 
214  for (int i = 0; i < nbin_; i++) {
215  theProfile_->Fill(float(i + minbunch_ + 0.5), std::log10(std::max(float(0.1), float(theMult[i]))));
216  }
217 }
void Fill(long long x)
template<class T1 , class T2 >
void MixCollectionValidation::fillSimHitTime ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Definition at line 239 of file MixCollectionValidation.cc.

References dqm::impl::MonitorElement::Fill(), minbunch_, nbin_, and ntuplemaker::time.

Referenced by analyze().

239  {
240  for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
241  int bunch = (*theItr_).eventId().bunchCrossing();
242  float time = (*theItr_).timeOfFlight();
243  int index = bunch - minbunch_;
244  if (index >= 0 && index < nbin_) {
245  theProfile_->Fill(float(bunch + 0.5), time);
246  } else {
247  edm::LogWarning("MixCollectionValidation") << "fillSimHitTime: bunch number " << bunch << " out of range";
248  }
249  }
250 }
void Fill(long long x)

Member Data Documentation

std::map<std::string, MonitorElement *> MixCollectionValidation::CaloHitNrmap_
private

Definition at line 81 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::map<std::string, MonitorElement *> MixCollectionValidation::CaloHitTimemap_
private

Definition at line 82 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<CrossingFrame<edm::HepMCProduct> > MixCollectionValidation::crossingFrame_Hep_Token_
private

Definition at line 62 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::vector<edm::EDGetTokenT<CrossingFrame<PCaloHit> > > MixCollectionValidation::crossingFrame_PCaloHit_Tokens_
private

Definition at line 66 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::vector<edm::EDGetTokenT<CrossingFrame<PSimHit> > > MixCollectionValidation::crossingFrame_PSimHit_Tokens_
private

Definition at line 65 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<CrossingFrame<SimTrack> > MixCollectionValidation::crossingFrame_SimTr_Token_
private

Definition at line 63 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<CrossingFrame<SimVertex> > MixCollectionValidation::crossingFrame_SimVtx_Token_
private

Definition at line 64 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::vector<edm::InputTag> MixCollectionValidation::HepMCProductTags_
private

Definition at line 84 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

int MixCollectionValidation::maxbunch_
private

Definition at line 70 of file MixCollectionValidation.h.

Referenced by bookHistograms().

int MixCollectionValidation::minbunch_
private
edm::ParameterSet MixCollectionValidation::mixObjextsSet_
private

Definition at line 41 of file MixCollectionValidation.h.

Referenced by bookHistograms(), and MixCollectionValidation().

int MixCollectionValidation::nbin_
private
MonitorElement* MixCollectionValidation::nrHepMCProductH_
private

Definition at line 74 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* MixCollectionValidation::nrSimTrackH_
private

Definition at line 75 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* MixCollectionValidation::nrSimVertexH_
private

Definition at line 76 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::string MixCollectionValidation::outputFile_
private

Definition at line 68 of file MixCollectionValidation.h.

std::vector<edm::InputTag> MixCollectionValidation::PCaloHitTags_
private

Definition at line 88 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::vector<edm::InputTag> MixCollectionValidation::PSimHitTags_
private

Definition at line 87 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::map<std::string, MonitorElement *> MixCollectionValidation::SimHitNrmap_
private

Definition at line 78 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::map<std::string, MonitorElement *> MixCollectionValidation::SimHitTimemap_
private

Definition at line 79 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::vector<edm::InputTag> MixCollectionValidation::SimTrackTags_
private

Definition at line 85 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::vector<edm::InputTag> MixCollectionValidation::SimVertexTags_
private

Definition at line 86 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

bool MixCollectionValidation::verbose_
private

Definition at line 72 of file MixCollectionValidation.h.