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
#include <cassert>
#include <algorithm>

#include "DataFormats/JetReco/interface/DiscretizedEnergyFlow.h"

namespace reco {

  DiscretizedEnergyFlow::DiscretizedEnergyFlow(const double* data,
                                               const char* title,
                                               const double etaMin,
                                               const double etaMax,
                                               const double phiBin0Edge,
                                               const unsigned nEtaBins,
                                               const unsigned nPhiBins)
      : title_(title),
        etaMin_(etaMin),
        etaMax_(etaMax),
        phiBin0Edge_(phiBin0Edge),
        nEtaBins_(nEtaBins),
        nPhiBins_(nPhiBins) {
    assert(data);
    assert(title);
    const unsigned nbins = nEtaBins * nPhiBins;
    data_.resize(nbins);
    std::copy(data, data + nbins, data_.begin());
  }

}  // namespace reco