2 #include <boost/foreach.hpp>
25 qualityCuts_(pset.getParameter<edm::
ParameterSet>(
"qualityCuts")) {
27 "ApplyDiscriminationByTrackerIsolation");
29 "ApplyDiscriminationByECALIsolation");
31 applyOccupancyCut_ = pset.
getParameter<
bool>(
"applyOccupancyCut");
32 maximumOccupancy_ = pset.
getParameter<uint32_t>(
"maximumOccupancy");
34 applySumPtCut_ = pset.
getParameter<
bool>(
"applySumPtCut");
35 maximumSumPt_ = pset.
getParameter<
double>(
"maximumSumPtCut");
38 "applyRelativeSumPtCut");
44 if (pset.
exists(
"customOuterCone")) {
45 customIsoCone_ = pset.
getParameter<
double>(
"customOuterCone");
54 double discriminate(
const PFTauRef& pfTau);
86 event.getByLabel(pvProducer_, primaryVertices);
89 if( primaryVertices->size() ) {
90 currentPV_ = *(primaryVertices->begin());
92 const double smearedPVsigmaY = 0.0015;
93 const double smearedPVsigmaX = 0.0015;
94 const double smearedPVsigmaZ = 0.005;
96 SimPVError(0,0) = smearedPVsigmaX*smearedPVsigmaX;
97 SimPVError(1,1) = smearedPVsigmaY*smearedPVsigmaY;
98 SimPVError(2,2) = smearedPVsigmaZ*smearedPVsigmaZ;
104 currentPV_ =
Vertex(blankVertex, SimPVError,1,1,1);
110 std::vector<LeafCandidate> isoObjects;
112 if (includeTracks_) {
113 qualityCuts_.isolationChargedObjects(*pfTau, currentPV_, isoObjects);
116 if (includeGammas_) {
117 qualityCuts_.isolationGammaObjects(*pfTau, isoObjects);
123 if (customIsoCone_ >= 0.) {
124 DRFilter
filter(pfTau->p4(), 0, customIsoCone_);
126 std::remove_if(isoObjects.begin(), isoObjects.end(), std::not1(
filter));
129 bool failsOccupancyCut =
false;
130 bool failsSumPtCut =
false;
131 bool failsRelativeSumPtCut =
false;
134 failsOccupancyCut = ( isoObjects.size() > maximumOccupancy_ );
137 if( applySumPtCut_ || applyRelativeSumPtCut_ ) {
140 totalP4 += isoObject.
p4();
143 failsSumPtCut = (totalP4.pt() > maximumSumPt_);
146 failsRelativeSumPtCut = (
147 (pfTau->pt() > 0 ? totalP4.pt()/pfTau->pt() : 0 )
148 > maximumRelativeSumPt_ );
151 bool fails = (applyOccupancyCut_ && failsOccupancyCut) ||
152 (applySumPtCut_ && failsSumPtCut) ||
153 (applyRelativeSumPtCut_ && failsRelativeSumPtCut) ;
155 return (fails ? 0. : 1.);
PFRecoTauDiscriminationByIsolation(const edm::ParameterSet &pset)
T getParameter(std::string const &) const
~PFRecoTauDiscriminationByIsolation()
bool exists(std::string const ¶meterName) const
checks if a parameter exists
math::Error< dimension >::type Error
covariance error matrix (3x3)
double maximumRelativeSumPt_
bool applyRelativeSumPtCut_
PFTauQualityCutWrapper qualityCuts_
math::XYZPoint Point
point in the space
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void beginEvent(const edm::Event &evt, const edm::EventSetup &evtSetup)
DEFINE_FWK_MODULE(CosmicTrackingParticleSelector)
tuple filter
USE THIS FOR SKIMMED TRACKS process.p = cms.Path(process.hltLevel1GTSeed*process.skimming*process.offlineBeamSpot*process.TrackRefitter2) OTHERWISE USE THIS.
uint32_t maximumOccupancy_
double discriminate(const PFTauRef &pfTau)
edm::InputTag pvProducer_
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.