Newer
Older
/** \class THcRasteredBeam
\ingroup Detectors
A class to handle the raster processing tasks
\author Buddhini Waidyawansa
*/
Buddhini Waidyawansa
committed
#include "THcRasteredBeam.h"
#include "THcRaster.h"
#include "TMath.h"
#include "TDatime.h"
#include "TList.h"
#include "VarDef.h"
//_____________________________________________________________________________
THcRasteredBeam::THcRasteredBeam( const char* name, const char* description ) :
THaBeam( name, description )
{
AddDetector( new THcRaster("raster","raster",this) );
Buddhini Waidyawansa
committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
}
//_____________________________________________________________________________
Int_t THcRasteredBeam::Reconstruct()
{
TIter nextDet( fDetectors );
nextDet.Reset();
// This apparatus assumes that there is only one detector
// in the list. If someone adds detectors by hand, the first
// detector in the list will be used to get the beam position
// the others will be processed
// -- Iam not sure why the code is written like this. But for now, I am
// going to work with this code as it is since all I need for is to
// decode the raster - Buddhini
if (THaBeamDet* theBeamDet=
static_cast<THaBeamDet*>( nextDet() )) {
theBeamDet->Process();
fPosition = theBeamDet->GetPosition();
fDirection = theBeamDet->GetDirection();
}
else {
Error( Here("THcRasteredBeam::Reconstruct"),
"Beamline Detectors Missing in Detector List" );
}
// Process any other detectors that may have been added (by default none)
while (THaBeamDet * theBeamDet=
static_cast<THaBeamDet*>( nextDet() )) {
theBeamDet->Process();
}
Update();
return 0;
}
//_____________________________________________________________________________
ClassImp(THcRasteredBeam)
////////////////////////////////////////////////////////////////////////////////