21 : minbunch_(iConfig.getParameter<int>(
"minBunch")),
22 maxbunch_(iConfig.getParameter<int>(
"maxBunch")),
23 verbose_(iConfig.getUntrackedParameter<bool>(
"verbose",
false)),
24 nbin_(maxbunch_ - minbunch_ + 1) {
41 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
46 std::vector<InputTag>
tags = pset.
getParameter<std::vector<InputTag>>(
"input");
48 if (
object ==
"HepMCProduct") {
58 }
else if (
object ==
"SimTrack") {
67 }
else if (
object ==
"SimVertex") {
77 }
else if (
object ==
"PSimHit") {
79 for (
unsigned int ii = 0;
ii < subdets.size();
ii++) {
84 title =
"Time of " + subdets[
ii];
85 name =
"TimeOf" + subdets[
ii];
94 }
else if (
object ==
"PCaloHit") {
96 for (
unsigned int ii = 0;
ii < subdets.size();
ii++) {
101 title =
"Time of " + subdets[
ii];
102 name =
"TimeOf" + subdets[
ii];
119 bool gotHepMCProduct;
123 if (gotHepMCProduct) {
124 std::unique_ptr<MixCollection<HepMCProduct>> hepMCProduct(
199 template <
class T1,
class T2>
201 std::vector<int> theMult(
nbin_);
203 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
204 int bunch = (*theItr_).eventId().bunchCrossing();
206 if (index >= 0 && index <
nbin_) {
209 edm::LogWarning(
"MixCollectionValidation") <<
"fillMultiplicity: bunch number " << bunch <<
" out of range";
218 template <
class T1,
class T2>
220 std::vector<int> theMult(
nbin_);
222 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
223 int bunch = theItr_.bunch();
225 if (index >= 0 && index <
nbin_) {
226 theMult[
index] += (*theItr_).GetEvent()->particles_size();
228 edm::LogWarning(
"MixCollectionValidation") <<
"fillMultiplicity: bunch number " << bunch <<
" out of range";
237 template <
class T1,
class T2>
239 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
240 int bunch = (*theItr_).eventId().bunchCrossing();
241 float time = (*theItr_).timeOfFlight();
243 if (index >= 0 && index <
nbin_) {
244 theProfile_->
Fill(
float(bunch + 0.5), time);
246 edm::LogWarning(
"MixCollectionValidation") <<
"fillSimHitTime: bunch number " << bunch <<
" out of range";
251 template <
class T1,
class T2>
253 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
254 int bunch = (*theItr_).eventId().bunchCrossing();
255 float time = (*theItr_).time();
257 if (index >= 0 && index <
nbin_) {
258 theProfile_->
Fill(
float(bunch + 0.5), time);
260 edm::LogWarning(
"MixCollectionValidation") <<
"fillCaloHitTime: bunch number " << bunch <<
" out of range";
std::map< std::string, MonitorElement * > SimHitNrmap_
std::vector< edm::EDGetTokenT< CrossingFrame< PSimHit > > > crossingFrame_PSimHit_Tokens_
std::map< std::string, MonitorElement * > CaloHitTimemap_
virtual void setCurrentFolder(std::string const &fullpath)
std::vector< edm::InputTag > HepMCProductTags_
MixCollectionValidation(const edm::ParameterSet &)
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< edm::EDGetTokenT< CrossingFrame< PCaloHit > > > crossingFrame_PCaloHit_Tokens_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::map< std::string, MonitorElement * > CaloHitNrmap_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
MonitorElement * nrSimTrackH_
const std::string names[nVars_]
edm::ParameterSet mixObjextsSet_
MonitorElement * nrHepMCProductH_
~MixCollectionValidation() override
void fillCaloHitTime(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
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())
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< std::string > getParameterNames() const
std::vector< edm::InputTag > PCaloHitTags_
std::vector< edm::InputTag > SimTrackTags_
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > crossingFrame_Hep_Token_
T const * product() const
T getParameter(std::string const &) const
std::vector< edm::InputTag > SimVertexTags_
MonitorElement * nrSimVertexH_
Log< level::Warning, false > LogWarning
static const std::string subdets[7]
void analyze(const edm::Event &, const edm::EventSetup &) override
void fillGenParticleMulti(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)