CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/PatCandidates/interface/Jet.h

Go to the documentation of this file.
00001 //
00002 // $Id: Jet.h,v 1.54 2011/06/08 20:40:18 rwolf Exp $
00003 //
00004 
00005 #ifndef DataFormats_PatCandidates_Jet_h
00006 #define DataFormats_PatCandidates_Jet_h
00007 
00020 #include "DataFormats/JetReco/interface/CaloJet.h"
00021 #include "DataFormats/JetReco/interface/BasicJet.h"
00022 #include "DataFormats/JetReco/interface/JPTJet.h"
00023 #include "DataFormats/JetReco/interface/PFJet.h"
00024 #include "DataFormats/CaloTowers/interface/CaloTower.h"
00025 #include "DataFormats/JetReco/interface/GenJet.h"
00026 #include "DataFormats/Candidate/interface/Particle.h"
00027 #include "DataFormats/TrackReco/interface/Track.h"
00028 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00029 #include "DataFormats/BTauReco/interface/JetTag.h"
00030 #include "DataFormats/PatCandidates/interface/PATObject.h"
00031 #include "DataFormats/BTauReco/interface/TrackIPTagInfo.h"
00032 #include "DataFormats/BTauReco/interface/TrackProbabilityTagInfo.h"
00033 #include "DataFormats/BTauReco/interface/TrackCountingTagInfo.h"
00034 #include "DataFormats/BTauReco/interface/SoftLeptonTagInfo.h"
00035 
00036 #include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h"
00037 #include "DataFormats/PatCandidates/interface/JetCorrFactors.h"
00038 #include "DataFormats/JetReco/interface/JetID.h"
00039 
00040 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
00041 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
00042 
00043 #include "DataFormats/Common/interface/Ptr.h"
00044 #include "DataFormats/Common/interface/OwnVector.h"
00045 
00046 
00047 // Define typedefs for convenience
00048 namespace pat {
00049   class Jet;
00050   typedef std::vector<Jet>              JetCollection;
00051   typedef edm::Ref<JetCollection>       JetRef;
00052   typedef edm::RefVector<JetCollection> JetRefVector;
00053 }
00054 
00055 namespace reco {
00057   std::ostream& operator<<(std::ostream& out, const pat::Jet& obj);
00058 }
00059 
00060 // Class definition
00061 namespace pat {
00062 
00063   typedef reco::CaloJet::Specific CaloSpecific;
00064   typedef reco::JPTJet::Specific JPTSpecific;
00065   typedef reco::PFJet::Specific PFSpecific;
00066   typedef std::vector<edm::FwdPtr<reco::BaseTagInfo> > TagInfoFwdPtrCollection;
00067   typedef std::vector<edm::FwdPtr<reco::PFCandidate> > PFCandidateFwdPtrCollection;
00068   typedef std::vector<edm::FwdPtr<CaloTower> > CaloTowerFwdPtrCollection;
00069 
00070 
00071   class Jet : public PATObject<reco::Jet> {
00075     friend class PATJetProducer;
00076 
00077     public:
00078 
00080       Jet();
00082       Jet(const reco::Jet & aJet);
00084       Jet(const edm::RefToBase<reco::Jet> & aJetRef);
00086       Jet(const edm::Ptr<reco::Jet> & aJetRef);
00088       virtual ~Jet();
00090       virtual Jet * clone() const { return new Jet(*this); }
00091 
00093 
00095       const reco::GenParticle * genParton() const { return genParticle(); }
00097       const reco::GenJet * genJet() const;
00099       int partonFlavour() const;
00100 
00101   public:
00103 
00105       const std::vector<std::string> availableJECSets() const;
00106       // returns the available JEC Levels for a given jecSet
00107       const std::vector<std::string> availableJECLevels(const int& set=0) const;
00108       // returns the available JEC Levels for a given jecSet
00109       const std::vector<std::string> availableJECLevels(const std::string& set) const { return availableJECLevels(jecSet(set)); };
00112       bool jecSetsAvailable() const { return !jec_.empty(); }
00115       bool jecSetAvailable(const std::string& set) const {return (jecSet(set)>=0); };
00118       bool jecSetAvailable(const unsigned int& set) const {return (set<jec_.size()); };
00120       std::string currentJECSet() const { return currentJECSet_<jec_.size() ? jec_.at(currentJECSet_).jecSet() : std::string("ERROR"); }
00122       std::string currentJECLevel() const { return currentJECSet_<jec_.size() ? jec_.at(currentJECSet_).jecLevel(currentJECLevel_) : std::string("ERROR"); };
00124       JetCorrFactors::Flavor currentJECFlavor() const { return currentJECFlavor_; };
00127       float jecFactor(const std::string& level, const std::string& flavor="none", const std::string& set="") const;
00130       float jecFactor(const unsigned int& level, const JetCorrFactors::Flavor& flavor=JetCorrFactors::NONE, const unsigned int& set=0) const;
00133       Jet correctedJet(const std::string& level, const std::string& flavor="none", const std::string& set="") const;
00136       Jet correctedJet(const unsigned int& level, const JetCorrFactors::Flavor& flavor=JetCorrFactors::NONE, const unsigned int& set=0) const;
00139       const LorentzVector& correctedP4(const std::string& level, const std::string& flavor="none", const std::string& set="") const { return correctedJet(level, flavor, set).p4(); };
00142       const LorentzVector& correctedP4(const unsigned int& level, const JetCorrFactors::Flavor& flavor=JetCorrFactors::NONE, const unsigned int& set=0) const { return correctedJet(level, flavor, set).p4(); };
00143 
00144   private:
00147       int jecSet(const std::string& label) const;
00149       void currentJECSet(const unsigned int& set) { currentJECSet_=set; };
00151       void currentJECLevel(const unsigned int& level) { currentJECLevel_=level; };
00153       void currentJECFlavor(const JetCorrFactors::Flavor& flavor) { currentJECFlavor_=flavor; };
00155       void addJECFactors(const JetCorrFactors& jec) {jec_.push_back(jec); };
00157       void initializeJEC(unsigned int level, const JetCorrFactors::Flavor& flavor=JetCorrFactors::NONE, unsigned int set=0);
00158 
00159   public:
00161 
00163       float bDiscriminator(const std::string &theLabel) const;
00165       const std::vector<std::pair<std::string, float> > & getPairDiscri() const;
00167       bool hasTagInfo( const std::string label) const { return tagInfo(label) != 0; }
00170       const reco::BaseTagInfo            * tagInfo(const std::string &label) const;
00174       const reco::TrackIPTagInfo         * tagInfoTrackIP(const std::string &label="") const;
00178       const reco::SoftLeptonTagInfo      * tagInfoSoftLepton(const std::string &label="") const;
00182       const reco::SecondaryVertexTagInfo * tagInfoSecondaryVertex(const std::string &label="") const;
00184       void addBDiscriminatorPair(const std::pair<std::string, float> & thePair);
00187       void  addTagInfo(const std::string &label,
00188                        const TagInfoFwdPtrCollection::value_type &info) ;
00189 
00190 
00191       // ---- track related methods ----
00192 
00194       float jetCharge() const;
00196       const reco::TrackRefVector & associatedTracks() const;
00198       void setJetCharge(float jetCharge);
00200       void setAssociatedTracks(const reco::TrackRefVector &tracks);
00201 
00202       // ---- methods for content embedding ----
00203 
00205       void setCaloTowers(const CaloTowerFwdPtrCollection & caloTowers);
00207       void setPFCandidates(const PFCandidateFwdPtrCollection & pfCandidates);
00209       void setGenParton(const reco::GenParticleRef & gp, bool embed=false) { setGenParticleRef(gp, embed); }
00211       void setGenJetRef(const edm::FwdRef<reco::GenJetCollection> & gj);
00213       void setPartonFlavour(int partonFl);
00214 
00215 
00217       void setJetID( reco::JetID const & id ) { jetID_ = id; }
00218 
00219       // ---- jet specific methods ----
00220 
00222       bool isCaloJet()  const { return !specificCalo_.empty() && !isJPTJet(); }
00224       bool isJPTJet()   const { return !specificJPT_.empty(); }
00226       bool isPFJet()    const { return !specificPF_.empty(); }
00228       bool isBasicJet() const { return !(isCaloJet() || isPFJet() || isJPTJet()); }
00230       const CaloSpecific& caloSpecific() const {
00231         if (specificCalo_.empty()) throw cms::Exception("Type Mismatch") << "This PAT jet was not made from a CaloJet.\n";
00232         return specificCalo_[0];
00233       }
00235       const JPTSpecific& jptSpecific() const {
00236         if (specificJPT_.empty()) throw cms::Exception("Type Mismatch") << "This PAT jet was not made from a JPTJet.\n";
00237         return specificJPT_[0];
00238       }
00240       const PFSpecific& pfSpecific() const {
00241         if (specificPF_.empty()) throw cms::Exception("Type Mismatch") << "This PAT jet was not made from a PFJet.\n";
00242         return specificPF_[0];
00243       }
00244 
00245       // ---- Calo Jet specific information ----
00246 
00248       float maxEInEmTowers() const {return caloSpecific().mMaxEInEmTowers;}
00250       float maxEInHadTowers() const {return caloSpecific().mMaxEInHadTowers;}
00252       float energyFractionHadronic () const {return caloSpecific().mEnergyFractionHadronic;}
00254       float emEnergyFraction() const {return caloSpecific().mEnergyFractionEm;}
00256       float hadEnergyInHB() const {return caloSpecific().mHadEnergyInHB;}
00258       float hadEnergyInHO() const {return caloSpecific().mHadEnergyInHO;}
00260       float hadEnergyInHE() const {return caloSpecific().mHadEnergyInHE;}
00262       float hadEnergyInHF() const {return caloSpecific().mHadEnergyInHF;}
00264       float emEnergyInEB() const {return caloSpecific().mEmEnergyInEB;}
00266       float emEnergyInEE() const {return caloSpecific().mEmEnergyInEE;}
00268       float emEnergyInHF() const {return caloSpecific().mEmEnergyInHF;}
00270       float towersArea() const {return caloSpecific().mTowersArea;}
00272       int n90() const {return nCarrying (0.9);}
00274       int n60() const {return nCarrying (0.6);}
00275 
00277       //  static CaloTowerPtr caloTower (const reco::Candidate* fConstituent);
00280       CaloTowerPtr getCaloConstituent (unsigned fIndex) const;
00283       std::vector<CaloTowerPtr> const & getCaloConstituents () const;
00284 
00285       // ---- JPT Jet specific information ----
00286 
00288       const reco::TrackRefVector& pionsInVertexInCalo () const{return jptSpecific().pionsInVertexInCalo; }
00290       const reco::TrackRefVector& pionsInVertexOutCalo() const{return jptSpecific().pionsInVertexOutCalo;}
00292       const reco::TrackRefVector& pionsOutVertexInCalo() const{return jptSpecific().pionsOutVertexInCalo;}
00294       const reco::TrackRefVector& muonsInVertexInCalo () const{return jptSpecific().muonsInVertexInCalo; }
00296       const reco::TrackRefVector& muonsInVertexOutCalo() const{return jptSpecific().muonsInVertexOutCalo;}
00298       const reco::TrackRefVector& muonsOutVertexInCalo() const{return jptSpecific().muonsOutVertexInCalo;}
00300       const reco::TrackRefVector& elecsInVertexInCalo () const{return jptSpecific().elecsInVertexInCalo; }
00302       const reco::TrackRefVector& elecsInVertexOutCalo() const{return jptSpecific().elecsInVertexOutCalo;}
00304       const reco::TrackRefVector& elecsOutVertexInCalo() const{return jptSpecific().elecsOutVertexInCalo;}
00306       const float& zspCorrection() const {return jptSpecific().mZSPCor;}
00308       float elecMultiplicity () const {return jptSpecific().elecsInVertexInCalo.size()+jptSpecific().elecsInVertexOutCalo.size();}
00309 
00310       // ---- JPT or PF Jet specific information ----
00311 
00313       int muonMultiplicity() const;
00315       int chargedMultiplicity() const;
00317       float chargedEmEnergy()  const;
00319       float neutralEmEnergy()  const;
00321       float chargedHadronEnergy() const;
00323       float neutralHadronEnergy() const;
00324 
00326       float chargedHadronEnergyFraction() const {return chargedHadronEnergy()/(jecFactor(0) * energy());}
00328       float neutralHadronEnergyFraction() const {return neutralHadronEnergy()/(jecFactor(0) * energy());}
00330       float chargedEmEnergyFraction()     const {return chargedEmEnergy()/(jecFactor(0) * energy());}
00332       float neutralEmEnergyFraction()     const {return neutralEmEnergy()/(jecFactor(0) * energy());}
00333 
00334       // ---- PF Jet specific information ----
00336       float photonEnergy () const {return pfSpecific().mPhotonEnergy;}
00338       float photonEnergyFraction () const {return photonEnergy () / energy ();}
00340       float electronEnergy () const {return pfSpecific().mElectronEnergy;}
00342       float muonEnergy () const {return pfSpecific().mMuonEnergy;}
00344       float muonEnergyFraction () const {return muonEnergy () / energy ();}
00346       float HFHadronEnergy () const {return pfSpecific().mHFHadronEnergy;}
00348       float HFHadronEnergyFraction () const {return HFHadronEnergy () / energy ();}
00350       float HFEMEnergy () const {return pfSpecific().mHFEMEnergy;}
00352       float HFEMEnergyFraction () const {return HFEMEnergy () / energy ();}
00353 
00355       int chargedHadronMultiplicity () const {return pfSpecific().mChargedHadronMultiplicity;}
00357       int neutralHadronMultiplicity () const {return pfSpecific().mNeutralHadronMultiplicity;}
00359       int photonMultiplicity () const {return pfSpecific().mPhotonMultiplicity;}
00361       int electronMultiplicity () const {return pfSpecific().mElectronMultiplicity;}
00362 
00364       int HFHadronMultiplicity () const {return pfSpecific().mHFHadronMultiplicity;}
00366       int HFEMMultiplicity () const {return pfSpecific().mHFEMMultiplicity;}
00367 
00369       float chargedMuEnergy () const {return pfSpecific().mChargedMuEnergy;}
00371       float chargedMuEnergyFraction () const {return chargedMuEnergy () / energy ();}
00372 
00374       int neutralMultiplicity () const {return pfSpecific().mNeutralMultiplicity;}
00375 
00377       //  static CaloTowerPtr caloTower (const reco::Candidate* fConstituent);
00380       reco::PFCandidatePtr getPFConstituent (unsigned fIndex) const;
00383       std::vector<reco::PFCandidatePtr> const & getPFConstituents () const;
00384 
00389       virtual const reco::Candidate * daughter(size_t i) const {
00390         if (isCaloJet() || isJPTJet() ) {
00391           if ( embeddedCaloTowers_ ) {
00392             if ( caloTowersFwdPtr_.size() > 0 ) return caloTowersFwdPtr_[i].get();
00393             else if ( caloTowers_.size() > 0 ) return &caloTowers_[i];
00394             else return reco::Jet::daughter(i);
00395           }
00396         }
00397         if (isPFJet()) {
00398           if ( embeddedPFCandidates_ ) {
00399             if ( pfCandidatesFwdPtr_.size() > 0 ) return pfCandidatesFwdPtr_[i].get();
00400             else if ( pfCandidates_.size() > 0 ) return &pfCandidates_[i];
00401             else return reco::Jet::daughter(i);
00402           }
00403         }
00404         return reco::Jet::daughter(i);
00405       }
00406 
00407       using reco::LeafCandidate::daughter; // avoid hiding the base implementation
00408 
00413       virtual size_t numberOfDaughters() const {
00414         if (isCaloJet() || isJPTJet()) {
00415           if ( embeddedCaloTowers_ ) {
00416             if ( caloTowersFwdPtr_.size() > 0 ) return caloTowersFwdPtr_.size();
00417             else if ( caloTowers_.size() > 0 ) return caloTowers_.size();
00418             else return reco::Jet::numberOfDaughters();
00419           }
00420         }
00421         if (isPFJet()) {
00422           if ( embeddedPFCandidates_ ) {
00423             if ( pfCandidatesFwdPtr_.size() > 0 ) return pfCandidatesFwdPtr_.size();
00424             else if ( pfCandidates_.size() > 0 ) return pfCandidates_.size();
00425             else return reco::Jet::numberOfDaughters();
00426           }
00427         }
00428         return reco::Jet::numberOfDaughters();
00429       }
00430 
00432       reco::JetID const & jetID () const { return jetID_;}
00433 
00434 
00436       CaloTowerFwdPtrVector               const & caloTowersFwdPtr()   const { return caloTowersFwdPtr_;}
00437       reco::PFCandidateFwdPtrVector       const & pfCandidatesFwdPtr() const { return pfCandidatesFwdPtr_; }
00438       edm::FwdRef<reco::GenJetCollection> const & genJetFwdRef()       const { return genJetFwdRef_; }
00439       TagInfoFwdPtrCollection             const & tagInfosFwdPtr()     const { return tagInfosFwdPtr_; }
00440 
00443       void updateFwdCaloTowerFwdPtr( unsigned int index, edm::Ptr<CaloTower> updateFwd ) {
00444         if ( index < caloTowersFwdPtr_.size() ) {
00445           caloTowersFwdPtr_[index] = CaloTowerFwdPtrVector::value_type( updateFwd, caloTowersFwdPtr_[index].backPtr() );
00446         } else {
00447           throw cms::Exception("OutOfRange") << "Index " << index << " is out of range" << std::endl;
00448         }
00449       }
00450 
00451       void updateFwdPFCandidateFwdPtr( unsigned int index, edm::Ptr<reco::PFCandidate> updateFwd ) {
00452         if ( index < pfCandidatesFwdPtr_.size() ) {
00453           pfCandidatesFwdPtr_[index] = reco::PFCandidateFwdPtrVector::value_type( updateFwd, pfCandidatesFwdPtr_[index].backPtr() );
00454         } else {
00455           throw cms::Exception("OutOfRange") << "Index " << index << " is out of range" << std::endl;
00456         }
00457       }
00458 
00459 
00460       void updateFwdTagInfoFwdPtr( unsigned int index, edm::Ptr<reco::BaseTagInfo> updateFwd ) {
00461         if ( index < tagInfosFwdPtr_.size() ) {
00462           tagInfosFwdPtr_[index] = TagInfoFwdPtrCollection::value_type( updateFwd, tagInfosFwdPtr_[index].backPtr() );
00463         } else {
00464           throw cms::Exception("OutOfRange") << "Index " << index << " is out of range" << std::endl;
00465         }
00466       }
00467 
00468       void updateFwdGenJetFwdRef( edm::Ref<reco::GenJetCollection> updateRef ) {
00469         genJetFwdRef_ = edm::FwdRef<reco::GenJetCollection>( updateRef, genJetFwdRef_.backRef() );
00470       }
00471 
00473       friend std::ostream& reco::operator<<(std::ostream& out, const Jet& obj);
00474 
00475     protected:
00476 
00477       // ---- for content embedding ----
00478 
00479       bool embeddedCaloTowers_;
00480       mutable std::vector<CaloTowerPtr> caloTowersTemp_; // to simplify user interface
00481       CaloTowerCollection caloTowers_; // Compatibility embedding
00482       CaloTowerFwdPtrVector caloTowersFwdPtr_; // Refactorized content embedding
00483 
00484 
00485       bool embeddedPFCandidates_;
00486       mutable std::vector<reco::PFCandidatePtr> pfCandidatesTemp_; // to simplify user interface
00487       reco::PFCandidateCollection pfCandidates_; // Compatibility embedding
00488       reco::PFCandidateFwdPtrVector pfCandidatesFwdPtr_; // Refactorized content embedding
00489 
00490 
00491       // ---- MC info ----
00492 
00493       std::vector<reco::GenJet> genJet_;
00494       reco::GenJetRefVector genJetRef_;
00495       edm::FwdRef<reco::GenJetCollection>  genJetFwdRef_;
00496       int partonFlavour_;
00497 
00498       // ---- energy scale correction factors ----
00499 
00500       // energy scale correction factors; the string carries a potential label if
00501       // more then one set of correction factors is embedded. The label corresponds
00502       // to the label of the jetCorrFactors module that has been embedded.
00503       std::vector<pat::JetCorrFactors> jec_;
00504       // currently applied set of jet energy correction factors (i.e. the index in
00505       // jetEnergyCorrections_)
00506       unsigned int currentJECSet_;
00507       // currently applied jet energy correction level
00508       unsigned int currentJECLevel_;
00509       // currently applied jet energy correction flavor (can be NONE, GLUON, UDS,
00510       // CHARM or BOTTOM)
00511       JetCorrFactors::Flavor currentJECFlavor_;
00512 
00513       // ---- b-tag related members ----
00514 
00515       std::vector<std::pair<std::string, float> >           pairDiscriVector_;
00516       std::vector<std::string>          tagInfoLabels_;
00517       edm::OwnVector<reco::BaseTagInfo> tagInfos_; // Compatibility embedding
00518       TagInfoFwdPtrCollection  tagInfosFwdPtr_; // Refactorized embedding
00519 
00520 
00521       // ---- track related members ----
00522 
00523       float jetCharge_;
00524       reco::TrackRefVector associatedTracks_;
00525 
00526       // ---- specific members ----
00527 
00528       std::vector<CaloSpecific> specificCalo_;
00529       std::vector<JPTSpecific>  specificJPT_;
00530       std::vector<PFSpecific>   specificPF_;
00531 
00532       // ---- id functions ----
00533       reco::JetID    jetID_;
00534 
00535 
00536     private:
00537 
00538       // ---- helper functions ----
00539 
00540       void tryImportSpecific(const reco::Jet &source);
00541       template<typename T> const T * tagInfoByType() const;
00542 
00544       const JetCorrFactors * corrFactors_(const std::string& set) const ;
00546       const JetCorrFactors * corrFactors_() const;
00547 
00549       mutable bool isCaloTowerCached_;
00550       void cacheCaloTowers() const;
00551       mutable bool isPFCandidateCached_;
00552       void cachePFCandidates() const;
00553 
00554   };
00555 }
00556 
00557 inline float pat::Jet::chargedHadronEnergy() const
00558 {
00559   if(isPFJet()){ return pfSpecific().mChargedHadronEnergy; }
00560   else if( isJPTJet() ){ return jptSpecific().mChargedHadronEnergy; }
00561   else{ throw cms::Exception("Type Mismatch") << "This PAT jet was not made from a JPTJet nor from PFJet.\n"; }
00562 }
00563 
00564 inline float pat::Jet::neutralHadronEnergy() const
00565 {
00566   if(isPFJet()){ return pfSpecific().mNeutralHadronEnergy; }
00567   else if( isJPTJet() ){ return jptSpecific().mNeutralHadronEnergy; }
00568   else{ throw cms::Exception("Type Mismatch") << "This PAT jet was not made from a JPTJet nor from PFJet.\n"; }
00569 }
00570 
00571 inline float pat::Jet::chargedEmEnergy() const
00572 {
00573   if(isPFJet()){ return pfSpecific().mChargedEmEnergy; }
00574   else if( isJPTJet() ){ return jptSpecific().mChargedEmEnergy;}
00575   else{ throw cms::Exception("Type Mismatch") << "This PAT jet was not made from a JPTJet nor from PFJet.\n"; }
00576 }
00577 
00578 inline float pat::Jet::neutralEmEnergy() const
00579 {
00580   if(isPFJet()){ return pfSpecific().mNeutralEmEnergy; }
00581   else if( isJPTJet() ){ return jptSpecific().mNeutralEmEnergy;}
00582   else{ throw cms::Exception("Type Mismatch") << "This PAT jet was not made from a JPTJet nor from PFJet.\n"; }
00583 }
00584 
00585 inline int pat::Jet::muonMultiplicity() const
00586 {
00587   if(isPFJet()){ return pfSpecific().mMuonMultiplicity; }
00588   else if( isJPTJet() ){ return jptSpecific().muonsInVertexInCalo.size()+jptSpecific().muonsInVertexOutCalo.size();}
00589   else{ throw cms::Exception("Type Mismatch") << "This PAT jet was not made from a JPTJet nor from PFJet.\n"; }
00590 }
00591 
00592 inline int pat::Jet::chargedMultiplicity() const
00593 {
00594   if(isPFJet()){ return pfSpecific().mChargedMultiplicity; }
00595   else if( isJPTJet() ){ return jptSpecific().muonsInVertexInCalo.size()+jptSpecific().muonsInVertexOutCalo.size()+
00596                                 jptSpecific().pionsInVertexInCalo.size()+jptSpecific().pionsInVertexOutCalo.size()+
00597                                 jptSpecific().elecsInVertexInCalo.size()+jptSpecific().elecsInVertexOutCalo.size();}
00598   else{ throw cms::Exception("Type Mismatch") << "This PAT jet was not made from a JPTJet nor from PFJet.\n"; }
00599 }
00600 
00601 #endif