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 
11 
12 namespace {
13 
14 using namespace reco;
15 
16 class CaloRecoTauDiscriminationByIsolation final : public CaloTauDiscriminationProducerBase {
17  public:
18  explicit CaloRecoTauDiscriminationByIsolation(const edm::ParameterSet& iConfig):CaloTauDiscriminationProducerBase(iConfig){
19  applyDiscriminationByTrackerIsolation_ = iConfig.getParameter<bool>("ApplyDiscriminationByTrackerIsolation");
20  TrackerIsolAnnulus_maximumOccupancy_ = iConfig.getParameter<unsigned>("TrackerIsolAnnulus_maximumOccupancy");
21 
22  applyDiscriminationByECALIsolation_ = iConfig.getParameter<bool>("ApplyDiscriminationByECALIsolation");
23  EcalIsolAnnulus_maximumSumEtCut_ = iConfig.getParameter<double>("ECALisolAnnulus_maximumSumEtCut");
24  }
25  ~CaloRecoTauDiscriminationByIsolation() override{}
26  double discriminate(const CaloTauRef&) const override;
27  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
28 
29  private:
30  bool applyDiscriminationByTrackerIsolation_;
31  unsigned TrackerIsolAnnulus_maximumOccupancy_;
32  bool applyDiscriminationByECALIsolation_;
33  double EcalIsolAnnulus_maximumSumEtCut_;
34 };
35 
36 double CaloRecoTauDiscriminationByIsolation::discriminate(const CaloTauRef& caloTau) const
37 {
38  if ( applyDiscriminationByTrackerIsolation_ ){
39  if ( caloTau->isolationTracks().size() > TrackerIsolAnnulus_maximumOccupancy_ ) return 0.;
40  }
41 
42  if ( applyDiscriminationByECALIsolation_ ) {
43  if ( caloTau->isolationECALhitsEtSum() > EcalIsolAnnulus_maximumSumEtCut_ ) return 0.;
44  }
45 
46  // N.B. the lead track requirement must be included in the discriminants
47  return 1.;
48 }
49 
50 }
51 
52 void
54  // caloRecoTauDiscriminationByIsolation
56  desc.add<bool>("ApplyDiscriminationByTrackerIsolation");
57  desc.add<unsigned>("TrackerIsolAnnulus_maximumOccupancy"); // unsigned means unsigned int, in my test it resulted in uint32
58  desc.add<bool>("ApplyDiscriminationByECALIsolation");
59  desc.add<double>("ECALisolAnnulus_maximumSumEtCut");
60 
61  fillProducerDescriptions(desc); // inherited from the base
62 
63  descriptions.add("caloRecoTauDiscriminationByIsolation", desc);
64 }
65 
66 DEFINE_FWK_MODULE(CaloRecoTauDiscriminationByIsolation);
67 
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
fixed size matrix