CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/DataFormats/BTauReco/src/TauImpactParameterInfo.cc

Go to the documentation of this file.
00001 #include "DataFormats/BTauReco/interface/TauImpactParameterInfo.h"
00002 #include "DataFormats/TrackReco/interface/Track.h" 
00003 
00004 using namespace edm;
00005 using namespace reco;
00006 using namespace std;
00007 
00008 float reco::TauImpactParameterInfo::discriminator (double ip_min,double ip_max,double sip_min,bool use_sign, bool use3D) const {
00009 
00010         double discriminator = isolatedTaus->discriminator();
00011 
00012         const TrackRef leadingTrack = isolatedTaus->leadingSignalTrack(0.4,1.);
00013 
00014         if(! leadingTrack.isNull()){
00015           const TauImpactParameterTrackData* ipData = getTrackData(leadingTrack);
00016           Measurement1D ip = ipData->transverseIp;
00017           if(use3D) ip = ipData->ip3D;
00018 
00019           if( ip.value() < ip_min ||
00020               ip.value() > ip_max ||
00021               ip.significance() < sip_min ){
00022                 discriminator = 0;
00023           }
00024         }
00025         return discriminator;
00026 }
00027 float reco::TauImpactParameterInfo::discriminator() const {
00028         //default discriminator: returns the value of the discriminator of the jet tag
00029         return isolatedTaus->discriminator();
00030 }
00031 
00032 const reco::TauImpactParameterTrackData* TauImpactParameterInfo::getTrackData(const reco::TrackRef & trackRef) const {
00033 
00034         reco::TrackTauImpactParameterAssociationCollection::const_iterator iter
00035             = trackDataMap.find(trackRef);
00036 
00037         if (iter != trackDataMap.end()) return &(iter->val);
00038 
00039         return 0; // if track not found return 0
00040 }
00041 
00042 void reco::TauImpactParameterInfo::storeTrackData(const reco::TrackRef & trackRef,
00043                   const reco::TauImpactParameterTrackData& trackData) {
00044 
00045         trackDataMap.insert(trackRef, trackData);
00046 }
00047 
00048 void reco::TauImpactParameterInfo::setIsolatedTauTag(const IsolatedTauTagInfoRef & isolationRef){
00049         isolatedTaus = isolationRef;
00050 }
00051 
00052 const IsolatedTauTagInfoRef& reco::TauImpactParameterInfo::getIsolatedTauTag() const {
00053         return isolatedTaus;
00054 }
00055