CMS 3D CMS Logo

Public Member Functions | Protected Attributes

JetIDStudiesSelector Class Reference

Inheritance diagram for JetIDStudiesSelector:
EventSelector

List of all members.

Public Member Functions

vector< pat::Jet > const & allCaloJets () const
vector< pat::Jet > const & allPFJets () const
index_type const & caloCuts () const
index_type const & caloDeltaPhi () const
pat::Jet const & caloJet0 () const
pat::Jet const & caloJet1 () const
index_type const & caloJetID () const
index_type const & caloKin () const
 JetIDStudiesSelector (edm::ParameterSet const &caloJetIdParams, edm::ParameterSet const &pfJetIdParams, edm::ParameterSet const &params)
boost::shared_ptr
< JetIDSelectionFunctor >
const & 
jetSel () const
virtual bool operator() (edm::EventBase const &event, pat::strbitset &ret)
index_type const & pfCuts () const
index_type const & pfDeltaPhi () const
pat::Jet const & pfJet0 () const
pat::Jet const & pfJet1 () const
index_type const & pfJetID () const
boost::shared_ptr
< PFJetIDSelectionFunctor >
const & 
pfJetSel () const
index_type const & pfKin () const
virtual ~JetIDStudiesSelector ()

Protected Attributes

index_type caloCuts_
index_type caloDeltaPhi_
edm::Ptr< pat::JetcaloJet0_
edm::Ptr< pat::JetcaloJet1_
index_type caloJetID_
index_type caloKin_
edm::Handle< vector< pat::Jet > > h_jets_
edm::Handle< vector< pat::Jet > > h_pfjets_
boost::shared_ptr
< JetIDSelectionFunctor
jetSel_
edm::InputTag jetSrc_
index_type pfCuts_
index_type pfDeltaPhi_
edm::Ptr< pat::JetpfJet0_
edm::Ptr< pat::JetpfJet1_
index_type pfJetID_
boost::shared_ptr
< PFJetIDSelectionFunctor
pfJetSel_
edm::InputTag pfJetSrc_
index_type pfKin_

Detailed Description

Definition at line 57 of file PatBasicFWLiteJetAnalyzer_Selector.cc.


Constructor & Destructor Documentation

JetIDStudiesSelector::JetIDStudiesSelector ( edm::ParameterSet const &  caloJetIdParams,
edm::ParameterSet const &  pfJetIdParams,
edm::ParameterSet const &  params 
) [inline]

Definition at line 59 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

References edm::ParameterSet::getParameter(), and PatBasicFWLiteJetAnalyzer_Selector_cfg::useCalo.

                                                         :
    jetSel_    (new JetIDSelectionFunctor(caloJetIdParams)), 
    pfJetSel_  (new PFJetIDSelectionFunctor(pfJetIdParams)),
    jetSrc_    (params.getParameter<edm::InputTag>("jetSrc")), 
    pfJetSrc_  (params.getParameter<edm::InputTag>("pfJetSrc")) 
  {
    bool useCalo = params.getParameter<bool>("useCalo");
               
    push_back("Calo Cuts");
    push_back("Calo Kin Cuts");
    push_back("Calo Delta Phi");
    push_back("Calo Jet ID");
    push_back("PF Cuts");
    push_back("PF Kin Cuts");
    push_back("PF Delta Phi");
    push_back("PF Jet ID");

    set("Calo Cuts", useCalo);
    set("Calo Kin Cuts", useCalo);
    set("Calo Delta Phi", useCalo);
    set("Calo Jet ID", useCalo);
    set("PF Cuts", !useCalo);
    set("PF Kin Cuts", !useCalo);
    set("PF Delta Phi", !useCalo);    
    set("PF Jet ID", !useCalo);

    // Indices for fast caching
    caloCuts_      = index_type(&bits_, std::string("Calo Cuts") );
    caloKin_       = index_type(&bits_, std::string("Calo Kin Cuts"));
    caloDeltaPhi_  = index_type(&bits_, std::string("Calo Delta Phi"));
    caloJetID_     = index_type(&bits_, std::string("Calo Jet ID"));
    pfCuts_        = index_type(&bits_, std::string("PF Cuts"));
    pfKin_         = index_type(&bits_, std::string("PF Kin Cuts"));
    pfDeltaPhi_    = index_type(&bits_, std::string("PF Delta Phi"));
    pfJetID_       = index_type(&bits_, std::string("PF Jet ID"));
    
  }
virtual JetIDStudiesSelector::~JetIDStudiesSelector ( ) [inline, virtual]

Definition at line 99 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

{}

Member Function Documentation

vector<pat::Jet> const& JetIDStudiesSelector::allCaloJets ( ) const [inline]

Definition at line 178 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{ return *h_jets_; }
vector<pat::Jet> const& JetIDStudiesSelector::allPFJets ( ) const [inline]

Definition at line 179 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{ return *h_pfjets_; }
index_type const& JetIDStudiesSelector::caloCuts ( ) const [inline]

Definition at line 189 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

{return caloCuts_;}      
index_type const& JetIDStudiesSelector::caloDeltaPhi ( ) const [inline]

Definition at line 191 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{return caloDeltaPhi_;}  
pat::Jet const& JetIDStudiesSelector::caloJet0 ( ) const [inline]

Definition at line 181 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{ return *caloJet0_; }
pat::Jet const& JetIDStudiesSelector::caloJet1 ( ) const [inline]

Definition at line 182 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{ return *caloJet1_; }
index_type const& JetIDStudiesSelector::caloJetID ( ) const [inline]

Definition at line 192 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{return caloJetID_;}     
index_type const& JetIDStudiesSelector::caloKin ( ) const [inline]

Definition at line 190 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{return caloKin_;}       
boost::shared_ptr<JetIDSelectionFunctor> const& JetIDStudiesSelector::jetSel ( ) const [inline]

Definition at line 175 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

{ return jetSel_;}
virtual bool JetIDStudiesSelector::operator() ( edm::EventBase const &  event,
pat::strbitset ret 
) [inline, virtual]

Definition at line 101 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

References reco::LeafCandidate::phi(), Pi, runTheMatrix::ret, and pat::strbitset::set().

                                                                          {

    pat::strbitset retCaloJet = jetSel_->getBitTemplate();
    pat::strbitset retPFJet = pfJetSel_->getBitTemplate();


    if ( considerCut(caloCuts_) ) {
      passCut(ret, caloCuts_);
      event.getByLabel( jetSrc_, h_jets_ );
      // Calo Cuts
      if ( h_jets_->size() >= 2 || ignoreCut(caloKin_) ) {
        passCut(ret, caloKin_);
        pat::Jet const & jet0 = h_jets_->at(0);
        pat::Jet const & jet1 = h_jets_->at(1);
        double dphi = fabs(deltaPhi<double>( jet0.phi(),
                                             jet1.phi() ) );
          
        if ( fabs(dphi - TMath::Pi()) < 1.0 || ignoreCut(caloDeltaPhi_) ) {
          passCut(ret, caloDeltaPhi_);

            
          retCaloJet.set(false);
          bool pass0 = (*jetSel_)( jet0, retCaloJet );
          retCaloJet.set(false);
          bool pass1 = (*jetSel_)( jet1, retCaloJet );
          if ( (pass0 && pass1) || ignoreCut(caloJetID_) ) {
            passCut(ret, caloJetID_);
            caloJet0_ = edm::Ptr<pat::Jet>( h_jets_, 0);
            caloJet1_ = edm::Ptr<pat::Jet>( h_jets_, 1);

            return (bool)ret;
          }// end if found 2 "loose" jet ID jets
        }// end if delta phi
      }// end calo kin cuts
    }// end if calo cuts


    if ( considerCut(pfCuts_) ) {

      passCut(ret, pfCuts_);
      event.getByLabel( pfJetSrc_, h_pfjets_ );
      // PF Cuts
      if ( h_pfjets_->size() >= 2 || ignoreCut(pfKin_) ) {
        passCut( ret, pfKin_);
        pat::Jet const & jet0 = h_pfjets_->at(0);
        pat::Jet const & jet1 = h_pfjets_->at(1);
        double dphi = fabs(deltaPhi<double>( jet0.phi(),
                                             jet1.phi() ) );
          
        if ( fabs(dphi - TMath::Pi()) < 1.0 || ignoreCut(pfDeltaPhi_) ) {
          passCut(ret, pfDeltaPhi_);

            
          retPFJet.set(false);
          bool pass0 = (*pfJetSel_)( jet0, retPFJet );
          retPFJet.set(false);
          bool pass1 = (*pfJetSel_)( jet1, retPFJet );
          if ( (pass0 && pass1) || ignoreCut(pfJetID_) ) {
            passCut(ret, pfJetID_);
            pfJet0_ = edm::Ptr<pat::Jet>( h_pfjets_, 0);
            pfJet1_ = edm::Ptr<pat::Jet>( h_pfjets_, 1);

            return (bool)ret;
          }// end if found 2 "loose" jet ID jets
        }// end if delta phi
      }// end pf kin cuts
    }// end if pf cuts


    setIgnored(ret);

    return false;
  }// end of method
index_type const& JetIDStudiesSelector::pfCuts ( ) const [inline]

Definition at line 193 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

{return pfCuts_;}        
index_type const& JetIDStudiesSelector::pfDeltaPhi ( ) const [inline]

Definition at line 195 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{return pfDeltaPhi_;}    
pat::Jet const& JetIDStudiesSelector::pfJet0 ( ) const [inline]

Definition at line 184 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{ return *pfJet0_; }
pat::Jet const& JetIDStudiesSelector::pfJet1 ( ) const [inline]

Definition at line 185 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{ return *pfJet1_; }
index_type const& JetIDStudiesSelector::pfJetID ( ) const [inline]

Definition at line 196 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

{return pfJetID_;}       
boost::shared_ptr<PFJetIDSelectionFunctor> const& JetIDStudiesSelector::pfJetSel ( ) const [inline]

Definition at line 176 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

{ return pfJetSel_;}
index_type const& JetIDStudiesSelector::pfKin ( ) const [inline]

Definition at line 194 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

{return pfKin_;}         

Member Data Documentation

index_type JetIDStudiesSelector::caloCuts_ [protected]

Definition at line 215 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::caloDeltaPhi_ [protected]

Definition at line 217 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Definition at line 208 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Definition at line 209 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::caloJetID_ [protected]

Definition at line 218 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::caloKin_ [protected]

Definition at line 216 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Definition at line 205 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Definition at line 206 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

boost::shared_ptr<JetIDSelectionFunctor> JetIDStudiesSelector::jetSel_ [protected]

Definition at line 200 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Definition at line 202 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::pfCuts_ [protected]

Definition at line 219 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::pfDeltaPhi_ [protected]

Definition at line 221 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Definition at line 211 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Definition at line 212 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::pfJetID_ [protected]

Definition at line 222 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Definition at line 201 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Definition at line 203 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::pfKin_ [protected]

Definition at line 220 of file PatBasicFWLiteJetAnalyzer_Selector.cc.