#include "StHbtMaker/Infrastructure/StHbtEvent.hh"
#include "StHbtMaker/Infrastructure/StHbtTypes.hh"
#include "StHbtMaker/Cut/eventCutMonitor_VpdVz.h"
#include <cstdio>

#ifdef __ROOT__ 
ClassImp(eventCutMonitor_VpdVz)
#endif
eventCutMonitor_VpdVz::eventCutMonitor_VpdVz(){
  mHisto = new StHbt1DHisto("hVpdVz","VpdVz",41,-20.,20.);
  mHisto->SetDirectory(0);
}
//------------------------------
eventCutMonitor_VpdVz::eventCutMonitor_VpdVz(const char* TitCutMoni, const char* title,
					     int nbins, double min, double max){
  mHisto = new StHbt1DHisto(TitCutMoni, title, nbins , min, max);
  mHisto->SetDirectory(0);
}
//------------------------------
eventCutMonitor_VpdVz::~eventCutMonitor_VpdVz(){
  delete mHisto;
}

//------------------------------
void eventCutMonitor_VpdVz::Fill(const StHbtEvent* event){
  mHisto->Fill( fabs(event->VpdVz() - event->PrimVertPos().z() ), 1.);
}

//------------------------------
void eventCutMonitor_VpdVz::Finish(){
  cout << " entries in histogram : " << mHisto->Integral() << endl;
}

//------------------------------
StHbtString eventCutMonitor_VpdVz::Report(){
  string Stemp;
  char Ctemp[100];
  sprintf(Ctemp," eventCutMonitor_VpdVz");
  Stemp=Ctemp;
  StHbtString returnThis = Stemp;
  return returnThis;
}

