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") {
61 if (paramfile.ReturnValue("MollerADC_buffer_offset",offset)) {
62 fWordInSubbank += offset;
63 }
64 } else {
65 fWordInSubbank = -1;
66 }
68
69 size_t namesize = fChannelName.Sizeof();
70 switch (fTypeID){
71 case kQwBPMStripline:
72 fdetectorname = fChannelName(0,namesize-3);
73 fSubelementName = fChannelName(namesize-3,2);
75 break;
76 case kQwQPD:
77 fdetectorname = fChannelName(0,namesize-3);
78 fSubelementName = fChannelName(namesize-3,2);
80 break;
81 case kQwLinearArray:
82 fdetectorname = fChannelName(0,namesize-3);
83 fSubelementName = fChannelName(namesize-3,2);
85 break;
86 case kQwBPMCavity:
89 break;
90 default:
92 fSubelementName = "";
93 fSubelement = 0;
94 break;
95 }
96}
@ 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 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(), and QwParameterFile::ReturnValue().

+ Here is the call graph for this function:

◆ QwBeamDetectorID() [3/4]

QwBeamDetectorID::QwBeamDetectorID ( const QwBeamDetectorID & input)

Definition at line 98 of file QwBeamDetectorID.cc.

99{
102 fmoduletype = input.fmoduletype;
105 fTypeID = input.fTypeID;
106 fIndex = input.fIndex;
107 fSubelement = input.fSubelement;
110}

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 142 of file QwBeamDetectorID.cc.

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

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

◆ ReportInitErrors()

Bool_t QwBeamDetectorID::ReportInitErrors ( ) const

Definition at line 113 of file QwBeamDetectorID.cc.

114{
115 Bool_t lineok;
116 lineok = kTRUE;
117 if(fWordInSubbank<0){
118 QwError<< "QwBeamLine::LoadChannelMap: Unknown module type, "
119 << fmoduletype <<", the detector "
120 << fChannelName <<" will not be decoded "
121 << QwLog::endl;
122 lineok=kFALSE;
123 }
125 QwError << "QwBeamLine::LoadChannelMap: Unknown detector type, "
126 << fdetectortype <<", the detector "
127 << fChannelName <<" will not be decoded "
128 << QwLog::endl;
129 lineok=kFALSE;
130 }
132 QwError << "QwBeamLine::LoadChannelMap: "<< fSubelementName
133 << " was not recognized as a valid subelement for "
134 << fdetectortype << "device type (channel name=="
135 << fChannelName << ")" <<QwLog::endl;;
136 lineok=kFALSE;
137 }
138 return lineok;
139}
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
static const UInt_t kInvalidSubelementIndex
Definition QwTypes.h:198
@ kQwUnknownDeviceType
Definition QwTypes.h:144
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: