23 minbunch_(iConfig.getParameter<
int>(
"minBunch")),
24 maxbunch_(iConfig.getParameter<
int>(
"maxBunch")),
25 verbose_(iConfig.getUntrackedParameter<
bool>(
"verbose",
false)),
26 nbin_(maxbunch_-minbunch_+1)
44 for (std::vector<std::string>::iterator it = names.begin();it!= names.end();++it)
47 if (!pset.
exists(
"type"))
continue;
49 std::vector<InputTag> tags = pset.
getParameter<std::vector<InputTag> >(
"input");
51 if (
object ==
"HepMCProduct" ) {
63 else if (
object ==
"SimTrack" ) {
75 else if (
object ==
"SimVertex" ) {
87 else if (
object ==
"PSimHit" ) {
89 for (
unsigned int ii=0;
ii<subdets.size();
ii++) {
95 title =
"Time of " + subdets[
ii];
96 name =
"TimeOf" + subdets[
ii];
106 else if (
object ==
"PCaloHit" ) {
108 for (
unsigned int ii=0;
ii<subdets.size();
ii++) {
114 title =
"Time of " + subdets[
ii];
115 name =
"TimeOf" + subdets[
ii];
133 bool gotHepMCProduct;
137 if (gotHepMCProduct){
138 std::auto_ptr<MixCollection<HepMCProduct> >
152 std::auto_ptr<MixCollection<SimTrack> >
167 std::auto_ptr<MixCollection<SimVertex> >
184 std::auto_ptr<MixCollection<PSimHit> >
206 std::auto_ptr<MixCollection<PCaloHit> >
222 std::vector<int> theMult(
nbin_);
224 for ( theItr_ = theColl_->begin() ; theItr_ != theColl_->end() ; ++theItr_) {
226 int bunch = (*theItr_).eventId().bunchCrossing();
228 if ( index >= 0 && index <
nbin_ ) { theMult[
index] += 1; }
229 else {
edm::LogWarning(
"MixCollectionValidation") <<
"fillMultiplicity: bunch number " << bunch <<
" out of range"; }
241 std::vector<int> theMult(
nbin_);
243 for ( theItr_ = theColl_->begin() ; theItr_ != theColl_->end() ; ++theItr_) {
245 int bunch = theItr_.bunch();
247 if ( index >= 0 && index <
nbin_ ) { theMult[
index] += (*theItr_).GetEvent()->particles_size(); }
248 else {
edm::LogWarning(
"MixCollectionValidation") <<
"fillMultiplicity: bunch number " << bunch <<
" out of range"; }
259 for ( theItr_ = theColl_->begin() ; theItr_ != theColl_->end() ; ++theItr_) {
261 int bunch = (*theItr_).eventId().bunchCrossing();
262 float time = (*theItr_).timeOfFlight();
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"; }
273 for ( theItr_ = theColl_->begin() ; theItr_ != theColl_->end() ; ++theItr_) {
275 int bunch = (*theItr_).eventId().bunchCrossing();
276 float time = (*theItr_).time();
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"; }
T getParameter(std::string const &) const
std::map< std::string, MonitorElement * > CaloHitNrmap_
std::vector< edm::EDGetTokenT< CrossingFrame< PCaloHit > > > crossingFrame_PCaloHit_Tokens_
std::vector< edm::InputTag > HepMCProductTags_
MonitorElement * bookProfile(Args &&...args)
MixCollectionValidation(const edm::ParameterSet &)
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< edm::EDGetTokenT< CrossingFrame< PSimHit > > > crossingFrame_PSimHit_Tokens_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
MonitorElement * nrSimTrackH_
std::map< std::string, MonitorElement * > SimHitTimemap_
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_)
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< std::string > getParameterNames() const
std::vector< edm::InputTag > PCaloHitTags_
std::vector< edm::InputTag > SimTrackTags_
void setCurrentFolder(const std::string &fullpath)
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > crossingFrame_Hep_Token_
T const * product() const
std::vector< edm::InputTag > SimVertexTags_
std::map< std::string, MonitorElement * > CaloHitTimemap_
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_)