CMS 3D CMS Logo

CaloRecoTauDiscriminationByIsolation.cc
Go to the documentation of this file.
1 /* class CaloRecoTauDiscriminationByIsolation
2  * created : Jul 23 2007,
3  * revised : Sep 5 2007,
4  * contributors : Ludovic Houchu (Ludovic.Houchu@cern.ch ; IPHC, Strasbourg), Christian Veelken (veelken@fnal.gov ; UC Davis), Evan Friis (UC Davis)
5  */
6 
8 
9 namespace {
10 
11 using namespace reco;
12 
13 class CaloRecoTauDiscriminationByIsolation final : public CaloTauDiscriminationProducerBase {
14  public:
15  explicit CaloRecoTauDiscriminationByIsolation(const edm::ParameterSet& iConfig):CaloTauDiscriminationProducerBase(iConfig){
16  applyDiscriminationByTrackerIsolation_ = iConfig.getParameter<bool>("ApplyDiscriminationByTrackerIsolation");
17  TrackerIsolAnnulus_maximumOccupancy_ = iConfig.getParameter<unsigned>("TrackerIsolAnnulus_maximumOccupancy");
18 
19  applyDiscriminationByECALIsolation_ = iConfig.getParameter<bool>("ApplyDiscriminationByECALIsolation");
20  EcalIsolAnnulus_maximumSumEtCut_ = iConfig.getParameter<double>("ECALisolAnnulus_maximumSumEtCut");
21  }
22  ~CaloRecoTauDiscriminationByIsolation() override{}
23  double discriminate(const CaloTauRef&) const override;
24  private:
25  bool applyDiscriminationByTrackerIsolation_;
26  unsigned TrackerIsolAnnulus_maximumOccupancy_;
27  bool applyDiscriminationByECALIsolation_;
28  double EcalIsolAnnulus_maximumSumEtCut_;
29 };
30 
31 double CaloRecoTauDiscriminationByIsolation::discriminate(const CaloTauRef& caloTau) const
32 {
33  if ( applyDiscriminationByTrackerIsolation_ ){
34  if ( caloTau->isolationTracks().size() > TrackerIsolAnnulus_maximumOccupancy_ ) return 0.;
35  }
36 
37  if ( applyDiscriminationByECALIsolation_ ) {
38  if ( caloTau->isolationECALhitsEtSum() > EcalIsolAnnulus_maximumSumEtCut_ ) return 0.;
39  }
40 
41  // N.B. the lead track requirement must be included in the discriminants
42  return 1.;
43 }
44 
45 }
46 
47 DEFINE_FWK_MODULE(CaloRecoTauDiscriminationByIsolation);
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
fixed size matrix