JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
VQwDetectorArray Class Reference

Abstract base for arrays of PMT-like detectors. More...

#include <VQwDetectorArray.h>

+ Inheritance diagram for VQwDetectorArray:
+ Collaboration diagram for VQwDetectorArray:

Public Member Functions

 VQwDetectorArray (const TString &name)
 Constructor with name.
 
 VQwDetectorArray (const VQwDetectorArray &source)
 Copy constructor.
 
 ~VQwDetectorArray () override
 Virtual destructor.
 
void ProcessOptions (QwOptions &options) override
 
Int_t LoadChannelMap (TString mapfile) override
 
Int_t LoadInputParameters (TString pedestalfile) override
 Mandatory parameter file definition.
 
void LoadEventCuts_Init () override
 
void LoadEventCuts_Line (QwParameterFile &mapstr, TString &varvalue, Int_t &eventcut_flag) override
 
void LoadEventCuts_Fin (Int_t &eventcut_flag) override
 
Bool_t ApplySingleEventCuts () override
 Apply the single event cuts.
 
Bool_t CheckForBurpFail (const VQwSubsystem *subsys) override
 Report the number of events failed due to HW and event cut failures.
 
void IncrementErrorCounters () override
 Increment the error counters.
 
void PrintErrorCounters () const override
 
UInt_t GetEventcutErrorFlag () override
 Return the error flag to the top level routines related to stability checks and ErrorFlag updates.
 
void UpdateErrorFlag (const VQwSubsystem *ev_error) override
 update the error flag in the subsystem level from the top level routines related to stability checks. This will uniquely update the errorflag at each channel based on the error flag in the corresponding channel in the ev_error subsystem
 
Int_t ProcessConfigurationBuffer (const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words) override
 
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 version.
 
void ClearEventData () override
 
Bool_t IsGoodEvent ()
 
void ProcessEvent () override
 
void ExchangeProcessedData () override
 
void ProcessEvent_2 () override
 Process the event data again, including data from other subsystems. Not all derived classes will require a second stage of event data processing.
 
Bool_t PublishInternalValues () const override
 
Bool_t PublishByRequest (TString device_name) override
 
void SetRandomEventParameters (Double_t mean, Double_t sigma)
 
void SetRandomEventAsymmetry (Double_t asymmetry)
 
void RandomizeEventData (int helicity=0, Double_t time=0.0) override
 
void EncodeEventData (std::vector< UInt_t > &buffer) override
 
void RandomizeMollerEvent (int helicity)
 
void ConstructHistograms (TDirectory *folder) override
 Construct the histograms for this subsystem in a folder.
 
void ConstructHistograms (TDirectory *folder, TString &prefix) override
 Construct the histograms for this subsystem in a folder with a prefix.
 
void FillHistograms () override
 Fill the histograms for this subsystem.
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override
 Construct the branch and tree vector.
 
void ConstructBranch (TTree *tree, TString &prefix) override
 Construct the branch and tree vector.
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &trim_file) override
 Construct the branch and tree vector based on the trim file.
 
void FillTreeVector (QwRootTreeBranchVector &values) const override
 Fill the tree vector.
 
const QwIntegrationPMT * GetChannel (const TString name) const
 
Bool_t Compare (VQwSubsystem *source)
 
VQwSubsystem & operator= (VQwSubsystem *value) override
 Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsystem *value) by VQwSubsystem::operator=(value)
 
VQwSubsystem & operator+= (VQwSubsystem *value) override
 
VQwSubsystem & operator-= (VQwSubsystem *value) override
 
void Ratio (VQwSubsystem *numer, VQwSubsystem *denom) override
 
void Scale (Double_t factor) override
 
void Normalize (VQwDataElement *denom)
 
void AccumulateRunningSum (VQwSubsystem *value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override
 Update the running sums for devices.
 
void DeaccumulateRunningSum (VQwSubsystem *value, Int_t ErrorMask=0xFFFFFFF) override
 remove one entry from the running sums for devices
 
void CalculateRunningAverage () override
 Calculate the average for all good events.
 
const QwIntegrationPMT * GetIntegrationPMT (const TString name) const
 
const QwCombinedPMT * GetCombinedPMT (const TString name) const
 
void DoNormalization (Double_t factor=1.0)
 
Bool_t ApplyHWChecks ()
 
void LoadMockDataParameters (TString pedestalfile) override
 
void PrintValue () const override
 Print values of all channels.
 
void WritePromptSummary (QwPromptSummary *ps, TString type) override
 
void PrintInfo () const override
 Print some information about the subsystem.
 
void PrintDetectorID () const
 
virtual void ConstructHistograms ()
 Construct the histograms for this subsystem.
 
virtual void ConstructHistograms (TString &prefix)
 Construct the histograms for this subsystem with a prefix.
 
virtual void ConstructBranchAndVector (TTree *tree, QwRootTreeBranchVector &values)
 Construct the branch and tree vector.
 
- Public Member Functions inherited from VQwSubsystemParity
 VQwSubsystemParity (const TString &name)
 Constructor with name.
 
 VQwSubsystemParity (const VQwSubsystemParity &source)
 Copy constructor.
 
 ~VQwSubsystemParity () override
 Default destructor.
 
virtual void FillDB_MPS (QwParityDB *, TString)
 Fill the database with MPS-based variables Note that most subsystems don't need to do this.
 
virtual void FillDB (QwParityDB *, TString)
 Fill the database.
 
virtual void FillErrDB (QwParityDB *, TString)
 
virtual void Sum (VQwSubsystem *value1, VQwSubsystem *value2)
 
virtual void Difference (VQwSubsystem *value1, VQwSubsystem *value2)
 
Int_t LoadEventCuts (TString filename) override
 Load the event cuts file.
 
virtual UInt_t UpdateErrorFlag ()
 Uses the error flags of contained data elements to update Returns the error flag to the top level routines related to stability checks and ErrorFlag updates.
 
virtual void Blind (const QwBlinder *)
 Blind the asymmetry of this subsystem.
 
virtual void Blind (const QwBlinder *, const VQwSubsystemParity *)
 Blind the difference of this subsystem.
 
virtual Bool_t CheckForEndOfBurst () const
 
- Public Member Functions inherited from VQwSubsystem
 VQwSubsystem (const TString &name)
 Constructor with name.
 
 VQwSubsystem (const VQwSubsystem &orig)
 Copy constructor by object.
 
 ~VQwSubsystem () override
 Default destructor.
 
TString GetName () const
 
Bool_t HasDataLoaded () const
 
VQwSubsystem * GetSibling (const std::string &name) const
 Get the sibling with specified name.
 
virtual std::vector< TString > GetParamFileNameList ()
 
virtual std::map< TString, TString > GetDetectorMaps ()
 
Bool_t PublishByRequest (TString) override
 Try to publish an internal variable matching the submitted name.
 
Bool_t PublishInternalValues () const override
 Publish all variables of the subsystem.
 
virtual Int_t LoadDetectorMaps (QwParameterFile &file)
 Parse parameter file to find the map files.
 
virtual Int_t LoadGeometryDefinition (TString)
 Optional geometry definition.
 
virtual Int_t LoadCrosstalkDefinition (TString)
 Optional crosstalk definition.
 
void SetEventTypeMask (const UInt_t mask)
 Set event type mask.
 
UInt_t GetEventTypeMask () const
 Get event type mask.
 
virtual Int_t ProcessEvBuffer (const UInt_t event_type, const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words)
 
virtual void AtEndOfEventLoop ()
 Perform actions at the end of the event loop.
 
virtual void RandomizeEventData (int=0, double=0.0)
 
virtual void ConstructObjects ()
 Construct the objects for this subsystem.
 
virtual void ConstructObjects (TDirectory *folder)
 Construct the objects for this subsystem in a folder.
 
virtual void ConstructObjects (TString &prefix)
 Construct the objects for this subsystem with a prefix.
 
virtual void ConstructObjects (TDirectory *, TString &)
 Construct the objects for this subsystem in a folder with a prefix.
 
virtual void ConstructTree ()
 Construct the tree for this subsystem.
 
virtual void ConstructTree (TDirectory *folder)
 Construct the tree for this subsystem in a folder.
 
virtual void ConstructTree (TString &prefix)
 Construct the tree for this subsystem with a prefix.
 
virtual void ConstructTree (TDirectory *, TString &)
 Construct the tree for this subsystem in a folder with a prefix.
 
virtual void FillTree ()
 Fill the tree for this subsystem.
 
virtual void DeleteTree ()
 Delete the tree for this subsystem.
 
virtual void PrintDetectorMaps (Bool_t status) const
 
void GetMarkerWordList (const ROCID_t roc_id, const BankID_t bank_id, std::vector< UInt_t > &marker) const
 
std::vector< ROCID_t > GetROCIds () const
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects.
 
- Public Member Functions inherited from MQwPublishable_child< QwSubsystemArray, VQwSubsystem >
 MQwPublishable_child ()
 Default constructor Initializes the child object and sets up self-reference for publishing.
 
 MQwPublishable_child (const MQwPublishable_child &source)
 Copy constructor.
 
virtual ~MQwPublishable_child ()
 Virtual destructor.
 
void SetParent (QwSubsystemArray *parent)
 Set the parent container for this child object.
 
QwSubsystemArray * GetParent () const
 Get the parent container for this child object.
 

Static Public Member Functions

static void DefineOptions (QwOptions &options)
 Define options function.
 
- Static Public Member Functions inherited from VQwSubsystem
static void DefineOptions ()
 Define options function (note: no virtual static functions in C++)
 

Protected Member Functions

EQwPMTInstrumentType GetDetectorTypeID (TString name)
 
Int_t GetDetectorIndex (EQwPMTInstrumentType TypeID, TString name)
 
void ClearAllBankRegistrations ()
 Clear all registration of ROC and Bank IDs for this subsystem.
 
virtual Int_t RegisterROCNumber (const ROCID_t roc_id, const BankID_t bank_id=0)
 Tell the object that it will decode data from this ROC and sub-bank.
 
Int_t RegisterSubbank (const BankID_t bank_id)
 Tell the object that it will decode data from this sub-bank in the ROC currently open for registration.
 
Int_t RegisterMarkerWord (const UInt_t markerword)
 
void RegisterRocBankMarker (QwParameterFile &mapstr)
 
Int_t GetSubbankIndex () const
 
Int_t GetSubbankIndex (const ROCID_t roc_id, const BankID_t bank_id) const
 
void SetDataLoaded (Bool_t flag)
 
template<class T>
Int_t FindIndex (const std::vector< T > &myvec, const T value) const
 
Bool_t Compare (VQwSubsystem *source)
 
- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor.
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor.
 
virtual ~MQwHistograms ()
 Virtual destructor.
 
MQwHistograms & operator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram.
 
- Protected Member Functions inherited from MQwPublishable_child< QwSubsystemArray, VQwSubsystem >
Bool_t RequestExternalValue (const TString &name, VQwHardwareChannel *value) const
 Retrieve the variable name from other subsystem arrays Get the value corresponding to some variable name from a different data array.
 
const VQwHardwareChannel * RequestExternalPointer (const TString &name) const
 Retrieve a pointer to an external variable by name Requests a direct pointer to a variable from sibling subsystems via the parent container.
 
Bool_t PublishInternalValue (const TString name, const TString desc, const VQwHardwareChannel *element) const
 Publish a variable from this child into the parent container.
 

Protected Attributes

Bool_t fDEBUG
 
std::vector< QwIntegrationPMT > fIntegrationPMT
 
std::vector< QwCombinedPMT > fCombinedPMT
 
std::vector< QwDetectorArrayID > fMainDetID
 
QwBeamCharge fTargetCharge
 
QwBeamPosition fTargetX
 
QwBeamPosition fTargetY
 
QwBeamAngle fTargetXprime
 
QwBeamAngle fTargetYprime
 
QwBeamEnergy fTargetEnergy
 
Bool_t bIsExchangedDataValid
 
Bool_t bNormalization
 
Double_t fNormThreshold
 
- Protected Attributes inherited from VQwSubsystem
std::vector< std::vector< TString > > fPublishList
 
TString fSystemName
 Name of this subsystem.
 
UInt_t fEventTypeMask
 Mask of event types.
 
Bool_t fIsDataLoaded
 Has this subsystem gotten data to be processed?
 
std::vector< TString > fDetectorMapsNames
 Names of loaded detector map files.
 
std::map< TString, TString > fDetectorMaps
 Map of file name to full path or content.
 
ROCID_t fCurrentROC_ID
 ROC ID that is currently being processed.
 
BankID_t fCurrentBank_ID
 Bank ID (and Marker word) that is currently being processed;.
 
std::vector< ROCID_t > fROC_IDs
 Vector of ROC IDs associated with this subsystem.
 
std::vector< std::vector< BankID_t > > fBank_IDs
 Vector of Bank IDs per ROC ID associated with this subsystem.
 
std::vector< std::vector< std::vector< UInt_t > > > fMarkerWords
 Vector of marker words per ROC & subbank associated with this subsystem.
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptr > fHistograms
 Histograms associated with this data element.
 

Private Member Functions

 VQwDetectorArray ()
 Private default constructor (not implemented, will throw linker error on use)
 

Private Attributes

Int_t fMainDetErrorCount
 

Static Private Attributes

static const Bool_t bDEBUG =kFALSE
 

Detailed Description

Abstract base for arrays of PMT-like detectors.

Provides common functionality for subsystems composed of multiple integration PMTs and combined PMTs, including normalization, histogram/NTuple construction, and running statistics.

Definition at line 79 of file VQwDetectorArray.h.

Constructor & Destructor Documentation

◆ VQwDetectorArray() [1/3]

VQwDetectorArray::VQwDetectorArray ( )
private

Private default constructor (not implemented, will throw linker error on use)

Referenced by AccumulateRunningSum(), CheckForBurpFail(), Compare(), DeaccumulateRunningSum(), operator+=(), operator-=(), operator=(), QwBlindDetectorArray::QwBlindDetectorArray(), QwBlindDetectorArray::QwBlindDetectorArray(), QwDetectorArray::QwDetectorArray(), QwDetectorArray::QwDetectorArray(), Ratio(), UpdateErrorFlag(), and VQwDetectorArray().

+ Here is the caller graph for this function:

◆ VQwDetectorArray() [2/3]

VQwDetectorArray::VQwDetectorArray ( const TString & name)
inline

Constructor with name.

Definition at line 95 of file VQwDetectorArray.h.

97
98 fTargetCharge.InitializeChannel("q_targ","derived");
99 fTargetX.InitializeChannel("x_targ","derived");
100 fTargetY.InitializeChannel("y_targ","derived");
101 fTargetXprime.InitializeChannel("xp_targ","derived");
102 fTargetYprime.InitializeChannel("yp_targ","derived");
103 fTargetEnergy.InitializeChannel("e_targ","derived");
104
105 };
QwBeamPosition fTargetX
QwBeamAngle fTargetXprime
QwBeamPosition fTargetY
QwBeamAngle fTargetYprime
QwBeamCharge fTargetCharge
QwBeamEnergy fTargetEnergy
VQwSubsystemParity()
Private default constructor (not implemented, will throw linker error on use)

References bNormalization, fTargetCharge, fTargetEnergy, fTargetX, fTargetXprime, fTargetY, fTargetYprime, VQwSubsystem::VQwSubsystem(), and VQwSubsystemParity::VQwSubsystemParity().

+ Here is the call graph for this function:

◆ VQwDetectorArray() [3/3]

VQwDetectorArray::VQwDetectorArray ( const VQwDetectorArray & source)
inline

Copy constructor.

Definition at line 109 of file VQwDetectorArray.h.

110 :VQwSubsystem(source),VQwSubsystemParity(source),
113 fMainDetID(source.fMainDetID){}
std::vector< QwIntegrationPMT > fIntegrationPMT
std::vector< QwDetectorArrayID > fMainDetID
std::vector< QwCombinedPMT > fCombinedPMT

References fCombinedPMT, fIntegrationPMT, fMainDetID, VQwDetectorArray(), VQwSubsystem::VQwSubsystem(), and VQwSubsystemParity::VQwSubsystemParity().

+ Here is the call graph for this function:

◆ ~VQwDetectorArray()

VQwDetectorArray::~VQwDetectorArray ( )
inlineoverride

Virtual destructor.

Definition at line 117 of file VQwDetectorArray.h.

117{ };

Member Function Documentation

◆ AccumulateRunningSum()

void VQwDetectorArray::AccumulateRunningSum ( VQwSubsystem * value,
Int_t count = 0,
Int_t ErrorMask = 0xFFFFFFF )
overridevirtual

Update the running sums for devices.

Implements VQwSubsystemParity.

Definition at line 1554 of file VQwDetectorArray.cc.

1554 {
1555
1556 if (Compare(value1)) {
1557
1558 VQwDetectorArray* value = dynamic_cast<VQwDetectorArray*>(value1);
1559
1560 for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1561 fIntegrationPMT[i].AccumulateRunningSum(value->fIntegrationPMT[i], count, ErrorMask);
1562
1563 for (size_t i = 0; i < fCombinedPMT.size(); i++)
1564 fCombinedPMT[i].AccumulateRunningSum(value->fCombinedPMT[i], count, ErrorMask);
1565
1566 }
1567
1568}
void AccumulateRunningSum(VQwSubsystem *value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override
Update the running sums for devices.
VQwDetectorArray()
Private default constructor (not implemented, will throw linker error on use)
Bool_t Compare(VQwSubsystem *source)

References AccumulateRunningSum(), Compare(), fCombinedPMT, fIntegrationPMT, VQwDetectorArray(), and VQwSubsystem::VQwSubsystem().

Referenced by AccumulateRunningSum().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ApplyHWChecks()

Bool_t VQwDetectorArray::ApplyHWChecks ( )
inline

Definition at line 213 of file VQwDetectorArray.h.

213 {//Check for hardware errors in the devices
214
215 Bool_t status = kTRUE;
216
217 for (size_t i=0; i<fIntegrationPMT.size(); i++){
218
219 status &= fIntegrationPMT.at(i).ApplyHWChecks();
220
221 }
222
223 return status;
224
225 };

References fIntegrationPMT.

◆ ApplySingleEventCuts()

Bool_t VQwDetectorArray::ApplySingleEventCuts ( )
overridevirtual

Apply the single event cuts.

Implements VQwSubsystemParity.

Definition at line 1069 of file VQwDetectorArray.cc.

1069 {
1070
1071 Bool_t status=kTRUE;
1072 for(size_t i=0;i<fIntegrationPMT.size();i++){
1073
1074 status &= fIntegrationPMT[i].ApplySingleEventCuts();
1075 if(!status && bDEBUG)
1076 std::cout<<"******* VQwDetectorArray::SingleEventCuts()->IntegrationPMT[ "<<i<<" , "<<fIntegrationPMT[i].GetElementName()<<" ] ******\n";
1077 }
1078
1079 for(size_t i=0;i<fCombinedPMT.size();i++){
1080
1081 status &= fCombinedPMT[i].ApplySingleEventCuts();
1082 if(!status && bDEBUG)
1083 std::cout<<"******* VQwDetectorArray::SingleEventCuts()->CombinedPMT[ "<<i<<" , "<<fCombinedPMT[i].GetElementName()<<" ] ******\n";
1084 }
1085
1086 if (!status)
1087 fMainDetErrorCount++; //failed event counter for VQwDetectorArray
1088
1089 return status;
1090}
static const Bool_t bDEBUG

References bDEBUG, fCombinedPMT, fIntegrationPMT, and fMainDetErrorCount.

◆ CalculateRunningAverage()

void VQwDetectorArray::CalculateRunningAverage ( )
overridevirtual

Calculate the average for all good events.

Implements VQwSubsystemParity.

Definition at line 1541 of file VQwDetectorArray.cc.

1541 {
1542
1543 for (size_t i=0;i<fIntegrationPMT.size();i++)
1545
1546 for (size_t i=0;i<fCombinedPMT.size();i++)
1548
1549 return;
1550
1551}
void CalculateRunningAverage() override
Calculate the average for all good events.

References CalculateRunningAverage(), fCombinedPMT, and fIntegrationPMT.

Referenced by CalculateRunningAverage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckForBurpFail()

Bool_t VQwDetectorArray::CheckForBurpFail ( const VQwSubsystem * subsys)
overridevirtual

Report the number of events failed due to HW and event cut failures.

Implements VQwSubsystemParity.

Definition at line 1155 of file VQwDetectorArray.cc.

1155 {
1156
1157 Bool_t burpstatus = kFALSE;
1158 VQwSubsystem* tmp = const_cast<VQwSubsystem *>(subsys);
1159
1160 if(Compare(tmp)) {
1161
1162 const VQwDetectorArray* input = dynamic_cast<const VQwDetectorArray*>(subsys);
1163
1164 for(size_t i=0;i<input->fIntegrationPMT.size();i++)
1165 burpstatus |= (this->fIntegrationPMT[i]).CheckForBurpFail(&(input->fIntegrationPMT[i]));
1166
1167 for(size_t i=0;i<input->fCombinedPMT.size();i++)
1168 burpstatus |= (this->fCombinedPMT[i]).CheckForBurpFail(&(input->fCombinedPMT[i]));
1169
1170 }
1171
1172 return burpstatus;
1173
1174}
VQwSubsystem(const TString &name)
Constructor with name.

References Compare(), fCombinedPMT, fIntegrationPMT, VQwDetectorArray(), and VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ ClearEventData()

void VQwDetectorArray::ClearEventData ( )
overridevirtual

Implements VQwSubsystem.

Definition at line 814 of file VQwDetectorArray.cc.

814 {
815
816 for (size_t i=0;i<fIntegrationPMT.size();i++){
817
818 fIntegrationPMT[i].ClearEventData();
819
820 }
821
822 for (size_t i=0;i<fCombinedPMT.size();i++)
824
825 return;
826
827}
void ClearEventData() override

References ClearEventData(), fCombinedPMT, and fIntegrationPMT.

Referenced by ClearEventData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Compare()

Bool_t VQwDetectorArray::Compare ( VQwSubsystem * source)

Definition at line 1404 of file VQwDetectorArray.cc.

1404 {
1405
1406 // std::cout<<" Here in VQwDetectorArray::Compare \n";
1407
1408 Bool_t res=kTRUE;
1409
1410 if (typeid(*value)!=typeid(*this)) {
1411
1412 res=kFALSE;
1413 //std::cout<<" types are not ok \n";
1414 //std::cout<<" this is bypassed just for now but should be fixed eventually \n";
1415
1416 } else {
1417
1418 VQwDetectorArray* input = dynamic_cast<VQwDetectorArray*>(value);
1419
1420 if (input->fIntegrationPMT.size()!=fIntegrationPMT.size()
1421 || input->fCombinedPMT.size()!=fCombinedPMT.size() ) {
1422
1423 res=kFALSE;
1424 //std::cout<<" not the same number of channels \n";
1425
1426 }
1427
1428 }
1429
1430 return res;
1431
1432}

References fCombinedPMT, fIntegrationPMT, VQwDetectorArray(), and VQwSubsystem::VQwSubsystem().

Referenced by AccumulateRunningSum(), QwBlindDetectorArray::Blind(), CheckForBurpFail(), DeaccumulateRunningSum(), operator+=(), operator-=(), operator=(), Ratio(), and UpdateErrorFlag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConstructBranch() [1/2]

void VQwDetectorArray::ConstructBranch ( TTree * tree,
TString & prefix )
overridevirtual

Construct the branch and tree vector.

Construct the branches for this subsystem.

Parameters
treeOutput ROOT tree.
prefixName prefix for all branch names.

Implements VQwSubsystem.

Definition at line 1315 of file VQwDetectorArray.cc.

1315 {
1316
1317 for (size_t i=0;i<fIntegrationPMT.size();i++)
1318 fIntegrationPMT[i].ConstructBranch(tree, prefix);
1319
1320 for (size_t i=0;i<fCombinedPMT.size();i++)
1321 fCombinedPMT[i].ConstructBranch(tree, prefix);
1322
1323 return;
1324
1325}
void ConstructBranch(TTree *tree, TString &prefix) override
Construct the branch and tree vector.

References ConstructBranch(), fCombinedPMT, and fIntegrationPMT.

Referenced by ConstructBranch(), and ConstructBranch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConstructBranch() [2/2]

void VQwDetectorArray::ConstructBranch ( TTree * tree,
TString & prefix,
QwParameterFile & trim_file )
overridevirtual

Construct the branch and tree vector based on the trim file.

Construct the branches for this subsystem using a trim file.

Parameters
treeOutput ROOT tree.
prefixName prefix for all branch names.
trim_fileTrim file describing which branches to construct.

Implements VQwSubsystem.

Definition at line 1327 of file VQwDetectorArray.cc.

1327 {
1328
1329 TString tmp;
1330 std::unique_ptr<QwParameterFile> nextmodule;
1331 trim_file.RewindToFileStart();
1332 tmp="QwIntegrationPMT";
1333 trim_file.RewindToFileStart();
1334
1335 if (trim_file.FileHasModuleHeader(tmp)){
1336
1337 nextmodule=trim_file.ReadUntilNextModule();//This section contains sub modules and or channels to be included in the tree
1338
1339 for (size_t i=0;i<fIntegrationPMT.size();i++)
1340 fIntegrationPMT[i].ConstructBranch(tree, prefix, *nextmodule);
1341
1342 }
1343
1344 tmp="QwCombinedPMT";
1345 trim_file.RewindToFileStart();
1346
1347 if (trim_file.FileHasModuleHeader(tmp)){
1348
1349 nextmodule=trim_file.ReadUntilNextModule();//This section contains sub modules and or channels to be included in the tree
1350
1351 for (size_t i=0;i<fCombinedPMT.size();i++)
1352 fCombinedPMT[i].ConstructBranch(tree, prefix, *nextmodule );
1353 }
1354
1355 return;
1356}
std::unique_ptr< QwParameterFile > ReadUntilNextModule(const bool add_current_line=false)
Bool_t FileHasModuleHeader(const std::string &secname)

References ConstructBranch(), fCombinedPMT, QwParameterFile::FileHasModuleHeader(), fIntegrationPMT, QwParameterFile::ReadUntilNextModule(), and QwParameterFile::RewindToFileStart().

+ Here is the call graph for this function:

◆ ConstructBranchAndVector() [1/2]

virtual void VQwSubsystem::ConstructBranchAndVector ( TTree * tree,
QwRootTreeBranchVector & values )
inlinevirtual

Construct the branch and tree vector.

Reimplemented from VQwSubsystem.

Definition at line 303 of file VQwSubsystem.h.

303 {
304 TString tmpstr("");
305 ConstructBranchAndVector(tree,tmpstr,values);
306 };
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override
Construct the branch and tree vector.

◆ ConstructBranchAndVector() [2/2]

void VQwDetectorArray::ConstructBranchAndVector ( TTree * tree,
TString & prefix,
QwRootTreeBranchVector & values )
overridevirtual

Construct the branch and tree vector.

Construct the branch and fill the provided values vector.

Parameters
treeOutput ROOT tree to which branches are added.
prefixName prefix for all branch names.
valuesVector that will be filled by FillTreeVector.

Implements VQwSubsystem.

Definition at line 1303 of file VQwDetectorArray.cc.

1303 {
1304
1305 for (size_t i=0;i<fIntegrationPMT.size();i++)
1306 fIntegrationPMT[i].ConstructBranchAndVector(tree, prefix, values);
1307
1308 for (size_t i=0;i<fCombinedPMT.size();i++)
1309 fCombinedPMT[i].ConstructBranchAndVector(tree, prefix, values);
1310
1311 return;
1312
1313}

References ConstructBranchAndVector(), fCombinedPMT, and fIntegrationPMT.

Referenced by ConstructBranchAndVector().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConstructHistograms() [1/4]

virtual void VQwSubsystem::ConstructHistograms ( )
inlinevirtual

Construct the histograms for this subsystem.

Reimplemented from VQwSubsystem.

Definition at line 270 of file VQwSubsystem.h.

270 {
271 TString tmpstr("");
272 ConstructHistograms((TDirectory*) NULL, tmpstr);
273 };
virtual void ConstructHistograms()
Construct the histograms for this subsystem.

Referenced by ConstructHistograms(), and ConstructHistograms().

+ Here is the caller graph for this function:

◆ ConstructHistograms() [2/4]

void VQwDetectorArray::ConstructHistograms ( TDirectory * folder)
inlineoverridevirtual

Construct the histograms for this subsystem in a folder.

Reimplemented from VQwSubsystem.

Definition at line 163 of file VQwDetectorArray.h.

163 {
164
165 TString tmpstr("");
166 ConstructHistograms(folder,tmpstr);
167 };

References ConstructHistograms().

+ Here is the call graph for this function:

◆ ConstructHistograms() [3/4]

void VQwDetectorArray::ConstructHistograms ( TDirectory * folder,
TString & prefix )
overridevirtual

Construct the histograms for this subsystem in a folder with a prefix.

Implements VQwSubsystem.

Definition at line 1277 of file VQwDetectorArray.cc.

1277 {
1278
1279 for (size_t i=0;i<fIntegrationPMT.size();i++)
1280 fIntegrationPMT[i].ConstructHistograms(folder,prefix);
1281
1282 for (size_t i=0;i<fCombinedPMT.size();i++)
1283 fCombinedPMT[i].ConstructHistograms(folder,prefix);
1284
1285 return;
1286
1287}

References ConstructHistograms(), fCombinedPMT, and fIntegrationPMT.

+ Here is the call graph for this function:

◆ ConstructHistograms() [4/4]

virtual void VQwSubsystem::ConstructHistograms ( TString & prefix)
inlinevirtual

Construct the histograms for this subsystem with a prefix.

Reimplemented from VQwSubsystem.

Definition at line 280 of file VQwSubsystem.h.

280 {
281 ConstructHistograms((TDirectory*) NULL, prefix);
282 };

◆ DeaccumulateRunningSum()

void VQwDetectorArray::DeaccumulateRunningSum ( VQwSubsystem * value,
Int_t ErrorMask = 0xFFFFFFF )
overridevirtual

remove one entry from the running sums for devices

Implements VQwSubsystemParity.

Definition at line 1570 of file VQwDetectorArray.cc.

1570 {
1571
1572 if (Compare(value1)) {
1573
1574 VQwDetectorArray* value = dynamic_cast<VQwDetectorArray*>(value1);
1575
1576 for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1578
1579 for (size_t i = 0; i < fCombinedPMT.size(); i++)
1580 fCombinedPMT[i].DeaccumulateRunningSum(value->fCombinedPMT[i], ErrorMask);
1581
1582 }
1583
1584}
void DeaccumulateRunningSum(VQwSubsystem *value, Int_t ErrorMask=0xFFFFFFF) override
remove one entry from the running sums for devices

References Compare(), DeaccumulateRunningSum(), fCombinedPMT, fIntegrationPMT, VQwDetectorArray(), and VQwSubsystem::VQwSubsystem().

Referenced by DeaccumulateRunningSum().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DefineOptions()

void VQwDetectorArray::DefineOptions ( QwOptions & options)
static

Define options function.

Define command-line options for detector array normalization.

Parameters
optionsOptions object to configure.

Definition at line 36 of file VQwDetectorArray.cc.

36 {
37 // Define the execution options
38 options.AddOptions()
39 ("QwDetectorArray.normalize",
40 po::value<bool>()->default_bool_value(true),
41 "Normalize the detectors by beam current");
42
43 options.AddOptions()
44 ("QwDetectorArray.norm_threshold",
45 po::value<double>()->default_value(2.5),
46 "Normalize the detectors for currents above this value");
47}
po::options_description_easy_init AddOptions(const std::string &blockname="Specialized options")
Add an option to a named block or create new block.
Definition QwOptions.h:170

References QwOptions::AddOptions().

+ Here is the call graph for this function:

◆ DoNormalization()

void VQwDetectorArray::DoNormalization ( Double_t factor = 1.0)

Definition at line 1669 of file VQwDetectorArray.cc.

1669 {
1670
1672
1673 try {
1674
1675 this->Normalize(&fTargetCharge);
1676
1677 }
1678
1679 catch (std::exception& e) {
1680
1681 std::cerr << e.what() << std::endl;
1682
1683 }
1684
1685 }
1686
1687}
void Normalize(VQwDataElement *denom)

References bIsExchangedDataValid, fTargetCharge, and Normalize().

Referenced by ProcessEvent_2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EncodeEventData()

void VQwDetectorArray::EncodeEventData ( std::vector< UInt_t > & buffer)
overridevirtual

Reimplemented from VQwSubsystem.

Definition at line 868 of file VQwDetectorArray.cc.

868 {
869
870 std::vector<UInt_t> elements;
871 elements.clear();
872
873 // Get all buffers in the order they are defined in the map file
874 for (size_t i = 0; i < fMainDetID.size(); i++) {
875
876 // This is a QwIntegrationPMT
877 if (fMainDetID.at(i).fTypeID == kQwIntegrationPMT)
878 fIntegrationPMT[fMainDetID.at(i).fIndex].EncodeEventData(elements);
879
880 }
881
882
883 // If there is element data, generate the subbank header
884 std::vector<UInt_t> subbankheader;
885 std::vector<UInt_t> rocheader;
886
887 if (elements.size() > 0) {
888
889 // Form CODA subbank header
890 subbankheader.clear();
891 subbankheader.push_back(elements.size() + 1); // subbank size
892 subbankheader.push_back((fCurrentBank_ID << 16) | (0x01 << 8) | (1 & 0xff));
893 // subbank tag | subbank type | event number
894
895 // Form CODA bank/roc header
896 rocheader.clear();
897 rocheader.push_back(subbankheader.size() + elements.size() + 1); // bank/roc size
898 rocheader.push_back((fCurrentROC_ID << 16) | (0x10 << 8) | (1 & 0xff));
899 // bank tag == ROC | bank type | event number
900
901 // Add bank header, subbank header and element data to output buffer
902 buffer.insert(buffer.end(), rocheader.begin(), rocheader.end());
903 buffer.insert(buffer.end(), subbankheader.begin(), subbankheader.end());
904 buffer.insert(buffer.end(), elements.begin(), elements.end());
905
906 }
907
908}
@ kQwIntegrationPMT
Definition QwTypes.h:137
BankID_t fCurrentBank_ID
Bank ID (and Marker word) that is currently being processed;.
ROCID_t fCurrentROC_ID
ROC ID that is currently being processed.

References VQwSubsystem::fCurrentBank_ID, VQwSubsystem::fCurrentROC_ID, fIntegrationPMT, fMainDetID, and kQwIntegrationPMT.

◆ ExchangeProcessedData()

void VQwDetectorArray::ExchangeProcessedData ( )
overridevirtual

Exchange data between subsystems

Reimplemented from VQwSubsystem.

Definition at line 1216 of file VQwDetectorArray.cc.

1216 {
1217
1218 //QwWarning << "VQwDetectorArray::ExchangeProcessedData "<< QwLog::endl;
1219 bIsExchangedDataValid = kTRUE;
1220
1221 if (1==1 || bNormalization) {
1222
1223 if(RequestExternalValue("q_targ", &fTargetCharge)) {
1224
1225 if (bDEBUG) {
1226
1227 QwWarning << "VQwDetectorArray::ExchangeProcessedData Found "<<fTargetCharge.GetElementName()<< QwLog::endl;
1228 //QwWarning <<"****VQwDetectorArray****"<< QwLog::endl;
1229 (dynamic_cast<QwMollerADC_Channel*>(&fTargetCharge))->PrintInfo();
1230
1231 }
1232
1233 } else {
1234
1235 bIsExchangedDataValid = kFALSE;
1236 QwError << GetName() << " could not get external value for "
1237 << fTargetCharge.GetElementName() << QwLog::endl;
1238
1239 }
1240
1241 }
1242
1243}
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44
Bool_t RequestExternalValue(const TString &name, VQwHardwareChannel *value) const
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
TString GetName() const
void PrintInfo() const override
Print some information about the subsystem.

References bDEBUG, bIsExchangedDataValid, bNormalization, QwLog::endl(), fTargetCharge, VQwSubsystem::GetName(), PrintInfo(), QwError, QwWarning, and MQwPublishable_child< QwSubsystemArray, VQwSubsystem >::RequestExternalValue().

+ Here is the call graph for this function:

◆ FillHistograms()

void VQwDetectorArray::FillHistograms ( )
overridevirtual

Fill the histograms for this subsystem.

Implements VQwSubsystem.

Definition at line 1290 of file VQwDetectorArray.cc.

1290 {
1291
1292 for (size_t i=0;i<fIntegrationPMT.size();i++)
1294
1295 for (size_t i=0;i<fCombinedPMT.size();i++)
1297
1298 return;
1299
1300}
void FillHistograms() override
Fill the histograms for this subsystem.

References fCombinedPMT, FillHistograms(), and fIntegrationPMT.

Referenced by FillHistograms().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FillTreeVector()

void VQwDetectorArray::FillTreeVector ( QwRootTreeBranchVector & values) const
overridevirtual

Fill the tree vector.

Fill the tree export vector with the current event values.

Parameters
valuesOutput vector to be filled.

Implements VQwSubsystem.

Definition at line 1358 of file VQwDetectorArray.cc.

1358 {
1359
1360 for (size_t i=0;i<fIntegrationPMT.size();i++)
1362
1363 for (size_t i=0;i<fCombinedPMT.size();i++)
1364 fCombinedPMT[i].FillTreeVector(values);
1365
1366 return;
1367
1368}
void FillTreeVector(QwRootTreeBranchVector &values) const override
Fill the tree vector.

References fCombinedPMT, FillTreeVector(), and fIntegrationPMT.

Referenced by FillTreeVector().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetChannel()

const QwIntegrationPMT * VQwDetectorArray::GetChannel ( const TString name) const

Definition at line 1397 of file VQwDetectorArray.cc.

1397 {
1398
1399 return GetIntegrationPMT(name);
1400
1401}
const QwIntegrationPMT * GetIntegrationPMT(const TString name) const

References GetIntegrationPMT().

Referenced by PublishByRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCombinedPMT()

const QwCombinedPMT * VQwDetectorArray::GetCombinedPMT ( const TString name) const

Definition at line 1651 of file VQwDetectorArray.cc.

1651 {
1652 TString tmpname = name;
1653 tmpname.ToLower();
1654 if (! fCombinedPMT.empty())
1655 {
1656 for (size_t i=0;i<fCombinedPMT.size();i++)
1657 {
1658 if (fCombinedPMT.at(i).GetElementName() == tmpname)
1659 {
1660 //std::cout<<"Get CombinedPMT "<<tmpname<<std::endl;
1661 return &(fCombinedPMT.at(i));
1662 }
1663 }
1664 }
1665 QwMessage << "VQwDetectorArray::GetCombinedPMT: cannot find channel " << tmpname << QwLog::endl;
1666 return NULL;
1667}
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49

References QwLog::endl(), fCombinedPMT, and QwMessage.

Referenced by PublishInternalValues().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDetectorIndex()

Int_t VQwDetectorArray::GetDetectorIndex ( EQwPMTInstrumentType TypeID,
TString name )
protected

Definition at line 1595 of file VQwDetectorArray.cc.

1595 {
1596
1597 Bool_t ldebug=kFALSE;
1598
1599 if (ldebug) {
1600
1601 std::cout<<"VQwDetectorArray::GetDetectorIndex\n";
1602 std::cout<<"type_id=="<<type_id<<" name="<<name<<"\n";
1603 std::cout<<fMainDetID.size()<<" already registered detector\n";
1604 }
1605
1606 Int_t result=-1;
1607 for (size_t i=0;i<fMainDetID.size();i++) {
1608
1609 if (fMainDetID[i].fTypeID==type_id)
1610 if (fMainDetID[i].fdetectorname==name) {
1611
1612 result=fMainDetID[i].fIndex;
1613
1614 if (ldebug)
1615 std::cout<<"testing against ("<<fMainDetID[i].fTypeID
1616 <<","<<fMainDetID[i].fdetectorname<<")=>"<<result<<"\n";
1617
1618 }
1619 }
1620
1621 return result;
1622
1623}

References fMainDetID.

Referenced by LoadChannelMap(), and LoadEventCuts_Line().

+ Here is the caller graph for this function:

◆ GetDetectorTypeID()

EQwPMTInstrumentType VQwDetectorArray::GetDetectorTypeID ( TString name)
protected

Definition at line 1587 of file VQwDetectorArray.cc.

1587 {
1588
1589 return GetQwPMTInstrumentType(name);
1590
1591}
EQwPMTInstrumentType GetQwPMTInstrumentType(TString name)
Definition QwTypes.cc:16

References GetQwPMTInstrumentType().

Referenced by LoadChannelMap(), and LoadEventCuts_Line().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEventcutErrorFlag()

UInt_t VQwDetectorArray::GetEventcutErrorFlag ( )
overridevirtual

Return the error flag to the top level routines related to stability checks and ErrorFlag updates.

Implements VQwSubsystemParity.

Definition at line 1093 of file VQwDetectorArray.cc.

1093 { //return the error flag
1094
1095 UInt_t ErrorFlag;
1096
1097 ErrorFlag=0;
1098
1099 for(size_t i=0;i<fIntegrationPMT.size();i++){
1100
1101 ErrorFlag |= fIntegrationPMT[i].GetEventcutErrorFlag();
1102
1103 }
1104
1105 for(size_t i=0;i<fCombinedPMT.size();i++){
1106
1107 ErrorFlag |= fCombinedPMT[i].GetEventcutErrorFlag();
1108
1109 }
1110
1111 return ErrorFlag;
1112
1113}

References fCombinedPMT, and fIntegrationPMT.

◆ GetIntegrationPMT()

const QwIntegrationPMT * VQwDetectorArray::GetIntegrationPMT ( const TString name) const

Definition at line 1625 of file VQwDetectorArray.cc.

1625 {
1626
1627 TString tmpname = name;
1628 tmpname.ToLower();
1629 if (! fIntegrationPMT.empty()) {
1630
1631 for (size_t i=0;i<fIntegrationPMT.size();i++) {
1632
1633 if (fIntegrationPMT.at(i).GetElementName() == tmpname) {
1634
1635 //std::cout<<"Get IntegrationPMT "<<tmpname<<std::endl;
1636 return &(fIntegrationPMT.at(i));
1637
1638 }
1639
1640 }
1641
1642 }
1643
1644 QwMessage << "VQwDetectorArray::GetIntegrationPMT: cannot find channel " << tmpname << QwLog::endl;
1645
1646 return NULL;
1647
1648}

References QwLog::endl(), fIntegrationPMT, and QwMessage.

Referenced by GetChannel(), PublishInternalValues(), and WritePromptSummary().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IncrementErrorCounters()

void VQwDetectorArray::IncrementErrorCounters ( )
overridevirtual

Increment the error counters.

Implements VQwSubsystemParity.

Definition at line 1115 of file VQwDetectorArray.cc.

1115 {
1116
1117 for(size_t i=0;i<fIntegrationPMT.size();i++){
1118
1119 fIntegrationPMT[i].IncrementErrorCounters();
1120
1121 }
1122
1123 for(size_t i=0;i<fCombinedPMT.size();i++){
1124
1125 fCombinedPMT[i].IncrementErrorCounters();
1126
1127 }
1128
1129}

References fCombinedPMT, and fIntegrationPMT.

◆ IsGoodEvent()

Bool_t VQwDetectorArray::IsGoodEvent ( )

Definition at line 807 of file VQwDetectorArray.cc.

807 {
808
809 Bool_t test=kTRUE;
810 return test;
811
812}

◆ LoadChannelMap()

Int_t VQwDetectorArray::LoadChannelMap ( TString mapfile)
overridevirtual

Load detector channel map file, creating integration and combined PMTs and configuring buffer layout, saturation limits, and sample sizes.

Parameters
mapfilePath to the channel map file.
Returns
0 on success.

Implements VQwSubsystem.

Definition at line 226 of file VQwDetectorArray.cc.

226 {
227
228 Bool_t ldebug=kFALSE;
229
230 std::vector<TString> combinedchannelnames;
231 std::vector<Double_t> weight;
232 Int_t wordsofar=0;
233 Int_t currentsubbankindex=-1;
234 Int_t sample_size=0;
235 Double_t abs_saturation_limit = 8.5; // default saturation limit(volt)
236 Bool_t bAssignedLimit = kFALSE;
237
238 // Open the file
239 QwParameterFile mapstr(mapfile.Data());
240 TString varname, varvalue;
241
242 fDetectorMaps.insert(mapstr.GetParamFileNameContents());
243 mapstr.EnableGreediness();
244 mapstr.SetCommentChars("!");
245
246 UInt_t value;
247 size_t vqwk_buffer_offset = 0;
248
249 while (mapstr.ReadNextLine()) {
250
251 RegisterRocBankMarker(mapstr);
252 if (mapstr.PopValue("abs_saturation_limit",value)) {
253 abs_saturation_limit=value;
254 bAssignedLimit = kTRUE;
255 }
256
257 if (mapstr.PopValue("sample_size",value)) {
258 sample_size=value;
259 }
260
261 if (mapstr.PopValue("vqwk_buffer_offset",value)) {
262 vqwk_buffer_offset=value;
263 }
264
265 mapstr.TrimComment('!'); // Remove everything after a '!' character.
266 mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
267
268 if (mapstr.LineIsEmpty()) continue;
269
270 Bool_t lineok = kTRUE;
271 TString keyword = "";
272 TString keyword2 = "";
273 TString modtype = "";
274 TString dettype = "";
275 TString namech = "";
276 Int_t modnum = 0;
277 Int_t channum = 0;
278
279 modtype = mapstr.GetTypedNextToken<TString>(); // module type
280
281 modtype.ToUpper();
282
283 if (modtype == "VPMT") {
284
285 channum = mapstr.GetTypedNextToken<Int_t>(); //channel number
286 Int_t combinedchans = mapstr.GetTypedNextToken<Int_t>(); //number of combined channels
287 dettype = mapstr.GetTypedNextToken<TString>(); //type-purpose of the detector
288 dettype.ToLower();
289 namech = mapstr.GetTypedNextToken<TString>(); //name of the detector
290 namech.ToLower();
291 combinedchannelnames.clear();
292
293 for (int i=0; i<combinedchans; i++){
294
295 TString nameofcombinedchan = mapstr.GetTypedNextToken<TString>();
296 nameofcombinedchan.ToLower();
297 combinedchannelnames.push_back(nameofcombinedchan);
298 }
299
300 weight.clear();
301
302 for (int i=0; i<combinedchans; i++) {
303
304 weight.push_back( mapstr.GetTypedNextToken<Double_t>());
305 }
306
307 keyword = mapstr.GetTypedNextToken<TString>();
308 keyword.ToLower();
309 keyword2 = mapstr.GetTypedNextToken<TString>();
310 keyword2.ToLower();
311
312 } else {
313
314 modnum = mapstr.GetTypedNextToken<Int_t>(); //slot number
315 channum = mapstr.GetTypedNextToken<Int_t>(); //channel number
316 dettype = mapstr.GetTypedNextToken<TString>(); //type-purpose of the detector
317 dettype.ToLower();
318 namech = mapstr.GetTypedNextToken<TString>(); //name of the detector
319 namech.ToLower();
320
321 keyword = mapstr.GetTypedNextToken<TString>();
322 keyword.ToLower();
323 keyword2 = mapstr.GetTypedNextToken<TString>();
324 keyword2.ToLower();
325 }
326
327
328 if (currentsubbankindex!=GetSubbankIndex(fCurrentROC_ID,fCurrentBank_ID)) {
329
331 wordsofar=0;
332 }
333
334 QwDetectorArrayID localMainDetID;
335 localMainDetID.fdetectorname=namech;
336 localMainDetID.fmoduletype=modtype;
337 localMainDetID.fSubbankIndex=currentsubbankindex;
338 localMainDetID.fdetectortype=dettype;
339
340 //localMainDetID.fWordInSubbank=wordsofar;
341
342 if (modtype=="MOLLERADC") {
343
344 UInt_t decode_mode = 0;
345 mapstr.ReturnValue("molleradc_decode_mode", decode_mode)
346 || mapstr.ReturnValue("decode_mode", decode_mode);
348
349 Int_t offset = QwMollerADC_Channel::GetBufferOffset(modnum, channum)+vqwk_buffer_offset;
350
351 if (offset>=0){
352
353 localMainDetID.fWordInSubbank = wordsofar + offset;
354 }
355
356 } else if (modtype=="VPMT") {
357
358 localMainDetID.fCombinedChannelNames = combinedchannelnames;
359 localMainDetID.fWeight = weight;
360
361 //std::cout<<"Add in a combined channel"<<std::endl;
362 } else {
363
364 QwError << "VQwDetectorArray::LoadChannelMap: Unknown module type: "
365 << modtype <<", the detector "<<namech<<" will not be decoded "
366 << QwLog::endl;
367 lineok=kFALSE;
368 continue;
369 }
370
371 localMainDetID.fTypeID=GetDetectorTypeID(dettype);
372
373 if (localMainDetID.fTypeID==kQwUnknownPMT) {
374
375 QwError << "VQwDetectorArray::LoadChannelMap: Unknown detector type: "
376 << dettype <<", the detector "<<namech<<" will not be decoded "
377 << QwLog::endl;
378 lineok=kFALSE;
379 continue;
380 }
381
382 localMainDetID.fIndex= GetDetectorIndex(localMainDetID.fTypeID,
383 localMainDetID.fdetectorname);
384
385 if (localMainDetID.fIndex==-1){
386
387 if (localMainDetID.fTypeID==kQwIntegrationPMT){
388
389 QwIntegrationPMT localIntegrationPMT(GetName(),localMainDetID.fdetectorname);
390
391 if (keyword=="not_blindable" || keyword2=="not_blindable")
392 localIntegrationPMT.SetBlindability(kFALSE);
393
394 else
395 localIntegrationPMT.SetBlindability(kTRUE);
396
397 if (keyword=="not_normalizable" || keyword2=="not_normalizable")
398 localIntegrationPMT.SetNormalizability(kFALSE);
399
400 else
401 localIntegrationPMT.SetNormalizability(kTRUE);
402
403 fIntegrationPMT.push_back(localIntegrationPMT);
404 fIntegrationPMT[fIntegrationPMT.size()-1].SetDefaultSampleSize(sample_size);
405
406 if(bAssignedLimit)
407 fIntegrationPMT[fIntegrationPMT.size()-1].SetSaturationLimit(abs_saturation_limit);
408
409 localMainDetID.fIndex=fIntegrationPMT.size()-1;
410
411 } else if (localMainDetID.fTypeID==kQwCombinedPMT) {
412
413 QwCombinedPMT localcombinedPMT(GetName(),localMainDetID.fdetectorname);
414
415 if (keyword=="not_normalizable" || keyword2=="not_normalizable")
416 localcombinedPMT.SetNormalizability(kFALSE);
417
418 else
419 localcombinedPMT.SetNormalizability(kTRUE);
420
421 if (keyword=="not_blindable" || keyword2 =="not_blindable")
422 localcombinedPMT.SetBlindability(kFALSE);
423
424 else
425 localcombinedPMT.SetBlindability(kTRUE);
426
427 fCombinedPMT.push_back(localcombinedPMT);
428 fCombinedPMT[fCombinedPMT.size()-1].SetDefaultSampleSize(sample_size);
429 localMainDetID.fIndex=fCombinedPMT.size()-1;
430 }
431 }
432
433 if (ldebug) {
434
435 localMainDetID.Print();
436 std::cout<<"line ok=";
437
438 if (lineok)
439 std::cout<<"TRUE"<<std::endl;
440
441 else
442 std::cout<<"FALSE"<<std::endl;
443 }
444
445 if (lineok)
446 fMainDetID.push_back(localMainDetID);
447
448 } // End of "while (mapstr.ReadNextLine())"
449
450 for (size_t i=0; i<fMainDetID.size(); i++) {
451
452 if (fMainDetID[i].fTypeID==kQwCombinedPMT) {
453
454 Int_t ind = fMainDetID[i].fIndex;
455
456 //check to see if all required channels are available
457 if (ldebug) {
458
459 std::cout<<"fMainDetID[i].fCombinedChannelNames.size()="
460 <<fMainDetID[i].fCombinedChannelNames.size()<<std::endl<<"name list: ";
461
462 for (size_t n=0; n<fMainDetID[i].fCombinedChannelNames.size(); n++)
463 std::cout<<" "<<fMainDetID[i].fCombinedChannelNames[n];
464
465 std::cout<<std::endl;
466 }
467
468 Int_t chanmatched=0;
469
470 for (size_t j=0; j<fMainDetID[i].fCombinedChannelNames.size(); j++) {
471
472 for (size_t k=0; k<fMainDetID.size(); k++) {
473
474 if (fMainDetID[i].fCombinedChannelNames[j]==fMainDetID[k].fdetectorname) {
475
476 if (ldebug)
477 std::cout<<"found a to-be-combined channel candidate"<<std::endl;
478
479 chanmatched ++;
480 break;
481 }
482 }
483 }
484
485 if ((Int_t) fMainDetID[i].fCombinedChannelNames.size()==chanmatched) {
486
487 for (size_t l=0; l<fMainDetID[i].fCombinedChannelNames.size(); l++) {
488
489 Int_t ind_pmt = GetDetectorIndex(GetDetectorTypeID("integrationpmt"),
490 fMainDetID[i].fCombinedChannelNames[l]);
491
492 fCombinedPMT[ind].Add(&fIntegrationPMT[ind_pmt],fMainDetID[i].fWeight[l]);
493 }
494
495 fCombinedPMT[ind].LinkChannel(fMainDetID[i].fdetectorname);
496
497 if (ldebug)
498 std::cout<<"linked a combined channel"<<std::endl;
499 } else {
500
501 std::cerr<<"cannot combine void channels for "<<fMainDetID[i].fdetectorname<<std::endl;
502 fMainDetID[i].fIndex = -1;
503 continue;
504 }
505 }
506 }
507
508
509 // Now load the variables to publish
510 mapstr.RewindToFileStart();
511 std::unique_ptr<QwParameterFile> section;
512 std::vector<TString> publishinfo;
513 while ((section = mapstr.ReadNextSection(varvalue))) {
514
515 if (varvalue == "PUBLISH") {
516
517 fPublishList.clear();
518
519 while (section->ReadNextLine()) {
520
521 section->TrimComment(); // Remove everything after a comment character
522 section->TrimWhitespace(); // Get rid of leading and trailing spaces
523
524 for (int ii = 0; ii < 4; ii++) {
525
526 varvalue = section->GetNextToken().c_str();
527
528 if (varvalue.Length()) {
529
530 publishinfo.push_back(varvalue);
531 }
532 }
533
534 if (publishinfo.size() == 4)
535 fPublishList.push_back(publishinfo);
536
537 publishinfo.clear();
538 }
539 }
540 }
541
542 // Print list of variables to publish
543 if (fPublishList.size()>0){
544
545 QwMessage << "Variables to publish:" << QwLog::endl;
546
547 for (size_t jj = 0; jj < fPublishList.size(); jj++)
548 QwMessage << fPublishList.at(jj).at(0) << " " << fPublishList.at(jj).at(1) << " "
549 << fPublishList.at(jj).at(2) << " " << fPublishList.at(jj).at(3) << QwLog::endl;
550 }
551
552 if (ldebug) {
553
554 std::cout<<"Done with Load channel map\n";
555
556 for (size_t i=0;i<fMainDetID.size();i++)
557 if (fMainDetID[i].fIndex>=0)
558 fMainDetID[i].Print();
559 }
560
561 ldebug=kFALSE;
562 mapstr.Close(); // Close the file (ifstream)
563 return 0;
564}
@ kQwUnknownPMT
Definition QwTypes.h:136
@ kQwCombinedPMT
Definition QwTypes.h:139
static void SetDecodeMode(UInt_t input)
static Int_t GetBufferOffset(Int_t moduleindex, Int_t channelindex)
std::vector< std::vector< TString > > fPublishList
Int_t GetSubbankIndex() const
void RegisterRocBankMarker(QwParameterFile &mapstr)
std::map< TString, TString > fDetectorMaps
Map of file name to full path or content.
std::vector< Double_t > fWeight
std::vector< TString > fCombinedChannelNames
EQwPMTInstrumentType fTypeID
Int_t GetDetectorIndex(EQwPMTInstrumentType TypeID, TString name)
EQwPMTInstrumentType GetDetectorTypeID(TString name)

References QwParameterFile::Close(), QwParameterFile::EnableGreediness(), QwLog::endl(), QwDetectorArrayID::fCombinedChannelNames, fCombinedPMT, VQwSubsystem::fCurrentBank_ID, VQwSubsystem::fCurrentROC_ID, VQwSubsystem::fDetectorMaps, QwDetectorArrayID::fdetectorname, QwDetectorArrayID::fdetectortype, QwDetectorArrayID::fIndex, fIntegrationPMT, fMainDetID, QwDetectorArrayID::fmoduletype, VQwSubsystem::fPublishList, QwDetectorArrayID::fSubbankIndex, QwDetectorArrayID::fTypeID, QwDetectorArrayID::fWeight, QwDetectorArrayID::fWordInSubbank, QwMollerADC_Channel::GetBufferOffset(), GetDetectorIndex(), GetDetectorTypeID(), VQwSubsystem::GetName(), QwParameterFile::GetParamFileNameContents(), VQwSubsystem::GetSubbankIndex(), QwParameterFile::GetTypedNextToken(), kQwCombinedPMT, kQwIntegrationPMT, kQwUnknownPMT, QwParameterFile::LineIsEmpty(), QwParameterFile::PopValue(), QwDetectorArrayID::Print(), QwError, QwMessage, QwParameterFile::ReadNextLine(), QwParameterFile::ReadNextSection(), VQwSubsystem::RegisterRocBankMarker(), QwParameterFile::ReturnValue(), QwParameterFile::RewindToFileStart(), QwCombinedPMT::SetBlindability(), QwIntegrationPMT::SetBlindability(), QwParameterFile::SetCommentChars(), QwMollerADC_Channel::SetDecodeMode(), QwCombinedPMT::SetNormalizability(), QwIntegrationPMT::SetNormalizability(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().

+ Here is the call graph for this function:

◆ LoadEventCuts_Fin()

void VQwDetectorArray::LoadEventCuts_Fin ( Int_t & eventcut_flag)
overridevirtual

Reimplemented from VQwSubsystemParity.

Definition at line 595 of file VQwDetectorArray.cc.

595 {
596 for (size_t i = 0; i < fIntegrationPMT.size(); i++)
597 fIntegrationPMT[i].SetEventCutMode(eventcut_flag);
598 for (size_t i = 0; i < fCombinedPMT.size(); i++)
599 fCombinedPMT[i].SetEventCutMode(eventcut_flag);
600
601 fMainDetErrorCount = 0;//set the error counter to zero
602}

References fCombinedPMT, fIntegrationPMT, and fMainDetErrorCount.

◆ LoadEventCuts_Init()

void VQwDetectorArray::LoadEventCuts_Init ( )
inlineoverridevirtual

Reimplemented from VQwSubsystemParity.

Definition at line 129 of file VQwDetectorArray.h.

129{};

◆ LoadEventCuts_Line()

void VQwDetectorArray::LoadEventCuts_Line ( QwParameterFile & mapstr,
TString & varvalue,
Int_t & eventcut_flag )
overridevirtual

Reimplemented from VQwSubsystemParity.

Definition at line 566 of file VQwDetectorArray.cc.

566 {
567 TString device_type = mapstr.GetTypedNextToken<TString>();
568 device_type.ToLower();
569 TString device_name = mapstr.GetTypedNextToken<TString>();
570 device_name.ToLower();
571
572 Int_t det_index = GetDetectorIndex(GetDetectorTypeID(device_type),device_name);
573 if (det_index == -1) {
574 QwWarning << " Device not found " << device_name << " of type " << device_type << QwLog::endl;
575 //continue;
576 }
577
578 Double_t LLX = mapstr.GetTypedNextToken<Double_t>(); //lower limit for IntegrationPMT value
579 Double_t ULX = mapstr.GetTypedNextToken<Double_t>(); //upper limit for IntegrationPMT value
580 varvalue = mapstr.GetTypedNextToken<TString>();//global/local
581 varvalue.ToLower();
582
583 Double_t burplevel = mapstr.GetTypedNextToken<Double_t>();
584 Double_t stabilitycut = mapstr.GetTypedNextToken<Double_t>();
585
587 QwMessage << "VQwDetectorArray Error Code passing to QwIntegrationPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl;
588 fIntegrationPMT[det_index].SetSingleEventCuts(GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut),LLX,ULX,stabilitycut,burplevel);
589 } else if (device_type == GetQwPMTInstrumentTypeName(kQwCombinedPMT)){
590 QwMessage << "VQwDetectorArray Error Code passing to QwCombinedPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl;
591 fCombinedPMT[det_index].SetSingleEventCuts(GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut),LLX,ULX,stabilitycut,burplevel);
592 }
593}
TString GetQwPMTInstrumentTypeName(EQwPMTInstrumentType type)
Definition QwTypes.cc:81
UInt_t GetGlobalErrorFlag(TString evtype, Int_t evMode, Double_t stabilitycut)
Definition QwTypes.cc:132
T GetTypedNextToken()
Get next token into specific type.

References QwLog::endl(), fCombinedPMT, fIntegrationPMT, GetDetectorIndex(), GetDetectorTypeID(), GetGlobalErrorFlag(), GetQwPMTInstrumentTypeName(), QwParameterFile::GetTypedNextToken(), kQwCombinedPMT, kQwIntegrationPMT, QwMessage, and QwWarning.

+ Here is the call graph for this function:

◆ LoadInputParameters()

Int_t VQwDetectorArray::LoadInputParameters ( TString mapfile)
overridevirtual

Mandatory parameter file definition.

Implements VQwSubsystem.

Definition at line 606 of file VQwDetectorArray.cc.

606 {
607
608 Bool_t ldebug=kFALSE;
609 TString varname;
610 Double_t varped;
611 Double_t varcal;
612
613 // Double_t varbaserate;
614 Double_t varnormrate;
615 Double_t varvoltperhz;
616 Double_t varasym;
617 Double_t varcx;
618 Double_t varcy;
619 Double_t varcxp;
620 Double_t varcyp;
621 Double_t varce;
622
623 TString localname;
624
625 Int_t lineread=0;
626
627 QwParameterFile mapstr(pedestalfile.Data()); //Open the file
628 fDetectorMaps.insert(mapstr.GetParamFileNameContents());
629
630 while (mapstr.ReadNextLine()) {
631
632 lineread+=1;
633 if (ldebug)std::cout<<" line read so far ="<<lineread<<"\n";
634 mapstr.TrimComment('!'); // Remove everything after a '!' character.
635
636 mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
637
638 if (mapstr.LineIsEmpty()) continue;
639
640 else {
641 varname = mapstr.GetTypedNextToken<TString>(); //name of the channel
642 varname.ToLower();
643 varname.Remove(TString::kBoth,' ');
644 varped = mapstr.GetTypedNextToken<Double_t>(); // value of the pedestal
645 varcal = mapstr.GetTypedNextToken<Double_t>(); // value of the calibration factor
646
647
648
649
650 if (ldebug)
651 std::cout << "Inputs for channel " << varname << ": ped=" << varped << ": cal=" << varcal << "\n"
652 << ": varnormrate=" << varnormrate << "\n"
653 << ": varvoltperhz=" << varvoltperhz << "\n"
654 << ": asym=" << varasym << "\n"
655 << ": C_x=" << varcx << ": C_y=" << varcy << "\n"
656 << ": C_xp=" << varcxp << ": C_yp=" << varcyp << "\n"
657 << ": C_e=" << varce << "\n";
658
659 // Bool_t notfound=kTRUE;
660
661 // if (notfound)
662 for (size_t i=0;i<fIntegrationPMT.size();i++){
663 if (fIntegrationPMT[i].GetElementName()==varname) {
664
665 fIntegrationPMT[i].SetPedestal(varped);
666 fIntegrationPMT[i].SetCalibrationFactor(varcal);
667
668
669
670 // i=fIntegrationPMT.size()+1;
671 // notfound=kFALSE;
672 // i=fIntegrationPMT.size()+1;
673
674 break;
675
676 }
677 }
678
679 }
680
681 }
682
683 if (ldebug)
684 std::cout<<" line read in the pedestal + cal file ="<<lineread<<" \n";
685
686 ldebug=kFALSE;
687 mapstr.Close(); // Close the file (ifstream)
688 return 0;
689
690}

References QwParameterFile::Close(), VQwSubsystem::fDetectorMaps, fIntegrationPMT, QwParameterFile::GetParamFileNameContents(), QwParameterFile::GetTypedNextToken(), QwParameterFile::LineIsEmpty(), QwParameterFile::ReadNextLine(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().

+ Here is the call graph for this function:

◆ LoadMockDataParameters()

void VQwDetectorArray::LoadMockDataParameters ( TString pedestalfile)
overridevirtual

Reimplemented from VQwSubsystemParity.

Definition at line 700 of file VQwDetectorArray.cc.

700 {
701
702 Bool_t ldebug=kFALSE;
703 TString varname;
704 Double_t varped;
705 Double_t varcal;
706
707 // Double_t varbaserate;
708 Double_t varnormrate;
709 Double_t varvoltperhz;
710 Double_t varasym;
711 Double_t varcx;
712 Double_t varcy;
713 Double_t varcxp;
714 Double_t varcyp;
715 Double_t varce;
716
717 TString localname;
718
719 Int_t lineread=0;
720
721 QwParameterFile mapstr(pedestalfile.Data()); //Open the file
722 fDetectorMaps.insert(mapstr.GetParamFileNameContents());
723
724 while (mapstr.ReadNextLine()) {
725
726 lineread+=1;
727 if (ldebug)std::cout<<" line read so far ="<<lineread<<"\n";
728 mapstr.TrimComment('!'); // Remove everything after a '!' character.
729
730 mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
731
732 if (mapstr.LineIsEmpty()) continue;
733
734 else {
735 varname = mapstr.GetTypedNextToken<TString>(); //name of the channel
736 varname.ToLower();
737 varname.Remove(TString::kBoth,' ');
738
739
740 varnormrate = mapstr.GetTypedNextToken<Double_t>(); // value of the NormRate
741 varvoltperhz = mapstr.GetTypedNextToken<Double_t>(); // value of the VoltPerHz
742 varasym = mapstr.GetTypedNextToken<Double_t>(); // value of the asymmetry
743 varcx = mapstr.GetTypedNextToken<Double_t>(); // value of the coefficient C_x
744 varcy = mapstr.GetTypedNextToken<Double_t>(); // value of the coefficient C_y
745 varcxp = mapstr.GetTypedNextToken<Double_t>(); // value of the coefficient C_xp
746 varcyp = mapstr.GetTypedNextToken<Double_t>(); // value of the coefficient C_yp
747 varce = mapstr.GetTypedNextToken<Double_t>(); // value of the coefficient C_e
748
749
750 if (ldebug)
751 std::cout << "Inputs for channel " << varname << ": ped=" << varped << ": cal=" << varcal << "\n"
752 << ": varnormrate=" << varnormrate << "\n"
753 << ": varvoltperhz=" << varvoltperhz << "\n"
754 << ": asym=" << varasym << "\n"
755 << ": C_x=" << varcx << ": C_y=" << varcy << "\n"
756 << ": C_xp=" << varcxp << ": C_yp=" << varcyp << "\n"
757 << ": C_e=" << varce << "\n";
758
759 // Bool_t notfound=kTRUE;
760
761 // if (notfound)
762 for (size_t i=0;i<fIntegrationPMT.size();i++){
763 if (fIntegrationPMT[i].GetElementName()==varname) {
764
765
766 fIntegrationPMT[i].SetNormRate(varnormrate);
767 fIntegrationPMT[i].SetVoltPerHz(varvoltperhz);
768 fIntegrationPMT[i].SetAsymmetry(varasym);
769 fIntegrationPMT[i].SetCoefficientCx(varcx);
770 fIntegrationPMT[i].SetCoefficientCy(varcy);
771 fIntegrationPMT[i].SetCoefficientCxp(varcxp);
772 fIntegrationPMT[i].SetCoefficientCyp(varcyp);
773 fIntegrationPMT[i].SetCoefficientCe(varce);
774
775 // i=fIntegrationPMT.size()+1;
776 // notfound=kFALSE;
777 // i=fIntegrationPMT.size()+1;
778
779 break;
780
781 }
782 }
783
784 }
785
786 }
787
788 if (ldebug)
789 std::cout<<" line read in the pedestal + cal file ="<<lineread<<" \n";
790
791 ldebug=kFALSE;
792 mapstr.Close(); // Close the file (ifstream)
793
794}

References QwParameterFile::Close(), VQwSubsystem::fDetectorMaps, fIntegrationPMT, QwParameterFile::GetParamFileNameContents(), QwParameterFile::GetTypedNextToken(), QwParameterFile::LineIsEmpty(), QwParameterFile::ReadNextLine(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().

+ Here is the call graph for this function:

◆ Normalize()

void VQwDetectorArray::Normalize ( VQwDataElement * denom)

Definition at line 1529 of file VQwDetectorArray.cc.

1529 {
1530
1531 for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1532 fIntegrationPMT[i].Normalize(denom);
1533
1534 for (size_t i = 0; i < fCombinedPMT.size(); i++)
1535 fCombinedPMT[i].Normalize(denom);
1536
1537}

References fCombinedPMT, fIntegrationPMT, and Normalize().

Referenced by DoNormalization(), and Normalize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator+=()

VQwSubsystem & VQwDetectorArray::operator+= ( VQwSubsystem * value)
overridevirtual

Implements VQwSubsystemParity.

Definition at line 1457 of file VQwDetectorArray.cc.

1457 {
1458
1459 if (Compare(value)) {
1460
1461 VQwDetectorArray* input= dynamic_cast<VQwDetectorArray*>(value) ;
1462
1463 for (size_t i=0;i<input->fIntegrationPMT.size();i++)
1464 this->fIntegrationPMT[i]+=input->fIntegrationPMT[i];
1465
1466 for (size_t i=0;i<input->fCombinedPMT.size();i++)
1467 this->fCombinedPMT[i]+=input->fCombinedPMT[i];
1468
1469 }
1470
1471 return *this;
1472
1473}

References Compare(), fCombinedPMT, fIntegrationPMT, VQwDetectorArray(), and VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ operator-=()

VQwSubsystem & VQwDetectorArray::operator-= ( VQwSubsystem * value)
overridevirtual

Implements VQwSubsystemParity.

Definition at line 1476 of file VQwDetectorArray.cc.

1476 {
1477
1478 if (Compare(value)) {
1479
1480 VQwDetectorArray* input= dynamic_cast<VQwDetectorArray*>(value);
1481
1482 for (size_t i=0;i<input->fIntegrationPMT.size();i++)
1483 this->fIntegrationPMT[i]-=input->fIntegrationPMT[i];
1484
1485 for (size_t i=0;i<input->fCombinedPMT.size();i++)
1486 this->fCombinedPMT[i]-=input->fCombinedPMT[i];
1487
1488 }
1489
1490 return *this;
1491
1492}

References Compare(), fCombinedPMT, fIntegrationPMT, VQwDetectorArray(), and VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ operator=()

VQwSubsystem & VQwDetectorArray::operator= ( VQwSubsystem * value)
overridevirtual

Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsystem *value) by VQwSubsystem::operator=(value)

Implements VQwSubsystemParity.

Definition at line 1435 of file VQwDetectorArray.cc.

1435 {
1436
1437 // std::cout<<" here in VQwDetectorArray::operator= \n";
1438
1439 if (this != value && Compare(value)) {
1440
1442 VQwDetectorArray* input = dynamic_cast<VQwDetectorArray*> (value);
1443
1444 for (size_t i=0;i<input->fIntegrationPMT.size();i++)
1445 this->fIntegrationPMT[i]=input->fIntegrationPMT[i];
1446
1447 for (size_t i=0;i<input->fCombinedPMT.size();i++)
1448 (this->fCombinedPMT[i])=(input->fCombinedPMT[i]);
1449
1450 }
1451
1452 return *this;
1453
1454}
virtual VQwSubsystem & operator=(VQwSubsystem *value)
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...

References Compare(), fCombinedPMT, fIntegrationPMT, VQwSubsystem::operator=(), VQwDetectorArray(), and VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ PrintDetectorID()

void VQwDetectorArray::PrintDetectorID ( ) const

Definition at line 1796 of file VQwDetectorArray.cc.

1796 {
1797
1798 for (size_t i=0;i<fMainDetID.size();i++) {
1799
1800 std::cout<<"============================="<<std::endl;
1801 std::cout<<" Detector ID="<<i<<std::endl;
1802 fMainDetID[i].Print();
1803
1804 }
1805
1806 return;
1807
1808}

References fMainDetID.

◆ PrintErrorCounters()

void VQwDetectorArray::PrintErrorCounters ( ) const
overridevirtual

Implements VQwSubsystemParity.

Definition at line 1132 of file VQwDetectorArray.cc.

1132 {
1133
1134 QwMessage<<"*********VQwDetectorArray Error Summary****************"<<QwLog::endl;
1136
1137 for(size_t i=0;i<fIntegrationPMT.size();i++){
1138
1139 //std::cout<<" IntegrationPMT ["<<i<<"] "<<std::endl;
1140 fIntegrationPMT[i].PrintErrorCounters();
1141
1142 }
1143
1144 for(size_t i=0;i<fCombinedPMT.size();i++){
1145
1146 //std::cout<<" CombinedPMT ["<<i<<"] "<<std::endl;
1147 fCombinedPMT[i].PrintErrorCounters();
1148
1149 }
1150
1152
1153}
static void PrintErrorCounterHead()
static void PrintErrorCounterTail()

References QwLog::endl(), fCombinedPMT, fIntegrationPMT, QwMollerADC_Channel::PrintErrorCounterHead(), QwMollerADC_Channel::PrintErrorCounterTail(), and QwMessage.

+ Here is the call graph for this function:

◆ PrintInfo()

void VQwDetectorArray::PrintInfo ( ) const
overridevirtual

Print some information about the subsystem.

Print some information about the subsystem (name, ROCs/banks, parent).

Reimplemented from VQwSubsystem.

Definition at line 1780 of file VQwDetectorArray.cc.

1780 {
1781
1782 std::cout<<"Name of the subsystem ="<<fSystemName<<"\n";
1783
1784 std::cout<<"there are "<<fIntegrationPMT.size()<<" IntegrationPMT \n";
1785 std::cout<<" "<<fCombinedPMT.size()<<" CombinedPMT \n";
1786
1787 std::cout<<" Printing Running AVG and other channel info"<<std::endl;
1788
1789 for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1791 for (size_t i = 0; i < fCombinedPMT.size(); i++)
1793
1794}
TString fSystemName
Name of this subsystem.

References fCombinedPMT, fIntegrationPMT, VQwSubsystem::fSystemName, and PrintInfo().

Referenced by ExchangeProcessedData(), PrintInfo(), and RandomizeMollerEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintValue()

void VQwDetectorArray::PrintValue ( ) const
overridevirtual

Print values of all channels.

Reimplemented from VQwSubsystemParity.

Definition at line 1768 of file VQwDetectorArray.cc.

1768 {
1769
1770 QwMessage << "=== VQwDetectorArray: " << GetName() << " ===" << QwLog::endl;
1771
1772 for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1774
1775 for (size_t i = 0; i < fCombinedPMT.size(); i++)
1777
1778}
void PrintValue() const override
Print values of all channels.

References QwLog::endl(), fCombinedPMT, fIntegrationPMT, VQwSubsystem::GetName(), PrintValue(), and QwMessage.

Referenced by PrintValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessConfigurationBuffer()

Int_t VQwDetectorArray::ProcessConfigurationBuffer ( const ROCID_t roc_id,
const BankID_t bank_id,
UInt_t * buffer,
UInt_t num_words )
overridevirtual

Implements VQwSubsystem.

Definition at line 1008 of file VQwDetectorArray.cc.

1008 {
1009
1010 /* Int_t index = GetSubbankIndex(roc_id,bank_id);
1011 if (index>=0 && num_words>0){
1012 // We want to process the configuration data for this ROC.
1013 UInt_t words_read = 0;
1014 for (size_t i = 0; i < fMainDetID.size(); i++) {
1015 words_read += fIntegrationPMT[i].ProcessConfigurationBuffer(&(buffer[words_read]),
1016 num_words-words_read);
1017 }
1018 }*/
1019 return 0;
1020
1021}

◆ ProcessEvBuffer()

Int_t VQwDetectorArray::ProcessEvBuffer ( const ROCID_t roc_id,
const BankID_t bank_id,
UInt_t * buffer,
UInt_t num_words )
overridevirtual

TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware version.

Implements VQwSubsystem.

Definition at line 1024 of file VQwDetectorArray.cc.

1024 {
1025
1026 Bool_t lkDEBUG=kFALSE;
1027
1028 Int_t index = GetSubbankIndex(roc_id,bank_id);
1029
1030 if (index>=0 && num_words>0) {
1031
1032 // We want to process this ROC. Begin looping through the data.
1033 if (lkDEBUG)
1034 std::cout << "VQwDetectorArray::ProcessEvBuffer: "
1035 << "Begin processing ROC" << roc_id
1036 << " and subbank "<<bank_id
1037 << " number of words="<<num_words<<std::endl;
1038
1039 for (size_t i=0;i<fMainDetID.size();i++) {
1040
1041 if (fMainDetID[i].fSubbankIndex==index) {
1042
1043 if (fMainDetID[i].fTypeID == kQwIntegrationPMT) {
1044
1045 if (lkDEBUG) {
1046
1047 std::cout<<"found IntegrationPMT data for "<<fMainDetID[i].fdetectorname<<std::endl;
1048 std::cout<<"word left to read in this buffer:"<<num_words-fMainDetID[i].fWordInSubbank<<std::endl;
1049
1050 }
1051
1052 fIntegrationPMT[fMainDetID[i].fIndex].ProcessEvBuffer(&(buffer[fMainDetID[i].fWordInSubbank]),
1053 num_words-fMainDetID[i].fWordInSubbank);
1054
1055 }
1056
1057 }
1058
1059 }
1060
1061 }
1062
1063 return 0;
1064
1065}

References fIntegrationPMT, fMainDetID, VQwSubsystem::GetSubbankIndex(), and kQwIntegrationPMT.

+ Here is the call graph for this function:

◆ ProcessEvent()

void VQwDetectorArray::ProcessEvent ( )
overridevirtual

Implements VQwSubsystem.

Definition at line 1196 of file VQwDetectorArray.cc.

1196 {
1197
1198 for (size_t i=0;i<fIntegrationPMT.size();i++)
1200
1201 for (size_t i=0;i<fCombinedPMT.size();i++) {
1202
1203 //std::cout<<"Process combination "<<i<<std::endl;
1204 fCombinedPMT[i].ProcessEvent();
1205
1206 }
1207
1208 return;
1209
1210}
void ProcessEvent() override

References fCombinedPMT, fIntegrationPMT, and ProcessEvent().

Referenced by ProcessEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessEvent_2()

void VQwDetectorArray::ProcessEvent_2 ( )
overridevirtual

Process the event data again, including data from other subsystems. Not all derived classes will require a second stage of event data processing.

Reimplemented from VQwSubsystem.

Definition at line 1246 of file VQwDetectorArray.cc.

1246 {
1247
1249
1250 //data is valid, process it
1251
1252 if (bDEBUG) {
1253
1254 Double_t pedestal = fTargetCharge.GetPedestal();
1255 Double_t calfactor = fTargetCharge.GetCalibrationFactor();
1256 Double_t volts = fTargetCharge.GetAverageVolts();
1257
1258 std::cout<<"VQwDetectorArray::ProcessEvent_2(): processing with exchanged data"<<std::endl;
1259 std::cout<<"pedestal, calfactor, average volts = "<<pedestal<<", "<<calfactor<<", "<<volts<<std::endl;
1260
1261 }
1262
1264 this->DoNormalization();
1265
1266 } else {
1267
1268 QwWarning<<"VQwDetectorArray::ProcessEvent_2(): could not get all external values."<<QwLog::endl;
1269
1270 }
1271
1272}
void DoNormalization(Double_t factor=1.0)

References bDEBUG, bIsExchangedDataValid, bNormalization, DoNormalization(), QwLog::endl(), fNormThreshold, fTargetCharge, and QwWarning.

+ Here is the call graph for this function:

◆ ProcessOptions()

void VQwDetectorArray::ProcessOptions ( QwOptions & options)
overridevirtual

Load detector array configuration from parsed command-line options.

Parameters
optionsOptions object.

Reimplemented from VQwSubsystem.

Definition at line 54 of file VQwDetectorArray.cc.

54 {
55
56 bNormalization = options.GetValue<bool>("QwDetectorArray.normalize");
57
58 if (! bNormalization) {
59
60 QwWarning << "QwDetectorArray::ProcessOptions: "
61 << "Detector yields WILL NOT be normalized."
62 << QwLog::endl;
63
64 }
65
66 fNormThreshold = options.GetValue<double>("QwDetectorArray.norm_threshold");
67
68}
T GetValue(const std::string &key)
Get a templated value.
Definition QwOptions.h:236

References bNormalization, QwLog::endl(), fNormThreshold, QwOptions::GetValue(), and QwWarning.

+ Here is the call graph for this function:

◆ PublishByRequest()

Bool_t VQwDetectorArray::PublishByRequest ( TString device_name)
overridevirtual

Publish a specific device channel on-demand by name lookup.

Parameters
device_nameName of the detector channel to publish.
Returns
true if the channel is found and published successfully.

Implements MQwPublishable_child< QwSubsystemArray, VQwSubsystem >.

Definition at line 179 of file VQwDetectorArray.cc.

179 {
180
181 Bool_t status = kFALSE;
182 //std::cerr << "##### device_name==\"" << device_name << "\"" << std::endl;
183
184 for(size_t i=0;i<fMainDetID.size();i++) {
185
186 //std::cerr << "fMainDetID[i].fdetectorname==\"" << fMainDetID[i].fdetectorname << "\"" << std::endl;
187
188 if(device_name.CompareTo(fMainDetID[i].fdetectorname)!=0) continue;
189
190 if (fMainDetID[i].fTypeID == kQwCombinedPMT){
191
192 status = PublishInternalValue(device_name, "published-by-request",
193 fCombinedPMT[fMainDetID[i].fIndex].GetChannel(device_name));
194
195 } else if (fMainDetID[i].fTypeID == kQwIntegrationPMT) {
196
197 status = PublishInternalValue(device_name, "published-by-request",
198 fIntegrationPMT[fMainDetID[i].fIndex].GetChannel(device_name));
199
200 } else {
201
202 QwError << "Unknown channel name: " << device_name << QwLog::endl;
203
204 }
205
206 break;
207
208 }
209
210 if (!status)
211 QwDebug << "VQwDetectorArray::PublishByRequest: Failed to publish channel name: " << device_name << QwLog::endl;
212
213 return status;
214
215}
#define QwDebug
Predefined log drain for debugging output.
Definition QwLog.h:59
Bool_t PublishInternalValue(const TString name, const TString desc, const VQwHardwareChannel *element) const
const QwIntegrationPMT * GetChannel(const TString name) const

References fCombinedPMT, fMainDetID, GetChannel(), kQwCombinedPMT, and MQwPublishable_child< QwSubsystemArray, VQwSubsystem >::PublishInternalValue().

+ Here is the call graph for this function:

◆ PublishInternalValues()

Bool_t VQwDetectorArray::PublishInternalValues ( ) const
overridevirtual

Publish internal detector channels according to the configured publish list (integration and combined PMTs).

Returns
true if all requested channels are successfully published.

Implements MQwPublishable_child< QwSubsystemArray, VQwSubsystem >.

Definition at line 78 of file VQwDetectorArray.cc.

78 {
79
80 // Publish variables
81
82 Bool_t status = kTRUE;
83
84/*
85 status = status && PublishInternalValue("qwk_md1neg", "qwk_md1neg", GetIntegrationPMT("qwk_md1neg")->GetChannel("qwk_md1neg"));
86 status = status && PublishInternalValue("qwk_md1pos", "qwk_md1pos", GetIntegrationPMT("qwk_md1pos")->GetChannel("qwk_md1pos"));
87 status = status && PublishInternalValue("qwk_md2neg", "qwk_md2neg", GetIntegrationPMT("qwk_md2neg")->GetChannel("qwk_md2neg"));
88 status = status && PublishInternalValue("qwk_md2pos", "qwk_md2pos", GetIntegrationPMT("qwk_md2pos")->GetChannel("qwk_md2pos"));
89 status = status && PublishInternalValue("qwk_md3neg", "qwk_md3neg", GetIntegrationPMT("qwk_md3neg")->GetChannel("qwk_md3neg"));
90 status = status && PublishInternalValue("qwk_md3pos", "qwk_md3pos", GetIntegrationPMT("qwk_md3pos")->GetChannel("qwk_md3pos"));
91 status = status && PublishInternalValue("qwk_md4neg", "qwk_md4neg", GetIntegrationPMT("qwk_md4neg")->GetChannel("qwk_md4neg"));
92 status = status && PublishInternalValue("qwk_md4pos", "qwk_md4pos", GetIntegrationPMT("qwk_md4pos")->GetChannel("qwk_md4pos"));
93 status = status && PublishInternalValue("qwk_md5neg", "qwk_md5neg", GetIntegrationPMT("qwk_md5neg")->GetChannel("qwk_md5neg"));
94 status = status && PublishInternalValue("qwk_md5pos", "qwk_md5pos", GetIntegrationPMT("qwk_md5pos")->GetChannel("qwk_md5pos"));
95 status = status && PublishInternalValue("qwk_md6neg", "qwk_md6neg", GetIntegrationPMT("qwk_md6neg")->GetChannel("qwk_md6neg"));
96 status = status && PublishInternalValue("qwk_md6pos", "qwk_md6pos", GetIntegrationPMT("qwk_md6pos")->GetChannel("qwk_md6pos"));
97 status = status && PublishInternalValue("qwk_md7neg", "qwk_md7neg", GetIntegrationPMT("qwk_md7neg")->GetChannel("qwk_md7neg"));
98 status = status && PublishInternalValue("qwk_md7pos", "qwk_md7pos", GetIntegrationPMT("qwk_md7pos")->GetChannel("qwk_md7pos"));
99 status = status && PublishInternalValue("qwk_md8neg", "qwk_md8neg", GetIntegrationPMT("qwk_md8neg")->GetChannel("qwk_md8neg"));
100 status = status && PublishInternalValue("qwk_md8pos", "qwk_md8pos", GetIntegrationPMT("qwk_md8pos")->GetChannel("qwk_md8pos"));
101 status = status && PublishInternalValue("qwk_md9neg", "qwk_md9neg", GetIntegrationPMT("qwk_md9neg")->GetChannel("qwk_md9neg"));
102 status = status && PublishInternalValue("qwk_md9pos", "qwk_md9pos", GetIntegrationPMT("qwk_md9pos")->GetChannel("qwk_md9pos"));
103*/
104
105/*
106 status = status && PublishInternalValue("qwk_md1barsum","qwk_md1barsum", GetCombinedPMT("qwk_md1barsum")->GetChannel("qwk_md1barsum"));
107 status = status && PublishInternalValue("qwk_md2barsum","qwk_md2barsum", GetCombinedPMT("qwk_md2barsum")->GetChannel("qwk_md2barsum"));
108 status = status && PublishInternalValue("qwk_md3barsum","qwk_md3barsum", GetCombinedPMT("qwk_md3barsum")->GetChannel("qwk_md3barsum"));
109 status = status && PublishInternalValue("qwk_md4barsum","qwk_md4barsum", GetCombinedPMT("qwk_md4barsum")->GetChannel("qwk_md4barsum"));
110 status = status && PublishInternalValue("qwk_md5barsum","qwk_md5barsum", GetCombinedPMT("qwk_md5barsum")->GetChannel("qwk_md5barsum"));
111 status = status && PublishInternalValue("qwk_md6barsum","qwk_md6barsum", GetCombinedPMT("qwk_md6barsum")->GetChannel("qwk_md6barsum"));
112 status = status && PublishInternalValue("qwk_md7barsum","qwk_md7barsum", GetCombinedPMT("qwk_md7barsum")->GetChannel("qwk_md7barsum"));
113 status = status && PublishInternalValue("qwk_md8barsum","qwk_md8barsum", GetCombinedPMT("qwk_md8barsum")->GetChannel("qwk_md8barsum"));
114
115 status = status && PublishInternalValue("qwk_mdallbars","qwk_mdallbars", GetCombinedPMT("qwk_mdallbars")->GetChannel("qwk_mdallbars"));
116*/
117
118 //return status;
119
120
121 // TODO:
122 // The variables should be published based on the parameter file.
123 // See QwBeamLine class for an implementation.
124
125 // Publish variables through map file
126 // This should work with bcm, bpmstripline, bpmcavity, combo bpm and combo bcm
127
128 for (size_t pp = 0; pp < fPublishList.size(); pp++) {
129
130 TString publish_name = fPublishList.at(pp).at(0);
131 TString device_type = fPublishList.at(pp).at(1);
132 TString device_name = fPublishList.at(pp).at(2);
133 TString device_prop = fPublishList.at(pp).at(3);
134 device_type.ToLower();
135 device_prop.ToLower();
136
137 const VQwHardwareChannel* tmp_channel = NULL;
138
139 if (device_type == "integrationpmt") {
140
141 tmp_channel = GetIntegrationPMT(device_name)->GetChannel(device_name);
142
143 } else if (device_type == "combinedpmt") {
144
145 tmp_channel = GetCombinedPMT(device_name)->GetChannel(device_name);
146
147 } else {
148
149 QwError << "QwBeamLine::PublishInternalValues() error "<< QwLog::endl;
150
151 }
152
153 if (tmp_channel == NULL) {
154
155 QwError << "QwBeamLine::PublishInternalValues(): " << publish_name << " not found" << QwLog::endl;
156 status |= kFALSE;
157
158 } else {
159
160 QwDebug << "QwBeamLine::PublishInternalValues(): " << publish_name << " found" << QwLog::endl;
161
162 }
163
164 status = status && PublishInternalValue(publish_name, publish_name, tmp_channel);
165
166 }
167
168 return status;
169
170}
const QwMollerADC_Channel * GetChannel(const TString name) const
const QwMollerADC_Channel * GetChannel(const TString name) const
const QwCombinedPMT * GetCombinedPMT(const TString name) const

References QwLog::endl(), VQwSubsystem::fPublishList, QwCombinedPMT::GetChannel(), QwIntegrationPMT::GetChannel(), GetCombinedPMT(), GetIntegrationPMT(), MQwPublishable_child< QwSubsystemArray, VQwSubsystem >::PublishInternalValue(), QwDebug, and QwError.

+ Here is the call graph for this function:

◆ RandomizeEventData()

void VQwDetectorArray::RandomizeEventData ( int helicity = 0,
Double_t time = 0.0 )
override

Definition at line 856 of file VQwDetectorArray.cc.

856 {
857
858 for (size_t i = 0; i < fMainDetID.size(); i++) {
859
860 // This is a QwIntegrationPMT
861 if (fMainDetID.at(i).fTypeID == kQwIntegrationPMT)
862 fIntegrationPMT[fMainDetID.at(i).fIndex].RandomizeEventData(helicity, time);
863
864 }
865
866}

References fIntegrationPMT, fMainDetID, and kQwIntegrationPMT.

◆ RandomizeMollerEvent()

void VQwDetectorArray::RandomizeMollerEvent ( int helicity)

Definition at line 910 of file VQwDetectorArray.cc.

910 {
911
912 /* fTargetCharge.PrintInfo();
913 fTargetX.PrintInfo();
914 fTargetY.PrintInfo();
915 fTargetXprime.PrintInfo();
916 fTargetYprime.PrintInfo();
917 fTargetEnergy.PrintInfo();*/
918
919 if(RequestExternalValue("x_targ", &fTargetX)){
920
921 if (bDEBUG){
922
923 dynamic_cast<QwMollerADC_Channel*>(&fTargetX)->PrintInfo();
924 QwWarning << "VQwDetectorArray::RandomizeMollerEvent Found "<<fTargetX.GetElementName()<< QwLog::endl;
925 }
926
927 }else{
928
929 bIsExchangedDataValid = kFALSE;
930 QwError << GetName() << " could not get external value for "
931 << fTargetX.GetElementName() << QwLog::endl;
932
933 }
934
935 if(RequestExternalValue("y_targ", &fTargetY)){
936
937 if (bDEBUG){
938 dynamic_cast<QwMollerADC_Channel*>(&fTargetY)->PrintInfo();
939 QwWarning << "VQwDetectorArray::RandomizeMollerEvent Found "<<fTargetY.GetElementName()<< QwLog::endl;
940 }
941
942 }else{
943
944 bIsExchangedDataValid = kFALSE;
945 QwError << GetName() << " could not get external value for "
946 << fTargetY.GetElementName() << QwLog::endl;
947 }
948
949 if(RequestExternalValue("xp_targ", &fTargetXprime)){
950
951 if (bDEBUG){
952
953 dynamic_cast<QwMollerADC_Channel*>(&fTargetXprime)->PrintInfo();
954 QwWarning << "VQwDetectorArray::RandomizeMollerEvent Found "<<fTargetXprime.GetElementName()<< QwLog::endl;
955 }
956
957 }else{
958
959 bIsExchangedDataValid = kFALSE;
960 QwError << GetName() << " could not get external value for "
961 << fTargetXprime.GetElementName() << QwLog::endl;
962
963 }
964
965 if(RequestExternalValue("yp_targ", &fTargetYprime)){
966
967 if (bDEBUG){
968
969 dynamic_cast<QwMollerADC_Channel*>(&fTargetYprime)->PrintInfo();
970 QwWarning << "VQwDetectorArray::RandomizeMollerEvent Found "<<fTargetYprime.GetElementName()<< QwLog::endl;
971
972 }
973
974 }else{
975
976 bIsExchangedDataValid = kFALSE;
977 QwError << GetName() << " could not get external value for "
978 << fTargetYprime.GetElementName() << QwLog::endl;
979
980 }
981
982 if(RequestExternalValue("e_targ", &fTargetEnergy)){
983
984 if (bDEBUG){
985
986 dynamic_cast<QwMollerADC_Channel*>(&fTargetEnergy)->PrintInfo();
987 QwWarning << "VQwDetectorArray::RandomizeMollerEvent Found "<<fTargetEnergy.GetElementName()<< QwLog::endl;
988
989 }
990
991 }else{
992
993 bIsExchangedDataValid = kFALSE;
994 QwError << GetName() << " could not get external value for "
995 << fTargetEnergy.GetElementName() << QwLog::endl;
996
997 }
998
999 for (size_t i = 0; i < fMainDetID.size(); i++) {
1000
1002 //fIntegrationPMT[i].PrintInfo();
1003
1004 }
1005
1006}

References bDEBUG, bIsExchangedDataValid, QwLog::endl(), fIntegrationPMT, fMainDetID, fTargetCharge, fTargetEnergy, fTargetX, fTargetXprime, fTargetY, fTargetYprime, VQwSubsystem::GetName(), PrintInfo(), QwError, QwWarning, and MQwPublishable_child< QwSubsystemArray, VQwSubsystem >::RequestExternalValue().

+ Here is the call graph for this function:

◆ Ratio()

void VQwDetectorArray::Ratio ( VQwSubsystem * numer,
VQwSubsystem * denom )
overridevirtual

Implements VQwSubsystemParity.

Definition at line 1495 of file VQwDetectorArray.cc.

1495 {
1496
1497 if (Compare(numer)&&Compare(denom)) {
1498
1499 VQwDetectorArray* innumer= dynamic_cast<VQwDetectorArray*>(numer) ;
1500 VQwDetectorArray* indenom= dynamic_cast<VQwDetectorArray*>(denom) ;
1501
1502 for (size_t i=0;i<innumer->fIntegrationPMT.size();i++)
1503 this->fIntegrationPMT[i].Ratio(innumer->fIntegrationPMT[i],indenom->fIntegrationPMT[i]);
1504
1505 for (size_t i=0;i<innumer->fCombinedPMT.size();i++)
1506 this->fCombinedPMT[i].Ratio(innumer->fCombinedPMT[i],indenom->fCombinedPMT[i]);
1507
1508 }
1509
1510 return;
1511
1512}
void Ratio(VQwSubsystem *numer, VQwSubsystem *denom) override

References Compare(), fCombinedPMT, fIntegrationPMT, Ratio(), VQwDetectorArray(), and VQwSubsystem::VQwSubsystem().

Referenced by Ratio().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Scale()

void VQwDetectorArray::Scale ( Double_t factor)
overridevirtual

Implements VQwSubsystemParity.

Definition at line 1515 of file VQwDetectorArray.cc.

1515 {
1516
1517 for (size_t i=0;i<fIntegrationPMT.size();i++)
1518 fIntegrationPMT[i].Scale(factor);
1519
1520 for (size_t i=0;i<fCombinedPMT.size();i++)
1521 fCombinedPMT[i].Scale(factor);
1522
1523 return;
1524
1525}
void Scale(Double_t factor) override

References fCombinedPMT, fIntegrationPMT, and Scale().

Referenced by Scale().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetRandomEventAsymmetry()

void VQwDetectorArray::SetRandomEventAsymmetry ( Double_t asymmetry)

Definition at line 844 of file VQwDetectorArray.cc.

844 {
845
846 for (size_t i = 0; i < fMainDetID.size(); i++) {
847
848 // This is a QwIntegrationPMT
849 if (fMainDetID.at(i).fTypeID == kQwIntegrationPMT)
850 fIntegrationPMT[fMainDetID.at(i).fIndex].SetRandomEventAsymmetry(asymmetry);
851
852 }
853
854}

References fIntegrationPMT, fMainDetID, and kQwIntegrationPMT.

◆ SetRandomEventParameters()

void VQwDetectorArray::SetRandomEventParameters ( Double_t mean,
Double_t sigma )

Definition at line 832 of file VQwDetectorArray.cc.

832 {
833
834 for (size_t i = 0; i < fMainDetID.size(); i++) {
835
836 // This is a QwIntegrationPMT
837 if (fMainDetID.at(i).fTypeID == kQwIntegrationPMT)
838 fIntegrationPMT[fMainDetID.at(i).fIndex].SetRandomEventParameters(mean, sigma);
839
840 }
841
842}

References fIntegrationPMT, fMainDetID, and kQwIntegrationPMT.

◆ UpdateErrorFlag()

void VQwDetectorArray::UpdateErrorFlag ( const VQwSubsystem * ev_error)
overridevirtual

update the error flag in the subsystem level from the top level routines related to stability checks. This will uniquely update the errorflag at each channel based on the error flag in the corresponding channel in the ev_error subsystem

Implements VQwSubsystemParity.

Definition at line 1177 of file VQwDetectorArray.cc.

1177 {
1178
1179 VQwSubsystem* tmp = const_cast<VQwSubsystem*>(ev_error);
1180
1181 if(Compare(tmp)){
1182
1183 const VQwDetectorArray* input = dynamic_cast<const VQwDetectorArray*> (ev_error);
1184
1185 for (size_t i=0;i<input->fIntegrationPMT.size();i++)
1186 this->fIntegrationPMT[i].UpdateErrorFlag(&(input->fIntegrationPMT[i]));
1187
1188 for (size_t i=0;i<input->fCombinedPMT.size();i++)
1189 this->fCombinedPMT[i].UpdateErrorFlag(&(input->fCombinedPMT[i]));
1190
1191 }
1192
1193}
virtual UInt_t UpdateErrorFlag()
Uses the error flags of contained data elements to update Returns the error flag to the top level rou...

References Compare(), fCombinedPMT, fIntegrationPMT, VQwSubsystemParity::UpdateErrorFlag(), VQwDetectorArray(), and VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ WritePromptSummary()

void VQwDetectorArray::WritePromptSummary ( QwPromptSummary * ps,
TString type )
overridevirtual

Reimplemented from VQwSubsystemParity.

Definition at line 1887 of file VQwDetectorArray.cc.

1887 {
1888
1889 Bool_t local_print_flag = false;
1890 Bool_t local_add_element= type.Contains("yield");
1891
1892 if(local_print_flag){
1893
1894 QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
1895 QwMessage << " QwDetectorArrayID::WritePromptSummary() " << QwLog::endl;
1896 QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
1897 }
1898
1899 const VQwHardwareChannel* tmp_channel = 0;
1900 TString element_name = "";
1901 Double_t element_value = 0.0;
1902 Double_t element_value_err = 0.0;
1903 Double_t element_value_width = 0.0;
1904
1905 PromptSummaryElement *local_ps_element = NULL;
1906 Bool_t local_add_these_elements= false;
1907
1908 for (size_t i = 0; i < fMainDetID.size(); i++) {
1909
1910 element_name = fMainDetID[i].fdetectorname;
1911 tmp_channel=GetIntegrationPMT(element_name)->GetChannel(element_name);
1912 element_value = 0.0;
1913 element_value_err = 0.0;
1914 element_value_width = 0.0;
1915
1916
1917 local_add_these_elements=element_name.Contains("sam"); // Need to change this to add other detectorss in summary
1918
1919 if(local_add_these_elements&&local_add_element){
1920
1921 ps->AddElement(new PromptSummaryElement(element_name));
1922
1923 }
1924
1925
1926 local_ps_element=ps->GetElementByName(element_name);
1927
1928
1929 if(local_ps_element) {
1930
1931 element_value = tmp_channel->GetValue();
1932 element_value_err = tmp_channel->GetValueError();
1933 element_value_width = tmp_channel->GetValueWidth();
1934
1935 local_ps_element->Set(type, element_value, element_value_err, element_value_width);
1936
1937 }
1938
1939 if( local_print_flag && local_ps_element) {
1940
1941 printf("Type %12s, Element %32s, value %12.4e error %8.4e width %12.4e\n",
1942 type.Data(), element_name.Data(), element_value, element_value_err, element_value_width);
1943
1944 }
1945
1946 }
1947
1948 return;
1949
1950}
void Set(TString type, const Double_t a, const Double_t a_err, const Double_t a_width)
void AddElement(PromptSummaryElement *in)
PromptSummaryElement * GetElementByName(TString name)
Double_t GetValueError() const
Double_t GetValueWidth() const
Double_t GetValue() const

References QwPromptSummary::AddElement(), QwLog::endl(), fMainDetID, QwIntegrationPMT::GetChannel(), QwPromptSummary::GetElementByName(), GetIntegrationPMT(), VQwHardwareChannel::GetValue(), VQwHardwareChannel::GetValueError(), VQwHardwareChannel::GetValueWidth(), QwMessage, and PromptSummaryElement::Set().

+ Here is the call graph for this function:

Field Documentation

◆ bDEBUG

const Bool_t VQwDetectorArray::bDEBUG =kFALSE
staticprivate

◆ bIsExchangedDataValid

Bool_t VQwDetectorArray::bIsExchangedDataValid
protected

◆ bNormalization

Bool_t VQwDetectorArray::bNormalization
protected

◆ fCombinedPMT

◆ fDEBUG

Bool_t VQwDetectorArray::fDEBUG
protected

Definition at line 237 of file VQwDetectorArray.h.

◆ fIntegrationPMT

◆ fMainDetErrorCount

Int_t VQwDetectorArray::fMainDetErrorCount
private

Definition at line 280 of file VQwDetectorArray.h.

Referenced by ApplySingleEventCuts(), and LoadEventCuts_Fin().

◆ fMainDetID

◆ fNormThreshold

Double_t VQwDetectorArray::fNormThreshold
protected

Definition at line 275 of file VQwDetectorArray.h.

Referenced by ProcessEvent_2(), and ProcessOptions().

◆ fTargetCharge

QwBeamCharge VQwDetectorArray::fTargetCharge
protected

◆ fTargetEnergy

QwBeamEnergy VQwDetectorArray::fTargetEnergy
protected

Definition at line 270 of file VQwDetectorArray.h.

Referenced by RandomizeMollerEvent(), and VQwDetectorArray().

◆ fTargetX

QwBeamPosition VQwDetectorArray::fTargetX
protected

Definition at line 266 of file VQwDetectorArray.h.

Referenced by RandomizeMollerEvent(), and VQwDetectorArray().

◆ fTargetXprime

QwBeamAngle VQwDetectorArray::fTargetXprime
protected

Definition at line 268 of file VQwDetectorArray.h.

Referenced by RandomizeMollerEvent(), and VQwDetectorArray().

◆ fTargetY

QwBeamPosition VQwDetectorArray::fTargetY
protected

Definition at line 267 of file VQwDetectorArray.h.

Referenced by RandomizeMollerEvent(), and VQwDetectorArray().

◆ fTargetYprime

QwBeamAngle VQwDetectorArray::fTargetYprime
protected

Definition at line 269 of file VQwDetectorArray.h.

Referenced by RandomizeMollerEvent(), and VQwDetectorArray().


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