5 #ifndef PhysicsTools_PatAlgos_PATJetSelector_h
6 #define PhysicsTools_PatAlgos_PATJetSelector_h
31 src_( params.getParameter<edm::InputTag>(
"src") ),
32 cut_( params.getParameter<std::string>(
"cut") ),
36 produces< std::vector<pat::Jet> >();
37 produces<reco::GenJetCollection> (
"genJets");
38 produces<std::vector<CaloTower> > (
"caloTowers");
39 produces<reco::PFCandidateCollection > (
"pfCandidates");
40 produces<edm::OwnVector<reco::BaseTagInfo> > (
"tagInfos");
42 if ( params.
exists(
"filter") ) {
54 std::auto_ptr< std::vector<Jet> >
patJets (
new std::vector<Jet>() );
57 std::auto_ptr<std::vector<CaloTower> > caloTowersOut(
new std::vector<CaloTower> () );
72 iend = h_jets->
end(), ijet = ibegin;
73 ijet != iend; ++ijet ) {
78 for ( CaloTowerFwdPtrVector::const_iterator itowerBegin = ijet->caloTowersFwdPtr().begin(),
79 itowerEnd = ijet->caloTowersFwdPtr().end(), itower = itowerBegin;
80 itower != itowerEnd; ++itower ) {
82 caloTowersOut->push_back( **itower );
87 for ( reco::PFCandidateFwdPtrVector::const_iterator icandBegin = ijet->pfCandidatesFwdPtr().begin(),
88 icandEnd = ijet->pfCandidatesFwdPtr().end(), icand = icandBegin;
89 icand != icandEnd; ++icand ) {
91 pfCandidatesOut->push_back( **icand );
95 for ( TagInfoFwdPtrCollection::const_iterator iinfoBegin = ijet->tagInfosFwdPtr().begin(),
96 iinfoEnd = ijet->tagInfosFwdPtr().end(), iinfo = iinfoBegin;
97 iinfo != iinfoEnd; ++iinfo ) {
99 tagInfosOut->push_back( **iinfo );
103 if ( ijet->genJet() != 0 ) {
104 genJetsOut->push_back( *(ijet->genJet()) );
121 unsigned int caloTowerIndex = 0;
122 unsigned int pfCandidateIndex = 0;
123 unsigned int tagInfoIndex = 0;
124 unsigned int genJetIndex = 0;
127 iend = h_jets->
end(), ijet = ibegin;
128 ijet != iend; ++ijet ) {
133 patJets->push_back( *ijet );
136 for ( CaloTowerFwdPtrVector::const_iterator itowerBegin = ijet->caloTowersFwdPtr().begin(),
137 itowerEnd = ijet->caloTowersFwdPtr().end(), itower = itowerBegin;
138 itower != itowerEnd; ++itower ) {
143 patJets->back().updateFwdCaloTowerFwdPtr( itower - itowerBegin,
151 for ( reco::PFCandidateFwdPtrVector::const_iterator icandBegin = ijet->pfCandidatesFwdPtr().begin(),
152 icandEnd = ijet->pfCandidatesFwdPtr().end(), icand = icandBegin;
153 icand != icandEnd; ++icand ) {
158 patJets->back().updateFwdPFCandidateFwdPtr( icand - icandBegin,
165 for ( TagInfoFwdPtrCollection::const_iterator iinfoBegin = ijet->tagInfosFwdPtr().begin(),
166 iinfoEnd = ijet->tagInfosFwdPtr().end(), iinfo = iinfoBegin;
167 iinfo != iinfoEnd; ++iinfo ) {
172 patJets->back().updateFwdTagInfoFwdPtr( iinfo - iinfoBegin,
179 if ( ijet->genJet() != 0 ) {
190 bool pass = patJets->size() > 0;
T getParameter(std::string const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
std::vector< GenJet > GenJetCollection
collection of GenJet objects
bool exists(std::string const ¶meterName) const
checks if a parameter exists
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
StringCutObjectSelector< Jet > selector_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
RefProd< PROD > getRefBeforePut()
virtual ~PATJetSelector()
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
virtual bool filter(edm::Event &iEvent, const edm::EventSetup &iSetup)
PATJetSelector(edm::ParameterSet const ¶ms)