96 typedef std::vector<edm::ParameterSet>
VPSet;
99 for (VPSet::const_iterator builderPSet =
builders.begin(); builderPSet !=
builders.end(); ++builderPSet) {
107 for (VPSet::const_iterator modfierPSet = modfiers.begin(); modfierPSet != modfiers.end(); ++modfierPSet) {
121 produces<reco::PFTauCollection>();
143 builder->setup(evt, es);
146 modifier->setup(evt, es);
150 auto output = std::make_unique<reco::PFTauCollection>();
154 for (
size_t i_j = 0; i_j < jetView->
size(); ++i_j) {
155 const auto& jetRef = jetView->
refAt(i_j);
162 if (jetRegionRef.
isNull()) {
163 throw cms::Exception(
"BadJetRegionRef") <<
"No jet region can be found for the current jet: " << jetRef.id();
166 std::vector<reco::CandidatePtr> jetCands = jetRef->daughterPtrVector();
167 std::vector<reco::CandidatePtr> allRegionalCands = jetRegionRef->daughterPtrVector();
169 std::sort(jetCands.begin(), jetCands.end());
170 std::sort(allRegionalCands.begin(), allRegionalCands.end());
172 std::vector<reco::CandidatePtr> uniqueRegionalCands;
176 if (allRegionalCands.size() > jetCands.size()) {
177 uniqueRegionalCands.reserve(allRegionalCands.size() - jetCands.size());
182 allRegionalCands.end(),
185 std::back_inserter(uniqueRegionalCands));
188 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = (*chargedHadronAssoc)[jetRef];
191 const std::vector<reco::RecoTauPiZero>& piZeros = (*piZeroAssoc)[jetRef];
193 unsigned int nTausBuilt = 0;
197 (*builder)(jetRef, chargedHadrons, piZeros, uniqueRegionalCands));
206 nTausBuilt +=
taus.size();
221 reco::PFTau nullTau(std::numeric_limits<int>::quiet_NaN(), jetRef->p4());
223 output->push_back(nullTau);
235 modifier->endEvent();
253 vpsd_modifiers.
add<
int>(
"verbosity", 0);
258 vpsd_modifiers.
addOptional<
double>(
"maximumForElectrionPreIDOutput");
259 vpsd_modifiers.
addOptional<
double>(
"ElecPreIDLeadTkMatch_maxDR");
260 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_minClusEnergy");
261 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_deltaPhiOverQ_minValue");
262 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_deltaPhiOverQ_maxValue");
263 vpsd_modifiers.
addOptional<
double>(
"EcalStripSumE_deltaEta");
264 vpsd_modifiers.
addOptional<
double>(
"dRaddNeutralHadron");
267 vpsd_modifiers.
addOptional<
double>(
"minNeutralHadronEt");
271 desc.addVPSet(
"modifiers", vpsd_modifiers);
275 desc.add<
double>(
"maxJetAbsEta", 2.5);
276 desc.add<
std::string>(
"outputSelection",
"leadPFChargedHadrCand().isNonnull()");
278 desc.add<
double>(
"minJetPt", 14.0);
285 desc_builders.
add<
int>(
"verbosity", 0);
290 desc_decayModes.
add<
unsigned int>(
"nPiZeros", 0);
291 desc_decayModes.
add<
unsigned int>(
"maxPiZeros", 0);
292 desc_decayModes.
add<
unsigned int>(
"nCharged", 1);
293 desc_decayModes.
add<
unsigned int>(
"maxTracks", 6);
296 desc_builders.
add<
double>(
"minAbsPhotonSumPt_insideSignalCone", 2.5);
297 desc_builders.
add<
double>(
"minRelPhotonSumPt_insideSignalCone", 0.1);
301 desc_builders.
addOptional<
double>(
"isolationConeSize");
302 desc_builders.
addOptional<
double>(
"minAbsPhotonSumPt_outsideSignalCone");
303 desc_builders.
addOptional<
double>(
"minRelPhotonSumPt_outsideSignalCone");
309 desc_builders.
addOptional<
int>(
"maxSignalConeChargedHadrons");
315 std::vector<edm::ParameterSet> vpset_default;
320 pset_default_builders.
addParameter<
int>(
"verbosity", 0);
321 pset_default_builders.
addParameter<
double>(
"minAbsPhotonSumPt_insideSignalCone", 2.5);
322 pset_default_builders.
addParameter<
double>(
"minRelPhotonSumPt_insideSignalCone", 0.1);
324 vpset_default.push_back(pset_default_builders);
326 desc.addVPSet(
"builders", desc_builders, vpset_default);
329 desc.add<
bool>(
"buildNullTaus",
false);
330 desc.add<
int>(
"verbosity", 0);
331 descriptions.
add(
"combinatoricRecoTaus",
desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
RefToBase< value_type > refAt(size_type i) const
std::vector< std::unique_ptr< reco::PFTau > > output_type
~RecoTauProducer() override
static void fillDescriptions(edm::ParameterSetDescription &descriptions)
Declare all parameters read from python config file.
def create(alignables, pedeDump, additionalData, outputFile, config)
ParameterDescriptionBase * addVPSetOptional(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
edm::EDGetTokenT< reco::JetView > jet_token
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::unique_ptr< Builder > > BuilderList
std::vector< std::unique_ptr< Modifier > > ModifierList
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)
#define DEFINE_FWK_MODULE(type)
edm::InputTag chargedHadronSrc_
bool isNull() const
Checks for null.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::Event &evt, const edm::EventSetup &es) override
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_