/** \class reco::FFTJetProducerSummary
 *
 * \short Data processing summary generated by FFTJetProducer
 *
 * \author Igor Volobouev, TTU, June 28, 2010
 ************************************************************/

#ifndef DataFormats_JetReco_FFTJetProducerSummary_h
#define DataFormats_JetReco_FFTJetProducerSummary_h

#include <vector>

#include "DataFormats/Math/interface/LorentzVector.h"
#include "DataFormats/Candidate/interface/CandidateFwd.h"

namespace reco {
  class FFTJetProducerSummary {
  public:
    // Must have a default constructor
    inline FFTJetProducerSummary()
        : unused_(0.f),
          minScale_(0.f),
          maxScale_(0.f),
          scaleUsed_(0.f),
          preclustersFound_(0),
          iterationsPerformed_(0),
          converged_(false) {}

    // Meaningful constructor
    FFTJetProducerSummary(const std::vector<double>& thresholds,
                          const std::vector<unsigned>& levelOccupancy,
                          const math::XYZTLorentzVector& unclustered,
                          const std::vector<CandidatePtr>& constituents,
                          double unused,
                          double minScale,
                          double maxScale,
                          double scaleUsed,
                          unsigned preclustersFound,
                          unsigned iterationsPerformed,
                          bool converged);

    // Vector of occupancy thresholds generated by
    // the locally adaptive resolution scheme
    inline const std::vector<float>& thresholds() const { return thresholds_; }

    // Clustering tree occupancy as a function of the level number
    inline const std::vector<unsigned>& levelOccupancy() const { return levelOccupancy_; }

    // Raw unclustered energy 4-vector
    inline const math::XYZTLorentzVector& unclustered() const { return unclustered_; }

    // Pointers to unclustered energy constituents
    inline const std::vector<CandidatePtr>& unclusteredConstituents() const { return unclusConstituents_; }

    // Scalar sum of unclustered transverse energies
    inline float unusedEt() const { return unused_; }

    // Minimum and maximum resolution scales to be used for
    // configuration stability calculations
    inline float minScale() const { return minScale_; }
    inline float maxScale() const { return maxScale_; }

    // The scale actually used to lookup clusters.
    // This info is useful mostly for maximally stable
    // and globally adaptive resolution schemes.
    inline float scaleUsed() const { return scaleUsed_; }

    // Number of preclusters found by the peak selection code.
    // Should normally coincide with the number of jets.
    inline unsigned preclustersFound() const { return preclustersFound_; }

    // Actual number of iterations made by the jet reconstruction
    // algorithm
    inline unsigned iterationsPerformed() const { return iterationsPerformed_; }

    // Did the jet reconstruction algorithm converge?
    inline bool iterationsConverged() const { return converged_; }

  private:
    std::vector<float> thresholds_;
    std::vector<unsigned> levelOccupancy_;
    math::XYZTLorentzVector unclustered_;
    std::vector<CandidatePtr> unclusConstituents_;
    float unused_;
    float minScale_;
    float maxScale_;
    float scaleUsed_;
    unsigned preclustersFound_;
    unsigned iterationsPerformed_;
    bool converged_;
  };
}  // namespace reco

#endif  // DataFormats_JetReco_FFTJetProducerSummary_h
