JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwBeamDetectorID Class Reference

Beam detector mapping/ID decoded from map files. More...

#include <QwBeamDetectorID.h>

Public Member Functions

 QwBeamDetectorID (Int_t subbankid, Int_t offset, TString name, TString dettype, TString modtype)
 
 QwBeamDetectorID (Int_t subbankid, QwParameterFile &paramfile)
 
 QwBeamDetectorID (const QwBeamDetectorID &input)
 
 ~QwBeamDetectorID ()
 
Bool_t ReportInitErrors () const
 
void Print () const
 

Data Fields

Int_t fSubbankIndex
 
Int_t fWordInSubbank
 
TString fmoduletype
 
TString fdetectorname
 
TString fdetectortype
 
EQwBeamInstrumentType fTypeID
 
Int_t fIndex
 
UInt_t fSubelement
 
TString fChannelName
 
TString fSubelementName
 

Private Member Functions

 QwBeamDetectorID ()
 

Detailed Description

Beam detector mapping/ID decoded from map files.

Definition at line 26 of file QwBeamDetectorID.h.

Constructor & Destructor Documentation

◆ QwBeamDetectorID() [1/4]

QwBeamDetectorID::QwBeamDetectorID ( Int_t subbankid,
Int_t offset,
TString name,
TString dettype,
TString modtype )

Definition at line 19 of file QwBeamDetectorID.cc.

21 :
22 fSubbankIndex(subbankid),fWordInSubbank(offset),
23 fmoduletype(modtype),fdetectorname(name),fdetectortype(dettype),
24 fIndex(-1)
25{
27}
EQwBeamInstrumentType GetQwBeamInstrumentType(TString name)
Definition QwTypes.cc:34
EQwBeamInstrumentType fTypeID

References fdetectorname, fdetectortype, fIndex, fmoduletype, fSubbankIndex, fTypeID, fWordInSubbank, and GetQwBeamInstrumentType().

Referenced by QwBeamDetectorID().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QwBeamDetectorID() [2/4]

QwBeamDetectorID::QwBeamDetectorID ( Int_t subbankid,
QwParameterFile & paramfile )

Definition at line 29 of file QwBeamDetectorID.cc.

30 :
31 fSubbankIndex(subbankid), fIndex(-1)
32{
33 Int_t modnum, channum;
34 fmoduletype = paramfile.GetTypedNextToken<TString>();
35 modnum = paramfile.GetTypedNextToken<Int_t>(); //slot number
36 channum = paramfile.GetTypedNextToken<Int_t>(); //channel number
37 fdetectortype = paramfile.GetTypedNextToken<TString>(); //type-purpose of the detector
38 fChannelName = paramfile.GetTypedNextToken<TString>(); //name of the detector
39 fmoduletype.ToUpper();
40 fdetectortype.ToLower();
41 fChannelName.ToLower();
42
43 Int_t offset;
44 if (fmoduletype == "VQWK") {
46 if (paramfile.ReturnValue("vqwk_buffer_offset",offset)) {
47 fWordInSubbank += offset;
48 }
49 } else if (fmoduletype == "ADC18") {
51 if (paramfile.ReturnValue("adc18_buffer_offset",offset)) {
52 fWordInSubbank += offset;
53 }
54 } else if (fmoduletype == "SCALER") {
56 if (paramfile.ReturnValue("scaler_buffer_offset",offset)) {
57 fWordInSubbank += offset;
58 }
59 } else if (fmoduletype == "MOLLERADC") {
60 UInt_t decode_mode = 0;
61 paramfile.ReturnValue("molleradc_decode_mode", decode_mode)
62 || paramfile.ReturnValue("decode_mode", decode_mode);
64
66 if (paramfile.ReturnValue("MollerADC_buffer_offset",offset)) {
67 fWordInSubbank += offset;
68 }
69 } else {
70 fWordInSubbank = -1;
71 }
73
74 size_t namesize = fChannelName.Sizeof();
75 switch (fTypeID){
76 case kQwBPMStripline:
77 fdetectorname = fChannelName(0,namesize-3);
78 fSubelementName = fChannelName(namesize-3,2);
80 break;
81 case kQwQPD:
82 fdetectorname = fChannelName(0,namesize-3);
83 fSubelementName = fChannelName(namesize-3,2);
85 break;
86 case kQwLinearArray:
87 fdetectorname = fChannelName(0,namesize-3);
88 fSubelementName = fChannelName(namesize-3,2);
90 break;
91 case kQwBPMCavity:
94 break;
95 default:
97 fSubelementName = "";
98 fSubelement = 0;
99 break;
100 }
101}
@ kQwBPMStripline
Definition QwTypes.h:145
@ kQwLinearArray
Definition QwTypes.h:147
@ kQwQPD
Definition QwTypes.h:146
@ kQwBPMCavity
Definition QwTypes.h:153
static Int_t GetBufferOffset(Int_t moduleindex, Int_t channelindex)
static void SetDecodeMode(UInt_t input)
static Int_t GetBufferOffset(Int_t moduleindex, Int_t channelindex)
T GetTypedNextToken()
Get next token into specific type.
Bool_t ReturnValue(const std::string keyname, T &retvalue)
static Int_t GetBufferOffset(Int_t scalerindex, Int_t wordindex, UInt_t header=1)
static Int_t GetBufferOffset(Int_t moduleindex, Int_t channelindex)
static Bool_t ParseChannelName(const TString &channel, TString &detname, TString &subname, UInt_t &localindex)
static UInt_t GetSubElementIndex(TString subname)
static UInt_t GetSubElementIndex(TString subname)
static UInt_t GetSubElementIndex(TString subname)
Definition QwQPD.cc:584

References fChannelName, fdetectorname, fdetectortype, fIndex, fmoduletype, fSubbankIndex, fSubelement, fSubelementName, fTypeID, fWordInSubbank, QwADC18_Channel::GetBufferOffset(), QwMollerADC_Channel::GetBufferOffset(), QwVQWK_Channel::GetBufferOffset(), VQwScaler_Channel::GetBufferOffset(), GetQwBeamInstrumentType(), QwBPMStripline< T >::GetSubElementIndex(), QwLinearDiodeArray::GetSubElementIndex(), QwQPD::GetSubElementIndex(), QwParameterFile::GetTypedNextToken(), kQwBPMCavity, kQwBPMStripline, kQwLinearArray, kQwQPD, QwBPMCavity::ParseChannelName(), QwParameterFile::ReturnValue(), and QwMollerADC_Channel::SetDecodeMode().

+ Here is the call graph for this function:

◆ QwBeamDetectorID() [3/4]

QwBeamDetectorID::QwBeamDetectorID ( const QwBeamDetectorID & input)

Definition at line 103 of file QwBeamDetectorID.cc.

104{
107 fmoduletype = input.fmoduletype;
110 fTypeID = input.fTypeID;
111 fIndex = input.fIndex;
112 fSubelement = input.fSubelement;
115}

References fChannelName, fdetectorname, fdetectortype, fIndex, fmoduletype, fSubbankIndex, fSubelement, fSubelementName, fTypeID, fWordInSubbank, and QwBeamDetectorID().

+ Here is the call graph for this function:

◆ ~QwBeamDetectorID()

QwBeamDetectorID::~QwBeamDetectorID ( )
inline

Definition at line 32 of file QwBeamDetectorID.h.

32{};

◆ QwBeamDetectorID() [4/4]

QwBeamDetectorID::QwBeamDetectorID ( )
private

Member Function Documentation

◆ Print()

void QwBeamDetectorID::Print ( ) const

Definition at line 147 of file QwBeamDetectorID.cc.

148{
149
150 std::cout<<std::endl<<"Detector name= "<<fdetectorname<<std::endl;
151 std::cout<<"SubbankkIndex= "<<fSubbankIndex<<std::endl;
152 std::cout<<"word index in subbank= "<<fWordInSubbank<<std::endl;
153 std::cout<<"module type= "<<fmoduletype<<std::endl;
154 std::cout<<"detector type= "<<fdetectortype<<" that is index="<<fTypeID<<std::endl;
155 std::cout<<"Index of this detector in the vector of similar detector= "<<
156 fIndex<<std::endl;
157 std::cout<<"Subelement index= "<<
158 fSubelement<<std::endl;
159 std::cout<<"---------------------------------------------------"<<std::endl;
160 std::cout<<std::endl;
161
162
163 return;
164}

References fdetectorname, fdetectortype, fIndex, fmoduletype, fSubbankIndex, fSubelement, fTypeID, and fWordInSubbank.

◆ ReportInitErrors()

Bool_t QwBeamDetectorID::ReportInitErrors ( ) const

Definition at line 118 of file QwBeamDetectorID.cc.

119{
120 Bool_t lineok;
121 lineok = kTRUE;
122 if(fWordInSubbank<0){
123 QwError<< "QwBeamLine::LoadChannelMap: Unknown module type, "
124 << fmoduletype <<", the detector "
125 << fChannelName <<" will not be decoded "
126 << QwLog::endl;
127 lineok=kFALSE;
128 }
130 QwError << "QwBeamLine::LoadChannelMap: Unknown detector type, "
131 << fdetectortype <<", the detector "
132 << fChannelName <<" will not be decoded "
133 << QwLog::endl;
134 lineok=kFALSE;
135 }
137 QwError << "QwBeamLine::LoadChannelMap: "<< fSubelementName
138 << " was not recognized as a valid subelement for "
139 << fdetectortype << "device type (channel name=="
140 << fChannelName << ")" <<QwLog::endl;;
141 lineok=kFALSE;
142 }
143 return lineok;
144}
static const UInt_t kInvalidSubelementIndex
Definition QwTypes.h:198
@ kQwUnknownDeviceType
Definition QwTypes.h:144
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297

References QwLog::endl(), fChannelName, fdetectortype, fmoduletype, fSubelement, fSubelementName, fTypeID, fWordInSubbank, kInvalidSubelementIndex, kQwUnknownDeviceType, and QwError.

Referenced by QwBeamLine::LoadChannelMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ fChannelName

TString QwBeamDetectorID::fChannelName

Definition at line 52 of file QwBeamDetectorID.h.

Referenced by QwBeamDetectorID(), QwBeamDetectorID(), and ReportInitErrors().

◆ fdetectorname

◆ fdetectortype

TString QwBeamDetectorID::fdetectortype

◆ fIndex

◆ fmoduletype

◆ fSubbankIndex

Int_t QwBeamDetectorID::fSubbankIndex

Definition at line 38 of file QwBeamDetectorID.h.

Referenced by Print(), QwBeamDetectorID(), QwBeamDetectorID(), and QwBeamDetectorID().

◆ fSubelement

UInt_t QwBeamDetectorID::fSubelement

Definition at line 51 of file QwBeamDetectorID.h.

Referenced by Print(), QwBeamDetectorID(), QwBeamDetectorID(), and ReportInitErrors().

◆ fSubelementName

TString QwBeamDetectorID::fSubelementName

Definition at line 53 of file QwBeamDetectorID.h.

Referenced by QwBeamDetectorID(), QwBeamDetectorID(), and ReportInitErrors().

◆ fTypeID

◆ fWordInSubbank

Int_t QwBeamDetectorID::fWordInSubbank

The documentation for this class was generated from the following files: