#ifndef ANALYSIS_SKELETON_H
#define ANALYSIS_SKELETON_H
/////////////////////////////////////////////////////////////////////////////////////////////////////
/// Name    : AnalysisSkeleton.h
/// Package : offline/PhysicsAnalysis/AnalysisCommon/UserAnalysis
/// Author  : Ketevi A. Assamagan
/// Created : July 2004
///
/// DESCRIPTION:
///
/// This class is an analysis skeleton - The user can implement his analysis here
/// This class is also used for the demonstration of the distributed analysis
/// Some electron histograms are used for the distributed case. The user may
/// remove the histograms and the electron stuff if not needed.
/// Note: the single algorithm structure as an analysis code does not scale
/// For detailed analysis examples, look in CVS: PhysicsAnalysis/AnalysisCommon/AnalysisExamples/
/// Ketevi A. Assamagan on June 9, 2004
///
///////////////////////////////////////////////////////////////////////////////////////////////////////

#include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/Algorithm.h"
#include "GaudiKernel/ObjectVector.h"
#include "CLHEP/Units/SystemOfUnits.h"
#include "StoreGate/StoreGateSvc.h"
#include "GaudiKernel/ITHistSvc.h"

#include "AnalysisTools/AnalysisTools.h"

//#include "TLorentzVector.h"
//#include "CLHEP/Vector/LorentzVector.h"

#include "CBNT_Utils/CBNT_AthenaAwareBase.h"

#include <string>

#include "TH1.h"


class AnalysisSkeleton : public CBNT_AthenaAwareBase  {

 public:

   AnalysisSkeleton(const std::string& name, ISvcLocator* pSvcLocator);
   ~AnalysisSkeleton();

   virtual StatusCode CBNT_initialize();
   virtual StatusCode CBNT_finalize();
   virtual StatusCode CBNT_execute();
   virtual StatusCode CBNT_clear();

 private:

   /** method called by CBNT_execute() - to be removed if not needed */
   StatusCode electronSkeleton();

 private:

   /** get a handle to the tool helper */
   ToolHandle<AnalysisTools> m_analysisTools;

   /** a handle on the Hist/TTree registration service */
   ITHistSvc * m_thistSvc;

   /** a handle on Store Gate for access to the Event Store */
   StoreGateSvc* m_storeGate;

   //////////////////// To be removed if not needed ///////////////////////////
   /// only here for distributed analysis example

   /** name of the AOD electron container to retrieve from StoreGate */
   std::string m_electronContainerName;
 
   /** name of the AOD truth particle container to retrieve from StoreGate */
   std::string m_truthParticleContainerName;

   /** cuts for user  pre selected electrons, muons and taus - 
       to be modified thru job options */
 
   double m_deltaRMatchCut;
   double m_maxDeltaR;

   /** electron specific cuts */
   double m_etElecCut;
   double m_elecCone;
   double m_etaElecCut;
   
  /** Histograms */
  TH1F* m_h_elecpt;
  TH1F* m_h_eleceta;

  TH1F* m_h_tranverseMofW; 
  TH1F* m_h_nuPt;       
  TH1F* m_h_qqMass;
  TH1F* m_h_lnu;
  TH1F* m_h_hmass;
  /** Athena-Aware Ntuple (AAN) variables - branches of the AAN TTree */

  /** Simple variables */
  int m_aan_size;
  std::vector<double> * m_aan_eta;
  std::vector<double> * m_aan_pt;
  std::vector<double> * m_aan_elecetres;

  int m_aan_t_size;
  std::vector<double> * m_aan_t_tranverseMofW;
  std::vector<double> * m_aan_t_nuPt;
  std::vector<double> * m_aan_t_qqMass;
  std::vector<double> * m_aan_t_lnuMass;
  std::vector<double> * m_aan_t_hmass;
  
  /////////////////////// the above to be removed if not needed ////////////////////
  
};

#endif // ANALYSIS_SKELETON_H

