20#ifdef HAS_RNTUPLE_SUPPORT
21#include "ROOT/RNTupleModel.hxx"
22#include "ROOT/RField.hxx"
38 TString varname, varvalue;
39 TString modtype, dettype, name, keyword;
40 Int_t modnum, channum;
42 Int_t currentsubbankindex = -1;
61 Bool_t lineok = kTRUE;
80 if (modtype ==
"SIS3801"){
82 }
else if(modtype ==
"SIS7200"){
84 }
else if(modtype ==
"VQWK"){
87 std::cerr <<
"Unknown module type: " << modtype <<
". Skipping channel " << name <<
'.' << std::endl;
91 if (name.Length() == 0){
96 std::size_t chan_size;
98 while ((Int_t) chan_size <= modnum) {
99 std::vector<QwSTR7200_Channel> new_module;
106 if (newChannelID.
fIndex == -1 && lineok){
154 if (index >= 0 && num_words > 0){
175 std::cout <<
"Problem reading buffer, incorrect structure of map file?" << std::endl;
236#ifdef HAS_RNTUPLE_SUPPORT
237void QwMollerDetector::ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString& prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs)
241 fSTR7200_Channel[i][j].ConstructNTupleAndVector(model, prefix, values, fieldPtrs);
246void QwMollerDetector::FillNTupleVector(std::vector<Double_t>& values)
const
258 if(
this != value &&
Compare(value)){
343 std::cout <<
"QwMoller::ApplySingleEventCuts() ";
344 Bool_t test = kTRUE, test_1 = kTRUE;
351 std::cout <<
"***** QwMoller::SingleEventCuts()->Channel[" << i <<
"][" << j <<
"]:" <<
fSTR7200_Channel[i][j].GetElementName() << std::endl;
359 std::cout <<
"***************QwMoller Error Summary****************" << std::endl;
366 std::cout <<
"************End QwMoller Error Summary***************" << std::endl;
380 float *result =
new float[len];
397 Bool_t ldebug=kFALSE;
399 channelName.ToLower();
402 std::cout <<
"QwMollerDetector::GetDetectorIndex" << std::endl;
403 std::cout <<
"module_number: " << module_number <<
" name=" << channelName << std::endl;
411 result = nextChannel->
fIndex;
423 if (source == 0)
return kFALSE;
425 Bool_t result = kTRUE;
426 if(
typeid(*source) !=
typeid(*
this)){
428 std::cout <<
" Type mismatch! This is bypassed for now but should be fixed eventually." << std::endl;
433 std::cout <<
" Not the same number of Modules" << std::endl;
438 std::cout <<
" Different number of channels in module " << i << std::endl;
456 for(
size_t i = 0; i < max; i++){
461 std::cout <<
"0x" << std::hex << (int)
fSTR7200_Channel[j][i].GetValue() << std::dec;
467 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.
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.
virtual VQwSubsystem & operator=(VQwSubsystem *value)
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...
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.
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