20#ifdef HAS_RNTUPLE_SUPPORT
21#include "ROOT/RNTupleModel.hxx"
22#include "ROOT/RField.hxx"
41 TString varname, varvalue;
42 TString modtype, dettype, name, keyword;
43 Int_t modnum, channum;
45 Int_t currentsubbankindex = -1;
64 Bool_t lineok = kTRUE;
83 if (modtype ==
"SIS3801"){
85 }
else if(modtype ==
"SIS7200"){
87 }
else if(modtype ==
"VQWK"){
90 std::cerr <<
"Unknown module type: " << modtype <<
". Skipping channel " << name <<
'.' << std::endl;
94 if (name.Length() == 0){
99 std::size_t chan_size;
101 while ((Int_t) chan_size <= modnum) {
102 std::vector<QwSTR7200_Channel> new_module;
109 if (newChannelID.
fIndex == -1 && lineok){
157 if (index >= 0 && num_words > 0){
178 std::cout <<
"Problem reading buffer, incorrect structure of map file?" << std::endl;
239#ifdef HAS_RNTUPLE_SUPPORT
240void QwMollerDetector::ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString& prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs)
244 fSTR7200_Channel[i][j].ConstructNTupleAndVector(model, prefix, values, fieldPtrs);
249void QwMollerDetector::FillNTupleVector(std::vector<Double_t>& values)
const
261 if(
this != value &&
Compare(value)){
346 std::cout <<
"QwMoller::ApplySingleEventCuts() ";
347 Bool_t test = kTRUE, test_1 = kTRUE;
354 std::cout <<
"***** QwMoller::SingleEventCuts()->Channel[" << i <<
"][" << j <<
"]:" <<
fSTR7200_Channel[i][j].GetElementName() << std::endl;
362 std::cout <<
"***************QwMoller Error Summary****************" << std::endl;
369 std::cout <<
"************End QwMoller Error Summary***************" << std::endl;
383 float *result =
new float[len];
400 Bool_t ldebug=kFALSE;
402 channelName.ToLower();
405 std::cout <<
"QwMollerDetector::GetDetectorIndex" << std::endl;
406 std::cout <<
"module_number: " << module_number <<
" name=" << channelName << std::endl;
414 result = nextChannel->
fIndex;
426 if (source == 0)
return kFALSE;
428 Bool_t result = kTRUE;
429 if(
typeid(*source) !=
typeid(*
this)){
431 std::cout <<
" Type mismatch! This is bypassed for now but should be fixed eventually." << std::endl;
436 std::cout <<
" Not the same number of Modules" << std::endl;
441 std::cout <<
" Different number of channels in module " << i << std::endl;
459 for(
size_t i = 0; i < max; i++){
464 std::cout <<
"0x" << std::hex << (int)
fSTR7200_Channel[j][i].GetValue() << std::dec;
470 std::cout << std::endl;
Base and derived classes for scaler channel data handling.
class QwScaler_Channel< 0xffffffff, 0 > QwSTR7200_Channel
A logfile class, based on an identical class in the Hermes analyzer.
Parameter file parsing and management.
#define REGISTER_SUBSYSTEM_FACTORY(A)
Moller detector analysis implementation.
Command-line and configuration file options processor.
Configuration file parser with flexible tokenization and search capabilities.
const TString GetParamFilename()
T GetTypedNextToken()
Get next token into specific type.
void TrimWhitespace(TString::EStripType head_tail=TString::kBoth)
Bool_t HasVariablePair(const std::string &separatorchars, std::string &varname, std::string &varvalue)
void TrimComment(const char commentchar)
A helper class to manage a vector of branch entries for ROOT trees.
BankID_t fCurrentBank_ID
Bank ID (and Marker word) that is currently being processed;.
Int_t GetSubbankIndex() const
std::vector< TString > fDetectorMapsNames
Names of loaded detector map files.
void RegisterRocBankMarker(QwParameterFile &mapstr)
VQwSubsystem(const TString &name)
Constructor with name.
ROCID_t fCurrentROC_ID
ROC ID that is currently being processed.
Mapping info for Moller detector channels.
Subsystem for analyzing Moller detector readout.
std::vector< std::vector< QwSTR7200_Channel > > fPrevious_STR7200_Channel
void FillHistograms() override
Fill the histograms for this subsystem.
Int_t fQwMollerErrorCount
Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words) override
TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware v...
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
void CalculateRunningAverage() override
Calculate the average for all good events.
void ProcessOptions(QwOptions &options) override
Process the command line options.
static const Bool_t bDEBUG
VQwSubsystem & operator-=(VQwSubsystem *value) override
void Ratio(VQwSubsystem *value1, VQwSubsystem *value2) override
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
Bool_t Compare(VQwSubsystem *source)
UInt_t GetEventcutErrorFlag() override
Return the error flag to the top level routines related to stability checks and ErrorFlag updates.
void PrintValue() const override
Print values of all channels.
void ProcessEvent() override
void PrintErrorCounters() const override
VQwSubsystem & operator=(VQwSubsystem *value) override
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...
Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words) override
float * GetRawChannelArray()
Int_t LoadEventCuts(TString &filename)
void AccumulateRunningSum(VQwSubsystem *value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override
Update the running sums for devices.
Int_t LoadInputParameters(TString pedestalfile) override
Mandatory parameter file definition.
Bool_t ApplySingleEventCuts() override
Apply the single event cuts.
void ConstructBranchAndVector(TTree *, TString &, QwRootTreeBranchVector &) override
Construct the branch and tree vector.
void Scale(Double_t) override
VQwSubsystem & operator+=(VQwSubsystem *value) override
Int_t LoadChannelMap(TString mapfile) override
void ClearEventData() override
QwMollerDetector()
Private default constructor (not implemented, will throw linker error on use)
Int_t GetChannelIndex(TString channelName, UInt_t module_number)
void FillTreeVector(QwRootTreeBranchVector &values) const override
Fill the tree vector.
std::vector< QwMollerChannelID > fMollerChannelID