Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:52

0001 #include "DataFormats/BTauReco/interface/TauImpactParameterInfo.h"
0002 #include "DataFormats/TrackReco/interface/Track.h"
0003 
0004 using namespace edm;
0005 using namespace reco;
0006 using namespace std;
0007 
0008 float reco::TauImpactParameterInfo::discriminator(
0009     double ip_min, double ip_max, double sip_min, bool use_sign, bool use3D) const {
0010   double discriminator = isolatedTaus->discriminator();
0011 
0012   const TrackRef leadingTrack = isolatedTaus->leadingSignalTrack(0.4, 1.);
0013 
0014   if (!leadingTrack.isNull()) {
0015     const TauImpactParameterTrackData* ipData = getTrackData(leadingTrack);
0016     Measurement1D ip = ipData->transverseIp;
0017     if (use3D)
0018       ip = ipData->ip3D;
0019 
0020     if (ip.value() < ip_min || ip.value() > ip_max || ip.significance() < sip_min) {
0021       discriminator = 0;
0022     }
0023   }
0024   return discriminator;
0025 }
0026 float reco::TauImpactParameterInfo::discriminator() const {
0027   //default discriminator: returns the value of the discriminator of the jet tag
0028   return isolatedTaus->discriminator();
0029 }
0030 
0031 const reco::TauImpactParameterTrackData* TauImpactParameterInfo::getTrackData(const reco::TrackRef& trackRef) const {
0032   reco::TrackTauImpactParameterAssociationCollection::const_iterator iter = trackDataMap.find(trackRef);
0033 
0034   if (iter != trackDataMap.end())
0035     return &(iter->val);
0036 
0037   return nullptr;  // if track not found return 0
0038 }
0039 
0040 void reco::TauImpactParameterInfo::storeTrackData(const reco::TrackRef& trackRef,
0041                                                   const reco::TauImpactParameterTrackData& trackData) {
0042   trackDataMap.insert(trackRef, trackData);
0043 }
0044 
0045 void reco::TauImpactParameterInfo::setIsolatedTauTag(const IsolatedTauTagInfoRef& isolationRef) {
0046   isolatedTaus = isolationRef;
0047 }
0048 
0049 const IsolatedTauTagInfoRef& reco::TauImpactParameterInfo::getIsolatedTauTag() const { return isolatedTaus; }