35 TString varname, varvalue;
36 TString modtype, dettype, name, keyword;
37 Int_t modnum, channum;
38 Int_t currentrocread = 0;
39 Int_t currentbankread = 0;
41 Int_t currentsubbankindex = -1;
45 while (mapstr.ReadNextLine()) {
46 mapstr.TrimComment(
'!');
47 mapstr.TrimWhitespace();
48 if (mapstr.LineIsEmpty())
continue;
50 if (mapstr.HasVariablePair(
"=", varname, varvalue)) {
55 if (varname ==
"roc") {
58 }
else if (varname ==
"bank") {
59 currentbankread=value;
61 if(currentsubbankindex !=
GetSubbankIndex(currentrocread,currentbankread)){
66 Bool_t lineok = kTRUE;
69 modtype = mapstr.GetTypedNextToken<TString>();
70 modnum = mapstr.GetTypedNextToken<Int_t>();
71 channum = mapstr.GetTypedNextToken<Int_t>();
72 dettype = mapstr.GetTypedNextToken<TString>();
73 name = mapstr.GetTypedNextToken<TString>();
85 if (modtype ==
"SIS3801"){
87 }
else if(modtype ==
"SIS7200"){
89 }
else if(modtype ==
"VQWK"){
92 std::cerr <<
"Unknown module type: " << modtype <<
". Skipping channel " << name <<
'.' << std::endl;
96 if (name.Length() == 0){
101 std::size_t chan_size;
103 while ((Int_t) chan_size <= modnum) {
104 std::vector<QwSTR7200_Channel> new_module;
111 if (newChannelID.
fIndex == -1 && lineok){
158 if (index >= 0 && num_words > 0){
179 std::cout <<
"Problem reading buffer, incorrect structure of map file?" << std::endl;
341 std::cout <<
"QwMoller::ApplySingleEventCuts() ";
342 Bool_t test = kTRUE, test_1 = kTRUE;
349 std::cout <<
"***** QwMoller::SingleEventCuts()->Channel[" << i <<
"][" << j <<
"]:" <<
fSTR7200_Channel[i][j].GetElementName() << std::endl;
357 std::cout <<
"***************QwMoller Error Summary****************" << std::endl;
364 std::cout <<
"************End QwMoller Error Summary***************" << std::endl;
378 float *result =
new float[len];
395 Bool_t ldebug=kFALSE;
397 channelName.ToLower();
400 std::cout <<
"QwMollerDetector::GetDetectorIndex" << std::endl;
401 std::cout <<
"module_number: " << module_number <<
" name=" << channelName << std::endl;
409 result = nextChannel->
fIndex;
421 if (source == 0)
return kFALSE;
423 Bool_t result = kTRUE;
424 if(
typeid(*source) !=
typeid(*
this)){
426 std::cout <<
" Type mismatch! This is bypassed for now but should be fixed eventually." << std::endl;
431 std::cout <<
" Not the same number of Modules" << std::endl;
436 std::cout <<
" Different number of channels in module " << i << std::endl;
454 for(
size_t i = 0; i < max; i++){
459 std::cout <<
"0x" << std::hex << (int)
fSTR7200_Channel[j][i].GetValue() << std::dec;
465 std::cout << std::endl;
Int_t GetSubbankIndex() const
Bool_t ApplySingleEventCuts()
Apply the single event cuts.
Bool_t Compare(VQwSubsystem *source)
void ProcessOptions(QwOptions &options)
Process the command line options.
VQwSubsystem & operator-=(VQwSubsystem *value)
VQwSubsystem & operator+=(VQwSubsystem *value)
void Ratio(VQwSubsystem *value1, VQwSubsystem *value2)
Int_t LoadChannelMap(TString mapfile)
static UInt_t GetUInt(const TString &varvalue)
float * GetRawChannelArray()
void FillTreeVector(std::vector< Double_t > &values) const
Fill the tree vector.
class QwScaler_Channel< 0xffffffff, 0 > QwSTR7200_Channel
void Sum(VQwSubsystem *value1, VQwSubsystem *value2)
void AccumulateRunningSum(VQwSubsystem *value)
Update the running sums for devices.
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
static const Bool_t bDEBUG
void FillHistograms()
Fill the histograms for this subsystem.
A logfile class, based on an identical class in the Hermes analyzer.
void PrintErrorCounters() const
Report the number of events failed due to HW and event cut failures.
Int_t LoadEventCuts(TString &filename)
Int_t GetChannelIndex(TString channelName, UInt_t module_number)
VQwSubsystem & operator=(VQwSubsystem *value)
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...
UInt_t GetEventcutErrorFlag()
Return the error flag to the top level routines related to stability checks and ErrorFlag updates...
Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
The pure virtual base class of all subsystems.
Implementation of the analysis of Moller data (copied from QwComptonElectronDetector.h)
Int_t RegisterSubbank(const UInt_t bank_id)
Tell the object that it will decode data from this sub-bank in the ROC currently open for registratio...
virtual Int_t RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id=0)
Tell the object that it will decode data from this ROC and sub-bank.
Int_t fQwMollerErrorCount
std::vector< QwMollerChannelID > fMollerChannelID
void Difference(VQwSubsystem *value1, VQwSubsystem *value2)
std::vector< TString > fDetectorMapsNames
std::vector< std::vector< QwSTR7200_Channel > > fPrevious_STR7200_Channel
void ConstructBranchAndVector(TTree *, TString &, std::vector< double, std::allocator< double > > &)
void CalculateRunningAverage()
Calculate the average for all good events.
void PrintValue() const
Print values of all channels.
Int_t ProcessEvBuffer(UInt_t roc_id, UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware v...
Int_t LoadInputParameters(TString pedestalfile)
Mandatory parameter file definition.
#define RegisterSubsystemFactory(A)