165 std::vector<edm::ValueMap<JetCorrFactors> > jetCorrs;
170 jetCorrs.push_back( *jetCorr );
175 std::vector<edm::Handle<reco::JetFloatAssociation::Container> > jetDiscriminators;
182 std::vector<edm::Handle<edm::View<reco::BaseTagInfo> > > jetTagInfos;
201 std::auto_ptr< std::vector<Jet> >
patJets (
new std::vector<Jet>() );
204 std::auto_ptr<std::vector<CaloTower> > caloTowersOut(
new std::vector<CaloTower> () );
218 unsigned int idx = itJet - jets->begin();
227 if ( ajet.isCaloJet()) cj = dynamic_cast<const reco::CaloJet *>(jetRef.
get());
234 for ( std::vector<CaloTowerPtr>::const_iterator towBegin = itowers.begin(), towEnd = itowers.end(), itow = towBegin; itow != towEnd; ++itow ) {
235 if( itow->isAvailable() && itow->isNonnull() ){
236 caloTowersOut->push_back( **itow );
239 edm::Ptr<CaloTower> caloForwardRef ( h_caloTowersOut.id(), caloTowerRef.key(), h_caloTowersOut.productGetter() );
246 ajet.setCaloTowers( itowersRef );
254 for ( std::vector<reco::PFCandidatePtr>::const_iterator partBegin = iparticles.begin(),
255 partEnd = iparticles.end(), ipart = partBegin;
256 ipart != partEnd; ++ipart ) {
257 pfCandidatesOut->push_back( **ipart );
266 ajet.setPFCandidates( iparticlesRef );
275 ajet.addJECFactors(jcf);
278 if(
std::find(levels.begin(), levels.end(),
"L2L3Residual")!=levels.end()){
279 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L2L3Residual"));
281 else if(
std::find(levels.begin(), levels.end(),
"L3Absolute")!=levels.end()){
282 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L3Absolute"));
285 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"Uncorrected"));
287 edm::LogWarning(
"L3Absolute not found") <<
"L2L3Residual and L3Absolute are not part of the correction applied jetCorrFactors \n"
288 <<
"of module " << jetCorrs[0][jetRef].jecSet() <<
" jets will remain"
289 <<
" uncorrected."; first=
false;
309 genJetsOut->push_back( *genjet );
316 ajet.setGenJetRef(genjetFwdRef );
336 for (
size_t k=0;
k<jetDiscriminators.size(); ++
k) {
337 float value = (*jetDiscriminators[
k])[jetRef];
342 for (
size_t k=0;
k<jetTagInfos.size(); ++
k) {
347 if ((idx < taginfos.
size()) && (taginfos[idx].
jet() == jetRef)) {
348 match = taginfos.
ptrAt(idx);
352 if (itTI->jet() == jetRef) { match = taginfos.
ptrAt( itTI - taginfos.
begin() );
break; }
356 tagInfosOut->push_back( match->clone() );
371 if (
addJetCharge_) ajet.setJetCharge( (*hJetChargeAss)[jetRef] );
376 ajet.setJetID( jetId );
379 else if (
addJetID_ && ajet.isJPTJet() ){
382 ajet.setJetID( jetId );
396 iEvent.
put( genJetsOut,
"genJets" );
397 iEvent.
put( caloTowersOut,
"caloTowers" );
398 iEvent.
put( pfCandidatesOut,
"pfCandidates" );
399 iEvent.
put( tagInfosOut,
"tagInfos" );
bool enabled() const
'true' if this there is at least one efficiency configured
pat::helper::EfficiencyLoader efficiencyLoader_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
std::vector< edm::EDGetTokenT< edm::View< reco::BaseTagInfo > > > tagInfoTokens_
edm::EDGetTokenT< reco::JetTracksAssociation::Container > trackAssociationToken_
Jets made from CaloTowers.
std::vector< std::string > tagInfoLabels_
std::vector< edm::EDGetTokenT< edm::ValueMap< JetCorrFactors > > > jetCorrFactorsTokens_
bool addAssociatedTracks_
std::vector< std::string > correctionLabels() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
pat::helper::KinResolutionsLoader resolutionLoader_
std::vector< GenJet > GenJetCollection
collection of GenJet objects
std::vector< std::string > discriminatorLabels_
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
virtual std::vector< CaloTowerPtr > getCaloConstituents() const
get all constituents
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
Jets made from PFObjects.
GreaterByPt< Jet > pTComparator_
bool enabled() const
'true' if this there is at least one efficiency configured
bool isNonnull() const
Checks for non-null.
edm::EDGetTokenT< reco::JetFloatAssociation::Container > jetChargeToken_
Ptr< value_type > ptrAt(size_type i) const
bool isNonnull() const
Checks for non-null.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Jets made from CaloJets corrected for ZSP and tracks.
Class for the storage of jet correction factors.
edm::EDGetTokenT< reco::JetIDValueMap > jetIDMapToken_
Container::value_type value_type
RefProd< PROD > getRefBeforePut()
pat::PATUserDataHelper< pat::Jet > userDataHelper_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< reco::JetFlavourMatchingCollection > jetPartonMapToken_
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
std::vector< edm::FwdPtr< CaloTower > > CaloTowerFwdPtrCollection
std::vector< edm::FwdPtr< reco::PFCandidate > > PFCandidateFwdPtrCollection
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
Analysis-level calorimeter jet class.
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetToken_
std::vector< edm::EDGetTokenT< reco::JetFloatAssociation::Container > > discriminatorTokens_
edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > genPartonToken_
virtual std::vector< reco::PFCandidatePtr > getPFConstituents() const
get all constituents
const_iterator begin() const
bool embedGenPartonMatch_
const_iterator end() const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
value_type const * get() const
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.