#ifndef HPIDALGRINGPROPERTIESPAR_H
#define HPIDALGRINGPROPERTIESPAR_H
using namespace std;
#include "hpidhistogramscont.h"
#include "hpidtrackcand.h"
#include "piddef.h"
#include <iostream>
#include <cstdlib>
#define PIDALGRINGPROPERTIESPAR_NAME "PidAlgRingPropertiesPar"
#define PIDALGRINGPROPERTIESPAR_TITLE "Parameters for HPidAlgRingProperties"
#define PIDALGRINGPROPERTIESPAR_CONTEXT "HPidAlgRingPropertiesContext"
#include "TH1.h"
class HPidAlgRingPropertiesPar : public HPidHistogramsCont
{
public:
HPidAlgRingPropertiesPar(
const Char_t *name = PIDALGRINGPROPERTIESPAR_NAME,
const Char_t *title = PIDALGRINGPROPERTIESPAR_TITLE,
const Char_t *context = PIDALGRINGPROPERTIESPAR_CONTEXT);
virtual ~HPidAlgRingPropertiesPar(void) {}
virtual void set4DMean(Int_t sector, Int_t index, Float_t value) {MeanValues4D[4*sector+index]=value;}
virtual void set5DMean(Int_t sector, Int_t index, Float_t value) {MeanValues5D[5*sector+index]=value;}
virtual void set4DEvec(Int_t sector, Int_t index, Float_t value) {EigenVectors4D[16*sector+index]=value;}
virtual void set5DEvec(Int_t sector, Int_t index, Float_t value) {EigenVectors5D[25*sector+index]=value;}
virtual void set4DSigma(Int_t sector, Int_t index, Float_t value) {SigmaValues4D[4*sector+index]=value;}
virtual void set5DSigma(Int_t sector, Int_t index, Float_t value) {SigmaValues5D[5*sector+index]=value;}
Float_t get4DMean(Int_t sector, Int_t index) {return MeanValues4D[4*sector+index];}
Float_t get5DMean(Int_t sector, Int_t index) {return MeanValues5D[5*sector+index];}
Float_t get4DEvec(Int_t sector, Int_t index) {return EigenVectors4D[16*sector+index];}
Float_t get5DEvec(Int_t sector, Int_t index) {return EigenVectors5D[25*sector+index];}
Float_t get4DSigma(Int_t sector, Int_t index) {return SigmaValues4D[4*sector+index];}
Float_t get5DSigma(Int_t sector, Int_t index) {return SigmaValues5D[5*sector+index];}
Int_t getThetaBin(Float_t fTheta) const
{
for(Int_t i=0;i<2;i++)
{
if(fTheta<=(i+1)*45.0)
{
if(i!=getThetaBinDynamic(fTheta))
{
Error("HPidAlgRingPropertiesPar::getThetaBin()","ambiguous theta bin not computed!");
exit(-1);
}
return i;
}
}
return -1;
}
Int_t getThetaBinDynamic(Float_t fTheta) const
{
Int_t nThetaBins = ((Float_t)(getHistsPerPart()-1)) / 2;
Float_t thetaStep = 90./nThetaBins;
for(Int_t i=0;i<nThetaBins;i++)
{
if(fTheta<=(i+1)*thetaStep)
{
return i;
}
}
return -1;
}
Float_t getNormalizedPDFValue(Int_t iPartId, Float_t fTheta, Int_t iSector, Bool_t bCentroid, Float_t Coordinate_1, Float_t Coordinate_2) const
{
Int_t offset=0;
Int_t thetaBin =getThetaBin(fTheta);
if(!bCentroid) offset+=2;
offset+=thetaBin;
if(offset>=4)
{
Error("HPidAlgRingPropertiesPar::getNormalizedPDFValue()","Offset %d out of range!",offset);
}
Float_t value = getValue(iPartId, offset, iSector, Coordinate_1, Coordinate_2);
return value;
}
Float_t getRichLeptonFraction(Float_t momentum, Float_t theta, Int_t sector)
{
Int_t offset = 4;
return (Float_t) getValue(2,offset,sector,momentum,theta);
}
Float_t getRichProtonFraction(Float_t momentum, Float_t theta, Int_t sector)
{
Int_t offset = 4;
return (Float_t) getValue(14,offset,sector,momentum,theta);
}
Float_t getRichPiPlusFraction(Float_t momentum, Float_t theta, Int_t sector)
{
Int_t offset = 4;
return (Float_t) getValue(8,offset,sector,momentum,theta);
}
Float_t getRichPiMinusFraction(Float_t momentum, Float_t theta, Int_t sector)
{
Int_t offset = 4;
return (Float_t) getValue(9,offset,sector,momentum,theta);
}
Float_t getRichFakeFraction(Float_t momentum, Float_t theta,Int_t sector)
{
Int_t offset = 4;
return (Float_t) getValue(-1,offset,sector,momentum,theta);
}
void setUse4DTransform(Bool_t choice){use4DTransform=choice;}
void setUse5DTransform(Bool_t choice){use5DTransform=choice;}
Bool_t getUse4DTransform(){return use4DTransform;}
Bool_t getUse5DTransform(){return use5DTransform;}
private:
Float_t EigenVectors4D[16*6];
Float_t EigenVectors5D[25*6];
Float_t MeanValues4D[4*6];
Float_t MeanValues5D[5*6];
Float_t SigmaValues4D[4*6];
Float_t SigmaValues5D[5*6];
Bool_t use5DTransform;
Bool_t use4DTransform;
public:
ClassDef(HPidAlgRingPropertiesPar, 1)
};
#endif /* !HPIDALGRINGPROPERTIESPAR_H */
Last change: Sat May 22 13:06:52 2010
Last generated: 2010-05-22 13:06
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.