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::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
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_)
 
 MixCollectionValidation (const edm::ParameterSet &)
 
 ~MixCollectionValidation () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 33 of file MixCollectionValidation.h.

Constructor & Destructor Documentation

◆ MixCollectionValidation()

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

Definition at line 20 of file MixCollectionValidation.cc.

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

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

◆ ~MixCollectionValidation()

MixCollectionValidation::~MixCollectionValidation ( )
override

Definition at line 29 of file MixCollectionValidation.cc.

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

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 115 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(), HepMCProductTags_, mps_fire::i, iEvent, 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.

115  {
116  using namespace edm;
117 
118  if (!HepMCProductTags_.empty()) {
119  bool gotHepMCProduct;
121  gotHepMCProduct = iEvent.getByToken(crossingFrame_Hep_Token_, crossingFrame);
122 
123  if (gotHepMCProduct) {
124  std::unique_ptr<MixCollection<HepMCProduct>> hepMCProduct(
125  new MixCollection<HepMCProduct>(crossingFrame.product()));
127 
128  fillGenParticleMulti(hitItr, hepMCProduct, nrHepMCProductH_);
129  }
130  }
131 
132  if (!SimTrackTags_.empty()) {
133  bool gotSimTrack;
135  gotSimTrack = iEvent.getByToken(crossingFrame_SimTr_Token_, crossingFrame);
136 
137  if (gotSimTrack) {
138  std::unique_ptr<MixCollection<SimTrack>> simTracks(new MixCollection<SimTrack>(crossingFrame.product()));
140 
142  }
143  }
144 
145  if (!SimVertexTags_.empty()) {
146  bool gotSimVertex;
148  std::string SimVertexLabel = SimVertexTags_[0].label();
149  gotSimVertex = iEvent.getByToken(crossingFrame_SimVtx_Token_, crossingFrame);
150 
151  if (gotSimVertex) {
152  std::unique_ptr<MixCollection<SimVertex>> simVerteces(new MixCollection<SimVertex>(crossingFrame.product()));
154 
155  fillMultiplicity(hitItr, simVerteces, nrSimVertexH_);
156  }
157  }
158 
159  if (!PSimHitTags_.empty()) {
160  edm::Handle<CrossingFrame<PSimHit>> crossingFrame;
161 
162  for (int i = 0; i < (int)PSimHitTags_.size(); i++) {
163  bool gotPSimHit;
164  gotPSimHit = iEvent.getByToken(crossingFrame_PSimHit_Tokens_[i], crossingFrame);
165 
166  if (gotPSimHit) {
167  std::unique_ptr<MixCollection<PSimHit>> simHits(new MixCollection<PSimHit>(crossingFrame.product()));
168 
170 
172 
174  }
175  }
176  }
177 
178  if (!PCaloHitTags_.empty()) {
180 
181  for (int i = 0; i < (int)PCaloHitTags_.size(); i++) {
182  bool gotPCaloHit;
183  std::string PCaloHitLabel = PCaloHitTags_[i].label() + PCaloHitTags_[i].instance();
184  gotPCaloHit = iEvent.getByToken(crossingFrame_PCaloHit_Tokens_[i], crossingFrame);
185 
186  if (gotPCaloHit) {
187  std::unique_ptr<MixCollection<PCaloHit>> caloHits(new MixCollection<PCaloHit>(crossingFrame.product()));
188 
190 
191  fillMultiplicity(hitItr, caloHits, CaloHitNrmap_[PCaloHitTags_[i].instance()]);
192 
193  fillCaloHitTime(hitItr, caloHits, CaloHitTimemap_[PCaloHitTags_[i].instance()]);
194  }
195  }
196  }
197 }
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
std::vector< edm::EDGetTokenT< CrossingFrame< PCaloHit > > > crossingFrame_PCaloHit_Tokens_
std::map< std::string, MonitorElement * > CaloHitNrmap_
T const * product() const
Definition: Handle.h:70
int iEvent
Definition: GenABIO.cc:224
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_
std::vector< edm::InputTag > SimVertexTags_
HLT enums.
void fillGenParticleMulti(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)

◆ bookHistograms()

void MixCollectionValidation::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 34 of file MixCollectionValidation.cc.

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

36  {
37  iBooker.setCurrentFolder("MixingV/Mixing");
38 
39  std::vector<std::string> names = mixObjextsSet_.getParameterNames();
40 
41  for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
43  if (!pset.exists("type"))
44  continue; // to allow replacement by empty pset
45  std::string object = pset.getParameter<std::string>("type");
46  std::vector<InputTag> tags = pset.getParameter<std::vector<InputTag>>("input");
47 
48  if (object == "HepMCProduct") {
49  std::string title = "Log10 Number of GenParticle in " + object;
50  std::string name = "NumberOf" + object;
51  nrHepMCProductH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.);
52 
54  if (!HepMCProductTags_.empty()) {
56  consumes<CrossingFrame<HepMCProduct>>(edm::InputTag("mix", HepMCProductTags_[0].label()));
57  }
58  } else if (object == "SimTrack") {
59  std::string title = "Log10 Number of " + object;
60  std::string name = "NumberOf" + object;
61  nrSimTrackH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.);
62 
64  if (!SimTrackTags_.empty()) {
65  crossingFrame_SimTr_Token_ = consumes<CrossingFrame<SimTrack>>(edm::InputTag("mix", SimTrackTags_[0].label()));
66  }
67  } else if (object == "SimVertex") {
68  std::string title = "Log10 Number of " + object;
69  std::string name = "NumberOf" + object;
70  nrSimVertexH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.);
71 
73  if (!SimVertexTags_.empty()) {
75  consumes<CrossingFrame<SimVertex>>(edm::InputTag("mix", SimVertexTags_[0].label()));
76  }
77  } else if (object == "PSimHit") {
78  std::vector<std::string> subdets = pset.getParameter<std::vector<std::string>>("subdets");
79  for (unsigned int ii = 0; ii < subdets.size(); ii++) {
80  std::string title = "Log10 Number of " + subdets[ii];
81  std::string name = "NumberOf" + subdets[ii];
82  SimHitNrmap_[subdets[ii]] = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.);
83 
84  title = "Time of " + subdets[ii];
85  name = "TimeOf" + subdets[ii];
87  iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, -125., 375.);
88  }
89 
91  for (auto const &it : PSimHitTags_)
93  consumes<CrossingFrame<PSimHit>>(edm::InputTag("mix", it.label() + it.instance())));
94  } else if (object == "PCaloHit") {
95  std::vector<std::string> subdets = pset.getParameter<std::vector<std::string>>("subdets");
96  for (unsigned int ii = 0; ii < subdets.size(); ii++) {
97  std::string title = "Log10 Number of " + subdets[ii];
98  std::string name = "NumberOf" + subdets[ii];
99  CaloHitNrmap_[subdets[ii]] = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.);
100 
101  title = "Time of " + subdets[ii];
102  name = "TimeOf" + subdets[ii];
104  iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, -125., 375.);
105  }
106 
108  for (auto const &it : PCaloHitTags_)
110  consumes<CrossingFrame<PCaloHit>>(edm::InputTag("mix", it.label() + it.instance())));
111  }
112  }
113 }
std::map< std::string, MonitorElement * > SimHitNrmap_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< edm::EDGetTokenT< CrossingFrame< PSimHit > > > crossingFrame_PSimHit_Tokens_
std::map< std::string, MonitorElement * > CaloHitTimemap_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::vector< edm::InputTag > HepMCProductTags_
std::vector< edm::EDGetTokenT< CrossingFrame< PCaloHit > > > crossingFrame_PCaloHit_Tokens_
std::map< std::string, MonitorElement * > CaloHitNrmap_
const std::string names[nVars_]
char const * label
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
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< edm::InputTag > PCaloHitTags_
ii
Definition: cuy.py:589
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
std::vector< std::string > getParameterNames() const

◆ fillCaloHitTime() [1/2]

template<class T1 , class T2 >
void MixCollectionValidation::fillCaloHitTime ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Referenced by analyze().

◆ fillCaloHitTime() [2/2]

template<class T1 , class T2 >
void MixCollectionValidation::fillCaloHitTime ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)

Definition at line 252 of file MixCollectionValidation.cc.

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

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

◆ fillGenParticleMulti() [1/2]

template<class T1 , class T2 >
void MixCollectionValidation::fillGenParticleMulti ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Referenced by analyze().

◆ fillGenParticleMulti() [2/2]

template<class T1 , class T2 >
void MixCollectionValidation::fillGenParticleMulti ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)

Definition at line 219 of file MixCollectionValidation.cc.

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

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

◆ fillMultiplicity() [1/2]

template<class T1 , class T2 >
void MixCollectionValidation::fillMultiplicity ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Referenced by analyze().

◆ fillMultiplicity() [2/2]

template<class T1 , class T2 >
void MixCollectionValidation::fillMultiplicity ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)

Definition at line 200 of file MixCollectionValidation.cc.

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

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

◆ fillSimHitTime() [1/2]

template<class T1 , class T2 >
void MixCollectionValidation::fillSimHitTime ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Referenced by analyze().

◆ fillSimHitTime() [2/2]

template<class T1 , class T2 >
void MixCollectionValidation::fillSimHitTime ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)

Definition at line 238 of file MixCollectionValidation.cc.

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

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

Member Data Documentation

◆ CaloHitNrmap_

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

Definition at line 81 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ CaloHitTimemap_

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

Definition at line 82 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ crossingFrame_Hep_Token_

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

Definition at line 62 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ crossingFrame_PCaloHit_Tokens_

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

Definition at line 66 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ crossingFrame_PSimHit_Tokens_

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

Definition at line 65 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ crossingFrame_SimTr_Token_

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

Definition at line 63 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ crossingFrame_SimVtx_Token_

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

Definition at line 64 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ HepMCProductTags_

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

Definition at line 84 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ maxbunch_

int MixCollectionValidation::maxbunch_
private

Definition at line 70 of file MixCollectionValidation.h.

Referenced by bookHistograms().

◆ minbunch_

int MixCollectionValidation::minbunch_
private

◆ mixObjextsSet_

edm::ParameterSet MixCollectionValidation::mixObjextsSet_
private

Definition at line 41 of file MixCollectionValidation.h.

Referenced by bookHistograms(), and MixCollectionValidation().

◆ nbin_

int MixCollectionValidation::nbin_
private

◆ nrHepMCProductH_

MonitorElement* MixCollectionValidation::nrHepMCProductH_
private

Definition at line 74 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ nrSimTrackH_

MonitorElement* MixCollectionValidation::nrSimTrackH_
private

Definition at line 75 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ nrSimVertexH_

MonitorElement* MixCollectionValidation::nrSimVertexH_
private

Definition at line 76 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ outputFile_

std::string MixCollectionValidation::outputFile_
private

Definition at line 68 of file MixCollectionValidation.h.

◆ PCaloHitTags_

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

Definition at line 88 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ PSimHitTags_

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

Definition at line 87 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ SimHitNrmap_

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

Definition at line 78 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ SimHitTimemap_

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

Definition at line 79 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ SimTrackTags_

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

Definition at line 85 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ SimVertexTags_

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

Definition at line 86 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

◆ verbose_

bool MixCollectionValidation::verbose_
private

Definition at line 72 of file MixCollectionValidation.h.