4 #ifndef PhysicsTools_PatAlgos_PATJetSelector_h
5 #define PhysicsTools_PatAlgos_PATJetSelector_h
30 cut_( params.getParameter<std::
string>(
"cut") ),
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 std::auto_ptr< std::vector<Jet> >
patJets (
new std::vector<Jet>() );
51 std::auto_ptr<std::vector<CaloTower> > caloTowersOut(
new std::vector<CaloTower> () );
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 ) {
127 patJets->push_back( *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_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< GenJet > GenJetCollection
collection of GenJet objects
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
RefProd< PROD > getRefBeforePut()
virtual ~PATJetSelector()
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
const edm::EDGetTokenT< edm::View< pat::Jet > > srcToken_
PATJetSelector(edm::ParameterSet const ¶ms)