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::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual 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 ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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 edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 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)
 

Detailed Description

Definition at line 34 of file MixCollectionValidation.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file MixCollectionValidation.cc.

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

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

Definition at line 32 of file MixCollectionValidation.cc.

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

Member Function Documentation

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

Definition at line 128 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_, trackerHits::simHits, SimHitTimemap_, tkConvValidator_cfi::simTracks, SimTrackTags_, SimVertexTags_, and AlCaHLTBitMon_QueryRunRegistry::string.

129 {
130  using namespace edm;
131 
132  if ( HepMCProductTags_.size() > 0 ) {
133  bool gotHepMCProduct;
135  gotHepMCProduct = iEvent.getByToken(crossingFrame_Hep_Token_, crossingFrame);
136 
137  if (gotHepMCProduct){
138  std::auto_ptr<MixCollection<HepMCProduct> >
139  hepMCProduct (new MixCollection<HepMCProduct>(crossingFrame.product ()));
141 
142  fillGenParticleMulti(hitItr, hepMCProduct, nrHepMCProductH_);
143  }
144  }
145 
146  if ( SimTrackTags_.size() > 0 ) {
147  bool gotSimTrack;
148  edm::Handle<CrossingFrame<SimTrack> > crossingFrame;
149  gotSimTrack = iEvent.getByToken(crossingFrame_SimTr_Token_,crossingFrame);
150 
151  if (gotSimTrack){
152  std::auto_ptr<MixCollection<SimTrack> >
153  simTracks (new MixCollection<SimTrack>(crossingFrame.product ()));
155 
157  }
158  }
159 
160  if ( SimVertexTags_.size() > 0 ) {
161  bool gotSimVertex;
162  edm::Handle<CrossingFrame<SimVertex> > crossingFrame;
163  std::string SimVertexLabel = SimVertexTags_[0].label();
164  gotSimVertex = iEvent.getByToken(crossingFrame_SimVtx_Token_, crossingFrame);
165 
166  if (gotSimVertex){
167  std::auto_ptr<MixCollection<SimVertex> >
168  simVerteces (new MixCollection<SimVertex>(crossingFrame.product ()));
170 
171  fillMultiplicity(hitItr, simVerteces, nrSimVertexH_);
172  }
173  }
174 
175  if ( PSimHitTags_.size() > 0 ) {
176 
177  edm::Handle<CrossingFrame<PSimHit> > crossingFrame;
178 
179  for ( int i = 0; i < (int)PSimHitTags_.size(); i++ ) {
180  bool gotPSimHit;
181  gotPSimHit = iEvent.getByToken(crossingFrame_PSimHit_Tokens_[i], crossingFrame);
182 
183  if (gotPSimHit){
184  std::auto_ptr<MixCollection<PSimHit> >
185  simHits (new MixCollection<PSimHit>(crossingFrame.product ()));
186 
188 
190 
192  }
193  }
194  }
195 
196  if ( PCaloHitTags_.size() > 0 ) {
197 
198  edm::Handle<CrossingFrame<PCaloHit> > crossingFrame;
199 
200  for ( int i = 0; i < (int)PCaloHitTags_.size(); i++ ) {
201  bool gotPCaloHit;
202  std::string PCaloHitLabel = PCaloHitTags_[i].label()+PCaloHitTags_[i].instance();
203  gotPCaloHit = iEvent.getByToken(crossingFrame_PCaloHit_Tokens_[i], crossingFrame);
204 
205  if (gotPCaloHit){
206  std::auto_ptr<MixCollection<PCaloHit> >
207  caloHits (new MixCollection<PCaloHit>(crossingFrame.product ()));
208 
210 
211  fillMultiplicity(hitItr, caloHits, CaloHitNrmap_[PCaloHitTags_[i].instance()]);
212 
213  fillCaloHitTime(hitItr, caloHits, CaloHitTimemap_[PCaloHitTags_[i].instance()]);
214  }
215  }
216  }
217 
218 }
std::map< std::string, MonitorElement * > CaloHitNrmap_
std::vector< edm::EDGetTokenT< CrossingFrame< PCaloHit > > > crossingFrame_PCaloHit_Tokens_
std::vector< edm::InputTag > HepMCProductTags_
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::vector< edm::EDGetTokenT< CrossingFrame< PSimHit > > > crossingFrame_PSimHit_Tokens_
std::map< std::string, MonitorElement * > SimHitTimemap_
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_
std::map< std::string, MonitorElement * > SimHitNrmap_
void fillSimHitTime(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
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:81
std::vector< edm::InputTag > SimVertexTags_
HLT enums.
std::map< std::string, MonitorElement * > CaloHitTimemap_
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 38 of file MixCollectionValidation.cc.

References 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, diffTwoXMLs::label, maxbunch_, minbunch_, mixObjextsSet_, dataset::name, cscdqm::h::names, nbin_, nrHepMCProductH_, nrSimTrackH_, nrSimVertexH_, resolutioncreator_cfi::object, PCaloHitTags_, muonDTDigis_cfi::pset, PSimHitTags_, DQMStore::IBooker::setCurrentFolder(), SimHitNrmap_, SimHitTimemap_, SimTrackTags_, SimVertexTags_, AlCaHLTBitMon_QueryRunRegistry::string, fireworks::subdets, and fftjetcommon_cfi::title.

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

Definition at line 271 of file MixCollectionValidation.cc.

References MonitorElement::Fill(), diffTreeTool::index, minbunch_, nbin_, and ntuplemaker::time.

Referenced by analyze().

271  {
272 
273  for ( theItr_ = theColl_->begin() ; theItr_ != theColl_->end() ; ++theItr_) {
274 
275  int bunch = (*theItr_).eventId().bunchCrossing();
276  float time = (*theItr_).time();
277  int index = bunch - minbunch_;
278  if ( index >= 0 && index < nbin_ ) { theProfile_->Fill(float(bunch+0.5),time); }
279  else { edm::LogWarning("MixCollectionValidation") << "fillCaloHitTime: bunch number " << bunch << " out of range"; }
280 
281  }
282 
283 }
void Fill(long long x)
template<class T1 , class T2 >
void MixCollectionValidation::fillGenParticleMulti ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Definition at line 239 of file MixCollectionValidation.cc.

References MonitorElement::Fill(), mps_fire::i, diffTreeTool::index, hpstanc_transforms::max, minbunch_, and nbin_.

Referenced by analyze().

239  {
240 
241  std::vector<int> theMult(nbin_);
242 
243  for ( theItr_ = theColl_->begin() ; theItr_ != theColl_->end() ; ++theItr_) {
244 
245  int bunch = theItr_.bunch();
246  int index = bunch - minbunch_;
247  if ( index >= 0 && index < nbin_ ) { theMult[index] += (*theItr_).GetEvent()->particles_size(); }
248  else { edm::LogWarning("MixCollectionValidation") << "fillMultiplicity: bunch number " << bunch << " out of range"; }
249 
250  }
251 
252  for ( int i = 0; i < nbin_; i++ ) {
253  theProfile_->Fill(float(i+minbunch_+0.5),std::log10(std::max(float(0.1),float(theMult[i]))));
254  }
255 }
void Fill(long long x)
template<class T1 , class T2 >
void MixCollectionValidation::fillMultiplicity ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Definition at line 220 of file MixCollectionValidation.cc.

References MonitorElement::Fill(), mps_fire::i, diffTreeTool::index, hpstanc_transforms::max, minbunch_, and nbin_.

Referenced by analyze().

220  {
221 
222  std::vector<int> theMult(nbin_);
223 
224  for ( theItr_ = theColl_->begin() ; theItr_ != theColl_->end() ; ++theItr_) {
225 
226  int bunch = (*theItr_).eventId().bunchCrossing();
227  int index = bunch - minbunch_;
228  if ( index >= 0 && index < nbin_ ) { theMult[index] += 1; }
229  else { 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::fillSimHitTime ( T1 &  theItr_,
T2 &  theColl_,
MonitorElement theProfile_ 
)
private

Definition at line 257 of file MixCollectionValidation.cc.

References MonitorElement::Fill(), diffTreeTool::index, minbunch_, nbin_, and ntuplemaker::time.

Referenced by analyze().

257  {
258 
259  for ( theItr_ = theColl_->begin() ; theItr_ != theColl_->end() ; ++theItr_) {
260 
261  int bunch = (*theItr_).eventId().bunchCrossing();
262  float time = (*theItr_).timeOfFlight();
263  int index = bunch - minbunch_;
264  if ( index >= 0 && index < nbin_ ) { theProfile_->Fill(float(bunch+0.5),time); }
265  else { edm::LogWarning("MixCollectionValidation") << "fillSimHitTime: bunch number " << bunch << " out of range"; }
266 
267  }
268 
269 }
void Fill(long long x)

Member Data Documentation

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

Definition at line 79 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 80 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 60 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 64 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 63 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 61 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 62 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 82 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

int MixCollectionValidation::maxbunch_
private

Definition at line 68 of file MixCollectionValidation.h.

Referenced by bookHistograms().

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

Definition at line 43 of file MixCollectionValidation.h.

Referenced by bookHistograms(), and MixCollectionValidation().

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

Definition at line 72 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* MixCollectionValidation::nrSimTrackH_
private

Definition at line 73 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* MixCollectionValidation::nrSimVertexH_
private

Definition at line 74 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

std::string MixCollectionValidation::outputFile_
private

Definition at line 66 of file MixCollectionValidation.h.

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

Definition at line 86 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 85 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 76 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 77 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 83 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 84 of file MixCollectionValidation.h.

Referenced by analyze(), and bookHistograms().

bool MixCollectionValidation::verbose_
private

Definition at line 70 of file MixCollectionValidation.h.