Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:23

0001 #ifndef DATAFORMAT_NUCLEARINTERACTION_
0002 #define DATAFORMAT_NUCLEARINTERACTION_
0003 
0004 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0005 #include "DataFormats/TrackReco/interface/Track.h"
0006 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0007 #include "DataFormats/VertexReco/interface/Vertex.h"
0008 
0009 namespace reco {
0010 
0011   class NuclearInteraction {
0012   public:
0013     typedef edm::RefVector<TrajectorySeedCollection> TrajectorySeedRefVector;
0014     typedef edm::Ref<TrajectorySeedCollection> TrajectorySeedRef;
0015     typedef reco::Vertex::trackRef_iterator trackRef_iterator;
0016     typedef TrajectorySeedRefVector::iterator seedRef_iterator;
0017 
0018     NuclearInteraction() {}
0019 
0020     NuclearInteraction(const TrajectorySeedRefVector& tseeds, const reco::Vertex& vtx, double lkh) {
0021       seeds_ = tseeds;
0022       vertex_ = vtx;
0023       likelihood_ = lkh;
0024     }
0025 
0026     /// return the base reference to the primary track
0027     const edm::RefToBase<reco::Track>& primaryTrack() const { return *(vertex_.tracks_begin()); }
0028 
0029     /// return the number of secondary tracks
0030     int secondaryTracksSize() const { return vertex_.tracksSize() - 1; }
0031 
0032     /// first iterator over secondary tracks
0033     trackRef_iterator secondaryTracks_begin() const { return vertex_.tracks_begin() + 1; }
0034 
0035     /// last iterator over secondary tracks
0036     trackRef_iterator secondaryTracks_end() const { return vertex_.tracks_end(); }
0037 
0038     /// return the number of seeds
0039     int seedsSize() const { return seeds_.size(); }
0040 
0041     /// return the seeds
0042     const TrajectorySeedRefVector& seeds() { return seeds_; }
0043 
0044     /// first iterator over seeds
0045     seedRef_iterator seeds_begin() const { return seeds_.begin(); }
0046 
0047     /// last iterator over seeds
0048     seedRef_iterator seeds_end() const { return seeds_.end(); }
0049 
0050     /// return the vertex
0051     const reco::Vertex& vertex() const { return vertex_; }
0052 
0053     /// return the likelihood ~ probability that the vertex is a real nuclear interaction
0054     double likelihood() const { return likelihood_; }
0055 
0056   private:
0057     /// The refitted primary track after removing eventually some outer rechits
0058     //reco::Track                 refittedPrimaryTrack_; // to be included in a futur version
0059 
0060     /// Reference to the TrajectorySeeds produced by NuclearSeedGenerator
0061     TrajectorySeedRefVector seeds_;
0062 
0063     /// The calculated vertex position
0064     reco::Vertex vertex_;
0065 
0066     /// Varaible used to measure the quality of the reconstructed nuclear interaction
0067     double likelihood_;
0068   };
0069 }  // namespace reco
0070 #endif