#ifndef HGEANTKINE_H
#define HGEANTKINE_H
#include "TMath.h"
#include "TObject.h"
#include "hades.h"
#include "hdataobject.h"
#include "hrecevent.h"
#include "hgeomvector.h"
class HLinkedDataObject;
class HCategory;
class HLinearCategory;
class HGeantKine : public TObject
{
private:
Int_t richIndex;
Int_t mdcIndex;
Int_t tofIndex;
Int_t rpcIndex;
Int_t showIndex;
Int_t wallIndex;
HCategory* pRich;
HCategory* pMdc;
HCategory* pTof;
HCategory* pRpc;
HCategory* pShow;
HCategory* pWall;
protected:
Int_t trackNumber;
Int_t parentTrack;
Int_t particleID;
Int_t mediumNumber;
Int_t creationMechanism;
Float_t xVertex;
Float_t yVertex;
Float_t zVertex;
Float_t xMom;
Float_t yMom;
Float_t zMom;
Float_t generatorInfo;
Float_t generatorInfo1;
Float_t generatorInfo2;
Float_t generatorWeight;
Short_t firstRichHit;
Short_t firstMdcHit;
Short_t firstTofHit;
Short_t firstRpcHit;
Short_t firstShowerHit;
Short_t firstWallHit;
Bool_t active;
Bool_t suppressed;
Float_t userVal;
public:
HGeantKine(void);
HGeantKine(HGeantKine &aKine);
~HGeantKine(void);
void setParticle(Int_t aTrack, Int_t aID);
void setCreator(Int_t aPar, Int_t aMed, Int_t aMech);
void setVertex(Float_t ax, Float_t ay, Float_t az);
void setMomentum(Float_t apx, Float_t apy, Float_t apz);
void setGenerator(Float_t aInfo, Float_t aWeight);
void setGenerator(Float_t aInfo, Float_t aInfo1, Float_t aInfo2);
void setWeight(Float_t aWeight) {generatorWeight = aWeight;}
void getParticle(Int_t &aTrack, Int_t &aID);
void getCreator(Int_t &aPar, Int_t &aMed, Int_t &aMech);
void getVertex(Float_t &ax, Float_t &ay, Float_t &az);
void getMomentum(Float_t &apx, Float_t &apy, Float_t &apz);
inline Int_t getTrack(void) const { return trackNumber; }
inline Int_t getID(void) const { return particleID; }
inline Int_t getParentTrack(void) const { return parentTrack; }
inline void setParentTrack(Int_t track) { parentTrack = track; }
void setNewTrackNumber(Int_t track);
Float_t getTotalMomentum2(void) const { return xMom*xMom + yMom*yMom + zMom*zMom; }
Float_t getTotalMomentum(void) const { return TMath::Sqrt(getTotalMomentum2()); }
Float_t getTransverseMomentum(void) const { return TMath::Sqrt(xMom*xMom + yMom*yMom); }
Int_t getPhiThetaDeg(Float_t& theta,Float_t& phi, Bool_t labSys = kTRUE);
void getMomentum(HGeomVector &v) { v.setXYZ(xMom, yMom, zMom); }
void getGenerator(Float_t &aInfo, Float_t &aWeight);
void getGenerator(Float_t &aInfo, Float_t &aInfo1, Float_t &aInfo2);
inline void setActive(Bool_t flag=kTRUE) {active=flag;}
inline void setSuppressed(Bool_t flag=kTRUE) {suppressed=flag;}
inline void setUserVal(Float_t val) {userVal=val;}
inline Bool_t isActive(void) const {return active;}
inline Bool_t isPrimary(void) const {return (parentTrack==0);}
inline Bool_t isSuppressed(void) const {return suppressed;}
inline Float_t getUserVal(void) const {return userVal;}
Bool_t hasAncestor(Int_t track, HLinearCategory* cat=NULL);
static Bool_t setChainActive(Int_t track, Bool_t flag=kTRUE, HLinearCategory* cat=NULL);
static Bool_t setAllDescendentsActive(Int_t track, Bool_t flag=kTRUE, HLinearCategory* cat=NULL);
static Bool_t setAllDescendentsSuppressed(Int_t track, Bool_t flag=kTRUE, HLinearCategory* cat=NULL);
static HGeantKine* getParent(Int_t track, HLinearCategory* cat=NULL);
static HGeantKine* getGrandParent(Int_t track, HLinearCategory* cat=NULL);
static HGeantKine* getPrimary(Int_t track, HLinearCategory* cat=NULL);
static HGeantKine* getCommonAncestor(Int_t track1, Int_t track2, HLinearCategory* cat=NULL);
static Bool_t suppressTracks(Int_t id, Float_t acceptedFraction, HLinearCategory* cat=NULL);
inline Int_t setRichHitIndex(Int_t index);
inline Int_t setMdcHitIndex(Int_t index);
inline Int_t setTofHitIndex(Int_t index);
inline Int_t setRpcHitIndex(Int_t index);
inline Int_t setShowerHitIndex(Int_t index);
inline Int_t setWallHitIndex(Int_t index);
Int_t getNRichHits(void);
Int_t getFirstRichHit() {return firstRichHit;}
Int_t getNMdcHits(void);
Int_t getFirstMdcHit() {return firstMdcHit;}
Int_t getNMdcHits(Int_t module);
Int_t getNTofHits(void);
Int_t getFirstTofHit() {return firstTofHit;}
Int_t getNRpcHits(void);
Int_t getFirstRpcHit() {return firstRpcHit;}
Int_t getNShowerHits(void);
Int_t getFirstShowerHit() {return firstShowerHit;}
Int_t getNWallHits(void);
Int_t getFirstWallHit() {return firstWallHit;}
void sortRichHits(void);
void sortMdcHits(void);
void sortTofHits(void);
void sortRpcHits(void);
void sortShowerHits(void);
void sortWallHits(void);
Int_t getSystem(void);
Int_t getSector(void);
UInt_t getMdcSectorBitArray(void);
UInt_t getMdcSectorDecimalArray(void);
UInt_t getShowerSectorBitArray(void);
UInt_t getShowerSectorDecimalArray(void);
UInt_t getTofSectorBitArray(void);
UInt_t getTofSectorDecimalArray(void);
UInt_t getRpcSectorBitArray(void);
UInt_t getRpcSectorDecimalArray(void);
UInt_t getRichSectorBitArray(void);
UInt_t getRichSectorDecimalArray(void);
UInt_t getSectorBitArray(void);
UInt_t getSectorDecimalArray(void);
inline HLinkedDataObject* nextRichHit();
inline HLinkedDataObject* nextMdcHit();
inline HLinkedDataObject* nextTofHit();
inline HLinkedDataObject* nextRpcHit();
inline HLinkedDataObject* nextShowerHit();
inline HLinkedDataObject* nextWallHit();
inline void setRichCategory(HCategory* p) {pRich = p;}
inline void setMdcCategory(HCategory* p) {pMdc = p;}
inline void setTofCategory(HCategory* p) {pTof = p;}
inline void setRpcCategory(HCategory* p) {pRpc = p;}
inline void setShowerCategory(HCategory* p) {pShow = p;}
inline void setWallCategory(HCategory* p) {pWall = p;}
inline void resetRichIter(void);
inline void resetMdcIter(void);
inline void resetTofIter(void);
inline void resetRpcIter(void);
inline void resetShowerIter(void);
inline void resetWallIter(void);
private:
Int_t setHitIndex(HCategory* p, Short_t& first, Int_t index);
HLinkedDataObject* nextHit(HCategory* p, Int_t& next);
ClassDef(HGeantKine,8)
};
inline Int_t HGeantKine::setRichHitIndex(Int_t index) {
resetRichIter();
return setHitIndex(pRich,firstRichHit,index);
}
inline Int_t HGeantKine::setMdcHitIndex(Int_t index) {
resetMdcIter();
return setHitIndex(pMdc,firstMdcHit,index);
}
inline Int_t HGeantKine::setTofHitIndex(Int_t index) {
resetTofIter();
return setHitIndex(pTof,firstTofHit,index);
}
inline Int_t HGeantKine::setRpcHitIndex(Int_t index) {
resetRpcIter();
return setHitIndex(pRpc,firstRpcHit,index);
}
inline Int_t HGeantKine::setShowerHitIndex(Int_t index) {
resetShowerIter();
return setHitIndex(pShow, firstShowerHit,index);
}
inline Int_t HGeantKine::setWallHitIndex(Int_t index) {
resetWallIter();
return setHitIndex(pWall, firstWallHit,index);
}
inline HLinkedDataObject* HGeantKine::nextRichHit() {
return nextHit(pRich,richIndex);
}
inline HLinkedDataObject* HGeantKine::nextMdcHit() {
return nextHit(pMdc,mdcIndex);
}
inline HLinkedDataObject* HGeantKine::nextTofHit() {
return nextHit(pTof,tofIndex);
}
inline HLinkedDataObject* HGeantKine::nextRpcHit() {
return nextHit(pRpc,rpcIndex);
}
inline HLinkedDataObject* HGeantKine::nextShowerHit() {
return nextHit(pShow,showIndex);
}
inline HLinkedDataObject* HGeantKine::nextWallHit() {
return nextHit(pWall,wallIndex);
}
inline void HGeantKine::resetRichIter(void) {
richIndex = (Int_t)firstRichHit;
if(!pRich) pRich = ((HRecEvent*)gHades->getCurrentEvent())
->getCategory(catRichGeantRaw);
}
inline void HGeantKine::resetMdcIter(void) {
mdcIndex = (Int_t)firstMdcHit;
if(!pMdc) pMdc = ((HRecEvent*)gHades->getCurrentEvent())
->getCategory(catMdcGeantRaw);
}
inline void HGeantKine::resetTofIter(void) {
tofIndex = (Int_t)firstTofHit;
if(!pTof) pTof = ((HRecEvent*)gHades->getCurrentEvent())
->getCategory(catTofGeantRaw);
}
inline void HGeantKine::resetRpcIter(void) {
rpcIndex = (Int_t)firstRpcHit;
if(!pRpc) pRpc = ((HRecEvent*)gHades->getCurrentEvent())
->getCategory(catRpcGeantRaw);
}
inline void HGeantKine::resetShowerIter(void) {
showIndex = (Int_t)firstShowerHit;
if(!pShow) pShow = ((HRecEvent*)gHades->getCurrentEvent())
->getCategory(catShowerGeantRaw);
}
inline void HGeantKine::resetWallIter(void) {
wallIndex = (Int_t)firstWallHit;
if(!pWall) pWall = ((HRecEvent*)gHades->getCurrentEvent())
->getCategory(catWallGeantRaw);
}
#endif /*! HGEANTKINE_H */
Last change: Sat May 22 12:55:52 2010
Last generated: 2010-05-22 12:55
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.