172 std::vector<edm::ValueMap<JetCorrFactors> > jetCorrs;
177 jetCorrs.push_back( *jetCorr );
182 std::vector<edm::Handle<reco::JetFloatAssociation::Container> > jetDiscriminators;
189 std::vector<edm::Handle<edm::View<reco::BaseTagInfo> > > jetTagInfos;
208 std::auto_ptr< std::vector<Jet> >
patJets (
new std::vector<Jet>() );
211 std::auto_ptr<std::vector<CaloTower> > caloTowersOut(
new std::vector<CaloTower> () );
225 unsigned int idx = itJet - jets->begin();
234 if ( ajet.isCaloJet()) cj = dynamic_cast<const reco::CaloJet *>(jetRef.
get());
241 for ( std::vector<CaloTowerPtr>::const_iterator towBegin = itowers.begin(), towEnd = itowers.end(), itow = towBegin; itow != towEnd; ++itow ) {
242 if( itow->isAvailable() && itow->isNonnull() ){
243 caloTowersOut->push_back( **itow );
246 edm::Ptr<CaloTower> caloForwardRef ( h_caloTowersOut.id(), caloTowerRef.key(), h_caloTowersOut.productGetter() );
253 ajet.setCaloTowers( itowersRef );
261 for ( std::vector<reco::PFCandidatePtr>::const_iterator partBegin = iparticles.begin(),
262 partEnd = iparticles.end(), ipart = partBegin;
263 ipart != partEnd; ++ipart ) {
264 pfCandidatesOut->push_back( **ipart );
273 ajet.setPFCandidates( iparticlesRef );
282 ajet.addJECFactors(jcf);
285 if(
std::find(levels.begin(), levels.end(),
"L2L3Residual")!=levels.end()){
286 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L2L3Residual"));
288 else if(
std::find(levels.begin(), levels.end(),
"L3Absolute")!=levels.end()){
289 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L3Absolute"));
292 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"Uncorrected"));
294 edm::LogWarning(
"L3Absolute not found") <<
"L2L3Residual and L3Absolute are not part of the correction applied jetCorrFactors \n"
295 <<
"of module " << jetCorrs[0][jetRef].jecSet() <<
" jets will remain"
296 <<
" uncorrected."; first=
false;
324 genJetsOut->push_back( *genjet );
331 ajet.setGenJetRef(genjetFwdRef );
351 for (
size_t k=0;
k<jetDiscriminators.size(); ++
k) {
352 float value = (*jetDiscriminators[
k])[jetRef];
357 for (
size_t k=0;
k<jetTagInfos.size(); ++
k) {
362 if ((idx < taginfos.
size()) && (taginfos[idx].
jet() == jetRef)) {
363 match = taginfos.
ptrAt(idx);
367 if (itTI->jet() == jetRef) { match = taginfos.
ptrAt( itTI - taginfos.
begin() );
break; }
371 tagInfosOut->push_back( match->clone() );
386 if (
addJetCharge_) ajet.setJetCharge( (*hJetChargeAss)[jetRef] );
391 ajet.setJetID( jetId );
394 else if (
addJetID_ && ajet.isJPTJet() ){
397 ajet.setJetID( jetId );
411 iEvent.
put( genJetsOut,
"genJets" );
412 iEvent.
put( caloTowersOut,
"caloTowers" );
413 iEvent.
put( pfCandidatesOut,
"pfCandidates" );
414 iEvent.
put( tagInfosOut,
"tagInfos" );
bool enabled() const
'true' if this there is at least one efficiency configured
value_type const * get() const
pat::helper::EfficiencyLoader efficiencyLoader_
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
bool isNonnull() const
Checks for non-null.
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
Ptr< value_type > ptrAt(size_type i) 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.
edm::EDGetTokenT< reco::JetFlavourInfoMatchingCollection > jetFlavourInfoToken_
Jets made from PFObjects.
GreaterByPt< Jet > pTComparator_
bool enabled() const
'true' if this there is at least one efficiency configured
edm::EDGetTokenT< reco::JetFloatAssociation::Container > jetChargeToken_
const_iterator begin() const
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()
bool isNonnull() const
Checks for non-null.
pat::PATUserDataHelper< pat::Jet > userDataHelper_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< reco::JetFlavourMatchingCollection > jetPartonMapToken_
bool useLegacyJetMCFlavour_
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_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > genPartonToken_
virtual std::vector< reco::PFCandidatePtr > getPFConstituents() const
get all constituents
const_iterator end() const
bool embedGenPartonMatch_
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.
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.