Main Page
Namespaces
Classes
Package Documentation
RecoTauTag
RecoTau
plugins
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
8
#include "
RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h
"
9
10
#include "
DataFormats/TrackReco/interface/Track.h
"
11
12
using namespace
reco
;
13
14
class
CaloRecoTauDiscriminationByLeadingTrackPtCut
final :
public
CaloTauDiscriminationProducerBase
{
15
public
:
16
explicit
CaloRecoTauDiscriminationByLeadingTrackPtCut
(
const
edm::ParameterSet
& iConfig):
CaloTauDiscriminationProducerBase
(iConfig){
17
minPtLeadTrack_ = iConfig.
getParameter
<
double
>(
"MinPtLeadingTrack"
);
18
}
19
~CaloRecoTauDiscriminationByLeadingTrackPtCut
(){}
20
double
discriminate(
const
CaloTauRef
& theCaloTauRef)
const override
;
21
22
private
:
23
double
minPtLeadTrack_
;
24
};
25
26
double
CaloRecoTauDiscriminationByLeadingTrackPtCut::discriminate
(
const
CaloTauRef
& theCaloTauRef)
const
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
38
DEFINE_FWK_MODULE
(
CaloRecoTauDiscriminationByLeadingTrackPtCut
);
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
*/
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition:
Ref.h:252
TauDiscriminationProducerBase.h
edm::Ref
Definition:
AssociativeIterator.h:51
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
CaloRecoTauDiscriminationByLeadingTrackPtCut::minPtLeadTrack_
double minPtLeadTrack_
Definition:
CaloRecoTauDiscriminationByLeadingTrackPtCut.cc:23
CaloRecoTauDiscriminationByLeadingTrackPtCut::CaloRecoTauDiscriminationByLeadingTrackPtCut
CaloRecoTauDiscriminationByLeadingTrackPtCut(const edm::ParameterSet &iConfig)
Definition:
CaloRecoTauDiscriminationByLeadingTrackPtCut.cc:16
CaloRecoTauDiscriminationByLeadingTrackPtCut::discriminate
double discriminate(const CaloTauRef &theCaloTauRef) const override
Definition:
CaloRecoTauDiscriminationByLeadingTrackPtCut.cc:26
CaloRecoTauDiscriminationByLeadingTrackPtCut
Definition:
CaloRecoTauDiscriminationByLeadingTrackPtCut.cc:14
CaloRecoTauDiscriminationByLeadingTrackPtCut::~CaloRecoTauDiscriminationByLeadingTrackPtCut
~CaloRecoTauDiscriminationByLeadingTrackPtCut()
Definition:
CaloRecoTauDiscriminationByLeadingTrackPtCut.cc:19
TauDiscriminationProducerBase
Definition:
TauDiscriminationProducerBase.h:51
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:43
edm::ParameterSet
Definition:
ParameterSet.h:36
Track.h
Generated for CMSSW Reference Manual by
1.8.11