162 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.";
163 std::auto_ptr<std::vector<Tau> >
patTaus(
new std::vector<Tau>());
173 std::vector<edm::Handle<edm::ValueMap<IsoDeposit> > > deposits(
isoDepositTokens_.size());
174 for (
size_t j = 0, nd = deposits.size();
j < nd; ++
j) {
179 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > >genMatches(
genMatchTokens_.size());
190 std::vector<edm::ValueMap<TauJetCorrFactors> > tauJetCorrs;
195 tauJetCorrs.push_back( *tauJetCorr );
199 std::auto_ptr<std::vector<Tau> >
patTaus(
new std::vector<Tau>());
202 for (
size_t idx = 0, ntaus = anyTaus->size();
idx < ntaus; ++
idx) {
212 aTau.embedLeadPFCand();
214 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
218 aTau.embedLeadPFChargedHadrCand();
220 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
224 aTau.embedLeadPFNeutralCand();
226 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
230 aTau.embedSignalPFCands();
232 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
236 aTau.embedSignalPFChargedHadrCands();
238 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
242 aTau.embedSignalPFNeutralHadrCands();
244 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
248 aTau.embedSignalPFGammaCands();
250 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
254 aTau.embedIsolationPFCands();
256 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
260 aTau.embedIsolationPFChargedHadrCands();
262 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
266 aTau.embedIsolationPFNeutralHadrCands();
268 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
272 aTau.embedIsolationPFGammaCands();
274 edm::LogWarning(
"Type Error") <<
"Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
279 for (
unsigned int i=0;
i<tauJetCorrs.size(); ++
i ) {
283 aTau.addJECFactors(tauJetCorr);
285 std::vector<std::string> levels = tauJetCorrs[0][tausRef].correctionLabels();
286 if(
std::find(levels.begin(), levels.end(),
"L2L3Residual")!=levels.end()){
287 aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel(
"L2L3Residual"));
289 else if(
std::find(levels.begin(), levels.end(),
"L3Absolute")!=levels.end()){
290 aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel(
"L3Absolute"));
293 aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel(
"Uncorrected"));
296 <<
"L2L3Residual and L3Absolute are not part of the correction applied jetCorrFactors \n"
297 <<
"of module " << tauJetCorrs[0][tausRef].jecSet() <<
" jets will remain"
306 for(
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
308 aTau.addGenParticleRef(genTau);
317 aTau.setGenJet( genJetTau );
323 std::vector<pat::Tau::IdPair> ids(
tauIDSrcs_.size());
347 "PATTauProducer: unsupported datatype '" <<
typeid(*tausRef).name() <<
"' for tauSource\n";
356 if ( aTau.isPFTau() ) {
361 aTau.setDecayMode(pfTauRef->decayMode());
375 aTauPFEssential.
dxy_ = tauLifetimeInfo.
dxy();
397 aTau.setIsolation(it->first, it->second);
401 for (
size_t j = 0, nd = deposits.size();
j < nd; ++
j) {
bool enabled() const
'true' if this there is at least one efficiency configured
bool hasSecondaryVertex() const
bool isNonnull() const
Checks for non-null.
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
bool addTauJetCorrFactors_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
pat::helper::EfficiencyLoader efficiencyLoader_
pat::helper::KinResolutionsLoader resolutionLoader_
float getTauIdDiscriminator(const edm::Handle< TauCollectionType > &, size_t, const edm::Handle< TauDiscrType > &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
const Point & dxy_PCA() const
bool enabled() const
'true' if this there is at least one efficiency configured
bool embedIsolationPFChargedHadrCands_
bool enabled() const
True if it has a non null configuration.
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
double flightLengthSig() const
edm::EDGetTokenT< PFTauTIPAssociationByRef > tauTransverseImpactParameterToken_
pat::helper::MultiIsolator isolator_
const Vector & flightLength() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< edm::View< reco::BaseTau > > baseTauToken_
bool embedIsolationPFNeutralHadrCands_
reco::PFTauTransverseImpactParameter::Vector flightLength_
edm::EDGetTokenT< reco::CaloTauCollection > caloTauToken_
pat::PATUserDataHelper< pat::Tau > userDataHelper_
bool embedSignalPFNeutralHadrCands_
bool embedIsolationPFCands_
Analysis-level tau class.
std::vector< edm::EDGetTokenT< reco::CaloTauDiscriminator > > caloTauIDTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< TauJetCorrFactors > > > tauJetCorrFactorsTokens_
edm::InputTag tauTransverseImpactParameterSrc_
bool embedIsolationTracks_
bool embedLeadPFChargedHadrCand_
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
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.
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetMatchToken_
bool embedSignalPFGammaCands_
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
bool embedLeadPFNeutralCand_
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
bool embedSignalPFChargedHadrCands_
std::vector< edm::EDGetTokenT< reco::PFTauDiscriminator > > pfTauIDTokens_
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
std::vector< NameTag > tauIDSrcs_
edm::EDGetTokenT< reco::PFTauCollection > pfTauToken_
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.
GreaterByPt< Tau > pTTauComparator_
reco::PFTauTransverseImpactParameter::Point dxy_PCA_
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const