#pragma implementation
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include "hphotoncluster.h"
#include "htool.h"
using namespace std;
ClassImp(HPhotonCluster)
void HPhotonCluster::clear(){
iPadNr = 0;
fThetaMax = 0;
fPhiMax = 0;
iClass = 0;
iXDimension = 0;
iYDimension = 0;
fTotalCharge = 0;
iSector = -1;
fPads->Clear();
}
HPhotonCluster::HPhotonCluster(){
fPads = new TList;
}
HPhotonCluster::~HPhotonCluster(){
fPads->Delete();
delete fPads;
}
Bool_t HPhotonCluster::isInPadList(Int_t col, Int_t row){
HRichCal *dummyPad =NULL;
Int_t iCol,iRow;
Int_t listSize = fPads->GetSize();
for(Int_t i = 0;i<listSize;i++){
dummyPad = (HRichCal*)fPads->At(i);
iCol = dummyPad->getCol();
iRow = dummyPad->getRow();
if(iCol==col&&iRow==row) return kTRUE;
}
return kFALSE;
}
void HPhotonCluster::calculatemaxmin(){
HRichCal * dummyPad = NULL;
Int_t listSize = fPads->GetSize();
Int_t * xPad = new Int_t[listSize];
Int_t * yPad = new Int_t[listSize];
for(Int_t i = 0;i<listSize;i++){
dummyPad = (HRichCal*)fPads->At(i);
xPad[i] = dummyPad->getCol();
yPad[i] = dummyPad->getRow();
}
Int_t * sortedxPad = new Int_t[listSize];
Int_t * sortedyPad = new Int_t[listSize];
HTool::sort(listSize,xPad ,sortedxPad ,kFALSE,kFALSE);
HTool::sort(listSize,yPad ,sortedyPad ,kFALSE,kFALSE);
for(Int_t i = 0;i<listSize;i++){
}
iXDimension = TMath::Abs(xPad[sortedxPad[0]] - xPad[sortedxPad[listSize-1]])+1;
iYDimension = TMath::Abs(yPad[sortedyPad[0]] - yPad[sortedyPad[listSize-1]])+1;
delete [] xPad;
delete [] yPad;
delete [] sortedxPad;
delete [] sortedyPad;
}
void HPhotonCluster::setfPhiMaxThetaMax(HRichGeometryPar* pGeomPar){
HRichCal * dummyPad = NULL;
Int_t sector = 0;
dummyPad = (HRichCal*)fPads->At(0);
sector = dummyPad->getSector();
fThetaMax = ((HRichGeometryPar*) pGeomPar) ->
getPadsPar()->getPad(dummyPad->getCol(),dummyPad->getRow())->getTheta();
fPhiMax =((HRichGeometryPar*) pGeomPar) ->
getPadsPar()->getPad(dummyPad->getCol(),dummyPad->getRow())->getPhi(sector);
}
Last change: Sat May 22 13:06:40 2010
Last generated: 2010-05-22 13:06
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.