31 useUserData_(iConfig.exists(
"userData"))
80 "PATTauProducer: you can't specify both 'tauIDSource' and 'tauIDSources'\n";
84 for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
90 "PATTauProducer: id addTauID is true, you must specify either:\n" <<
91 "\tInputTag tauIDSource = <someTag>\n" <<
"or\n" <<
92 "\tPSet tauIDSources = { \n" <<
93 "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
98 if (iConfig.
exists(
"isoDeposits")) {
108 if ( depconf.
exists(
"user") ) {
109 std::vector<edm::InputTag> userdeps = depconf.
getParameter<std::vector<edm::InputTag> >(
"user");
110 std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
112 for ( ; it != ed; ++it, ++
key) {
136 produces<std::vector<Tau> >();
150 edm::LogWarning(
"DataSource") <<
"WARNING! No Tau collection found. This missing input will not block the job. Instead, an empty tau collection is being be produced.";
151 std::auto_ptr<std::vector<Tau> >
patTaus(
new std::vector<Tau>());
167 std::vector<edm::Handle<edm::ValueMap<IsoDeposit> > > deposits(
isoDepositLabels_.size());
168 for (
size_t j = 0, nd = deposits.size();
j < nd; ++
j) {
173 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > genMatches(
genMatchSrc_.size());
183 std::auto_ptr<std::vector<Tau> >
patTaus(
new std::vector<Tau>());
185 for (
size_t idx = 0, ntaus = anyTaus->size(); idx < ntaus; ++idx) {
197 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
203 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
209 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
215 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
221 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
227 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
233 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
239 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
245 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
251 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
257 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
262 for(
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
279 std::vector<pat::Tau::IdPair> ids(
tauIDSrcs_.size());
309 "PATTauProducer: unsupported datatype '" <<
typeid(*tausRef).name() <<
"' for tauSource\n";
337 for (
size_t j = 0, nd = deposits.size();
j < nd; ++
j) {
353 patTaus->push_back(aTau);
366 template <
typename TauCollectionType,
typename TauDiscrType>
370 return (*tauIdDiscr)[tauRef];
383 iDesc.
add<
bool>(
"embedIsolationTracks",
false)->setComment(
"embed external isolation tracks");
384 iDesc.
add<
bool>(
"embedLeadTrack",
false)->setComment(
"embed external leading track");
385 iDesc.
add<
bool>(
"embedLeadTracks",
false)->setComment(
"embed external signal tracks");
388 iDesc.
add<
bool>(
"addGenMatch",
true)->setComment(
"add MC matching");
389 iDesc.
add<
bool>(
"embedGenMatch",
false)->setComment(
"embed MC matched MC information");
390 std::vector<edm::InputTag> emptySourceVector;
393 )->
setComment(
"input with MC match information");
396 iDesc.
add<
bool>(
"addGenJetMatch",
true)->setComment(
"add MC jet matching");
397 iDesc.
add<
bool>(
"embedGenJetMatch",
false)->setComment(
"embed MC jet matched jet information");
404 iDesc.
add<
bool>(
"addTauID",
true)->setComment(
"add tau ID variables");
409 )->
setComment(
"input with electron ID variables");
420 isoDepositsPSet.
addOptional<std::vector<edm::InputTag> >(
"user");
426 iDesc.
add(
"efficiencies", efficienciesPSet);
427 iDesc.
add<
bool>(
"addEfficiencies",
false);
436 iDesc.
add(
"userIsolation", isolationPSet);
bool enabled() const
'true' if this there is at least one efficiency configured
T getParameter(std::string const &) const
void setComment(std::string const &value)
Assists in assimilating all pat::UserData into pat objects.
std::pair< std::string, edm::InputTag > NameTag
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void setIsolation(IsolationKeys key, float value)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
void setAllowAnything()
allow any parameter label/value pairs
#define DEFINE_FWK_MODULE(type)
void embedLeadPFChargedHadrCand()
method to store the leading charged hadron candidate internally
pat::helper::EfficiencyLoader efficiencyLoader_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
pat::helper::KinResolutionsLoader resolutionLoader_
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
void embedSignalPFGammaCands()
method to store the signal gamma candidates internally
float getTauIdDiscriminator(const edm::Handle< TauCollectionType > &, size_t, const edm::Handle< TauDiscrType > &)
void embedIsolationPFCands()
method to store the isolation candidates internally
void embedIsolationPFGammaCands()
method to store the isolation gamma candidates internally
void setTauIDs(const std::vector< IdPair > &ids)
IsolationKeys
Enum defining isolation keys.
void embedSignalTracks()
method to store the signal tracks internally
edm::InputTag genJetMatchSrc_
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
std::vector< edm::InputTag > genMatchSrc_
bool enabled() const
'true' if this there is at least one efficiency configured
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
bool embedIsolationPFChargedHadrCands_
static void fillDescription(edm::ParameterSetDescription &iDesc)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
U second(std::pair< T, U > const &p)
bool enabled() const
True if it has a non null configuration.
bool isNonnull() const
Checks for non-null.
void embedSignalPFChargedHadrCands()
method to store the signal charged hadrons candidates internally
void setComment(std::string const &value)
void embedSignalPFCands()
method to store the signal candidates internally
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
pat::helper::MultiIsolator isolator_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool embedIsolationPFNeutralHadrCands_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void embedLeadTrack()
method to store the leading track internally
pat::PATUserDataHelper< pat::Tau > userDataHelper_
bool embedSignalPFNeutralHadrCands_
bool embedIsolationPFCands_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Analysis-level tau class.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void embedIsolationPFNeutralHadrCands()
method to store the isolation neutral hadrons candidates internally
void embedLeadPFNeutralCand()
method to store the leading neutral candidate internally
void addGenParticleRef(const reco::GenParticleRef &ref)
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
bool embedIsolationTracks_
bool embedLeadPFChargedHadrCand_
bool embedIsolationPFGammaCands_
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
void embedSignalPFNeutralHadrCands()
method to store the signal neutral hadrons candidates internally
void setDecayMode(int)
set decay mode
bool embedSignalPFGammaCands_
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
void embedIsolationPFChargedHadrCands()
method to store the isolation charged hadrons candidates internally
PATTauProducer(const edm::ParameterSet &iConfig)
bool embedLeadPFNeutralCand_
bool isPFTau() const
Returns true if this pat::Tau was made from a reco::PFTau.
void setGenJet(const reco::GenJetRef &ref)
set the matched GenJet
void embedIsolationTracks()
method to store the isolation tracks internally
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
bool embedSignalPFChargedHadrCands_
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
static const HistoName names[]
void embedLeadPFCand()
method to store the leading candidate internally
std::vector< NameTag > tauIDSrcs_
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.
GreaterByPt< Tau > pTTauComparator_
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const