Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaRasteredBeam.cxx
Go to the documentation of this file.
1//*-- Author : Bodo Reitz April 2003
2
4//
5// THaRasteredBeam
6//
7// Apparatus describing a rastered beam that is analyzed using event-by-event
8// raster currents.
9//
11
12#include "THaRasteredBeam.h"
13#include "THaRaster.h"
14#include "TList.h"
15
17
18//_____________________________________________________________________________
19THaRasteredBeam::THaRasteredBeam( const char* name, const char* description,
20 bool do_setup )
21 : THaBeam( name, description )
22{
23 if( do_setup )
24 AddDetector(new THaRaster("Raster", "raster", this));
25}
26
27//_____________________________________________________________________________
29{
30
31 TIter nextDet( fDetectors );
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
39 if( auto* theBeamDet = dynamic_cast<THaBeamDet*>( nextDet() ) ) {
40 theBeamDet->Process();
41 fPosition = theBeamDet->GetPosition();
42 fDirection = theBeamDet->GetDirection();
43 }
44 else {
45 Error( Here("Reconstruct"),
46 "Beamline Detectors Missing in Detector List" );
47 }
48
49 // Process any other detectors that may have been added (by default none)
50 while( TObject* obj = nextDet() ) {
51 if( auto* theBeamDet = dynamic_cast<THaBeamDet*>(obj) )
52 theBeamDet->Process();
53 }
54
55 Update();
56
57 return 0;
58}
int Int_t
char name[80]
virtual const char * Here(const char *) const
TList * fDetectors
TVector3 fPosition
Definition THaBeam.h:32
virtual void Update()
Definition THaBeam.cxx:85
TVector3 fDirection
Definition THaBeam.h:33
THaRasteredBeam(const char *name, const char *description, bool do_setup=true)
virtual Int_t Reconstruct()
void Reset()
virtual void Error(const char *method, const char *msgfmt,...) const
ClassImp(TPyArg)