PreshowerCluster

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 64 65
#ifndef DataFormats_EgammaReco_PreshowerCluster_h
#define DataFormats_EgammaReco_PreshowerCluster_h
/*
 * Preshower cluster class
 *
 * \authors Dmirty Bandurin (KSU), Ted Kolberg (ND)
 */
//
#include "DataFormats/Math/interface/Point3D.h"
#include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
#include "DataFormats/EgammaReco/interface/PreshowerClusterFwd.h"

#include <cmath>

namespace reco {

  class PreshowerCluster : public CaloCluster {
  public:
    typedef math::XYZPoint Point;

    /// default constructor
    PreshowerCluster() : CaloCluster(0., Point(0., 0., 0.)) {}

    ~PreshowerCluster() override;

    /// Constructor from EcalRecHits
    PreshowerCluster(const double E,
                     const Point& pos,
                     const std::vector<std::pair<DetId, float> >& usedHits,
                     const int plane);

    /// Constructor from cluster
    PreshowerCluster(const PreshowerCluster&);

    /// Number of RecHits the cluster
    int nhits() const { return hitsAndFractions_.size(); }

    /// Preshower plane
    int plane() const { return plane_; }

    double et() const { return energy() / cosh(eta()); }

    /// Comparisons
    bool operator==(const PreshowerCluster&) const;
    bool operator<(const PreshowerCluster&) const;

    /// Associated basic cluster;
    CaloClusterPtr basicCluster() const { return bc_ref_; }

    /// DetIds of component RecHits -- now inherited from CaloCluster
    //std::vector<DetId> getHitsByDetId() const { return usedHits_; }

    void setBCRef(const CaloClusterPtr& r) { bc_ref_ = r; }

  private:
    int plane_;

    /// Associated basic cluster;
    CaloClusterPtr bc_ref_;

    /// used hits by detId -- now inherited from CaloCluster
    //std::vector<DetId> usedHits_;
  };
}  // namespace reco
#endif