Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // Author: Aurora Perego, Fabio Cossutti - aurora.perego@cern.ch, fabio.cossutti@ts.infn.it
0002 // Date: 05/2023
0003 
0004 #ifndef SimDataFormats_MtdMtdSimTrackster_h
0005 #define SimDataFormats_MtdMtdSimTrackster_h
0006 
0007 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0008 #include "SimDataFormats/CaloAnalysis/interface/MtdSimCluster.h"
0009 #include <vector>
0010 
0011 class MtdSimTrackster : public MtdSimCluster {
0012   friend std::ostream &operator<<(std::ostream &s, MtdSimTrackster const &tp);
0013 
0014 public:
0015   MtdSimTrackster();
0016 
0017   MtdSimTrackster(const SimCluster &sc);
0018   MtdSimTrackster(EncodedEventId eventID, uint32_t particleID);  // for PU
0019   MtdSimTrackster(const SimCluster &sc, const std::vector<uint32_t> SCs, const float time, const GlobalPoint pos);
0020 
0021   // destructor
0022   ~MtdSimTrackster();
0023 
0024   /** @brief returns the position of the cluster */
0025   GlobalPoint position() const { return posAtEntrance_; }
0026 
0027   /** @brief returns the time of the cluster */
0028   float time() const { return timeAtEntrance_; }
0029 
0030   /** @brief returns the layer clusters indexes in the sim trackster*/
0031   std::vector<uint32_t> clusters() const { return clusters_; }
0032 
0033   /** @brief add simhit's energy to cluster */
0034   void addCluster(const uint32_t sc) { clusters_.push_back(sc); }
0035 
0036   /** @brief Gives the total number of SimHits, in the cluster */
0037   int numberOfClusters() const { return clusters_.size(); }
0038 
0039 private:
0040   float timeAtEntrance_{0.f};
0041   GlobalPoint posAtEntrance_;
0042   // indices of the MtdSimLayerClusters contained in the simTrackster
0043   std::vector<uint32_t> clusters_;
0044 };
0045 
0046 #endif  // SimDataFormats_MtdSimTrackster_H