Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:52

0001 #ifndef _PFNuclarInteraction_H
0002 #define _PFNuclarInteraction_H
0003 
0004 // class which contains the secondary PFRecTracks
0005 // this dataformat will be used to create PFBlockElementNuclTrack
0006 
0007 // \author vincent roberfroid
0008 
0009 #include "DataFormats/VertexReco/interface/NuclearInteraction.h"
0010 #include "DataFormats/VertexReco/interface/NuclearInteractionFwd.h"
0011 #include "DataFormats/ParticleFlowReco/interface/PFRecTrack.h"
0012 #include "DataFormats/ParticleFlowReco/interface/PFRecTrackFwd.h"
0013 
0014 namespace reco {
0015   class PFNuclearInteraction {
0016   public:
0017     typedef NuclearInteraction::trackRef_iterator trackRef_iterator;
0018     typedef PFRecTrackRefVector::const_iterator pfTrackref_iterator;
0019 
0020   public:
0021     PFNuclearInteraction() {}
0022     PFNuclearInteraction(const NuclearInteractionRef& nuclref, const PFRecTrackRefVector& pfSeconds)
0023         : nuclInterRef_(nuclref), pfSecTracks_(pfSeconds) {}
0024 
0025     /// \return the base reference to the primary track
0026     const edm::RefToBase<reco::Track>& primaryTrack() const { return nuclInterRef_->primaryTrack(); }
0027 
0028     /// \return first iterator over secondary tracks
0029     trackRef_iterator secondaryTracks_begin() const { return nuclInterRef_->secondaryTracks_begin(); }
0030 
0031     /// \return last iterator over secondary tracks
0032     trackRef_iterator secondaryTracks_end() const { return nuclInterRef_->secondaryTracks_end(); }
0033 
0034     /// \return first iterator over secondary PFRecTracks
0035     pfTrackref_iterator secPFRecTracks_begin() const { return pfSecTracks_.begin(); }
0036 
0037     /// \return last iterator over secondary PFRecTracks
0038     pfTrackref_iterator secPFRecTracks_end() const { return pfSecTracks_.end(); }
0039 
0040     /// \return the likelihood
0041     double likelihood() const { return nuclInterRef_->likelihood(); }
0042 
0043     /// \return the initial nuclear interaction
0044     const NuclearInteractionRef& nuclInterRef() const { return nuclInterRef_; }
0045 
0046     int secondaryTracksSize() const { return nuclInterRef_->secondaryTracksSize(); }
0047 
0048   private:
0049     // Reference to the initial NuclearInteraction
0050     NuclearInteractionRef nuclInterRef_;
0051 
0052     // Collection of the secondary PFRecTracks
0053     PFRecTrackRefVector pfSecTracks_;
0054   };
0055 
0056   /// collection of NuclearInteractions
0057   typedef std::vector<PFNuclearInteraction> PFNuclearInteractionCollection;
0058   /// persistent reference to a NuclearInteraction
0059   typedef edm::Ref<PFNuclearInteractionCollection> PFNuclearInteractionRef;
0060   /// vector of reference to Track in the same collection
0061   typedef edm::RefVector<PFNuclearInteractionCollection> PFNuclearInteractionRefVector;
0062 }  // namespace reco
0063 #endif