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
16
ClassImp
(
THaRasteredBeam
)
17
18
//_____________________________________________________________________________
19
THaRasteredBeam::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
//_____________________________________________________________________________
28
Int_t
THaRasteredBeam::Reconstruct
()
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_t
int Int_t
name
char name[80]
THaRaster.h
THaRasteredBeam.h
TList.h
THaAnalysisObject::Here
virtual const char * Here(const char *) const
Definition
THaAnalysisObject.cxx:373
THaApparatus::fDetectors
TList * fDetectors
Definition
THaApparatus.h:38
THaBeamDet
Definition
THaBeamDet.h:13
THaBeam
Definition
THaBeam.h:16
THaBeam::fPosition
TVector3 fPosition
Definition
THaBeam.h:32
THaBeam::Update
virtual void Update()
Definition
THaBeam.cxx:85
THaBeam::fDirection
TVector3 fDirection
Definition
THaBeam.h:33
THaRaster
Definition
THaRaster.h:14
THaRasteredBeam
Definition
THaRasteredBeam.h:15
THaRasteredBeam::THaRasteredBeam
THaRasteredBeam(const char *name, const char *description, bool do_setup=true)
THaRasteredBeam::Reconstruct
virtual Int_t Reconstruct()
Definition
THaRasteredBeam.cxx:28
TIter
TIter::Reset
void Reset()
TObject
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
ClassImp
ClassImp(TPyArg)
Podd
THaRasteredBeam.cxx
Generated by
1.9.8