Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef FastSimDataFormats_NuclearInteractions_FSimDisplacedVertex_h
0002 #define FastSimDataFormats_NuclearInteractions_FSimDisplacedVertex_h
0003 
0004 #include "SimDataFormats/Vertex/interface/SimVertex.h"
0005 
0006 #include "FastSimDataFormats/NuclearInteractions/interface/FSimVertexType.h"
0007 
0008 #include <iostream>
0009 #include <vector>
0010 
0011 /*!\Data Format FSimDisplacedVertex
0012 
0013 \brief  A FSimDisplacedVertex extends the FSimVertex with VertexType information
0014 
0015 This data format is designed to combine the informations 
0016 from FSimVertex and its FSimVertexType. It is not part of 
0017 general FAMOS sequence and useful for 
0018 private productions and analyses. The format contains also 
0019 an integer identifier which may be optionally used 
0020 to associate it to reconstruced
0021 nuclear Interaction: boolean isRecoVertex and int recoVertexId;
0022 
0023 \author Maxime Gouzevitch
0024 \date November 2009
0025 */
0026 
0027 class FSimDisplacedVertex {
0028 public:
0029   FSimDisplacedVertex();
0030   FSimDisplacedVertex(const SimVertex& vertex,
0031                       unsigned id,
0032                       int motherId,
0033                       unsigned nCharged,
0034                       const std::vector<int>& daughterIds,
0035                       const FSimVertexType::VertexType vertexType);
0036 
0037   FSimDisplacedVertex(const FSimDisplacedVertex& other);
0038 
0039   virtual ~FSimDisplacedVertex() {}
0040 
0041   /// \return the SimVertex
0042   const SimVertex vertex() const { return vertex_; }
0043 
0044   /// \return the id of the vertex in the collection
0045   int id() const { return id_; }
0046 
0047   /// \return mother id in the track collection
0048   int motherId() const { return motherId_; }
0049 
0050   /// \return the number of daughters
0051   unsigned int nDaughters() const { return daughterIds_.size(); }
0052 
0053   /// \return the number of charged daughters
0054   unsigned int nChargedDaughters() const { return nCharged_; }
0055 
0056   /// \return vector of daughter ids
0057   const std::vector<int>& daughterIds() const { return daughterIds_; }
0058 
0059   /// \return the vertex type
0060   const FSimVertexType::VertexType vertexType() const { return vertexType_; }
0061 
0062   /// \return indicated if there is a Displaced Vertex associated
0063   const bool isRecoVertex() const { return isRecoVertex_; }
0064 
0065   /// \return the reconstructed Displaced Vertex index
0066   const int recoVertexId() const { return recoVertexId_; }
0067 
0068   /// Set the associated reconstructed DispacedVertex
0069   void setRecoVertex(int recoVertexId) {
0070     isRecoVertex_ = true;
0071     recoVertexId_ = recoVertexId;
0072   }
0073 
0074   /// Remove the associated reconstructed DispacedVertex
0075   void removeRecoVertex() {
0076     isRecoVertex_ = false;
0077     recoVertexId_ = -1;
0078   }
0079 
0080 private:
0081   /// Sim Vertex
0082   SimVertex vertex_;
0083 
0084   /// \return the id in the vertex in the collection.
0085   /// -1 if the default value
0086   int id_;
0087 
0088   /// id of mother particle. -1 if no mother
0089   int motherId_;
0090 
0091   /// Number of charged daughters
0092   unsigned int nCharged_;
0093 
0094   ///  Vector of daughter ids in the track collection
0095   std::vector<int> daughterIds_;
0096 
0097   ///  Vertex Type
0098   FSimVertexType::VertexType vertexType_;
0099 
0100   /// Flag to indicate if a reconstructed DisplacedVertex was found and associated
0101   bool isRecoVertex_;
0102 
0103   /// The index of the reconstructed DisplacedVertex associated.
0104   /// By default the value is -1.
0105   /// The association may be done in the dedicated algorithm of the producer.
0106   int recoVertexId_;
0107 
0108   friend std::ostream& operator<<(std::ostream& out, const FSimDisplacedVertex& co);
0109 };
0110 
0111 #endif