From f10217bf6129cf25da74e97900d5bfe5010bbfb5 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 15 Oct 2014 14:55:49 +0200 Subject: [PATCH 1/4] use descriptions add(....) --- RecoPixelVertexing/PixelVertexFinding/src/JetVertexChecker.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoPixelVertexing/PixelVertexFinding/src/JetVertexChecker.cc b/RecoPixelVertexing/PixelVertexFinding/src/JetVertexChecker.cc index c486e558cd90e..345e86207d6e6 100644 --- a/RecoPixelVertexing/PixelVertexFinding/src/JetVertexChecker.cc +++ b/RecoPixelVertexing/PixelVertexFinding/src/JetVertexChecker.cc @@ -184,7 +184,7 @@ JetVertexChecker::fillDescriptions(edm::ConfigurationDescriptions& descriptions) desc.add ("maxChi2",20.0); desc.add ("maxTrackPt",20.0); desc.add ("newMethod",false); // <---- newMethod - descriptions.addDefault(desc); + descriptions.add("jetVertexChecker",desc); } //define this as a plug-in DEFINE_FWK_MODULE(JetVertexChecker); From 4b986a76ad39e6aaaced991fe21c1ed3b6d90f45 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 15 Oct 2014 17:15:19 +0200 Subject: [PATCH 2/4] BuildFile.xml --- .../python/jetVertexChecker_cfi.py | 12 -- .../src/SwitchTrackCollection.cc | 133 ++++++++++++++++++ 2 files changed, 133 insertions(+), 12 deletions(-) delete mode 100644 RecoPixelVertexing/PixelVertexFinding/python/jetVertexChecker_cfi.py create mode 100644 RecoPixelVertexing/PixelVertexFinding/src/SwitchTrackCollection.cc diff --git a/RecoPixelVertexing/PixelVertexFinding/python/jetVertexChecker_cfi.py b/RecoPixelVertexing/PixelVertexFinding/python/jetVertexChecker_cfi.py deleted file mode 100644 index b93f2de26678a..0000000000000 --- a/RecoPixelVertexing/PixelVertexFinding/python/jetVertexChecker_cfi.py +++ /dev/null @@ -1,12 +0,0 @@ -import FWCore.ParameterSet.Config as cms -jetVertexChecker = cms.EDFilter('JetVertexChecker', - jetTracks = cms.InputTag( "hltBLifetimeL25AssociatorHbbFirst" ), - minPt = cms.double( 0 ), - minPtRatio = cms.double( 0.05 ), - doFilter = cms.bool( False ), - beamSpot = cms.InputTag("hltOnlineBeamSpot"), - maxNJetsToCheck = cms.int32(2) -) - - - diff --git a/RecoPixelVertexing/PixelVertexFinding/src/SwitchTrackCollection.cc b/RecoPixelVertexing/PixelVertexFinding/src/SwitchTrackCollection.cc new file mode 100644 index 0000000000000..260fbae6f773d --- /dev/null +++ b/RecoPixelVertexing/PixelVertexFinding/src/SwitchTrackCollection.cc @@ -0,0 +1,133 @@ +// -*- C++ -*- +// +// Package: SwitchTrackCollection +// Class: SwitchTrackCollection +// +/**\class SwitchTrackCollection SwitchTrackCollection.cc RecoBTag/SwitchTrackCollection/src/SwitchTrackCollection.cc + + Description: [one line class summary] + + Implementation: + [Notes on implementation] +*/ +// +// Original Author: Andrea RIZZI +// Created: Mon Jan 16 11:19:48 CET 2012 +// +// + + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDProducer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "FWCore/Utilities/interface/InputTag.h" + +// +// class declaration +// + +class SwitchTrackCollection : public edm::EDProducer { + public: + explicit SwitchTrackCollection(const edm::ParameterSet&); + ~SwitchTrackCollection(); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + private: + virtual void produce(edm::Event&, const edm::EventSetup&); + + // ----------member data --------------------------- + edm::EDGetTokenT > m_track1; + edm::EDGetTokenT > m_track2; + +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +SwitchTrackCollection::SwitchTrackCollection(const edm::ParameterSet& iConfig) +{ + //now do what ever initialization is needed + m_track1 = consumes >(iConfig.getParameter("TrackCollection1")); + m_track2 = consumes >(iConfig.getParameter("TrackCollection2")); + + produces >(); + +// m_beamSpot = consumes(iConfig.getParameter("beamSpot")); +// m_associator = consumes(iConfig.getParameter("jetTracks")); +// m_doFilter = iConfig.getParameter("doFilter"); +// m_cutMinPt = iConfig.getParameter("minPt"); +// m_cutMinPtRatio = iConfig.getParameter("minPtRatio"); +// m_maxNjets = iConfig.getParameter("maxNJetsToCheck"); +// m_newMethod = iConfig.getParameter("newMethod"); +// produces >(); +// produces(); +// produces(); +// produces("ntrks"); +// produces("trkPt"); +} + + +SwitchTrackCollection::~SwitchTrackCollection() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + +} + + +// +// member functions +// + +// ------------ method called on each new Event ------------ +void SwitchTrackCollection::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + using namespace std; + + Handle > tracks1; + iEvent.getByToken(m_track1, tracks1); + + Handle > tracks2; + iEvent.getByToken(m_track2, tracks2); + + std::auto_ptr > pOut(new std::vector ); + + if(tracks2->size()==0) *pOut = *tracks1; + else *pOut = *tracks2; + + iEvent.put(pOut); + +// return true; +} + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void +SwitchTrackCollection::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + //The following says we do not know what parameters are allowed so do no validation + // Please change this to state exactly what you do use, even if it is no parameters + edm::ParameterSetDescription desc; + desc.setUnknown(); + descriptions.addDefault(desc); +} +//define this as a plug-in +DEFINE_FWK_MODULE(SwitchTrackCollection); From 70f58ab5addc7451c182fbaba599d5afb97f8c01 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 15 Oct 2014 17:17:30 +0200 Subject: [PATCH 3/4] BuildFile.xml --- .../src/SwitchTrackCollection.cc | 133 ------------------ 1 file changed, 133 deletions(-) delete mode 100644 RecoPixelVertexing/PixelVertexFinding/src/SwitchTrackCollection.cc diff --git a/RecoPixelVertexing/PixelVertexFinding/src/SwitchTrackCollection.cc b/RecoPixelVertexing/PixelVertexFinding/src/SwitchTrackCollection.cc deleted file mode 100644 index 260fbae6f773d..0000000000000 --- a/RecoPixelVertexing/PixelVertexFinding/src/SwitchTrackCollection.cc +++ /dev/null @@ -1,133 +0,0 @@ -// -*- C++ -*- -// -// Package: SwitchTrackCollection -// Class: SwitchTrackCollection -// -/**\class SwitchTrackCollection SwitchTrackCollection.cc RecoBTag/SwitchTrackCollection/src/SwitchTrackCollection.cc - - Description: [one line class summary] - - Implementation: - [Notes on implementation] -*/ -// -// Original Author: Andrea RIZZI -// Created: Mon Jan 16 11:19:48 CET 2012 -// -// - - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "FWCore/Utilities/interface/InputTag.h" - -// -// class declaration -// - -class SwitchTrackCollection : public edm::EDProducer { - public: - explicit SwitchTrackCollection(const edm::ParameterSet&); - ~SwitchTrackCollection(); - - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - - private: - virtual void produce(edm::Event&, const edm::EventSetup&); - - // ----------member data --------------------------- - edm::EDGetTokenT > m_track1; - edm::EDGetTokenT > m_track2; - -}; - -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - -// -// constructors and destructor -// -SwitchTrackCollection::SwitchTrackCollection(const edm::ParameterSet& iConfig) -{ - //now do what ever initialization is needed - m_track1 = consumes >(iConfig.getParameter("TrackCollection1")); - m_track2 = consumes >(iConfig.getParameter("TrackCollection2")); - - produces >(); - -// m_beamSpot = consumes(iConfig.getParameter("beamSpot")); -// m_associator = consumes(iConfig.getParameter("jetTracks")); -// m_doFilter = iConfig.getParameter("doFilter"); -// m_cutMinPt = iConfig.getParameter("minPt"); -// m_cutMinPtRatio = iConfig.getParameter("minPtRatio"); -// m_maxNjets = iConfig.getParameter("maxNJetsToCheck"); -// m_newMethod = iConfig.getParameter("newMethod"); -// produces >(); -// produces(); -// produces(); -// produces("ntrks"); -// produces("trkPt"); -} - - -SwitchTrackCollection::~SwitchTrackCollection() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - -// ------------ method called on each new Event ------------ -void SwitchTrackCollection::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - using namespace std; - - Handle > tracks1; - iEvent.getByToken(m_track1, tracks1); - - Handle > tracks2; - iEvent.getByToken(m_track2, tracks2); - - std::auto_ptr > pOut(new std::vector ); - - if(tracks2->size()==0) *pOut = *tracks1; - else *pOut = *tracks2; - - iEvent.put(pOut); - -// return true; -} - -// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ -void -SwitchTrackCollection::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - //The following says we do not know what parameters are allowed so do no validation - // Please change this to state exactly what you do use, even if it is no parameters - edm::ParameterSetDescription desc; - desc.setUnknown(); - descriptions.addDefault(desc); -} -//define this as a plug-in -DEFINE_FWK_MODULE(SwitchTrackCollection); From 5eb060eb98e518b79159dfd8ab104ff6765f8d6a Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 15 Oct 2014 17:27:00 +0200 Subject: [PATCH 4/4] BuildFile.xml --- RecoPixelVertexing/PixelVertexFinding/src/JetVertexChecker.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/RecoPixelVertexing/PixelVertexFinding/src/JetVertexChecker.cc b/RecoPixelVertexing/PixelVertexFinding/src/JetVertexChecker.cc index 345e86207d6e6..fb6719e416174 100644 --- a/RecoPixelVertexing/PixelVertexFinding/src/JetVertexChecker.cc +++ b/RecoPixelVertexing/PixelVertexFinding/src/JetVertexChecker.cc @@ -171,8 +171,6 @@ JetVertexChecker::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void JetVertexChecker::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { -//The following says we do not know what parameters are allowed so do no validation -// Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; desc.add ("beamSpot",edm::InputTag("hltOnlineBeamSpot")); desc.add ("jetTracks",edm::InputTag("hltFastPVJetTracksAssociator"));