19 #include "boost/bind.hpp" 20 #include <boost/ptr_container/ptr_vector.hpp> 97 typedef std::vector<edm::ParameterSet>
VPSet;
100 for (VPSet::const_iterator builderPSet = builders.begin(); builderPSet != builders.end(); ++builderPSet) {
107 const VPSet& modfiers = pset.
getParameter<VPSet>(
"modifiers");
108 for (VPSet::const_iterator modfierPSet = modfiers.begin(); modfierPSet != modfiers.end(); ++modfierPSet) {
117 if (!selection.empty()) {
122 produces<reco::PFTauCollection>();
144 builder->setup(evt, es);
147 modifier->setup(evt, es);
151 auto output = std::make_unique<reco::PFTauCollection>();
155 for (
size_t i_j = 0; i_j < jetView->
size(); ++i_j) {
156 const auto& jetRef = jetView->
refAt(i_j);
163 if (jetRegionRef.
isNull()) {
164 throw cms::Exception(
"BadJetRegionRef") <<
"No jet region can be found for the current jet: " << jetRef.id();
167 std::vector<reco::CandidatePtr> jetCands = jetRef->daughterPtrVector();
168 std::vector<reco::CandidatePtr> allRegionalCands = jetRegionRef->daughterPtrVector();
170 std::sort(jetCands.begin(), jetCands.end());
171 std::sort(allRegionalCands.begin(), allRegionalCands.end());
173 std::vector<reco::CandidatePtr> uniqueRegionalCands;
177 if (allRegionalCands.size() > jetCands.size()) {
178 uniqueRegionalCands.reserve(allRegionalCands.size() - jetCands.size());
182 std::set_difference(allRegionalCands.begin(),
183 allRegionalCands.end(),
186 std::back_inserter(uniqueRegionalCands));
189 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = (*chargedHadronAssoc)[jetRef];
192 const std::vector<reco::RecoTauPiZero>& piZeros = (*piZeroAssoc)[jetRef];
194 unsigned int nTausBuilt = 0;
195 for (
const auto& builder : builders_) {
198 (*builder)(jetRef, chargedHadrons, piZeros, uniqueRegionalCands));
204 output->insert(
output->end(), taus.begin(), taus.end());
205 nTausBuilt += taus.size();
208 for (
auto const&
tau : taus) {
220 reco::PFTau nullTau(std::numeric_limits<int>::quiet_NaN(), jetRef->p4());
222 output->push_back(nullTau);
228 for (
const auto& modifier : modifiers_) {
233 for (
auto& modifier : modifiers_) {
234 modifier->endEvent();
246 pset_signalQualityCuts.
add<
double>(
"maxDeltaZ", 0.4);
247 pset_signalQualityCuts.add<
double>(
"minTrackPt", 0.5);
248 pset_signalQualityCuts.add<
double>(
"minTrackVertexWeight", -1.0);
249 pset_signalQualityCuts.add<
double>(
"maxTrackChi2", 100.0);
250 pset_signalQualityCuts.add<
unsigned int>(
"minTrackPixelHits", 0);
251 pset_signalQualityCuts.add<
double>(
"minGammaEt", 1.0);
252 pset_signalQualityCuts.add<
unsigned int>(
"minTrackHits", 3);
253 pset_signalQualityCuts.add<
double>(
"minNeutralHadronEt", 30.0);
254 pset_signalQualityCuts.add<
double>(
"maxTransverseImpactParameter", 0.1);
255 pset_signalQualityCuts.addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
258 pset_vxAssocQualityCuts.
add<
double>(
"minTrackPt", 0.5);
259 pset_vxAssocQualityCuts.add<
double>(
"minTrackVertexWeight", -1.0);
260 pset_vxAssocQualityCuts.add<
double>(
"maxTrackChi2", 100.0);
261 pset_vxAssocQualityCuts.add<
unsigned int>(
"minTrackPixelHits", 0);
262 pset_vxAssocQualityCuts.add<
double>(
"minGammaEt", 1.0);
263 pset_vxAssocQualityCuts.add<
unsigned int>(
"minTrackHits", 3);
264 pset_vxAssocQualityCuts.add<
double>(
"maxTransverseImpactParameter", 0.1);
265 pset_vxAssocQualityCuts.addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
268 pset_isolationQualityCuts.
add<
double>(
"maxDeltaZ", 0.2);
269 pset_isolationQualityCuts.add<
double>(
"minTrackPt", 1.0);
270 pset_isolationQualityCuts.add<
double>(
"minTrackVertexWeight", -1.0);
271 pset_isolationQualityCuts.add<
double>(
"maxTrackChi2", 100.0);
272 pset_isolationQualityCuts.add<
unsigned int>(
"minTrackPixelHits", 0);
273 pset_isolationQualityCuts.add<
double>(
"minGammaEt", 1.5);
274 pset_isolationQualityCuts.add<
unsigned int>(
"minTrackHits", 8);
275 pset_isolationQualityCuts.add<
double>(
"maxTransverseImpactParameter", 0.03);
276 pset_isolationQualityCuts.addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
282 pset_qualityCuts.
add<
std::string>(
"leadingTrkOrPFCandOption",
"leadPFCand");
283 pset_qualityCuts.add<
std::string>(
"pvFindingAlgo",
"closestInDeltaZ");
285 pset_qualityCuts.add<
bool>(
"vertexTrackFiltering",
false);
286 pset_qualityCuts.add<
bool>(
"recoverLeadingTrk",
false);
292 vpsd_modifiers.
add<
int>(
"verbosity", 0);
297 vpsd_modifiers.
addOptional<
double>(
"maximumForElectrionPreIDOutput");
298 vpsd_modifiers.
addOptional<
double>(
"ElecPreIDLeadTkMatch_maxDR");
299 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_minClusEnergy");
300 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_deltaPhiOverQ_minValue");
301 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_deltaPhiOverQ_maxValue");
302 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_deltaEta");
303 vpsd_modifiers.
addOptional<
double>(
"dRaddNeutralHadron");
306 vpsd_modifiers.
addOptional<
double>(
"minNeutralHadronEt");
309 desc.
addVPSet(
"modifiers", vpsd_modifiers);
313 desc.
add<
double>(
"maxJetAbsEta", 2.5);
314 desc.
add<
std::string>(
"outputSelection",
"leadPFChargedHadrCand().isNonnull()");
316 desc.
add<
double>(
"minJetPt", 14.0);
323 desc_builders.
add<
int>(
"verbosity", 0);
328 desc_decayModes.
add<
unsigned int>(
"nPiZeros", 0);
329 desc_decayModes.
add<
unsigned int>(
"maxPiZeros", 0);
330 desc_decayModes.
add<
unsigned int>(
"nCharged", 1);
331 desc_decayModes.
add<
unsigned int>(
"maxTracks", 6);
334 desc_builders.
add<
double>(
"minAbsPhotonSumPt_insideSignalCone", 2.5);
335 desc_builders.
add<
double>(
"minRelPhotonSumPt_insideSignalCone", 0.1);
339 desc_builders.
addOptional<
double>(
"isolationConeSize");
340 desc_builders.
addOptional<
double>(
"minAbsPhotonSumPt_outsideSignalCone");
341 desc_builders.
addOptional<
double>(
"minRelPhotonSumPt_outsideSignalCone");
347 desc_builders.
addOptional<
int>(
"maxSignalConeChargedHadrons");
353 std::vector<edm::ParameterSet> vpset_default;
358 pset_default_builders.
addParameter<
int>(
"verbosity", 0);
359 pset_default_builders.
addParameter<
double>(
"minAbsPhotonSumPt_insideSignalCone", 2.5);
360 pset_default_builders.
addParameter<
double>(
"minRelPhotonSumPt_insideSignalCone", 0.1);
362 vpset_default.push_back(pset_default_builders);
364 desc.
addVPSet(
"builders", desc_builders, vpset_default);
367 desc.
add<
bool>(
"buildNullTaus",
false);
368 desc.
add<
int>(
"verbosity", 0);
369 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_
std::unique_ptr< StringCutObjectSelector< reco::PFTau > > outputSelector_