CMS 3D CMS Logo

CaloRecoTauDiscriminationByLeadingTrackPtCut.cc
Go to the documentation of this file.
1 /*
2  * class CaloRecoTauDiscriminationByLeadingTrackPtCut
3  * created : October 08 2008,
4  * revised : ,
5  * Authors : Simone Gennai (SNS), Evan Friis (UC Davis)
6  */
7 
9 
11 
12 using namespace reco;
13 
15  public:
17  minPtLeadTrack_ = iConfig.getParameter<double>("MinPtLeadingTrack");
18  }
20  double discriminate(const CaloTauRef& theCaloTauRef) const override;
21 
22  private:
24 };
25 
27 {
28  double leadTrackPt_ = -1;
29 
30  if( theCaloTauRef->leadTrack().isNonnull() )
31  {
32  leadTrackPt_ = theCaloTauRef->leadTrack()->pt();
33  }
34 
35  return ( (leadTrackPt_ > minPtLeadTrack_) ? 1. : 0. );
36 }
37 
39 
40 /*
41  edm::Handle<CaloTauCollection> theCaloTauCollection;
42  iEvent.getByLabel(CaloTauProducer_,theCaloTauCollection);
43 
44  double theleadTrackPtCutDiscriminator = 0.;
45  auto theCaloTauDiscriminatorByLeadingTrackPtCut = std::make_unique<CaloTauDiscriminator>(CaloTauRefProd(theCaloTauCollection));
46 
47  //loop over the CaloTau candidates
48  for(size_t iCaloTau=0;iCaloTau<theCaloTauCollection->size();++iCaloTau) {
49  CaloTauRef theCaloTauRef(theCaloTauCollection,iCaloTau);
50  CaloTau theCaloTau=*theCaloTauRef;
51 
52  // fill the AssociationVector object
53  if (!theCaloTau.leadTrack())
54  theleadTrackPtCutDiscriminator=0.;
55  else if(theCaloTau.leadTrack()->pt() > minPtLeadTrack_) theleadTrackPtCutDiscriminator=1.;
56 
57  theCaloTauDiscriminatorByLeadingTrackPtCut->setValue(iCaloTau,theleadTrackPtCutDiscriminator);
58  }
59 
60  iEvent.put(std::move(theCaloTauDiscriminatorByLeadingTrackPtCut));
61 
62 }
63 
64 */
T getParameter(std::string const &) const
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
double discriminate(const CaloTauRef &theCaloTauRef) const override
fixed size matrix