Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaHelicityDet.cxx
Go to the documentation of this file.
1//*-- Author : Vincent Sulkosky and R. Feuerbach, Jan 2006
2// Changed to an abstract base class, Ole Hansen, Aug 2006
4//
5// THaHelicityDet
6//
7// Base class for a beam helicity detector.
8//
10
11
12#include "THaHelicityDet.h"
13
14using namespace std;
15
16//_____________________________________________________________________________
17THaHelicityDet::THaHelicityDet( const char* name, const char* description ,
18 THaApparatus* apparatus )
19 : THaDetector( name, description, apparatus ), fHelicity(kUnknown), fSign(1)
20{
21 // Constructor
22}
23
24//_____________________________________________________________________________
26{
27 // Destructor
29}
30
31//_____________________________________________________________________________
33{
34 // Initialize global variables
35
36 const RVarDef var[] = {
37 { "helicity", "Beam helicity", "fHelicity" },
38 { nullptr }
39 };
40 return DefineVarsFromList( var, mode );
41}
42
43//_____________________________________________________________________________
45{
46 // All helicity detectors read from db_hel.dat by default. Database
47 // keys should (but do not have to) be prefixed by each detector's prefix,
48 // e.g. L.adchel.detmap
49
50 return "hel.";
51}
52
53//_____________________________________________________________________________
55{
56 // All helicity detectors use only their name, not apparatus.name, as
57 // prefix.
58
60
61}
62
63//_____________________________________________________________________________
65{
66 // Read fSign
67
68 fSign = 1; // Default sign is +1
69
70 FILE* file = OpenFile( date );
71 if( !file )
72 // No database file is fine since we only read an optional parameter here
73 return kOK;
74
75 const DBRequest request[] = {
76 { "helicity_sign", &fSign, kInt, 0, true, -2 },
77 { nullptr }
78 };
79 Int_t err = LoadDB( file, date, request );
80 fclose(file);
81 if( err )
82 return kInitError;
83
84 return kOK;
85}
86
int Int_t
Option_t Option_t TPoint TPoint const char mode
char name[80]
kUnknown
static Int_t LoadDB(FILE *file, const TDatime &date, const DBRequest *request, const char *prefix, Int_t search=0, const char *here="THaAnalysisObject::LoadDB")
static Int_t DefineVarsFromList(const void *list, EType type, EMode mode, const char *def_prefix, const TObject *obj, const char *prefix, const char *here, const char *comment_subst="")
virtual void MakePrefix()
virtual FILE * OpenFile(const TDatime &date)
virtual void MakePrefix()
virtual Int_t ReadDatabase(const TDatime &date)
virtual const char * GetDBFileName() const
virtual Int_t DefineVariables(EMode mode=kDefine)
virtual ~THaHelicityDet()
STL namespace.
ClassImp(TPyArg)