Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcRasteredBeam.cxx
Go to the documentation of this file.
1
10#include "THcRasteredBeam.h"
11#include "THcRaster.h"
12#include "TMath.h"
13#include "TDatime.h"
14#include "TList.h"
15
16#include "VarDef.h"
17
18//_____________________________________________________________________________
19THcRasteredBeam::THcRasteredBeam( const char* name, const char* description ) :
20 THaBeam( name, description )
21{
22 AddDetector( new THcRaster("raster","raster",this) );
23}
24
25
26//_____________________________________________________________________________
28{
29
30 TIter nextDet( fDetectors );
31
32 nextDet.Reset();
33
34 // This apparatus assumes that there is only one detector
35 // in the list. If someone adds detectors by hand, the first
36 // detector in the list will be used to get the beam position
37 // the others will be processed
38 // -- Iam not sure why the code is written like this. But for now, I am
39 // going to work with this code as it is since all I need for is to
40 // decode the raster - Buddhini
41
42
43 if (THaBeamDet* theBeamDet=
44 static_cast<THaBeamDet*>( nextDet() )) {
45 theBeamDet->Process();
46 fPosition = theBeamDet->GetPosition();
47 fDirection = theBeamDet->GetDirection();
48 }
49 else {
50 Error( Here("THcRasteredBeam::Reconstruct"),
51 "Beamline Detectors Missing in Detector List" );
52 }
53
54
55 // Process any other detectors that may have been added (by default none)
56 while (THaBeamDet * theBeamDet=
57 static_cast<THaBeamDet*>( nextDet() )) {
58 theBeamDet->Process();
59 }
60
61 Update();
62
63 return 0;
64
65}
66
67//_____________________________________________________________________________
69
70
71
int Int_t
ClassImp(VDC::AnalyticTTDConv) using namespace std
virtual const char * Here(const char *) const
virtual Int_t AddDetector(THaDetector *det, Bool_t quiet=false, Bool_t first=false)
TList * fDetectors
TVector3 fPosition
virtual void Update()
TVector3 fDirection
Detector class for fast raster.
Definition THcRaster.h:23
Apparatus for a rastered beam.
virtual Int_t Reconstruct()
THcRasteredBeam(const char *name, const char *description)
void Reset()
virtual void Error(const char *method, const char *msgfmt,...) const