19 #include "boost/bind.hpp" 20 #include <boost/ptr_container/ptr_vector.hpp> 21 #include <boost/foreach.hpp> 96 typedef std::vector<edm::ParameterSet>
VPSet;
99 for ( VPSet::const_iterator builderPSet = builders.begin();
100 builderPSet != builders.end(); ++builderPSet ) {
107 const VPSet& modfiers = pset.
getParameter<VPSet>(
"modifiers");
108 for ( VPSet::const_iterator modfierPSet = modfiers.begin();
109 modfierPSet != modfiers.end(); ++modfierPSet) {
119 if ( pset.
exists(
"outputSelection") ) {
121 if ( !selection.empty() ) {
127 produces<reco::PFTauCollection>();
152 for (BuilderList::iterator builder =
builders_.begin();
154 builder->setup(evt, es);
156 for (ModifierList::iterator modifier =
modifiers_.begin();
158 modifier->setup(evt, es);
162 auto output = std::make_unique<reco::PFTauCollection>();
171 if ( jetRegionRef.
isNull() ) {
173 <<
"No jet region can be found for the current jet: " << jetRef.
id();
176 std::vector<reco::PFCandidatePtr> jetCands = jetRef->getPFConstituents();
177 std::vector<reco::PFCandidatePtr> allRegionalCands = jetRegionRef->getPFConstituents();
179 std::sort(jetCands.begin(), jetCands.end());
180 std::sort(allRegionalCands.begin(), allRegionalCands.end());
182 std::vector<reco::PFCandidatePtr> uniqueRegionalCands;
186 if ( allRegionalCands.size() > jetCands.size() ) {
187 uniqueRegionalCands.reserve(allRegionalCands.size() - jetCands.size());
191 std::set_difference(allRegionalCands.begin(), allRegionalCands.end(),
192 jetCands.begin(), jetCands.end(),
193 std::back_inserter(uniqueRegionalCands));
196 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = (*chargedHadronAssoc)[jetRef];
199 const std::vector<reco::RecoTauPiZero>& piZeros = (*piZeroAssoc)[jetRef];
201 unsigned int nTausBuilt = 0;
202 for ( BuilderList::const_iterator builder =
builders_.begin();
210 output->insert(
output->end(), taus.begin(), taus.end());
211 nTausBuilt += taus.size();
226 reco::PFTau nullTau(std::numeric_limits<int>::quiet_NaN(), jetRef->p4());
228 output->push_back(nullTau);
233 for ( reco::PFTauCollection::iterator
tau =
output->begin();
235 for ( ModifierList::const_iterator modifier =
modifiers_.begin();
241 for ( ModifierList::iterator modifier =
modifiers_.begin();
243 modifier->endEvent();
T getParameter(std::string const &) const
boost::ptr_vector< Modifier > ModifierList
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< reco::CandidateView > jet_token
~RecoTauProducer() override
def create(alignables, pedeDump, additionalData, outputFile, config)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
boost::ptr_vector< reco::PFTau > output_type
ProductID id() const
Accessor for product ID.
void setjetRef(const PFJetRef &)
RecoTauProducer(const edm::ParameterSet &pset)
unique_ptr< JetDefinition::Plugin > plugin
Abs< T >::type abs(const T &t)
edm::InputTag chargedHadronSrc_
bool isNull() const
Checks for null.
void produce(edm::Event &evt, const edm::EventSetup &es) override
edm::EDGetTokenT< reco::JetPiZeroAssociation > piZero_token
reco::tau::RecoTauModifierPlugin Modifier
edm::EDGetTokenT< reco::PFJetChargedHadronAssociation > chargedHadron_token
edm::EDGetTokenT< edm::Association< reco::PFJetCollection > > jetRegion_token
size_type size() const
Size of the RefVector.
reco::tau::RecoTauBuilderPlugin Builder
edm::InputTag jetRegionSrc_
boost::ptr_vector< Builder > BuilderList
T get(const Candidate &c)
std::unique_ptr< StringCutObjectSelector< reco::PFTau > > outputSelector_