QwAnalysis
QwLumi Class Reference

#include <QwLumi.h>

+ Inheritance diagram for QwLumi:
+ Collaboration diagram for QwLumi:

Public Member Functions

 QwLumi (const TString &name)
 Constructor with name. More...
 
 QwLumi (const QwLumi &source)
 Copy constructor. More...
 
virtual ~QwLumi ()
 Virtual destructor. More...
 
void ProcessOptions (QwOptions &options)
 Process the command line options. More...
 
Int_t LoadChannelMap (TString mapfile)
 Mandatory map file definition. More...
 
Int_t LoadInputParameters (TString pedestalfile)
 Mandatory parameter file definition. More...
 
Int_t LoadEventCuts (TString filename)
 Load the event cuts file. More...
 
Bool_t ApplySingleEventCuts ()
 Apply the single event cuts. More...
 
void IncrementErrorCounters ()
 Increment the error counters. More...
 
void PrintErrorCounters () const
 Report the number of events failed due to HW and event cut failures. More...
 
UInt_t GetEventcutErrorFlag ()
 Return the error flag to the top level routines related to stability checks and ErrorFlag updates. More...
 
void UpdateErrorFlag (const VQwSubsystem *ev_error)
 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 More...
 
void AccumulateRunningSum (VQwSubsystem *value)
 Update the running sums for devices. More...
 
void DeaccumulateRunningSum (VQwSubsystem *value)
 remove one entry from the running sums for devices More...
 
void CalculateRunningAverage ()
 Calculate the average for all good events. More...
 
Int_t ProcessConfigurationBuffer (const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
 
Int_t ProcessEvBuffer (const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
 TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware version. More...
 
void PrintDetectorID () const
 
void ClearEventData ()
 
Bool_t IsGoodEvent ()
 
void ProcessEvent ()
 
void ExchangeProcessedData ()
 
void ProcessEvent_2 ()
 Process the event data again, including data from other subsystems. Not all derived classes will require a second stage of event data processing. More...
 
Bool_t PublishInternalValues () const
 Publish all variables of the subsystem. More...
 
Bool_t PublishByRequest (TString device_name)
 Try to publish an internal variable matching the submitted name. More...
 
void DoNormalization (Double_t factor=1.0)
 
void SetRandomEventParameters (Double_t mean, Double_t sigma)
 
void SetRandomEventAsymmetry (Double_t asymmetry)
 
void RandomizeEventData (int helicity=0, double time=0.0)
 
void EncodeEventData (std::vector< UInt_t > &buffer)
 
VQwSubsystemoperator= (VQwSubsystem *value)
 Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsystem *value) by VQwSubsystem::operator=(value) More...
 
VQwSubsystemoperator+= (VQwSubsystem *value)
 
VQwSubsystemoperator-= (VQwSubsystem *value)
 
void Sum (VQwSubsystem *value1, VQwSubsystem *value2)
 
void Difference (VQwSubsystem *value1, VQwSubsystem *value2)
 
void Ratio (VQwSubsystem *numer, VQwSubsystem *denom)
 
void Normalize (VQwDataElement *denom)
 
void Scale (Double_t factor)
 
void ConstructHistograms (TDirectory *folder, TString &prefix)
 Construct the histograms for this subsystem in a folder with a prefix. More...
 
void FillHistograms ()
 Fill the histograms for this subsystem. More...
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, std::vector< Double_t > &values)
 Construct the branch and tree vector. More...
 
void ConstructBranch (TTree *tree, TString &prefix)
 Construct the branch and tree vector. More...
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &trim_file)
 Construct the branch and tree vector based on the trim file. More...
 
void FillTreeVector (std::vector< Double_t > &values) const
 Fill the tree vector. More...
 
void FillDB (QwParityDB *db, TString datatype)
 Fill the database. More...
 
void FillErrDB (QwParityDB *db, TString datatype)
 
const QwIntegrationPMTGetChannel (const TString name) const
 
const QwIntegrationPMTGetIntegrationPMT (const TString name) const
 
const QwCombinedPMTGetCombinedPMT (const TString name) const
 
Bool_t Compare (VQwSubsystem *source)
 
void PrintValue () const
 Print values of all channels. More...
 
void PrintInfo () const
 Print some information about the subsystem. More...
 
void WritePromptSummary (QwPromptSummary *ps, TString type)
 
- Public Member Functions inherited from VQwSubsystemParity
 VQwSubsystemParity (const TString &name)
 Constructor with name. More...
 
 VQwSubsystemParity (const VQwSubsystemParity &source)
 Copy constructor. More...
 
virtual ~VQwSubsystemParity ()
 Default destructor. More...
 
virtual void FillDB_MPS (QwParityDB *db, TString type)
 Fill the database with MPS-based variables Note that most subsystems don't need to do this. More...
 
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. More...
 
virtual void Blind (const QwBlinder *blinder)
 Blind the asymmetry of this subsystem. More...
 
virtual void Blind (const QwBlinder *blinder, const VQwSubsystemParity *subsys)
 Blind the difference of this subsystem. More...
 
virtual Bool_t CheckForEndOfBurst () const
 
- Public Member Functions inherited from VQwSubsystem
 VQwSubsystem (const TString &name)
 Constructor with name. More...
 
 VQwSubsystem (const VQwSubsystem &orig)
 Copy constructor by object. More...
 
virtual ~VQwSubsystem ()
 Default destructor. More...
 
TString GetSubsystemName () const
 
Bool_t HasDataLoaded () const
 
void SetParent (QwSubsystemArray *parent)
 Set the parent of this subsystem to the specified array. More...
 
QwSubsystemArrayGetParent (const unsigned int parent=0) const
 Get the parent of this subsystem. More...
 
VQwSubsystemGetSibling (const std::string &name) const
 Get the sibling with specified name. More...
 
Bool_t PublishInternalValue (const TString &name, const TString &desc, const VQwHardwareChannel *value) const
 Publish a variable name to the parent subsystem array. More...
 
Bool_t RequestExternalValue (const TString &name, VQwHardwareChannel *value) const
 Request a named value which is owned by an external subsystem; the request will be handled by the parent subsystem array. More...
 
virtual const VQwHardwareChannelReturnInternalValue (const TString &name) const
 Return a pointer to a varialbe to the parent subsystem array to be delivered to a different subsystem. More...
 
virtual Bool_t ReturnInternalValue (const TString &name, VQwHardwareChannel *value) const
 Return a named value to the parent subsystem array to be delivered to a different subsystem. More...
 
virtual std::vector< TString > GetParamFileNameList ()
 
virtual std::map< TString,
TString > 
GetDetectorMaps ()
 
virtual Int_t LoadDetectorMaps (QwParameterFile &file)
 Parse parameter file to find the map files. More...
 
virtual Int_t LoadGeometryDefinition (TString mapfile)
 Optional geometry definition. More...
 
virtual Int_t LoadCrosstalkDefinition (TString mapfile)
 Optional crosstalk definition. More...
 
void SetEventTypeMask (const UInt_t mask)
 Set event type mask. More...
 
UInt_t GetEventTypeMask () const
 Get event type mask. More...
 
virtual Int_t ProcessEvBuffer (const UInt_t event_type, const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
 
virtual void AtEndOfEventLoop ()
 Perform actions at the end of the event loop. More...
 
virtual void PrintDetectorMaps (Bool_t status) const
 
virtual void ConstructHistograms ()
 Construct the histograms for this subsystem. More...
 
virtual void ConstructHistograms (TDirectory *folder)
 Construct the histograms for this subsystem in a folder. More...
 
virtual void ConstructHistograms (TString &prefix)
 Construct the histograms for this subsystem with a prefix. More...
 
virtual void ConstructBranchAndVector (TTree *tree, std::vector< Double_t > &values)
 Construct the branch and tree vector. More...
 
virtual void ConstructTree ()
 Construct the tree for this subsystem. More...
 
virtual void ConstructTree (TDirectory *folder)
 Construct the tree for this subsystem in a folder. More...
 
virtual void ConstructTree (TString &prefix)
 Construct the tree for this subsystem with a prefix. More...
 
virtual void ConstructTree (TDirectory *folder, TString &prefix)
 Construct the tree for this subsystem in a folder with a prefix. More...
 
virtual void FillTree ()
 Fill the tree for this subsystem. More...
 
virtual void DeleteTree ()
 Delete the tree for this subsystem. More...
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects. More...
 
- Public Member Functions inherited from MQwCloneable< VQwSubsystem, QwLumi >
virtual ~MQwCloneable ()
 Virtual destructor. More...
 
virtual VQwSubsystemClone () const
 Concrete clone method. More...
 
const VQwFactory< VQwSubsystem > * Factory () const
 Factory getter. More...
 
- Public Member Functions inherited from VQwCloneable< VQwSubsystem >
virtual ~VQwCloneable ()
 Virtual destructor. More...
 
std::string GetClassName () const
 Get demangled name of this class. More...
 

Static Public Member Functions

static void DefineOptions (QwOptions &options)
 Define options function. More...
 
- Static Public Member Functions inherited from VQwSubsystem
static void DefineOptions ()
 Define options function (note: no virtual static functions in C++) More...
 
- Static Public Member Functions inherited from MQwCloneable< VQwSubsystem, QwLumi >
static VQwSubsystemCreate (const std::string &name)
 Object creation. More...
 
static QwLumiCast (QwLumi *type)
 Object dynamic cast. More...
 

Data Fields

std::vector< TString > fgDetectorTypeNames
 

Protected Member Functions

EQwPMTInstrumentType GetDetectorTypeID (TString name)
 
Int_t GetDetectorIndex (EQwPMTInstrumentType TypeID, TString name)
 
- Protected Member Functions inherited from VQwSubsystem
void UpdatePublishedValue (const TString &name, VQwHardwareChannel *data_channel)
 
void ClearAllBankRegistrations ()
 Clear all registration of ROC and Bank IDs for this subsystem. More...
 
virtual Int_t RegisterROCNumber (const UInt_t roc_id, const UInt_t bank_id=0)
 Tell the object that it will decode data from this ROC and sub-bank. More...
 
Int_t RegisterSubbank (const UInt_t bank_id)
 Tell the object that it will decode data from this sub-bank in the ROC currently open for registration. More...
 
Int_t GetSubbankIndex () const
 
Int_t GetSubbankIndex (const UInt_t roc_id, const UInt_t bank_id) const
 
void SetDataLoaded (Bool_t flag)
 
Int_t FindIndex (const std::vector< UInt_t > &myvec, const UInt_t value) const
 
Bool_t Compare (VQwSubsystem *source)
 
- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor. More...
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor. More...
 
virtual ~MQwHistograms ()
 Virtual destructor. More...
 
virtual MQwHistogramsoperator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram. More...
 

Protected Attributes

std::vector< QwIntegrationPMTfIntegrationPMT
 
std::vector< QwCombinedPMTfCombinedPMT
 
std::vector< QwSIS3801D24_ChannelfScalerPMT
 
std::vector< QwLumiDetectorIDfLumiDetectorID
 
QwBeamCharge fTargetCharge
 
Bool_t bIsExchangedDataValid
 
Bool_t bNormalization
 
- Protected Attributes inherited from VQwSubsystem
std::map< TString,
VQwHardwareChannel * > 
fPublishedInternalValues
 Map of published internal values. More...
 
std::vector< std::vector
< TString > > 
fPublishList
 List of parameters to be published (loaded at the channel map) More...
 
TString fSystemName
 Name of this subsystem. More...
 
UInt_t fEventTypeMask
 Mask of event types. More...
 
Bool_t fIsDataLoaded
 Has this subsystem gotten data to be processed? More...
 
std::vector< TString > fDetectorMapsNames
 
std::map< TString, TString > fDetectorMaps
 
Int_t fCurrentROC_ID
 ROC ID that is currently being processed. More...
 
Int_t fCurrentBank_ID
 Bank ID that is currently being processed. More...
 
std::vector< UInt_t > fROC_IDs
 Vector of ROC IDs associated with this subsystem. More...
 
std::vector< std::vector
< UInt_t > > 
fBank_IDs
 Vector of Bank IDs per ROC ID associated with this subsystem. More...
 
std::vector< QwSubsystemArray * > fArrays
 Vector of pointers to subsystem arrays that contain this subsystem. More...
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptrfHistograms
 Histograms associated with this data element. More...
 

Private Member Functions

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

Private Attributes

Int_t fQwLumiErrorCount
 

Static Private Attributes

static const Bool_t bDEBUG =kFALSE
 

Friends

class QwCombinedPMT
 

Detailed Description

Definition at line 57 of file QwLumi.h.

Constructor & Destructor Documentation

QwLumi::QwLumi ( )
private

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

QwLumi::QwLumi ( const TString &  name)
inline

Constructor with name.

Definition at line 67 of file QwLumi.h.

References fTargetCharge.

68  : VQwSubsystem(name),VQwSubsystemParity(name),bNormalization(kFALSE)
69  {
70  fTargetCharge.InitializeChannel("q_targ","derived");
71  };
Bool_t bNormalization
Definition: QwLumi.h:177
QwBeamCharge fTargetCharge
Definition: QwLumi.h:175
VQwSubsystemParity()
Private default constructor (not implemented, will throw linker error on use)
QwLumi::QwLumi ( const QwLumi source)
inline

Copy constructor.

Definition at line 73 of file QwLumi.h.

74  : VQwSubsystem(source),VQwSubsystemParity(source),
76  fScalerPMT(source.fScalerPMT),
78  { }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwLumiDetectorID > fLumiDetectorID
Definition: QwLumi.h:172
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170
VQwSubsystemParity()
Private default constructor (not implemented, will throw linker error on use)
virtual QwLumi::~QwLumi ( )
inlinevirtual

Virtual destructor.

Definition at line 80 of file QwLumi.h.

80 { };

Member Function Documentation

void QwLumi::AccumulateRunningSum ( VQwSubsystem value)
virtual

Update the running sums for devices.

Implements VQwSubsystemParity.

Definition at line 1187 of file QwLumi.cc.

References Compare(), fCombinedPMT, and fIntegrationPMT.

1188 {
1189  if (Compare(value1)) {
1190  QwLumi* value = dynamic_cast<QwLumi*>(value1);
1191 
1192  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1194 
1195  for (size_t i = 0; i < fCombinedPMT.size(); i++)
1197  }
1198 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
Bool_t Compare(VQwSubsystem *source)
Definition: QwLumi.cc:1003
Definition: QwLumi.h:57
void AccumulateRunningSum(VQwSubsystem *value)
Update the running sums for devices.
Definition: QwLumi.cc:1187

+ Here is the call graph for this function:

Bool_t QwLumi::ApplySingleEventCuts ( )
virtual

Apply the single event cuts.

Implements VQwSubsystemParity.

Definition at line 615 of file QwLumi.cc.

References bDEBUG, fCombinedPMT, fIntegrationPMT, and fQwLumiErrorCount.

615  {
616 
617  Bool_t status=kTRUE;
618  for(size_t i=0;i<fIntegrationPMT.size();i++){
619  status &= fIntegrationPMT[i].ApplySingleEventCuts();
620  if(!status && bDEBUG) std::cout<<"******* QwLumi::SingleEventCuts()->IntegrationPMT[ "<<i<<" , "<<fIntegrationPMT[i].GetElementName()<<" ] ******\n";
621  }
622  for(size_t i=0;i<fCombinedPMT.size();i++){
623  status &= fCombinedPMT[i].ApplySingleEventCuts();
624  if(!status && bDEBUG) std::cout<<"******* QwLumi::SingleEventCuts()->CombinedPMT[ "<<i<<" , "<<fCombinedPMT[i].GetElementName()<<" ] ******\n";
625  }
626 
627 
628  if (!status)
629  fQwLumiErrorCount++;//failed event counter for QwLumi
630 
631  return status;
632 }
Int_t fQwLumiErrorCount
Definition: QwLumi.h:181
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
static const Bool_t bDEBUG
Definition: QwLumi.h:183
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
void QwLumi::CalculateRunningAverage ( )
virtual

Calculate the average for all good events.

Implements VQwSubsystemParity.

Definition at line 1177 of file QwLumi.cc.

References fCombinedPMT, and fIntegrationPMT.

1178 {
1179  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1181 
1182  for (size_t i=0;i<fCombinedPMT.size();i++)
1184 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
void CalculateRunningAverage()
Calculate the average for all good events.
Definition: QwLumi.cc:1177
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
void QwLumi::ClearEventData ( )
virtual

Implements VQwSubsystem.

Definition at line 801 of file QwLumi.cc.

References fCombinedPMT, fIntegrationPMT, fScalerPMT, and VQwSubsystem::SetDataLoaded().

802 {
803  SetDataLoaded(kFALSE);
804  for(size_t i=0;i<fIntegrationPMT.size();i++)
806  for (size_t i=0;i<fCombinedPMT.size();i++)
808  for(size_t i=0;i<fScalerPMT.size();i++)
810 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
void ClearEventData()
Definition: QwLumi.cc:801
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170
void SetDataLoaded(Bool_t flag)
Definition: VQwSubsystem.h:305

+ Here is the call graph for this function:

Bool_t QwLumi::Compare ( VQwSubsystem source)

Definition at line 1003 of file QwLumi.cc.

References fCombinedPMT, fIntegrationPMT, and fScalerPMT.

Referenced by AccumulateRunningSum(), DeaccumulateRunningSum(), Difference(), operator+=(), operator-=(), operator=(), Ratio(), Sum(), and UpdateErrorFlag().

1004 {
1005  // std::cout<<" Here in QwLumi::Compare \n";
1006 
1007  Bool_t res=kTRUE;
1008  if(typeid(*value)!=typeid(*this))
1009  {
1010  res=kFALSE;
1011  // std::cout<<" types are not ok \n";
1012  // std::cout<<" this is bypassed just for now but should be fixed eventually \n";
1013  }
1014  else
1015  {
1016  QwLumi* input= dynamic_cast<QwLumi*>(value);
1017  if(input->fIntegrationPMT.size()!=fIntegrationPMT.size() ||
1018  input->fCombinedPMT.size()!=fCombinedPMT.size() )
1019  {
1020  res=kFALSE;
1021  }
1022  if(input->fScalerPMT.size()!=fScalerPMT.size())
1023  {
1024  res=kFALSE;
1025  }
1026  }
1027  return res;
1028 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
Definition: QwLumi.h:57
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170

+ Here is the caller graph for this function:

void QwLumi::ConstructBranch ( TTree *  tree,
TString &  prefix 
)
virtual

Construct the branch and tree vector.

Implements VQwSubsystem.

Definition at line 1069 of file QwLumi.cc.

References fCombinedPMT, fIntegrationPMT, and fScalerPMT.

Referenced by ConstructBranch().

1070 {
1071  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1072  fIntegrationPMT[i].ConstructBranch(tree, prefix);
1073  for (size_t i = 0; i < fCombinedPMT.size(); i++)
1074  fCombinedPMT[i].ConstructBranch(tree, prefix);
1075  for (size_t i = 0; i < fScalerPMT.size(); i++)
1076  fScalerPMT[i].ConstructBranch(tree, prefix);
1077 }
void ConstructBranch(TTree *tree, TString &prefix)
Construct the branch and tree vector.
Definition: QwLumi.cc:1069
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170

+ Here is the caller graph for this function:

void QwLumi::ConstructBranch ( TTree *  tree,
TString &  prefix,
QwParameterFile trim_file 
)
virtual

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

Implements VQwSubsystem.

Definition at line 1080 of file QwLumi.cc.

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

1081 {
1082  TString tmp;
1083  QwParameterFile* nextmodule;
1084 
1085  tmp="QwIntegrationPMT";
1086  trim_file.RewindToFileStart();
1087  if (trim_file.FileHasModuleHeader(tmp)){
1088  nextmodule=trim_file.ReadUntilNextModule();
1089  //This section contains sub modules and or channels to be included in the tree
1090 
1091  for(size_t i = 0; i < fIntegrationPMT.size(); i++)
1092  fIntegrationPMT[i].ConstructBranch(tree, prefix,*nextmodule);
1093  for(size_t i = 0; i < fIntegrationPMT.size(); i++)
1094  fScalerPMT[i].ConstructBranch(tree, prefix);
1095 
1096  }
1097 
1098  tmp="QwCombinedPMT";
1099  trim_file.RewindToFileStart();
1100  if (trim_file.FileHasModuleHeader(tmp)){
1101  nextmodule=trim_file.ReadUntilNextModule();//This section contains sub modules and or channels to be included in the tree
1102  for (size_t i=0;i<fCombinedPMT.size();i++)
1103  fCombinedPMT[i].ConstructBranch(tree, prefix, *nextmodule );
1104  }
1105 }
void ConstructBranch(TTree *tree, TString &prefix)
Construct the branch and tree vector.
Definition: QwLumi.cc:1069
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
Bool_t FileHasModuleHeader(const std::string &secname)
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170
QwParameterFile * ReadUntilNextModule(const bool add_current_line=false)

+ Here is the call graph for this function:

void QwLumi::ConstructBranchAndVector ( TTree *  tree,
TString &  prefix,
std::vector< Double_t > &  values 
)
virtual

Construct the branch and tree vector.

Implements VQwSubsystem.

Definition at line 1058 of file QwLumi.cc.

References fCombinedPMT, fIntegrationPMT, and fScalerPMT.

1059 {
1060  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1061  fIntegrationPMT[i].ConstructBranchAndVector(tree, prefix, values);
1062  for (size_t i = 0; i < fCombinedPMT.size(); i++)
1063  fCombinedPMT[i].ConstructBranchAndVector(tree, prefix, values);
1064  for (size_t i = 0; i < fScalerPMT.size(); i++)
1065  fScalerPMT[i].ConstructBranchAndVector(tree, prefix, values);
1066 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
Construct the branch and tree vector.
Definition: QwLumi.cc:1058
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170
void QwLumi::ConstructHistograms ( TDirectory *  folder,
TString &  prefix 
)
virtual

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

Implements VQwSubsystem.

Definition at line 1032 of file QwLumi.cc.

References VQwSubsystem::ConstructHistograms(), fCombinedPMT, fIntegrationPMT, and fScalerPMT.

1033 {
1034  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1035  fIntegrationPMT[i].ConstructHistograms(folder,prefix);
1036  for (size_t i = 0; i < fCombinedPMT.size(); i++)
1037  fCombinedPMT[i].ConstructHistograms(folder,prefix);
1038  for (size_t i = 0; i < fScalerPMT.size(); i++)
1039  fScalerPMT[i].ConstructHistograms(folder,prefix);
1040 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
Definition: VQwSubsystem.h:209
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170

+ Here is the call graph for this function:

void QwLumi::DeaccumulateRunningSum ( VQwSubsystem value)
virtual

remove one entry from the running sums for devices

Implements VQwSubsystemParity.

Definition at line 1200 of file QwLumi.cc.

References Compare(), fCombinedPMT, and fIntegrationPMT.

1200  {
1201  if (Compare(value1)) {
1202  QwLumi* value = dynamic_cast<QwLumi *>(value1);
1203 
1204  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1206  for (size_t i = 0; i < fCombinedPMT.size(); i++)
1208  }
1209 };
void DeaccumulateRunningSum(VQwSubsystem *value)
remove one entry from the running sums for devices
Definition: QwLumi.cc:1200
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
Bool_t Compare(VQwSubsystem *source)
Definition: QwLumi.cc:1003
Definition: QwLumi.h:57

+ Here is the call graph for this function:

void QwLumi::DefineOptions ( QwOptions options)
static

Define options function.

Definition at line 24 of file QwLumi.cc.

References QwOptions::AddOptions(), and default_bool_value.

25 {
26  options.AddOptions()
27  ("QwLumi.normalize",
28  po::value<bool>()->default_bool_value(true),
29  "Normalize the detectors by beam current");
30 }
#define default_bool_value(b)
Definition: QwOptions.h:51
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:164

+ Here is the call graph for this function:

void QwLumi::Difference ( VQwSubsystem value1,
VQwSubsystem value2 
)
virtual

Implements VQwSubsystemParity.

Definition at line 953 of file QwLumi.cc.

References Compare().

954 {
955  if (Compare(value1) && Compare(value2))
956  {
957  *this = value1;
958  *this -= value2;
959  }
960 }
Bool_t Compare(VQwSubsystem *source)
Definition: QwLumi.cc:1003

+ Here is the call graph for this function:

void QwLumi::DoNormalization ( Double_t  factor = 1.0)

Definition at line 1213 of file QwLumi.cc.

References bDEBUG, bIsExchangedDataValid, Qw::e, fTargetCharge, and Normalize().

Referenced by ProcessEvent_2().

1214 {
1216  {
1217  if (bDEBUG)
1218  {
1219  Double_t pedestal = fTargetCharge.GetPedestal();
1220  Double_t calfactor = fTargetCharge.GetCalibrationFactor();
1221  Double_t volts = fTargetCharge.GetAverageVolts();
1222  std::cout<<"QwLumi::ProcessEvent_2(): processing with exchanged data"<<std::endl;
1223  std::cout<<"pedestal, calfactor, average volts = "<<pedestal<<", "<<calfactor<<", "<<volts<<std::endl;
1224  }
1225  try
1226  {
1227  this->Normalize(&fTargetCharge);
1228  }
1229  catch (std::exception& e)
1230  {
1231  std::cerr << e.what() << std::endl;
1232  }
1233  }
1234 }
void Normalize(VQwDataElement *denom)
Definition: QwLumi.cc:991
Bool_t bIsExchangedDataValid
Definition: QwLumi.h:176
static const double e
Definition: QwUnits.h:91
static const Bool_t bDEBUG
Definition: QwLumi.h:183
QwBeamCharge fTargetCharge
Definition: QwLumi.h:175

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwLumi::EncodeEventData ( std::vector< UInt_t > &  buffer)
virtual

Reimplemented from VQwSubsystem.

Definition at line 505 of file QwLumi.cc.

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

506 {
507  std::vector<UInt_t> elements;
508  elements.clear();
509 
510  // Get all buffers in the order they are defined in the map file
511  for (size_t i = 0; i < fLumiDetectorID.size(); i++) {
512  // This is a QwIntegrationPMT
513  if (fLumiDetectorID.at(i).fTypeID == kQwIntegrationPMT)
514  fIntegrationPMT[fLumiDetectorID.at(i).fIndex].EncodeEventData(elements);
515  }
516 
517  // If there is element data, generate the subbank header
518  std::vector<UInt_t> subbankheader;
519  std::vector<UInt_t> rocheader;
520  if (elements.size() > 0) {
521 
522  // Form CODA subbank header
523  subbankheader.clear();
524  subbankheader.push_back(elements.size() + 1); // subbank size
525  subbankheader.push_back((fCurrentBank_ID << 16) | (0x01 << 8) | (1 & 0xff));
526  // subbank tag | subbank type | event number
527 
528  // Form CODA bank/roc header
529  rocheader.clear();
530  rocheader.push_back(subbankheader.size() + elements.size() + 1); // bank/roc size
531  rocheader.push_back((fCurrentROC_ID << 16) | (0x10 << 8) | (1 & 0xff));
532  // bank tag == ROC | bank type | event number
533 
534  // Add bank header, subbank header and element data to output buffer
535  buffer.insert(buffer.end(), rocheader.begin(), rocheader.end());
536  buffer.insert(buffer.end(), subbankheader.begin(), subbankheader.end());
537  buffer.insert(buffer.end(), elements.begin(), elements.end());
538  }
539 }
std::vector< QwLumiDetectorID > fLumiDetectorID
Definition: QwLumi.h:172
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
Int_t fCurrentROC_ID
ROC ID that is currently being processed.
Definition: VQwSubsystem.h:325
Int_t fCurrentBank_ID
Bank ID that is currently being processed.
Definition: VQwSubsystem.h:326
void QwLumi::ExchangeProcessedData ( )
virtual

Exchange data between subsystems

Reimplemented from VQwSubsystem.

Definition at line 707 of file QwLumi.cc.

References bDEBUG, bIsExchangedDataValid, bNormalization, QwLog::endl(), fTargetCharge, VQwSubsystem::HasDataLoaded(), QwWarning, and VQwSubsystem::RequestExternalValue().

708 {
709  if (! HasDataLoaded()) return;
710 
711  bIsExchangedDataValid = kTRUE;
712  if (bNormalization){
713  if(RequestExternalValue("q_targ", &fTargetCharge)){
714  if (bDEBUG){
715  QwWarning << "QwLumi::ExchangeProcessedData Found "<<fTargetCharge.GetElementName()<< QwLog::endl;
716  //QwWarning <<"****QwMainCerenkovDetector****"<< QwLog::endl;
717  (dynamic_cast<QwVQWK_Channel*>(&fTargetCharge))->PrintInfo();
718  }
719  }
720  }
721 }
Bool_t bIsExchangedDataValid
Definition: QwLumi.h:176
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
Bool_t bNormalization
Definition: QwLumi.h:177
static const Bool_t bDEBUG
Definition: QwLumi.h:183
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
Bool_t RequestExternalValue(const TString &name, VQwHardwareChannel *value) const
Request a named value which is owned by an external subsystem; the request will be handled by the par...
QwBeamCharge fTargetCharge
Definition: QwLumi.h:175
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45

+ Here is the call graph for this function:

void QwLumi::FillDB ( QwParityDB db,
TString  type 
)
virtual

Fill the database.

Reimplemented from VQwSubsystemParity.

Definition at line 1243 of file QwLumi.cc.

References QwDatabase::Connect(), QwDBInterface::DetermineMeasurementTypeID(), QwDatabase::Disconnect(), QwLog::endl(), fCombinedPMT, fIntegrationPMT, QwParityDB::GetAnalysisID(), Qw::kBoldRed, Qw::kGreen, Qw::kNormal, QwDatabase::Query(), and QwMessage.

1244 {
1245 
1246  Bool_t local_print_flag = false;
1247  if(local_print_flag){
1248  QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
1249  QwMessage << " QwLumi::FillDB " << QwLog::endl;
1250  QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
1251  }
1252 
1253  std::vector<QwDBInterface> interface;
1254  std::vector<QwParitySSQLS::lumi_data> entrylist;
1255 
1256  UInt_t analysis_id = db->GetAnalysisID();
1257 
1258  TString measurement_type;
1259  measurement_type = QwDBInterface::DetermineMeasurementTypeID(datatype);
1260 
1261  UInt_t i,j;
1262  i = j = 0;
1263  if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "IntegrationPMT" <<QwLog::endl;
1264 
1265  for(i=0; i< fIntegrationPMT.size(); i++) {
1266  interface.clear();
1267  interface = fIntegrationPMT[i].GetDBEntry();
1268  for(j=0; j<interface.size(); j++){
1269  interface.at(j).SetAnalysisID( analysis_id );
1270  interface.at(j).SetLumiDetectorID( db );
1271  interface.at(j).SetMeasurementTypeID( measurement_type );
1272  interface.at(j).PrintStatus( local_print_flag );
1273  interface.at(j).AddThisEntryToList( entrylist );
1274  }
1275  }
1276  if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "Combined PMT" <<QwLog::endl;
1277 
1278  for(i=0; i< fCombinedPMT.size(); i++)
1279  {
1280  interface.clear();
1281  interface = fCombinedPMT[i].GetDBEntry();
1282  for(j=0; j<interface.size(); j++) {
1283  interface.at(j).SetAnalysisID( analysis_id );
1284  interface.at(j).SetLumiDetectorID( db );
1285  interface.at(j).SetMeasurementTypeID( measurement_type );
1286  interface.at(j).PrintStatus( local_print_flag );
1287  interface.at(j).AddThisEntryToList( entrylist );
1288  }
1289  }
1290 
1291 
1292 
1293 
1294  if(local_print_flag) {
1295  QwMessage << QwColor(Qw::kGreen) << "Entrylist Size : "
1296  << QwColor(Qw::kBoldRed) << entrylist.size()
1298  }
1299 
1300  db->Connect();
1301  // Check the entrylist size, if it isn't zero, start to query..
1302  if( entrylist.size() ) {
1303  mysqlpp::Query query= db->Query();
1304  query.insert(entrylist.begin(), entrylist.end());
1305  query.execute();
1306  }
1307  else {
1308  QwMessage << "QwLumi::FillDB :: This is the case when the entrlylist contains nothing in "<< datatype.Data() << QwLog::endl;
1309  }
1310 
1311  db->Disconnect();
1312 
1313  return;
1314 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void Disconnect()
Definition: QwDatabase.h:59
Bool_t Connect()
Open a connection to the database using the predefined parameters.
Definition: QwDatabase.cc:175
UInt_t GetAnalysisID()
Definition: QwParityDB.h:71
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
mysqlpp::Query Query(const char *qstr=0)
Definition: QwDatabase.h:66
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
A color changing class for the output stream.
Definition: QwColor.h:98
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
static TString DetermineMeasurementTypeID(TString type, TString suffix="", Bool_t forcediffs=kFALSE)

+ Here is the call graph for this function:

void QwLumi::FillErrDB ( QwParityDB db,
TString  datatype 
)
virtual

Reimplemented from VQwSubsystemParity.

Definition at line 1319 of file QwLumi.cc.

References QwDatabase::Connect(), QwDatabase::Disconnect(), QwLog::endl(), fCombinedPMT, fIntegrationPMT, QwParityDB::GetAnalysisID(), Qw::kBoldRed, Qw::kGreen, Qw::kNormal, QwDatabase::Query(), and QwMessage.

1320 {
1321 
1322  Bool_t local_print_flag = false;
1323  if(local_print_flag){
1324  QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
1325  QwMessage << " QwLumi::FillErrDB " << QwLog::endl;
1326  QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
1327  }
1328 
1329  std::vector<QwErrDBInterface> interface;
1330  std::vector<QwParitySSQLS::lumi_errors> entrylist;
1331 
1332  UInt_t analysis_id = db->GetAnalysisID();
1333 
1334  UInt_t i,j;
1335  i = j = 0;
1336  if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "IntegrationPMT" <<QwLog::endl;
1337 
1338  for(i=0; i< fIntegrationPMT.size(); i++) {
1339  interface.clear();
1340  interface = fIntegrationPMT[i].GetErrDBEntry();
1341  for(j=0; j<interface.size(); j++){
1342  interface.at(j).SetAnalysisID ( analysis_id );
1343  interface.at(j).SetLumiDetectorID ( db );
1344  interface.at(j).PrintStatus ( local_print_flag );
1345  interface.at(j).AddThisEntryToList( entrylist );
1346  }
1347  }
1348  if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "Combined PMT" <<QwLog::endl;
1349 
1350  for(i=0; i< fCombinedPMT.size(); i++)
1351  {
1352  interface.clear();
1353  interface = fCombinedPMT[i].GetErrDBEntry();
1354  for(j=0; j<interface.size(); j++) {
1355  interface.at(j).SetAnalysisID ( analysis_id );
1356  interface.at(j).SetLumiDetectorID ( db );
1357  interface.at(j).PrintStatus ( local_print_flag );
1358  interface.at(j).AddThisEntryToList( entrylist );
1359  }
1360  }
1361 
1362 
1363 
1364 
1365  if(local_print_flag) {
1366  QwMessage << QwColor(Qw::kGreen) << "Entrylist Size : "
1367  << QwColor(Qw::kBoldRed) << entrylist.size()
1369  }
1370 
1371  db->Connect();
1372  // Check the entrylist size, if it isn't zero, start to query..
1373  if( entrylist.size() ) {
1374  mysqlpp::Query query= db->Query();
1375  query.insert(entrylist.begin(), entrylist.end());
1376  query.execute();
1377  }
1378  else {
1379  QwMessage << "QwLumi::FillErrDB :: This is the case when the entrlylist contains nothing in "<< datatype.Data() << QwLog::endl;
1380  }
1381 
1382  db->Disconnect();
1383 
1384  return;
1385 };
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void Disconnect()
Definition: QwDatabase.h:59
Bool_t Connect()
Open a connection to the database using the predefined parameters.
Definition: QwDatabase.cc:175
UInt_t GetAnalysisID()
Definition: QwParityDB.h:71
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
mysqlpp::Query Query(const char *qstr=0)
Definition: QwDatabase.h:66
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
A color changing class for the output stream.
Definition: QwColor.h:98
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299

+ Here is the call graph for this function:

void QwLumi::FillHistograms ( )
virtual

Fill the histograms for this subsystem.

Implements VQwSubsystem.

Definition at line 1044 of file QwLumi.cc.

References fCombinedPMT, fIntegrationPMT, fScalerPMT, and VQwSubsystem::HasDataLoaded().

1045 {
1046  if (! HasDataLoaded()) return;
1047 
1048  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1050  for (size_t i = 0; i < fCombinedPMT.size(); i++)
1052  for (size_t i = 0; i < fScalerPMT.size(); i++)
1054 }
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
void FillHistograms()
Fill the histograms for this subsystem.
Definition: QwLumi.cc:1044
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170

+ Here is the call graph for this function:

void QwLumi::FillTreeVector ( std::vector< Double_t > &  values) const
virtual

Fill the tree vector.

Implements VQwSubsystem.

Definition at line 1108 of file QwLumi.cc.

References fCombinedPMT, fIntegrationPMT, fScalerPMT, and VQwSubsystem::HasDataLoaded().

1109 {
1110  if (! HasDataLoaded()) return;
1111 
1112  for(size_t i = 0; i < fIntegrationPMT.size(); i++)
1113  fIntegrationPMT[i].FillTreeVector(values);
1114  for (size_t i=0;i<fCombinedPMT.size();i++)
1115  fCombinedPMT[i].FillTreeVector(values);
1116  for(size_t i = 0; i < fScalerPMT.size(); i++)
1117  fScalerPMT[i].FillTreeVector(values);
1118 }
void FillTreeVector(std::vector< Double_t > &values) const
Fill the tree vector.
Definition: QwLumi.cc:1108
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170

+ Here is the call graph for this function:

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

Definition at line 845 of file QwLumi.cc.

References GetIntegrationPMT().

Referenced by PublishByRequest().

846 {
847  return GetIntegrationPMT(name);
848 }
const QwIntegrationPMT * GetIntegrationPMT(const TString name) const
Definition: QwLumi.cc:852

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 865 of file QwLumi.cc.

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

866 {
867  TString tmpname = name;
868  tmpname.ToLower();
869  if (! fCombinedPMT.empty())
870  {
871  for (size_t i=0;i<fCombinedPMT.size();i++)
872  {
873  if (fCombinedPMT.at(i).GetElementName() == tmpname)
874  {
875  //std::cout<<"Get CombinedPMT "<<tmpname<<std::endl;
876  return &(fCombinedPMT.at(i));
877  }
878  }
879  }
880  QwMessage << "QwLumi::GetCombinedPMT: cannot find channel " << tmpname << QwLog::endl;
881  return NULL;
882 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299

+ Here is the call graph for this function:

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

Definition at line 818 of file QwLumi.cc.

References fLumiDetectorID.

Referenced by LoadChannelMap(), and LoadEventCuts().

819 {
820  Bool_t ldebug=kFALSE;
821  if(ldebug)
822  {
823  std::cout<<"QwLumi::GetDetectorIndex\n";
824  std::cout<<"type_id=="<<type_id<<" name="<<name<<"\n";
825  std::cout<<fLumiDetectorID.size()<<" already registered detector\n";
826  }
827 
828  Int_t result=-1;
829  for(size_t i=0;i<fLumiDetectorID.size();i++)
830  {
831  if(fLumiDetectorID[i].fTypeID==type_id)
832  if(fLumiDetectorID[i].fdetectorname==name)
833  result=fLumiDetectorID[i].fIndex;
834  if(ldebug)
835  {
836  std::cout<<"testing against ("<<fLumiDetectorID[i].fTypeID
837  <<","<<fLumiDetectorID[i].fdetectorname<<")=>"<<result<<"\n";
838  }
839  }
840 
841  return result;
842 }
std::vector< QwLumiDetectorID > fLumiDetectorID
Definition: QwLumi.h:172

+ Here is the caller graph for this function:

EQwPMTInstrumentType QwLumi::GetDetectorTypeID ( TString  name)
protected

Definition at line 812 of file QwLumi.cc.

References GetQwPMTInstrumentType().

Referenced by LoadChannelMap(), and LoadEventCuts().

813 {
814  return GetQwPMTInstrumentType(name);
815 }
EQwPMTInstrumentType GetQwPMTInstrumentType(TString name)
Definition: QwTypes.cc:11

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

UInt_t QwLumi::GetEventcutErrorFlag ( )
virtual

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

Implements VQwSubsystemParity.

Definition at line 664 of file QwLumi.cc.

References fCombinedPMT, and fIntegrationPMT.

664  {//return the error flag
665  UInt_t ErrorFlag;
666  ErrorFlag=0;
667  for(size_t i=0;i<fIntegrationPMT.size();i++){
668  ErrorFlag |= fIntegrationPMT[i].GetEventcutErrorFlag();
669  }
670  for(size_t i=0;i<fCombinedPMT.size();i++){
671  ErrorFlag |= fCombinedPMT[i].GetEventcutErrorFlag();
672  }
673  return ErrorFlag;
674 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
const QwIntegrationPMT * QwLumi::GetIntegrationPMT ( const TString  name) const

Definition at line 852 of file QwLumi.cc.

References fIntegrationPMT.

Referenced by GetChannel().

853 {
854  if (! fIntegrationPMT.empty()) {
855  for (std::vector<QwIntegrationPMT>::const_iterator IntegrationPMT = fIntegrationPMT.begin(); IntegrationPMT != fIntegrationPMT.end(); ++IntegrationPMT) {
856  if (IntegrationPMT->GetElementName() == name) {
857  return &(*IntegrationPMT);
858  }
859  }
860  }
861  return 0;
862 }
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168

+ Here is the caller graph for this function:

void QwLumi::IncrementErrorCounters ( )
virtual

Increment the error counters.

Implements VQwSubsystemParity.

Definition at line 635 of file QwLumi.cc.

References fCombinedPMT, and fIntegrationPMT.

636 {
637  for(size_t i=0;i<fIntegrationPMT.size();i++){
638  fIntegrationPMT[i].IncrementErrorCounters();
639  }
640  for(size_t i=0;i<fCombinedPMT.size();i++){
641  fCombinedPMT[i].IncrementErrorCounters();
642  }
643 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
Bool_t QwLumi::IsGoodEvent ( )

Definition at line 792 of file QwLumi.cc.

793 {
794  Bool_t test=kTRUE;
795 
796  return test;
797 }
Int_t QwLumi::LoadChannelMap ( TString  mapfile)
virtual

Mandatory map file definition.

TODO: Instead of just forcing the external clock to not be used, we should figure out how to use the clock from teh beamline subsystem.

Implements VQwSubsystem.

Definition at line 45 of file QwLumi.cc.

References QwLog::endl(), QwLumiDetectorID::fCombinedChannelNames, fCombinedPMT, VQwSubsystem::fDetectorMaps, QwLumiDetectorID::fdetectorname, QwLumiDetectorID::fdetectortype, QwLumiDetectorID::fIndex, fIntegrationPMT, fLumiDetectorID, QwLumiDetectorID::fmoduletype, fScalerPMT, QwLumiDetectorID::fSubbankIndex, QwLumiDetectorID::fTypeID, QwLumiDetectorID::fWeight, QwLumiDetectorID::fWordInSubbank, QwVQWK_Channel::GetBufferOffset(), GetDetectorIndex(), GetDetectorTypeID(), VQwSubsystem::GetSubbankIndex(), VQwSubsystem::GetSubsystemName(), QwParameterFile::GetUInt(), kQwCombinedPMT, kQwIntegrationPMT, kQwScalerPMT, QwLumiDetectorID::Print(), QwError, VQwSubsystem::RegisterROCNumber(), VQwSubsystem::RegisterSubbank(), QwCombinedPMT::SetBlindability(), QwIntegrationPMT::SetBlindability(), QwCombinedPMT::SetNormalizability(), and QwIntegrationPMT::SetNormalizability().

46 {
47  Bool_t ldebug=kFALSE;
48 
49  TString varname, varvalue;
50  TString modtype, dettype, namech, nameofcombinedchan, keyword, keyword2;
51  Int_t modnum = 0;
52  Int_t channum = 0;
53  Int_t combinedchans = 0;
54  std::vector<TString> combinedchannelnames;
55  std::vector<Double_t> weight;
56  Int_t currentrocread=0;
57  Int_t currentbankread=0;
58  Int_t offset = -1;
59  Int_t currentsubbankindex=-1;
60  Int_t fSample_size=0;
61 
62  QwParameterFile mapstr(mapfile.Data()); //Open the file
63  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
64  while (mapstr.ReadNextLine())
65  {
66  mapstr.TrimComment('!'); // Remove everything after a '!' character.
67  mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
68  if (mapstr.LineIsEmpty()) continue;
69 
70  if (mapstr.HasVariablePair("=",varname,varvalue))
71  {
72  // This is a declaration line. Decode it.
73  varname.ToLower();
74  UInt_t value = QwParameterFile::GetUInt(varvalue);
75 
76  if (varname=="roc")
77  {
78  currentrocread=value;
79  RegisterROCNumber(value,0);
80  }
81  else if (varname=="bank")
82  {
83  currentbankread=value;
84  RegisterSubbank(value);
85  }
86  else if (varname=="sample_size")
87  {
88  fSample_size=value;
89  }
90  }
91  else
92  {
93  Bool_t lineok=kTRUE;
94  keyword = "";
95  keyword2 = "";
96  // Break this line into tokens to process it.
97  modtype = mapstr.GetTypedNextToken<TString>(); // module type
98  if (modtype == "VQWK" || modtype == "SCALER")
99  {
100  modnum = mapstr.GetTypedNextToken<Int_t>(); //slot number
101  channum = mapstr.GetTypedNextToken<Int_t>(); //channel number
102  dettype = mapstr.GetTypedNextToken<TString>(); //type-purpose of the detector
103  dettype.ToLower();
104  namech = mapstr.GetTypedNextToken<TString>(); //name of the detector
105  namech.ToLower();
106  keyword = mapstr.GetTypedNextToken<TString>();
107  keyword2 = mapstr.GetTypedNextToken<TString>();
108  keyword.ToLower();
109  keyword2.ToLower();
110  }
111  else if (modtype == "VPMT")
112  {
113  channum = mapstr.GetTypedNextToken<Int_t>(); //channel number
114  combinedchans = mapstr.GetTypedNextToken<Int_t>(); //number of combined channels
115  dettype = mapstr.GetTypedNextToken<TString>(); //type-purpose of the detector
116  dettype.ToLower();
117  namech = mapstr.GetTypedNextToken<TString>(); //name of the detector
118  namech.ToLower();
119  //TString nameofchannel;
120  combinedchannelnames.clear();
121  for (int i=0; i<combinedchans; i++)
122  {
123  nameofcombinedchan = mapstr.GetTypedNextToken<TString>();
124  nameofcombinedchan.ToLower();
125  combinedchannelnames.push_back(nameofcombinedchan);
126  }
127  weight.clear();
128  for (int i=0; i<combinedchans; i++)
129  {
130  weight.push_back( mapstr.GetTypedNextToken<Double_t>());
131  }
132  keyword = mapstr.GetTypedNextToken<TString>();
133  keyword2 = mapstr.GetTypedNextToken<TString>();
134  keyword.ToLower();
135  keyword2.ToLower();
136 
137 
138 
139 
140 
141 
142 
143  }
144  if(currentsubbankindex!=GetSubbankIndex(currentrocread,currentbankread))
145  {
146  currentsubbankindex=GetSubbankIndex(currentrocread,currentbankread);
147  }
148 
149 
150 
151  QwLumiDetectorID localLumiDetectorID;
152  localLumiDetectorID.fdetectorname=namech;
153  localLumiDetectorID.fmoduletype=modtype;
154  localLumiDetectorID.fSubbankIndex=currentsubbankindex;
155  localLumiDetectorID.fdetectortype=dettype;
156 
157 
158  if(modtype=="VQWK")
159  {
160  offset = QwVQWK_Channel::GetBufferOffset(modnum, channum);
161  localLumiDetectorID.fWordInSubbank = offset;
162  }
163  else if(modtype=="SCALER")
164  {
165  offset = QwSIS3801D24_Channel::GetBufferOffset(modnum, channum);
166  localLumiDetectorID.fWordInSubbank = offset;
167  }
168  else if (modtype=="VPMT")
169  {
170  localLumiDetectorID.fCombinedChannelNames = combinedchannelnames;
171  localLumiDetectorID.fWeight = weight;
172  //std::cout<<"Add in a combined channel"<<std::endl;
173  }
174 
175  if(offset<0)
176  {
177  QwError << "QwLumi::LoadChannelMap: Unknown module type: "
178  << modtype <<", the detector "<<namech<<" will not be decoded "
179  << QwLog::endl;
180  lineok=kFALSE;
181  continue;
182  }
183 
184 
185 
186 
187  localLumiDetectorID.fTypeID=GetDetectorTypeID(dettype);
188  if(localLumiDetectorID.fTypeID==-1)
189  {
190  QwError << "QwLumi::LoadChannelMap: Unknown detector type: "
191  << dettype <<", the detector "<<namech<<" will not be decoded "
192  << QwLog::endl;
193  lineok=kFALSE;
194  continue;
195  }
196 
197  localLumiDetectorID.fIndex=
198  GetDetectorIndex(localLumiDetectorID.fTypeID,
199  localLumiDetectorID.fdetectorname);
200 
201  if(localLumiDetectorID.fIndex==-1)
202  {
203  if(localLumiDetectorID.fTypeID==kQwIntegrationPMT)
204  {
205  QwIntegrationPMT localIntegrationPMT(GetSubsystemName(),localLumiDetectorID.fdetectorname);
206 
207  // Force all Lumi PMTs to be not_blindable.
208  // This isn't really needed, since the subsystem
209  // doesn't call QwIntegrationPMT::Blind, but let's
210  // do it anyway.
211  localIntegrationPMT.SetBlindability(kFALSE);
212  if (keyword=="not_normalizable"
213  || keyword2=="not_normalizable")
214  localIntegrationPMT.SetNormalizability(kFALSE);
215  else
216  localIntegrationPMT.SetNormalizability(kTRUE);
217 
218  fIntegrationPMT.push_back(localIntegrationPMT);
219  fIntegrationPMT[fIntegrationPMT.size()-1].SetDefaultSampleSize(fSample_size);
220  localLumiDetectorID.fIndex=fIntegrationPMT.size()-1;
221  }
222  else if (localLumiDetectorID.fTypeID==kQwCombinedPMT)
223  {
224  QwCombinedPMT localcombinedPMT(GetSubsystemName(),localLumiDetectorID.fdetectorname);
225  // Force all Lumi PMTs to be not_blindable.
226  // This isn't really needed, since the subsystem
227  // doesn't call QwCombinedPMT::Blind, but let's
228  // do it anyway.
229  localcombinedPMT.SetBlindability(kFALSE);
230  if (keyword=="not_normalizable"
231  || keyword2=="not_normalizable")
232  localcombinedPMT.SetNormalizability(kFALSE);
233  else
234  localcombinedPMT.SetNormalizability(kTRUE);
235 
236  fCombinedPMT.push_back(localcombinedPMT);
237  fCombinedPMT[fCombinedPMT.size()-1].SetDefaultSampleSize(fSample_size);
238  localLumiDetectorID.fIndex=fCombinedPMT.size()-1;
239  }
240 
241 
242 
243 
244 
245 
246 
247 
248  if(localLumiDetectorID.fTypeID==kQwScalerPMT)
249  {
250  QwSIS3801D24_Channel localcounter(localLumiDetectorID.fdetectorname);
251  /// TODO: Instead of just forcing the external clock to not be used, we should
252  /// figure out how to use the clock from teh beamline subsystem.
253  localcounter.SetNeedsExternalClock(kFALSE);
254  fScalerPMT.push_back(localcounter);
255  localLumiDetectorID.fIndex=fScalerPMT.size()-1;
256  }
257 
258  }
259 
260 
261  if(ldebug)
262  {
263  localLumiDetectorID.Print();
264  std::cout<<"line ok=";
265  if(lineok) std::cout<<"TRUE"<<std::endl;
266  else
267  std::cout<<"FALSE"<<std::endl;
268  }
269 
270  if(lineok)
271  fLumiDetectorID.push_back(localLumiDetectorID);
272  }
273  }
274 
275 
276 
277 
278 
279  //std::cout<<"linking combined channels"<<std::endl;
280 
281  for (size_t i=0; i<fLumiDetectorID.size(); i++)
282  {
283  if (fLumiDetectorID[i].fTypeID==kQwCombinedPMT)
284  {
285  Int_t ind = fLumiDetectorID[i].fIndex;
286 
287  //check to see if all required channels are available
288  if (ldebug)
289  {
290  std::cout<<"fLumiDetectorID[i].fCombinedChannelNames.size()="
291  <<fLumiDetectorID[i].fCombinedChannelNames.size()<<std::endl<<"name list: ";
292  for (size_t n=0; n<fLumiDetectorID[i].fCombinedChannelNames.size(); n++)
293  std::cout<<" "<<fLumiDetectorID[i].fCombinedChannelNames[n];
294  std::cout<<std::endl;
295  }
296 
297  Int_t chanmatched=0;
298  for (size_t j=0; j<fLumiDetectorID[i].fCombinedChannelNames.size(); j++)
299  {
300 
301  for (size_t k=0; k<fLumiDetectorID.size(); k++)
302  {
303  if (fLumiDetectorID[i].fCombinedChannelNames[j]==fLumiDetectorID[k].fdetectorname)
304  {
305  if (ldebug)
306  std::cout<<"found a to-be-combined channel candidate"<<std::endl;
307  chanmatched ++;
308  break;
309  }
310  }
311  }
312 
313  if ((Int_t) fLumiDetectorID[i].fCombinedChannelNames.size()==chanmatched)
314  {
315  for (size_t l=0; l<fLumiDetectorID[i].fCombinedChannelNames.size(); l++)
316  {
317  Int_t ind_pmt = GetDetectorIndex(GetDetectorTypeID("integrationpmt"),
318  fLumiDetectorID[i].fCombinedChannelNames[l]);
319 
320  fCombinedPMT[ind].Add(&fIntegrationPMT[ind_pmt],fLumiDetectorID[i].fWeight[l]);
321 
322  if (ldebug) std::cout<<"added combined pmt "<<fLumiDetectorID[i].fWeight[l] <<" to array"<<std::endl;
323  }
324  fCombinedPMT[ind].LinkChannel(fLumiDetectorID[i].fdetectorname);
325  if (ldebug)
326  std::cout<<"linked a combined channel"<<std::endl;
327  }
328  else
329  {
330  std::cerr<<"cannot combine void channels for "<<fLumiDetectorID[i].fdetectorname<<std::endl;
331  fLumiDetectorID[i].fIndex = -1;
332  continue;
333  }
334  }
335  }
336 
337 
338  if(ldebug)
339  {
340  std::cout<<"QwLumi::Done with Load map channel \n";
341  for(size_t i=0;i<fLumiDetectorID.size();i++)
342  fLumiDetectorID[i].Print();
343  }
344  ldebug=kFALSE;
345  mapstr.Close(); // Close the file (ifstream)
346 
347  return 0;
348 }
Int_t GetSubbankIndex() const
Definition: VQwSubsystem.h:303
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
void Print() const
Definition: QwLumi.cc:1162
TString fdetectorname
Definition: QwLumi.h:45
static UInt_t GetUInt(const TString &varvalue)
std::vector< Double_t > fWeight
Definition: QwLumi.h:48
TString fdetectortype
Definition: QwLumi.h:46
int fSubbankIndex
Definition: QwLumi.h:33
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
int fWordInSubbank
Definition: QwLumi.h:36
EQwPMTInstrumentType fTypeID
Definition: QwLumi.h:40
std::vector< QwLumiDetectorID > fLumiDetectorID
Definition: QwLumi.h:172
Int_t GetDetectorIndex(EQwPMTInstrumentType TypeID, TString name)
Definition: QwLumi.cc:818
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
class QwScaler_Channel< 0x00ffffff, 0 > QwSIS3801D24_Channel
Int_t RegisterSubbank(const UInt_t bank_id)
Tell the object that it will decode data from this sub-bank in the ROC currently open for registratio...
virtual Int_t RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id=0)
Tell the object that it will decode data from this ROC and sub-bank.
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
static Int_t GetBufferOffset(Int_t moduleindex, Int_t channelindex)
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170
std::vector< TString > fCombinedChannelNames
Definition: QwLumi.h:47
TString fmoduletype
Definition: QwLumi.h:44
#define QwError
Predefined log drain for errors.
Definition: QwLog.h:40
EQwPMTInstrumentType GetDetectorTypeID(TString name)
Definition: QwLumi.cc:812
TString GetSubsystemName() const
Definition: VQwSubsystem.h:93

+ Here is the call graph for this function:

Int_t QwLumi::LoadEventCuts ( TString  filename)
virtual

Load the event cuts file.

Implements VQwSubsystemParity.

Definition at line 352 of file QwLumi.cc.

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

353 {
354  Int_t eventcut_flag = 1;
355 
356  // Open the file
357  QwParameterFile mapstr(filename.Data());
358  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
359  while (mapstr.ReadNextLine()){
360  //std::cout<<"********* In the loop *************"<<std::endl;
361  mapstr.TrimComment('!'); // Remove everything after a '!' character.
362  mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
363  if (mapstr.LineIsEmpty()) continue;
364 
365  TString varname, varvalue;
366  if (mapstr.HasVariablePair("=",varname,varvalue)){
367  if (varname == "EVENTCUTS"){
368  //varname="";
369  eventcut_flag = QwParameterFile::GetUInt(varvalue);
370  //std::cout<<"EVENT CUT FLAG "<<eventcut_flag<<std::endl;
371  }
372  }
373  else{
374  TString device_type = mapstr.GetTypedNextToken<TString>();
375  device_type.ToLower();
376  TString device_name = mapstr.GetTypedNextToken<TString>();
377  device_name.ToLower();
378 
379  Int_t det_index = GetDetectorIndex(GetDetectorTypeID(device_type),device_name);
380  if (det_index == -1) {
381  QwWarning << " Device not found " << device_name << " of type " << device_type << QwLog::endl;
382  continue;
383  }
384 
385  if (device_type == GetQwPMTInstrumentTypeName(kQwIntegrationPMT)){
386  Double_t LLX = mapstr.GetTypedNextToken<Double_t>(); //lower limit for IntegrationPMT value
387  Double_t ULX = mapstr.GetTypedNextToken<Double_t>(); //upper limit for IntegrationPMT value
388  varvalue = mapstr.GetTypedNextToken<TString>();//global/loacal
389  Double_t stabilitycut = mapstr.GetTypedNextToken<Double_t>();
390  varvalue.ToLower();
391  QwMessage << "QwLumi Error Code passing to QwIntegrationPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl;
392 
393  //std::cout<<"*****************************"<<std::endl;
394  //std::cout<<" Type "<<device_type<<" Name "<<device_name<<" Index ["<<det_index <<"] "<<" device flag "<<check_flag<<std::endl;
395 
396  fIntegrationPMT[det_index].SetSingleEventCuts(GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut),LLX,ULX,stabilitycut);
397  //std::cout<<"*****************************"<<std::endl;
398 
399  } else if (device_type == GetQwPMTInstrumentTypeName(kQwCombinedPMT)){
400  Double_t LLX = mapstr.GetTypedNextToken<Double_t>(); //lower limit for IntegrationPMT value
401  Double_t ULX = mapstr.GetTypedNextToken<Double_t>(); //upper limit for IntegrationPMT value
402  varvalue = mapstr.GetTypedNextToken<TString>();//global/loacal
403  Double_t stabilitycut=mapstr.GetTypedNextToken<Double_t>();
404  varvalue.ToLower();
405  QwMessage << "QwLumi Error Code passing to QwCombinedPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl;
406 
407  //std::cout<<"*****************************"<<std::endl;
408  //std::cout<<" Type "<<device_type<<" Name "<<device_name<<" Index ["<<det_index <<"] "<<" device flag "<<check_flag<<std::endl;
409 
410  fCombinedPMT[det_index].SetSingleEventCuts(GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut),LLX,ULX,stabilitycut);
411  //std::cout<<"*****************************"<<std::endl;
412 
413  }
414 
415  }
416 
417  }
418  for (size_t i=0;i<fIntegrationPMT.size();i++)
419  fIntegrationPMT[i].SetEventCutMode(eventcut_flag);
420  for (size_t i=0;i<fCombinedPMT.size();i++)
421  fCombinedPMT[i].SetEventCutMode(eventcut_flag);
422 
423  fQwLumiErrorCount=0; //set the error counter to zero
424  mapstr.Close(); // Close the file (ifstream)
425  return 0;
426 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
Int_t fQwLumiErrorCount
Definition: QwLumi.h:181
static UInt_t GetUInt(const TString &varvalue)
TString GetQwPMTInstrumentTypeName(EQwPMTInstrumentType type)
Definition: QwTypes.cc:76
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
Int_t GetDetectorIndex(EQwPMTInstrumentType TypeID, TString name)
Definition: QwLumi.cc:818
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45
UInt_t GetGlobalErrorFlag(TString evtype, Int_t evMode, Double_t stabilitycut)
Definition: QwTypes.cc:127
EQwPMTInstrumentType GetDetectorTypeID(TString name)
Definition: QwLumi.cc:812

+ Here is the call graph for this function:

Int_t QwLumi::LoadInputParameters ( TString  mapfile)
virtual

Mandatory parameter file definition.

Implements VQwSubsystem.

Definition at line 429 of file QwLumi.cc.

References VQwSubsystem::fDetectorMaps, and fIntegrationPMT.

430 {
431  Bool_t ldebug=kFALSE;
432  TString varname;
433  Double_t varped;
434  Double_t varcal;
435  TString localname;
436 
437  Int_t lineread=0;
438 
439  if(ldebug)std::cout<<"QwLumi::LoadInputParameters("<< pedestalfile<<")\n";
440 
441  QwParameterFile mapstr(pedestalfile.Data()); //Open the file
442  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
443 
444  while (mapstr.ReadNextLine())
445  {
446  lineread+=1;
447  if(ldebug)std::cout<<" line read so far ="<<lineread<<"\n";
448  mapstr.TrimComment('!'); // Remove everything after a '!' character.
449  mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
450  if (mapstr.LineIsEmpty()) continue;
451  else
452  {
453  varname = mapstr.GetTypedNextToken<TString>(); //name of the channel
454  varname.ToLower();
455  varname.Remove(TString::kBoth,' ');
456  varped= mapstr.GetTypedNextToken<Double_t>(); // value of the pedestal
457  varcal= mapstr.GetTypedNextToken<Double_t>(); // value of the calibration factor
458  if(ldebug) std::cout<<"inputs for channel "<<varname
459  <<": ped="<<varped<<": cal="<<varcal<<"\n";
460  Bool_t notfound=kTRUE;
461 
462  if(notfound)
463  for(size_t i=0;i<fIntegrationPMT.size();i++)
464  if(fIntegrationPMT[i].GetElementName()==varname)
465  {
466  fIntegrationPMT[i].SetPedestal(varped);
467  fIntegrationPMT[i].SetCalibrationFactor(varcal);
468  i=fIntegrationPMT.size()+1;
469  notfound=kFALSE;
470  i=fIntegrationPMT.size()+1;
471  }
472  }
473 
474  }
475  if(ldebug) std::cout<<" line read in the pedestal + cal file ="<<lineread<<" \n";
476 
477  ldebug=kFALSE;
478  mapstr.Close(); // Close the file (ifstream)
479  return 0;
480 }
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
void QwLumi::Normalize ( VQwDataElement denom)

Definition at line 991 of file QwLumi.cc.

References fCombinedPMT, and fIntegrationPMT.

Referenced by DoNormalization().

992 {
993  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
994  fIntegrationPMT[i].Normalize(denom);
995  for (size_t i = 0; i < fCombinedPMT.size(); i++)
996  fCombinedPMT[i].Normalize(denom);
997  //for (size_t i = 0; i < fScalerPMT.size(); i++)
998  //fScalerPMT[i].Normalize(denom);
999 }
void Normalize(VQwDataElement *denom)
Definition: QwLumi.cc:991
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168

+ Here is the caller graph for this function:

VQwSubsystem & QwLumi::operator+= ( VQwSubsystem value)
virtual

Implements VQwSubsystemParity.

Definition at line 908 of file QwLumi.cc.

References Compare(), fCombinedPMT, fIntegrationPMT, and fScalerPMT.

909 {
910  if (Compare(value))
911  {
912  QwLumi* input= dynamic_cast<QwLumi*>(value);
913 
914  for (size_t i = 0; i < input->fIntegrationPMT.size(); i++)
915  this->fIntegrationPMT[i] += input->fIntegrationPMT[i];
916  for (size_t i = 0; i < input->fCombinedPMT.size(); i++)
917  this->fCombinedPMT[i] += input->fCombinedPMT[i];
918  for (size_t i = 0; i < input->fScalerPMT.size(); i++)
919  this->fScalerPMT[i] += input->fScalerPMT[i];
920  }
921  return *this;
922 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
Bool_t Compare(VQwSubsystem *source)
Definition: QwLumi.cc:1003
Definition: QwLumi.h:57
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170

+ Here is the call graph for this function:

VQwSubsystem & QwLumi::operator-= ( VQwSubsystem value)
virtual

Implements VQwSubsystemParity.

Definition at line 925 of file QwLumi.cc.

References Compare(), fCombinedPMT, fIntegrationPMT, and fScalerPMT.

926 {
927 
928  if (Compare(value))
929  {
930  QwLumi* input= dynamic_cast<QwLumi*>(value);
931 
932  for (size_t i = 0; i < input->fIntegrationPMT.size(); i++)
933  this->fIntegrationPMT[i] -= input->fIntegrationPMT[i];
934  for (size_t i = 0; i < input->fCombinedPMT.size(); i++)
935  this->fCombinedPMT[i] -= input->fCombinedPMT[i];
936  for (size_t i = 0; i < input->fScalerPMT.size(); i++)
937  this->fScalerPMT[i] -= input->fScalerPMT[i];
938  }
939  return *this;
940 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
Bool_t Compare(VQwSubsystem *source)
Definition: QwLumi.cc:1003
Definition: QwLumi.h:57
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170

+ Here is the call graph for this function:

VQwSubsystem & QwLumi::operator= ( VQwSubsystem value)
virtual

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 888 of file QwLumi.cc.

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

889 {
890  // std::cout<<" here in QwLumi::operator= \n";
891  if (Compare(value))
892  {
894  QwLumi* input = dynamic_cast<QwLumi*> (value);
895 
896  for (size_t i = 0; i < input->fIntegrationPMT.size(); i++)
897  this->fIntegrationPMT[i] = input->fIntegrationPMT[i];
898  for (size_t i = 0; i < input->fCombinedPMT.size(); i++)
899  this->fCombinedPMT[i] = input->fCombinedPMT[i];
900  for (size_t i = 0; i < input->fScalerPMT.size(); i++)
901  this->fScalerPMT[i] = input->fScalerPMT[i];
902 
903  }
904  return *this;
905 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
virtual VQwSubsystem & operator=(VQwSubsystem *value)
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
Bool_t Compare(VQwSubsystem *source)
Definition: QwLumi.cc:1003
Definition: QwLumi.h:57
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170

+ Here is the call graph for this function:

void QwLumi::PrintDetectorID ( ) const

Definition at line 1151 of file QwLumi.cc.

References fLumiDetectorID.

1152 {
1153  for (size_t i=0;i<fLumiDetectorID.size();i++)
1154  {
1155  std::cout<<"============================="<<std::endl;
1156  std::cout<<" Detector ID="<<i<<std::endl;
1157  fLumiDetectorID[i].Print();
1158  }
1159 }
std::vector< QwLumiDetectorID > fLumiDetectorID
Definition: QwLumi.h:172
void QwLumi::PrintErrorCounters ( ) const
virtual

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

Implements VQwSubsystemParity.

Definition at line 646 of file QwLumi.cc.

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

647 {
648  //inherited from the VQwSubsystemParity; this will display the error summary
649  QwMessage<<"*********QwLumi Error Summary****************"<<QwLog::endl;
651  for(size_t i=0;i<fIntegrationPMT.size();i++){
652  //std::cout<<" IntegrationPMT ["<<i<<"] "<<std::endl;
653  fIntegrationPMT[i].PrintErrorCounters();
654  }
655  for(size_t i=0;i<fCombinedPMT.size();i++){
656  //std::cout<<" CombinedPMT ["<<i<<"] "<<std::endl;
657  fCombinedPMT[i].PrintErrorCounters();
658  }
660 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
static void PrintErrorCounterHead()
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
static void PrintErrorCounterTail()

+ Here is the call graph for this function:

void QwLumi::PrintInfo ( ) const
virtual

Print some information about the subsystem.

Reimplemented from VQwSubsystem.

Definition at line 1134 of file QwLumi.cc.

References QwLog::endl(), fCombinedPMT, fIntegrationPMT, fScalerPMT, VQwSubsystem::fSystemName, and QwMessage.

1135 {
1136  QwMessage << "Name of the subsystem = " << fSystemName << QwLog::endl;
1137  QwMessage << "There are " << fIntegrationPMT.size() << " IntegrationPMT" << QwLog::endl;
1138  QwMessage << " " << fCombinedPMT.size() << " CombinedPMT" << QwLog::endl;
1139  QwMessage << "There are " << fScalerPMT.size() << " halo counters" << QwLog::endl;
1140 
1141  QwMessage << " Printing Running AVG and other channel info" << QwLog::endl;
1142  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1144  for (size_t i = 0; i < fCombinedPMT.size(); i++)
1145  fCombinedPMT[i].PrintInfo();
1146  for (size_t i = 0; i < fScalerPMT.size(); i++)
1147  fScalerPMT[i].PrintInfo();
1148 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void PrintInfo() const
Print some information about the subsystem.
Definition: QwLumi.cc:1134
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
TString fSystemName
Name of this subsystem.
Definition: VQwSubsystem.h:315
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170

+ Here is the call graph for this function:

void QwLumi::PrintValue ( ) const
virtual

Print values of all channels.

Reimplemented from VQwSubsystemParity.

Definition at line 1122 of file QwLumi.cc.

References QwLog::endl(), fCombinedPMT, fIntegrationPMT, fScalerPMT, VQwSubsystem::GetSubsystemName(), and QwMessage.

1123 {
1124  QwMessage << "=== QwLumi: " << GetSubsystemName() << " ===" << QwLog::endl;
1125  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
1127  for (size_t i = 0; i < fCombinedPMT.size(); i++)
1128  fCombinedPMT[i].PrintValue();
1129  for (size_t i = 0; i < fScalerPMT.size(); i++)
1130  fScalerPMT[i].PrintValue();
1131 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void PrintValue() const
Print values of all channels.
Definition: QwLumi.cc:1122
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170
TString GetSubsystemName() const
Definition: VQwSubsystem.h:93

+ Here is the call graph for this function:

Int_t QwLumi::ProcessConfigurationBuffer ( const UInt_t  roc_id,
const UInt_t  bank_id,
UInt_t *  buffer,
UInt_t  num_words 
)
virtual

Implements VQwSubsystem.

Definition at line 786 of file QwLumi.cc.

787 {
788  return 0;
789 }
Int_t QwLumi::ProcessEvBuffer ( const UInt_t  roc_id,
const UInt_t  bank_id,
UInt_t *  buffer,
UInt_t  num_words 
)
virtual

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

Implements VQwSubsystem.

Definition at line 542 of file QwLumi.cc.

References fIntegrationPMT, fLumiDetectorID, fScalerPMT, VQwSubsystem::GetSubbankIndex(), kQwIntegrationPMT, kQwScalerPMT, and VQwSubsystem::SetDataLoaded().

543 {
544  Bool_t lkDEBUG=kFALSE;
545  Bool_t firsttime=kTRUE;
546  Bool_t issingleevent=kTRUE;
547 
548  Int_t index = GetSubbankIndex(roc_id,bank_id);
549 
550  if (index>=0 && num_words>0){
551  // We want to process this ROC. Begin looping through the data.
552  if (lkDEBUG)
553  std::cout << "QwLumi::ProcessEvBuffer: "
554  << "Begin processing ROC" << roc_id
555  << " and subbank "<<bank_id
556  << " number of words="<<num_words<<std::endl;
557 
558  for(size_t i=0;i<fLumiDetectorID.size();i++)
559  {
560  if(fLumiDetectorID[i].fSubbankIndex==index)
561  {
562 
563  if(fLumiDetectorID[i].fTypeID == kQwIntegrationPMT)
564  {
565  if (lkDEBUG)
566  {
567  std::cout<<"found IntegrationPMT data for "<<fLumiDetectorID[i].fdetectorname<<std::endl;
568  std::cout<<"words left to read in this buffer:"<<num_words-fLumiDetectorID[i].fWordInSubbank<<std::endl;
569  }
570  fIntegrationPMT[fLumiDetectorID[i].fIndex].
571  ProcessEvBuffer(&(buffer[fLumiDetectorID[i].fWordInSubbank]),
572  num_words-fLumiDetectorID[i].fWordInSubbank);
573  }
574 
575  if(fLumiDetectorID[i].fTypeID == kQwScalerPMT)
576  {
577  if (lkDEBUG)
578  {
579  std::cout<<"found ScalerPMT data for "<<fLumiDetectorID[i].fdetectorname<<std::endl;
580  std::cout<<"word left to read in this buffer:"<<num_words-fLumiDetectorID[i].fWordInSubbank<<std::endl;
581  }
582 
583  // This was added to check if the buffer contains more than one event. If it does then throw those events away. A better way to do this would be to find how many events were in the buffer then change the offset to be able to read them all.
584  if (firsttime)
585  {
586  firsttime=kFALSE;
587  if (buffer[0]/32!=1)
588  {
589  issingleevent=kFALSE;
590  if(lkDEBUG) {
591  std::cout<<"QwLumi::ProcessEvBuffer: More than one event was found in the buffer. Setting these events to zero."<<std::endl;
592  }
593  }
594  }
595  if (issingleevent==kFALSE) continue;
596 
597 
598 
599 
600 
601  fScalerPMT[fLumiDetectorID[i].fIndex].
602  ProcessEvBuffer(&(buffer[fLumiDetectorID[i].fWordInSubbank]),
603  num_words-fLumiDetectorID[i].fWordInSubbank);
604  }
605 
606  }
607  }
608  SetDataLoaded(kTRUE);
609  }
610 
611  return 0;
612 }
Int_t GetSubbankIndex() const
Definition: VQwSubsystem.h:303
Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware v...
Definition: QwLumi.cc:542
std::vector< QwLumiDetectorID > fLumiDetectorID
Definition: QwLumi.h:172
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170
void SetDataLoaded(Bool_t flag)
Definition: VQwSubsystem.h:305

+ Here is the call graph for this function:

void QwLumi::ProcessEvent ( )
virtual

Implements VQwSubsystem.

Definition at line 691 of file QwLumi.cc.

References fCombinedPMT, fIntegrationPMT, fScalerPMT, and VQwSubsystem::HasDataLoaded().

692 {
693  if (! HasDataLoaded()) return;
694 
695  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
697  for (size_t i = 0; i < fCombinedPMT.size(); i++)
699  for (size_t i = 0; i < fScalerPMT.size(); i++)
701 }
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
void ProcessEvent()
Definition: QwLumi.cc:691
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170

+ Here is the call graph for this function:

void QwLumi::ProcessEvent_2 ( )
virtual

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 726 of file QwLumi.cc.

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

727 {
728  if (! HasDataLoaded()) return;
729 
731  {
732  //data is valid, process it
733  if (bDEBUG)
734  {
735  Double_t pedestal = fTargetCharge.GetPedestal();
736  Double_t calfactor = fTargetCharge.GetCalibrationFactor();
737  Double_t volts = fTargetCharge.GetAverageVolts();
738  std::cout<<"QwLumi::ProcessEvent_2(): processing with exchanged data"<<std::endl;
739  std::cout<<"pedestal, calfactor, average volts = "<<pedestal<<", "<<calfactor<<", "<<volts<<std::endl;
740  }
741 
742  // assume fTargetCharge.fHardwareSum is a calibrated value,
743  // detector signals will be normalized to it
744  if (bNormalization) this->DoNormalization();
745  }
746  else
747  {
748  QwWarning <<"QwLumi::ProcessEvent_2(): could not get all external values."<<QwLog::endl;
749  }
750 }
Bool_t bIsExchangedDataValid
Definition: QwLumi.h:176
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
void DoNormalization(Double_t factor=1.0)
Definition: QwLumi.cc:1213
Bool_t bNormalization
Definition: QwLumi.h:177
static const Bool_t bDEBUG
Definition: QwLumi.h:183
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
QwBeamCharge fTargetCharge
Definition: QwLumi.h:175
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45

+ Here is the call graph for this function:

void QwLumi::ProcessOptions ( QwOptions options)
virtual

Process the command line options.

Reimplemented from VQwSubsystem.

Definition at line 34 of file QwLumi.cc.

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

35 {
36  bNormalization = options.GetValue<bool>("QwLumi.normalize");
37  if (! bNormalization){
38  QwWarning << "QwLumi::ProcessOptions: "
39  << "Detector yields WILL NOT be normalized."
40  << QwLog::endl;
41  }
42 }
Bool_t bNormalization
Definition: QwLumi.h:177
T GetValue(const std::string &key)
Get a templated value.
Definition: QwOptions.h:240
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45

+ Here is the call graph for this function:

Bool_t QwLumi::PublishByRequest ( TString  device_name)
virtual

Try to publish an internal variable matching the submitted name.

Reimplemented from VQwSubsystem.

Definition at line 763 of file QwLumi.cc.

References QwLog::endl(), fCombinedPMT, fIntegrationPMT, fLumiDetectorID, GetChannel(), kQwCombinedPMT, kQwIntegrationPMT, VQwSubsystem::PublishInternalValue(), and QwError.

764 {
765  Bool_t status = kFALSE;
766  for(size_t i=0;i<fLumiDetectorID.size();i++) {
767  if(device_name.CompareTo(fLumiDetectorID[i].fdetectorname)!=0) continue;
768 
769  if (fLumiDetectorID[i].fTypeID == kQwCombinedPMT){
770  status = PublishInternalValue(device_name, "published-by-request",
771  fCombinedPMT[fLumiDetectorID[i].fIndex].GetChannel(device_name));
772  } else if (fLumiDetectorID[i].fTypeID == kQwIntegrationPMT) {
773  status = PublishInternalValue(device_name, "published-by-request",
774  fIntegrationPMT[fLumiDetectorID[i].fIndex].GetChannel(device_name));
775  } else {
776  QwError << "Unknown channel name: " << device_name << QwLog::endl;
777  }
778  break;
779  }
780  if (!status)
781  QwError << "QwLumi::PublishByRequest: Failed to publish channel name: " << device_name << QwLog::endl;
782  return status;
783 }
const QwIntegrationPMT * GetChannel(const TString name) const
Definition: QwLumi.cc:845
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwLumiDetectorID > fLumiDetectorID
Definition: QwLumi.h:172
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
Bool_t PublishInternalValue(const TString &name, const TString &desc, const VQwHardwareChannel *value) const
Publish a variable name to the parent subsystem array.
#define QwError
Predefined log drain for errors.
Definition: QwLog.h:40

+ Here is the call graph for this function:

Bool_t QwLumi::PublishInternalValues ( ) const
virtual

Publish all variables of the subsystem.

Reimplemented from VQwSubsystem.

Definition at line 752 of file QwLumi.cc.

753 {
754  // Publish variables
755  Bool_t status = kTRUE;
756 
757  // Don't publish anything explicitly, use the PublishByRequest
758  // mechanism instead.
759 
760  return status;
761 }
void QwLumi::RandomizeEventData ( int  helicity = 0,
double  time = 0.0 
)
virtual

Reimplemented from VQwSubsystem.

Definition at line 497 of file QwLumi.cc.

References fIntegrationPMT.

498 {
499  // Randomize all QwIntegrationPMT buffers
500  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
501  fIntegrationPMT[i].RandomizeEventData(helicity, time);
502 }
void RandomizeEventData(int helicity=0, double time=0.0)
Definition: QwLumi.cc:497
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
void QwLumi::Ratio ( VQwSubsystem numer,
VQwSubsystem denom 
)
virtual

Implements VQwSubsystemParity.

Definition at line 963 of file QwLumi.cc.

References Compare(), fCombinedPMT, fIntegrationPMT, and fScalerPMT.

964 {
965  if (Compare(numer) && Compare(denom))
966  {
967  QwLumi* innumer = dynamic_cast<QwLumi*>(numer);
968  QwLumi* indenom = dynamic_cast<QwLumi*>(denom);
969 
970  for (size_t i = 0; i < innumer->fIntegrationPMT.size(); i++)
971  this->fIntegrationPMT[i].Ratio(innumer->fIntegrationPMT[i],indenom->fIntegrationPMT[i]);
972  for (size_t i = 0; i < innumer->fCombinedPMT.size(); i++)
973  this->fCombinedPMT[i].Ratio(innumer->fCombinedPMT[i],indenom->fCombinedPMT[i]);
974  for (size_t i = 0; i < innumer->fScalerPMT.size(); i++)
975  this->fScalerPMT[i].Ratio(innumer->fScalerPMT[i],indenom->fScalerPMT[i]);
976  }
977 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
Bool_t Compare(VQwSubsystem *source)
Definition: QwLumi.cc:1003
Definition: QwLumi.h:57
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170
void Ratio(VQwSubsystem *numer, VQwSubsystem *denom)
Definition: QwLumi.cc:963

+ Here is the call graph for this function:

void QwLumi::Scale ( Double_t  factor)
virtual

Implements VQwSubsystemParity.

Definition at line 980 of file QwLumi.cc.

References fCombinedPMT, fIntegrationPMT, and fScalerPMT.

981 {
982  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
983  fIntegrationPMT[i].Scale(factor);
984  for (size_t i = 0; i < fCombinedPMT.size(); i++)
985  fCombinedPMT[i].Scale(factor);
986  for (size_t i = 0; i < fScalerPMT.size(); i++)
987  fScalerPMT[i].Scale(factor);
988 }
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
void Scale(Double_t factor)
Definition: QwLumi.cc:980
std::vector< QwSIS3801D24_Channel > fScalerPMT
Definition: QwLumi.h:170
void QwLumi::SetRandomEventAsymmetry ( Double_t  asymmetry)

Definition at line 490 of file QwLumi.cc.

References fIntegrationPMT.

Referenced by main().

491 {
492  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
494 }
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
void SetRandomEventAsymmetry(Double_t asymmetry)
Definition: QwLumi.cc:490

+ Here is the caller graph for this function:

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

Definition at line 483 of file QwLumi.cc.

References fIntegrationPMT.

Referenced by main().

484 {
485  for (size_t i = 0; i < fIntegrationPMT.size(); i++)
487 }
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
void SetRandomEventParameters(Double_t mean, Double_t sigma)
Definition: QwLumi.cc:483

+ Here is the caller graph for this function:

void QwLumi::Sum ( VQwSubsystem value1,
VQwSubsystem value2 
)
virtual

Implements VQwSubsystemParity.

Definition at line 943 of file QwLumi.cc.

References Compare().

944 {
945  if (Compare(value1) && Compare(value2))
946  {
947  *this = value1;
948  *this += value2;
949  }
950 }
Bool_t Compare(VQwSubsystem *source)
Definition: QwLumi.cc:1003

+ Here is the call graph for this function:

void QwLumi::UpdateErrorFlag ( const VQwSubsystem ev_error)
virtual

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 676 of file QwLumi.cc.

References Compare(), fCombinedPMT, fIntegrationPMT, and UpdateErrorFlag().

Referenced by UpdateErrorFlag().

676  {
677  VQwSubsystem* tmp = const_cast<VQwSubsystem*>(ev_error);
678  if(Compare(tmp)){
679  const QwLumi * input = dynamic_cast<const QwLumi *> (ev_error);
680 
681  for (size_t i=0;i<input->fIntegrationPMT.size();i++)
682  (this->fIntegrationPMT[i]).UpdateErrorFlag(&(input->fIntegrationPMT[i]));
683 
684  for (size_t i=0;i<input->fCombinedPMT.size();i++)
685  (this->fCombinedPMT[i]).UpdateErrorFlag(&(input->fCombinedPMT[i]));
686  }
687 };
void UpdateErrorFlag(const VQwSubsystem *ev_error)
update the error flag in the subsystem level from the top level routines related to stability checks...
Definition: QwLumi.cc:676
std::vector< QwCombinedPMT > fCombinedPMT
Definition: QwLumi.h:169
The pure virtual base class of all subsystems.
Definition: VQwSubsystem.h:59
std::vector< QwIntegrationPMT > fIntegrationPMT
Definition: QwLumi.h:168
Bool_t Compare(VQwSubsystem *source)
Definition: QwLumi.cc:1003
Definition: QwLumi.h:57

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwLumi::WritePromptSummary ( QwPromptSummary ps,
TString  type 
)
virtual

Reimplemented from VQwSubsystemParity.

Definition at line 1389 of file QwLumi.cc.

References QwLog::endl(), and QwMessage.

1390 {
1391 
1392  Bool_t local_print_flag = true;
1393  if(local_print_flag){
1394  QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
1395  QwMessage << " QwLumi::WritePromptSummary() " << QwLog::endl;
1396  QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
1397  }
1398 
1399  return;
1400 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend class QwCombinedPMT
friend

Definition at line 59 of file QwLumi.h.

Field Documentation

const Bool_t QwLumi::bDEBUG =kFALSE
staticprivate
Bool_t QwLumi::bIsExchangedDataValid
protected

Definition at line 176 of file QwLumi.h.

Referenced by DoNormalization(), ExchangeProcessedData(), and ProcessEvent_2().

Bool_t QwLumi::bNormalization
protected

Definition at line 177 of file QwLumi.h.

Referenced by ExchangeProcessedData(), ProcessEvent_2(), and ProcessOptions().

std::vector<TString> QwLumi::fgDetectorTypeNames

Definition at line 156 of file QwLumi.h.

std::vector<QwLumiDetectorID> QwLumi::fLumiDetectorID
protected
Int_t QwLumi::fQwLumiErrorCount
private

Definition at line 181 of file QwLumi.h.

Referenced by ApplySingleEventCuts(), and LoadEventCuts().

QwBeamCharge QwLumi::fTargetCharge
protected

Definition at line 175 of file QwLumi.h.

Referenced by DoNormalization(), ExchangeProcessedData(), ProcessEvent_2(), and QwLumi().


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