14 #ifndef GW_GAMMATRACKER_H
20 #define MAXIMPACTS 1000
33 InputE =
new Double_t[MaxImpacts]; ::memset(
InputE,0,
sizeof(Double_t)*MaxImpacts);
34 InputDE =
new Double_t[MaxImpacts]; ::memset(
InputDE,0,
sizeof(Double_t)*MaxImpacts);
36 InputX =
new Double_t[MaxImpacts]; ::memset(
InputX,0,
sizeof(Double_t)*MaxImpacts);
37 InputY =
new Double_t[MaxImpacts]; ::memset(
InputY,0,
sizeof(Double_t)*MaxImpacts);
38 InputZ =
new Double_t[MaxImpacts]; ::memset(
InputZ,0,
sizeof(Double_t)*MaxImpacts);
39 InputDX =
new Double_t[MaxImpacts]; ::memset(
InputDX,0,
sizeof(Double_t)*MaxImpacts);
40 InputDY =
new Double_t[MaxImpacts]; ::memset(
InputDY,0,
sizeof(Double_t)*MaxImpacts);
41 InputDZ =
new Double_t[MaxImpacts]; ::memset(
InputDZ,0,
sizeof(Double_t)*MaxImpacts);
44 OutputE =
new Double_t[MaxImpacts]; ::memset(
OutputE,0,
sizeof(Double_t)*MaxImpacts);
70 bool GammaTracker::Load(
const char *classname,
const char *pathtopackage,
const char *libraryname)
74 TString name = classname, path = pathtopackage, libname = libraryname,
tmp;
76 if ( path.EndsWith(
"/") == kFALSE ) path +=
"/";
80 if ( gSystem->Load(tmp.Data()) < 0 ) {
81 cout <<
"Cannot find library " << libname <<
" in " << path <<
endl;
return false;
85 tmp =
".include " + path ; gROOT->ProcessLine(tmp.Data());
88 tmp =
".L "; tmp += classname; tmp +=
"Adapter.C+";
89 cout <<
" Trying to compile the Adapter: " << tmp <<
endl; gROOT->ProcessLine(tmp);
93 cout <<
" " << classname <<
" is now available though GammaTracker::GetTracker " <<
endl;
return true;
96 cout <<
" " << classname <<
" is NOT available though GammaTracker::GetTracker " <<
endl;
return false;
106 TClass *cl = gROOT->GetClass(classname);
113 UInt_t
GammaTracker::SetEvent(UInt_t n,
const Double_t *e,
const Double_t *x,
const Double_t *y,
const Double_t *z, Double_t efactor, Double_t pfactor)
116 if ( n > (MaxImpacts-1) ) {
InputN = 0;
return InputN; }
119 if ( efactor == 1.0 ) {
123 for (i = 0; i <
InputN; i++ ) {
InputE[i] = e[i] * efactor; }
126 if ( pfactor == 1.0 ) {
127 ::memcpy(
InputX,x,
sizeof(Double_t)*n);
128 ::memcpy(
InputY,y,
sizeof(Double_t)*n);
129 ::memcpy(
InputZ,z,
sizeof(Double_t)*n);
132 for (i = 0; i <
InputN; i++ ) {
133 InputX[i] = x[i] * pfactor;
134 InputY[i] = y[i] * pfactor;
135 InputZ[i] = z[i] * pfactor;
138 ::memset(
InputDE,0,
sizeof(Double_t)*MaxImpacts);
139 ::memset(
InputDX,0,
sizeof(Double_t)*MaxImpacts);
140 ::memset(
InputDY,0,
sizeof(Double_t)*MaxImpacts);
141 ::memset(
InputDZ,0,
sizeof(Double_t)*MaxImpacts);
147 cout <<
" list of inputs for GammaTracker " <<
endl;
148 for (UInt_t i = 0; i <
InputN; i++ ) {
153 cout <<
" list of outputs for GammaTracker " <<
endl;
154 for (UInt_t i = 0; i <
OutputN; i++ ) {
UInt_t OutputN
DZ positions.
Base class to build tracker families.
Double_t * InputZ
Y positions.
virtual Int_t DoTracking()
to track the gamma-rays
Double_t * OutputPhi2
direction (theta) of the first scattered gamma-ray for polarisation
GammaTracker(const char *name="GammaTracker", const char *title="Base to track gamma-rays")
direction (phi) of the first scattered gamma-ray for polarisation
static GammaTracker * GetTracker(const char *classname)
Interface to get a new tracker.
Double_t * InputDY
DX positions.
Double_t * OutputPhi1
incoming direction (theta) of the reconstructed gamma-rays
static bool IsTracker(const char *classname)
To know if a tracker is already loaded.
UInt_t InputN
Units for energies.
virtual UInt_t SetEvent(UInt_t n, const Double_t *e, const Double_t *x, const Double_t *y, const Double_t *z, Double_t efactor=1.0, Double_t pfactor=1.0)
Double_t * OutputTheta1
energies of the reconstructed gamma-rays
Double_t * InputY
X positions.
static bool Load(const char *classname, const char *pathtopackage, const char *libraryname)
To load an interface to a particular tracker.
Double_t * OutputE
of reconstructed gamma-rays
Double_t * InputDE
energies
Double_t * InputE
of impacts
Double_t * InputDZ
DY positions.
ADF::LogMessage & endl(ADF::LogMessage &log)
Double_t * InputX
errors on energies
Double_t * InputDX
Z positions.
Double_t * OutputTheta2
incoming direction (phi) of the reconstructed gamma-rays