22 : minbunch_(iConfig.getParameter<
int>(
"minBunch")),
23 maxbunch_(iConfig.getParameter<
int>(
"maxBunch")),
24 verbose_(iConfig.getUntrackedParameter<
bool>(
"verbose",
false)),
25 nbin_(maxbunch_ - minbunch_ + 1) {
42 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
47 std::vector<InputTag>
tags = pset.
getParameter<std::vector<InputTag>>(
"input");
49 if (
object ==
"HepMCProduct") {
59 }
else if (
object ==
"SimTrack") {
68 }
else if (
object ==
"SimVertex") {
78 }
else if (
object ==
"PSimHit") {
80 for (
unsigned int ii = 0;
ii < subdets.size();
ii++) {
85 title =
"Time of " + subdets[
ii];
86 name =
"TimeOf" + subdets[
ii];
95 }
else if (
object ==
"PCaloHit") {
97 for (
unsigned int ii = 0;
ii < subdets.size();
ii++) {
102 title =
"Time of " + subdets[
ii];
103 name =
"TimeOf" + subdets[
ii];
120 bool gotHepMCProduct;
124 if (gotHepMCProduct) {
125 std::unique_ptr<MixCollection<HepMCProduct>> hepMCProduct(
200 template <
class T1,
class T2>
202 std::vector<int> theMult(
nbin_);
204 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
205 int bunch = (*theItr_).eventId().bunchCrossing();
207 if (index >= 0 && index <
nbin_) {
210 edm::LogWarning(
"MixCollectionValidation") <<
"fillMultiplicity: bunch number " << bunch <<
" out of range";
219 template <
class T1,
class T2>
221 std::vector<int> theMult(
nbin_);
223 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
224 int bunch = theItr_.bunch();
226 if (index >= 0 && index <
nbin_) {
227 theMult[
index] += (*theItr_).GetEvent()->particles_size();
229 edm::LogWarning(
"MixCollectionValidation") <<
"fillMultiplicity: bunch number " << bunch <<
" out of range";
238 template <
class T1,
class T2>
240 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
241 int bunch = (*theItr_).eventId().bunchCrossing();
242 float time = (*theItr_).timeOfFlight();
244 if (index >= 0 && index <
nbin_) {
245 theProfile_->
Fill(
float(bunch + 0.5), time);
247 edm::LogWarning(
"MixCollectionValidation") <<
"fillSimHitTime: bunch number " << bunch <<
" out of range";
252 template <
class T1,
class T2>
254 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
255 int bunch = (*theItr_).eventId().bunchCrossing();
256 float time = (*theItr_).time();
258 if (index >= 0 && index <
nbin_) {
259 theProfile_->
Fill(
float(bunch + 0.5), time);
261 edm::LogWarning(
"MixCollectionValidation") <<
"fillCaloHitTime: bunch number " << bunch <<
" out of range";
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_
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
void setCurrentFolder(std::string const &fullpath)
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_]
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::ParameterSet mixObjextsSet_
MonitorElement * nrHepMCProductH_
~MixCollectionValidation() override
void fillCaloHitTime(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
edm::EDGetTokenT< CrossingFrame< SimVertex > > crossingFrame_SimVtx_Token_
void fillMultiplicity(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
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
std::vector< edm::InputTag > SimVertexTags_
MonitorElement * nrSimVertexH_
static const std::string subdets[7]
void analyze(const edm::Event &, const edm::EventSetup &) override
void fillGenParticleMulti(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_)