19 #include "boost/bind.hpp" 20 #include <boost/ptr_container/ptr_vector.hpp> 99 typedef std::vector<edm::ParameterSet>
VPSet;
102 for ( VPSet::const_iterator builderPSet = builders.begin();
103 builderPSet != builders.end(); ++builderPSet ) {
110 const VPSet& modfiers = pset.
getParameter<VPSet>(
"modifiers");
111 for ( VPSet::const_iterator modfierPSet = modfiers.begin();
112 modfierPSet != modfiers.end(); ++modfierPSet) {
121 if ( !selection.empty() ) {
126 produces<reco::PFTauCollection>();
149 builder->setup(evt, es);
152 modifier->setup(evt, es);
156 auto output = std::make_unique<reco::PFTauCollection>();
160 for (
size_t i_j = 0; i_j < jetView->
size(); ++i_j) {
161 const auto& jetRef = jetView->
refAt(i_j);
166 if ( jetRegionRef.
isNull() ) {
168 <<
"No jet region can be found for the current jet: " << jetRef.id();
171 std::vector<reco::CandidatePtr> jetCands = jetRef->daughterPtrVector();
172 std::vector<reco::CandidatePtr> allRegionalCands = jetRegionRef->daughterPtrVector();
174 std::sort(jetCands.begin(), jetCands.end());
175 std::sort(allRegionalCands.begin(), allRegionalCands.end());
177 std::vector<reco::CandidatePtr> uniqueRegionalCands;
181 if ( allRegionalCands.size() > jetCands.size() ) {
182 uniqueRegionalCands.reserve(allRegionalCands.size() - jetCands.size());
186 std::set_difference(allRegionalCands.begin(), allRegionalCands.end(),
187 jetCands.begin(), jetCands.end(),
188 std::back_inserter(uniqueRegionalCands));
191 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = (*chargedHadronAssoc)[jetRef];
194 const std::vector<reco::RecoTauPiZero>& piZeros = (*piZeroAssoc)[jetRef];
196 unsigned int nTausBuilt = 0;
197 for (
const auto& builder: builders_ ) {
205 output->insert(
output->end(), taus.begin(), taus.end());
206 nTausBuilt += taus.size();
209 for(
auto const&
tau : taus ) {
221 reco::PFTau nullTau(std::numeric_limits<int>::quiet_NaN(), jetRef->p4());
223 output->push_back(nullTau);
228 for ( reco::PFTauCollection::iterator
tau =
output->begin();
230 for (
const auto& modifier: modifiers_ ) {
235 for (
auto& modifier: modifiers_ ) {
236 modifier->endEvent();
249 pset_signalQualityCuts.
add<
double>(
"maxDeltaZ", 0.4);
250 pset_signalQualityCuts.add<
double>(
"minTrackPt", 0.5);
251 pset_signalQualityCuts.add<
double>(
"minTrackVertexWeight", -1.0);
252 pset_signalQualityCuts.add<
double>(
"maxTrackChi2", 100.0);
253 pset_signalQualityCuts.add<
unsigned int>(
"minTrackPixelHits", 0);
254 pset_signalQualityCuts.add<
double>(
"minGammaEt", 1.0);
255 pset_signalQualityCuts.add<
unsigned int>(
"minTrackHits", 3);
256 pset_signalQualityCuts.add<
double>(
"minNeutralHadronEt", 30.0);
257 pset_signalQualityCuts.add<
double>(
"maxTransverseImpactParameter", 0.1);
258 pset_signalQualityCuts.addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
261 pset_vxAssocQualityCuts.
add<
double>(
"minTrackPt", 0.5);
262 pset_vxAssocQualityCuts.add<
double>(
"minTrackVertexWeight", -1.0);
263 pset_vxAssocQualityCuts.add<
double>(
"maxTrackChi2", 100.0);
264 pset_vxAssocQualityCuts.add<
unsigned int>(
"minTrackPixelHits", 0);
265 pset_vxAssocQualityCuts.add<
double>(
"minGammaEt", 1.0);
266 pset_vxAssocQualityCuts.add<
unsigned int>(
"minTrackHits", 3);
267 pset_vxAssocQualityCuts.add<
double>(
"maxTransverseImpactParameter", 0.1);
268 pset_vxAssocQualityCuts.addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
271 pset_isolationQualityCuts.
add<
double>(
"maxDeltaZ", 0.2);
272 pset_isolationQualityCuts.add<
double>(
"minTrackPt", 1.0);
273 pset_isolationQualityCuts.add<
double>(
"minTrackVertexWeight", -1.0);
274 pset_isolationQualityCuts.add<
double>(
"maxTrackChi2", 100.0);
275 pset_isolationQualityCuts.add<
unsigned int>(
"minTrackPixelHits", 0);
276 pset_isolationQualityCuts.add<
double>(
"minGammaEt", 1.5);
277 pset_isolationQualityCuts.add<
unsigned int>(
"minTrackHits", 8);
278 pset_isolationQualityCuts.add<
double>(
"maxTransverseImpactParameter", 0.03);
279 pset_isolationQualityCuts.addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
285 pset_qualityCuts.
add<
std::string>(
"leadingTrkOrPFCandOption",
"leadPFCand");
286 pset_qualityCuts.add<
std::string>(
"pvFindingAlgo",
"closestInDeltaZ");
288 pset_qualityCuts.add<
bool>(
"vertexTrackFiltering",
false);
289 pset_qualityCuts.add<
bool>(
"recoverLeadingTrk",
false);
295 vpsd_modifiers.
add<
int>(
"verbosity", 0);
300 vpsd_modifiers.
addOptional<
double>(
"maximumForElectrionPreIDOutput");
301 vpsd_modifiers.
addOptional<
double>(
"ElecPreIDLeadTkMatch_maxDR");
302 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_minClusEnergy");
303 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_deltaPhiOverQ_minValue");
304 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_deltaPhiOverQ_maxValue");
305 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_deltaEta");
306 vpsd_modifiers.
addOptional<
double>(
"dRaddNeutralHadron");
309 vpsd_modifiers.
addOptional<
double>(
"minNeutralHadronEt");
312 desc.
addVPSet(
"modifiers", vpsd_modifiers);
316 desc.
add<
double>(
"maxJetAbsEta", 2.5);
317 desc.
add<
std::string>(
"outputSelection",
"leadPFChargedHadrCand().isNonnull()");
319 desc.
add<
double>(
"minJetPt", 14.0);
326 desc_builders.
add<
int>(
"verbosity", 0);
331 desc_decayModes.
add<
unsigned int>(
"nPiZeros", 0);
332 desc_decayModes.
add<
unsigned int>(
"maxPiZeros", 0);
333 desc_decayModes.
add<
unsigned int>(
"nCharged", 1);
334 desc_decayModes.
add<
unsigned int>(
"maxTracks", 6);
337 desc_builders.
add<
double>(
"minAbsPhotonSumPt_insideSignalCone", 2.5);
338 desc_builders.
add<
double>(
"minRelPhotonSumPt_insideSignalCone", 0.1);
342 desc_builders.
addOptional<
double>(
"isolationConeSize");
343 desc_builders.
addOptional<
double>(
"minAbsPhotonSumPt_outsideSignalCone");
344 desc_builders.
addOptional<
double>(
"minRelPhotonSumPt_outsideSignalCone");
350 desc_builders.
addOptional<
int>(
"maxSignalConeChargedHadrons");
356 std::vector<edm::ParameterSet> vpset_default;
362 pset_default_builders.
addParameter<
double>(
"minAbsPhotonSumPt_insideSignalCone", 2.5);
363 pset_default_builders.
addParameter<
double>(
"minRelPhotonSumPt_insideSignalCone", 0.1);
365 vpset_default.push_back(pset_default_builders);
367 desc.
addVPSet(
"builders", desc_builders, vpset_default);
371 desc.
add<
bool>(
"buildNullTaus",
false);
372 desc.
add<
int>(
"verbosity", 0);
373 descriptions.
add(
"combinatoricRecoTaus", desc);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
~RecoTauProducer() override
def create(alignables, pedeDump, additionalData, outputFile, config)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
ParameterDescriptionBase * addVPSetOptional(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
edm::EDGetTokenT< reco::JetView > jet_token
boost::ptr_vector< reco::PFTau > output_type
std::vector< std::unique_ptr< Builder > > BuilderList
std::vector< std::unique_ptr< Modifier > > ModifierList
RefToBase< value_type > refAt(size_type i) const
#define DEFINE_FWK_MODULE(type)
RecoTauProducer(const edm::ParameterSet &pset)
void addParameter(std::string const &name, T const &value)
edm::EDGetTokenT< edm::AssociationMap< edm::OneToOne< reco::JetView, reco::JetView > > > jetRegion_token
Abs< T >::type abs(const T &t)
edm::InputTag chargedHadronSrc_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::Event &evt, const edm::EventSetup &es) override
bool isNull() const
Checks for null.
edm::EDGetTokenT< reco::JetPiZeroAssociation > piZero_token
reco::tau::RecoTauModifierPlugin Modifier
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< reco::PFJetChargedHadronAssociation > chargedHadron_token
void setjetRef(const JetBaseRef &)
reco::tau::RecoTauBuilderPlugin Builder
edm::InputTag jetRegionSrc_
T get(const Candidate &c)
std::unique_ptr< StringCutObjectSelector< reco::PFTau > > outputSelector_