ROOT logo
//_HADES_CLASS_DESCRIPTION
//////////////////////////////////////////////////////////////////////////////
//
//
//  HParticleBTClusterF
//
//  This class searches for clusters and calculates its properties.
//  Rich hit and fired pad information is obtained from HParticleBTRing
//  class. If at least 1 rich hit is found on fPrediction cluster properties
//  are calculated.
//
//
//////////////////////////////////////////////////////////////////////////////

#include "hparticlebtclusterf.h"
#include "hades.h"
#include "TF2.h"
#include "TH2F.h"
#include "TMath.h"
#include "hparticlebtangletrafo.h"
#include "hruntimedb.h"
#include "hparticlebtpar.h"
#include "hparticlebtringf.h"
#include "hparticlebtringinfo.h"


// ----------------------------------------------------------------

ClassImp(HParticleBtClusterF)

// ----------------------------------------------------------------

HParticleBtClusterF::HParticleBtClusterF( )
{
	fRing = NULL;
}

HParticleBtClusterF::~HParticleBtClusterF(){
    fRing = NULL;
}
void HParticleBtClusterF::setRingF(HParticleBtRingF* ring)
{
    fRing             = ring;
    fPrediction       = &fRing->getPrediction();
    fRichHitAdd       = &fRing->getRichHitAdd();
    fRichHitCharge    = &fRing->getRichHitCharge();
}
Bool_t HParticleBtClusterF::init() {

    fBtPar =(HParticleBtPar*) gHades->getRuntimeDb()->getContainer("ParticleBtPar");
    if(!fBtPar) {
	Error ("init()", "Retrieve ZERO pointer for ParticleBtPar!");
	return kFALSE;
    }

    fPadUp                 = fBtPar->getNeighbourPad(0);
    fPadUpRight            = fBtPar->getNeighbourPad(1);
    fPadRight              = fBtPar->getNeighbourPad(2);
    fPadDownRight          = fBtPar->getNeighbourPad(3);
    fPadDown               = fBtPar->getNeighbourPad(4);
    fPadDownLeft           = fBtPar->getNeighbourPad(5);
    fPadLeft               = fBtPar->getNeighbourPad(6);
    fPadUpLeft             = fBtPar->getNeighbourPad(7);

    memcpy(&fChargeLimit[0]        ,fBtPar->getChargeThres()   , sizeof(fChargeLimit) );
    memcpy(&fChargeLimitMaximum[0] ,fBtPar->getChargeThresMax(), sizeof(fChargeLimitMaximum) );
    fPadWidthX             = fBtPar->getPadWidthX();
    fPadWidthY             = fBtPar->getPadWidthY();

    fNSigma                = fBtPar->getSigmaRange();
    fMaxSigmaRange         = fBtPar->getSigmaRangeMax();
    fMaxSigmaRangeSmall    = fBtPar->getSigmaRangeSmall();
    fSigmaErrorPad         = fBtPar->getSigmaRangePadError();

    fNMaxLimit             = fBtPar->getClusMaximaLimit();
    fClusSizeLimit         = fBtPar->getClusSizeLimit();
    fMinimumSigmaValue     = fBtPar->getMinimumSigmaValue();

    fMaximumType           = fBtPar->getMaximumType();
    memcpy(&fSigmaGaus[0]     , fBtPar->getSigmaGaus()     , sizeof(fSigmaGaus) ) ;
    memcpy(&fSigmaGausRange[0], fBtPar->getSigmaGausRange(), sizeof(fSigmaGausRange) ) ;

    memcpy(&fChargeDiagonalPar[0]  , fBtPar->getSharedChargeDiagonal()  , sizeof(fChargeDiagonalPar) ) ;
    memcpy(&fChargeVerticalPar[0]  , fBtPar->getSharedChargeVertical()  , sizeof(fChargeVerticalPar) ) ;
    memcpy(&fChargeHorizontalPar[0], fBtPar->getSharedChargeHorizontal(), sizeof(fChargeHorizontalPar) ) ;

    memcpy(&fPhiOff[0] , fBtPar->getPhiOffset() , sizeof(fPhiOff ) );
    memcpy(&fPhiOff2[0], fBtPar->getPhiOffset2(), sizeof(fPhiOff2 ) );
    fPhiOffsetPar          = fBtPar->getOffsetPar();

    fNRingSeg              = fBtPar->getNRingSegments();
    fNRingSegStep          = fBtPar->getRingSegStep();
    fNRingSegOffset        = fBtPar->getRingSegOffset();

    fNVertex               = fBtPar->getNVertex();
    fNParMean              = fBtPar->getNParMean();
    fNParSigma             = fBtPar->getNParSigma();
    fParThetaAngleMin      = fBtPar->getParThetaAngleMin();
    fParThetaAngleMax      = fBtPar->getParThetaAngleMax();
   
    fPol2DMean.resize(fNRingSeg);
    fPol2DSigma.resize(fNRingSeg);

    for(Int_t bin=0; bin<fNRingSeg; bin++){
	for(Int_t vertex=0; vertex<fNVertex; vertex++){
	    //Theta,Phi Range, + x: x is half step width of binning used for calculating theses values
	    fPol2DMean[bin].push_back( new TF2(Form("meanPol_%i_v%i",bin,vertex),"x*x*x*[0]+x*x*[1]+x*[2]+y*y*[3]+y*[4]+[5]+y*(x*x*[6]+x*[7])",20.+3.3,86.,0+7.51,60.)); 
	    fPol2DSigma[bin].push_back(new TF2(Form("sigmaPol_%i_v%i",bin,vertex),"TMath::Power(x,3)*[0]+TMath::Power(x,2)*[1]+x*[2]+TMath::Power(y,4)*[3]+TMath::Power(y,3)*[4]+TMath::Power(y,2)*[5]+y*[6]+[7]+y*(x*x*[8]+x*[9]+[10]) + x*(y*y*y*[11]+y*y*[12])",20.+3.3,86,8+7.51,60.));
	    for(Int_t par=0; par<fNParMean; par++)
		fPol2DMean[bin][vertex] ->SetParameter(par, fBtPar->getTF2ParMean( bin, vertex, par));
	    for(Int_t par=0; par<fNParSigma; par++)
		fPol2DSigma[bin][vertex]->SetParameter(par, fBtPar->getTF2ParSigma(bin, vertex, par));
	}
	fRad2Deg.push_back(TMath::DegToRad()*(bin*fNRingSegStep+fNRingSegOffset));
	fRad2DegX.push_back(TMath::Sin(fRad2Deg[bin]));
	fRad2DegY.push_back(-1*TMath::Cos(fRad2Deg[bin]));
    }

    fPrediction   = NULL;
    fRichHitAdd   = NULL;
    fRichHitCharge= NULL;

    return kTRUE;
}

//-----------------------------------------------------------
//Helper functions


void HParticleBtClusterF::addressToColRow(const Int_t address, Int_t &sec, Int_t &row, Int_t &col)
{
    //Converts richCal address to sector, column and row numbers

    sec = (Int_t)address/10000;
    row = (Int_t)(address-sec*10000)/100;
    col = address-sec*10000-row*100;
    sec = sec==6 ? 0 : sec;
}


Float_t HParticleBtClusterF::getPadCharge(const Int_t pos)
{
    //Returns pad charge for given pad address

    Int_t charge = 0;
    for(UInt_t add=0; add < fRichHitAdd->size() && charge==0; add++){
	if((*fRichHitAdd)[add]==pos)
	    charge = (*fRichHitCharge)[add];
    }
    return charge;
}

Int_t HParticleBtClusterF::getShared(const Int_t trackNo,const Int_t clusNum, const Float_t sigmaRange, const Bool_t trackType, const Int_t trackNo2 = -1)
{
    //Returns number of maxima that are inside sigma region of track with trackNo
    //Values are calculated for a single cluster with clusNum
    //Function call sets search area (sigma range) and track type ( good Track, close track with bad quality)
    Int_t counter = 0;
    vector <Int_t> padAdd;
    //Check which maxima are inside sigma region around track with trackNo
    for(UInt_t j = 0; j < fClusTrackNoShared[clusNum].size(); j++){
        if(fClusTrackNoShared[clusNum][j] != trackNo) continue;
	for(UInt_t k = 0; k < fClusChi2[clusNum][j].size(); k++){
	    if(fClusChi2[clusNum][j][k] < sigmaRange)
		padAdd.push_back(fClusNMaximaPad[clusNum][j][k]);
	}
    }
   

    //Search for maxima that are shared with trackNo
    vector <Int_t> counterShared ( padAdd.size(),0 );
    for(UInt_t j = 0; j < fClusTrackNoShared[clusNum].size(); j++){
	if(fClusTrackNoShared[clusNum][j] == trackNo) continue;
    
	if(fRing->isGoodTrack(fClusTrackNoShared[clusNum][j]) != trackType) continue;
        if(trackNo2 != -1 && fClusTrackNoShared[clusNum][j] != trackNo2) continue;
	for(UInt_t k = 0; k < fClusChi2[clusNum][j].size(); k++){
	    if(fClusChi2[clusNum][j][k] < sigmaRange){
		for(UInt_t l = 0 ; l < padAdd.size();  l++){
		    if(padAdd[l] == fClusNMaximaPad[clusNum][j][k]){
			counterShared[l]++;
		    }
		}
	    }
	}
    }

    for(UInt_t i = 0 ; i < counterShared.size();  i++){
	if(counterShared[i] > 0)
	    counter++;
    }
    return counter;
}
Float_t HParticleBtClusterF::getSharedCharge(const Int_t trackNo,const Int_t clusNum, const Float_t sigmaRange, const Bool_t trackType, const Int_t trackNo2 = -1)
{
    //Returns number of charge maxima that are inside sigma region of track with trackNo
    //Values are calculated for a single cluster with clusNum
    //Function call sets search area (sigma range) and track type ( good Track, close track with bad quality)
    Float_t chargeSum = 0;
    vector <Int_t> padAdd;
    //Check which maxima are inside sigma region around track with trackNo
    for(UInt_t j = 0; j < fClusTrackNoShared[clusNum].size(); j++){
        if(fClusTrackNoShared[clusNum][j] != trackNo) continue;
	for(UInt_t k = 0; k < fClusChi2[clusNum][j].size(); k++){
	    if(fClusChi2[clusNum][j][k] < sigmaRange)
		padAdd.push_back(fClusNMaximaPad[clusNum][j][k]);
	}
    }
   

    //Search for maxima that are shared with trackNo
    vector <Int_t> counterShared ( padAdd.size(),0 );
    for(UInt_t j = 0; j < fClusTrackNoShared[clusNum].size(); j++){
	if(fClusTrackNoShared[clusNum][j] == trackNo) continue;
    
	if(fRing->isGoodTrack(fClusTrackNoShared[clusNum][j]) != trackType) continue;
        if(trackNo2 != -1 && fClusTrackNoShared[clusNum][j] != trackNo2) continue;
	for(UInt_t k = 0; k < fClusChi2[clusNum][j].size(); k++){
	    if(fClusChi2[clusNum][j][k] < sigmaRange){
		for(UInt_t l = 0 ; l < padAdd.size();  l++){
		    if(padAdd[l] == fClusNMaximaPad[clusNum][j][k]){
			counterShared[l]++;
		    }
		}
	    }
	}
    }
    for(UInt_t i = 0 ; i < counterShared.size();  i++){
	if(counterShared[i] > 0){
	    chargeSum+=getPadCharge(padAdd[i]);
	}
    }
       
    return chargeSum;
}

void HParticleBtClusterF::addressIsShared(Int_t address)
{
    //Checks if rich pad is inside fPrediction area of additional tracks

    UInt_t vectorPos = fClusTrackNoShared.size()-1;
    for(UInt_t i=0; i<fPrediction->size(); i++){
	for(UInt_t pred=0; pred < (*fPrediction)[i].size(); pred++){
	    if(address == (*fPrediction)[i][pred]){
                if( ( std::find(fClusTrackNoShared[vectorPos].begin(), fClusTrackNoShared[vectorPos].end(), i) ==  fClusTrackNoShared[vectorPos].end() ) )
		    fClusTrackNoShared[vectorPos].push_back(i);
	    }
	}
    }
}


Float_t  HParticleBtClusterF::sharedChargeDiagonal(const Float_t maximumCharge)
{
    //Diagonal charge sharing in dependence of maximum size
    //Determined by quadratic 4 pad clusters

    Int_t charge = maximumCharge * (fChargeDiagonalPar[0]+TMath::Power(maximumCharge*fChargeDiagonalPar[1],fChargeDiagonalPar[2]));
    if(charge<maximumCharge)
       return charge;
    else
        return maximumCharge;
}


Float_t  HParticleBtClusterF::sharedChargeVertical(const Float_t maximumCharge)
{
    //Vertical charge sharing in dependence of maximum size
    //Determined by 2 pad clusters

    if(maximumCharge>fChargeVerticalPar[0])
	return  maximumCharge * ((TMath::Power(maximumCharge-fChargeVerticalPar[0],1./fChargeVerticalPar[2]))/fChargeVerticalPar[1]);
    else
        return 0;
}


Float_t  HParticleBtClusterF::sharedChargeHorizontal(const Float_t maximumCharge)
{
    //Horizontal charge sharing in dependence of maximum size
    //Determined by 2 pad clusters

    if(maximumCharge>fChargeHorizontalPar[0])
	return  maximumCharge * ((TMath::Power(maximumCharge-fChargeHorizontalPar[0],1./fChargeHorizontalPar[2]))/fChargeHorizontalPar[1]);
    else
	return 0;
}



void  HParticleBtClusterF::findNeighbour(const Int_t trackNo,const Int_t address)
{
    //Searches for pads directly connected to initial pad and adds them to the same cluster
    addressIsShared(address);
    fIsInCluster.push_back(address);

    if((std::find(fRichHitAdd->begin(), fRichHitAdd->end(), address+fPadUp) !=  fRichHitAdd->end()) && ((std::find(fIsInCluster.begin(), fIsInCluster.end(), address+fPadUp) ==  fIsInCluster.end()) ))
	findNeighbour(trackNo,address+fPadUp);
    if((std::find(fRichHitAdd->begin(), fRichHitAdd->end(), address+fPadDown) !=  fRichHitAdd->end()) && ((std::find(fIsInCluster.begin(), fIsInCluster.end(), address+fPadDown) ==  fIsInCluster.end())  ))
        findNeighbour(trackNo,address+fPadDown);
    if((std::find(fRichHitAdd->begin(), fRichHitAdd->end(), address+fPadRight) !=  fRichHitAdd->end()) && ((std::find(fIsInCluster.begin(), fIsInCluster.end(), address+fPadRight) ==  fIsInCluster.end())  ))
        findNeighbour(trackNo,address+fPadRight);
    if((std::find(fRichHitAdd->begin(), fRichHitAdd->end(), address+fPadLeft) !=  fRichHitAdd->end()) && ((std::find(fIsInCluster.begin(), fIsInCluster.end(), address+fPadLeft) ==  fIsInCluster.end())   ))
	findNeighbour(trackNo,address+fPadLeft);
}


void HParticleBtClusterF::fillCluster(const Int_t trackNo, const UInt_t beginclus)
{
    //Fills basic cluster information in vectors
    fClusPadSum.push_back(fIsInCluster.size()-beginclus);
    fClusPadRing.push_back(0);
    fClusPosX.push_back(0);
    fClusPosY.push_back(0);
    fClusChargeSum.push_back(0);
    fClusChargeRing.push_back(0);


    UInt_t clusNum = fClusPadSum.size()-1;
    Int_t sec           = -1;
    Int_t padX          = -1;
    Int_t padY          = -1;
    for(UInt_t hit=beginclus; hit < fIsInCluster.size(); hit++){
	for(UInt_t add=0; add < fRichHitAdd->size(); add++){
	    if(fIsInCluster[hit]==(*fRichHitAdd)[add]){
		addressToColRow(fIsInCluster[hit],sec,padX,padY);
		fClusPosX[clusNum]+=padX*(*fRichHitCharge)[add];
		fClusPosY[clusNum]+=padY*(*fRichHitCharge)[add];
                if((*fRichHitCharge)[add]>fChargeLimit[fRing->getTrackSec(trackNo)])
		    fClusChargeSum[clusNum]+=(*fRichHitCharge)[add];
	    }
	}
    }
    fClusPosX[clusNum]=fClusPosX[clusNum]/(Float_t)fClusChargeSum[clusNum];
    fClusPosY[clusNum]=fClusPosY[clusNum]/(Float_t)fClusChargeSum[clusNum];



}


void HParticleBtClusterF::nMaxima(const Int_t trackNo,const UInt_t beginclus)
{
    // Searches for maxima in clusters:
    // Maximum8: All 8 surrounding pads must have measured a smaller charge than maximum pad
    // Maximum4: 4 directly connected pads must have measured a smaller charge than maximum pad
    // Maximum7: 7 directly connected pads must have measured a smaller charge than maximum pad
    //          Adds maxima with smaller charge that are located directly next to maximum
    //          Indicated by larger charge of diagonal pad compared to directly connected pad
    //          of primary maximum


    const Int_t nNeighbours  = 8;
    const Int_t nNeighbours4 = 4;
    const Int_t size         = fIsInCluster.size()-beginclus;
    Int_t neighborAdd[nNeighbours]    = {fPadUp,fPadDown,fPadRight,fPadLeft,fPadUpRight,fPadDownLeft,fPadDownRight,fPadUpRight};
    Int_t vetoPads[nNeighbours4][3]   = {
	{fPadDownRight,fPadDown, fPadRight},
	{fPadUpRight,  fPadRight,fPadDown},
	{fPadUpLeft,   fPadUp,   fPadLeft},
	{fPadDownLeft, fPadLeft, fPadDown}};
    // Only necessary for diagonal pads
    //{{99,-1,100},
    //{101,100,1},
    //{-99,1,-100},
    //{-101,-100,-1}

    vector <Int_t> isPeak7Tmp;
    vector <Int_t> isPeak4Tmp;
    vector <Int_t> isPeak8Tmp;


    vector <Int_t>  vetoPeak;


    UInt_t lastElement     = fClusTrackNoShared.size()-1;
    UInt_t lastElementSize = fClusTrackNoShared[lastElement].size();

    //NMaxima8
    vector <Int_t> peakCounterVec8(lastElementSize);
    vector < vector <Int_t> > peakPadsVec8(lastElementSize);

    //NMaxima4
    vector <Int_t> peakCounterVec4(lastElementSize);
    vector < vector <Int_t> > peakPadsVec4(lastElementSize);

    //NMaxima7
    vector <Int_t> peakCounterVec7(lastElementSize);
    vector < vector <Int_t> > peakPadsVec7(lastElementSize);


    //Searching loop to find Maxima4 and Maxima8
    for(UInt_t hit=beginclus; hit < fIsInCluster.size(); hit++) {
	Bool_t isPeak8 = kTRUE;
	Bool_t isPeak4 = kTRUE;
	Bool_t isPeak  = kTRUE;

	Int_t i=0;

	Int_t posPad = fIsInCluster[hit];
	Float_t chargePad = 0.;
	chargePad = getPadCharge(posPad);

	while(i<nNeighbours && isPeak) {
	    Bool_t  padInCluster   = kFALSE;
	    Int_t   posNeigh       = posPad+neighborAdd[i];
	    Float_t chargeNeigh    = 0.;
	    chargeNeigh = getPadCharge(posNeigh);

	    for( UInt_t hit2 = beginclus; hit2 < fIsInCluster.size(); hit2++ ){
		if(fIsInCluster[hit2]==posNeigh)
		    padInCluster = kTRUE;
	    }
	    if(chargeNeigh>chargePad && padInCluster){
		isPeak8 = kFALSE;
		if(i<nNeighbours4){
		    isPeak4 = kFALSE;
		    isPeak  = kFALSE;
		}
	    }
	    i++;
	}

	if(isPeak8)
	    isPeak8Tmp.push_back(posPad);
	if(isPeak4){
	    isPeak4Tmp.push_back(posPad);
	    isPeak7Tmp.push_back(posPad);
	}

    }

    //Check if second maximum was located next to maximum (Maxima7)
    if(size>3) {
	for( UInt_t peak=0; peak < isPeak4Tmp.size(); peak++ ) {

	    //Each entry in vector stands for different neighbouring pad
	    //Stores address of a possible new maximum pad
	    Int_t posPad[nNeighbours]     = {-1,-1,-1,-1,-1,-1,-1,-1};
	    //Check if at least 7 pads have lower charge than maximum pad
	    Int_t isGoodPeakNeigh[nNeighbours]  = {1,1,1,1,1,1,1,1};
	    //Check if increased charge of diagonal pad is not due to shared charge of diagonal pads
	    Int_t isGoodPeakCharge[nNeighbours] = {1,1,1,1,1,1,1,1};


	    for(Int_t veto=0; veto < nNeighbours4; veto++) {
		Float_t chargeVeto[3] = {0,0,0};
		Int_t kMaximum          = 0;
		Int_t kMaximumNeigh     = 0;
		Int_t kMaximumDiag      = 0;
		//Int_t chargeMaximumNeigh= 0;     // unused
		Int_t chargeMaximumDiag = 0;


		if((std::find(isPeak4Tmp.begin(), isPeak4Tmp.end(), isPeak4Tmp[peak]+vetoPads[veto][0]) !=  isPeak4Tmp.end())) {
		    //Continue if diagonal pad is already maximum
		    kMaximum=kTRUE;
		}
		for(Int_t i=0; i <nNeighbours4; i++){
		    if((std::find(isPeak4Tmp.begin(), isPeak4Tmp.end(), isPeak4Tmp[peak]+vetoPads[veto][0]+neighborAdd[i]) !=  isPeak4Tmp.end())  ) {
			// Check if horizontal or vertical pad are maximum
			kMaximumNeigh++;
			//chargeMaximumNeigh = getPadCharge(isPeak4Tmp[peak]+vetoPads[veto][0]+neighborAdd[i]);   //unused
		    }

		}
		for(Int_t i=4; i <nNeighbours; i++){
		    if((std::find(isPeak4Tmp.begin(), isPeak4Tmp.end(), isPeak4Tmp[peak]+vetoPads[veto][0]+neighborAdd[i]) !=  isPeak4Tmp.end())  ) {
			//Continue if diagonal pads are maximum
			if(isPeak4Tmp[peak]+vetoPads[veto][0]+neighborAdd[i]!=isPeak4Tmp[peak]){
			    kMaximumDiag++;
			    chargeMaximumDiag = getPadCharge(isPeak4Tmp[peak]+vetoPads[veto][0]+neighborAdd[i]);
			}
		    }
		}
		if(kMaximum)
		    continue;
		if(kMaximumNeigh>0)
		    continue;
		if(kMaximumDiag>1)
		    continue;

		//Get charge of diagonal pad [0] and horizontal and vertical pad [1] [2]
		for(UInt_t add=0; add < fRichHitAdd->size(); add++) {
		    if((*fRichHitAdd)[add]==isPeak4Tmp[peak]+vetoPads[veto][0])
			chargeVeto[0] = (*fRichHitCharge)[add];
		    if((*fRichHitAdd)[add]==isPeak4Tmp[peak]+vetoPads[veto][1])
			chargeVeto[1] = (*fRichHitCharge)[add];
		    if((*fRichHitAdd)[add]==isPeak4Tmp[peak]+vetoPads[veto][2])
			chargeVeto[2] = (*fRichHitCharge)[add];
		}

		//If charge of diagonal pads is larger -> second maximum must exist
		//Depending of diagonal pad position and if condition different pad must be maximum
		//   {{99,-1,100},{101,100,1},{-99,1,-100},{-101,-100,-1}
		//{fPadDownRight,fPadDown, fPadRight
		//{fPadUpRight,  fPadRight,fPadDown}
		//{fPadUpLeft,   fPadUp,   fPadLeft}
		//{fPadDownLeft, fPadLeft, fPadDown}
		if(chargeVeto[0]>chargeVeto[1] && chargeVeto[0]<chargeVeto[2] && chargeVeto[2]>fChargeLimitMaximum[fRing->getTrackSec(trackNo)]){    // Bigger than 1 neighbour pad
		    if(vetoPads[veto][0]==fPadDownRight){
			posPad[2]=isPeak4Tmp[peak]+vetoPads[veto][2];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[1]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[2]=-1;
		    }if(vetoPads[veto][0]==fPadUpRight){
			posPad[0]=isPeak4Tmp[peak]+vetoPads[veto][2];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[1]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[0]=-1;
		    }if(vetoPads[veto][0]==fPadUpLeft){
			posPad[3]=isPeak4Tmp[peak]+vetoPads[veto][2];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[1]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[3]=-1;
		    }if(vetoPads[veto][0]==fPadDownLeft){
			posPad[1]=isPeak4Tmp[peak]+vetoPads[veto][2];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[1]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[1]=-1;
		    }
		}else if(chargeVeto[0]>chargeVeto[2] && chargeVeto[0]<chargeVeto[1] && chargeVeto[1]>fChargeLimitMaximum[fRing->getTrackSec(trackNo)]){   // Bigger than 1 neighbour pad
		    if(vetoPads[veto][0]==fPadDownRight){
			posPad[1]=isPeak4Tmp[peak]+vetoPads[veto][1];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[2]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[1]=-1;
		    }if(vetoPads[veto][0]==fPadUpRight){
			posPad[2]=isPeak4Tmp[peak]+vetoPads[veto][1];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[2]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[2]=-1;
		    }if(vetoPads[veto][0]==fPadUpLeft){
			posPad[0]=isPeak4Tmp[peak]+vetoPads[veto][1];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[2]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[0]=-1;
		    }if(vetoPads[veto][0]==fPadDownLeft){
			posPad[3]=isPeak4Tmp[peak]+vetoPads[veto][1];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[2]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[3]=-1;
		    }
		}else if(chargeVeto[0]>chargeVeto[2] && chargeVeto[0]>chargeVeto[1] && chargeVeto[0]>fChargeLimitMaximum[fRing->getTrackSec(trackNo)]) {    // Bigger than both neighbour pads
		    if(vetoPads[veto][0]==fPadDownRight){
			posPad[6]=isPeak4Tmp[peak]+vetoPads[veto][0];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[2]+sharedChargeDiagonal(chargeMaximumDiag)) && chargeVeto[0]<(chargeVeto[1]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[6]=-1;
		    }if(vetoPads[veto][0]==fPadUpRight){
			posPad[4]=isPeak4Tmp[peak]+vetoPads[veto][0];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[2]+sharedChargeDiagonal(chargeMaximumDiag)) && chargeVeto[0]<(chargeVeto[1]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[4]=-1;
		    }if(vetoPads[veto][0]==fPadUpLeft){
			posPad[7]=isPeak4Tmp[peak]+vetoPads[veto][0];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[2]+sharedChargeDiagonal(chargeMaximumDiag)) && chargeVeto[0]<(chargeVeto[1]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[7]=-1;
		    }if(vetoPads[veto][0]==fPadDownLeft){
			posPad[5]=isPeak4Tmp[peak]+vetoPads[veto][0];
			if(kMaximumDiag==1 && chargeVeto[0]<(chargeVeto[2]+sharedChargeDiagonal(chargeMaximumDiag))  && chargeVeto[0]<(chargeVeto[1]+sharedChargeDiagonal(chargeMaximumDiag)))
			    isGoodPeakCharge[5]=-1;
		    }
		}
	    }

	    //Check if 7 pads around possible maximum have smaller charge (only exception should be maximum which was already found
	    for(Int_t veto=0; veto < nNeighbours ; veto++) {
		if(posPad[veto]<0) //Skip if no possible maximum was found
		    continue;
		//Get charge of possible maximum
		Float_t chargePad = getPadCharge(posPad[veto]);

		Int_t i=0;
		while(i<nNeighbours && isGoodPeakNeigh[veto]){
		    Int_t posNeigh      = posPad[veto] + neighborAdd[i];
		    Float_t chargeNeigh = getPadCharge(posNeigh);
		    if(chargeNeigh>chargePad){
			isGoodPeakNeigh[veto]--;
		    }
		    i++;
		}
		Bool_t inCluster = kFALSE;// Check if Maxima pad is in Cluster
		for(UInt_t hit=beginclus; hit < fIsInCluster.size(); hit++){
		    if(posPad[veto]==fIsInCluster[hit])
			inCluster=kTRUE;
		}
		if(inCluster){
		    if(isGoodPeakNeigh[veto]>=0 && isGoodPeakCharge[veto]>0){
			isPeak7Tmp.push_back(posPad[veto]);
		    }
		}
	    }
	}


	//Search for nMaxima7 which are not in nMaxima4 and are located next to each other
	vector < Int_t > tmpErase;
	for(UInt_t peak=0; peak < isPeak7Tmp.size(); peak++) {
	    Int_t posPad1 = isPeak7Tmp[peak];
	    if(std::find(isPeak4Tmp.begin(), isPeak4Tmp.end(), posPad1) !=  isPeak4Tmp.end())
		continue;
	    for(UInt_t peak2=peak+1; peak2 < isPeak7Tmp.size(); peak2++){
		Int_t posPad2 = isPeak7Tmp[peak2];
		if(std::find(isPeak4Tmp.begin(), isPeak4Tmp.end(), posPad2) !=  isPeak4Tmp.end())
		    continue;

		//Get col and row to check if peaks are next to each other
		Int_t sec1;
		Int_t row1;
		Int_t col1;
		Int_t sec2;
		Int_t row2;
		Int_t col2;

		addressToColRow(posPad1, sec1, row1, col1);
		addressToColRow(posPad2, sec2, row2, col2);

		if((TMath::Abs(row1-row2)==1 && (col1-col2)==0 ) || (TMath::Abs(col1-col2)==1 && (row1-row2)==0)){
		    Float_t charge1 =  getPadCharge(posPad1);
		    Float_t charge2 =  getPadCharge(posPad2);
		    if(charge1>charge2)
			tmpErase.push_back(peak2);
		    else if(charge1<charge2)
			tmpErase.push_back(peak);
		}
	    }
	}

	//Remove found max
	for(UInt_t i = 0; i < tmpErase.size(); i++){
	    // once the position i is reached the element to be erased has a position pos - i
	    isPeak7Tmp.erase(isPeak7Tmp.begin()+tmpErase[i]-i);
	}

    }
    //Fill all max, max on fPrediction,max next to fPrediction
    for(UInt_t peak = 0; peak < isPeak7Tmp.size(); peak++) {
	Bool_t isPeak4 = kFALSE;
        Bool_t isPeak8 = kFALSE;
	Bool_t isPeak7 = kFALSE;

	Int_t posPad = isPeak7Tmp[peak];
	if(std::find(isPeak4Tmp.begin(), isPeak4Tmp.end(), posPad) !=  isPeak4Tmp.end())
	    isPeak4 = kTRUE;
        if(std::find(isPeak8Tmp.begin(), isPeak8Tmp.end(), posPad) !=  isPeak8Tmp.end())
	    isPeak8 = kTRUE;
        if(std::find(isPeak7Tmp.begin(), isPeak7Tmp.end(), posPad) !=  isPeak7Tmp.end())
	    isPeak7 = kTRUE;

	for(UInt_t i=0; i< fPrediction->size(); i++){
	    Int_t pos = -1;
	    for(UInt_t j=0; j < fClusTrackNoShared[lastElement].size(); j++) {
		if((UInt_t)fClusTrackNoShared[lastElement][j]==i)
		    pos = j;
	    }
	       
	    if(pos!=-1) {
		if(getPadCharge(posPad)>fChargeLimitMaximum[fRing->getTrackSec(trackNo)]){
		    if(isPeak7){
			peakCounterVec7[pos]++;
			peakPadsVec7[pos].push_back(posPad);
		    }
		    if(isPeak8){
			peakCounterVec8[pos]++;
			peakPadsVec8[pos].push_back(posPad);

		    }
		    if(isPeak4){
			peakCounterVec4[pos]++;
			peakPadsVec4[pos].push_back(posPad);

		    }
		}
	    }
	}
    }
    if( fMaximumType==7 ) {
	fClusNMaxima.push_back(peakCounterVec7);
	fClusNMaximaPad.push_back(peakPadsVec7);
    } else if( fMaximumType == 4 ){
	fClusNMaxima.push_back(peakCounterVec4);
	fClusNMaximaPad.push_back(peakPadsVec4);
    } else if(fMaximumType == 8 ){
	fClusNMaxima.push_back(peakCounterVec8);
	fClusNMaximaPad.push_back(peakPadsVec8);
    } else {
	fClusNMaxima.push_back(peakCounterVec7);
	fClusNMaximaPad.push_back(peakPadsVec7);
    }

}

//Double_t HParticleBtClusterF::gaussf(Double_t *x, Double_t *par)
Double_t gaussf(Double_t *x, Double_t *par)
{
    //Gauss function consisting out of 1 2D gauss per maximum
    Double_t myfval=0.0;
    for(Int_t i=0; i< par[0]; i++){
        myfval += par[1+i*5]*TMath::Gaus(x[0],par[2+i*5],par[3+i*5],kFALSE)*TMath::Gaus(x[1],par[4+i*5],par[5+i*5],kFALSE);
    }
    return myfval;
}

void HParticleBtClusterF::fitMaximaPos(const UInt_t beginclus)
{
    //Fit charge distribution of clusters to determine more precise maxima positions

    UInt_t lastElementClus   = fClusNMaximaPad.size()-1;
    UInt_t lastElementTrack  = fClusNMaximaPad[lastElementClus].size()-1;
    const UInt_t nMaxima     = fClusNMaximaPad[lastElementClus][lastElementTrack].size();
    const UInt_t clusSize    = fIsInCluster.size()-beginclus;
    vector < vector <Float_t> > peakVecX(lastElementTrack+1);
    vector < vector <Float_t> > peakVecY(lastElementTrack+1);



    Int_t secMax[nMaxima];
    Int_t colMax[nMaxima];
    Int_t rowMax[nMaxima];
    Int_t secClus[clusSize];
    Int_t colClus[clusSize];
    Int_t rowClus[clusSize];

    if(nMaxima < fNMaxLimit && nMaxima > 0 && fClusPadSum[lastElementClus] > 1  ) {

	for(UInt_t max=0; max<nMaxima; max++){
	    addressToColRow(fClusNMaximaPad[lastElementClus][lastElementTrack][max],secMax[max],colMax[max],rowMax[max]);
	}

	for(UInt_t hit=beginclus; hit < fIsInCluster.size(); hit++){
	    addressToColRow(fIsInCluster[hit],secClus[hit-beginclus],colClus[hit-beginclus],rowClus[hit-beginclus]);

	}

	Int_t DistCol = 0;
	Int_t DistRow = 0;
	Int_t minCol  = 1000; 
	Int_t minRow  = 1000;

	//Determine maximum distance of pad rows and pad cols
	for(UInt_t hit=0; hit < clusSize; hit++){
	    if(rowClus[hit]<minRow)
		minRow=rowClus[hit];
	    if(colClus[hit]<minCol)
		minCol=colClus[hit];
	    for(UInt_t hit2=hit+1; hit2 < clusSize; hit2++){
		Int_t tmpDistRow =  TMath::Abs(rowClus[hit]-rowClus[hit2])+1;
		Int_t tmpDistCol =  TMath::Abs(colClus[hit]-colClus[hit2])+1;
		if(tmpDistRow>DistRow)
		    DistRow=tmpDistRow;
		if(tmpDistCol>DistCol)
		    DistCol=tmpDistCol;
	    }
	}

	Int_t maxDistRow = DistRow;
	Int_t maxDistCol = DistCol;

        // Creation of the histogram for 2D fitting. TODO check if setting bin error can help...
	TH2F* hCluster  = new TH2F("hCluster","hCluster",maxDistRow,minRow,minRow+maxDistRow,maxDistCol,minCol,minCol+maxDistCol);
	for(UInt_t clus=0; clus< clusSize; clus++){
	    hCluster->SetBinContent(rowClus[clus]-minRow+1,colClus[clus]-minCol+1,getPadCharge(fIsInCluster[clus+beginclus]));
	}

	//Init fit function and set parameters
	TF2 *fGaus     = new TF2("fGaus",gaussf,(Double_t)minRow,(Double_t)(minRow+maxDistRow),(Double_t)minCol,(Double_t)(minCol+maxDistCol),nMaxima*5+1);//TODO init somewhere else
	fGaus->FixParameter(0,fNMaxLimit);
        fGaus->SetLineColor(kBlack);
        //Prepare fit
	for(UInt_t max=0; max < nMaxima; max++){
	    Float_t maximumCharge = getPadCharge(fClusNMaximaPad[lastElementClus][lastElementTrack][max]);
	    fGaus->SetParameter(1+max*5,maximumCharge*1.1);
	    fGaus->SetParLimits(1+max*5,maximumCharge*0.1,maximumCharge*3000);
	    fGaus->SetParameter(2+max*5,rowMax[max]+0.5);
	    fGaus->SetParLimits(2+max*5,rowMax[max],rowMax[max]+1.0);
	    fGaus->SetParameter(3+max*5,fSigmaGaus[0]);
	    fGaus->SetParLimits(3+max*5,fSigmaGaus[0]-fSigmaGausRange[0],fSigmaGaus[0]+fSigmaGausRange[0]);
	    fGaus->SetParameter(4+max*5,colMax[max]+0.5);
	    fGaus->SetParLimits(4+max*5,colMax[max],colMax[max]+1.0);
	    fGaus->SetParameter(5+max*5,fSigmaGaus[1]);
	    fGaus->SetParLimits(5+max*5,fSigmaGaus[1]-fSigmaGausRange[1],fSigmaGaus[1]+fSigmaGausRange[1]);
	}

	hCluster->Fit(fGaus,"QRWW");

        //Get pad Position
	for(UInt_t max=0; max < nMaxima; max++) {
	    for(UInt_t track=0; track <= lastElementTrack; track++){
		peakVecX[track].push_back(fGaus->GetParameter(2+max*5));
		peakVecY[track].push_back(fGaus->GetParameter(4+max*5));
	    }
	}
	delete hCluster;
	delete fGaus;
    }else if(fClusPadSum[lastElementClus]==1 && nMaxima > 0){
	//Set value if cluster consists of one pad.
	Int_t tmpAdd[3];

	addressToColRow(fClusNMaximaPad[lastElementClus][lastElementTrack][0],tmpAdd[0],tmpAdd[1],tmpAdd[2]);
	for(UInt_t track=0; track <= lastElementTrack; track++){
	    peakVecX[track].push_back(tmpAdd[2]+0.5);
	    peakVecY[track].push_back(tmpAdd[1]+0.5);
	}
       
    }else if( nMaxima ==0 ){
	//Cluster had too many maxima or 0
            for(UInt_t track=0; track <= lastElementTrack; track++){
		peakVecX[track].push_back(-1);
		peakVecY[track].push_back(-1);
	    }
  
    }else{
	//Cluster had too many maxima or 0
	for(UInt_t max=0; max < nMaxima; max++){
	    for(UInt_t track=0; track <= lastElementTrack; track++){
		peakVecX[track].push_back(-1);
		peakVecY[track].push_back(-1);
	    }
	}
    }
   
    fClusNMaximaPosX.push_back(peakVecX);
    fClusNMaximaPosY.push_back(peakVecY);

}

void HParticleBtClusterF::calcChi2(const Int_t trackNo)
{
    //Calculates distance between maxima positions and ring predictions for tracks
    //Distance is normalized by sigma of optical distortioan and error of maximum position determination

    UInt_t lastElementClus  = fClusNMaximaPad.size()-1;
    UInt_t lastElementTrack = fClusNMaximaPad[lastElementClus].size();
    const UInt_t nMaxima    = fClusNMaximaPad[lastElementClus][lastElementTrack-1].size();
    vector < vector <Float_t> > vecChi2(lastElementTrack);
    vector < vector <Float_t> > vecChi2XMM(lastElementTrack);
    vector < vector <Float_t> > vecChi2YMM(lastElementTrack);
    vector < vector <Float_t> > vecCircleX(lastElementTrack);
    vector < vector <Float_t> > vecCircleY(lastElementTrack);
    vector < vector <Float_t> > vecSig1X(lastElementTrack);
    vector < vector <Float_t> > vecSig1Y(lastElementTrack);
    vector < vector <Float_t> > vecSig2X(lastElementTrack);
    vector < vector <Float_t> > vecSig2Y(lastElementTrack);


    Float_t chi2XMM = 0;
    Float_t chi2YMM = 0;

    Int_t theta     = 0;
    Int_t phi       = 0;
    Int_t vertexNum = 0;
    Int_t sec       = 0;

    HParticleBtAngleTrafo richAngles;


    for(UInt_t trackNo = 0; trackNo<lastElementTrack; trackNo++){
        //get ring information
	theta        = fRing->getTrackTheta(fClusTrackNoShared[lastElementClus][trackNo] );
	phi          = fRing->getTrackPhi(fClusTrackNoShared[lastElementClus][trackNo]   );
        vertexNum    = fRing->getTrackVertex(fClusTrackNoShared[lastElementClus][trackNo]);
        sec          = fRing->getTrackSec(fClusTrackNoShared[lastElementClus][trackNo]   );
       
    
	Double_t posXCenter = richAngles.xPad2x(fRing->getPosXCenter(fClusTrackNoShared[lastElementClus][trackNo]));
	Double_t posYCenter = richAngles.xPadyPad2y(fRing->getPosXCenter(fClusTrackNoShared[lastElementClus][trackNo]),fRing->getPosYCenter(fClusTrackNoShared[lastElementClus][trackNo]));


	for(UInt_t max=0; max < nMaxima ; max++){

            Double_t padXMax = fClusNMaximaPosX[lastElementClus][trackNo][max];
	    Double_t padYMax = fClusNMaximaPosY[lastElementClus][trackNo][max];

	    if(padXMax<0 || padYMax<0){
		//Bad cluster with too many maxima
		vecChi2[trackNo].push_back(999);
	        vecChi2XMM[trackNo].push_back(999);
		vecChi2YMM[trackNo].push_back(999);
		vecCircleX[trackNo].push_back(999);
		vecCircleY[trackNo].push_back(999);
		vecSig1X[trackNo].push_back(999);
		vecSig1Y[trackNo].push_back(999);
		vecSig2X[trackNo].push_back(999);
		vecSig2Y[trackNo].push_back(999);
	    }else{
		Double_t posXMax = richAngles.xPad2x(padXMax);
		Double_t posYMax = richAngles.xPadyPad2y(padXMax,padYMax);
	      

		Double_t distX = posXMax-posXCenter;
		Double_t distY = posYMax-posYCenter;
		Double_t posXCircle = -1;
		Double_t posYCircle = -1;
		Double_t angle      = -1;
		Int_t    bin        = -1;
		Int_t    bin2       = -1;
		Double_t rest       = -1;
		Double_t radius     = -1;
		Double_t radius2    = -1;
		Double_t sigma      = -1;
		Double_t sigmaXRing = -1;
		Double_t sigmaYRing = -1;
                Double_t sigmaX     = -1;
		Double_t sigmaY     = -1;
                //Double_t sigmaTotal = -1; //unused


		Double_t sigma2  = -1;

	     

                //Use maxima position to calculate corresponding phi angle of ring
		if(distX>=0){
		    if(distY<=0){
			angle = TMath::Abs(TMath::ATan(distX/distY))*TMath::RadToDeg();
		    }else{
			angle = TMath::Abs(TMath::ATan(distY/distX))*TMath::RadToDeg()+90;
		    }
		}else{
		    if(distY>=0)
			angle = TMath::Abs(TMath::ATan(distX/distY))*TMath::RadToDeg()+180;
		    else
			angle = TMath::Abs(TMath::ATan(distY/distX))*TMath::RadToDeg()+270;

		}
                //Get bin corresponding to phi angle
                if(angle>-1){
		    bin  = (Int_t)angle/fNRingSegStep;
		    rest = angle-(bin*fNRingSegStep);
		}
		if(bin!=fNRingSeg-1)
		    bin2=bin+1;
		else
		    bin2=0;

                //Set limits to avoid very small sigma values
		if(theta<fParThetaAngleMin) theta=fParThetaAngleMin;
		if(theta>fParThetaAngleMax) theta=fParThetaAngleMax;

                //Get radius and sigma information
		radius   = fPol2DMean[bin][vertexNum]   -> Eval(theta,-(phi-fPhiOff[sec])+30);
        	radius2  = fPol2DMean[bin2][vertexNum]  -> Eval(theta,-(phi-fPhiOff[sec])+30);
		sigma    = fPol2DSigma[bin][vertexNum]  -> Eval(theta,-(phi-fPhiOff[sec])+30);
		sigma2   = fPol2DSigma[bin2][vertexNum] -> Eval(theta,-(phi-fPhiOff[sec])+30);
		radius     =  (((fNRingSegStep-1)-rest)*radius + rest*radius2)/(fNRingSegStep-1); //weight radius to get better approximation
		sigma      =  (((fNRingSegStep-1)-rest)*sigma + rest*sigma2)/(fNRingSegStep-1);

                //Combine ring width with error of maximum position determination
		sigmaXRing = TMath::Sin(TMath::DegToRad()*angle)*sigma;
		sigmaYRing = (-1)*TMath::Cos(TMath::DegToRad()*angle)*sigma;
		sigmaX     = TMath::Sqrt(sigmaXRing*sigmaXRing+(fSigmaErrorPad*fPadWidthX)*(fSigmaErrorPad*fPadWidthX));
		sigmaY     = TMath::Sqrt(sigmaYRing*sigmaYRing+(fSigmaErrorPad*fPadWidthY)*(fSigmaErrorPad*fPadWidthY));
                //sigmaTotal = TMath::Sqrt(sigmaX*sigmaX+sigmaY+sigmaY);   //unused

                //Calulate most likely position for photon hit
		posXCircle = posXCenter + radius*TMath::Sin(TMath::DegToRad()*angle);
		posYCircle = posYCenter + (-1)*radius*TMath::Cos(TMath::DegToRad()*angle);
		chi2XMM = posXMax-posXCircle;
		chi2YMM = posYMax-posYCircle;

                //Distance between maxima and most likely hit position
		Float_t sigmaPad = TMath::Sqrt(TMath::Power(richAngles.x2xPad(posXCircle)-richAngles.x2xPad(posXCircle+sigmaX),2)
					       +TMath::Power(richAngles.xy2yPad(posXCircle,posYCircle)
							     -richAngles.xy2yPad(posXCircle+sigmaX,posYCircle+sigmaY),2));
		Float_t chi2    = TMath::Sqrt(TMath::Power(richAngles.x2xPad(posXCircle)-richAngles.x2xPad(posXMax),2)
					       +TMath::Power(richAngles.xy2yPad(posXCircle,posYCircle)-richAngles.xy2yPad(posXMax,posYMax),2))
	                                     /sigmaPad;

		vecChi2[trackNo].push_back(chi2);
		vecChi2XMM[trackNo].push_back(chi2XMM);
		vecChi2YMM[trackNo].push_back(chi2YMM);
		vecCircleX[trackNo].push_back(richAngles.x2xPad(posXCircle));
		vecCircleY[trackNo].push_back(richAngles.xy2yPad(posXCircle,posYCircle));

		vecSig1X[trackNo].push_back(richAngles.x2xPad(posXCircle)-TMath::Sin(TMath::DegToRad()*angle)*sigmaPad);
		vecSig1Y[trackNo].push_back(richAngles.xy2yPad(posXCircle,posYCircle)-(-1)*TMath::Cos(TMath::DegToRad()*angle)*sigmaPad);
	        vecSig2X[trackNo].push_back(richAngles.x2xPad(posXCircle)+TMath::Sin(TMath::DegToRad()*angle)*sigmaPad);
		vecSig2Y[trackNo].push_back(richAngles.xy2yPad(posXCircle,posYCircle)+(-1)*TMath::Cos(TMath::DegToRad()*angle)*sigmaPad);
	   

	    }
	}
    }

    fClusChi2.push_back(vecChi2);
    fClusChi2XMM.push_back(vecChi2XMM);
    fClusChi2YMM.push_back(vecChi2YMM);
    fClusCircleX.push_back(vecCircleX);
    fClusCircleY.push_back(vecCircleY);
    fClusSig1X.push_back(vecSig1X);
    fClusSig1Y.push_back(vecSig1Y);
    fClusSig2X.push_back(vecSig2X);
    fClusSig2Y.push_back(vecSig2Y);

}

void HParticleBtClusterF::setGoodClus(){
    UInt_t lastElementClus  = fClusNMaximaPad.size()-1;

    if((UInt_t)fClusPadSum[lastElementClus]>=fClusSizeLimit || (UInt_t)fClusNMaxima[lastElementClus][0]>=fNMaxLimit)
	fClusIsGood.push_back(kFALSE);
    else
	fClusIsGood.push_back(kTRUE);
}

void HParticleBtClusterF::findClusterShape(const UInt_t beginclus)
{
    //Shapes of clusters is detected and marked with number.
    //Only most common shapes are considered
    //Clusters with more than 5 pads are just sorted by size

    const UInt_t size = fIsInCluster.size()-beginclus;
    Int_t sizeCharge = size; //Pads with charge larger 65.0
    Int_t sec[size];
    Int_t row[size];
    Int_t col[size];

    Int_t nNeighboursMax = 0;
    Int_t nBorderMax     = 0;
    Int_t nBorder        = 0;
    Int_t padDist        = 0;
 
    //Detect Maximum
    Int_t   pos = std::find(fRichHitAdd->begin(), fRichHitAdd->end(), fIsInCluster[beginclus]) - fRichHitAdd->begin();
    Float_t maximumCharge = (*fRichHitCharge)[pos];
    Int_t   maximum       = beginclus;
    Float_t minimumCharge = (*fRichHitCharge)[pos];
    Float_t restCharge    = 0;

    for(UInt_t hit=beginclus+1; hit < fIsInCluster.size(); hit++){
	pos = std::find(fRichHitAdd->begin(), fRichHitAdd->end(), fIsInCluster[hit]) - fRichHitAdd->begin();
	if((*fRichHitCharge)[pos]>maximumCharge){
	    maximum       = hit;
	    maximumCharge = (*fRichHitCharge)[pos];
	}
        if((*fRichHitCharge)[pos]<minimumCharge){
	    minimumCharge = (*fRichHitCharge)[pos];
	}
    }
    for(UInt_t hit=beginclus; hit < fIsInCluster.size(); hit++){
	pos = std::find(fRichHitAdd->begin(), fRichHitAdd->end(), fIsInCluster[hit]) - fRichHitAdd->begin();
        restCharge+=(*fRichHitCharge)[pos];
    }
    restCharge -= maximumCharge;
    restCharge -= minimumCharge;

    for(UInt_t hit=beginclus; hit < fIsInCluster.size(); hit++){
	addressToColRow(fIsInCluster[hit], sec[hit-beginclus], row[hit-beginclus], col[hit-beginclus]);
    }

    //Determine number of fired neighbours for fIsInCluster[maximum]
    if(std::find(fIsInCluster.begin(), fIsInCluster.end(),  fIsInCluster[maximum]+fPadUp)    !=  fIsInCluster.end()){
	nNeighboursMax++;
    }if(std::find(fIsInCluster.begin(), fIsInCluster.end(), fIsInCluster[maximum]+fPadDown)  !=  fIsInCluster.end()){
	nNeighboursMax++;
    }if(std::find(fIsInCluster.begin(), fIsInCluster.end(), fIsInCluster[maximum]+fPadRight) !=  fIsInCluster.end()){
	nNeighboursMax++;
    }if(std::find(fIsInCluster.begin(), fIsInCluster.end(), fIsInCluster[maximum]+fPadLeft)  !=  fIsInCluster.end()){
	nNeighboursMax++;
    }

    //Determine length of border in length of pads  for InCluster[maximum]
    if(!(std::find(fIsInCluster.begin(), fIsInCluster.end(),  fIsInCluster[maximum]+fPadUp)   !=  fIsInCluster.end())){
	nBorderMax++;
    }if(!(std::find(fIsInCluster.begin(), fIsInCluster.end(), fIsInCluster[maximum]+fPadDown) !=  fIsInCluster.end())){
	nBorderMax++;
    }if(!(std::find(fIsInCluster.begin(), fIsInCluster.end(), fIsInCluster[maximum]+fPadRight)!=  fIsInCluster.end())){
	nBorderMax++;
    }if(!(std::find(fIsInCluster.begin(), fIsInCluster.end(), fIsInCluster[maximum]+fPadLeft) !=  fIsInCluster.end())){
	nBorderMax++;
    }

    for(UInt_t hit=beginclus; hit < fIsInCluster.size(); hit++) {
	if(!(std::find(fIsInCluster.begin(), fIsInCluster.end(),  fIsInCluster[hit]+fPadUp)   !=  fIsInCluster.end())){
	    nBorder++;
	}if(!(std::find(fIsInCluster.begin(), fIsInCluster.end(), fIsInCluster[hit]+fPadDown) !=  fIsInCluster.end())){
	    nBorder++;
	}if(!(std::find(fIsInCluster.begin(), fIsInCluster.end(), fIsInCluster[hit]+fPadRight)!=  fIsInCluster.end())){
	    nBorder++;
	}if(!(std::find(fIsInCluster.begin(), fIsInCluster.end(), fIsInCluster[hit]+fPadLeft) !=  fIsInCluster.end())){
	    nBorder++;
	}
    }
    //Determine maximum distance of pad rows and pad cols
    for(UInt_t hit=0; hit < size; hit++){
	for(UInt_t hit2=hit+1; hit2 < size; hit2++){
	    Int_t tmpDistRow=  TMath::Abs(row[hit]-row[hit2]);
	    Int_t tmpDistCol=  TMath::Abs(col[hit]-col[hit2]);
            if(tmpDistRow>padDist)
		padDist=tmpDistRow;
	    if(tmpDistCol>padDist)
		padDist=tmpDistCol;
	}
    }
    //Pad clus categorization
    if(sizeCharge==0)
	fClusClass.push_back(0);
    if(sizeCharge==1)
        if(maximumCharge>65)
	    fClusClass.push_back(1);
        else
            fClusClass.push_back(0);
    
    else if(sizeCharge==2){
        if(row[0]==row[1] && minimumCharge<maximumCharge ){
	    fClusClass.push_back(2);
      
	}if(col[0]==col[1] && minimumCharge<maximumCharge){
	    fClusClass.push_back(3);
	}
    }else if(sizeCharge==3){
     
	if((row[0]==row[1] && row[0]==row[2]) || (col[0]==col[1] && col[0]==col[2])){  
    
	    if(nNeighboursMax==2){             //Shape: #x#
                if(row[0]==row[1])
		    fClusClass.push_back(4);
                if(col[0]==col[1])
		    fClusClass.push_back(5);
	    }else{                              //Shape: x##
		fClusClass.push_back(7);
	    }
	}else{
	    if(nNeighboursMax==2){            //Shape:#x
		fClusClass.push_back(6);      //Shape: #
	    }else{                                //Shape: ##
		fClusClass.push_back(8);           //Shape: x
	    }
	}
    }
    else if(sizeCharge==4) {
	if(nNeighboursMax==2 && nBorder==8 && padDist==1){
	    fClusClass.push_back(9);           //Shape:   #x
	}else  if(nNeighboursMax==3 && nBorder==10 && padDist==2){     //    #
	    fClusClass.push_back(10);                                    //   #x#
	}else if (padDist==3)   {                     // ####
	    fClusClass.push_back(11);                  //
	}else{
	    fClusClass.push_back(12);
	}
    }else if(sizeCharge==5){
        Int_t counterRow=0;
        Int_t counterCol=0;
	for(Int_t i=0; i< 5 ; i++){
	    if(row[maximum-beginclus]==row[i])
		counterRow++;
            if(col[maximum-beginclus]==col[i])
		counterCol++;
	}
	if(nBorder==10){
	    if(nBorderMax==2){
	        if(counterCol==3 || counterRow==3)
		    fClusClass.push_back(13);
                else
	            fClusClass.push_back(14);
	    }else
	        fClusClass.push_back(14);
        }else
	    fClusClass.push_back(14);
    }
    else{
	fClusClass.push_back(sizeCharge+9);
    }
}

void HParticleBtClusterF::calcRingShift(const Int_t trackNo)
{
    //Calculates mean maxima position deviation from ring prediction
    //Mean deviation in x,y direction is  stored


    HParticleBtAngleTrafo richAngles;
    //Correct theta and phi angle
    //Float_t theta     = fRing->getTrackTheta(trackNo);   //unused
    //Float_t phi       = fRing->getTrackPhi(trackNo);     //unused
    //Int_t   sec       = fRing->getTrackSec(trackNo);     //unused
    //Int_t   vertexNum = fRing->getTrackVertex(trackNo);  //unused
   

    //Transform angles to x,y Padplane coordinates
    Double_t posXCenter = richAngles.xPad2x(fRing->getPosXCenter(trackNo));
    Double_t posYCenter = richAngles.xPadyPad2y(fRing->getPosXCenter(trackNo),fRing->getPosYCenter(trackNo));

    Float_t meanDistX = 0;
    Float_t meanDistY = 0;
    Float_t meanDistXPad = 0;
    Float_t meanDistYPad = 0;
    Int_t nMaxima     = 0;

   
    //Add deviations in x and y direction
    for(UInt_t clus = 0; clus<fClusNMaximaPad.size(); clus++){
	for(UInt_t track=0; track < fClusNMaximaPad[clus].size();track++){
	    for(UInt_t max=0; max<fClusNMaximaPad[clus][track].size(); max++){
		if(fClusTrackNoShared[clus][track]==trackNo){
		    Double_t padXMax = fClusNMaximaPosX[clus][track][max];
		    Double_t padYMax = fClusNMaximaPosY[clus][track][max];
                    if(padXMax >= 0 || padYMax >= 0){
		        if(fClusChi2[clus][track][max]<fMaxSigmaRange){
			    meanDistX+=fClusChi2XMM[clus][track][max];
			    meanDistY+=fClusChi2YMM[clus][track][max];
			    nMaxima++;
			}
		    }
		}
	    }
	}
    }
    if(nMaxima>0){
	meanDistX = meanDistX/(Float_t)nMaxima;
	meanDistY = meanDistY/(Float_t)nMaxima;
	meanDistXPad = TMath::Abs(richAngles.x2xPad(posXCenter)-richAngles.x2xPad(posXCenter+meanDistX));
	meanDistYPad = TMath::Abs(richAngles.xy2yPad(posXCenter,posYCenter)-richAngles.xy2yPad(posXCenter+meanDistX,posYCenter+meanDistY));

    }else{
	meanDistXPad = 999;
	meanDistYPad = 999;

    }
		  
    fRingMeanDistX.push_back(meanDistXPad);
    fRingMeanDistY.push_back(meanDistYPad);
}



void HParticleBtClusterF::clearCluster()
{
    //Clears vectors that contain cluster information of one event

    fIsInCluster.clear();               
    fRingMeanDistX.clear();
    fRingMeanDistY.clear();
    fClusPadSum.clear();
    fClusPadRing.clear();
    fClusClass.clear();
    fClusPosX.clear();
    fClusPosY.clear();
    fClusChargeSum.clear();
    fClusChargeRing.clear();
  
    for(UInt_t i=0; i<fClusTrackNoShared.size(); i++)
	fClusTrackNoShared[i].clear();
    fClusTrackNoShared.clear();
    for(UInt_t i=0; i<fClusNMaxima.size(); i++){
	fClusNMaxima[i].clear();
	for(UInt_t j=0; j<fClusNMaxima[i].size();j++){
	    fClusNMaximaPad[i][j].clear();
	    fClusNMaximaPosX[i][j].clear();
	    fClusNMaximaPosY[i][j].clear();
	    fClusCircleX[i][j].clear();
	    fClusCircleY[i][j].clear();
	    fClusSig1X[i][j].clear();
	    fClusSig1Y[i][j].clear();
	    fClusSig2X[i][j].clear();
	    fClusSig2Y[i][j].clear();
	    fClusChi2[i][j].clear();
            fClusChi2XMM[i][j].clear();
            fClusChi2YMM[i][j].clear();
        }
	fClusNMaximaPad[i].clear();
        fClusNMaximaPosX[i].clear();
        fClusNMaximaPosY[i].clear();
	fClusCircleX[i].clear();
	fClusCircleY[i].clear();
	fClusSig1X[i].clear();
	fClusSig1Y[i].clear();
	fClusSig2X[i].clear();
	fClusSig2Y[i].clear();
	fClusChi2[i].clear();
        fClusChi2XMM[i].clear();
	fClusChi2YMM[i].clear();

    }
    fClusNMaxima.clear();
    fClusNMaximaPad.clear();
    fClusNMaximaPosX.clear();
    fClusNMaximaPosY.clear();
    fClusCircleX.clear();
    fClusCircleY.clear();
    fClusSig1X.clear();
    fClusSig1Y.clear();
    fClusSig2X.clear();
    fClusSig2Y.clear();
    fClusChi2.clear();
    fClusChi2XMM.clear();
    fClusChi2YMM.clear();

      
}

Int_t HParticleBtClusterF::getPadsRing(const Int_t trackNo)
{
    //Returns number of pads on predicted pads

    if(!fPrediction){
	Error("calcCluster()","fPrediction pionter is NULL, call setRingF() first!");
        exit(1);
    }
   
    Int_t nHits=0;
    for(UInt_t pred=0; pred < (*fPrediction)[trackNo].size(); pred++){
	for(UInt_t hit=0; hit < fRichHitAdd->size(); hit++){
	    if((*fRichHitAdd)[hit] == (*fPrediction)[trackNo][pred]){
	        if((*fRichHitCharge)[hit]>fChargeLimit[fRing->getTrackSec(trackNo)]){
	            nHits++;
	        }
	    }
	}
    }
    return  nHits;
}

Int_t HParticleBtClusterF::getPadsSum(const Int_t trackNo)
{
    //Returns number of pads of clusters which have at least one predicted pad

    Int_t nHits=0;
    for(UInt_t i=0; i<fClusPadSum.size(); i++){
        Bool_t isClusterOfTrack = kFALSE;
	for(UInt_t j=0; j<fClusTrackNoShared[i].size(); j++){
	    if(fClusTrackNoShared[i][j]==trackNo)
		isClusterOfTrack = kTRUE;
	}
	if(fClusIsGood[i] && fClusChargeSum[i] > 0 && isClusterOfTrack)
	    nHits+=fClusPadSum[i];

    }
    return  nHits;
}


Float_t HParticleBtClusterF::getChargeRing(const Int_t trackNo)
{
    //Returns charge of pads that are predicted
    Float_t charge = 0;
    for(UInt_t pred=0; pred < (*fPrediction)[trackNo].size(); pred++){
	for(UInt_t hit=0; hit < fRichHitAdd->size(); hit++){
	    if((*fRichHitAdd)[hit]==(*fPrediction)[trackNo][pred]){
		if((*fRichHitCharge)[hit]>fChargeLimit[fRing->getTrackSec(trackNo)]){
		    charge+=(*fRichHitCharge)[hit];
		}
	    }
	}
    }
    return  charge;
}

Float_t HParticleBtClusterF::getChargeSum(const Int_t trackNo)
{
    //Returns charge of clusters which have at least one predicted pad
    Float_t charge = 0;
    for(UInt_t i=0; i<fClusChargeSum.size(); i++){
	Bool_t isClusterOfTrack = kFALSE;
	for(UInt_t j=0; j<fClusTrackNoShared[i].size(); j++){
	    if(fClusTrackNoShared[i][j]==trackNo)
		isClusterOfTrack = kTRUE;
	}
	if(fClusIsGood[i] && isClusterOfTrack)
	    charge+=fClusChargeSum[i];
    }
    return  charge;
}

Int_t HParticleBtClusterF::getNClusters(const Int_t trackNo)
{
    //Get number of clusters which have at least one predicted pad
    Int_t counter = 0;
    for(UInt_t i=0; i<fClusTrackNoShared.size(); i++){
	if(!fClusIsGood[i] || fClusChargeSum[i] <= 0) continue;
	for(UInt_t j=0; j<fClusTrackNoShared[i].size(); j++){
	    if(fClusTrackNoShared[i][j] == trackNo){
		//Include only clusters where at least 20% is inside TODO CHECK THE OUTPUT OF THIS METHOD
		if((fClusPadRing[i]>=fClusPadSum[i]*0.2 && fClusPadSum[i]>3) || fClusPadSum[i]<=4)
		    counter++;
	    }
	}
    }
    return counter;
}

Int_t HParticleBtClusterF::getMaxima(const Int_t trackNo)
{
    //Return  number of maxima per ring
    Int_t counter=0;
    for(UInt_t i=0; i<fClusTrackNoShared.size(); i++){
	if(!fClusIsGood[i]) continue;
	for(UInt_t j=0; j<fClusTrackNoShared[i].size(); j++){
	    if(fClusTrackNoShared[i][j]==trackNo){
		for(UInt_t k=0; k<fClusChi2[i][j].size(); k++){
		    if(fClusChi2[i][j][k] < fMaxSigmaRange )
			counter++;
		}
	    }
	}
    }
    return counter;
}

Float_t HParticleBtClusterF::getMaximaCharge(const Int_t trackNo)
{
    //Return  charge of maxima per ring
    Float_t counter=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	for(UInt_t j=0; j<fClusChi2[i].size(); j++){
	    if(fClusTrackNoShared[i][j]==trackNo){
		for(UInt_t k=0; k<fClusChi2[i][j].size(); k++){
		    if(fClusChi2[i][j][k]<fMaxSigmaRange && fClusIsGood[i])
			counter+=getPadCharge(fClusNMaximaPad[i][j][k]);
		}
	    }
	}
    }
    return counter;
}

Int_t HParticleBtClusterF::getNearbyMaxima(const Int_t trackNo)
{
    //Return number of maxima per ring which are in restricted sigma area ( fMaxSigmaRangeSmall)

    Int_t counter=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	for(UInt_t j=0; j<fClusChi2[i].size(); j++){
	    if(fClusTrackNoShared[i][j]==trackNo){
		for(UInt_t k=0; k<fClusChi2[i][j].size(); k++){
                    if(fClusChi2[i][j][k]<fMaxSigmaRangeSmall && fClusIsGood[i])   
			counter++;
		}
	    }
	}
    }
    return counter;
}

Float_t HParticleBtClusterF::getChi2Value(const Int_t trackNo)
{
    // Returns chi2 value

    Float_t chi2=0;
    Int_t counter=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	for(UInt_t j=0; j<fClusChi2[i].size(); j++){
	    if(fClusTrackNoShared[i][j]==trackNo){
		for(UInt_t k=0; k<fClusChi2[i][j].size(); k++){
		    if(fClusChi2[i][j][k]<fMaxSigmaRange && fClusIsGood[i]){
			chi2 += TMath::Power(fClusChi2[i][j][k],2);
			counter++;
		    }
		}
	    }
	}
    }
    if (counter==0) return 999.;
    return TMath::Sqrt(chi2)/(Float_t)counter;
}


Float_t HParticleBtClusterF::getChi2ValuePrimary(const Int_t trackNo)
{
    //Returns chi2 value
    //Maxima are only used if distance is closest to current track

    Float_t chi2=0;
    Int_t counter=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	for(UInt_t j=0; j<fClusChi2[i].size(); j++){
	    if(fClusTrackNoShared[i][j]==trackNo){
		for(UInt_t k=0; k<fClusChi2[i][j].size(); k++){
		    if(fClusChi2[i][j][k]<fMaxSigmaRange){
                        Bool_t kPrimary =kTRUE;
			for(UInt_t l=0; l<fClusChi2[i].size(); l++){//loop for checking
			    if(l==j)
				kPrimary =kTRUE;
		            if(fClusChi2[i][l][k]<fClusChi2[i][j][k])// check if maximum  has smaller dist to other track
				kPrimary=kFALSE;
			}
			if(kPrimary && fClusChi2[i][j][k]<fMaxSigmaRange && fClusIsGood[i]){
			    chi2+=TMath::Power(fClusChi2[i][j][k],2);
			    counter++;
			}
		    }
		}
	    }
	}
    }
    if (counter==0) return 999.;
    return TMath::Sqrt(chi2)/(Float_t)counter;
}

Int_t HParticleBtClusterF::getMaximaShared(const Int_t trackNo)
{
    //Returns number of maxima which are inside shared clusters

    Int_t counterShared=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	counterShared += getShared(trackNo,i, fMaxSigmaRange, kTRUE );
    }
    return counterShared;

}

Int_t HParticleBtClusterF::getMaximaSharedTrack(const Int_t trackNo, const Int_t trackNo2)
{
    //Returns number of maxima which are inside a cluster which is shared with track 2

    Int_t counterShared=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	counterShared += getShared(trackNo,i, fMaxSigmaRange, kTRUE, trackNo2 );
   
    }
     return counterShared;
}

Int_t HParticleBtClusterF::getMaximaSharedBad(const Int_t trackNo)
{
    //Returns number of maxima which are inside shared clusters

    Int_t counterShared=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	counterShared += getShared(trackNo,i, fMaxSigmaRange, kFALSE );
    }
    return counterShared;

}

Int_t HParticleBtClusterF::getMaximaSharedBadTrack(const Int_t trackNo, const Int_t trackNo2)
{
    //Returns number of maxima which are inside a cluster which is shared with track 2

    Int_t counterShared=0;

    for(UInt_t i=0; i<fClusChi2.size(); i++){
	counterShared += getShared(trackNo,i, fMaxSigmaRange, kFALSE, trackNo2 );
    }
    return counterShared;
}

Int_t HParticleBtClusterF::getNearbyMaximaShared(const Int_t trackNo)
{
    //Returns number of maxima which are inside shared clusters and inside a small sigma range

    Int_t counterShared=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	counterShared += getShared(trackNo,i, fMaxSigmaRangeSmall, kTRUE );
    }
    return counterShared;
}

Int_t HParticleBtClusterF::getNearbyMaximaSharedTrack(const Int_t trackNo, const Int_t trackNo2)
{
    //Returns number of maxima which are inside a cluster which is shared with track 2 and inside a restricted sigma range of both tracks

    Int_t counterShared=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	counterShared += getShared(trackNo,i, fMaxSigmaRangeSmall, kTRUE, trackNo2 );
    }
    return counterShared;
}

Float_t HParticleBtClusterF::getMaximaChargeShared(const Int_t trackNo)
{
    //Returns charge of maxima pads which are inside shared clusters

    Float_t counterShared=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	counterShared += getSharedCharge(trackNo,i, fMaxSigmaRange, kTRUE);
    }
    return counterShared;
}


Float_t HParticleBtClusterF::getMaximaChargeSharedTrack(const Int_t trackNo, const Int_t trackNo2)
{
    //Returns charge of maxima pads which are inside a cluster which is shared with track 2

    Float_t counterShared=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
        counterShared += getSharedCharge(trackNo,i, fMaxSigmaRange, kTRUE, trackNo2);
  
    }
    return counterShared;
}

Float_t HParticleBtClusterF::getMaximaChargeSharedBad(const Int_t trackNo)
{
    //Returns charge of maxima pads which are inside shared clusters

    Float_t counterShared=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	counterShared += getSharedCharge(trackNo,i, fMaxSigmaRange, kFALSE);
    }
    return counterShared;
}

Float_t HParticleBtClusterF::getMaximaChargeSharedBadTrack(const Int_t trackNo, const Int_t trackNo2)
{
    //Returns charge of maxima pads which are inside a cluster which is shared with track 2

    Float_t counterShared=0;
    for(UInt_t i=0; i<fClusChi2.size(); i++){
	counterShared += getSharedCharge(trackNo,i, fMaxSigmaRange, kFALSE, trackNo2);
    }
    return counterShared;
}

Float_t HParticleBtClusterF::getMeanDistX(const Int_t trackNo)
{
    //Returns mean maxima deviation of maxima from ring prediction in x direction

    return fRingMeanDistX[trackNo];
}

Float_t HParticleBtClusterF::getMeanDistY(const Int_t trackNo)
{
    //Returns mean maxima deviation of maxima from ring prediction in y direction

    return fRingMeanDistY[trackNo];
}

Float_t HParticleBtClusterF::getMeanDist(const Int_t trackNo)
{
    //Returns mean maxima deviation of maxima from ring prediction
    if(fRingMeanDistX[trackNo] < 999)
	return TMath::Sqrt(fRingMeanDistX[trackNo]*fRingMeanDistX[trackNo]+fRingMeanDistY[trackNo]*fRingMeanDistY[trackNo]);
    else
        return 999;
}


Bool_t HParticleBtClusterF::fillRingInfo(HParticleBtRingInfo* btRingInfo)
{

    Bool_t kOverflow = kFALSE;

    Int_t   isInCluster     [1024];   //fired pads

    //Cluster information
    Int_t   clusTrackNo     [32][32];  //clusters, tracks
    Bool_t  clusIsGood      [32];      //clusters
    Int_t   clusPadSum      [32];
    Int_t   clusPadRing     [32];
    Float_t clusChargeSum   [32];
    Float_t clusChargeRing  [32];
    Float_t clusPosX        [32];
    Float_t clusPosY        [32];
    Int_t   clusClass       [32];

    //Maxima and maxima position
    Int_t   clusNMaxima     [32][32];       //clusters,tracks
    Int_t   clusNMaximaPad  [32][32][32];   //clusters,tracks,maxima
    Float_t clusNMaximaPosX [32][32][32];
    Float_t clusNMaximaPosY [32][32][32];

    //Chi2
    Float_t clusChi2        [32][32][32];
    Float_t clusChi2XMM     [32][32][32];
    Float_t clusChi2YMM     [32][32][32];

    //Debug info
    Float_t clusCircleX     [32][32][32];
    Float_t clusCircleY     [32][32][32];
    Float_t clusSig1X       [32][32][32];
    Float_t clusSig1Y       [32][32][32];
    Float_t clusSig2X       [32][32][32];
    Float_t clusSig2Y       [32][32][32];


    //Initialization
    for(Int_t i = 0; i < 1024; i++ ){
	isInCluster[i]   = -1;
    }

    for(Int_t i = 0; i < 32; i++ ){
	for(Int_t j = 0; j < 32; j++ ){
	    clusTrackNo[i][j] = -1;
	}
	clusIsGood[i]     = kTRUE;
	clusPadSum[i]     = -1;
	clusPadRing[i]    = -1;
	clusChargeSum[i]  = -1.;
        clusChargeRing[i]  = -1.;
	clusPosX[i]       = -1.;
	clusPosY[i]       = -1.;
        clusClass[i]      = -1;
    }
    for(Int_t i = 0; i < 32; i++ ){
	for(Int_t j = 0; j < 32; j++ ){
	    clusNMaxima [i][j]  = -1;
	    for(Int_t k = 0; k < 32; k++ ){
	            clusNMaximaPad[i][j][k]     = -1;
		    clusNMaximaPosX[i][j][k]    = -1.;
		    clusNMaximaPosY[i][j][k]    = -1.;

		    clusChi2[i][j][k]           = -1.;
		    clusChi2XMM[i][j][k]        = -1.;
		    clusChi2YMM[i][j][k]        = -1.;

		    clusCircleX[i][j][k]        = -1.;
		    clusCircleY[i][j][k]        = -1.;
		    clusSig1X[i][j][k]          = -1.;
		    clusSig1Y[i][j][k]          = -1.;
		    clusSig2X[i][j][k]          = -1.;
		    clusSig2Y[i][j][k]          = -1.;
	    }
	}
    }

    //Fill vector to array and check if vector size is too large
    if(fIsInCluster.size() <= 1024){
	for(UInt_t i = 0; i < fIsInCluster.size(); i++ ){
	    isInCluster[i]    =  fIsInCluster[i];
	}
    }else
        kOverflow =kTRUE;

    if(fClusTrackNoShared.size() <= 32 ){
	for(UInt_t i = 0; i < fClusTrackNoShared.size(); i++ ){
	    if(fClusTrackNoShared[i].size() <= 32 ){
		for(UInt_t j = 0; j < fClusTrackNoShared[i].size(); j++ ){
		    clusTrackNo[i][j] =  fClusTrackNoShared[i][j];
		}
	    }else
		kOverflow = kTRUE;
	    clusIsGood[i]       = fClusIsGood [i];
	    clusPadSum[i]       = fClusPadSum[i];
	    clusPadRing[i]      = fClusPadRing[i];
	    clusChargeSum[i]    = fClusChargeSum[i];
            clusChargeRing[i]   = fClusChargeRing[i];
	    clusPosX[i]         = fClusPosX[i];
	    clusPosY[i]         = fClusPosY[i];
            clusClass[i]        = fClusClass[i];
        }
    }else
        kOverflow =kTRUE;


    if(fClusNMaximaPad.size() <= 32 ){
	for(UInt_t i = 0; i < fClusNMaximaPad.size(); i++ ){
	    if(fClusNMaximaPad[i].size() <= 32 ){
		for(UInt_t j = 0; j < fClusNMaximaPad[i].size(); j++ ){
		    clusNMaxima[i][j]   = fClusNMaxima[i][j];
		    if(fClusNMaximaPad[i][j].size() <= 32 ){
		        for(UInt_t k = 0; k < fClusNMaximaPad[i][j].size(); k++ ){
			    clusNMaximaPad[i][j][k]   = fClusNMaximaPad[i][j][k];
			    clusNMaximaPosX[i][j][k]  = fClusNMaximaPosX[i][j][k];
			    clusNMaximaPosY[i][j][k]  = fClusNMaximaPosY[i][j][k];

			    clusChi2[i][j][k]         = fClusChi2[i][j][k];
			    clusChi2XMM[i][j][k]      = fClusChi2XMM[i][j][k];
			    clusChi2YMM[i][j][k]      = fClusChi2YMM[i][j][k];

			    clusCircleX[i][j][k]      = fClusCircleX[i][j][k];
			    clusCircleY[i][j][k]      = fClusCircleY[i][j][k];
			    clusSig1X[i][j][k]        = fClusSig1X[i][j][k];
			    clusSig1Y[i][j][k]        = fClusSig1Y[i][j][k];
			    clusSig2X[i][j][k]        = fClusSig2X[i][j][k];
			    clusSig2Y[i][j][k]        = fClusSig2Y[i][j][k];
			}
		    }else
			kOverflow = kTRUE;
		}
	    }else
                kOverflow = kTRUE;
	}
    }else
	kOverflow = kTRUE;
	    
	btRingInfo->setIsInCluster      ( isInCluster    );
        btRingInfo->setClusTrackNo      ( clusTrackNo    );
        btRingInfo->setClusIsGood       ( clusIsGood     );
        btRingInfo->setClusPadSum       ( clusPadSum     );
        btRingInfo->setClusPadRing      ( clusPadRing    );
	btRingInfo->setClusChargeSum    ( clusChargeSum  );
        btRingInfo->setClusChargeRing   ( clusChargeRing );
	btRingInfo->setClusPosX         ( clusPosX       );
        btRingInfo->setClusPosY         ( clusPosY       );
        btRingInfo->setClusClass        ( clusClass      );
       
	btRingInfo->setClusNMaxima      ( clusNMaxima     );
        btRingInfo->setClusNMaximaPad   ( clusNMaximaPad  );
        btRingInfo->setClusNMaximaPosX  ( clusNMaximaPosX );
        btRingInfo->setClusNMaximaPosY  ( clusNMaximaPosY );
       
	btRingInfo->setClusChi2         ( clusChi2      );
        btRingInfo->setClusChi2XMM      ( clusChi2XMM   );
        btRingInfo->setClusChi2YMM      ( clusChi2YMM   );
       

	btRingInfo->setClusCircleX      ( clusCircleX );
        btRingInfo->setClusCircleY      ( clusCircleY );
        btRingInfo->setClusSig1X        ( clusSig1X   );
        btRingInfo->setClusSig1Y        ( clusSig1Y   );
        btRingInfo->setClusSig2X        ( clusSig2X   );
        btRingInfo->setClusSig2Y        ( clusSig2Y   );

	return kOverflow;

}

void HParticleBtClusterF::calcCluster(Int_t trackNo)
{
    // Main method of the HParticleBtClusterF class. It makes all the relevant calculation on the clusters

    if(!fPrediction){
	Error("calcCluster()","fPrediction pionter is NULL, call setRingF() first!");
        exit(1);
    }

    for( UInt_t hit = 0; hit < fRichHitAdd->size(); hit++){
	for( UInt_t pred = 0; pred < (*fPrediction)[trackNo].size(); pred++){
            if( (*fPrediction)[trackNo][pred] == (*fRichHitAdd)[hit] &&  ( std::find(fIsInCluster.begin(), fIsInCluster.end(), (*fPrediction)[trackNo][pred]) ==  fIsInCluster.end() )  ){
		//Hit found first time
	        vector <Int_t> track;
	        track.push_back(trackNo);
		fClusTrackNoShared.push_back(track);    //add new vector for new cluster and fill first trackNo
		UInt_t beginclus = fIsInCluster.size();
		findNeighbour(trackNo,(*fPrediction)[trackNo][pred]);
		fillCluster(trackNo,beginclus);
	        nMaxima(trackNo,beginclus);
	        fitMaximaPos(beginclus);
	        calcChi2(trackNo);
	        setGoodClus();
		findClusterShape(beginclus);
	    }
	}
    }
    calcRingShift(trackNo);
}

void HParticleBtClusterF::noHitFound()
{
    fRingMeanDistX.push_back(999);
    fRingMeanDistY.push_back(999);
   

}
 hparticlebtclusterf.cc:1
 hparticlebtclusterf.cc:2
 hparticlebtclusterf.cc:3
 hparticlebtclusterf.cc:4
 hparticlebtclusterf.cc:5
 hparticlebtclusterf.cc:6
 hparticlebtclusterf.cc:7
 hparticlebtclusterf.cc:8
 hparticlebtclusterf.cc:9
 hparticlebtclusterf.cc:10
 hparticlebtclusterf.cc:11
 hparticlebtclusterf.cc:12
 hparticlebtclusterf.cc:13
 hparticlebtclusterf.cc:14
 hparticlebtclusterf.cc:15
 hparticlebtclusterf.cc:16
 hparticlebtclusterf.cc:17
 hparticlebtclusterf.cc:18
 hparticlebtclusterf.cc:19
 hparticlebtclusterf.cc:20
 hparticlebtclusterf.cc:21
 hparticlebtclusterf.cc:22
 hparticlebtclusterf.cc:23
 hparticlebtclusterf.cc:24
 hparticlebtclusterf.cc:25
 hparticlebtclusterf.cc:26
 hparticlebtclusterf.cc:27
 hparticlebtclusterf.cc:28
 hparticlebtclusterf.cc:29
 hparticlebtclusterf.cc:30
 hparticlebtclusterf.cc:31
 hparticlebtclusterf.cc:32
 hparticlebtclusterf.cc:33
 hparticlebtclusterf.cc:34
 hparticlebtclusterf.cc:35
 hparticlebtclusterf.cc:36
 hparticlebtclusterf.cc:37
 hparticlebtclusterf.cc:38
 hparticlebtclusterf.cc:39
 hparticlebtclusterf.cc:40
 hparticlebtclusterf.cc:41
 hparticlebtclusterf.cc:42
 hparticlebtclusterf.cc:43
 hparticlebtclusterf.cc:44
 hparticlebtclusterf.cc:45
 hparticlebtclusterf.cc:46
 hparticlebtclusterf.cc:47
 hparticlebtclusterf.cc:48
 hparticlebtclusterf.cc:49
 hparticlebtclusterf.cc:50
 hparticlebtclusterf.cc:51
 hparticlebtclusterf.cc:52
 hparticlebtclusterf.cc:53
 hparticlebtclusterf.cc:54
 hparticlebtclusterf.cc:55
 hparticlebtclusterf.cc:56
 hparticlebtclusterf.cc:57
 hparticlebtclusterf.cc:58
 hparticlebtclusterf.cc:59
 hparticlebtclusterf.cc:60
 hparticlebtclusterf.cc:61
 hparticlebtclusterf.cc:62
 hparticlebtclusterf.cc:63
 hparticlebtclusterf.cc:64
 hparticlebtclusterf.cc:65
 hparticlebtclusterf.cc:66
 hparticlebtclusterf.cc:67
 hparticlebtclusterf.cc:68
 hparticlebtclusterf.cc:69
 hparticlebtclusterf.cc:70
 hparticlebtclusterf.cc:71
 hparticlebtclusterf.cc:72
 hparticlebtclusterf.cc:73
 hparticlebtclusterf.cc:74
 hparticlebtclusterf.cc:75
 hparticlebtclusterf.cc:76
 hparticlebtclusterf.cc:77
 hparticlebtclusterf.cc:78
 hparticlebtclusterf.cc:79
 hparticlebtclusterf.cc:80
 hparticlebtclusterf.cc:81
 hparticlebtclusterf.cc:82
 hparticlebtclusterf.cc:83
 hparticlebtclusterf.cc:84
 hparticlebtclusterf.cc:85
 hparticlebtclusterf.cc:86
 hparticlebtclusterf.cc:87
 hparticlebtclusterf.cc:88
 hparticlebtclusterf.cc:89
 hparticlebtclusterf.cc:90
 hparticlebtclusterf.cc:91
 hparticlebtclusterf.cc:92
 hparticlebtclusterf.cc:93
 hparticlebtclusterf.cc:94
 hparticlebtclusterf.cc:95
 hparticlebtclusterf.cc:96
 hparticlebtclusterf.cc:97
 hparticlebtclusterf.cc:98
 hparticlebtclusterf.cc:99
 hparticlebtclusterf.cc:100
 hparticlebtclusterf.cc:101
 hparticlebtclusterf.cc:102
 hparticlebtclusterf.cc:103
 hparticlebtclusterf.cc:104
 hparticlebtclusterf.cc:105
 hparticlebtclusterf.cc:106
 hparticlebtclusterf.cc:107
 hparticlebtclusterf.cc:108
 hparticlebtclusterf.cc:109
 hparticlebtclusterf.cc:110
 hparticlebtclusterf.cc:111
 hparticlebtclusterf.cc:112
 hparticlebtclusterf.cc:113
 hparticlebtclusterf.cc:114
 hparticlebtclusterf.cc:115
 hparticlebtclusterf.cc:116
 hparticlebtclusterf.cc:117
 hparticlebtclusterf.cc:118
 hparticlebtclusterf.cc:119
 hparticlebtclusterf.cc:120
 hparticlebtclusterf.cc:121
 hparticlebtclusterf.cc:122
 hparticlebtclusterf.cc:123
 hparticlebtclusterf.cc:124
 hparticlebtclusterf.cc:125
 hparticlebtclusterf.cc:126
 hparticlebtclusterf.cc:127
 hparticlebtclusterf.cc:128
 hparticlebtclusterf.cc:129
 hparticlebtclusterf.cc:130
 hparticlebtclusterf.cc:131
 hparticlebtclusterf.cc:132
 hparticlebtclusterf.cc:133
 hparticlebtclusterf.cc:134
 hparticlebtclusterf.cc:135
 hparticlebtclusterf.cc:136
 hparticlebtclusterf.cc:137
 hparticlebtclusterf.cc:138
 hparticlebtclusterf.cc:139
 hparticlebtclusterf.cc:140
 hparticlebtclusterf.cc:141
 hparticlebtclusterf.cc:142
 hparticlebtclusterf.cc:143
 hparticlebtclusterf.cc:144
 hparticlebtclusterf.cc:145
 hparticlebtclusterf.cc:146
 hparticlebtclusterf.cc:147
 hparticlebtclusterf.cc:148
 hparticlebtclusterf.cc:149
 hparticlebtclusterf.cc:150
 hparticlebtclusterf.cc:151
 hparticlebtclusterf.cc:152
 hparticlebtclusterf.cc:153
 hparticlebtclusterf.cc:154
 hparticlebtclusterf.cc:155
 hparticlebtclusterf.cc:156
 hparticlebtclusterf.cc:157
 hparticlebtclusterf.cc:158
 hparticlebtclusterf.cc:159
 hparticlebtclusterf.cc:160
 hparticlebtclusterf.cc:161
 hparticlebtclusterf.cc:162
 hparticlebtclusterf.cc:163
 hparticlebtclusterf.cc:164
 hparticlebtclusterf.cc:165
 hparticlebtclusterf.cc:166
 hparticlebtclusterf.cc:167
 hparticlebtclusterf.cc:168
 hparticlebtclusterf.cc:169
 hparticlebtclusterf.cc:170
 hparticlebtclusterf.cc:171
 hparticlebtclusterf.cc:172
 hparticlebtclusterf.cc:173
 hparticlebtclusterf.cc:174
 hparticlebtclusterf.cc:175
 hparticlebtclusterf.cc:176
 hparticlebtclusterf.cc:177
 hparticlebtclusterf.cc:178
 hparticlebtclusterf.cc:179
 hparticlebtclusterf.cc:180
 hparticlebtclusterf.cc:181
 hparticlebtclusterf.cc:182
 hparticlebtclusterf.cc:183
 hparticlebtclusterf.cc:184
 hparticlebtclusterf.cc:185
 hparticlebtclusterf.cc:186
 hparticlebtclusterf.cc:187
 hparticlebtclusterf.cc:188
 hparticlebtclusterf.cc:189
 hparticlebtclusterf.cc:190
 hparticlebtclusterf.cc:191
 hparticlebtclusterf.cc:192
 hparticlebtclusterf.cc:193
 hparticlebtclusterf.cc:194
 hparticlebtclusterf.cc:195
 hparticlebtclusterf.cc:196
 hparticlebtclusterf.cc:197
 hparticlebtclusterf.cc:198
 hparticlebtclusterf.cc:199
 hparticlebtclusterf.cc:200
 hparticlebtclusterf.cc:201
 hparticlebtclusterf.cc:202
 hparticlebtclusterf.cc:203
 hparticlebtclusterf.cc:204
 hparticlebtclusterf.cc:205
 hparticlebtclusterf.cc:206
 hparticlebtclusterf.cc:207
 hparticlebtclusterf.cc:208
 hparticlebtclusterf.cc:209
 hparticlebtclusterf.cc:210
 hparticlebtclusterf.cc:211
 hparticlebtclusterf.cc:212
 hparticlebtclusterf.cc:213
 hparticlebtclusterf.cc:214
 hparticlebtclusterf.cc:215
 hparticlebtclusterf.cc:216
 hparticlebtclusterf.cc:217
 hparticlebtclusterf.cc:218
 hparticlebtclusterf.cc:219
 hparticlebtclusterf.cc:220
 hparticlebtclusterf.cc:221
 hparticlebtclusterf.cc:222
 hparticlebtclusterf.cc:223
 hparticlebtclusterf.cc:224
 hparticlebtclusterf.cc:225
 hparticlebtclusterf.cc:226
 hparticlebtclusterf.cc:227
 hparticlebtclusterf.cc:228
 hparticlebtclusterf.cc:229
 hparticlebtclusterf.cc:230
 hparticlebtclusterf.cc:231
 hparticlebtclusterf.cc:232
 hparticlebtclusterf.cc:233
 hparticlebtclusterf.cc:234
 hparticlebtclusterf.cc:235
 hparticlebtclusterf.cc:236
 hparticlebtclusterf.cc:237
 hparticlebtclusterf.cc:238
 hparticlebtclusterf.cc:239
 hparticlebtclusterf.cc:240
 hparticlebtclusterf.cc:241
 hparticlebtclusterf.cc:242
 hparticlebtclusterf.cc:243
 hparticlebtclusterf.cc:244
 hparticlebtclusterf.cc:245
 hparticlebtclusterf.cc:246
 hparticlebtclusterf.cc:247
 hparticlebtclusterf.cc:248
 hparticlebtclusterf.cc:249
 hparticlebtclusterf.cc:250
 hparticlebtclusterf.cc:251
 hparticlebtclusterf.cc:252
 hparticlebtclusterf.cc:253
 hparticlebtclusterf.cc:254
 hparticlebtclusterf.cc:255
 hparticlebtclusterf.cc:256
 hparticlebtclusterf.cc:257
 hparticlebtclusterf.cc:258
 hparticlebtclusterf.cc:259
 hparticlebtclusterf.cc:260
 hparticlebtclusterf.cc:261
 hparticlebtclusterf.cc:262
 hparticlebtclusterf.cc:263
 hparticlebtclusterf.cc:264
 hparticlebtclusterf.cc:265
 hparticlebtclusterf.cc:266
 hparticlebtclusterf.cc:267
 hparticlebtclusterf.cc:268
 hparticlebtclusterf.cc:269
 hparticlebtclusterf.cc:270
 hparticlebtclusterf.cc:271
 hparticlebtclusterf.cc:272
 hparticlebtclusterf.cc:273
 hparticlebtclusterf.cc:274
 hparticlebtclusterf.cc:275
 hparticlebtclusterf.cc:276
 hparticlebtclusterf.cc:277
 hparticlebtclusterf.cc:278
 hparticlebtclusterf.cc:279
 hparticlebtclusterf.cc:280
 hparticlebtclusterf.cc:281
 hparticlebtclusterf.cc:282
 hparticlebtclusterf.cc:283
 hparticlebtclusterf.cc:284
 hparticlebtclusterf.cc:285
 hparticlebtclusterf.cc:286
 hparticlebtclusterf.cc:287
 hparticlebtclusterf.cc:288
 hparticlebtclusterf.cc:289
 hparticlebtclusterf.cc:290
 hparticlebtclusterf.cc:291
 hparticlebtclusterf.cc:292
 hparticlebtclusterf.cc:293
 hparticlebtclusterf.cc:294
 hparticlebtclusterf.cc:295
 hparticlebtclusterf.cc:296
 hparticlebtclusterf.cc:297
 hparticlebtclusterf.cc:298
 hparticlebtclusterf.cc:299
 hparticlebtclusterf.cc:300
 hparticlebtclusterf.cc:301
 hparticlebtclusterf.cc:302
 hparticlebtclusterf.cc:303
 hparticlebtclusterf.cc:304
 hparticlebtclusterf.cc:305
 hparticlebtclusterf.cc:306
 hparticlebtclusterf.cc:307
 hparticlebtclusterf.cc:308
 hparticlebtclusterf.cc:309
 hparticlebtclusterf.cc:310
 hparticlebtclusterf.cc:311
 hparticlebtclusterf.cc:312
 hparticlebtclusterf.cc:313
 hparticlebtclusterf.cc:314
 hparticlebtclusterf.cc:315
 hparticlebtclusterf.cc:316
 hparticlebtclusterf.cc:317
 hparticlebtclusterf.cc:318
 hparticlebtclusterf.cc:319
 hparticlebtclusterf.cc:320
 hparticlebtclusterf.cc:321
 hparticlebtclusterf.cc:322
 hparticlebtclusterf.cc:323
 hparticlebtclusterf.cc:324
 hparticlebtclusterf.cc:325
 hparticlebtclusterf.cc:326
 hparticlebtclusterf.cc:327
 hparticlebtclusterf.cc:328
 hparticlebtclusterf.cc:329
 hparticlebtclusterf.cc:330
 hparticlebtclusterf.cc:331
 hparticlebtclusterf.cc:332
 hparticlebtclusterf.cc:333
 hparticlebtclusterf.cc:334
 hparticlebtclusterf.cc:335
 hparticlebtclusterf.cc:336
 hparticlebtclusterf.cc:337
 hparticlebtclusterf.cc:338
 hparticlebtclusterf.cc:339
 hparticlebtclusterf.cc:340
 hparticlebtclusterf.cc:341
 hparticlebtclusterf.cc:342
 hparticlebtclusterf.cc:343
 hparticlebtclusterf.cc:344
 hparticlebtclusterf.cc:345
 hparticlebtclusterf.cc:346
 hparticlebtclusterf.cc:347
 hparticlebtclusterf.cc:348
 hparticlebtclusterf.cc:349
 hparticlebtclusterf.cc:350
 hparticlebtclusterf.cc:351
 hparticlebtclusterf.cc:352
 hparticlebtclusterf.cc:353
 hparticlebtclusterf.cc:354
 hparticlebtclusterf.cc:355
 hparticlebtclusterf.cc:356
 hparticlebtclusterf.cc:357
 hparticlebtclusterf.cc:358
 hparticlebtclusterf.cc:359
 hparticlebtclusterf.cc:360
 hparticlebtclusterf.cc:361
 hparticlebtclusterf.cc:362
 hparticlebtclusterf.cc:363
 hparticlebtclusterf.cc:364
 hparticlebtclusterf.cc:365
 hparticlebtclusterf.cc:366
 hparticlebtclusterf.cc:367
 hparticlebtclusterf.cc:368
 hparticlebtclusterf.cc:369
 hparticlebtclusterf.cc:370
 hparticlebtclusterf.cc:371
 hparticlebtclusterf.cc:372
 hparticlebtclusterf.cc:373
 hparticlebtclusterf.cc:374
 hparticlebtclusterf.cc:375
 hparticlebtclusterf.cc:376
 hparticlebtclusterf.cc:377
 hparticlebtclusterf.cc:378
 hparticlebtclusterf.cc:379
 hparticlebtclusterf.cc:380
 hparticlebtclusterf.cc:381
 hparticlebtclusterf.cc:382
 hparticlebtclusterf.cc:383
 hparticlebtclusterf.cc:384
 hparticlebtclusterf.cc:385
 hparticlebtclusterf.cc:386
 hparticlebtclusterf.cc:387
 hparticlebtclusterf.cc:388
 hparticlebtclusterf.cc:389
 hparticlebtclusterf.cc:390
 hparticlebtclusterf.cc:391
 hparticlebtclusterf.cc:392
 hparticlebtclusterf.cc:393
 hparticlebtclusterf.cc:394
 hparticlebtclusterf.cc:395
 hparticlebtclusterf.cc:396
 hparticlebtclusterf.cc:397
 hparticlebtclusterf.cc:398
 hparticlebtclusterf.cc:399
 hparticlebtclusterf.cc:400
 hparticlebtclusterf.cc:401
 hparticlebtclusterf.cc:402
 hparticlebtclusterf.cc:403
 hparticlebtclusterf.cc:404
 hparticlebtclusterf.cc:405
 hparticlebtclusterf.cc:406
 hparticlebtclusterf.cc:407
 hparticlebtclusterf.cc:408
 hparticlebtclusterf.cc:409
 hparticlebtclusterf.cc:410
 hparticlebtclusterf.cc:411
 hparticlebtclusterf.cc:412
 hparticlebtclusterf.cc:413
 hparticlebtclusterf.cc:414
 hparticlebtclusterf.cc:415
 hparticlebtclusterf.cc:416
 hparticlebtclusterf.cc:417
 hparticlebtclusterf.cc:418
 hparticlebtclusterf.cc:419
 hparticlebtclusterf.cc:420
 hparticlebtclusterf.cc:421
 hparticlebtclusterf.cc:422
 hparticlebtclusterf.cc:423
 hparticlebtclusterf.cc:424
 hparticlebtclusterf.cc:425
 hparticlebtclusterf.cc:426
 hparticlebtclusterf.cc:427
 hparticlebtclusterf.cc:428
 hparticlebtclusterf.cc:429
 hparticlebtclusterf.cc:430
 hparticlebtclusterf.cc:431
 hparticlebtclusterf.cc:432
 hparticlebtclusterf.cc:433
 hparticlebtclusterf.cc:434
 hparticlebtclusterf.cc:435
 hparticlebtclusterf.cc:436
 hparticlebtclusterf.cc:437
 hparticlebtclusterf.cc:438
 hparticlebtclusterf.cc:439
 hparticlebtclusterf.cc:440
 hparticlebtclusterf.cc:441
 hparticlebtclusterf.cc:442
 hparticlebtclusterf.cc:443
 hparticlebtclusterf.cc:444
 hparticlebtclusterf.cc:445
 hparticlebtclusterf.cc:446
 hparticlebtclusterf.cc:447
 hparticlebtclusterf.cc:448
 hparticlebtclusterf.cc:449
 hparticlebtclusterf.cc:450
 hparticlebtclusterf.cc:451
 hparticlebtclusterf.cc:452
 hparticlebtclusterf.cc:453
 hparticlebtclusterf.cc:454
 hparticlebtclusterf.cc:455
 hparticlebtclusterf.cc:456
 hparticlebtclusterf.cc:457
 hparticlebtclusterf.cc:458
 hparticlebtclusterf.cc:459
 hparticlebtclusterf.cc:460
 hparticlebtclusterf.cc:461
 hparticlebtclusterf.cc:462
 hparticlebtclusterf.cc:463
 hparticlebtclusterf.cc:464
 hparticlebtclusterf.cc:465
 hparticlebtclusterf.cc:466
 hparticlebtclusterf.cc:467
 hparticlebtclusterf.cc:468
 hparticlebtclusterf.cc:469
 hparticlebtclusterf.cc:470
 hparticlebtclusterf.cc:471
 hparticlebtclusterf.cc:472
 hparticlebtclusterf.cc:473
 hparticlebtclusterf.cc:474
 hparticlebtclusterf.cc:475
 hparticlebtclusterf.cc:476
 hparticlebtclusterf.cc:477
 hparticlebtclusterf.cc:478
 hparticlebtclusterf.cc:479
 hparticlebtclusterf.cc:480
 hparticlebtclusterf.cc:481
 hparticlebtclusterf.cc:482
 hparticlebtclusterf.cc:483
 hparticlebtclusterf.cc:484
 hparticlebtclusterf.cc:485
 hparticlebtclusterf.cc:486
 hparticlebtclusterf.cc:487
 hparticlebtclusterf.cc:488
 hparticlebtclusterf.cc:489
 hparticlebtclusterf.cc:490
 hparticlebtclusterf.cc:491
 hparticlebtclusterf.cc:492
 hparticlebtclusterf.cc:493
 hparticlebtclusterf.cc:494
 hparticlebtclusterf.cc:495
 hparticlebtclusterf.cc:496
 hparticlebtclusterf.cc:497
 hparticlebtclusterf.cc:498
 hparticlebtclusterf.cc:499
 hparticlebtclusterf.cc:500
 hparticlebtclusterf.cc:501
 hparticlebtclusterf.cc:502
 hparticlebtclusterf.cc:503
 hparticlebtclusterf.cc:504
 hparticlebtclusterf.cc:505
 hparticlebtclusterf.cc:506
 hparticlebtclusterf.cc:507
 hparticlebtclusterf.cc:508
 hparticlebtclusterf.cc:509
 hparticlebtclusterf.cc:510
 hparticlebtclusterf.cc:511
 hparticlebtclusterf.cc:512
 hparticlebtclusterf.cc:513
 hparticlebtclusterf.cc:514
 hparticlebtclusterf.cc:515
 hparticlebtclusterf.cc:516
 hparticlebtclusterf.cc:517
 hparticlebtclusterf.cc:518
 hparticlebtclusterf.cc:519
 hparticlebtclusterf.cc:520
 hparticlebtclusterf.cc:521
 hparticlebtclusterf.cc:522
 hparticlebtclusterf.cc:523
 hparticlebtclusterf.cc:524
 hparticlebtclusterf.cc:525
 hparticlebtclusterf.cc:526
 hparticlebtclusterf.cc:527
 hparticlebtclusterf.cc:528
 hparticlebtclusterf.cc:529
 hparticlebtclusterf.cc:530
 hparticlebtclusterf.cc:531
 hparticlebtclusterf.cc:532
 hparticlebtclusterf.cc:533
 hparticlebtclusterf.cc:534
 hparticlebtclusterf.cc:535
 hparticlebtclusterf.cc:536
 hparticlebtclusterf.cc:537
 hparticlebtclusterf.cc:538
 hparticlebtclusterf.cc:539
 hparticlebtclusterf.cc:540
 hparticlebtclusterf.cc:541
 hparticlebtclusterf.cc:542
 hparticlebtclusterf.cc:543
 hparticlebtclusterf.cc:544
 hparticlebtclusterf.cc:545
 hparticlebtclusterf.cc:546
 hparticlebtclusterf.cc:547
 hparticlebtclusterf.cc:548
 hparticlebtclusterf.cc:549
 hparticlebtclusterf.cc:550
 hparticlebtclusterf.cc:551
 hparticlebtclusterf.cc:552
 hparticlebtclusterf.cc:553
 hparticlebtclusterf.cc:554
 hparticlebtclusterf.cc:555
 hparticlebtclusterf.cc:556
 hparticlebtclusterf.cc:557
 hparticlebtclusterf.cc:558
 hparticlebtclusterf.cc:559
 hparticlebtclusterf.cc:560
 hparticlebtclusterf.cc:561
 hparticlebtclusterf.cc:562
 hparticlebtclusterf.cc:563
 hparticlebtclusterf.cc:564
 hparticlebtclusterf.cc:565
 hparticlebtclusterf.cc:566
 hparticlebtclusterf.cc:567
 hparticlebtclusterf.cc:568
 hparticlebtclusterf.cc:569
 hparticlebtclusterf.cc:570
 hparticlebtclusterf.cc:571
 hparticlebtclusterf.cc:572
 hparticlebtclusterf.cc:573
 hparticlebtclusterf.cc:574
 hparticlebtclusterf.cc:575
 hparticlebtclusterf.cc:576
 hparticlebtclusterf.cc:577
 hparticlebtclusterf.cc:578
 hparticlebtclusterf.cc:579
 hparticlebtclusterf.cc:580
 hparticlebtclusterf.cc:581
 hparticlebtclusterf.cc:582
 hparticlebtclusterf.cc:583
 hparticlebtclusterf.cc:584
 hparticlebtclusterf.cc:585
 hparticlebtclusterf.cc:586
 hparticlebtclusterf.cc:587
 hparticlebtclusterf.cc:588
 hparticlebtclusterf.cc:589
 hparticlebtclusterf.cc:590
 hparticlebtclusterf.cc:591
 hparticlebtclusterf.cc:592
 hparticlebtclusterf.cc:593
 hparticlebtclusterf.cc:594
 hparticlebtclusterf.cc:595
 hparticlebtclusterf.cc:596
 hparticlebtclusterf.cc:597
 hparticlebtclusterf.cc:598
 hparticlebtclusterf.cc:599
 hparticlebtclusterf.cc:600
 hparticlebtclusterf.cc:601
 hparticlebtclusterf.cc:602
 hparticlebtclusterf.cc:603
 hparticlebtclusterf.cc:604
 hparticlebtclusterf.cc:605
 hparticlebtclusterf.cc:606
 hparticlebtclusterf.cc:607
 hparticlebtclusterf.cc:608
 hparticlebtclusterf.cc:609
 hparticlebtclusterf.cc:610
 hparticlebtclusterf.cc:611
 hparticlebtclusterf.cc:612
 hparticlebtclusterf.cc:613
 hparticlebtclusterf.cc:614
 hparticlebtclusterf.cc:615
 hparticlebtclusterf.cc:616
 hparticlebtclusterf.cc:617
 hparticlebtclusterf.cc:618
 hparticlebtclusterf.cc:619
 hparticlebtclusterf.cc:620
 hparticlebtclusterf.cc:621
 hparticlebtclusterf.cc:622
 hparticlebtclusterf.cc:623
 hparticlebtclusterf.cc:624
 hparticlebtclusterf.cc:625
 hparticlebtclusterf.cc:626
 hparticlebtclusterf.cc:627
 hparticlebtclusterf.cc:628
 hparticlebtclusterf.cc:629
 hparticlebtclusterf.cc:630
 hparticlebtclusterf.cc:631
 hparticlebtclusterf.cc:632
 hparticlebtclusterf.cc:633
 hparticlebtclusterf.cc:634
 hparticlebtclusterf.cc:635
 hparticlebtclusterf.cc:636
 hparticlebtclusterf.cc:637
 hparticlebtclusterf.cc:638
 hparticlebtclusterf.cc:639
 hparticlebtclusterf.cc:640
 hparticlebtclusterf.cc:641
 hparticlebtclusterf.cc:642
 hparticlebtclusterf.cc:643
 hparticlebtclusterf.cc:644
 hparticlebtclusterf.cc:645
 hparticlebtclusterf.cc:646
 hparticlebtclusterf.cc:647
 hparticlebtclusterf.cc:648
 hparticlebtclusterf.cc:649
 hparticlebtclusterf.cc:650
 hparticlebtclusterf.cc:651
 hparticlebtclusterf.cc:652
 hparticlebtclusterf.cc:653
 hparticlebtclusterf.cc:654
 hparticlebtclusterf.cc:655
 hparticlebtclusterf.cc:656
 hparticlebtclusterf.cc:657
 hparticlebtclusterf.cc:658
 hparticlebtclusterf.cc:659
 hparticlebtclusterf.cc:660
 hparticlebtclusterf.cc:661
 hparticlebtclusterf.cc:662
 hparticlebtclusterf.cc:663
 hparticlebtclusterf.cc:664
 hparticlebtclusterf.cc:665
 hparticlebtclusterf.cc:666
 hparticlebtclusterf.cc:667
 hparticlebtclusterf.cc:668
 hparticlebtclusterf.cc:669
 hparticlebtclusterf.cc:670
 hparticlebtclusterf.cc:671
 hparticlebtclusterf.cc:672
 hparticlebtclusterf.cc:673
 hparticlebtclusterf.cc:674
 hparticlebtclusterf.cc:675
 hparticlebtclusterf.cc:676
 hparticlebtclusterf.cc:677
 hparticlebtclusterf.cc:678
 hparticlebtclusterf.cc:679
 hparticlebtclusterf.cc:680
 hparticlebtclusterf.cc:681
 hparticlebtclusterf.cc:682
 hparticlebtclusterf.cc:683
 hparticlebtclusterf.cc:684
 hparticlebtclusterf.cc:685
 hparticlebtclusterf.cc:686
 hparticlebtclusterf.cc:687
 hparticlebtclusterf.cc:688
 hparticlebtclusterf.cc:689
 hparticlebtclusterf.cc:690
 hparticlebtclusterf.cc:691
 hparticlebtclusterf.cc:692
 hparticlebtclusterf.cc:693
 hparticlebtclusterf.cc:694
 hparticlebtclusterf.cc:695
 hparticlebtclusterf.cc:696
 hparticlebtclusterf.cc:697
 hparticlebtclusterf.cc:698
 hparticlebtclusterf.cc:699
 hparticlebtclusterf.cc:700
 hparticlebtclusterf.cc:701
 hparticlebtclusterf.cc:702
 hparticlebtclusterf.cc:703
 hparticlebtclusterf.cc:704
 hparticlebtclusterf.cc:705
 hparticlebtclusterf.cc:706
 hparticlebtclusterf.cc:707
 hparticlebtclusterf.cc:708
 hparticlebtclusterf.cc:709
 hparticlebtclusterf.cc:710
 hparticlebtclusterf.cc:711
 hparticlebtclusterf.cc:712
 hparticlebtclusterf.cc:713
 hparticlebtclusterf.cc:714
 hparticlebtclusterf.cc:715
 hparticlebtclusterf.cc:716
 hparticlebtclusterf.cc:717
 hparticlebtclusterf.cc:718
 hparticlebtclusterf.cc:719
 hparticlebtclusterf.cc:720
 hparticlebtclusterf.cc:721
 hparticlebtclusterf.cc:722
 hparticlebtclusterf.cc:723
 hparticlebtclusterf.cc:724
 hparticlebtclusterf.cc:725
 hparticlebtclusterf.cc:726
 hparticlebtclusterf.cc:727
 hparticlebtclusterf.cc:728
 hparticlebtclusterf.cc:729
 hparticlebtclusterf.cc:730
 hparticlebtclusterf.cc:731
 hparticlebtclusterf.cc:732
 hparticlebtclusterf.cc:733
 hparticlebtclusterf.cc:734
 hparticlebtclusterf.cc:735
 hparticlebtclusterf.cc:736
 hparticlebtclusterf.cc:737
 hparticlebtclusterf.cc:738
 hparticlebtclusterf.cc:739
 hparticlebtclusterf.cc:740
 hparticlebtclusterf.cc:741
 hparticlebtclusterf.cc:742
 hparticlebtclusterf.cc:743
 hparticlebtclusterf.cc:744
 hparticlebtclusterf.cc:745
 hparticlebtclusterf.cc:746
 hparticlebtclusterf.cc:747
 hparticlebtclusterf.cc:748
 hparticlebtclusterf.cc:749
 hparticlebtclusterf.cc:750
 hparticlebtclusterf.cc:751
 hparticlebtclusterf.cc:752
 hparticlebtclusterf.cc:753
 hparticlebtclusterf.cc:754
 hparticlebtclusterf.cc:755
 hparticlebtclusterf.cc:756
 hparticlebtclusterf.cc:757
 hparticlebtclusterf.cc:758
 hparticlebtclusterf.cc:759
 hparticlebtclusterf.cc:760
 hparticlebtclusterf.cc:761
 hparticlebtclusterf.cc:762
 hparticlebtclusterf.cc:763
 hparticlebtclusterf.cc:764
 hparticlebtclusterf.cc:765
 hparticlebtclusterf.cc:766
 hparticlebtclusterf.cc:767
 hparticlebtclusterf.cc:768
 hparticlebtclusterf.cc:769
 hparticlebtclusterf.cc:770
 hparticlebtclusterf.cc:771
 hparticlebtclusterf.cc:772
 hparticlebtclusterf.cc:773
 hparticlebtclusterf.cc:774
 hparticlebtclusterf.cc:775
 hparticlebtclusterf.cc:776
 hparticlebtclusterf.cc:777
 hparticlebtclusterf.cc:778
 hparticlebtclusterf.cc:779
 hparticlebtclusterf.cc:780
 hparticlebtclusterf.cc:781
 hparticlebtclusterf.cc:782
 hparticlebtclusterf.cc:783
 hparticlebtclusterf.cc:784
 hparticlebtclusterf.cc:785
 hparticlebtclusterf.cc:786
 hparticlebtclusterf.cc:787
 hparticlebtclusterf.cc:788
 hparticlebtclusterf.cc:789
 hparticlebtclusterf.cc:790
 hparticlebtclusterf.cc:791
 hparticlebtclusterf.cc:792
 hparticlebtclusterf.cc:793
 hparticlebtclusterf.cc:794
 hparticlebtclusterf.cc:795
 hparticlebtclusterf.cc:796
 hparticlebtclusterf.cc:797
 hparticlebtclusterf.cc:798
 hparticlebtclusterf.cc:799
 hparticlebtclusterf.cc:800
 hparticlebtclusterf.cc:801
 hparticlebtclusterf.cc:802
 hparticlebtclusterf.cc:803
 hparticlebtclusterf.cc:804
 hparticlebtclusterf.cc:805
 hparticlebtclusterf.cc:806
 hparticlebtclusterf.cc:807
 hparticlebtclusterf.cc:808
 hparticlebtclusterf.cc:809
 hparticlebtclusterf.cc:810
 hparticlebtclusterf.cc:811
 hparticlebtclusterf.cc:812
 hparticlebtclusterf.cc:813
 hparticlebtclusterf.cc:814
 hparticlebtclusterf.cc:815
 hparticlebtclusterf.cc:816
 hparticlebtclusterf.cc:817
 hparticlebtclusterf.cc:818
 hparticlebtclusterf.cc:819
 hparticlebtclusterf.cc:820
 hparticlebtclusterf.cc:821
 hparticlebtclusterf.cc:822
 hparticlebtclusterf.cc:823
 hparticlebtclusterf.cc:824
 hparticlebtclusterf.cc:825
 hparticlebtclusterf.cc:826
 hparticlebtclusterf.cc:827
 hparticlebtclusterf.cc:828
 hparticlebtclusterf.cc:829
 hparticlebtclusterf.cc:830
 hparticlebtclusterf.cc:831
 hparticlebtclusterf.cc:832
 hparticlebtclusterf.cc:833
 hparticlebtclusterf.cc:834
 hparticlebtclusterf.cc:835
 hparticlebtclusterf.cc:836
 hparticlebtclusterf.cc:837
 hparticlebtclusterf.cc:838
 hparticlebtclusterf.cc:839
 hparticlebtclusterf.cc:840
 hparticlebtclusterf.cc:841
 hparticlebtclusterf.cc:842
 hparticlebtclusterf.cc:843
 hparticlebtclusterf.cc:844
 hparticlebtclusterf.cc:845
 hparticlebtclusterf.cc:846
 hparticlebtclusterf.cc:847
 hparticlebtclusterf.cc:848
 hparticlebtclusterf.cc:849
 hparticlebtclusterf.cc:850
 hparticlebtclusterf.cc:851
 hparticlebtclusterf.cc:852
 hparticlebtclusterf.cc:853
 hparticlebtclusterf.cc:854
 hparticlebtclusterf.cc:855
 hparticlebtclusterf.cc:856
 hparticlebtclusterf.cc:857
 hparticlebtclusterf.cc:858
 hparticlebtclusterf.cc:859
 hparticlebtclusterf.cc:860
 hparticlebtclusterf.cc:861
 hparticlebtclusterf.cc:862
 hparticlebtclusterf.cc:863
 hparticlebtclusterf.cc:864
 hparticlebtclusterf.cc:865
 hparticlebtclusterf.cc:866
 hparticlebtclusterf.cc:867
 hparticlebtclusterf.cc:868
 hparticlebtclusterf.cc:869
 hparticlebtclusterf.cc:870
 hparticlebtclusterf.cc:871
 hparticlebtclusterf.cc:872
 hparticlebtclusterf.cc:873
 hparticlebtclusterf.cc:874
 hparticlebtclusterf.cc:875
 hparticlebtclusterf.cc:876
 hparticlebtclusterf.cc:877
 hparticlebtclusterf.cc:878
 hparticlebtclusterf.cc:879
 hparticlebtclusterf.cc:880
 hparticlebtclusterf.cc:881
 hparticlebtclusterf.cc:882
 hparticlebtclusterf.cc:883
 hparticlebtclusterf.cc:884
 hparticlebtclusterf.cc:885
 hparticlebtclusterf.cc:886
 hparticlebtclusterf.cc:887
 hparticlebtclusterf.cc:888
 hparticlebtclusterf.cc:889
 hparticlebtclusterf.cc:890
 hparticlebtclusterf.cc:891
 hparticlebtclusterf.cc:892
 hparticlebtclusterf.cc:893
 hparticlebtclusterf.cc:894
 hparticlebtclusterf.cc:895
 hparticlebtclusterf.cc:896
 hparticlebtclusterf.cc:897
 hparticlebtclusterf.cc:898
 hparticlebtclusterf.cc:899
 hparticlebtclusterf.cc:900
 hparticlebtclusterf.cc:901
 hparticlebtclusterf.cc:902
 hparticlebtclusterf.cc:903
 hparticlebtclusterf.cc:904
 hparticlebtclusterf.cc:905
 hparticlebtclusterf.cc:906
 hparticlebtclusterf.cc:907
 hparticlebtclusterf.cc:908
 hparticlebtclusterf.cc:909
 hparticlebtclusterf.cc:910
 hparticlebtclusterf.cc:911
 hparticlebtclusterf.cc:912
 hparticlebtclusterf.cc:913
 hparticlebtclusterf.cc:914
 hparticlebtclusterf.cc:915
 hparticlebtclusterf.cc:916
 hparticlebtclusterf.cc:917
 hparticlebtclusterf.cc:918
 hparticlebtclusterf.cc:919
 hparticlebtclusterf.cc:920
 hparticlebtclusterf.cc:921
 hparticlebtclusterf.cc:922
 hparticlebtclusterf.cc:923
 hparticlebtclusterf.cc:924
 hparticlebtclusterf.cc:925
 hparticlebtclusterf.cc:926
 hparticlebtclusterf.cc:927
 hparticlebtclusterf.cc:928
 hparticlebtclusterf.cc:929
 hparticlebtclusterf.cc:930
 hparticlebtclusterf.cc:931
 hparticlebtclusterf.cc:932
 hparticlebtclusterf.cc:933
 hparticlebtclusterf.cc:934
 hparticlebtclusterf.cc:935
 hparticlebtclusterf.cc:936
 hparticlebtclusterf.cc:937
 hparticlebtclusterf.cc:938
 hparticlebtclusterf.cc:939
 hparticlebtclusterf.cc:940
 hparticlebtclusterf.cc:941
 hparticlebtclusterf.cc:942
 hparticlebtclusterf.cc:943
 hparticlebtclusterf.cc:944
 hparticlebtclusterf.cc:945
 hparticlebtclusterf.cc:946
 hparticlebtclusterf.cc:947
 hparticlebtclusterf.cc:948
 hparticlebtclusterf.cc:949
 hparticlebtclusterf.cc:950
 hparticlebtclusterf.cc:951
 hparticlebtclusterf.cc:952
 hparticlebtclusterf.cc:953
 hparticlebtclusterf.cc:954
 hparticlebtclusterf.cc:955
 hparticlebtclusterf.cc:956
 hparticlebtclusterf.cc:957
 hparticlebtclusterf.cc:958
 hparticlebtclusterf.cc:959
 hparticlebtclusterf.cc:960
 hparticlebtclusterf.cc:961
 hparticlebtclusterf.cc:962
 hparticlebtclusterf.cc:963
 hparticlebtclusterf.cc:964
 hparticlebtclusterf.cc:965
 hparticlebtclusterf.cc:966
 hparticlebtclusterf.cc:967
 hparticlebtclusterf.cc:968
 hparticlebtclusterf.cc:969
 hparticlebtclusterf.cc:970
 hparticlebtclusterf.cc:971
 hparticlebtclusterf.cc:972
 hparticlebtclusterf.cc:973
 hparticlebtclusterf.cc:974
 hparticlebtclusterf.cc:975
 hparticlebtclusterf.cc:976
 hparticlebtclusterf.cc:977
 hparticlebtclusterf.cc:978
 hparticlebtclusterf.cc:979
 hparticlebtclusterf.cc:980
 hparticlebtclusterf.cc:981
 hparticlebtclusterf.cc:982
 hparticlebtclusterf.cc:983
 hparticlebtclusterf.cc:984
 hparticlebtclusterf.cc:985
 hparticlebtclusterf.cc:986
 hparticlebtclusterf.cc:987
 hparticlebtclusterf.cc:988
 hparticlebtclusterf.cc:989
 hparticlebtclusterf.cc:990
 hparticlebtclusterf.cc:991
 hparticlebtclusterf.cc:992
 hparticlebtclusterf.cc:993
 hparticlebtclusterf.cc:994
 hparticlebtclusterf.cc:995
 hparticlebtclusterf.cc:996
 hparticlebtclusterf.cc:997
 hparticlebtclusterf.cc:998
 hparticlebtclusterf.cc:999
 hparticlebtclusterf.cc:1000
 hparticlebtclusterf.cc:1001
 hparticlebtclusterf.cc:1002
 hparticlebtclusterf.cc:1003
 hparticlebtclusterf.cc:1004
 hparticlebtclusterf.cc:1005
 hparticlebtclusterf.cc:1006
 hparticlebtclusterf.cc:1007
 hparticlebtclusterf.cc:1008
 hparticlebtclusterf.cc:1009
 hparticlebtclusterf.cc:1010
 hparticlebtclusterf.cc:1011
 hparticlebtclusterf.cc:1012
 hparticlebtclusterf.cc:1013
 hparticlebtclusterf.cc:1014
 hparticlebtclusterf.cc:1015
 hparticlebtclusterf.cc:1016
 hparticlebtclusterf.cc:1017
 hparticlebtclusterf.cc:1018
 hparticlebtclusterf.cc:1019
 hparticlebtclusterf.cc:1020
 hparticlebtclusterf.cc:1021
 hparticlebtclusterf.cc:1022
 hparticlebtclusterf.cc:1023
 hparticlebtclusterf.cc:1024
 hparticlebtclusterf.cc:1025
 hparticlebtclusterf.cc:1026
 hparticlebtclusterf.cc:1027
 hparticlebtclusterf.cc:1028
 hparticlebtclusterf.cc:1029
 hparticlebtclusterf.cc:1030
 hparticlebtclusterf.cc:1031
 hparticlebtclusterf.cc:1032
 hparticlebtclusterf.cc:1033
 hparticlebtclusterf.cc:1034
 hparticlebtclusterf.cc:1035
 hparticlebtclusterf.cc:1036
 hparticlebtclusterf.cc:1037
 hparticlebtclusterf.cc:1038
 hparticlebtclusterf.cc:1039
 hparticlebtclusterf.cc:1040
 hparticlebtclusterf.cc:1041
 hparticlebtclusterf.cc:1042
 hparticlebtclusterf.cc:1043
 hparticlebtclusterf.cc:1044
 hparticlebtclusterf.cc:1045
 hparticlebtclusterf.cc:1046
 hparticlebtclusterf.cc:1047
 hparticlebtclusterf.cc:1048
 hparticlebtclusterf.cc:1049
 hparticlebtclusterf.cc:1050
 hparticlebtclusterf.cc:1051
 hparticlebtclusterf.cc:1052
 hparticlebtclusterf.cc:1053
 hparticlebtclusterf.cc:1054
 hparticlebtclusterf.cc:1055
 hparticlebtclusterf.cc:1056
 hparticlebtclusterf.cc:1057
 hparticlebtclusterf.cc:1058
 hparticlebtclusterf.cc:1059
 hparticlebtclusterf.cc:1060
 hparticlebtclusterf.cc:1061
 hparticlebtclusterf.cc:1062
 hparticlebtclusterf.cc:1063
 hparticlebtclusterf.cc:1064
 hparticlebtclusterf.cc:1065
 hparticlebtclusterf.cc:1066
 hparticlebtclusterf.cc:1067
 hparticlebtclusterf.cc:1068
 hparticlebtclusterf.cc:1069
 hparticlebtclusterf.cc:1070
 hparticlebtclusterf.cc:1071
 hparticlebtclusterf.cc:1072
 hparticlebtclusterf.cc:1073
 hparticlebtclusterf.cc:1074
 hparticlebtclusterf.cc:1075
 hparticlebtclusterf.cc:1076
 hparticlebtclusterf.cc:1077
 hparticlebtclusterf.cc:1078
 hparticlebtclusterf.cc:1079
 hparticlebtclusterf.cc:1080
 hparticlebtclusterf.cc:1081
 hparticlebtclusterf.cc:1082
 hparticlebtclusterf.cc:1083
 hparticlebtclusterf.cc:1084
 hparticlebtclusterf.cc:1085
 hparticlebtclusterf.cc:1086
 hparticlebtclusterf.cc:1087
 hparticlebtclusterf.cc:1088
 hparticlebtclusterf.cc:1089
 hparticlebtclusterf.cc:1090
 hparticlebtclusterf.cc:1091
 hparticlebtclusterf.cc:1092
 hparticlebtclusterf.cc:1093
 hparticlebtclusterf.cc:1094
 hparticlebtclusterf.cc:1095
 hparticlebtclusterf.cc:1096
 hparticlebtclusterf.cc:1097
 hparticlebtclusterf.cc:1098
 hparticlebtclusterf.cc:1099
 hparticlebtclusterf.cc:1100
 hparticlebtclusterf.cc:1101
 hparticlebtclusterf.cc:1102
 hparticlebtclusterf.cc:1103
 hparticlebtclusterf.cc:1104
 hparticlebtclusterf.cc:1105
 hparticlebtclusterf.cc:1106
 hparticlebtclusterf.cc:1107
 hparticlebtclusterf.cc:1108
 hparticlebtclusterf.cc:1109
 hparticlebtclusterf.cc:1110
 hparticlebtclusterf.cc:1111
 hparticlebtclusterf.cc:1112
 hparticlebtclusterf.cc:1113
 hparticlebtclusterf.cc:1114
 hparticlebtclusterf.cc:1115
 hparticlebtclusterf.cc:1116
 hparticlebtclusterf.cc:1117
 hparticlebtclusterf.cc:1118
 hparticlebtclusterf.cc:1119
 hparticlebtclusterf.cc:1120
 hparticlebtclusterf.cc:1121
 hparticlebtclusterf.cc:1122
 hparticlebtclusterf.cc:1123
 hparticlebtclusterf.cc:1124
 hparticlebtclusterf.cc:1125
 hparticlebtclusterf.cc:1126
 hparticlebtclusterf.cc:1127
 hparticlebtclusterf.cc:1128
 hparticlebtclusterf.cc:1129
 hparticlebtclusterf.cc:1130
 hparticlebtclusterf.cc:1131
 hparticlebtclusterf.cc:1132
 hparticlebtclusterf.cc:1133
 hparticlebtclusterf.cc:1134
 hparticlebtclusterf.cc:1135
 hparticlebtclusterf.cc:1136
 hparticlebtclusterf.cc:1137
 hparticlebtclusterf.cc:1138
 hparticlebtclusterf.cc:1139
 hparticlebtclusterf.cc:1140
 hparticlebtclusterf.cc:1141
 hparticlebtclusterf.cc:1142
 hparticlebtclusterf.cc:1143
 hparticlebtclusterf.cc:1144
 hparticlebtclusterf.cc:1145
 hparticlebtclusterf.cc:1146
 hparticlebtclusterf.cc:1147
 hparticlebtclusterf.cc:1148
 hparticlebtclusterf.cc:1149
 hparticlebtclusterf.cc:1150
 hparticlebtclusterf.cc:1151
 hparticlebtclusterf.cc:1152
 hparticlebtclusterf.cc:1153
 hparticlebtclusterf.cc:1154
 hparticlebtclusterf.cc:1155
 hparticlebtclusterf.cc:1156
 hparticlebtclusterf.cc:1157
 hparticlebtclusterf.cc:1158
 hparticlebtclusterf.cc:1159
 hparticlebtclusterf.cc:1160
 hparticlebtclusterf.cc:1161
 hparticlebtclusterf.cc:1162
 hparticlebtclusterf.cc:1163
 hparticlebtclusterf.cc:1164
 hparticlebtclusterf.cc:1165
 hparticlebtclusterf.cc:1166
 hparticlebtclusterf.cc:1167
 hparticlebtclusterf.cc:1168
 hparticlebtclusterf.cc:1169
 hparticlebtclusterf.cc:1170
 hparticlebtclusterf.cc:1171
 hparticlebtclusterf.cc:1172
 hparticlebtclusterf.cc:1173
 hparticlebtclusterf.cc:1174
 hparticlebtclusterf.cc:1175
 hparticlebtclusterf.cc:1176
 hparticlebtclusterf.cc:1177
 hparticlebtclusterf.cc:1178
 hparticlebtclusterf.cc:1179
 hparticlebtclusterf.cc:1180
 hparticlebtclusterf.cc:1181
 hparticlebtclusterf.cc:1182
 hparticlebtclusterf.cc:1183
 hparticlebtclusterf.cc:1184
 hparticlebtclusterf.cc:1185
 hparticlebtclusterf.cc:1186
 hparticlebtclusterf.cc:1187
 hparticlebtclusterf.cc:1188
 hparticlebtclusterf.cc:1189
 hparticlebtclusterf.cc:1190
 hparticlebtclusterf.cc:1191
 hparticlebtclusterf.cc:1192
 hparticlebtclusterf.cc:1193
 hparticlebtclusterf.cc:1194
 hparticlebtclusterf.cc:1195
 hparticlebtclusterf.cc:1196
 hparticlebtclusterf.cc:1197
 hparticlebtclusterf.cc:1198
 hparticlebtclusterf.cc:1199
 hparticlebtclusterf.cc:1200
 hparticlebtclusterf.cc:1201
 hparticlebtclusterf.cc:1202
 hparticlebtclusterf.cc:1203
 hparticlebtclusterf.cc:1204
 hparticlebtclusterf.cc:1205
 hparticlebtclusterf.cc:1206
 hparticlebtclusterf.cc:1207
 hparticlebtclusterf.cc:1208
 hparticlebtclusterf.cc:1209
 hparticlebtclusterf.cc:1210
 hparticlebtclusterf.cc:1211
 hparticlebtclusterf.cc:1212
 hparticlebtclusterf.cc:1213
 hparticlebtclusterf.cc:1214
 hparticlebtclusterf.cc:1215
 hparticlebtclusterf.cc:1216
 hparticlebtclusterf.cc:1217
 hparticlebtclusterf.cc:1218
 hparticlebtclusterf.cc:1219
 hparticlebtclusterf.cc:1220
 hparticlebtclusterf.cc:1221
 hparticlebtclusterf.cc:1222
 hparticlebtclusterf.cc:1223
 hparticlebtclusterf.cc:1224
 hparticlebtclusterf.cc:1225
 hparticlebtclusterf.cc:1226
 hparticlebtclusterf.cc:1227
 hparticlebtclusterf.cc:1228
 hparticlebtclusterf.cc:1229
 hparticlebtclusterf.cc:1230
 hparticlebtclusterf.cc:1231
 hparticlebtclusterf.cc:1232
 hparticlebtclusterf.cc:1233
 hparticlebtclusterf.cc:1234
 hparticlebtclusterf.cc:1235
 hparticlebtclusterf.cc:1236
 hparticlebtclusterf.cc:1237
 hparticlebtclusterf.cc:1238
 hparticlebtclusterf.cc:1239
 hparticlebtclusterf.cc:1240
 hparticlebtclusterf.cc:1241
 hparticlebtclusterf.cc:1242
 hparticlebtclusterf.cc:1243
 hparticlebtclusterf.cc:1244
 hparticlebtclusterf.cc:1245
 hparticlebtclusterf.cc:1246
 hparticlebtclusterf.cc:1247
 hparticlebtclusterf.cc:1248
 hparticlebtclusterf.cc:1249
 hparticlebtclusterf.cc:1250
 hparticlebtclusterf.cc:1251
 hparticlebtclusterf.cc:1252
 hparticlebtclusterf.cc:1253
 hparticlebtclusterf.cc:1254
 hparticlebtclusterf.cc:1255
 hparticlebtclusterf.cc:1256
 hparticlebtclusterf.cc:1257
 hparticlebtclusterf.cc:1258
 hparticlebtclusterf.cc:1259
 hparticlebtclusterf.cc:1260
 hparticlebtclusterf.cc:1261
 hparticlebtclusterf.cc:1262
 hparticlebtclusterf.cc:1263
 hparticlebtclusterf.cc:1264
 hparticlebtclusterf.cc:1265
 hparticlebtclusterf.cc:1266
 hparticlebtclusterf.cc:1267
 hparticlebtclusterf.cc:1268
 hparticlebtclusterf.cc:1269
 hparticlebtclusterf.cc:1270
 hparticlebtclusterf.cc:1271
 hparticlebtclusterf.cc:1272
 hparticlebtclusterf.cc:1273
 hparticlebtclusterf.cc:1274
 hparticlebtclusterf.cc:1275
 hparticlebtclusterf.cc:1276
 hparticlebtclusterf.cc:1277
 hparticlebtclusterf.cc:1278
 hparticlebtclusterf.cc:1279
 hparticlebtclusterf.cc:1280
 hparticlebtclusterf.cc:1281
 hparticlebtclusterf.cc:1282
 hparticlebtclusterf.cc:1283
 hparticlebtclusterf.cc:1284
 hparticlebtclusterf.cc:1285
 hparticlebtclusterf.cc:1286
 hparticlebtclusterf.cc:1287
 hparticlebtclusterf.cc:1288
 hparticlebtclusterf.cc:1289
 hparticlebtclusterf.cc:1290
 hparticlebtclusterf.cc:1291
 hparticlebtclusterf.cc:1292
 hparticlebtclusterf.cc:1293
 hparticlebtclusterf.cc:1294
 hparticlebtclusterf.cc:1295
 hparticlebtclusterf.cc:1296
 hparticlebtclusterf.cc:1297
 hparticlebtclusterf.cc:1298
 hparticlebtclusterf.cc:1299
 hparticlebtclusterf.cc:1300
 hparticlebtclusterf.cc:1301
 hparticlebtclusterf.cc:1302
 hparticlebtclusterf.cc:1303
 hparticlebtclusterf.cc:1304
 hparticlebtclusterf.cc:1305
 hparticlebtclusterf.cc:1306
 hparticlebtclusterf.cc:1307
 hparticlebtclusterf.cc:1308
 hparticlebtclusterf.cc:1309
 hparticlebtclusterf.cc:1310
 hparticlebtclusterf.cc:1311
 hparticlebtclusterf.cc:1312
 hparticlebtclusterf.cc:1313
 hparticlebtclusterf.cc:1314
 hparticlebtclusterf.cc:1315
 hparticlebtclusterf.cc:1316
 hparticlebtclusterf.cc:1317
 hparticlebtclusterf.cc:1318
 hparticlebtclusterf.cc:1319
 hparticlebtclusterf.cc:1320
 hparticlebtclusterf.cc:1321
 hparticlebtclusterf.cc:1322
 hparticlebtclusterf.cc:1323
 hparticlebtclusterf.cc:1324
 hparticlebtclusterf.cc:1325
 hparticlebtclusterf.cc:1326
 hparticlebtclusterf.cc:1327
 hparticlebtclusterf.cc:1328
 hparticlebtclusterf.cc:1329
 hparticlebtclusterf.cc:1330
 hparticlebtclusterf.cc:1331
 hparticlebtclusterf.cc:1332
 hparticlebtclusterf.cc:1333
 hparticlebtclusterf.cc:1334
 hparticlebtclusterf.cc:1335
 hparticlebtclusterf.cc:1336
 hparticlebtclusterf.cc:1337
 hparticlebtclusterf.cc:1338
 hparticlebtclusterf.cc:1339
 hparticlebtclusterf.cc:1340
 hparticlebtclusterf.cc:1341
 hparticlebtclusterf.cc:1342
 hparticlebtclusterf.cc:1343
 hparticlebtclusterf.cc:1344
 hparticlebtclusterf.cc:1345
 hparticlebtclusterf.cc:1346
 hparticlebtclusterf.cc:1347
 hparticlebtclusterf.cc:1348
 hparticlebtclusterf.cc:1349
 hparticlebtclusterf.cc:1350
 hparticlebtclusterf.cc:1351
 hparticlebtclusterf.cc:1352
 hparticlebtclusterf.cc:1353
 hparticlebtclusterf.cc:1354
 hparticlebtclusterf.cc:1355
 hparticlebtclusterf.cc:1356
 hparticlebtclusterf.cc:1357
 hparticlebtclusterf.cc:1358
 hparticlebtclusterf.cc:1359
 hparticlebtclusterf.cc:1360
 hparticlebtclusterf.cc:1361
 hparticlebtclusterf.cc:1362
 hparticlebtclusterf.cc:1363
 hparticlebtclusterf.cc:1364
 hparticlebtclusterf.cc:1365
 hparticlebtclusterf.cc:1366
 hparticlebtclusterf.cc:1367
 hparticlebtclusterf.cc:1368
 hparticlebtclusterf.cc:1369
 hparticlebtclusterf.cc:1370
 hparticlebtclusterf.cc:1371
 hparticlebtclusterf.cc:1372
 hparticlebtclusterf.cc:1373
 hparticlebtclusterf.cc:1374
 hparticlebtclusterf.cc:1375
 hparticlebtclusterf.cc:1376
 hparticlebtclusterf.cc:1377
 hparticlebtclusterf.cc:1378
 hparticlebtclusterf.cc:1379
 hparticlebtclusterf.cc:1380
 hparticlebtclusterf.cc:1381
 hparticlebtclusterf.cc:1382
 hparticlebtclusterf.cc:1383
 hparticlebtclusterf.cc:1384
 hparticlebtclusterf.cc:1385
 hparticlebtclusterf.cc:1386
 hparticlebtclusterf.cc:1387
 hparticlebtclusterf.cc:1388
 hparticlebtclusterf.cc:1389
 hparticlebtclusterf.cc:1390
 hparticlebtclusterf.cc:1391
 hparticlebtclusterf.cc:1392
 hparticlebtclusterf.cc:1393
 hparticlebtclusterf.cc:1394
 hparticlebtclusterf.cc:1395
 hparticlebtclusterf.cc:1396
 hparticlebtclusterf.cc:1397
 hparticlebtclusterf.cc:1398
 hparticlebtclusterf.cc:1399
 hparticlebtclusterf.cc:1400
 hparticlebtclusterf.cc:1401
 hparticlebtclusterf.cc:1402
 hparticlebtclusterf.cc:1403
 hparticlebtclusterf.cc:1404
 hparticlebtclusterf.cc:1405
 hparticlebtclusterf.cc:1406
 hparticlebtclusterf.cc:1407
 hparticlebtclusterf.cc:1408
 hparticlebtclusterf.cc:1409
 hparticlebtclusterf.cc:1410
 hparticlebtclusterf.cc:1411
 hparticlebtclusterf.cc:1412
 hparticlebtclusterf.cc:1413
 hparticlebtclusterf.cc:1414
 hparticlebtclusterf.cc:1415
 hparticlebtclusterf.cc:1416
 hparticlebtclusterf.cc:1417
 hparticlebtclusterf.cc:1418
 hparticlebtclusterf.cc:1419
 hparticlebtclusterf.cc:1420
 hparticlebtclusterf.cc:1421
 hparticlebtclusterf.cc:1422
 hparticlebtclusterf.cc:1423
 hparticlebtclusterf.cc:1424
 hparticlebtclusterf.cc:1425
 hparticlebtclusterf.cc:1426
 hparticlebtclusterf.cc:1427
 hparticlebtclusterf.cc:1428
 hparticlebtclusterf.cc:1429
 hparticlebtclusterf.cc:1430
 hparticlebtclusterf.cc:1431
 hparticlebtclusterf.cc:1432
 hparticlebtclusterf.cc:1433
 hparticlebtclusterf.cc:1434
 hparticlebtclusterf.cc:1435
 hparticlebtclusterf.cc:1436
 hparticlebtclusterf.cc:1437
 hparticlebtclusterf.cc:1438
 hparticlebtclusterf.cc:1439
 hparticlebtclusterf.cc:1440
 hparticlebtclusterf.cc:1441
 hparticlebtclusterf.cc:1442
 hparticlebtclusterf.cc:1443
 hparticlebtclusterf.cc:1444
 hparticlebtclusterf.cc:1445
 hparticlebtclusterf.cc:1446
 hparticlebtclusterf.cc:1447
 hparticlebtclusterf.cc:1448
 hparticlebtclusterf.cc:1449
 hparticlebtclusterf.cc:1450
 hparticlebtclusterf.cc:1451
 hparticlebtclusterf.cc:1452
 hparticlebtclusterf.cc:1453
 hparticlebtclusterf.cc:1454
 hparticlebtclusterf.cc:1455
 hparticlebtclusterf.cc:1456
 hparticlebtclusterf.cc:1457
 hparticlebtclusterf.cc:1458
 hparticlebtclusterf.cc:1459
 hparticlebtclusterf.cc:1460
 hparticlebtclusterf.cc:1461
 hparticlebtclusterf.cc:1462
 hparticlebtclusterf.cc:1463
 hparticlebtclusterf.cc:1464
 hparticlebtclusterf.cc:1465
 hparticlebtclusterf.cc:1466
 hparticlebtclusterf.cc:1467
 hparticlebtclusterf.cc:1468
 hparticlebtclusterf.cc:1469
 hparticlebtclusterf.cc:1470
 hparticlebtclusterf.cc:1471
 hparticlebtclusterf.cc:1472
 hparticlebtclusterf.cc:1473
 hparticlebtclusterf.cc:1474
 hparticlebtclusterf.cc:1475
 hparticlebtclusterf.cc:1476
 hparticlebtclusterf.cc:1477
 hparticlebtclusterf.cc:1478
 hparticlebtclusterf.cc:1479
 hparticlebtclusterf.cc:1480
 hparticlebtclusterf.cc:1481
 hparticlebtclusterf.cc:1482
 hparticlebtclusterf.cc:1483
 hparticlebtclusterf.cc:1484
 hparticlebtclusterf.cc:1485
 hparticlebtclusterf.cc:1486
 hparticlebtclusterf.cc:1487
 hparticlebtclusterf.cc:1488
 hparticlebtclusterf.cc:1489
 hparticlebtclusterf.cc:1490
 hparticlebtclusterf.cc:1491
 hparticlebtclusterf.cc:1492
 hparticlebtclusterf.cc:1493
 hparticlebtclusterf.cc:1494
 hparticlebtclusterf.cc:1495
 hparticlebtclusterf.cc:1496
 hparticlebtclusterf.cc:1497
 hparticlebtclusterf.cc:1498
 hparticlebtclusterf.cc:1499
 hparticlebtclusterf.cc:1500
 hparticlebtclusterf.cc:1501
 hparticlebtclusterf.cc:1502
 hparticlebtclusterf.cc:1503
 hparticlebtclusterf.cc:1504
 hparticlebtclusterf.cc:1505
 hparticlebtclusterf.cc:1506
 hparticlebtclusterf.cc:1507
 hparticlebtclusterf.cc:1508
 hparticlebtclusterf.cc:1509
 hparticlebtclusterf.cc:1510
 hparticlebtclusterf.cc:1511
 hparticlebtclusterf.cc:1512
 hparticlebtclusterf.cc:1513
 hparticlebtclusterf.cc:1514
 hparticlebtclusterf.cc:1515
 hparticlebtclusterf.cc:1516
 hparticlebtclusterf.cc:1517
 hparticlebtclusterf.cc:1518
 hparticlebtclusterf.cc:1519
 hparticlebtclusterf.cc:1520
 hparticlebtclusterf.cc:1521
 hparticlebtclusterf.cc:1522
 hparticlebtclusterf.cc:1523
 hparticlebtclusterf.cc:1524
 hparticlebtclusterf.cc:1525
 hparticlebtclusterf.cc:1526
 hparticlebtclusterf.cc:1527
 hparticlebtclusterf.cc:1528
 hparticlebtclusterf.cc:1529
 hparticlebtclusterf.cc:1530
 hparticlebtclusterf.cc:1531
 hparticlebtclusterf.cc:1532
 hparticlebtclusterf.cc:1533
 hparticlebtclusterf.cc:1534
 hparticlebtclusterf.cc:1535
 hparticlebtclusterf.cc:1536
 hparticlebtclusterf.cc:1537
 hparticlebtclusterf.cc:1538
 hparticlebtclusterf.cc:1539
 hparticlebtclusterf.cc:1540
 hparticlebtclusterf.cc:1541
 hparticlebtclusterf.cc:1542
 hparticlebtclusterf.cc:1543
 hparticlebtclusterf.cc:1544
 hparticlebtclusterf.cc:1545
 hparticlebtclusterf.cc:1546
 hparticlebtclusterf.cc:1547
 hparticlebtclusterf.cc:1548
 hparticlebtclusterf.cc:1549
 hparticlebtclusterf.cc:1550
 hparticlebtclusterf.cc:1551
 hparticlebtclusterf.cc:1552
 hparticlebtclusterf.cc:1553
 hparticlebtclusterf.cc:1554
 hparticlebtclusterf.cc:1555
 hparticlebtclusterf.cc:1556
 hparticlebtclusterf.cc:1557
 hparticlebtclusterf.cc:1558
 hparticlebtclusterf.cc:1559
 hparticlebtclusterf.cc:1560
 hparticlebtclusterf.cc:1561
 hparticlebtclusterf.cc:1562
 hparticlebtclusterf.cc:1563
 hparticlebtclusterf.cc:1564
 hparticlebtclusterf.cc:1565
 hparticlebtclusterf.cc:1566
 hparticlebtclusterf.cc:1567
 hparticlebtclusterf.cc:1568
 hparticlebtclusterf.cc:1569
 hparticlebtclusterf.cc:1570
 hparticlebtclusterf.cc:1571
 hparticlebtclusterf.cc:1572
 hparticlebtclusterf.cc:1573
 hparticlebtclusterf.cc:1574
 hparticlebtclusterf.cc:1575
 hparticlebtclusterf.cc:1576
 hparticlebtclusterf.cc:1577
 hparticlebtclusterf.cc:1578
 hparticlebtclusterf.cc:1579
 hparticlebtclusterf.cc:1580
 hparticlebtclusterf.cc:1581
 hparticlebtclusterf.cc:1582
 hparticlebtclusterf.cc:1583
 hparticlebtclusterf.cc:1584
 hparticlebtclusterf.cc:1585
 hparticlebtclusterf.cc:1586
 hparticlebtclusterf.cc:1587
 hparticlebtclusterf.cc:1588
 hparticlebtclusterf.cc:1589
 hparticlebtclusterf.cc:1590
 hparticlebtclusterf.cc:1591
 hparticlebtclusterf.cc:1592
 hparticlebtclusterf.cc:1593
 hparticlebtclusterf.cc:1594
 hparticlebtclusterf.cc:1595
 hparticlebtclusterf.cc:1596
 hparticlebtclusterf.cc:1597
 hparticlebtclusterf.cc:1598
 hparticlebtclusterf.cc:1599
 hparticlebtclusterf.cc:1600
 hparticlebtclusterf.cc:1601
 hparticlebtclusterf.cc:1602
 hparticlebtclusterf.cc:1603
 hparticlebtclusterf.cc:1604
 hparticlebtclusterf.cc:1605
 hparticlebtclusterf.cc:1606
 hparticlebtclusterf.cc:1607
 hparticlebtclusterf.cc:1608
 hparticlebtclusterf.cc:1609
 hparticlebtclusterf.cc:1610
 hparticlebtclusterf.cc:1611
 hparticlebtclusterf.cc:1612
 hparticlebtclusterf.cc:1613
 hparticlebtclusterf.cc:1614
 hparticlebtclusterf.cc:1615
 hparticlebtclusterf.cc:1616
 hparticlebtclusterf.cc:1617
 hparticlebtclusterf.cc:1618
 hparticlebtclusterf.cc:1619
 hparticlebtclusterf.cc:1620
 hparticlebtclusterf.cc:1621
 hparticlebtclusterf.cc:1622
 hparticlebtclusterf.cc:1623
 hparticlebtclusterf.cc:1624
 hparticlebtclusterf.cc:1625
 hparticlebtclusterf.cc:1626
 hparticlebtclusterf.cc:1627
 hparticlebtclusterf.cc:1628
 hparticlebtclusterf.cc:1629
 hparticlebtclusterf.cc:1630
 hparticlebtclusterf.cc:1631
 hparticlebtclusterf.cc:1632
 hparticlebtclusterf.cc:1633
 hparticlebtclusterf.cc:1634
 hparticlebtclusterf.cc:1635
 hparticlebtclusterf.cc:1636
 hparticlebtclusterf.cc:1637
 hparticlebtclusterf.cc:1638
 hparticlebtclusterf.cc:1639
 hparticlebtclusterf.cc:1640
 hparticlebtclusterf.cc:1641
 hparticlebtclusterf.cc:1642
 hparticlebtclusterf.cc:1643
 hparticlebtclusterf.cc:1644
 hparticlebtclusterf.cc:1645
 hparticlebtclusterf.cc:1646
 hparticlebtclusterf.cc:1647
 hparticlebtclusterf.cc:1648
 hparticlebtclusterf.cc:1649
 hparticlebtclusterf.cc:1650
 hparticlebtclusterf.cc:1651
 hparticlebtclusterf.cc:1652
 hparticlebtclusterf.cc:1653
 hparticlebtclusterf.cc:1654
 hparticlebtclusterf.cc:1655
 hparticlebtclusterf.cc:1656
 hparticlebtclusterf.cc:1657
 hparticlebtclusterf.cc:1658
 hparticlebtclusterf.cc:1659
 hparticlebtclusterf.cc:1660
 hparticlebtclusterf.cc:1661
 hparticlebtclusterf.cc:1662
 hparticlebtclusterf.cc:1663
 hparticlebtclusterf.cc:1664
 hparticlebtclusterf.cc:1665
 hparticlebtclusterf.cc:1666
 hparticlebtclusterf.cc:1667
 hparticlebtclusterf.cc:1668
 hparticlebtclusterf.cc:1669
 hparticlebtclusterf.cc:1670
 hparticlebtclusterf.cc:1671
 hparticlebtclusterf.cc:1672
 hparticlebtclusterf.cc:1673
 hparticlebtclusterf.cc:1674
 hparticlebtclusterf.cc:1675
 hparticlebtclusterf.cc:1676
 hparticlebtclusterf.cc:1677
 hparticlebtclusterf.cc:1678
 hparticlebtclusterf.cc:1679
 hparticlebtclusterf.cc:1680
 hparticlebtclusterf.cc:1681
 hparticlebtclusterf.cc:1682
 hparticlebtclusterf.cc:1683
 hparticlebtclusterf.cc:1684
 hparticlebtclusterf.cc:1685
 hparticlebtclusterf.cc:1686
 hparticlebtclusterf.cc:1687
 hparticlebtclusterf.cc:1688
 hparticlebtclusterf.cc:1689
 hparticlebtclusterf.cc:1690
 hparticlebtclusterf.cc:1691
 hparticlebtclusterf.cc:1692
 hparticlebtclusterf.cc:1693
 hparticlebtclusterf.cc:1694
 hparticlebtclusterf.cc:1695
 hparticlebtclusterf.cc:1696
 hparticlebtclusterf.cc:1697
 hparticlebtclusterf.cc:1698
 hparticlebtclusterf.cc:1699
 hparticlebtclusterf.cc:1700
 hparticlebtclusterf.cc:1701
 hparticlebtclusterf.cc:1702
 hparticlebtclusterf.cc:1703
 hparticlebtclusterf.cc:1704
 hparticlebtclusterf.cc:1705
 hparticlebtclusterf.cc:1706
 hparticlebtclusterf.cc:1707
 hparticlebtclusterf.cc:1708
 hparticlebtclusterf.cc:1709
 hparticlebtclusterf.cc:1710
 hparticlebtclusterf.cc:1711
 hparticlebtclusterf.cc:1712
 hparticlebtclusterf.cc:1713
 hparticlebtclusterf.cc:1714
 hparticlebtclusterf.cc:1715
 hparticlebtclusterf.cc:1716
 hparticlebtclusterf.cc:1717
 hparticlebtclusterf.cc:1718
 hparticlebtclusterf.cc:1719
 hparticlebtclusterf.cc:1720
 hparticlebtclusterf.cc:1721
 hparticlebtclusterf.cc:1722
 hparticlebtclusterf.cc:1723
 hparticlebtclusterf.cc:1724
 hparticlebtclusterf.cc:1725
 hparticlebtclusterf.cc:1726
 hparticlebtclusterf.cc:1727
 hparticlebtclusterf.cc:1728
 hparticlebtclusterf.cc:1729
 hparticlebtclusterf.cc:1730
 hparticlebtclusterf.cc:1731
 hparticlebtclusterf.cc:1732
 hparticlebtclusterf.cc:1733
 hparticlebtclusterf.cc:1734
 hparticlebtclusterf.cc:1735
 hparticlebtclusterf.cc:1736
 hparticlebtclusterf.cc:1737
 hparticlebtclusterf.cc:1738
 hparticlebtclusterf.cc:1739
 hparticlebtclusterf.cc:1740
 hparticlebtclusterf.cc:1741
 hparticlebtclusterf.cc:1742
 hparticlebtclusterf.cc:1743
 hparticlebtclusterf.cc:1744
 hparticlebtclusterf.cc:1745
 hparticlebtclusterf.cc:1746
 hparticlebtclusterf.cc:1747
 hparticlebtclusterf.cc:1748
 hparticlebtclusterf.cc:1749
 hparticlebtclusterf.cc:1750
 hparticlebtclusterf.cc:1751
 hparticlebtclusterf.cc:1752
 hparticlebtclusterf.cc:1753
 hparticlebtclusterf.cc:1754
 hparticlebtclusterf.cc:1755
 hparticlebtclusterf.cc:1756
 hparticlebtclusterf.cc:1757
 hparticlebtclusterf.cc:1758
 hparticlebtclusterf.cc:1759
 hparticlebtclusterf.cc:1760
 hparticlebtclusterf.cc:1761
 hparticlebtclusterf.cc:1762
 hparticlebtclusterf.cc:1763
 hparticlebtclusterf.cc:1764
 hparticlebtclusterf.cc:1765
 hparticlebtclusterf.cc:1766
 hparticlebtclusterf.cc:1767
 hparticlebtclusterf.cc:1768
 hparticlebtclusterf.cc:1769
 hparticlebtclusterf.cc:1770
 hparticlebtclusterf.cc:1771
 hparticlebtclusterf.cc:1772
 hparticlebtclusterf.cc:1773
 hparticlebtclusterf.cc:1774
 hparticlebtclusterf.cc:1775
 hparticlebtclusterf.cc:1776
 hparticlebtclusterf.cc:1777
 hparticlebtclusterf.cc:1778
 hparticlebtclusterf.cc:1779
 hparticlebtclusterf.cc:1780
 hparticlebtclusterf.cc:1781
 hparticlebtclusterf.cc:1782
 hparticlebtclusterf.cc:1783
 hparticlebtclusterf.cc:1784
 hparticlebtclusterf.cc:1785
 hparticlebtclusterf.cc:1786
 hparticlebtclusterf.cc:1787
 hparticlebtclusterf.cc:1788
 hparticlebtclusterf.cc:1789
 hparticlebtclusterf.cc:1790
 hparticlebtclusterf.cc:1791
 hparticlebtclusterf.cc:1792
 hparticlebtclusterf.cc:1793
 hparticlebtclusterf.cc:1794
 hparticlebtclusterf.cc:1795
 hparticlebtclusterf.cc:1796
 hparticlebtclusterf.cc:1797
 hparticlebtclusterf.cc:1798
 hparticlebtclusterf.cc:1799
 hparticlebtclusterf.cc:1800
 hparticlebtclusterf.cc:1801
 hparticlebtclusterf.cc:1802
 hparticlebtclusterf.cc:1803
 hparticlebtclusterf.cc:1804
 hparticlebtclusterf.cc:1805
 hparticlebtclusterf.cc:1806
 hparticlebtclusterf.cc:1807
 hparticlebtclusterf.cc:1808
 hparticlebtclusterf.cc:1809
 hparticlebtclusterf.cc:1810
 hparticlebtclusterf.cc:1811
 hparticlebtclusterf.cc:1812
 hparticlebtclusterf.cc:1813
 hparticlebtclusterf.cc:1814
 hparticlebtclusterf.cc:1815
 hparticlebtclusterf.cc:1816
 hparticlebtclusterf.cc:1817
 hparticlebtclusterf.cc:1818
 hparticlebtclusterf.cc:1819
 hparticlebtclusterf.cc:1820
 hparticlebtclusterf.cc:1821
 hparticlebtclusterf.cc:1822
 hparticlebtclusterf.cc:1823
 hparticlebtclusterf.cc:1824
 hparticlebtclusterf.cc:1825
 hparticlebtclusterf.cc:1826
 hparticlebtclusterf.cc:1827