Commit f635601e authored by J.Dudouet [IPNL/CSNSM]'s avatar J.Dudouet [IPNL/CSNSM]
Browse files

Set the max number of hits in trakedhit at 800 (as in oft tracking)


git-svn-id: svn+ssh://anonsvn.in2p3.fr/agata/gammaware/trunk@2226 c3abf467-7ff2-0310-b516-c5fb849bdde0
parent bb0a04f1
...@@ -18,373 +18,30 @@ ...@@ -18,373 +18,30 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
/** @file Hits.h header file for Hits.cpp */ /** \file Hits.cpp compiled in libGWADF.so */
#ifndef ADF_Hits #include "Hits.h"
#define ADF_Hits
#include "StackOfObjects.h" using namespace ADF;
namespace ADF
{
//! Base class for a Hit
/*!
A Hit is an energy deposited in a given position
*/
class Hit
{
public:
//!
Hit()
{;}
//!
virtual ~Hit()
{;}
//! to fully copy a Hit into another one. In principle, no need to overwritte it as soon as the interface is this
virtual void SetHit(const Hit &);
virtual void SetX(Double_t)
{;}
virtual void SetY(Double_t)
{;}
virtual void SetZ(Double_t)
{;}
virtual Double_t GetX() const
{return 0.0;}
virtual Double_t GetY() const
{return 0.0;}
virtual Double_t GetZ() const
{return 0.0;}
virtual void SetXYZ(Double_t, Double_t, Double_t)
{;}
virtual void GetXYZ(Double_t &x, Double_t &y, Double_t &z) const
{ x = y = z = 0.0; }
virtual Double_t GetE() const
{return 0.0;}
virtual void SetE(Double_t)
{;}
virtual Double_t GetT() const
{return 0.0;}
virtual void SetT(Double_t)
{;}
virtual void SetDX(Double_t)
{;}
virtual void SetDY(Double_t)
{;}
virtual void SetDZ(Double_t)
{;}
virtual Double_t GetDX() const
{return 0.0;}
virtual Double_t GetDY() const
{return 0.0;}
virtual Double_t GetDZ() const
{return 0.0;}
virtual void SetDXYZ(Double_t, Double_t, Double_t)
{;}
virtual void GetDXYZ(Double_t &dx, Double_t &dy, Double_t &dz) const
{dx = dy = dz = 0.0;}
virtual Double_t GetDE() const
{return 0.0;}
virtual void SetDE(Double_t)
{;}
virtual Double_t GetDT() const
{return 0.0;}
virtual void SetDT(Double_t)
{;}
virtual UShort_t GetStatus() const
{return 0u;}
virtual void SetStatus(UShort_t)
{;}
virtual Int_t GetID(Int_t = 0) const
{return 0;}
virtual void SetID(Int_t, Int_t = 0)
{;}
virtual void Reset() = 0;
};
//!
/*!
*/
class EHit : public Hit
{
private:
Double32_t fX; // X position
Double32_t fY; // Y position
Double32_t fZ; // Z position
Double32_t fE; // Energy
public:
//!
EHit() :
fX(0.0), fY(0.0), fZ(0.0), fE(0.0) {;}
virtual ~EHit()
{;}
virtual void SetX(Double_t x)
{fX=x;}
virtual void SetY(Double_t y)
{fY=y;}
virtual void SetZ(Double_t z)
{fZ=z;}
virtual Double_t GetX() const
{return fX;}
virtual Double_t GetY() const
{return fY;}
virtual Double_t GetZ() const
{return fZ;}
virtual void SetXYZ(Double_t x, Double_t y, Double_t z)
{ fX=x; fY=y; fZ=z; }
virtual void GetXYZ(Double_t &x, Double_t &y, Double_t &z) const
{ x=fX; y=fY; z = fZ; }
virtual Double_t GetE() const
{return fE;}
virtual void SetE(Double_t e)
{fE = e;}
virtual void Reset()
{ fX = fY = fZ = fE = 0.0 ;}
};
//! ETHit
/*!
*/
class ETHit : public EHit
{
private:
Double32_t fT; // Time
public: void Hit::SetHit(const Hit &ahit)
//!
ETHit() :
EHit(), fT(0.0) {;}
virtual ~ETHit()
{;}
virtual Double_t GetT() const
{return fT;}
virtual void SetT(Double_t t)
{ fT = t; }
virtual void Reset()
{ EHit::Reset(); fT = 0.0; }
};
//!
/*!
*/
class FullHit : public ETHit
{
private:
Double32_t fDX; // Error on X
Double32_t fDY; // Error on Y
Double32_t fDZ; // Error on Z
Double32_t fDE; // Error on E
Double32_t fDT; // Error on T
public:
//!
FullHit() : ETHit(), fDX(0.0), fDY(0.0), fDZ(0.0), fDE(0.0), fDT(0.0)
{;}
virtual ~FullHit()
{;}
virtual void SetDX(Double_t dx)
{ fDX=dx; }
virtual void SetDY(Double_t dy)
{ fDY=dy; }
virtual void SetDZ(Double_t dz)
{ fDZ=dz; }
virtual Double_t GetDX() const
{return fDX;}
virtual Double_t GetDY() const
{return fDY;}
virtual Double_t GetDZ() const
{return fDZ;}
virtual void SetDXYZ(Double_t dx, Double_t dy, Double_t dz)
{ fDX=dx; fDY=dy; fDZ=dz; }
virtual void GetDXYZ(Double_t &dx, Double_t &dy, Double_t &dz) const
{ dx=fDX; dy=fDY; dz = fDZ; }
virtual Double_t GetDE() const
{return fDE;}
virtual void SetDE(Double_t de)
{ fDE = de;}
virtual Double_t GetDT() const
{return fDT;}
virtual void SetDT(Double_t dt)
{ fDT = dt; }
virtual void Reset()
{ ETHit::Reset(); fDX = fDY = fDZ = fDE = fDT = 0.0; }
};
//! It is a hit associated to a list of Hits
/*!
For gamma-ray tracking, the hit represents the tracked gamma-ray.
It gives then the first interaction point and the reconstructed energy.
Depending of the algorithms, it can also be a mean value of the track.
The list of hits composing the track is also available through the methods
GetNbHits, NewHit and GetHit
*/
class TrackedHit : public Hit
{ {
private: // position
UShort_t fType; SetXYZ(ahit.GetX(),ahit.GetY(),ahit.GetZ());
// error on position
public: SetDXYZ(ahit.GetDX(),ahit.GetDY(),ahit.GetDZ());
enum {kUndef, kSingle, kCompton, kPair};
public:
TrackedHit(): fType(0)
{;}
virtual ~TrackedHit()
{;}
//! It returns the number of hits for this tracked particle
virtual UShort_t GetNbHits() const = 0;
//! Add a new hit to the track (filling mode). The Stack is emptied by calling Reset
virtual Hit *NewHit() = 0;
//! Get Hit number i of the track (already added with NewHit !!)
virtual Hit *GetHit(UInt_t i = 0) const = 0;
virtual UShort_t GetType() const
{return fType;}
virtual void SetType(UShort_t s)
{fType = s;}
};
//! Concrete implementation of a tracked Hit
/*!
*/
template <typename Hit_T, typename HitTrack_T>
class TrackedHitImp : public TrackedHit
{
private:
Hit_T fTrackedHit; // Tracked particle
StackOfObjects<HitTrack_T> fTrack; // Keep the full track of the particle
public:
TrackedHitImp()
: fTrackedHit(), fTrack(100u) {;}
virtual ~TrackedHitImp()
{;}
virtual UShort_t GetNbHits() const
{ return fTrack.GetSize(); }
virtual Hit *NewHit()
{ return fTrack.New(); }
virtual Hit *GetHit(UInt_t i = 0) const
{ return fTrack.At(i); }
virtual void SetX(Double_t x) // energy and time
{fTrackedHit.SetX(x);} SetE(ahit.GetE()); SetDE(ahit.GetDE());
virtual void SetY(Double_t y) SetT(ahit.GetT()); SetDT(ahit.GetDT());
{fTrackedHit.SetY(y);}
virtual void SetZ(Double_t z)
{fTrackedHit.SetZ(z);}
virtual Double_t GetX() const
{return fTrackedHit.GetX();}
virtual Double_t GetY() const
{return fTrackedHit.GetY();}
virtual Double_t GetZ() const
{return fTrackedHit.GetZ();}
virtual void SetXYZ(Double_t x, Double_t y, Double_t z)
{fTrackedHit.SetXYZ(x,y,z);}
virtual void GetXYZ(Double_t &x, Double_t &y, Double_t &z) const
{ fTrackedHit.GetXYZ(x,y,z); }
virtual Double_t GetE() const // status and ID
{return fTrackedHit.GetE();} SetStatus(ahit.GetStatus());
virtual void SetE(Double_t e) SetID(ahit.GetID());
{fTrackedHit.SetE(e);} }
virtual Double_t GetT() const
{return fTrackedHit.GetT();}
virtual void SetT(Double_t t)
{fTrackedHit.SetT(t);}
virtual void SetDX(Double_t dx)
{fTrackedHit.SetDX(dx);}
virtual void SetDY(Double_t dy)
{fTrackedHit.SetDY(dy);}
virtual void SetDZ(Double_t dz)
{fTrackedHit.SetDZ(dz);}
virtual Double_t GetDX() const
{return fTrackedHit.GetDX();}
virtual Double_t GetDY() const
{return fTrackedHit.GetDY();}
virtual Double_t GetDZ() const
{return fTrackedHit.GetDZ();}
virtual void SetDXYZ(Double_t dx, Double_t dy, Double_t dz)
{fTrackedHit.SetDXYZ(dx,dy,dz);}
virtual void GetDXYZ(Double_t &dx, Double_t &dy, Double_t &dz) const
{fTrackedHit.GetDXYZ(dx,dy,dz);}
virtual Double_t GetDE() const
{return fTrackedHit.GetDE();}
virtual void SetDE(Double_t de)
{fTrackedHit.SetDE(de);}
virtual Double_t GetDT() const
{return fTrackedHit.GetDT();}
virtual void SetDT(Double_t dt)
{fTrackedHit.SetDT(dt);}
virtual Int_t GetID(Int_t which = 0) const
{return fTrackedHit.GetID(which);}
virtual void SetID(Int_t id, Int_t which = 0)
{fTrackedHit.SetID(id,which);}
virtual UShort_t GetStatus() const
{return fTrackedHit.GetStatus();}
virtual void SetStatus(UShort_t s)
{fTrackedHit.SetStatus(s);}
virtual void Reset()
{ fTrackedHit.Reset(); fTrack.Reset(); }
};
} // namespace ADF
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment