26 if (conemetric==
"DR"){
28 }
else if(conemetric==
"angle"){
30 }
else if(conemetric==
"area"){
34 double coneangle=theFixedAreaCone(myVector.theta(),myVector.phi(),0,conesize,errorFlag);
35 if (errorFlag!=0)
return theFilteredPFCandsInCone;
38 return theFilteredPFCandsInCone;
42 return theFilteredPFCandsInCone;
46 return theFilteredPFCandsInCone;
51 TrackRef PFChargedHadrCand_track=(**iPFCand).trackRef();
52 if (!PFChargedHadrCand_track)
continue;
53 if (fabs((*PFChargedHadrCand_track).dz(myPV.
position())-refpoint_Z)<=PFChargedHadrCand_tracktorefpoint_maxDZ) filteredPFChargedHadrCands.
push_back(*iPFCand);
56 return theFilteredPFCandsInCone;
60 return theFilteredPFCandsInCone;
64 return theFilteredPFCandsInCone;
69 std::pair<PFCandidateRefVector,PFCandidateRefVector> myPFGammaCandsInEllipse =
PFCandidatesInEllipse_(leadCand_, rPhi, rEta, PFGammaCands_);
74 if((**iPFGammaCand).pt() <= maxPt) theFilteredPFGammaCandsInEllipse.
push_back(*iPFGammaCand);
75 else thePFGammaCandsOutEllipse.
push_back(*iPFGammaCand);
77 std::pair<PFCandidateRefVector, PFCandidateRefVector> theFilteredPFGammaCandsInOutEllipse(theFilteredPFGammaCandsInEllipse, thePFGammaCandsOutEllipse);
79 return theFilteredPFGammaCandsInOutEllipse;
90 if (outercone_metric==
"DR"){
91 if (innercone_metric==
"DR"){
93 }
else if(innercone_metric==
"angle"){
95 }
else if(innercone_metric==
"area"){
99 double innercone_angle=theFixedAreaSignalCone(myVector.theta(),myVector.phi(),0,innercone_size,errorFlag);
100 if (errorFlag!=0)
return theFilteredPFCandsInAnnulus;
103 }
else if(outercone_metric==
"angle"){
104 if (innercone_metric==
"DR"){
106 }
else if(innercone_metric==
"angle"){
108 }
else if(innercone_metric==
"area"){
112 double innercone_angle=theFixedAreaSignalCone(myVector.theta(),myVector.phi(),0,innercone_size,errorFlag);
113 if (errorFlag!=0)
return theFilteredPFCandsInAnnulus;
116 }
else if(outercone_metric==
"area"){
120 if (innercone_metric==
"DR"){
122 }
else if(innercone_metric==
"angle"){
123 double outercone_angle=theFixedAreaSignalCone(myVector.theta(),myVector.phi(),innercone_size,outercone_size,errorFlag);
124 if (errorFlag!=0)
return theFilteredPFCandsInAnnulus;
126 }
else if(innercone_metric==
"area"){
127 double innercone_angle=theFixedAreaSignalCone(myVector.theta(),myVector.phi(),0,innercone_size,errorFlag);
128 if (errorFlag!=0)
return theFilteredPFCandsInAnnulus;
129 double outercone_angle=theFixedAreaSignalCone(myVector.theta(),myVector.phi(),innercone_angle,outercone_size,errorFlag);
130 if (errorFlag!=0)
return theFilteredPFCandsInAnnulus;
134 return theFilteredPFCandsInAnnulus;
138 return theFilteredPFCandsInAnnulus;
142 return theFilteredPFCandsInAnnulus;
147 TrackRef PFChargedHadrCand_track=(**iPFCand).trackRef();
148 if (!PFChargedHadrCand_track)
continue;
149 if (fabs((*PFChargedHadrCand_track).dz(myPV.
position())-refpoint_Z)<=PFChargedHadrCand_tracktorefpoint_maxDZ) filteredPFChargedHadrCands.
push_back(*iPFCand);
152 return theFilteredPFCandsInAnnulus;
156 return theFilteredPFCandsInAnnulus;
160 return theFilteredPFCandsInAnnulus;
168 if (theFilteredPFCandsInCone.
size()>0.){
170 if((*iPFCand)->pt()>pt_cut) {
171 myleadPFCand=*iPFCand;
172 pt_cut=(**iPFCand).pt();
182 if (theFilteredPFCandsInCone.
size()>0){
184 if((*iPFCand)->pt()>pt_cut) {
185 myleadPFCand=*iPFCand;
186 pt_cut=(**iPFCand).pt();
198 if (theFilteredPFCandsInCone.
size()>0.){
200 if((*iPFCand)->pt()>pt_cut) {
201 myleadPFCand=*iPFCand;
202 pt_cut=(**iPFCand).pt();
212 if (theFilteredPFCandsInCone.
size()>0){
214 if((*iPFCand)->pt()>pt_cut) {
215 myleadPFCand=*iPFCand;
216 pt_cut=(**iPFCand).pt();
228 if (theFilteredPFCandsInCone.
size()>0.){
230 if((*iPFCand)->pt()>pt_cut) {
231 myleadPFCand=*iPFCand;
232 pt_cut=(**iPFCand).pt();
242 if (theFilteredPFCandsInCone.
size()>0){
244 if((*iPFCand)->pt()>pt_cut) {
245 myleadPFCand=*iPFCand;
246 pt_cut=(**iPFCand).pt();
258 if (theFilteredPFCandsInCone.
size()>0.){
260 if((*iPFCand)->pt()>pt_cut) {
261 myleadPFCand=*iPFCand;
262 pt_cut=(**iPFCand).pt();
272 if (theFilteredPFCandsInCone.
size()>0){
274 if((*iPFCand)->pt()>pt_cut) {
275 myleadPFCand=*iPFCand;
276 pt_cut=(**iPFCand).pt();
287 iPFCand != theInputCands.
end();
290 if ( (*iPFCand)->pt() >
minPt )
300 const double minChargedSize,
const double maxChargedSize,
const double minNeutralSize,
const double maxNeutralSize,
301 const double minChargedPt,
const double minNeutralPt,
302 const string& outlierCollectorConeMetric,
const double outlierCollectionMaxSize,
306 if (theChargedCands.
empty() && theGammaCands.
empty())
315 if (filteredCands.
empty())
320 unsigned int numberOfCandidates = filteredCands.
size();
321 std::vector<uint32_t> filteredCandIndexes(numberOfCandidates);
322 for(uint32_t theIndex = 0; theIndex < numberOfCandidates; theIndex++)
323 filteredCandIndexes[theIndex] = theIndex;
328 sort(filteredCandIndexes.begin(), filteredCandIndexes.end(), myAngularSorter);
331 for(std::vector<uint32_t>::const_iterator theSortedIndex = filteredCandIndexes.begin();
332 theSortedIndex != filteredCandIndexes.end();
335 sortedCands.
push_back(filteredCands.
at(*theSortedIndex));
340 double totalEnergySoFar = (**signalObjectCandidate).energy();
341 double totalEtSoFar = (**signalObjectCandidate).et();
343 double currentDelToCenter = ptrToMetricFunction(leadTrackVector, axisVectorSoFar);
345 ++signalObjectCandidate;
346 bool doneBuilding =
false;
347 while (!doneBuilding && signalObjectCandidate != sortedCands.end())
352 testAxis += (**signalObjectCandidate).momentum();
353 currentDelToCenter = ptrToMetricFunction((**signalObjectCandidate).momentum(), testAxis);
354 double testEnergy = totalEnergySoFar + (**signalObjectCandidate).energy();
355 double testEt = totalEtSoFar + (**signalObjectCandidate).et();
356 bool isCharged = (**signalObjectCandidate).charge();
357 bool addThisObject =
true;
358 if (currentDelToCenter > ((isCharged)?maxChargedSize:maxNeutralSize) ) {
360 addThisObject =
false;
362 else if (currentDelToCenter > ((isCharged)?minChargedSize:minNeutralSize) )
365 double cutOffQuantity = coneSizeFormula.Eval(testEnergy, testEt);
366 if (currentDelToCenter > cutOffQuantity)
367 addThisObject =
false;
368 else if (useScanningAxis)
372 if (ptrToMetricFunction(testAxis, leadTrackVector) > cutOffQuantity)
373 addThisObject =
false;
378 axisVectorSoFar = testAxis;
379 totalEnergySoFar = testEnergy;
380 totalEtSoFar = testEt;
381 ++signalObjectCandidate;
389 double largest3DOpeningAngleSignal = 0.;
391 iterCand != signalObjectCandidate;
395 if (angleToAxis > largest3DOpeningAngleSignal)
396 largest3DOpeningAngleSignal = angleToAxis;
398 if ((*iterCand)->charge())
399 signalChargedObjects.
push_back(*iterCand);
406 double outlierCollectionComputedMaxSize = 0;
408 if (!outlierCollectorConeMetric.compare(
"angle"))
411 outlierCollectionComputedMaxSize = outlierCollectionMaxSize;
412 }
else if (!outlierCollectorConeMetric.compare(
"area"))
420 int errorFlagForConeSizeCalc = 0;
421 outlierCollectionComputedMaxSize = theFixedAreaCone(axisVectorSoFar.theta(), axisVectorSoFar.phi(), largest3DOpeningAngleSignal, outlierCollectionMaxSize, errorFlagForConeSizeCalc);
422 if (errorFlagForConeSizeCalc != 0)
424 edm::LogError(
"PFRecoTauAlgorithm") <<
"Error: " << errorFlagForConeSizeCalc <<
" when calculated const area annulus. Taking all non-signal PFJet consituents!";
425 outlierCollectionComputedMaxSize = 1000.;
427 }
else if (!outlierCollectorConeMetric.compare(
"DR"))
430 outlierCollectionComputedMaxSize = outlierCollectionMaxSize;
434 edm::LogWarning(
"PFRecoTauAlgorithm") <<
"Error in computeInsideOutContents(...): Outlier (isolation) collector cone metric (" << outlierCollectorConeMetric
435 <<
") is not recognized! All non-signal associated PFJet constituents will be included in the outliers!";
439 iterCand != sortedCands.end();
443 double outlierOpeningQuantity = outlierCollectionCalculator(axisVectorSoFar, (*iterCand)->momentum());
444 if (outlierOpeningQuantity > outlierCollectionComputedMaxSize)
break;
446 if ((*iterCand)->charge())
447 outlierChargedObjects.
push_back(*iterCand);
449 outlierGammaObjects.
push_back(*iterCand);
457 double myDiscriminator=0.;
459 return myDiscriminator;
461 double PFTauElementsOperators::discriminatorByIsolPFCandsN(
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
int IsolPFCands_maxN){
462 double myDiscriminator=0.;
464 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
465 else myleadPFCand=
leadPFCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
466 if(!myleadPFCand)
return myDiscriminator;
470 if ((
int)isolPFCands.
size()<=IsolPFCands_maxN) myDiscriminator=1;
471 return myDiscriminator;
473 double PFTauElementsOperators::discriminatorByIsolPFCandsN(
math::XYZVector myVector,
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
int IsolPFCands_maxN){
474 double myDiscriminator=0;
476 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
477 else myleadPFCand=
leadPFCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
478 if(!myleadPFCand)
return myDiscriminator;
482 if ((
int)isolPFCands.
size()<=IsolPFCands_maxN) myDiscriminator=1;
483 return myDiscriminator;
486 double myDiscriminator=0.;
488 return myDiscriminator;
490 double PFTauElementsOperators::discriminatorByIsolPFChargedHadrCandsN(
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
int IsolPFChargedHadrCands_maxN){
491 double myDiscriminator=0.;
493 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
494 else myleadPFCand=
leadPFCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
495 if(!myleadPFCand)
return myDiscriminator;
499 if ((
int)isolPFChargedHadrCands.
size()<=IsolPFChargedHadrCands_maxN) myDiscriminator=1;
500 return myDiscriminator;
502 double PFTauElementsOperators::discriminatorByIsolPFChargedHadrCandsN(
math::XYZVector myVector,
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
int IsolPFChargedHadrCands_maxN){
503 double myDiscriminator=0;
505 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
506 else myleadPFCand=
leadPFCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
507 if(!myleadPFCand)
return myDiscriminator;
511 if ((
int)isolPFChargedHadrCands.
size()<=IsolPFChargedHadrCands_maxN) myDiscriminator=1;
512 return myDiscriminator;
515 double myDiscriminator=0.;
517 return myDiscriminator;
519 double PFTauElementsOperators::discriminatorByIsolPFNeutrHadrCandsN(
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
int IsolPFNeutrHadrCands_maxN){
520 double myDiscriminator=0.;
522 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
523 else myleadPFCand=
leadPFCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
524 if(!myleadPFCand)
return myDiscriminator;
528 if ((
int)isolPFNeutrHadrCands.
size()<=IsolPFNeutrHadrCands_maxN) myDiscriminator=1;
529 return myDiscriminator;
531 double PFTauElementsOperators::discriminatorByIsolPFNeutrHadrCandsN(
math::XYZVector myVector,
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
int IsolPFNeutrHadrCands_maxN){
532 double myDiscriminator=0;
534 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
535 else myleadPFCand=
leadPFCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
536 if(!myleadPFCand)
return myDiscriminator;
540 if ((
int)isolPFNeutrHadrCands.
size()<=IsolPFNeutrHadrCands_maxN) myDiscriminator=1;
541 return myDiscriminator;
544 double myDiscriminator=0.;
546 return myDiscriminator;
548 double PFTauElementsOperators::discriminatorByIsolPFGammaCandsN(
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
int IsolPFGammaCands_maxN){
549 double myDiscriminator=0.;
551 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
552 else myleadPFCand=
leadPFCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
553 if(!myleadPFCand)
return myDiscriminator;
557 if ((
int)isolPFGammaCands.
size()<=IsolPFGammaCands_maxN) myDiscriminator=1;
558 return myDiscriminator;
560 double PFTauElementsOperators::discriminatorByIsolPFGammaCandsN(
math::XYZVector myVector,
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
int IsolPFGammaCands_maxN){
561 double myDiscriminator=0;
563 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
564 else myleadPFCand=
leadPFCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
565 if(!myleadPFCand)
return myDiscriminator;
569 if ((
int)isolPFGammaCands.
size()<=IsolPFGammaCands_maxN) myDiscriminator=1;
570 return myDiscriminator;
573 double myIsolPFCandsEtSum=0.;
574 double myDiscriminator=0.;
576 if (myIsolPFCandsEtSum<=IsolPFCands_maxEtSum) myDiscriminator=1;
577 return myDiscriminator;
579 double PFTauElementsOperators::discriminatorByIsolPFCandsEtSum(
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
double IsolPFCands_maxEtSum){
580 double myIsolPFCandsEtSum=0.;
581 double myDiscriminator=0.;
583 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
584 else myleadPFCand=
leadPFCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
585 if(!myleadPFCand)
return myDiscriminator;
590 if (myIsolPFCandsEtSum<=IsolPFCands_maxEtSum) myDiscriminator=1;
591 return myDiscriminator;
593 double PFTauElementsOperators::discriminatorByIsolPFCandsEtSum(
math::XYZVector myVector,
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
double IsolPFCands_maxEtSum){
594 double myIsolPFCandsEtSum=0.;
595 double myDiscriminator=0;
597 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
598 else myleadPFCand=
leadPFCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
599 if(!myleadPFCand)
return myDiscriminator;
604 if (myIsolPFCandsEtSum<=IsolPFCands_maxEtSum) myDiscriminator=1;
605 return myDiscriminator;
608 double myIsolPFCandsEtSum=0.;
609 double myDiscriminator=0.;
611 if (myIsolPFCandsEtSum<=IsolPFChargedHadrCands_maxEtSum) myDiscriminator=1;
612 return myDiscriminator;
614 double PFTauElementsOperators::discriminatorByIsolPFChargedHadrCandsEtSum(
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
double IsolPFChargedHadrCands_maxEtSum){
615 double myIsolPFCandsEtSum=0.;
616 double myDiscriminator=0.;
618 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
619 else myleadPFCand=
leadPFCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
620 if(!myleadPFCand)
return myDiscriminator;
625 if (myIsolPFCandsEtSum<=IsolPFChargedHadrCands_maxEtSum) myDiscriminator=1;
626 return myDiscriminator;
628 double PFTauElementsOperators::discriminatorByIsolPFChargedHadrCandsEtSum(
math::XYZVector myVector,
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
double IsolPFChargedHadrCands_maxEtSum){
629 double myIsolPFCandsEtSum=0.;
630 double myDiscriminator=0;
632 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
633 else myleadPFCand=
leadPFCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
634 if(!myleadPFCand)
return myDiscriminator;
639 if (myIsolPFCandsEtSum<=IsolPFChargedHadrCands_maxEtSum) myDiscriminator=1;
640 return myDiscriminator;
643 double myIsolPFCandsEtSum=0.;
644 double myDiscriminator=0.;
646 if (myIsolPFCandsEtSum<=IsolPFNeutrHadrCands_maxEtSum) myDiscriminator=1;
647 return myDiscriminator;
649 double PFTauElementsOperators::discriminatorByIsolPFNeutrHadrCandsEtSum(
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
double IsolPFNeutrHadrCands_maxEtSum){
650 double myIsolPFCandsEtSum=0.;
651 double myDiscriminator=0.;
653 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
654 else myleadPFCand=
leadPFCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
655 if(!myleadPFCand)
return myDiscriminator;
660 if (myIsolPFCandsEtSum<=IsolPFNeutrHadrCands_maxEtSum) myDiscriminator=1;
661 return myDiscriminator;
663 double PFTauElementsOperators::discriminatorByIsolPFNeutrHadrCandsEtSum(
math::XYZVector myVector,
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
double IsolPFNeutrHadrCands_maxEtSum){
664 double myIsolPFCandsEtSum=0.;
665 double myDiscriminator=0;
667 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
668 else myleadPFCand=
leadPFCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
669 if(!myleadPFCand)
return myDiscriminator;
674 if (myIsolPFCandsEtSum<=IsolPFNeutrHadrCands_maxEtSum) myDiscriminator=1;
675 return myDiscriminator;
678 double myIsolPFCandsEtSum=0.;
679 double myDiscriminator=0.;
681 if (myIsolPFCandsEtSum<=IsolPFGammaCands_maxEtSum) myDiscriminator=1;
682 return myDiscriminator;
684 double PFTauElementsOperators::discriminatorByIsolPFGammaCandsEtSum(
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
double IsolPFGammaCands_maxEtSum){
685 double myIsolPFCandsEtSum=0.;
686 double myDiscriminator=0.;
688 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
689 else myleadPFCand=
leadPFCand(matchingcone_metric,matchingcone_size,minPt_leadPFCand);
690 if(!myleadPFCand)
return myDiscriminator;
691 if(signalcone_size>=isolcone_size)
return 1.;
695 if (myIsolPFCandsEtSum<=IsolPFGammaCands_maxEtSum) myDiscriminator=1;
696 return myDiscriminator;
698 double PFTauElementsOperators::discriminatorByIsolPFGammaCandsEtSum(
math::XYZVector myVector,
string matchingcone_metric,
double matchingcone_size,
string signalcone_metric,
double signalcone_size,
string isolcone_metric,
double isolcone_size,
bool useOnlyChargedHadrforleadPFCand,
double minPt_leadPFCand,
double minPt_PFCand,
double IsolPFGammaCands_maxEtSum){
699 double myIsolPFCandsEtSum=0.;
700 double myDiscriminator=0;
702 if (useOnlyChargedHadrforleadPFCand) myleadPFCand=
leadPFChargedHadrCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
703 else myleadPFCand=
leadPFCand(myVector,matchingcone_metric,matchingcone_size,minPt_leadPFCand);
704 if(!myleadPFCand)
return myDiscriminator;
709 if (myIsolPFCandsEtSum<=IsolPFGammaCands_maxEtSum) myDiscriminator=1;
710 return myDiscriminator;
ElementsInEllipse< reco::PFCandidate, reco::PFCandidateCollection > PFCandidatesInEllipse_
const PFCandidateRefVector & isolationPFCands() const
PFCandidates in isolation region.
reco::PFCandidateRefVector PFGammaCands_
reco::PFCandidateRefVector PFNeutrHadrCands_
ElementsInCone< math::XYZVector, Angle< math::XYZVector >, reco::PFCandidateCollection > PFCandsinCone_Anglemetric_
reco::PFCandidateRefVector IsolPFChargedHadrCands_
double discriminatorByIsolPFGammaCandsN(int IsolPFCands_maxN=0)
reco::PFCandidateRefVector PFCands_
reco::PFCandidateRefVector PFCandsInCone(const reco::PFCandidateRefVector PFCands, const math::XYZVector myVector, const std::string conemetric, const double conesize, const double minPt) const
Angle< math::XYZVector > metricAngle_
ElementsInAnnulus< math::XYZVector, Angle< math::XYZVector >, DeltaR< math::XYZVector >, reco::PFCandidateCollection > PFCandsinAnnulus_innerAngleouterDRmetrics_
reco::PFCandidateRefVector PFChargedHadrCands_
double discriminatorByIsolPFChargedHadrCandsN(int IsolPFCands_maxN=0)
ElementsInCone< math::XYZVector, DeltaR< math::XYZVector >, reco::PFCandidateCollection > PFCandsinCone_DRmetric_
const_iterator end() const
Termination of iteration.
bool empty() const
Is the RefVector empty.
reco::PFCandidateRefVector PFNeutrHadrCandsInCone(const math::XYZVector myVector, const std::string conemetric, const double conesize, const double minPt) const
const Point & position() const
position
reco::PFCandidateRefVector PFGammaCandsInCone(const math::XYZVector myVector, const std::string conemetric, const double conesize, const double minPt) const
reco::PFCandidateRefVector IsolPFCands_
const_iterator begin() const
Initialize an iterator over the RefVector.
reco::PFCandidateRefVector PFChargedHadrCandsInAnnulus(const math::XYZVector myVector, const std::string innercone_metric, const double innercone_size, const std::string outercone_metric, const double outercone_size, const double minPt) const
void computeInsideOutContents(const reco::PFCandidateRefVector &theChargedCands, const reco::PFCandidateRefVector &theGammaCands, const math::XYZVector leadTrackVector, const TFormula &coneSizeFormula, double(*ptrToMetricFunction)(const math::XYZVector &, const math::XYZVector &), const double minChargedSize, const double maxChargedSize, const double minNeutralSize, const double maxNeutralSize, const double minChargedPt, const double minNeutralPt, const std::string &outlierCollectorConeMetric, const double outlierCollectorConeSize, reco::PFCandidateRefVector &signalChargedObjects, reco::PFCandidateRefVector &outlierChargedObjects, reco::PFCandidateRefVector &signalGammaObjects, reco::PFCandidateRefVector &outlierGammaObjects, bool useScanningAxis)
compute size of cone using the Inside-Out cone (Author Evan Friis, UC Davis)
ElementsInAnnulus< math::XYZVector, Angle< math::XYZVector >, Angle< math::XYZVector >, reco::PFCandidateCollection > PFCandsinAnnulus_innerAngleouterAnglemetrics_
double AreaMetric_recoElements_maxabsEta_
std::pair< reco::PFCandidateRefVector, reco::PFCandidateRefVector > PFGammaCandsInOutEllipse(const reco::PFCandidateRefVector, const reco::PFCandidate, double rPhi, double rEta, double maxPt) const
ElementsInAnnulus< math::XYZVector, DeltaR< math::XYZVector >, Angle< math::XYZVector >, reco::PFCandidateCollection > PFCandsinAnnulus_innerDRouterAnglemetrics_
double discriminatorByIsolPFCandsEtSum(double IsolPFCands_maxEtSum=0)
double discriminatorByIsolPFGammaCandsEtSum(double IsolPFCands_maxEtSum=0)
const PFCandidateRefVector & isolationPFGammaCands() const
Gamma candidates in isolation region.
double discriminatorByIsolPFCandsN(int IsolPFCands_maxN=0)
reco::PFCandidateRefVector IsolPFGammaCands_
PFTauElementsOperators(reco::PFTau &thePFTau)
void setAcceptanceLimit(double etaMaxTrackingAcceptance)
double discriminatorByIsolPFNeutrHadrCandsN(int IsolPFCands_maxN=0)
void reserve(size_type n)
Reserve space for RefVector.
reco::TrackRefVector Tracks_
const PFTauTagInfoRef & pfTauTagInfoRef() const
reco::PFCandidateRef leadPFNeutrHadrCand(const std::string matchingcone_metric, const double matchingcone_size, const double minPt) const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
edm::RefVector< PFCandidateCollection > PFCandidateRefVector
vector of reference to GenParticleCandidate in the same collection
reco::PFCandidateRefVector PFChargedHadrCandsInCone(const math::XYZVector myVector, const std::string conemetric, const double conesize, const double minPt) const
reco::PFCandidateRefVector PFCandsInAnnulus(const reco::PFCandidateRefVector PFCands, const math::XYZVector myVector, const std::string innercone_metric, const double innercone_size, const std::string outercone_metric, const double outercone_size, const double minPt) const
reco::PFCandidateRef leadPFChargedHadrCand(const std::string matchingcone_metric, const double matchingcone_size, const double minPt) const
DeltaR< math::XYZVector > metricDR_
void setAreaMetricrecoElementsmaxabsEta(double x)
Particle reconstructed by the particle flow algorithm.
value_type const at(size_type idx) const
Retrieve an element of the RefVector.
reco::PFCandidateRef leadPFCand(const std::string matchingcone_metric, const double matchingcone_size, const double minPt) const
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
double discriminatorByIsolPFChargedHadrCandsEtSum(std::string matchingcone_metric, double matchingcone_size, std::string signalcone_metric, double signalcone_size, std::string isolcone_metric, double isolcone_size, bool useOnlyChargedHadrforleadPFCand, double minPt_leadPFCand, double minPt_PFCand, double IsolPFCands_maxEtSum=0)
double discriminatorByIsolPFNeutrHadrCandsEtSum(double IsolPFCands_maxEtSum=0)
ElementsInAnnulus< math::XYZVector, DeltaR< math::XYZVector >, DeltaR< math::XYZVector >, reco::PFCandidateCollection > PFCandsinAnnulus_innerDRouterDRmetrics_
void copyCandRefsFilteredByPt(const reco::PFCandidateRefVector &theInputCands, reco::PFCandidateRefVector &theOutputCands, const double minPt)
append elements of theInputCands that pass Pt requirement to the end of theOutputCands ...
reco::PFCandidateRef leadPFGammaCand(const std::string matchingcone_metric, const double matchingcone_size, const double minPt) const
reco::PFCandidateRefVector PFGammaCandsInAnnulus(const math::XYZVector myVector, const std::string innercone_metric, const double innercone_size, const std::string outercone_metric, const double outercone_size, const double minPt) const
const PFCandidateRefVector & isolationPFNeutrHadrCands() const
reco::PFCandidateRefVector IsolPFNeutrHadrCands_
reco::PFCandidateRefVector PFNeutrHadrCandsInAnnulus(const math::XYZVector myVector, const std::string innercone_metric, const double innercone_size, const std::string outercone_metric, const double outercone_size, const double minPt) const
const PFCandidateRefVector & isolationPFChargedHadrCands() const
Charged candidates in isolation region.