PFNuclearInteraction

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
#ifndef _PFNuclarInteraction_H
#define _PFNuclarInteraction_H

// class which contains the secondary PFRecTracks
// this dataformat will be used to create PFBlockElementNuclTrack

// \author vincent roberfroid

#include "DataFormats/VertexReco/interface/NuclearInteraction.h"
#include "DataFormats/VertexReco/interface/NuclearInteractionFwd.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecTrack.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecTrackFwd.h"

namespace reco {
  class PFNuclearInteraction {
  public:
    typedef NuclearInteraction::trackRef_iterator trackRef_iterator;
    typedef PFRecTrackRefVector::const_iterator pfTrackref_iterator;

  public:
    PFNuclearInteraction() {}
    PFNuclearInteraction(const NuclearInteractionRef& nuclref, const PFRecTrackRefVector& pfSeconds)
        : nuclInterRef_(nuclref), pfSecTracks_(pfSeconds) {}

    /// \return the base reference to the primary track
    const edm::RefToBase<reco::Track>& primaryTrack() const { return nuclInterRef_->primaryTrack(); }

    /// \return first iterator over secondary tracks
    trackRef_iterator secondaryTracks_begin() const { return nuclInterRef_->secondaryTracks_begin(); }

    /// \return last iterator over secondary tracks
    trackRef_iterator secondaryTracks_end() const { return nuclInterRef_->secondaryTracks_end(); }

    /// \return first iterator over secondary PFRecTracks
    pfTrackref_iterator secPFRecTracks_begin() const { return pfSecTracks_.begin(); }

    /// \return last iterator over secondary PFRecTracks
    pfTrackref_iterator secPFRecTracks_end() const { return pfSecTracks_.end(); }

    /// \return the likelihood
    double likelihood() const { return nuclInterRef_->likelihood(); }

    /// \return the initial nuclear interaction
    const NuclearInteractionRef& nuclInterRef() const { return nuclInterRef_; }

    int secondaryTracksSize() const { return nuclInterRef_->secondaryTracksSize(); }

  private:
    // Reference to the initial NuclearInteraction
    NuclearInteractionRef nuclInterRef_;

    // Collection of the secondary PFRecTracks
    PFRecTrackRefVector pfSecTracks_;
  };

  /// collection of NuclearInteractions
  typedef std::vector<PFNuclearInteraction> PFNuclearInteractionCollection;
  /// persistent reference to a NuclearInteraction
  typedef edm::Ref<PFNuclearInteractionCollection> PFNuclearInteractionRef;
  /// vector of reference to Track in the same collection
  typedef edm::RefVector<PFNuclearInteractionCollection> PFNuclearInteractionRefVector;
}  // namespace reco
#endif