QwAnalysis
QwBeamDetectorID Class Reference

#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

Definition at line 27 of file QwBeamDetectorID.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file QwBeamDetectorID.cc.

References fTypeID, and GetQwBeamInstrumentType().

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:29
EQwBeamInstrumentType fTypeID

+ Here is the call graph for this function:

QwBeamDetectorID::QwBeamDetectorID ( Int_t  subbankid,
QwParameterFile paramfile 
)

Definition at line 29 of file QwBeamDetectorID.cc.

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

30  :
31  fSubbankIndex(subbankid), fIndex(-1)
32 {
33  Int_t modnum, channum;
34  fmoduletype = paramfile.GetTypedNextToken<TString>();
35  modnum = paramfile.GetTypedNextToken<UInt_t>(); //slot number
36  channum = paramfile.GetTypedNextToken<UInt_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  if(fmoduletype=="VQWK"){
45  } else if(fmoduletype=="SCALER") {
47  } else {
48  fWordInSubbank = -1;
49  }
50  fTypeID = GetQwBeamInstrumentType(fdetectortype);
51 
52  size_t namesize = fChannelName.Sizeof();
53  switch (fTypeID){
54  case kQwBPMStripline:
55  fdetectorname = fChannelName(0,namesize-3);
56  fSubelementName = fChannelName(namesize-3,2);
58  break;
59  case kQwQPD:
60  fdetectorname = fChannelName(0,namesize-3);
61  fSubelementName = fChannelName(namesize-3,2);
63  break;
64  case kQwLinearArray:
65  fdetectorname = fChannelName(0,namesize-3);
66  fSubelementName = fChannelName(namesize-3,2);
68  break;
69  case kQwBPMCavity:
70  fdetectorname = fChannelName(0,namesize-2);
71  fSubelementName = fChannelName(namesize-2,1);
73  break;
74  default:
76  fSubelementName = "";
77  fSubelement = 0;
78  break;
79  }
80 
81 }
EQwBeamInstrumentType GetQwBeamInstrumentType(TString name)
Definition: QwTypes.cc:29
static UInt_t GetSubElementIndex(TString subname)
static Int_t GetBufferOffset(Int_t scalerindex, Int_t wordindex, UInt_t header=1)
static UInt_t GetSubElementIndex(TString subname)
Definition: QwBPMCavity.cc:412
EQwBeamInstrumentType fTypeID
static UInt_t GetSubElementIndex(TString subname)
Definition: QwQPD.cc:477
static UInt_t GetSubElementIndex(TString subname)
T GetTypedNextToken()
Get next token into specific type.
static Int_t GetBufferOffset(Int_t moduleindex, Int_t channelindex)

+ Here is the call graph for this function:

QwBeamDetectorID::QwBeamDetectorID ( const QwBeamDetectorID input)
QwBeamDetectorID::~QwBeamDetectorID ( )
inline

Definition at line 33 of file QwBeamDetectorID.h.

33 {};
QwBeamDetectorID::QwBeamDetectorID ( )
private

Member Function Documentation

void QwBeamDetectorID::Print ( ) const

Definition at line 127 of file QwBeamDetectorID.cc.

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

128 {
129 
130  std::cout<<std::endl<<"Detector name= "<<fdetectorname<<std::endl;
131  std::cout<<"SubbankkIndex= "<<fSubbankIndex<<std::endl;
132  std::cout<<"word index in subbank= "<<fWordInSubbank<<std::endl;
133  std::cout<<"module type= "<<fmoduletype<<std::endl;
134  std::cout<<"detector type= "<<fdetectortype<<" that is index="<<fTypeID<<std::endl;
135  std::cout<<"Index of this detector in the vector of similar detector= "<<
136  fIndex<<std::endl;
137  std::cout<<"Subelement index= "<<
138  fSubelement<<std::endl;
139  std::cout<<"---------------------------------------------------"<<std::endl;
140  std::cout<<std::endl;
141 
142 
143  return;
144 }
EQwBeamInstrumentType fTypeID
Bool_t QwBeamDetectorID::ReportInitErrors ( ) const

Definition at line 98 of file QwBeamDetectorID.cc.

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

Referenced by QwBeamLine::LoadChannelMap().

99 {
100  Bool_t lineok;
101  lineok = kTRUE;
102  if(fWordInSubbank<0){
103  QwError<< "QwBeamLine::LoadChannelMap: Unknown module type, "
104  << fmoduletype <<", the detector "
105  << fChannelName <<" will not be decoded "
106  << QwLog::endl;
107  lineok=kFALSE;
108  }
110  QwError << "QwBeamLine::LoadChannelMap: Unknown detector type, "
111  << fdetectortype <<", the detector "
112  << fChannelName <<" will not be decoded "
113  << QwLog::endl;
114  lineok=kFALSE;
115  }
117  QwError << "QwBeamLine::LoadChannelMap: "<< fSubelementName
118  << " was not recognized as a valid subelement for "
119  << fdetectortype << "device type (channel name=="
120  << fChannelName << ")" <<QwLog::endl;;
121  lineok=kFALSE;
122  }
123  return lineok;
124 }
static const UInt_t kInvalidSubelementIndex
Definition: QwTypes.h:191
EQwBeamInstrumentType fTypeID
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
#define QwError
Predefined log drain for errors.
Definition: QwLog.h:40

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

TString QwBeamDetectorID::fChannelName

Definition at line 53 of file QwBeamDetectorID.h.

Referenced by QwBeamDetectorID(), and ReportInitErrors().

TString QwBeamDetectorID::fdetectorname
TString QwBeamDetectorID::fdetectortype

Definition at line 48 of file QwBeamDetectorID.h.

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

Int_t QwBeamDetectorID::fIndex
TString QwBeamDetectorID::fmoduletype

Definition at line 46 of file QwBeamDetectorID.h.

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

Int_t QwBeamDetectorID::fSubbankIndex

Definition at line 39 of file QwBeamDetectorID.h.

Referenced by Print(), and QwBeamDetectorID().

UInt_t QwBeamDetectorID::fSubelement

Definition at line 52 of file QwBeamDetectorID.h.

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

TString QwBeamDetectorID::fSubelementName

Definition at line 54 of file QwBeamDetectorID.h.

Referenced by QwBeamDetectorID(), and ReportInitErrors().

Int_t QwBeamDetectorID::fWordInSubbank

Definition at line 40 of file QwBeamDetectorID.h.

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


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