4 #ifndef PhysicsTools_PatAlgos_PATJetSelector_h
5 #define PhysicsTools_PatAlgos_PATJetSelector_h
31 cut_( params.getParameter<std::
string>(
"cut") ),
35 produces< std::vector<pat::Jet> >();
36 produces<reco::GenJetCollection> (
"genJets");
37 produces<std::vector<CaloTower> > (
"caloTowers");
38 produces<reco::PFCandidateCollection > (
"pfCandidates");
39 produces<edm::OwnVector<reco::BaseTagInfo> > (
"tagInfos");
41 if ( params.
exists(
"filter") ) {
53 std::auto_ptr< std::vector<Jet> >
patJets (
new std::vector<Jet>() );
56 std::auto_ptr<std::vector<CaloTower> > caloTowersOut(
new std::vector<CaloTower> () );
71 iend = h_jets->
end(), ijet = ibegin;
72 ijet != iend; ++ijet ) {
77 for ( CaloTowerFwdPtrVector::const_iterator itowerBegin = ijet->caloTowersFwdPtr().begin(),
78 itowerEnd = ijet->caloTowersFwdPtr().end(), itower = itowerBegin;
79 itower != itowerEnd; ++itower ) {
81 caloTowersOut->push_back( **itower );
86 for ( reco::PFCandidateFwdPtrVector::const_iterator icandBegin = ijet->pfCandidatesFwdPtr().begin(),
87 icandEnd = ijet->pfCandidatesFwdPtr().end(), icand = icandBegin;
88 icand != icandEnd; ++icand ) {
90 pfCandidatesOut->push_back( **icand );
94 for ( TagInfoFwdPtrCollection::const_iterator iinfoBegin = ijet->tagInfosFwdPtr().begin(),
95 iinfoEnd = ijet->tagInfosFwdPtr().end(), iinfo = iinfoBegin;
96 iinfo != iinfoEnd; ++iinfo ) {
98 tagInfosOut->push_back( **iinfo );
102 if ( ijet->genJet() != 0 ) {
103 genJetsOut->push_back( *(ijet->genJet()) );
120 unsigned int caloTowerIndex = 0;
121 unsigned int pfCandidateIndex = 0;
122 unsigned int tagInfoIndex = 0;
123 unsigned int genJetIndex = 0;
126 iend = h_jets->
end(), ijet = ibegin;
127 ijet != iend; ++ijet ) {
132 patJets->push_back( *ijet );
135 for ( CaloTowerFwdPtrVector::const_iterator itowerBegin = ijet->caloTowersFwdPtr().begin(),
136 itowerEnd = ijet->caloTowersFwdPtr().end(), itower = itowerBegin;
137 itower != itowerEnd; ++itower ) {
142 patJets->back().updateFwdCaloTowerFwdPtr( itower - itowerBegin,
150 for ( reco::PFCandidateFwdPtrVector::const_iterator icandBegin = ijet->pfCandidatesFwdPtr().begin(),
151 icandEnd = ijet->pfCandidatesFwdPtr().end(), icand = icandBegin;
152 icand != icandEnd; ++icand ) {
157 patJets->back().updateFwdPFCandidateFwdPtr( icand - icandBegin,
164 for ( TagInfoFwdPtrCollection::const_iterator iinfoBegin = ijet->tagInfosFwdPtr().begin(),
165 iinfoEnd = ijet->tagInfosFwdPtr().end(), iinfo = iinfoBegin;
166 iinfo != iinfoEnd; ++iinfo ) {
171 patJets->back().updateFwdTagInfoFwdPtr( iinfo - iinfoBegin,
178 if ( ijet->genJet() != 0 ) {
189 bool pass = patJets->size() > 0;
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< GenJet > GenJetCollection
collection of GenJet objects
bool exists(std::string const ¶meterName) const
checks if a parameter exists
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual bool filter(edm::Event &iEvent, const edm::EventSetup &iSetup) override
StringCutObjectSelector< Jet > selector_
RefProd< PROD > getRefBeforePut()
virtual ~PATJetSelector()
edm::EDGetTokenT< edm::View< pat::Jet > > srcToken_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Analysis-level calorimeter jet class.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
volatile std::atomic< bool > shutdown_flag false
PATJetSelector(edm::ParameterSet const ¶ms)