QwAnalysis
QwIntegratedRaster Class Reference

#include <QwIntegratedRaster.h>

+ Inheritance diagram for QwIntegratedRaster:
+ Collaboration diagram for QwIntegratedRaster:

Public Member Functions

 QwIntegratedRaster (const TString &name)
 Constructor with name. More...
 
 QwIntegratedRaster (const QwIntegratedRaster &source)
 Copy constructor. More...
 
virtual ~QwIntegratedRaster ()
 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...
 
void IncrementErrorCounters ()
 Increment the error counters. More...
 
Bool_t ApplySingleEventCuts ()
 Apply the single event cuts. 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 ()
 Request processed data from other subsystems for internal use in the second event processing stage. Not all derived classes will require data from other subsystems. More...
 
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...
 
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 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)
 
void WritePromptSummary (QwPromptSummary *ps, TString type)
 
const VQwDataElementGetChannel (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...
 
- 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...
 
virtual Bool_t PublishInternalValues () const
 Publish all variables of the subsystem. More...
 
virtual Bool_t PublishByRequest (TString device_name)
 Try to publish an internal variable matching the submitted name. 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, QwIntegratedRaster >
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, QwIntegratedRaster >
static VQwSubsystemCreate (const std::string &name)
 Object creation. More...
 
static QwIntegratedRasterCast (QwIntegratedRaster *type)
 Object dynamic cast. More...
 

Protected Member Functions

Int_t GetDetectorIndex (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
< QwIntegratedRasterChannel
< QwVQWK_Channel > > 
fIntegratedRasterChannel
 
std::vector
< QwIntegratedRasterDetectorID
fDetectorIDs
 
- 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

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

Private Attributes

Int_t fQwIntegratedRasterErrorCount
 

Static Private Attributes

static const Bool_t bDEBUG =kFALSE
 

Detailed Description

Definition at line 55 of file QwIntegratedRaster.h.

Constructor & Destructor Documentation

QwIntegratedRaster::QwIntegratedRaster ( )
private

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

QwIntegratedRaster::QwIntegratedRaster ( const TString &  name)
inline

Constructor with name.

Definition at line 64 of file QwIntegratedRaster.h.

65  : VQwSubsystem(name),VQwSubsystemParity(name)
66  { };
VQwSubsystemParity()
Private default constructor (not implemented, will throw linker error on use)
QwIntegratedRaster::QwIntegratedRaster ( const QwIntegratedRaster source)
inline

Copy constructor.

Definition at line 68 of file QwIntegratedRaster.h.

69  : VQwSubsystem(source),VQwSubsystemParity(source),
71  { }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
VQwSubsystemParity()
Private default constructor (not implemented, will throw linker error on use)
virtual QwIntegratedRaster::~QwIntegratedRaster ( )
inlinevirtual

Virtual destructor.

Definition at line 73 of file QwIntegratedRaster.h.

73 { };

Member Function Documentation

void QwIntegratedRaster::AccumulateRunningSum ( VQwSubsystem value)
virtual

Update the running sums for devices.

Implements VQwSubsystemParity.

Definition at line 726 of file QwIntegratedRaster.cc.

References Compare(), and fIntegratedRasterChannel.

727 {
728  if (Compare(value1)) {
729  QwIntegratedRaster* value = dynamic_cast<QwIntegratedRaster*>(value1);
730 
731  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
733  }
734 }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void AccumulateRunningSum(VQwSubsystem *value)
Update the running sums for devices.
Bool_t Compare(VQwSubsystem *source)

+ Here is the call graph for this function:

Bool_t QwIntegratedRaster::ApplySingleEventCuts ( )
virtual

Apply the single event cuts.

Implements VQwSubsystemParity.

Definition at line 382 of file QwIntegratedRaster.cc.

References bDEBUG, fIntegratedRasterChannel, and fQwIntegratedRasterErrorCount.

382  {
383 
384  Bool_t status=kTRUE;
385  for(size_t i=0;i<fIntegratedRasterChannel.size();i++){
386  status &= fIntegratedRasterChannel[i].ApplySingleEventCuts();
387  if(!status && bDEBUG) std::cout<<"******* QwIntegratedRaster::SingleEventCuts()->IntegratedRasterChannel[ "<<i<<" , "<<fIntegratedRasterChannel[i].GetElementName()<<" ] ******\n";
388  }
389 
390  if (!status)
391  fQwIntegratedRasterErrorCount++;//failed event counter for QwIntegratedRaster
392 
393  return status;
394 }
static const Bool_t bDEBUG
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void QwIntegratedRaster::CalculateRunningAverage ( )
virtual

Calculate the average for all good events.

Implements VQwSubsystemParity.

Definition at line 719 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

720 {
721  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
723 }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void CalculateRunningAverage()
Calculate the average for all good events.
void QwIntegratedRaster::ClearEventData ( )
virtual

Implements VQwSubsystem.

Definition at line 454 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel, and VQwSubsystem::SetDataLoaded().

455 {
456  SetDataLoaded(kFALSE);
457  for(size_t i=0;i<fIntegratedRasterChannel.size();i++)
459 }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void SetDataLoaded(Bool_t flag)
Definition: VQwSubsystem.h:305

+ Here is the call graph for this function:

Bool_t QwIntegratedRaster::Compare ( VQwSubsystem source)

Definition at line 591 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

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

592 {
593  // std::cout<<" Here in QwIntegratedRaster::Compare \n";
594 
595  Bool_t res=kTRUE;
596  if(typeid(*value)!=typeid(*this))
597  {
598  res=kFALSE;
599  // std::cout<<" types are not ok \n";
600  // std::cout<<" this is bypassed just for now but should be fixed eventually \n";
601  }
602  else
603  {
604  QwIntegratedRaster* input= dynamic_cast<QwIntegratedRaster*>(value);
605  if(input->fIntegratedRasterChannel.size() !=fIntegratedRasterChannel.size() )
606  {
607  res=kFALSE;
608  }
609  }
610  return res;
611 }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel

+ Here is the caller graph for this function:

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

Construct the branch and tree vector.

Implements VQwSubsystem.

Definition at line 640 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

Referenced by ConstructBranch().

641 {
642  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
643  fIntegratedRasterChannel[i].ConstructBranch(tree, prefix);
644 }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void ConstructBranch(TTree *tree, TString &prefix)
Construct the branch and tree vector.

+ Here is the caller graph for this function:

void QwIntegratedRaster::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 647 of file QwIntegratedRaster.cc.

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

648 {
649  TString tmp;
650  QwParameterFile* nextmodule;
651 
652  tmp="QwIntegratedRasterChannel";
653  trim_file.RewindToFileStart();
654  if (trim_file.FileHasModuleHeader(tmp)){
655  nextmodule=trim_file.ReadUntilNextModule();
656  //This section contains sub modules and or channels to be included in the tree
657 
658  for(size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
659  fIntegratedRasterChannel[i].ConstructBranch(tree, prefix,*nextmodule);
660  }
661 }
Bool_t FileHasModuleHeader(const std::string &secname)
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void ConstructBranch(TTree *tree, TString &prefix)
Construct the branch and tree vector.
QwParameterFile * ReadUntilNextModule(const bool add_current_line=false)

+ Here is the call graph for this function:

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

Construct the branch and tree vector.

Implements VQwSubsystem.

Definition at line 633 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

634 {
635  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
636  fIntegratedRasterChannel[i].ConstructBranchAndVector(tree, prefix, values);
637 }
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
Construct the branch and tree vector.
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void QwIntegratedRaster::ConstructHistograms ( TDirectory *  folder,
TString &  prefix 
)
virtual

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

Implements VQwSubsystem.

Definition at line 615 of file QwIntegratedRaster.cc.

References VQwSubsystem::ConstructHistograms(), and fIntegratedRasterChannel.

616 {
617  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
619 }
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
Definition: VQwSubsystem.h:209
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel

+ Here is the call graph for this function:

void QwIntegratedRaster::DeaccumulateRunningSum ( VQwSubsystem value)
inlinevirtual

remove one entry from the running sums for devices

Implements VQwSubsystemParity.

Definition at line 97 of file QwIntegratedRaster.h.

97  {
98  };
void QwIntegratedRaster::DefineOptions ( QwOptions options)
static

Define options function.

Definition at line 24 of file QwIntegratedRaster.cc.

25 {
26 }
void QwIntegratedRaster::Difference ( VQwSubsystem value1,
VQwSubsystem value2 
)
virtual

Implements VQwSubsystemParity.

Definition at line 559 of file QwIntegratedRaster.cc.

References Compare().

560 {
561  if (Compare(value1) && Compare(value2))
562  {
563  *this = value1;
564  *this -= value2;
565  }
566 }
Bool_t Compare(VQwSubsystem *source)

+ Here is the call graph for this function:

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

Reimplemented from VQwSubsystem.

Definition at line 313 of file QwIntegratedRaster.cc.

References VQwSubsystem::fCurrentBank_ID, VQwSubsystem::fCurrentROC_ID, fDetectorIDs, and fIntegratedRasterChannel.

314 {
315  std::vector<UInt_t> elements;
316  elements.clear();
317 
318  // Get all buffers in the order they are defined in the map file
319  for (size_t i = 0; i < fDetectorIDs.size(); i++) {
320  // This is a QwIntegratedRasterChannel
321  fIntegratedRasterChannel[fDetectorIDs.at(i).fIndex].EncodeEventData(elements);
322  }
323 
324  // If there is element data, generate the subbank header
325  std::vector<UInt_t> subbankheader;
326  std::vector<UInt_t> rocheader;
327  if (elements.size() > 0) {
328 
329  // Form CODA subbank header
330  subbankheader.clear();
331  subbankheader.push_back(elements.size() + 1); // subbank size
332  subbankheader.push_back((fCurrentBank_ID << 16) | (0x01 << 8) | (1 & 0xff));
333  // subbank tag | subbank type | event number
334 
335  // Form CODA bank/roc header
336  rocheader.clear();
337  rocheader.push_back(subbankheader.size() + elements.size() + 1); // bank/roc size
338  rocheader.push_back((fCurrentROC_ID << 16) | (0x10 << 8) | (1 & 0xff));
339  // bank tag == ROC | bank type | event number
340 
341  // Add bank header, subbank header and element data to output buffer
342  buffer.insert(buffer.end(), rocheader.begin(), rocheader.end());
343  buffer.insert(buffer.end(), subbankheader.begin(), subbankheader.end());
344  buffer.insert(buffer.end(), elements.begin(), elements.end());
345  }
346 }
std::vector< QwIntegratedRasterDetectorID > fDetectorIDs
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
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 QwIntegratedRaster::ExchangeProcessedData ( )
inlinevirtual

Request processed data from other subsystems for internal use in the second event processing stage. Not all derived classes will require data from other subsystems.

Reimplemented from VQwSubsystem.

Definition at line 109 of file QwIntegratedRaster.h.

109 {};
void QwIntegratedRaster::FillDB ( QwParityDB db,
TString  type 
)
virtual

Fill the database.

Reimplemented from VQwSubsystemParity.

Definition at line 738 of file QwIntegratedRaster.cc.

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

739 {
740 
741  Bool_t local_print_flag = false;
742  if(local_print_flag){
743  QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
744  QwMessage << " QwIntegratedRaster::FillDB " << QwLog::endl;
745  QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
746  }
747 
748  std::vector<QwDBInterface> interface;
749  std::vector<QwParitySSQLS::beam> entrylist;
750 
751  UInt_t analysis_id = db->GetAnalysisID();
752 
753  TString measurement_type;
754  measurement_type =
756 
757  UInt_t i,j;
758  i = j = 0;
759  if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "IntegratedRasterChannel" <<QwLog::endl;
760 
761  for(i=0; i< fIntegratedRasterChannel.size(); i++) {
762  interface.clear();
763  interface = fIntegratedRasterChannel[i].GetDBEntry();
764  for(j=0; j<interface.size(); j++){
765  interface.at(j).SetAnalysisID( analysis_id );
766  interface.at(j).SetMonitorID( db );
767  interface.at(j).SetMeasurementTypeID( measurement_type );
768  interface.at(j).PrintStatus( local_print_flag );
769  interface.at(j).AddThisEntryToList( entrylist );
770  }
771  }
772 
773  if(local_print_flag) {
774  QwMessage << QwColor(Qw::kGreen) << "Entrylist Size : "
775  << QwColor(Qw::kBoldRed) << entrylist.size()
777  }
778 
779  db->Connect();
780  // Check the entrylist size, if it isn't zero, start to query..
781  if( entrylist.size() ) {
782  mysqlpp::Query query= db->Query();
783  query.insert(entrylist.begin(), entrylist.end());
784  query.execute();
785  }
786  else {
787  QwMessage << "QwIntegratedRaster::FillDB :: This is the case when the entrlylist contains nothing in "<< datatype.Data() << QwLog::endl;
788  }
789 
790  db->Disconnect();
791 
792  return;
793 }
#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
mysqlpp::Query Query(const char *qstr=0)
Definition: QwDatabase.h:66
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
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 QwIntegratedRaster::FillErrDB ( QwParityDB db,
TString  datatype 
)
virtual

Reimplemented from VQwSubsystemParity.

Definition at line 796 of file QwIntegratedRaster.cc.

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

797 {
798 
799  Bool_t local_print_flag = false;
800  if(local_print_flag){
801  QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
802  QwMessage << " QwIntegratedRaster::FillErrDB " << QwLog::endl;
803  QwMessage << " --------------------------------------------------------------- " << QwLog::endl;
804  }
805 
806  std::vector<QwErrDBInterface> interface;
807  std::vector<QwParitySSQLS::beam_errors> entrylist;
808 
809  UInt_t analysis_id = db->GetAnalysisID();
810 
811  UInt_t i,j;
812  i = j = 0;
813  if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "IntegratedRasterChannel" <<QwLog::endl;
814 
815  for(i=0; i< fIntegratedRasterChannel.size(); i++) {
816  interface.clear();
817  interface = fIntegratedRasterChannel[i].GetErrDBEntry();
818  for(j=0; j<interface.size(); j++){
819  interface.at(j).SetAnalysisID ( analysis_id );
820  interface.at(j).SetMonitorID ( db );
821  interface.at(j).PrintStatus ( local_print_flag );
822  interface.at(j).AddThisEntryToList( entrylist );
823  }
824  }
825 
826  if(local_print_flag) {
827  QwMessage << QwColor(Qw::kGreen) << "Entrylist Size : "
828  << QwColor(Qw::kBoldRed) << entrylist.size()
830  }
831 
832  db->Connect();
833  // Check the entrylist size, if it isn't zero, start to query..
834  if( entrylist.size() ) {
835  mysqlpp::Query query= db->Query();
836  query.insert(entrylist.begin(), entrylist.end());
837  query.execute();
838  }
839  else {
840  QwMessage << "QwIntegratedRaster::FillErrDB :: This is the case when the entrlylist contains nothing in "<< datatype.Data() << QwLog::endl;
841  }
842 
843  db->Disconnect();
844 
845  return;
846 };
#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
mysqlpp::Query Query(const char *qstr=0)
Definition: QwDatabase.h:66
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
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 QwIntegratedRaster::FillHistograms ( )
virtual

Fill the histograms for this subsystem.

Implements VQwSubsystem.

Definition at line 623 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel, and VQwSubsystem::HasDataLoaded().

624 {
625  if (! HasDataLoaded()) return;
626 
627  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
629 }
void FillHistograms()
Fill the histograms for this subsystem.
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel

+ Here is the call graph for this function:

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

Fill the tree vector.

Implements VQwSubsystem.

Definition at line 664 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel, and VQwSubsystem::HasDataLoaded().

665 {
666  if (! HasDataLoaded()) return;
667 
668  for(size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
670 }
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
void FillTreeVector(std::vector< Double_t > &values) const
Fill the tree vector.
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel

+ Here is the call graph for this function:

const VQwDataElement * QwIntegratedRaster::GetChannel ( const TString  name) const

Definition at line 491 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

492 {
493  if (! fIntegratedRasterChannel.empty()) {
494  for (std::vector<QwIntegratedRasterChannel<QwVQWK_Channel> >::const_iterator
495  IntegratedRasterChannel = fIntegratedRasterChannel.begin();
496  IntegratedRasterChannel != fIntegratedRasterChannel.end(); ++IntegratedRasterChannel) {
497  if (IntegratedRasterChannel->GetElementName() == name) {
498  return &(*IntegratedRasterChannel);
499  }
500  }
501  }
502  return 0;
503 }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
Int_t QwIntegratedRaster::GetDetectorIndex ( TString  name)
protected

Definition at line 463 of file QwIntegratedRaster.cc.

References fDetectorIDs.

Referenced by LoadChannelMap(), and LoadEventCuts().

464 {
465  Bool_t ldebug=kFALSE;
466  if(ldebug)
467  {
468  std::cout<<"QwIntegratedRaster::GetDetectorIndex\n";
469  std::cout<<" name="<<name<<"\n";
470  std::cout<<fDetectorIDs.size()<<" already registered detector\n";
471  }
472 
473  Int_t result=-1;
474  for(size_t i=0;i<fDetectorIDs.size();i++)
475  {
476  if(fDetectorIDs[i].fdetectorname==name)
477  result=fDetectorIDs[i].fIndex;
478  if(ldebug)
479  {
480  std::cout<<"testing against ("
481  <<fDetectorIDs[i].fdetectorname
482  <<")=>"<<result<<"\n";
483  }
484  }
485 
486  return result;
487 }
std::vector< QwIntegratedRasterDetectorID > fDetectorIDs

+ Here is the caller graph for this function:

UInt_t QwIntegratedRaster::GetEventcutErrorFlag ( )
virtual

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

Implements VQwSubsystemParity.

Definition at line 419 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

419  {//return the error flag
420  UInt_t ErrorFlag;
421  ErrorFlag=0;
422  for(size_t i=0;i<fIntegratedRasterChannel.size();i++){
423  ErrorFlag |= fIntegratedRasterChannel[i].GetEventcutErrorFlag();
424  }
425  return ErrorFlag;
426 }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void QwIntegratedRaster::IncrementErrorCounters ( )
virtual

Increment the error counters.

Implements VQwSubsystemParity.

Definition at line 398 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

399 {
400  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
402 }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void IncrementErrorCounters()
Increment the error counters.
Bool_t QwIntegratedRaster::IsGoodEvent ( )

Definition at line 445 of file QwIntegratedRaster.cc.

446 {
447  Bool_t test=kTRUE;
448 
449  return test;
450 }
Int_t QwIntegratedRaster::LoadChannelMap ( TString  mapfile)
virtual

Mandatory map file definition.

Implements VQwSubsystem.

Definition at line 35 of file QwIntegratedRaster.cc.

References QwLog::endl(), fDetectorIDs, VQwSubsystem::fDetectorMaps, QwIntegratedRasterDetectorID::fdetectorname, QwIntegratedRasterDetectorID::fdetectortype, QwIntegratedRasterDetectorID::fIndex, fIntegratedRasterChannel, QwIntegratedRasterDetectorID::fmoduletype, QwIntegratedRasterDetectorID::fSubbankIndex, QwIntegratedRasterDetectorID::fWordInSubbank, QwVQWK_Channel::GetBufferOffset(), GetDetectorIndex(), VQwSubsystem::GetSubbankIndex(), VQwSubsystem::GetSubsystemName(), QwParameterFile::GetUInt(), QwIntegratedRasterDetectorID::Print(), QwError, QwVerbose, VQwSubsystem::RegisterROCNumber(), and VQwSubsystem::RegisterSubbank().

36 {
37  Bool_t ldebug=kFALSE;
38 
39  TString varname, varvalue;
40  TString modtype, dettype, namech, nameofcombinedchan, keyword;
41  Int_t modnum = 0;
42  Int_t channum = 0;
43  Int_t currentrocread=0;
44  Int_t currentbankread=0;
45  Int_t offset = -1;
46  Int_t currentsubbankindex=-1;
47  Int_t fSample_size=0;
48 
49  QwParameterFile mapstr(mapfile.Data()); //Open the file
50  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
51  while (mapstr.ReadNextLine())
52  {
53  mapstr.TrimComment('!'); // Remove everything after a '!' character.
54  mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
55  if (mapstr.LineIsEmpty()) continue;
56 
57  if (mapstr.HasVariablePair("=",varname,varvalue))
58  {
59  // This is a declaration line. Decode it.
60  varname.ToLower();
61  UInt_t value = QwParameterFile::GetUInt(varvalue);
62 
63  if (varname=="roc")
64  {
65  currentrocread=value;
66  RegisterROCNumber(value,0);
67  }
68  else if (varname=="bank")
69  {
70  currentbankread=value;
71  RegisterSubbank(value);
72  }
73  else if (varname=="sample_size")
74  {
75  fSample_size=value;
76  }
77  }
78  else
79  {
80  Bool_t lineok=kTRUE;
81  // Break this line into tokens to process it.
82  modtype = mapstr.GetTypedNextToken<TString>(); // module type
83  if (modtype == "VQWK")
84  {
85  modnum = mapstr.GetTypedNextToken<Int_t>(); //slot number
86  channum = mapstr.GetTypedNextToken<Int_t>(); //channel number
87  dettype = mapstr.GetTypedNextToken<TString>(); //type-purpose of the detector
88  dettype.ToLower();
89  namech = mapstr.GetTypedNextToken<TString>(); //name of the detector
90  namech.ToLower();
91  keyword = mapstr.GetTypedNextToken<TString>();
92  keyword.ToLower();
93  }
94 
95  if(currentsubbankindex!=GetSubbankIndex(currentrocread,currentbankread))
96  {
97  currentsubbankindex=GetSubbankIndex(currentrocread,currentbankread);
98  }
99 
100 
101 
102  QwIntegratedRasterDetectorID detector_id;
103  detector_id.fdetectorname=namech;
104  detector_id.fmoduletype=modtype;
105  detector_id.fSubbankIndex=currentsubbankindex;
106  detector_id.fdetectortype=dettype;
107 
108 
109  if(modtype=="VQWK")
110  {
111  offset = QwVQWK_Channel::GetBufferOffset(modnum, channum);
112  detector_id.fWordInSubbank = offset;
113  }
114 
115  if(offset<0)
116  {
117  QwError << "QwIntegratedRaster::LoadChannelMap: Unknown module type: "
118  << modtype <<", the detector "<<namech<<" will not be decoded "
119  << QwLog::endl;
120  lineok=kFALSE;
121  continue;
122  }
123 
124 
125  detector_id.fdetectortype.ToLower();
126  if(detector_id.fdetectortype!="raster") {
127  // Silently ignore the line if this isn't a raster element.
128  QwVerbose << "QwIntegratedRaster::LoadChannelMap: Unknown detector type: "
129  << dettype <<", the detector "<<namech<<" will not be decoded "
130  << QwLog::endl;
131  lineok=kFALSE;
132  continue;
133  }
134 
135  detector_id.fIndex=
136  GetDetectorIndex(detector_id.fdetectorname);
137 
138  if(detector_id.fIndex==-1)
139  {
140  QwIntegratedRasterChannel<QwVQWK_Channel> localIntegratedRasterChannel(GetSubsystemName(),detector_id.fdetectorname);
141  fIntegratedRasterChannel.push_back(localIntegratedRasterChannel);
142  fIntegratedRasterChannel[fIntegratedRasterChannel.size()-1].SetDefaultSampleSize(fSample_size);
143  detector_id.fIndex=fIntegratedRasterChannel.size()-1;
144  }
145 
146  if(ldebug)
147  {
148  detector_id.Print();
149  std::cout<<"line ok=";
150  if(lineok) std::cout<<"TRUE"<<std::endl;
151  else
152  std::cout<<"FALSE"<<std::endl;
153  }
154 
155  if(lineok)
156  fDetectorIDs.push_back(detector_id);
157  }
158  }
159 
160  if(ldebug) {
161  std::cout<<"QwIntegratedRaster::Done with Load map channel \n";
162  for(size_t i=0;i<fDetectorIDs.size();i++)
163  fDetectorIDs[i].Print();
164  }
165  ldebug=kFALSE;
166  mapstr.Close(); // Close the file (ifstream)
167  return 0;
168 }
Int_t GetSubbankIndex() const
Definition: VQwSubsystem.h:303
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
static UInt_t GetUInt(const TString &varvalue)
std::vector< QwIntegratedRasterDetectorID > fDetectorIDs
#define QwVerbose
Predefined log drain for verbose messages.
Definition: QwLog.h:55
Int_t GetDetectorIndex(TString name)
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
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)
#define QwError
Predefined log drain for errors.
Definition: QwLog.h:40
TString GetSubsystemName() const
Definition: VQwSubsystem.h:93

+ Here is the call graph for this function:

Int_t QwIntegratedRaster::LoadEventCuts ( TString  filename)
virtual

Load the event cuts file.

Implements VQwSubsystemParity.

Definition at line 172 of file QwIntegratedRaster.cc.

References QwLog::endl(), VQwSubsystem::fDetectorMaps, fIntegratedRasterChannel, fQwIntegratedRasterErrorCount, GetDetectorIndex(), GetGlobalErrorFlag(), QwParameterFile::GetUInt(), QwMessage, QwVerbose, and QwWarning.

173 {
174  Int_t eventcut_flag = 1;
175 
176  // Open the file
177  QwParameterFile mapstr(filename.Data());
178  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
179  while (mapstr.ReadNextLine()){
180  //std::cout<<"********* In the loop *************"<<std::endl;
181  mapstr.TrimComment('!'); // Remove everything after a '!' character.
182  mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
183  if (mapstr.LineIsEmpty()) continue;
184 
185  TString varname, varvalue;
186  if (mapstr.HasVariablePair("=",varname,varvalue)){
187  if (varname == "EVENTCUTS") {
188  //varname="";
189  eventcut_flag = QwParameterFile::GetUInt(varvalue);
190  //std::cout<<"EVENT CUT FLAG "<<eventcut_flag<<std::endl;
191  }
192  }
193  else{
194  TString device_type = mapstr.GetTypedNextToken<TString>();
195  device_type.ToLower();
196  TString device_name = mapstr.GetTypedNextToken<TString>();
197  device_name.ToLower();
198 
199  if (device_type != "raster") {
200  QwVerbose << "QwIntegratedRaster::LoadEventCuts: Skipping detector type: "
201  << device_type << ", detector name "
202  << device_name << QwLog::endl;
203  continue;
204  }
205 
206  Int_t det_index = GetDetectorIndex(device_name);
207  if (det_index == -1) {
208  QwWarning << " Device not found " << device_name << " of type " << device_type << QwLog::endl;
209  continue;
210  }
211 
212  Double_t LLX = mapstr.GetTypedNextToken<Double_t>(); //lower limit for IntegratedRasterChannel value
213  Double_t ULX = mapstr.GetTypedNextToken<Double_t>(); //upper limit for IntegratedRasterChannel value
214  varvalue = mapstr.GetTypedNextToken<TString>();//global/local
215  varvalue.ToLower();
216  Double_t stabilitycut = mapstr.GetTypedNextToken<Double_t>();
217  QwMessage << "QwIntegratedRaster Error Code passing to QwIntegratedRasterChannel " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl;
218 
219  //std::cout<<"*****************************"<<std::endl;
220  //std::cout<<" Type "<<device_type<<" Name "<<device_name<<" Index ["<<det_index <<"] "<<" device flag "<<check_flag<<std::endl;
221 
222  fIntegratedRasterChannel[det_index].SetSingleEventCuts(GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut),LLX,ULX,stabilitycut);
223  //std::cout<<"*****************************"<<std::endl;
224  }
225 
226  }
227  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
228  fIntegratedRasterChannel[i].SetEventCutMode(eventcut_flag);
229 
230  fQwIntegratedRasterErrorCount = 0; //set the error counter to zero
231 
232  return 0;
233 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
static UInt_t GetUInt(const TString &varvalue)
#define QwVerbose
Predefined log drain for verbose messages.
Definition: QwLog.h:55
Int_t GetDetectorIndex(TString name)
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
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

+ Here is the call graph for this function:

Int_t QwIntegratedRaster::LoadInputParameters ( TString  mapfile)
virtual

Mandatory parameter file definition.

Implements VQwSubsystem.

Definition at line 236 of file QwIntegratedRaster.cc.

References VQwSubsystem::fDetectorMaps, and fIntegratedRasterChannel.

237 {
238  Bool_t ldebug=kFALSE;
239  TString varname;
240  Double_t varped;
241  Double_t varcal;
242  TString localname;
243 
244  Int_t lineread=0;
245 
246  if(ldebug)std::cout<<"QwIntegratedRaster::LoadInputParameters("<< pedestalfile<<")\n";
247 
248  QwParameterFile mapstr(pedestalfile.Data()); //Open the file
249  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
250 
251  while (mapstr.ReadNextLine())
252  {
253  lineread+=1;
254  if(ldebug)std::cout<<" line read so far ="<<lineread<<"\n";
255  mapstr.TrimComment('!'); // Remove everything after a '!' character.
256  mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
257  if (mapstr.LineIsEmpty()) continue;
258  else
259  {
260  varname = mapstr.GetTypedNextToken<TString>(); //name of the channel
261  varname.ToLower();
262  varname.Remove(TString::kBoth,' ');
263  varped= mapstr.GetTypedNextToken<Double_t>(); // value of the pedestal
264  varcal= mapstr.GetTypedNextToken<Double_t>(); // value of the calibration factor
265  if(ldebug) std::cout<<"inputs for channel "<<varname
266  <<": ped="<<varped<<": cal="<<varcal<<"\n";
267  Bool_t notfound=kTRUE;
268 
269  if(notfound)
270  for(size_t i=0;i<fIntegratedRasterChannel.size();i++)
271  if(fIntegratedRasterChannel[i].GetElementName()==varname)
272  {
273  fIntegratedRasterChannel[i].SetPedestal(varped);
274  fIntegratedRasterChannel[i].SetCalibrationFactor(varcal);
275  i=fIntegratedRasterChannel.size()+1;
276  notfound=kFALSE;
277  i=fIntegratedRasterChannel.size()+1;
278  }
279  }
280 
281  }
282  if(ldebug) std::cout<<" line read in the pedestal + cal file ="<<lineread<<" \n";
283 
284  ldebug=kFALSE;
285  mapstr.Close(); // Close the file (ifstream)
286 
287  return 0;
288 }
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
VQwSubsystem & QwIntegratedRaster::operator+= ( VQwSubsystem value)
virtual

Implements VQwSubsystemParity.

Definition at line 522 of file QwIntegratedRaster.cc.

References Compare(), and fIntegratedRasterChannel.

523 {
524  if (Compare(value))
525  {
526  QwIntegratedRaster* input= dynamic_cast<QwIntegratedRaster*>(value);
527 
528  for (size_t i = 0; i < input->fIntegratedRasterChannel.size(); i++)
530  }
531  return *this;
532 }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
Bool_t Compare(VQwSubsystem *source)

+ Here is the call graph for this function:

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

Implements VQwSubsystemParity.

Definition at line 535 of file QwIntegratedRaster.cc.

References Compare(), and fIntegratedRasterChannel.

536 {
537 
538  if (Compare(value))
539  {
540  QwIntegratedRaster* input= dynamic_cast<QwIntegratedRaster*>(value);
541 
542  for (size_t i = 0; i < input->fIntegratedRasterChannel.size(); i++)
544  }
545  return *this;
546 }
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
Bool_t Compare(VQwSubsystem *source)

+ Here is the call graph for this function:

VQwSubsystem & QwIntegratedRaster::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 507 of file QwIntegratedRaster.cc.

References Compare(), fIntegratedRasterChannel, and VQwSubsystem::operator=().

508 {
509  // std::cout<<" here in QwIntegratedRaster::operator= \n";
510  if (Compare(value))
511  {
513  QwIntegratedRaster* input = dynamic_cast<QwIntegratedRaster*> (value);
514 
515  for (size_t i = 0; i < input->fIntegratedRasterChannel.size(); i++)
517  }
518  return *this;
519 }
virtual VQwSubsystem & operator=(VQwSubsystem *value)
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
Bool_t Compare(VQwSubsystem *source)

+ Here is the call graph for this function:

void QwIntegratedRaster::PrintDetectorID ( ) const

Definition at line 693 of file QwIntegratedRaster.cc.

References fDetectorIDs.

694 {
695  for (size_t i=0;i<fDetectorIDs.size();i++)
696  {
697  std::cout<<"============================="<<std::endl;
698  std::cout<<" Detector ID="<<i<<std::endl;
699  fDetectorIDs[i].Print();
700  }
701 }
std::vector< QwIntegratedRasterDetectorID > fDetectorIDs
void QwIntegratedRaster::PrintErrorCounters ( ) const
virtual

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

Implements VQwSubsystemParity.

Definition at line 405 of file QwIntegratedRaster.cc.

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

406 {
407  //inherited from the VQwSubsystemParity; this will display the error summary
408  QwMessage<<"*********QwIntegratedRaster Error Summary****************"<<QwLog::endl;
410  for(size_t i=0;i<fIntegratedRasterChannel.size();i++){
411  //std::cout<<" IntegratedRasterChannel ["<<i<<"] "<<std::endl;
412  fIntegratedRasterChannel[i].PrintErrorCounters();
413  }
415 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
static void PrintErrorCounterHead()
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
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 QwIntegratedRaster::PrintInfo ( ) const
virtual

Print some information about the subsystem.

Reimplemented from VQwSubsystem.

Definition at line 682 of file QwIntegratedRaster.cc.

References QwLog::endl(), fIntegratedRasterChannel, VQwSubsystem::fSystemName, and QwMessage.

683 {
684  QwMessage << "Name of the subsystem = " << fSystemName << QwLog::endl;
685  QwMessage << "There are " << fIntegratedRasterChannel.size() << " IntegratedRasterChannel" << QwLog::endl;
686 
687  QwMessage << " Printing Running AVG and other channel info" << QwLog::endl;
688  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
690 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void PrintInfo() const
Print some information about the subsystem.
TString fSystemName
Name of this subsystem.
Definition: VQwSubsystem.h:315
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299

+ Here is the call graph for this function:

void QwIntegratedRaster::PrintValue ( ) const
virtual

Print values of all channels.

Reimplemented from VQwSubsystemParity.

Definition at line 674 of file QwIntegratedRaster.cc.

References QwLog::endl(), fIntegratedRasterChannel, VQwSubsystem::GetSubsystemName(), and QwMessage.

675 {
676  QwMessage << "=== QwIntegratedRaster: " << GetSubsystemName() << " ===" << QwLog::endl;
677  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
679 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void PrintValue() const
Print values of all channels.
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
TString GetSubsystemName() const
Definition: VQwSubsystem.h:93

+ Here is the call graph for this function:

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

Implements VQwSubsystem.

Definition at line 439 of file QwIntegratedRaster.cc.

440 {
441  return 0;
442 }
Int_t QwIntegratedRaster::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 349 of file QwIntegratedRaster.cc.

References fDetectorIDs, fIntegratedRasterChannel, VQwSubsystem::GetSubbankIndex(), and VQwSubsystem::SetDataLoaded().

350 {
351  Bool_t lkDEBUG=kFALSE;
352 
353  Int_t index = GetSubbankIndex(roc_id,bank_id);
354 
355  if (index>=0 && num_words>0){
356  // We want to process this ROC. Begin looping through the data.
357  if (lkDEBUG)
358  std::cout << "QwIntegratedRaster::ProcessEvBuffer: "
359  << "Begin processing ROC" << roc_id
360  << " and subbank "<<bank_id
361  << " number of words="<<num_words<<std::endl;
362 
363  for(size_t i=0;i<fDetectorIDs.size();i++) {
364  if(fDetectorIDs[i].fSubbankIndex==index) {
365  if (lkDEBUG) {
366  std::cout<<"found IntegratedRasterChannel data for "<<fDetectorIDs[i].fdetectorname<<std::endl;
367  std::cout<<"words left to read in this buffer:"<<num_words-fDetectorIDs[i].fWordInSubbank<<std::endl;
368  }
369 
371  ProcessEvBuffer(&(buffer[fDetectorIDs[i].fWordInSubbank]),
372  num_words-fDetectorIDs[i].fWordInSubbank);
373  }
374 
375  }
376  SetDataLoaded(kTRUE);
377  }
378  return 0;
379 }
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...
std::vector< QwIntegratedRasterDetectorID > fDetectorIDs
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void SetDataLoaded(Bool_t flag)
Definition: VQwSubsystem.h:305

+ Here is the call graph for this function:

void QwIntegratedRaster::ProcessEvent ( )
virtual

Implements VQwSubsystem.

Definition at line 429 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel, and VQwSubsystem::HasDataLoaded().

430 {
431  if (! HasDataLoaded()) return;
432 
433  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
435 }
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel

+ Here is the call graph for this function:

void QwIntegratedRaster::ProcessEvent_2 ( )
inlinevirtual

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 110 of file QwIntegratedRaster.h.

110 {};
void QwIntegratedRaster::ProcessOptions ( QwOptions options)
virtual

Process the command line options.

Reimplemented from VQwSubsystem.

Definition at line 30 of file QwIntegratedRaster.cc.

31 {
32 }
void QwIntegratedRaster::RandomizeEventData ( int  helicity = 0,
double  time = 0.0 
)
virtual

Reimplemented from VQwSubsystem.

Definition at line 305 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

306 {
307  // Randomize all QwIntegratedRasterChannel buffers
308  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
309  fIntegratedRasterChannel[i].RandomizeEventData(helicity, time);
310 }
void RandomizeEventData(int helicity=0, double time=0.0)
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void QwIntegratedRaster::Ratio ( VQwSubsystem numer,
VQwSubsystem denom 
)
virtual

Implements VQwSubsystemParity.

Definition at line 569 of file QwIntegratedRaster.cc.

References Compare(), and fIntegratedRasterChannel.

570 {
571  if (Compare(numer) && Compare(denom))
572  {
573  QwIntegratedRaster* innumer = dynamic_cast<QwIntegratedRaster*>(numer);
574  QwIntegratedRaster* indenom = dynamic_cast<QwIntegratedRaster*>(denom);
575 
576  for (size_t i = 0; i < innumer->fIntegratedRasterChannel.size(); i++)
578  }
579 }
void Ratio(VQwSubsystem *numer, VQwSubsystem *denom)
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
Bool_t Compare(VQwSubsystem *source)

+ Here is the call graph for this function:

void QwIntegratedRaster::Scale ( Double_t  factor)
virtual

Implements VQwSubsystemParity.

Definition at line 582 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

583 {
584  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
585  fIntegratedRasterChannel[i].Scale(factor);
586 }
void Scale(Double_t factor)
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void QwIntegratedRaster::SetRandomEventAsymmetry ( Double_t  asymmetry)

Definition at line 298 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

299 {
300  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
302 }
void SetRandomEventAsymmetry(Double_t asymmetry)
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void QwIntegratedRaster::SetRandomEventParameters ( Double_t  mean,
Double_t  sigma 
)

Definition at line 291 of file QwIntegratedRaster.cc.

References fIntegratedRasterChannel.

292 {
293  for (size_t i = 0; i < fIntegratedRasterChannel.size(); i++)
295 }
void SetRandomEventParameters(Double_t mean, Double_t sigma)
std::vector< QwIntegratedRasterChannel< QwVQWK_Channel > > fIntegratedRasterChannel
void QwIntegratedRaster::Sum ( VQwSubsystem value1,
VQwSubsystem value2 
)
virtual

Implements VQwSubsystemParity.

Definition at line 549 of file QwIntegratedRaster.cc.

References Compare().

550 {
551  if (Compare(value1) && Compare(value2))
552  {
553  *this = value1;
554  *this += value2;
555  }
556 }
Bool_t Compare(VQwSubsystem *source)

+ Here is the call graph for this function:

void QwIntegratedRaster::UpdateErrorFlag ( const VQwSubsystem ev_error)
inlinevirtual

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 92 of file QwIntegratedRaster.h.

92  {
93  };
void QwIntegratedRaster::WritePromptSummary ( QwPromptSummary ps,
TString  type 
)
virtual

Reimplemented from VQwSubsystemParity.

Definition at line 848 of file QwIntegratedRaster.cc.

References QwLog::endl(), and QwMessage.

849 {
850  QwMessage << "QwIntegratedRaster::WritePromptSummary()" << QwLog::endl;
851  return;
852 };
#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:

Field Documentation

const Bool_t QwIntegratedRaster::bDEBUG =kFALSE
staticprivate

Definition at line 160 of file QwIntegratedRaster.h.

Referenced by ApplySingleEventCuts().

std::vector<QwIntegratedRasterDetectorID> QwIntegratedRaster::fDetectorIDs
protected
Int_t QwIntegratedRaster::fQwIntegratedRasterErrorCount
private

Definition at line 158 of file QwIntegratedRaster.h.

Referenced by ApplySingleEventCuts(), and LoadEventCuts().


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