Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:39

0001 #ifndef SimDataFormats_Associations_TTrackTruthPair_h
0002 #define SimDataFormats_Associations_TTrackTruthPair_h
0003 
0004 #include "DataFormats/L1TrackTrigger/interface/TTTrack.h"
0005 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0006 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h"
0007 
0008 //The goal of this class is to allow easier access in FWLite where references can be hard to get
0009 //By storing a reference to the track and the tracking particle as well as the flags, it makes it much easier
0010 
0011 template <typename T>
0012 class TTTrackTruthPair {
0013 public:
0014   struct StatusFlags {
0015     enum Status { IsGenuine = 0x1, IsLooselyGenuine = 0x2, IsCombinatoric = 0x4, IsUnknown = 0x8 };
0016   };
0017 
0018 private:
0019   edm::Ref<std::vector<TTTrack<T> > > ttTrkRef_;
0020   edm::Ref<TrackingParticleCollection> trkPartRef_;
0021   char flags_;
0022 
0023 public:
0024   TTTrackTruthPair() : flags_(0) {}
0025   TTTrackTruthPair(const edm::Ref<std::vector<TTTrack<T> > >& ttTrkRef,
0026                    const edm::Ref<TrackingParticleCollection>& trkPartRef,
0027                    int flags)
0028       : ttTrkRef_(ttTrkRef), trkPartRef_(trkPartRef), flags_(flags) {}
0029 
0030   edm::Ref<std::vector<TTTrack<T> > > ttTrk() const { return ttTrkRef_; }
0031   edm::Ref<TrackingParticleCollection> trkPart() const { return trkPartRef_; }
0032   int flags() const { return flags_; }
0033   bool isGenuine() const { return (flags_ & StatusFlags::IsGenuine) != 0; }
0034   bool isLooselyGenuine() const { return (flags_ & StatusFlags::IsLooselyGenuine) != 0; }
0035   bool isCombinatoric() const { return (flags_ & StatusFlags::IsCombinatoric) != 0; }
0036   bool isUnknown() const { return (flags_ & StatusFlags::IsUnknown) != 0; }
0037 };
0038 
0039 #endif