23 : minbunch_(iConfig.getParameter<
int>(
"minBunch")),
24 maxbunch_(iConfig.getParameter<
int>(
"maxBunch")),
25 verbose_(iConfig.getUntrackedParameter<
bool>(
"verbose",
false)),
26 nbin_(maxbunch_ - minbunch_ + 1) {
43 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
48 std::vector<InputTag> tags = pset.
getParameter<std::vector<InputTag>>(
"input");
50 if (
object ==
"HepMCProduct") {
60 }
else if (
object ==
"SimTrack") {
69 }
else if (
object ==
"SimVertex") {
79 }
else if (
object ==
"PSimHit") {
81 for (
unsigned int ii = 0;
ii < subdets.size();
ii++) {
86 title =
"Time of " + subdets[
ii];
87 name =
"TimeOf" + subdets[
ii];
96 }
else if (
object ==
"PCaloHit") {
98 for (
unsigned int ii = 0;
ii < subdets.size();
ii++) {
103 title =
"Time of " + subdets[
ii];
104 name =
"TimeOf" + subdets[
ii];
121 bool gotHepMCProduct;
125 if (gotHepMCProduct) {
126 std::unique_ptr<MixCollection<HepMCProduct>> hepMCProduct(
201 template <
class T1,
class T2>
203 std::vector<int> theMult(
nbin_);
205 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
206 int bunch = (*theItr_).eventId().bunchCrossing();
208 if (index >= 0 && index <
nbin_) {
211 edm::LogWarning(
"MixCollectionValidation") <<
"fillMultiplicity: bunch number " << bunch <<
" out of range";
220 template <
class T1,
class T2>
222 std::vector<int> theMult(
nbin_);
224 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
225 int bunch = theItr_.bunch();
227 if (index >= 0 && index <
nbin_) {
228 theMult[
index] += (*theItr_).GetEvent()->particles_size();
230 edm::LogWarning(
"MixCollectionValidation") <<
"fillMultiplicity: bunch number " << bunch <<
" out of range";
239 template <
class T1,
class T2>
241 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
242 int bunch = (*theItr_).eventId().bunchCrossing();
243 float time = (*theItr_).timeOfFlight();
245 if (index >= 0 && index <
nbin_) {
246 theProfile_->
Fill(
float(bunch + 0.5), time);
248 edm::LogWarning(
"MixCollectionValidation") <<
"fillSimHitTime: bunch number " << bunch <<
" out of range";
253 template <
class T1,
class T2>
255 for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) {
256 int bunch = (*theItr_).eventId().bunchCrossing();
257 float time = (*theItr_).time();
259 if (index >= 0 && index <
nbin_) {
260 theProfile_->
Fill(
float(bunch + 0.5), time);
262 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_
MonitorElement * bookProfile(Args &&...args)
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_
void setCurrentFolder(std::string const &fullpath)
~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_)
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_)