#include "TMHistogrammingClusterTypeOuter.h"
#include "TMControlSPD.h"
#include "AliITSRawStreamSPD.h"
#include <TStyle.h>
#include <TPad.h>
#include <TH1F.h>

//_____________________________________________________________________
TMHistogrammingClusterTypeOuter::TMHistogrammingClusterTypeOuter() :
  TMHistogramming()
{
  fHist = new TH1F("ClusterTypeOuter","Cluster Type Outer Layer",16,-0.5,15.5);
  fHist->SetMinimum(0);
  fHist->SetStats(0);
  fHist->SetFillColor(kYellow);
  fHist->GetXaxis()->SetTitle("Cluster Type");
  fHist->GetYaxis()->SetTitle("Number of Clusters");
  fHist->SetTitleOffset(1.2,"X");
  fHist->SetTitleOffset(1.6,"Y");
}
//_____________________________________________________________________
TMHistogrammingClusterTypeOuter::~TMHistogrammingClusterTypeOuter() {
  delete fHist;
}
//_____________________________________________________________________
void TMHistogrammingClusterTypeOuter::ProcessCluster(Float_t x, Float_t y, Float_t z, UInt_t module, UInt_t size, UInt_t widz, UInt_t widphi, UInt_t type) {
  if (fEventAccept) {
    if (module>=80) {
      fHist->Fill(type);
    }
  }
}
//_____________________________________________________________________
void TMHistogrammingClusterTypeOuter::Draw(TPad *pad) {
  pad->cd();
  pad->SetLeftMargin(0.15);
  pad->SetRightMargin(0.15);
  pad->SetBorderSize(0);
  pad->SetBorderMode(0);

  fHist->Draw();
}
//_____________________________________________________________________
void TMHistogrammingClusterTypeOuter::Reset() {
  fHist->Reset();
  TMHistogramming::Reset();
}
