///////////////////////////////////////////////////////////////////
//
// PruneProc clears branches of the data structure _DS.  This
// is useful if you want to eliminate parts of the event you don't
// need in order to reduce the amount of space the event occupies on
// disk.  The prune processor can eliminate most of the lists in the
// data structure (like PMT hits and particle tracks).  See SetS()
// for a detailed list of branch names.
//
// There is little benefit to pruning an event except just before
// writing it to disk.  Events are never copied in memory, so their
// size does not affect the speed of other processors.
//
// Author: Stan Seibert <volsung@physics.utexas.edu>
//         P G Jones <p.g.jones@qmul.ac.uk>
//
// REVISION HISTORY:
//         2014-04-04 : P Jones - Refactor for new ds.
//         2016-10-19 : M Stringer - Changes to how MCTracks are accessed (PR #1508).
//
///////////////////////////////////////////////////////////////////

#ifndef __RAT_PruneProc__
#define __RAT_PruneProc__

#include <RAT/Processor.hh>
#include <vector>

namespace RAT
{

class PruneProc : public Processor
{
public:
  // By default nothing is pruned
  PruneProc();

  // Called per Monte Carlo event, does the pruning.
  //
  // run: run information to process
  // ds: entry information to process
  // Returns a a processor result indicating success
  virtual Processor::Result DSEvent( DS::Run& run, DS::Entry& ds );

  // Set string parameter.
  //
  // param: should be 'prune'
  // value: can be a comma separated list of options.
  virtual void SetS( const std::string& param, const std::string& value );

  // Set the pruning state of a branch.
  //
  // item: Name of branch. Valid names listed in SetS().
  // state: if true, that branch will be deleted.
  //
  void SetPruneState( const std::string& item, const bool state );

  // Returns true if the branch name item will be cut.
  //
  // item: Name of branch. Valid names listed in SetS().
  // Returns a true if item is to be deleted
  bool GetPruneState( const std::string& item ) const;

protected:
  bool fMC; // True if the MC branch should be pruned
  bool fMCParticles; // True if the MCParticles branch should be pruned
  bool fMCParents; // True if the MCParents branch should be pruned
  bool fMCTracks; // True if the MCTracks branch should be pruned
  bool fMCTrackSteps; // True if the MCTrackSteps branch should be pruned
  bool fMCPMTs; // True if the MCPMTs branch should be pruned
  bool fMCPhotons; // True if the MCPhotons branch should be pruned
  bool fMCPEs; // True if the MCPEs branch should be pruned
  bool fMCHits; // True if the MCHits branch should be pruned
  bool fMCEVs; // True if the MCEVs branch should be pruned

  bool fEVs; // True if the EV branches should be pruned
  bool fEVUncalPMTs; // True if the EVUncalPMTs branch should be pruned
  bool fEVCalPMTs; // True if the EVCalPMTs branch should be pruned
  bool fEVInterCalPMTs; // True if the EVInterCalPMTs branch should be pruned
  bool fEVPMTs; // True if the EVPMTs branch should be pruned
  bool fEVInwardPMTs; // True if the now deprecated inward PMT branch should be pruned
};


} // namespace RAT

#endif