JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwTypes.cc File Reference

Implementation of type conversion and utility functions. More...

#include "QwTypes.h"
#include "TString.h"
+ Include dependency graph for QwTypes.cc:

Go to the source code of this file.

Functions

EQwPMTInstrumentType GetQwPMTInstrumentType (TString name)
 
EQwBeamInstrumentType GetQwBeamInstrumentType (TString name)
 
TString GetQwPMTInstrumentTypeName (EQwPMTInstrumentType type)
 
TString GetQwBeamInstrumentTypeName (EQwBeamInstrumentType type)
 
UInt_t GetGlobalErrorFlag (TString evtype, Int_t evMode, Double_t stabilitycut)
 
std::string WienModeName (EQwWienMode type)
 
EQwWienMode WienModeIndex (TString name)
 

Detailed Description

Implementation of type conversion and utility functions.

Definition in file QwTypes.cc.

Function Documentation

◆ GetGlobalErrorFlag()

UInt_t GetGlobalErrorFlag ( TString evtype,
Int_t evMode,
Double_t stabilitycut )

Definition at line 132 of file QwTypes.cc.

132 {
133 UInt_t evntMode;
134 if (evMode==3)
135 evntMode=kEventCutMode3;
136 else
137 evntMode=0;
138 if (evtype=="g" && stabilitycut>0)
139 return (kGlobalCut|kStabilityCut|evntMode);
140 else if (evtype=="g" && stabilitycut<=0)
141 return (kGlobalCut|evntMode);
142 else if (evtype=="l" && stabilitycut>0)
143 return (kLocalCut|evntMode|kStabilityCut);
144 else if (evtype=="l" && stabilitycut<=0)
145 return (kLocalCut|evntMode);
146
147 return 0;
148}
static const UInt_t kGlobalCut
Definition QwTypes.h:182
static const UInt_t kStabilityCut
Definition QwTypes.h:184
static const UInt_t kEventCutMode3
Definition QwTypes.h:174
static const UInt_t kLocalCut
Definition QwTypes.h:183

References kEventCutMode3, kGlobalCut, kLocalCut, and kStabilityCut.

Referenced by QwBeamLine::LoadEventCuts_Line(), QwBeamMod::LoadEventCuts_Line(), and VQwDetectorArray::LoadEventCuts_Line().

+ Here is the caller graph for this function:

◆ GetQwBeamInstrumentType()

EQwBeamInstrumentType GetQwBeamInstrumentType ( TString name)

Definition at line 34 of file QwTypes.cc.

34 {
35 // The name is passed by value because we will
36 // change it to lower case.
37 name.ToLower();
39 result = kQwUnknownDeviceType;
40 if (name=="bpmstripline"){
41 result = kQwBPMStripline;
42 }
43 else if (name=="bcm"){
44 result = kQwBCM;
45 }
46 else if (name=="combinedbcm"){
47 result = kQwCombinedBCM;
48 }
49 else if (name=="combinedbpm"){
50 result = kQwCombinedBPM;
51 }
52 else if (name=="energycalculator"){
53 result = kQwEnergyCalculator;
54 }
55 else if (name=="halomonitor"){
56 result = kQwHaloMonitor;
57 }
58 else if (name=="bpmcavity"){
59 result = kQwBPMCavity;
60 }
61 else if (name=="qpd"){
62 result = kQwQPD;
63 }
64 else if (name=="lineararray"){
65 result = kQwLinearArray;
66 }
67 else if (name=="clock") {
68 result = kQwClock;
69 }
70 return result;
71}
EQwBeamInstrumentType
Definition QwTypes.h:143
@ kQwEnergyCalculator
Definition QwTypes.h:151
@ kQwHaloMonitor
Definition QwTypes.h:152
@ kQwCombinedBPM
Definition QwTypes.h:150
@ kQwBPMStripline
Definition QwTypes.h:145
@ kQwClock
Definition QwTypes.h:154
@ kQwLinearArray
Definition QwTypes.h:147
@ kQwCombinedBCM
Definition QwTypes.h:149
@ kQwQPD
Definition QwTypes.h:146
@ kQwBCM
Definition QwTypes.h:148
@ kQwUnknownDeviceType
Definition QwTypes.h:144
@ kQwBPMCavity
Definition QwTypes.h:153

References kQwBCM, kQwBPMCavity, kQwBPMStripline, kQwClock, kQwCombinedBCM, kQwCombinedBPM, kQwEnergyCalculator, kQwHaloMonitor, kQwLinearArray, kQwQPD, and kQwUnknownDeviceType.

Referenced by QwBeamLine::LoadChannelMap(), QwBeamLine::LoadEventCuts_Line(), QwBeamLine::LoadGeometryDefinition(), QwBeamLine::LoadMockDataParameters(), QwBeamLine::PublishInternalValues(), QwBeamDetectorID::QwBeamDetectorID(), and QwBeamDetectorID::QwBeamDetectorID().

+ Here is the caller graph for this function:

◆ GetQwBeamInstrumentTypeName()

TString GetQwBeamInstrumentTypeName ( EQwBeamInstrumentType type)

Definition at line 100 of file QwTypes.cc.

100 {
101 TString result;
102 result = "kQwUnknownDeviceType";
103 if (type==kQwBPMStripline){
104 result = "bpmstripline";
105 }
106 else if (type==kQwBCM){
107 result = "bcm";
108 }
109 else if (type==kQwQPD){
110 result = "qpd";
111 }
112 else if (type==kQwLinearArray){
113 result = "lineararray";
114 }
115 else if (type==kQwCombinedBCM){
116 result = "combinedbcm";
117 }
118 else if (type==kQwCombinedBPM){
119 result = "combinedbpm";
120 }
121 else if (type==kQwEnergyCalculator){
122 result = "energycalculator";
123 }
124 else if (type==kQwHaloMonitor){
125 result = "halomonitor";
126 }
127 else if (type==kQwBPMCavity)
128 result = "bpmcavity";
129 return result;
130}

References kQwBCM, kQwBPMCavity, kQwBPMStripline, kQwCombinedBCM, kQwCombinedBPM, kQwEnergyCalculator, kQwHaloMonitor, kQwLinearArray, and kQwQPD.

Referenced by QwBeamLine::GetChannel(), QwBeamLine::GetElement(), QwBeamLine::LoadEventCuts_Line(), and QwBeamLine::PublishByRequest().

+ Here is the caller graph for this function:

◆ GetQwPMTInstrumentType()

EQwPMTInstrumentType GetQwPMTInstrumentType ( TString name)

Determine the EQwPMTInstrumentType value corresponding to a text name of the type, as used in the channel map files. The text comparison is not case sensitive.

Parameters
nameText name of an instrument type, such as "IntegrationPMT"
Returns
EQwPMTInstrumentType value corresponding to the name

Definition at line 16 of file QwTypes.cc.

16 {
17 // The name is passed by value because we will
18 // change it to lower case.
19 name.ToLower();
21 result = kQwUnknownPMT;
22 if (name=="integrationpmt"){
23 result = kQwIntegrationPMT;
24 } else if (name=="scalerpmt"){
25 result = kQwScalerPMT;
26 }
27 else if (name=="combinationpmt"){
28 result = kQwCombinedPMT;
29 }
30 return result;
31}
EQwPMTInstrumentType
Definition QwTypes.h:135
@ kQwUnknownPMT
Definition QwTypes.h:136
@ kQwCombinedPMT
Definition QwTypes.h:139
@ kQwIntegrationPMT
Definition QwTypes.h:137
@ kQwScalerPMT
Definition QwTypes.h:138

References kQwCombinedPMT, kQwIntegrationPMT, kQwScalerPMT, and kQwUnknownPMT.

Referenced by VQwDetectorArray::GetDetectorTypeID().

+ Here is the caller graph for this function:

◆ GetQwPMTInstrumentTypeName()

TString GetQwPMTInstrumentTypeName ( EQwPMTInstrumentType type)

Get the text name of a EQwPMTInstrumentType, as it would be used in the channel map files.

Parameters
typeEQwPMTInstrumentType value for which the name should be returned, such as kQwPMTIntegrationPMT
Returns
Text name corresponding to the type

Definition at line 81 of file QwTypes.cc.

81 {
82 TString result;
83 result = "UnknownPMT";
84 if (type==kQwIntegrationPMT){
85 result = "IntegrationPMT";
86 result.ToLower();
87 }
88 else if (type==kQwScalerPMT){
89 result = "ScalerPMT";
90 result.ToLower();
91 }
92 else if (type==kQwCombinedPMT){
93 result = "CombinationPMT";
94 result.ToLower();
95 }
96 return result;
97}

References kQwCombinedPMT, kQwIntegrationPMT, and kQwScalerPMT.

Referenced by VQwDetectorArray::LoadEventCuts_Line().

+ Here is the caller graph for this function:

◆ WienModeIndex()

EQwWienMode WienModeIndex ( TString name)

Definition at line 156 of file QwTypes.cc.

156 {
158 if (name=="Forward"){
159 retval = kWienForward;
160 } else if (name=="Backward"){
161 retval = kWienBackward;
162 } else if (name=="Vertical"){
163 retval = kWienVertTrans;
164 } else if (name=="Horizontal"){
165 retval = kWienHorizTrans;
166 }
167 return retval;
168}
EQwWienMode
Double Wien configuration.
Definition QwTypes.h:308
@ kWienIndeterminate
Definition QwTypes.h:309
@ kWienBackward
Definition QwTypes.h:311
@ kWienVertTrans
Definition QwTypes.h:312
@ kWienForward
Definition QwTypes.h:310
@ kWienHorizTrans
Definition QwTypes.h:313

References kWienBackward, kWienForward, kWienHorizTrans, kWienIndeterminate, and kWienVertTrans.

◆ WienModeName()

std::string WienModeName ( EQwWienMode type)

Definition at line 150 of file QwTypes.cc.

150 {
151 const std::string wienname[5] = {"Indeterminate", "Forward", "Backward",
152 "Vertical", "Horizontal"};
153 return wienname[type];
154};

Referenced by QwEPICSEvent::ExtractEPICSValues(), and QwBlinder::SetWienState().

+ Here is the caller graph for this function: