ROOT logo
HYDRA - THE HADES ANALYSIS PACKAGE » (UNKNOWN) » HParticleTool

class HParticleTool: public TObject

_HADES_CLASS_DESCRIPTION

 HParticleTool

 library of static functions
 look here for auxiliary functions for:
 physics analysis, simulation analysis, ...

Function Members (Methods)

public:
HParticleTool()
HParticleTool(const HParticleTool&)
virtual~HParticleTool()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
static Double_tbeta(Int_t id, Double_t p)
static Double_tbetaandgammafunc(Double_t* x, Double_t* par)
static TF1*betaAndGammaTF1(Int_t id, TString name = "", TString opt = "beta", Double_t scaleY = 1, Double_t xoffset = 0, Double_t scaleX = 1, Double_t theta = -1, Double_t frac = 0.1, Double_t xmin = 20, Double_t xmax = 2000, Int_t linecolor = 2, Int_t linestyle = 1, Int_t npoints = 500)
static Double_tbetagamma(Int_t id, Double_t p)
static Double_tbetagammaToP(Int_t id, Double_t betagamma)
static Double_tbetaToP(Int_t id, Double_t beta)
virtual voidTObject::Browse(TBrowser* b)
static Double_tcalcDeterminant(HGeomVector& v1, HGeomVector& v2, HGeomVector& v3)
static Float_tcalcRichQA(HMdcSeg* seg, HRichHit* hit)
static Float_tcalcRichQA(HMdcSeg* seg, Float_t richTheta, Float_t richPhi)
static Double_tcalcRMS(const Double_t* valArr, Double_t Mean, Int_t valNum)
static voidcalcSegVector(Double_t z, Double_t rho, Double_t phi, Double_t theta, HGeomVector& base, HGeomVector& dir)
static HGeomVectorcalculateCrossPoint(HGeomVector& base1, HGeomVector& dir1, HGeomVector& base2, HGeomVector& dir2)
static Double_tcalculateMinimumDistance(HGeomVector& base1, HGeomVector& dir1, HGeomVector& base2, HGeomVector& dir2)
static Double_tcalculateMinimumDistanceStraightToPoint(HGeomVector& base, HGeomVector& dir, HGeomVector& point)
static HGeomVectorcalculatePointOfClosestApproach(HGeomVector& base1, HGeomVector& dir1, HGeomVector& base2, HGeomVector& dir2)
static HGeomVectorcalculatePointOfClosestApproachStraightToPoint(HGeomVector& base, HGeomVector& dir, HGeomVector& point)
static HGeomVectorcalcVertexAnalytical(HGeomVector& base1, HGeomVector& dir1, HGeomVector& base2, HGeomVector& dir2)
static Bool_tcheckCropedLayer(HGeantKine* kine, HMdcLayer* mdcLayer, Bool_t* croped = 0, Bool_t checkHit = kTRUE)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
static Bool_tcorrectPathLength(HParticleCand* pCand, HGeomVector& vertex, const HMdcPlane* planes, const HGeomVector& targetMidPoint, Double_t beamEnergy = 1230)
static Double_tdedxfunc(Double_t* x, Double_t* par)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
static voiddrawPtyGrid(vector<TF1*>& grid, TString opt = "draw")
virtual voidTObject::Dump() constMENU
static TF1*energyLossTF1(Int_t id, TString name = "", TString opt = "p", Double_t scaleY = 1, Double_t xoffset = 0, Double_t scaleX = 1, Double_t theta = -1, Double_t frac = 0.1, Double_t xmin = 20, Double_t xmax = 2000, Int_t linecolor = 2, Int_t linestyle = 1, Int_t npoints = 500)
virtual voidTObject::Error(const char* method, const char* msgfmt) const
static Bool_tevalPairsFlags(UInt_t flag, UInt_t fl)
static Bool_tevalPairsFlags(UInt_t flag, HParticlePair& pair)
static Bool_tevalPairsFlags(vector<UInt_t>& flags, HParticlePair& pair)
static Bool_tevalPairsFlags(UInt_t flag, HParticleCand* cand1, HParticleCand* cand2)
static Bool_tevalPairsFlags(vector<UInt_t>& flags, vector<Bool_t>& results, HParticlePair& pair)
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
static Double_tfcross(Double_t* xin, Double_t* par)
static voidfillTLorentzVector(TLorentzVector& v, HVirtualCand* cand, Float_t mass)
static voidfillTLorentzVector(TLorentzVector& v, HVirtualCand* cand, Int_t pid, Bool_t correctMom = kTRUE)
static Int_tfindFirstHitInTof(Int_t trackID, Int_t modeTrack = 2)
static Int_tfindFirstHitShowerInRpc(Int_t trackID, Int_t modeTrack = 2)
static Int_tfindFirstHitShowerInTofino(Int_t trackID, Int_t modeTrack = 2)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
static Double_tgamma(Int_t id, Double_t p)
static Double_tgammaToBeta(Int_t id, Double_t gamma)
static Double_tgammaToP(Int_t id, Double_t gamma)
static Int_tgetCloseCandidates(HParticleCand* cand, vector<HParticleCand*>& vcand, vector<Float_t>& vopeninAngle, Float_t oACut = 15., Bool_t sameSector = kTRUE, Bool_t skipSameSeg = kTRUE)
static Int_tgetCloseCandidatesSegInd(HParticleCand* cand, vector<Int_t>& vSeg, Float_t oACut, Bool_t sameSector, Bool_t skipSameSeg)
static Float_tgetCorrectedMomentum(HParticleCand* c)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
static HEmcCluster*getEmcCluster(Int_t emcind)
static HGeomVectorgetGlobalVertex(Int_t v, Bool_t warn = kFALSE)
virtual const char*TObject::GetIconName() const
static Float_tgetInterpolatedValue(TH1* h, Float_t xVal, Bool_t warn = kTRUE)
static Bool_tgetIntersectionPoint(TF1* f1, TF1* f2, Double_t& xout, Double_t& yout, Double_t xlow, Double_t xup, Int_t n = 500)
static Float_tgetLabPhiDeg(TLorentzVector& vec)
static TObjArray*getMdcCal1Cluster(Int_t segind)
static Int_tgetMdcCal1Cluster(Int_t segind, vector<HMdcCal1*>& v, Bool_t clear = kTRUE)
static TObjArray*getMdcCal1Seg(Int_t segind)
static Int_tgetMdcCal1Seg(Int_t segind, vector<HMdcCal1*>& v, Bool_t clear = kTRUE)
static HMdcClus*getMdcClus(Int_t segind)
static HMdcClusFit*getMdcClusFit(Int_t segind)
static HMdcClusInf*getMdcClusInf(Int_t segind, Int_t nhit = 0)
static HMdcHit*getMdcHit(Int_t segind, Int_t nhit = 0)
static HMdcSeg*getMdcSeg(Int_t segind)
static HMdcTrkCand*getMdcTrkCand(Int_t metaind)
static TObjArray*getMdcWireFitSeg(Int_t segind)
static Int_tgetMdcWireFitSeg(Int_t segind, vector<HMdcWireFit*>& v, Bool_t clear = kTRUE)
static HMetaMatch2*getMetaMatch(Int_t metaind)
static Double_tgetMinimumDistToVertex(HParticleCand*, HGeomVector& vertex)
virtual const char*TObject::GetName() const
static Float_tgetNormDX(HParticleCand* c, TString beamtime = "apr12")
static Float_tgetNormDX(HParticleCand* c, HTofWalkPar* p)
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
static Float_tgetOpeningAngle(TLorentzVector& vec1, TLorentzVector& vec2)
static Float_tgetOpeningAngle(HParticleCand* cand1, HParticleCand* cand2)
static Float_tgetOpeningAngle(HGeantKine* kine1, HGeantKine* kine2)
static Float_tgetOpeningAngle(Float_t phi1, Float_t theta1, Float_t phi2, Float_t theta2)
virtual Option_t*TObject::GetOption() const
static HGeomVectorgetPointOfClosestApproachToVertex(HParticleCand*, HGeomVector& vertex)
static HRichHit*getRichHit(Int_t richind)
static Float_tgetRpcCellHalfWidth(Int_t mod, Int_t cell)
static HRpcCluster*getRpcCluster(Int_t rpcind)
static Int_tgetRpcHitMult(Float_t minTof = 0, Float_t maxTof = 25., Int_t* sector = 0)
static Double_tgetScaledDy(HParticleCand* c, Double_t dyCut = -1)
static TF1*getScaleTF1()
static HShowerHit*getShowerHit(Int_t showerind)
static Float_tgetSigmaDX(HParticleCand* c, TString beamtime = "apr12")
static Float_tgetSigmaDX(HParticleCand* c, HTofWalkPar* p)
static Bool_tgetSimTracks(HParticleCandSim* c, vector<Int_t>& tracksMeta, vector<Int_t>& tracksShowerEcal, vector<Int_t>& tracksRich, vector<Int_t>& weightRich, vector<Int_t>& tracksInnerMdc, vector<Int_t>& weightInnerMdc, vector<Int_t>& tracksOuterMdc, vector<Int_t>& weightOuterMdc, Bool_t print = kFALSE)
virtual const char*TObject::GetTitle() const
static voidgetTLorentzVector(HGeantKine* kine, TLorentzVector& vec, Int_t pid = -1)
static Float_tgetTofCellHalfWidth(Int_t mod, Int_t cell)
static HTofCluster*getTofCluster(Int_t tofind)
static HTofHit*getTofHit(Int_t tofind)
static Int_tgetTofHitMult(Float_t minTof = 0, Float_t maxTof = 35., Int_t* sector = 0)
static TF1*getTofXOffsetTF1()
static TF1*getTofXSigmaTF1()
virtual UInt_tTObject::GetUniqueID() const
static Stat_tgetValue(TH1* h, Float_t xVal, Float_t yVal = 0.0f, Float_t zVal = 0.0f)
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
static Bool_tisGoodClusterVertex(Float_t minZ)
static Bool_tisGoodMetaCell(HParticleCand* c, Double_t bound = 3.5, Bool_t doScaling = kTRUE)
static Bool_tisGoodRecoVertex(Float_t minZ)
static Bool_tisGoodSTART(Int_t minFlag)
static Bool_tisGoodSTARTMETA(Float_t minStart = 80., Float_t maxStart = 350., Int_t tresh = 4, Float_t window = 5., Float_t offset = 7.)
static Bool_tisGoodSTARTVETO(Float_t minStart = 15., Float_t maxStart = 350., Float_t window = 1.)
static Bool_tisGoodTrigger(Int_t triggerbit)
static Bool_tisNoMETAPileUp(Float_t ftimeTofCut, Int_t threshold)
static Bool_tisNoSTART(Float_t minStart = -15., Float_t maxStart = 15., Float_t window = 1.)
static Bool_tisNoSTARTPileUp()
static Bool_tisNoVETO(Float_t minStart = -15., Float_t maxStart = 15.)
Bool_tTObject::IsOnHeap() const
static Bool_tisPairsFlagsBit(UInt_t flag, UInt_t fl)
static Bool_tisParticleBeta(Int_t PID, HParticleCand* pCand, Float_t nsigma, Float_t momMin, Float_t momMax, Float_t& dtime, Float_t& dsigma, TString beamtime = "apr12")
static Bool_tisParticledEdx(Int_t PID, HParticleCand* c, Float_t& deloss, Float_t& dsigma)
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
static Double_tkinEToMom(Int_t id = 14, Double_t Ekin = 3500)
virtual voidTObject::ls(Option_t* option = "") const
static TCutG*makeCut(TF1* lower, TF1* upper, TString name, Double_t xlow, Double_t xup, Double_t ymin = -1000, Double_t ymax = 1000, Int_t npoint = 500, Int_t linecolor = 2, Int_t linestyle = 2)
voidTObject::MayNotUse(const char* method) const
static Double_tmomToKinE(Int_t id = 14, Double_t p = 3500)
static Bool_tnormDX(HParticleCand* c, TString beamtime = "apr12")
static Bool_tnormDX(HParticleCand* c, HTofWalkPar* p)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
HParticleTool&operator=(const HParticleTool&)
virtual voidTObject::Paint(Option_t* option = "")
static Float_tphiLabToPhiSecDeg(Float_t phiLabDeg)
static Int_tphiLabToSec(Float_t phiLabDeg)
static Float_tphiSecToLabDeg(Int_t sec, Float_t phiRad)
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
static Bool_tprintSimTracks(HParticleCandSim* c)
static Double_tptyfunc(Double_t* x, Double_t* par)
static vector<TF1*>ptyGrid(Int_t id, vector<Double_t>& vtheta, vector<Double_t>& vmom, TString name = "", TString opt = "draw", Double_t xmin = 0, Double_t xmax = 2, Double_t midRap = 0, Int_t linecolorTheta = 1, Int_t linestyleTheta = 2, Int_t linecolorMom = 1, Int_t linestyleMom = 2)
static vector<TF1*>ptyGrid(Int_t id, TString setup = "@theta:8,0,10@momentum:20,10,100", TString name = "", TString opt = "draw", Double_t xmin = 0, Double_t xmax = 2, Double_t midRap = 0, Int_t linecolorTheta = 1, Int_t linestyleTheta = 2, Int_t linecolorMom = 1, Int_t linestyleMom = 2, TString labels = "@theta:draw=yes,format=%5.1f#circ,textsize=0.021,angle=0,align=-1@momentum:draw=yes,format=%5.1f MeV/c,textsize=0.023,angle=10,align=-1")
static TF1*ptyTF1(Int_t id, Double_t val = 45, TString name = "", TString opt = "theta", Double_t xmin = 0, Double_t xmax = 2, Double_t midRap = 0, Int_t linecolor = 2, Int_t linestyle = 1)
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
static Double_tscaledy(Double_t* x, Double_t* par)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
static Bool_tsetCloseCandidates(Float_t oACut = 15., Bool_t sameSector = kTRUE, Bool_t skipSameSeg = kTRUE)
static Float_tsetCorrectedMomentum(HParticleCand* c)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
static Bool_tsetPairFlags(UInt_t& flag, HParticleCand* cand2 = 0, HParticleCand* cand1 = 0)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
static Float_tthetaToLabDeg(Float_t thetaRad)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

private:
static TStringbeamtime_tof
static TF1*fdxoffsettof dx offset function
static TF1*fdxsigmatof dx sigma function
static TF1*gScaledyscaling function (1/p) for dy matching boundary cut
static TF1*gf1helper functions for genereric intersection of tf1
static TF1*gf2helper functions for genereric intersection of tf1
static TF1*gfsumhelper functions for genereric intersection of tf1
static Double_tparsDX[6][8][8][5]tof offset dx normalization parameters
static Double_tparsDX_apr12[6][8][8][5]tof offset dx normalization parameters
static Double_tparsSX[6][8][8][3]tof sigma dx normalization parameters
static Double_tparsSX_apr12[6][8][8][3]tof sigma dx normalization parameters
static Float_trpcCellHalfWidth[192]! half with of rpc cell for matching [col*32+cell]
static Double_tscaleDyPars[4]! params for TF1 gScaledy
static Float_ttofCellHalfWidth[64]! half with of tof cell for matching [mod*8+cell]

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

HParticleTool()
~HParticleTool()
Float_t phiSecToLabDeg(Int_t sec, Float_t phiRad)
 Convert phi (rad) angle from sec to Lab phi in deg
Float_t thetaToLabDeg(Float_t thetaRad)
 Convert theta angle (rad) to the coordinate lab system
Float_t phiLabToPhiSecDeg(Float_t phiLabDeg)
 Convert phi angle (deg,lab: 0-360) to the coordinate sector system (60,120)
Int_t phiLabToSec(Float_t phiLabDeg)
Float_t calcRichQA(HMdcSeg* seg, HRichHit* hit)
 return -1 if fails.
Float_t calcRichQA(HMdcSeg* seg, Float_t richTheta, Float_t richPhi)
 return -1 if fails. richTheta and richPhi in deg in lab system

Float_t getOpeningAngle(Float_t phi1, Float_t theta1, Float_t phi2, Float_t theta2)
 phi and theta angles of particle 1 and 2 in lab coordinates [deg]
 returns opening angle [deg]
Float_t getOpeningAngle(TLorentzVector& vec1, TLorentzVector& vec2)
 returns opening angle [deg]
Float_t getOpeningAngle(HParticleCand* cand1, HParticleCand* cand2)
 returns opening angle [deg]
Float_t getOpeningAngle(HGeantKine* kine1, HGeantKine* kine2)
 returns opening angle [deg]
Bool_t setCloseCandidates(Float_t oACut = 15., Bool_t sameSector = kTRUE, Bool_t skipSameSeg = kTRUE)
 loops over HParticleCand category and finds the closest partners of each candidate. set
 setAngleToNearbyFittedInner() and setAngleToNearbyUnfittedInner() of the candidates
 convention :  oAngle is positive if the closest partner had a ring match otherwise negative.
 Only opening Angles smaller oACut [Deg] are taken into account. Default opening Angles
 are set to -99. if sameSector = kTRUE (default) closest partners are searched in the
 same sector only. if skipSameSeg = kTRUE (default) candidates which share the same
 inner segment are ignored.
Int_t getCloseCandidates(HParticleCand* cand, vector<HParticleCand*>& vcand, vector<Float_t>& vopeninAngle, Float_t oACut = 15., Bool_t sameSector = kTRUE, Bool_t skipSameSeg = kTRUE)
 loops over HParticleCand category and finds the closest partners of cand
 and fill them to vcand. the opening angles are filled in same order to vopeningAngles.
 Only opening Angles smaller oACut [Deg] are taken into account.
 if sameSector = kTRUE (default) closest partners are searched in the
 same sector only. if skipSameSeg = kTRUE (default) candidates which share the same
 inner segment are ignored. The candidates are sorted by inreasing opening angle.
Int_t getCloseCandidatesSegInd(HParticleCand* cand, vector<Int_t>& vSeg, Float_t oACut, Bool_t sameSector, Bool_t skipSameSeg)
 loops over HParticleCand category and finds the closest partners of cand
 and fill the inner seg Ind to vSeg.
 Only opening Angles smaller oACut [Deg] are taken into account.
 if sameSector = kTRUE (default) closest partners are searched in the
 same sector only. if skipSameSeg = kTRUE (default) candidates which share the same
 inner segment are ignored.
 The seg ind are sorted by inreasing opening angle.
void getTLorentzVector(HGeantKine* kine, TLorentzVector& vec, Int_t pid = -1)
 fills TLorentzVector vec from HGeantKine (if no id is provide id from
 kine will be used).
 CAUTION : vec.Phi() will be -pi to  pi  (-180 to +180 deg)
           To be compatibel with the HADES lab system phi (0-360 deg)
           one has to use
           HParticleTool::getLabPhiDeg(TLorentzVector& vec)
void fillTLorentzVector(TLorentzVector& v, HVirtualCand* cand, Float_t mass)
 fill v from cand. cand will be unmodified.
 user has to provide the mass. if the candidate has
 no reconstructed momentum the vector will be filled
 by angles only (enough for opening angle calculation, but invMass
 for such vectors will be wrong). FOR PARTICLES WITH CHARGE != 1
 USE fillTLorentzVector(TLorentzVector& v,HParticleCand* cand,Int_t pid,Bool_t correctMom=kTRUE)
void fillTLorentzVector(TLorentzVector& v, HVirtualCand* cand, Int_t pid, Bool_t correctMom = kTRUE)
 fill v from cand. cand will be unmodified.
 user has to provide the PID. if the candidate has
 no reconstructed momentum the vector will be filled
 by angles only (enough for opening angle calculation, but invMass
 for such vectors will be wrong). correctMom will
 switch to correction of momentum (HEnergylossCorrPar needed)
 The function takes care about particle charge != 1 when
 fill the momenta.
Float_t getLabPhiDeg(TLorentzVector& vec)
 CAUTION : vec.Phi() will be -pi to  pi  (-180 to +180 deg)
           To be compatibel with the HADES lab system phi (0-360 deg)
           one has to use shift negative values by 360deg
HGeomVector getGlobalVertex(Int_t v, Bool_t warn = kFALSE)
  return the global vertex position
  v can be Particle::kVertexCluster, Particle::kVertexSegment,
  Particle::kVertexParticle. In case of Particle::kVertexSegment
  and Particle::kVertexParticle the chi2 of the vertex fit is
  checked. If the the fit Particle::kVertexSegment failed the position of
  Particle::kVertexCluster is returned instead. If Particle::kVertexParticle
  fails Particle::kVertexSegment is used if possible otherwise fallback
  is Particle::kVertexCluster.
Double_t scaledy(Double_t* x, Double_t* par)
 scaling function for dy METAMATCH cut with 1/p  [GeV/c]
 par[0] a : dy at 1/p=0;
 par[1] slope per 1/p unit
 par[2] part2 : open window for very slow particles
 par[3] gain  : slope = slope*gain for 1/p > part2
Double_t getScaledDy(HParticleCand* c, Double_t dyCut = -1)
 scaling function for dy METAMATCH cut with 1/p  [GeV/c]
 par[0] a : dy at 1/p=0    [mm];
 par[1] slope per 1/p unit
 par[2] part2 : open window for very slow particles
 par[3] gain  : slope = slope*gain for 1/p > part2
 TF1 is created with initial parameters HParticleTool::scaleDyPars[4] at
 first call of the function, dyCut [mm] will be used instead of scaleDyPars[0]
 if dyCut is positive.
Float_t getRpcCellHalfWidth(Int_t mod, Int_t cell)
 returns the half cell width for rpc cell in column col
 return -1 if out of bounds (col 0-5,cell 0-31)
Float_t getTofCellHalfWidth(Int_t mod, Int_t cell)
 returns the half cell width for tof cell in module mod (addressing like data, not geom!)
 return -1 if out of bounds (mod 0-7, cell 0-7)
Bool_t isGoodMetaCell(HParticleCand* c, Double_t bound = 3.5, Bool_t doScaling = kTRUE)
 returns kTRUE is the candidate matches in dy to the meta cell.
 returns kFALSE if the candidate has no meta. If the candidate has shower
 only it returns alway kTRUE. If doScaling = kTRUE a scaling with 1/p
 of bound is applied to account for multiple scattering of slow particles
Bool_t normDX(HParticleCand* c, TString beamtime = "apr12")
 This function changes
 c->setMetaMatchQuality(metaDxnorm) (quality for dx only, dx unchanged);
 RK dx values will be normalized by correct width to alow
 for general treatment of cuts (RPC (clustersize 1 and 2, TOF and SIM)).
 supported beamtime = apr12 (default)
Float_t getNormDX(HParticleCand* c, TString beamtime = "apr12")
 This function does not change the candidate.
 it returns normalized RK dx value (including sign) to alow
 for general treatment of cuts (RPC (clustersize 1 and 2, TOF and SIM)).
 supported beamtime = apr12 (default)
Float_t getSigmaDX(HParticleCand* c, TString beamtime = "apr12")
 This function does not change the candidate.
 it returns sigma RK dx value to alow
 for general treatment of cuts (RPC (clustersize 1 and 2, TOF and SIM)).
 supported beamtime = apr12 (default)
Bool_t normDX(HParticleCand* c, HTofWalkPar* p)
 This function changes
 c->setMetaMatchQuality(metaDxnorm) (quality for dx only, dx unchanged);
 RK dx values will be normalized by correct width to alow
 for general treatment of cuts (RPC (clustersize 1 and 2, TOF and SIM)).
Float_t getNormDX(HParticleCand* c, HTofWalkPar* p)
 This function does not change the candidate.
 it returns normalized RK dx value (including sign) to alow
 for general treatment of cuts (RPC (clustersize 1 and 2, TOF and SIM)).
Float_t getSigmaDX(HParticleCand* c, HTofWalkPar* p)
 This function does not change the candidate.
 it returns sigma RK dx value to alow
 for general treatment of cuts (RPC (clustersize 1 and 2, TOF and SIM)).
Float_t getCorrectedMomentum(HParticleCand* c)
 returns the corrected momenta (not changing the candidate)
 corrections: 1. systematic deviation for high momenta (obtained
 from simulation, applied for SIM+REAL) 2. correction for field map
 (obtained from apr12 data applied for REAL only).
 REMARK: NO ENERGYLOSS CORRECTION HERE!
Float_t setCorrectedMomentum(HParticleCand* c)
 returns the corrected momenta (candidate is changed)
 corrections: 1. systematic deviation for high momenta (obtained
 from simulation, applied for SIM+REAL) 2. correction for field map
 (obtained from apr12 data applied for REAL only).
 REMARK: NO ENERGYLOSS CORRECTION HERE!
Bool_t isParticledEdx(Int_t PID, HParticleCand* c, Float_t& deloss, Float_t& dsigma)
 return the delta eloss and sigma of particle assuming PID from
 the calibrated Mdc dedx vs beta curve. The functions takes
 into account the dependency of beta from energyloss (as function
 of theta .charge =1 and charge =2 are treated correct.
 The function makes use of HEnergyLossPar. You have to init
 the container before. Params are taken from apr12.
Bool_t isParticleBeta(Int_t PID, HParticleCand* pCand, Float_t nsigma, Float_t momMin, Float_t momMax, Float_t& dtime, Float_t& dsigma, TString beamtime = "apr12")
Bool_t correctPathLength(HParticleCand* pCand, HGeomVector& vertex, const HMdcPlane* planes, const HGeomVector& targetMidPoint, Double_t beamEnergy = 1230)
Bool_t checkCropedLayer(HGeantKine* kine, HMdcLayer* mdcLayer, Bool_t* croped = 0, Bool_t checkHit = kTRUE)
 this function checks for particle kine (and his decayed charged daughter it it exist)
 if the track is in the croped area of the layer. if the track has a hit
 but not in the layers to check (0 or 5, depending on first or last module in segment)
 it will be counted as croped if checkHit=kFALSE(default = kTRUE) otherwise not.
 The function returns true if any of the mdcs  was croped.
 if an pointer to Bool_t croped[4] is provided the crop results
 per module will be returned to the array.
Double_t beta(Int_t id, Double_t p)
 Id : see HPysicsConstants
 p [MeV/c]
 return beta
Double_t betaToP(Int_t id, Double_t beta)
 Id : see HPysicsConstants
 return p [MeV/c]
Double_t gamma(Int_t id, Double_t p)
 Id : see HPysicsConstants
 p [MeV/c]
 return gamma
Double_t gammaToBeta(Int_t id, Double_t gamma)
 Id : see HPysicsConstants
 return beta
Double_t gammaToP(Int_t id, Double_t gamma)
 Id : see HPysicsConstants
 return p [MeV/c]
Double_t betagamma(Int_t id, Double_t p)
 Id : see HPysicsConstants
 p [MeV/c]
 return beta*gamma
Double_t betagammaToP(Int_t id, Double_t betagamma)
 Id : see HPysicsConstants
 return  p [MeV/c]
Double_t kinEToMom(Int_t id = 14, Double_t Ekin = 3500)
 Id : see HPysicsConstants input kinetic energy
 return  p [MeV/c]
Double_t momToKinE(Int_t id = 14, Double_t p = 3500)
 Id : see HPysicsConstants
 return  kinetic energy [MeV]
Double_t dedxfunc(Double_t* x, Double_t* par)
 function of MdcDedx used in TF1
 par[0] Id : see HPysicsConstants
 par[1] scale return val
 par[2] shift x (after scaling)
 par[3] scale x
 par[4] option:   0:p,1:beta,2:gamma,3:betagamma
 par[5] theta [deg]: do dedx corr for fixed theta .if <=0 don't do anything
 par[6]; frac of dedx corr
 return MDC dEdx
Double_t betaandgammafunc(Double_t* x, Double_t* par)
 function of beta / gamma  used in TF1
 par[0] Id : see HPysicsConstants
 par[1] scale return val
 par[2] shift x (after scaling)
 par[3] scale x
 par[4] option:   0:beta,1:gamma,2:betagamma
 par[5] theta [deg]: do dedx corr for fixed theta .if <=0 don't do anything
 par[6]; frac of dedx corr
 return beta or gamma or betagamma
TCutG* makeCut(TF1* lower, TF1* upper, TString name, Double_t xlow, Double_t xup, Double_t ymin = -1000, Double_t ymax = 1000, Int_t npoint = 500, Int_t linecolor = 2, Int_t linestyle = 2)
 creates TCutG from upper and lower TF1 in range xlow to xup
 the x interval is splitted into npoints. User has to delete
 the TCutG objects
Double_t ptyfunc(Double_t* x, Double_t* par)
 return pt as function of y
 for fix theta or momenta of a particle
Double_t fcross(Double_t* xin, Double_t* par)
Bool_t getIntersectionPoint(TF1* f1, TF1* f2, Double_t& xout, Double_t& yout, Double_t xlow, Double_t xup, Int_t n = 500)
 calculates the intersection point of f1 and f2 in interval xlow,xup
 to vars xout, yout
 return kFALSE if no intersection was found (xout=yout=-10000)
 higher number of points n give better precision at the higher
 calculation time
TF1* energyLossTF1(Int_t id, TString name = "", TString opt = "p", Double_t scaleY = 1, Double_t xoffset = 0, Double_t scaleX = 1, Double_t theta = -1, Double_t frac = 0.1, Double_t xmin = 20, Double_t xmax = 2000, Int_t linecolor = 2, Int_t linestyle = 1, Int_t npoints = 500)
 MdcDedx TF1
 name :  name of TF1 (default dedx, the id of the paricle will be appended)
 opt  :  p beta gamma betagamma

 par[0] Id : see HPysicsConstants
 par[1] scale return val
 par[2] shift x (after scaling)
 par[3] scale x
 par[4] option:   0:p,1:beta,2:gamma,3:betagamma
 par[5] theta [deg]: do dedx corr for fixed theta .if <=0 don't do anything
 par[6] fraction of dedx corr
 return TF1
 The user has to delete the TF1 object
TF1* betaAndGammaTF1(Int_t id, TString name = "", TString opt = "beta", Double_t scaleY = 1, Double_t xoffset = 0, Double_t scaleX = 1, Double_t theta = -1, Double_t frac = 0.1, Double_t xmin = 20, Double_t xmax = 2000, Int_t linecolor = 2, Int_t linestyle = 1, Int_t npoints = 500)
 beta  / gamma  TF1
 name :  name of TF1 (default equals opt, the id of the paricle will be appended)
 opt  :  beta gamma betagamma

 par[0] Id : see HPysicsConstants
 par[1] scale return val
 par[2] shift x (after scaling)
 par[3] scale x
 par[4] option:   0:p,1:beta,2:gamma,3:betagamma
 par[5] theta [deg]: do dedx corr for fixed theta .if <=0 don't do anything
 par[6] fraction of dedx corr
 return TF1
 The user has to delete the TF1 object
TF1* ptyTF1(Int_t id, Double_t val = 45, TString name = "", TString opt = "theta", Double_t xmin = 0, Double_t xmax = 2, Double_t midRap = 0, Int_t linecolor = 2, Int_t linestyle = 1)
 ptY TF1
 name :  name of TF1 (default opt, the d of the paricle will be appended)
 opt  :  theta momentum

 par[0] Id : see HPysicsConstants
 par[1] val
 par[2] midRap (default 0)
 par[3] option:   0:theta,1:momentum
 return TF1
 The user has to delete the TF1 object
vector<TF1*> ptyGrid(Int_t id, vector<Double_t>& vtheta, vector<Double_t>& vmom, TString name = "", TString opt = "draw", Double_t xmin = 0, Double_t xmax = 2, Double_t midRap = 0, Int_t linecolorTheta = 1, Int_t linestyleTheta = 2, Int_t linecolorMom = 1, Int_t linestyleMom = 2)
 draws a pt -y grid for a give particle at given list of theta and momenta
 opt : draw drawcopy
 range xmin to xmax
 The created TF1 objects are return in a vector. The use has to delet them.
vector<TF1*> ptyGrid(Int_t id, TString setup = "@theta:8,0,10@momentum:20,10,100", TString name = "", TString opt = "draw", Double_t xmin = 0, Double_t xmax = 2, Double_t midRap = 0, Int_t linecolorTheta = 1, Int_t linestyleTheta = 2, Int_t linecolorMom = 1, Int_t linestyleMom = 2, TString labels = "@theta:draw=yes,format=%5.1f#circ,textsize=0.021,angle=0,align=-1@momentum:draw=yes,format=%5.1f MeV/c,textsize=0.023,angle=10,align=-1")
 Draw pt - y grid for particle id: lines for constant #theta and constant momentum

 setup:
 theta     :  format string "@theta:8,0,10"              : draw 8 lines starting from 0 deg with stepsize 10 deg
                            "@theta:-1,10,20,45,60,75"   : draw lines at list values (first entry has to be -1)
 momentum  :  format string "@momentum:8,100,200"        : draw 8 lines starting from 100 MeV/c with stepsize 200 MeV/c
                            "@momentum:-1,500,1000,1500" : draw lines at list values (first entry has to be -1)

 name      :  optional string for the name construction of TF1
 opt       :  ""            no draw
              "draw"        draw in current canvas
              "drawcopy"    draw a copy in current canvas
 xmin,xmax : rapidity range (default 0 - 2)
 midRap    : midRapidity    (default 0)
 linecolorTheta,lienstyleTheta : line attributes of theta    (default black,dashed)
 linecolorMom  ,lienstyleMom   : line attributes of momentum (default black,dashed)


 labels="@theta:draw=yes,format=%5.1f#circ,textsize=0.021,angle=0,align=-1@momentum:draw=yes,format=%5.1f MeV/c,textsize=0.023,angle=0,align=-1,yoff=0,02,xoff=0.01
      draw : yes (default)
     format: print format
   textsize: 0.021
     angle : 0
     align : -1(default: build in) sum of TTextAtributes:  kHAlignLeft   = 10, kHAlignCenter = 20, kHAlignRight = 30 ,kVAlignBottom = 1,  kVAlignCenter = 2,  kVAlignTop   = 3
      yoff : 0.02   offset from yaxis
      xoff : 0.01   offset from xaxis
void drawPtyGrid(vector<TF1*>& grid, TString opt = "draw")
 draws an already existing pt-y grid (see HParticleTool::ptyGrif())
 opt : draw drawcopy
void calcSegVector(Double_t z, Double_t rho, Double_t phi, Double_t theta, HGeomVector& base, HGeomVector& dir)
Double_t calcRMS(const Double_t* valArr, Double_t Mean, Int_t valNum)
 Calculates RMS of valNum numbers in valArr using the Mean of the values
Double_t calcDeterminant(HGeomVector& v1, HGeomVector& v2, HGeomVector& v3)
 calculating the Determinant of a 3 x 3 Matrix
 with the column vectors [v1, v2, v3]
 using the RULE of SARRUS

 | v1(0)   v2(0)   v3(0) |      | v1(0) v2(0) v3(0)|v1(0) v2(0)  .
 |                       |      |  \\     \\     X   |  /     /    .
 |                       |      |   \\     \\   / \\  | /     /     .
 |                       |      |    \\     \\ /   \\ |/     /      .
 |                       |      |     \\     X     \\/     /       .
 |                       |      |      \\   / \\    /\\    /        .
 |                       |      |       \\ /   \\  / |\\  /         .
 | v1(1)   v2(1)   v3(1) |   =  | v1(1) v2(1) v3(1)|v1(1) v2(1)  .
 |                       |      |       / \\    /\\  | /\\          .
 |                       |      |      /   \\  /  \\ |/  \\         .
 |                       |      |     /     \\/    \\/    \\        .
 |                       |      |    /      /\\    /\\     \\       .
 |                       |      |   /      /  \\  / |\\     \\      .
 |                       |      |  /      /    \\/  | \\     \\     .
 | v1(2)   v2(2)   v3(2) |      | v1(2) v2(2) v3(2)| v1(2) v2(2) .
                                 /      /     /  \\     \\     \\   .

                                -      -     -    +     +     +  .
Double_t calculateMinimumDistanceStraightToPoint(HGeomVector& base, HGeomVector& dir, HGeomVector& point)
calculates the minimum distance of a point to a straight
given as parametric straight x = base + n * dir
HGeomVector calculatePointOfClosestApproachStraightToPoint(HGeomVector& base, HGeomVector& dir, HGeomVector& point)
calculates the point of minimum distance of a point to a straight
given as parametric straight x = base + n * dir
Double_t calculateMinimumDistance(HGeomVector& base1, HGeomVector& dir1, HGeomVector& base2, HGeomVector& dir2)
 calculates the minimum distance of two tracks given
 as parametric straights x = base + n * dir
HGeomVector calculatePointOfClosestApproach(HGeomVector& base1, HGeomVector& dir1, HGeomVector& base2, HGeomVector& dir2)
  calculating point of closest approach

        from the equations of the straight lines of g and h
        g: x1 = base1 + l * dir1
        h: x2 = base2 + m * dir2

        you can construct the following planes:

        E1: e1 = base1  +  a * dir1  +  b * (dir1 x dir2)
        E2: e2 = base2  +  s * dir2  +  t * (dir1 x dir2)

        now the intersection point of E1 with g2 = {P1}
        and the intersection point of E2 with g1 = {P2}

        form the base points of the perpendicular to both straight lines.

        The point of closest approach is the middle point between P1 and P2:

        vertex = (p2 - p1)/2

        E1 ^ g2:

           e1 = x2
    -->    base1  +  a * dir1  +  b * (dir1 x dir2) = base2 + m * dir2
    -->    base1 - base2 = m * dir2  -  a * dir1  -  b * (dir1 x dir2)
                                          (m)
    -->    [ dir2, -dir1, -(dir1 x dir2)] (a) = base1 - base2
                                          (b)

           using CRAMER's RULE you can find the solution for m (a,b, not used)

           using the rules for converting determinants:

           D12 = det [dir2, -dir1, -(dir1 x dir2)]
               = det [dir2,  dir1,  (dir1 x dir2)]

           Dm  = det [base1 - base2, -dir1, -(dir1 x dir2)]
               = det [base1 - base2,  dir1,  (dir1 x dir2)]

            m  = Dm/D12

           P1: p1 = x2(m)
                  = base2 + Dm/D12 * dir2

        E2 ^ g1:

           e2 = x1
    -->    base2  +  s * dir2  +  t * (dir1 x dir2) = base1 + l * dir1
    -->    base2 - base1 = l * dir1  -  s * dir2  -  t * (dir1 x dir2)
                                          (l)
    -->    [ dir1, -dir2, -(dir1 x dir2)] (s) = base2 - base1
                                          (t)

           again using CRAMER's RULE you can find the solution for m (a,b, not used)

           using the rules for converting determinants:

           D21 =  det [dir1, -dir2, -(dir1 x dir2)]
               =  det [dir1,  dir2,  (dir1 x dir2)]
               = -det [dir2,  dir1,  (dir1 x dir2)]
               = -D12

           Dl  =  det [base2 - base1, -dir2, -(dir1 x dir2)]
               =  det [base2 - base1,  dir1,  (dir1 x dir2)]
               = -det [base1 - base2,  dir1,  (dir1 x dir2)]

            l  =   Dl/D21
               = - Dl/D12

           P2: p2 = x1(m)
                  = base1 - Dl/D12 * dir1


           vertex = p1 + 1/2 * (p2 - p1)
                  = 1/2 * (p2 + p1)
                  = 1/2 *( (base1 + base2) +  1/D12 * ( Dm * dir2 - Dl * dir1) )

HGeomVector calculateCrossPoint(HGeomVector& base1, HGeomVector& dir1, HGeomVector& base2, HGeomVector& dir2)
 calculating cross point
 taking all three equations into account solving the overdetermined set of lin. equations
 of
 base1 + l * dir2 =  base1 + m * dir2

 set of lin. equations:

   base1(0) + l * dir1(0) = base2(0) + m * dir2(0)
   base1(1) + l * dir1(1) = base2(1) + m * dir2(1)
   base1(2) + l * dir1(2) = base2(2) + m * dir2(2) this line is ignored

   written in matrix form

        l \\                                                                  .
   M * |   | = base2 - base1
\\ m

   M is a 3x2 matrix

 to solve multiply the equation by the transposed Matrix of M from the left: M

  T      /  l \\                                                               .
 M * M * |    | = M  * (base2 - base1)
\\ -m
 MIND THE '-' of m

     / dir1(0) dir2(0) \\                                                      .
     |                 |    T   / dir1(0) dir1(1) dir1(2) \\                   .
 M = | dir1(1) dir2(1) |,  M  = |                         |
     |                 |        \\ dir2(0) dir2(1) dir2(2) /                   .
\\ dir1(2) dir2(2)

  T      / (dir1(0)*dir1(0) + dir1(1)*dir1(1) + dir1(2)*dir1(2))   (dir1(0)*dir2(0) + dir1(1)*dir2(1) + dir1(2)*dir2(2))  \\ .

 M * M = |                                                                                                                |

\\ (dir1(0)*dir2(0) + dir1(1)*dir2(1) + dir1(2)*dir2(2))   (dir2(0)*dir2(0) + dir2(1)*dir2(1) + dir2(2)*dir2(2))


  T       / d1d1 d1d2 \\                           .
 M  * M = |           |
\\ d1d2 d2d2

 diff = base2 - base1

  T           /  (dir1(0)*diff(0) + dir1(1)*diff(1) + dir1(2)*diff(2)) \\         .
 M  * diff =  |                                                        |
\\  (dir2(0)*diff(0) + dir2(1)*diff(1) + dir2(2)*diff(2))

  T           /  d1diff  \\                                          .
 M  * diff =  |          |
\\  d2diff

 now the new Matrix set is to be solved by CRAMER'S Rule:

 / d1d1 d1d2 \\   /  l \\   /  d1diff \\                   .
 |           | * |    | = |          |
\\ d1d2 d2d2 /   \\ -m /   \\  d2diff

     | d1d1 d1d2 |
 D = |           | = d1d1*d2d2 - d1d2*d1d2;
     | d1d2 d2d2 |

     | d1diff d1d2 |
 Dl= |              | = d1diff*d2d2 - d1d2*d2diff;
     | d2diff d2d2 |

 l = Dl/D = l_cross

 vertex = base1 + l_cross * dir1

HGeomVector calcVertexAnalytical(HGeomVector& base1, HGeomVector& dir1, HGeomVector& base2, HGeomVector& dir2)
 Calculates the Vertex of two straight lines defined by the vectors base and dir

      g: x1 = base1 + l * dir1
      h: x2 = base2 + m * dir2 , where l,m are real numbers
                                   h
 1. are g and h
       parallel / identical, i.e. are dir1 and dir2 linear dependent?

                                        /-
                                        |
                                        |   = 0    linear dependent, no unique solution, returning dummy
      => cross product : dir1 x dir2 = -|
                                        |  != 0    linear independent
                                        |
                                        \\-

 2. are g and h
       skew or do they have a crossing point, i.e are dir1, dir2 and (base1 - base2) linear dependent ?

                                                    /-
                                                    |
                                                    |   = 0    linear dependent
                                                    |          g and h are intersecting
                                                    |          calculating vertex as point of intersection
                                                    |
    => determinant: det[ dir1, dir2, base1-base2]= -|
                                                    |  != 0    linear independent
                                                    |          g and h are skew
                                                    |          calulating vertex as point of closest approach
                                                    |
                                                    \\-

 3.
    (a) calculating intersection point
    (b) calculating point of closest approach
Int_t findFirstHitInTof(Int_t trackID, Int_t modeTrack = 2)
 find the first track ID entering the TOF
 Used to suppress the secondaries created in the
 TOF itself.
        0 = realistic (secondaries included)
        1 primary particle is stored
        2 (default) the first track number entering the tof in SAME SECTOR is stored
        3 as 2 but condition on SAME SECTOR && MOD
        4 as 2 but SAME SECTOR && MOD && ROD
Int_t findFirstHitShowerInTofino(Int_t trackID, Int_t modeTrack = 2)
 Used to suppress the secondaries created in the
 SHOWER itself.
        0 = realistic (secondaries included)
        1 primary particle is stored
        2 the first track number entering the SHOWER in SAME SECTOR is stored
        3 the first track number entering the TOFINO in SAME SECTOR is stored
          or the primary track if no TOFINO was found
        4 (default) the first track number entering the TOFINO in SAME SECTOR is stored
          or the first track in SHOWER if no TOFINO was found
Int_t findFirstHitShowerInRpc(Int_t trackID, Int_t modeTrack = 2)
 Used to suppress the secondaries created in the
 SHOWER itself.
        0 = realistic (secondaries included)
        1 primary particle is stored
        2 the first track number entering the SHOWER in SAME SECTOR is stored
        3 the first track number entering the RPC in SAME SECTOR is stored
          or the primary track if no RPC was found
        4 (default) the first track number entering the RPC in SAME SECTOR is stored
          or the first track in SHOWER if no RPC was found
Float_t getInterpolatedValue(TH1* h, Float_t xVal, Bool_t warn = kTRUE)
 retrieve content of 1-dim Hist corresponding to x val.
 The values will be linear interpolated. If warn == kTRUE
 warning will be emitted if the xval is out of the range
 of the hist. In case the value is out of range the value
 of first or last bin will be returned respectively.
Stat_t getValue(TH1* h, Float_t xVal, Float_t yVal = 0.0f, Float_t zVal = 0.0f)
 retrieve value from Histogram (1,2 and 3 dim) corresponding
 to x val, y val and z val.  If the values are out of range of
 the histogram axis the lowest/highest bin of the axis will be
 used. No interpolation performed.
HRichHit* getRichHit(Int_t richind)
 return HRichHit pointer from the object index
 in the category. In case of no success returns NULL
HTofHit* getTofHit(Int_t tofind)
 return HTofHit pointer from the object index
 in the category. In case of no success returns NULL
HTofCluster* getTofCluster(Int_t tofind)
 return HTofCluster pointer from the object index
 in the category. In case of no success returns NULL
HRpcCluster* getRpcCluster(Int_t rpcind)
 return HRpcCluster pointer from the object index
 in the category. In case of no success returns NULL
HShowerHit* getShowerHit(Int_t showerind)
 return HShowerHit pointer from the object index
 in the category. In case of no success returns NULL
HEmcCluster* getEmcCluster(Int_t emcind)
 return HEmcCluster pointer from the object index
 in the category. In case of no success returns NULL
HMetaMatch2* getMetaMatch(Int_t metaind)
 return HMetaMatch2 pointer from the object index
 in the category. In case of no success returns NULL
HMdcTrkCand* getMdcTrkCand(Int_t metaind)
 return HMdcTrkCand pointer from the object index of MetaMatch2
 in the category (indMeta->HMetaMatch2->HMdcTrkCand). In case of
 no success returns NULL
HMdcSeg* getMdcSeg(Int_t segind)
 return HMdcSeg pointer from the object index
 in the category. In case of no success returns NULL
HMdcHit* getMdcHit(Int_t segind, Int_t nhit = 0)
 return HMdcHit pointer from the object index of HMdcSeg
 in the category (indSeg->HMdcSeg->HMdcHit). nhit (0 or 1)
 is the number of the hit inside the segment which should
 be retrived. In case of no success returns NULL
HMdcClusInf* getMdcClusInf(Int_t segind, Int_t nhit = 0)
 return HMdcClusInf pointer from the object index of HMdcSeg
 in the category (indSeg->HMdcSeg->HMdcClusInf). nhit (0 or 1)
 is the number of the hit inside the segment which should
 be retrived. In case of no success returns NULL
HMdcClusFit* getMdcClusFit(Int_t segind)
 return HMdcClusFit pointer from the object index of HMdcSeg
 in the category (indSeg->HMdcSeg->HMdcClsuInf->HMdcClusFit).
 In case of no success returns NULL
HMdcClus* getMdcClus(Int_t segind)
 return HMdcClus pointer from the object index of HMdcSeg
 in the category (indSeg->HMdcSeg->HMdcClus).
 In case of no success returns NULL
TObjArray* getMdcWireFitSeg(Int_t segind)
 return TObjArray pointer to an array of HMdcWireFit
 pointer from the object index of HMdcSeg
 in the category (indSeg->HMdcSeg->HMdcClusInf->HMdcClusFit->HMdcWireFit).
 The user has to delete the TObjArray object
 (not the content) by himself.
Int_t getMdcWireFitSeg(Int_t segind, vector<HMdcWireFit*>& v, Bool_t clear = kTRUE)
 fill vector of HMdcWireFit
 pointer from the object index of HMdcSeg
 in the category (indSeg->HMdcSeg->HMdcClusInf->HMdcClusFit->HMdcWireFit).
 The user has to delete the TObjArray object
 (not the content) by himself. Returns the number of
 collected objects .the vector will be cleared
 if clear=kTRUE
TObjArray* getMdcCal1Seg(Int_t segind)
 return TObjArray pointer to an array of HMdcCal1
 pointer from the object index of HMdcSeg
 in the category (indSeg->HMdcSeg->HMdcCal1).
 user has to delete the TObjArray object
 (not the content) by himself.
Int_t getMdcCal1Seg(Int_t segind, vector<HMdcCal1*>& v, Bool_t clear = kTRUE)
 fill vector of HMdcCal1
 pointer from the object index of HMdcSeg
 in the category (indSeg->HMdcSeg->HMdcCal1).
 user has to delete the TObjArray object
 (not the content) by himself. Returns number
 of collected objects. the vector will be cleared
 if clear=kTRUE
TObjArray* getMdcCal1Cluster(Int_t segind)
 return TObjArray pointer to an array of HMdcCal1
 pointer from the object index of HMdcSeg
 in the category (indSeg->HMdcSeg->HMdcClus->HMdcCal1).
 user has to delete the TObjArray object
 (not the content) by himself.
Int_t getMdcCal1Cluster(Int_t segind, vector<HMdcCal1*>& v, Bool_t clear = kTRUE)
 fill vector of HMdcCal1
 pointer from the object index of HMdcSeg
 in the category (indSeg->HMdcSeg->HMdcClus->HMdcCal1).
 user has to delete the TObjArray object
 (not the content) by himself. Returns the number
 of collected objects. The vector will be cleared
 if clear=kTRUE
Bool_t getSimTracks(HParticleCandSim* c, vector<Int_t>& tracksMeta, vector<Int_t>& tracksShowerEcal, vector<Int_t>& tracksRich, vector<Int_t>& weightRich, vector<Int_t>& tracksInnerMdc, vector<Int_t>& weightInnerMdc, vector<Int_t>& tracksOuterMdc, vector<Int_t>& weightOuterMdc, Bool_t print = kFALSE)
Bool_t printSimTracks(HParticleCandSim* c)
Bool_t setPairFlags(UInt_t& flag, HParticleCand* cand2 = 0, HParticleCand* cand1 = 0)
 evalutates the bitwise flags defined in eClosePairSelect (hparticledef.h)
 for cand1 (reference for closePair) and cand2. cand1 can be NULL, the comparison
 for same detector hits will be skipped then.

Bool_t evalPairsFlags(UInt_t flag, UInt_t fl)
 evalutates the bitwise flags defined in flag (see eClosePairSelect + ePairCase (hparticledef.h)
 against fl. return kTRUE if all set bit in flag are set in fl too.
Bool_t isPairsFlagsBit(UInt_t flag, UInt_t fl)
 evalutates the bitwise flags defined fl (see eClosePairSelect + ePairCase (hparticledef.h))
 return kTRUE if all set bits in fl are set in flags too
Bool_t evalPairsFlags(UInt_t flag, HParticleCand* cand1, HParticleCand* cand2)
Bool_t evalPairsFlags(UInt_t flag, HParticlePair& pair)
Bool_t evalPairsFlags(vector<UInt_t>& flags, vector<Bool_t>& results, HParticlePair& pair)
 evalutates the bitwise flags defined in eClosePairSelect + ePairCase (hparticledef.h)
 return kTRUE if one of the flags in vector flags are identical. The result for
 each individual flag is store in vector results (which will be automaticly cleared before).
Bool_t evalPairsFlags(vector<UInt_t>& flags, HParticlePair& pair)
 evalutates the bitwise flags defined in eClosePairSelect + ePairCase (hparticledef.h)
 return kTRUE if one of the flags in vector flags are identical.
Bool_t isGoodClusterVertex(Float_t minZ)
 request good chi2 and a z pos > minZ (apr12 typically -65 mm, jul14/aug14 -200)
 minZ is given in mm
 if minZ > 0 gHades is used to retrieve the beamTimeID default values
Bool_t isGoodRecoVertex(Float_t minZ)
 request good chi2 and a z pos > minZ (apr12 typically -65 mm)
 minZ is given in mm. For good chi2 at least 2 particle cands are needed.
 if minZ > 0 gHades is used to retrieve the beamTimeID default values
Bool_t isGoodSTART(Int_t minFlag)
 request existing start hit object and starthit->getCorrFlag()>=minFlag
 REMARK : corrFlags are filled by HParticleStart2HitF (-1,0,1,2).
 In this case HStart2Hit::getIteration() (0,1,2) gives 2. For Iteration
 <2 corrFlags are not checked
 return kFALSE if category is not available
Bool_t isNoVETO(Float_t minStart = -15., Float_t maxStart = 15.)
 return kTRUE if no VETO hit inside timewindow minStart-maxStart [ns]
 relative to starttime was found. otherwise kFALSE.
 requires  catStart2Cal catStart2Hit
 return kFALSE if category is not available
Bool_t isNoSTART(Float_t minStart = -15., Float_t maxStart = 15., Float_t window = 1.)
 return kTRUE if no START hit inside timewindow minStart-maxStart [ns] of the
 START time was found. otherwise kFALSE. (startime +- window excluded)
 requires catStart2Hit and catStart2Cal
 return kFALSE if categories are not available
Bool_t isGoodSTARTVETO(Float_t minStart = 15., Float_t maxStart = 350., Float_t window = 1.)
 return kTRUE is no starthit between minStart [ns] and maxStart [ns]
 has been found which has no correlation with VETO inside window [ns]
 +-window arround starthit startime is excluded.
 requires catStart2Hit + catStart2Cal category. If the categories are
 not available kFALSE  is returned.
Bool_t isGoodSTARTMETA(Float_t minStart = 80., Float_t maxStart = 350., Int_t tresh = 4, Float_t window = 5., Float_t offset = 7.)
 search for metahits inside the event which are correlated with
 late starthits.
 return kTRUE if in range minStart [ns] to maxStart [ns] of START Hits
 not more than tresh metahits inside correlation window [ns] are found.
 offset [ns](apr12 = 7) has to be adjusted to move the fastest particles
 of good triggered event to 0.
 requires catRpcHit, catTofHit, catStart2Cal, catStart2Hit. if any of those is missing kFALSE
 is returned.
Bool_t isNoSTARTPileUp()
 request existing start hit object and starthit->getMultiplicity()==1
 return kFALSE if categories are not available
Bool_t isNoMETAPileUp(Float_t ftimeTofCut, Int_t threshold)
 loops TofHit and RpcCluster and counds objects with tof < 0
 or tof > ftimeTofCut. if n > threshold (pileup) kFALSE is returned
 if tofhit and rpccluster cateories are not available kTRUE is returned
 if threshold < 0 gHades is used to retrieve the beamTimeID default values
Bool_t isGoodTrigger(Int_t triggerbit)
 test if the triggerbit is set ( bit number is pt (physics trigger) + 10)
 example : pt3 -> 13
 if triggerbit < 0 gHades is used to retrieve the beamTimeID default values
Int_t getTofHitMult(Float_t minTof = 0, Float_t maxTof = 35., Int_t* sector = 0)
 return the TofHit multiplicity between minTof and maxTof. if sector
 (pointer to Int_t sector[6]) is not NULL sectorwise mult is filled.
 the array is rest to 0 before. requires catTofHit
Int_t getRpcHitMult(Float_t minTof = 0, Float_t maxTof = 25., Int_t* sector = 0)
 return the RpcHit multiplicity between minTof and maxTof. if sector
 (pointer to Int_t sector[6]) is not NULL sectorwise mult is filled.
 the array is rest to 0 before. requires catRpcHit.
HParticleTool()
Double_t getMinimumDistToVertex(HParticleCand* , HGeomVector& vertex)
HGeomVector getPointOfClosestApproachToVertex(HParticleCand* , HGeomVector& vertex)
TF1* getScaleTF1()
{ return gScaledy ;}
TF1* getTofXOffsetTF1()
{return fdxoffset;}
TF1* getTofXSigmaTF1()
{return fdxsigma ;}