4 #ifndef PhysicsTools_PatAlgos_PATJetSelector_h 5 #define PhysicsTools_PatAlgos_PATJetSelector_h 31 filter_( params.exists(
"filter") ? params.getParameter<bool>(
"filter") :
false ),
34 produces< std::vector<pat::Jet> >();
35 produces<reco::GenJetCollection> (
"genJets");
36 produces<std::vector<CaloTower> > (
"caloTowers");
37 produces<reco::PFCandidateCollection > (
"pfCandidates");
38 produces<edm::OwnVector<reco::BaseTagInfo> > (
"tagInfos");
48 auto patJets = std::make_unique<std::vector<Jet>>();
50 auto genJetsOut = std::make_unique<reco::GenJetCollection>();
51 auto caloTowersOut = std::make_unique<std::vector<CaloTower> >();
52 auto pfCandidatesOut = std::make_unique<reco::PFCandidateCollection>();
53 auto tagInfosOut = std::make_unique<edm::OwnVector<reco::BaseTagInfo>>();
66 iend = h_jets->
end(), ijet = ibegin;
67 ijet != iend; ++ijet ) {
72 for ( CaloTowerFwdPtrVector::const_iterator itowerBegin = ijet->caloTowersFwdPtr().begin(),
73 itowerEnd = ijet->caloTowersFwdPtr().end(), itower = itowerBegin;
74 itower != itowerEnd; ++itower ) {
76 caloTowersOut->push_back( **itower );
81 for ( reco::PFCandidateFwdPtrVector::const_iterator icandBegin = ijet->pfCandidatesFwdPtr().begin(),
82 icandEnd = ijet->pfCandidatesFwdPtr().end(), icand = icandBegin;
83 icand != icandEnd; ++icand ) {
85 pfCandidatesOut->push_back( **icand );
89 for ( TagInfoFwdPtrCollection::const_iterator iinfoBegin = ijet->tagInfosFwdPtr().begin(),
90 iinfoEnd = ijet->tagInfosFwdPtr().end(), iinfo = iinfoBegin;
91 iinfo != iinfoEnd; ++iinfo ) {
93 tagInfosOut->push_back( **iinfo );
97 if ( ijet->genJet() != 0 ) {
98 genJetsOut->push_back( *(ijet->genJet()) );
115 unsigned int caloTowerIndex = 0;
116 unsigned int pfCandidateIndex = 0;
117 unsigned int tagInfoIndex = 0;
118 unsigned int genJetIndex = 0;
121 iend = h_jets->
end(), ijet = ibegin;
122 ijet != iend; ++ijet ) {
130 for ( CaloTowerFwdPtrVector::const_iterator itowerBegin = ijet->caloTowersFwdPtr().begin(),
131 itowerEnd = ijet->caloTowersFwdPtr().end(), itower = itowerBegin;
132 itower != itowerEnd; ++itower ) {
137 patJets->back().updateFwdCaloTowerFwdPtr( itower - itowerBegin,
145 for ( reco::PFCandidateFwdPtrVector::const_iterator icandBegin = ijet->pfCandidatesFwdPtr().begin(),
146 icandEnd = ijet->pfCandidatesFwdPtr().end(), icand = icandBegin;
147 icand != icandEnd; ++icand ) {
152 patJets->back().updateFwdPFCandidateFwdPtr( icand - icandBegin,
159 for ( TagInfoFwdPtrCollection::const_iterator iinfoBegin = ijet->tagInfosFwdPtr().begin(),
160 iinfoEnd = ijet->tagInfosFwdPtr().end(), iinfo = iinfoBegin;
161 iinfo != iinfoEnd; ++iinfo ) {
166 patJets->back().updateFwdTagInfoFwdPtr( iinfo - iinfoBegin,
173 if ( ijet->genJet() != 0 ) {
184 bool pass =
patJets->size() > 0;
const StringCutObjectSelector< Jet > selector_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< GenJet > GenJetCollection
collection of GenJet objects
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
virtual bool filter(edm::Event &iEvent, const edm::EventSetup &iSetup) override
RefProd< PROD > getRefBeforePut()
virtual ~PATJetSelector()
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const edm::EDGetTokenT< edm::View< pat::Jet > > srcToken_
PATJetSelector(edm::ParameterSet const ¶ms)