QwAnalysis
QwMollerDetector Class Reference

Implementation of the analysis of Moller data (copied from QwComptonElectronDetector.h) More...

#include <QwMollerDetector.h>

+ Inheritance diagram for QwMollerDetector:
+ Collaboration diagram for QwMollerDetector:

Public Member Functions

 QwMollerDetector (const TString &name)
 Constructor with name. More...
 
 QwMollerDetector (const QwMollerDetector &source)
 Copy constructor. More...
 
virtual ~QwMollerDetector ()
 Virtual destructor. More...
 
void ProcessOptions (QwOptions &options)
 Process the command line options. More...
 
Int_t LoadChannelMap (TString mapfile)
 
Int_t LoadInputParameters (TString pedestalfile)
 Mandatory parameter file definition. More...
 
Int_t LoadEventCuts (TString &filename)
 
Bool_t SingleEventCuts ()
 
Int_t ProcessConfigurationBuffer (const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
 
Int_t ProcessConfigurationBuffer (UInt_t ev_type, const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
 
Int_t ProcessEvBuffer (UInt_t roc_id, 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...
 
Int_t ProcessEvBuffer (UInt_t ev_type, UInt_t roc_id, UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
 
void ClearEventData ()
 
void ProcessEvent ()
 
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...
 
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 *value1, VQwSubsystem *value2)
 
void Scale (Double_t)
 
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 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 ConstructBranchAndVector (TTree *, TString &, std::vector< double, std::allocator< double > > &)
 
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...
 
Bool_t Compare (VQwSubsystem *source)
 
void print ()
 
void PrintValue () const
 Print values of all channels. More...
 
float * GetRawChannelArray ()
 
Int_t GetChannelIndex (TString channelName, UInt_t module_number)
 
float GetDataForChannelInModule (Int_t module_number, Int_t channel_index)
 
float GetDataForChannelInModule (Int_t module_number, TString channel_name)
 
- 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 void FillDB (QwParityDB *db, TString type)
 Fill the database. More...
 
virtual void FillErrDB (QwParityDB *db, TString type)
 
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 void WritePromptSummary (QwPromptSummary *ps, TString type)
 
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 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...
 
virtual 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...
 
virtual void AtEndOfEventLoop ()
 Perform actions at the end of the event loop. More...
 
virtual void RandomizeEventData (int helicity=0, double time=0.0)
 
virtual void EncodeEventData (std::vector< UInt_t > &buffer)
 
virtual void PrintInfo () const
 Print some information about the subsystem. 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, TString &prefix, std::vector< Double_t > &values)=0
 Construct the branch and tree vector. 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, QwMollerDetector >
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...
 

Protected Attributes

std::vector< QwMollerChannelIDfMollerChannelID
 
std::vector< std::vector
< QwSTR7200_Channel > > 
fSTR7200_Channel
 
std::vector< std::vector
< QwSTR7200_Channel > > 
fPrevious_STR7200_Channel
 
- 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

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

Private Attributes

Int_t fQwMollerErrorCount
 
UInt_t fNumberOfEvents
 

Static Private Attributes

static const Bool_t bDEBUG = kFALSE
 

Additional Inherited Members

- 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, QwMollerDetector >
static VQwSubsystemCreate (const std::string &name)
 Object creation. More...
 
static QwMollerDetectorCast (QwMollerDetector *type)
 Object dynamic cast. More...
 
- 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...
 

Detailed Description

Implementation of the analysis of Moller data (copied from QwComptonElectronDetector.h)

Author
Andrew Kubera
Date
2010-06-07

Definition at line 62 of file QwMollerDetector.h.

Constructor & Destructor Documentation

QwMollerDetector::QwMollerDetector ( )
private

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

QwMollerDetector::QwMollerDetector ( const TString &  name)
inline

Constructor with name.

Definition at line 73 of file QwMollerDetector.h.

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

Copy constructor.

Definition at line 77 of file QwMollerDetector.h.

78  : VQwSubsystem(source),VQwSubsystemParity(source),
80  { }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
VQwSubsystemParity()
Private default constructor (not implemented, will throw linker error on use)
virtual QwMollerDetector::~QwMollerDetector ( )
inlinevirtual

Virtual destructor.

Definition at line 82 of file QwMollerDetector.h.

82 { };

Member Function Documentation

void QwMollerDetector::AccumulateRunningSum ( VQwSubsystem value)
virtual

Update the running sums for devices.

Implements VQwSubsystemParity.

Definition at line 317 of file QwMollerDetector.cc.

References Compare(), and fSTR7200_Channel.

317  {
318  if (Compare(value)) {
319  QwMollerDetector* v = dynamic_cast<QwMollerDetector*>(value);
320 
321  for (size_t i = 0; i < fSTR7200_Channel.size(); i++){
322  for (size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
323  fSTR7200_Channel[i][j].AccumulateRunningSum(v->fSTR7200_Channel[i][j]);
324  }
325  }
326 
327  }
328 }
Bool_t Compare(VQwSubsystem *source)
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
Implementation of the analysis of Moller data (copied from QwComptonElectronDetector.h)

+ Here is the call graph for this function:

Bool_t QwMollerDetector::ApplySingleEventCuts ( )
virtual

Apply the single event cuts.

Implements VQwSubsystemParity.

Definition at line 340 of file QwMollerDetector.cc.

References bDEBUG, and fSTR7200_Channel.

340  {
341  std::cout << "QwMoller::ApplySingleEventCuts() ";
342  Bool_t test = kTRUE, test_1 = kTRUE;
343 
344  for (size_t i = 0; i < fSTR7200_Channel.size(); i++){
345  for (size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
346  test_1 = fSTR7200_Channel[i][j].ApplySingleEventCuts();
347  test &= test_1;
348  if(!test_1 && bDEBUG){
349  std::cout << "***** QwMoller::SingleEventCuts()->Channel[" << i << "][" << j << "]:" << fSTR7200_Channel[i][j].GetElementName() << std::endl;
350  }
351  }
352  }
353  return test;
354 }
static const Bool_t bDEBUG
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
void QwMollerDetector::CalculateRunningAverage ( )
virtual

Calculate the average for all good events.

Implements VQwSubsystemParity.

Definition at line 330 of file QwMollerDetector.cc.

References fSTR7200_Channel.

330  {
331  for (size_t i = 0; i < fSTR7200_Channel.size(); i++){
332  for (size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
333  fSTR7200_Channel[i][j].CalculateRunningAverage();
334  }
335  }
336 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
void QwMollerDetector::ClearEventData ( )
virtual

Implements VQwSubsystem.

Definition at line 137 of file QwMollerDetector.cc.

137 {}
Bool_t QwMollerDetector::Compare ( VQwSubsystem source)

Definition at line 418 of file QwMollerDetector.cc.

References fSTR7200_Channel.

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

418  {
419  //std::cout << "Beginning QwMollerDetector::Compare" << std::endl;
420 
421  if (source == 0) return kFALSE;
422 
423  Bool_t result = kTRUE;
424  if(typeid(*source) != typeid(*this)){
425  result = kFALSE;
426  std::cout << " Type mismatch! This is bypassed for now but should be fixed eventually." << std::endl;
427  } else { //same type, test for # of modules
428  QwMollerDetector* input = dynamic_cast<QwMollerDetector*>(source);
429  if(input->fSTR7200_Channel.size() != fSTR7200_Channel.size()){
430  result = kFALSE;
431  std::cout << " Not the same number of Modules" << std::endl;
432  }else { //same # modules, loop through and make sure each one has same amount of channels
433  for(size_t i = 0; i < fSTR7200_Channel.size(); i++){
434  if(input->fSTR7200_Channel[i].size() != fSTR7200_Channel[i].size()){
435  result = kFALSE;
436  std::cout << " Different number of channels in module " << i << std::endl;
437  }
438  }
439  }
440  }
441  return result;
442 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
Implementation of the analysis of Moller data (copied from QwComptonElectronDetector.h)

+ Here is the caller graph for this function:

void QwMollerDetector::ConstructBranch ( TTree *  tree,
TString &  prefix 
)
inlinevirtual

Construct the branch and tree vector.

Implements VQwSubsystem.

Definition at line 125 of file QwMollerDetector.h.

125 { };
void QwMollerDetector::ConstructBranch ( TTree *  tree,
TString &  prefix,
QwParameterFile trim_file 
)
inlinevirtual

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

Implements VQwSubsystem.

Definition at line 126 of file QwMollerDetector.h.

126 { };
void QwMollerDetector::ConstructBranchAndVector ( TTree *  ,
TString &  ,
std::vector< double, std::allocator< double > > &   
)

Definition at line 224 of file QwMollerDetector.cc.

References fSTR7200_Channel.

224  {
225  for(size_t i = 0; i < fSTR7200_Channel.size(); i++){
226  for(size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
227  fSTR7200_Channel[i][j].ConstructBranchAndVector(tree, prefix, values);
228  }
229  }
230 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
void QwMollerDetector::ConstructHistograms ( TDirectory *  folder,
TString &  prefix 
)
virtual

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

Implements VQwSubsystem.

Definition at line 208 of file QwMollerDetector.cc.

References fSTR7200_Channel.

208  {
209  for(size_t i = 0; i < fSTR7200_Channel.size(); i++){
210  for(size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
211  fSTR7200_Channel[i][j].ConstructHistograms(folder, prefix);
212  }
213  }
214 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
void QwMollerDetector::DeaccumulateRunningSum ( VQwSubsystem value)
inlinevirtual

remove one entry from the running sums for devices

Implements VQwSubsystemParity.

Definition at line 110 of file QwMollerDetector.h.

110  {
111  };
void QwMollerDetector::Difference ( VQwSubsystem value1,
VQwSubsystem value2 
)
virtual

Implements VQwSubsystemParity.

Definition at line 288 of file QwMollerDetector.cc.

References Compare().

288  {
289  if (Compare(value1) && Compare(value2)) {
290  *this = value1;
291  *this -= value2;
292  }
293 }
Bool_t Compare(VQwSubsystem *source)

+ Here is the call graph for this function:

void QwMollerDetector::FillHistograms ( )
virtual

Fill the histograms for this subsystem.

Implements VQwSubsystem.

Definition at line 216 of file QwMollerDetector.cc.

References fSTR7200_Channel.

216  {
217  for(size_t i = 0; i < fSTR7200_Channel.size(); i++){
218  for(size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
219  fSTR7200_Channel[i][j].FillHistograms();
220  }
221  }
222 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
void QwMollerDetector::FillTreeVector ( std::vector< Double_t > &  values) const
virtual

Fill the tree vector.

Implements VQwSubsystem.

Definition at line 232 of file QwMollerDetector.cc.

References fSTR7200_Channel.

232  {
233  for(size_t i = 0; i < fSTR7200_Channel.size(); i++){
234  for(size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
235  fSTR7200_Channel[i][j].FillTreeVector(values);
236  }
237  }
238 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
Int_t QwMollerDetector::GetChannelIndex ( TString  channelName,
UInt_t  module_number 
)

Definition at line 393 of file QwMollerDetector.cc.

References QwMollerChannelID::fChannelName, QwMollerChannelID::fIndex, QwMollerChannelID::fModuleNumber, and fMollerChannelID.

Referenced by GetDataForChannelInModule().

394 {
395  Bool_t ldebug=kFALSE;
396 
397  channelName.ToLower();
398 
399  if (ldebug){
400  std::cout << "QwMollerDetector::GetDetectorIndex" << std::endl;
401  std::cout << "module_number: " << module_number << " name=" << channelName << std::endl;
402  }
403 
404  Int_t result = -1;
405  for(size_t i = 0; i < fMollerChannelID.size(); i++){
406  QwMollerChannelID *nextChannel = &fMollerChannelID[i];
407  //std::cout << ' '<< nextChannel->fChannelName << '=' << channelName << ':' << (nextChannel->fChannelName == channelName) << std::endl;
408  if (nextChannel->fChannelName == channelName && nextChannel->fModuleNumber == module_number){
409  result = nextChannel->fIndex;
410  break;
411  }
412  }
413 
414  return result;
415 }
std::vector< QwMollerChannelID > fMollerChannelID

+ Here is the caller graph for this function:

float QwMollerDetector::GetDataForChannelInModule ( Int_t  module_number,
Int_t  channel_index 
)
inline

Definition at line 135 of file QwMollerDetector.h.

References fSTR7200_Channel.

Referenced by GetDataForChannelInModule().

135  {
136  return fSTR7200_Channel[module_number][channel_index].GetValue();
137  }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel

+ Here is the caller graph for this function:

float QwMollerDetector::GetDataForChannelInModule ( Int_t  module_number,
TString  channel_name 
)
inline

Definition at line 139 of file QwMollerDetector.h.

References GetChannelIndex(), and GetDataForChannelInModule().

139  {
140  return GetDataForChannelInModule(module_number, GetChannelIndex(channel_name,module_number));
141  }
float GetDataForChannelInModule(Int_t module_number, Int_t channel_index)
Int_t GetChannelIndex(TString channelName, UInt_t module_number)

+ Here is the call graph for this function:

UInt_t QwMollerDetector::GetEventcutErrorFlag ( )
virtual

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

Implements VQwSubsystemParity.

Definition at line 367 of file QwMollerDetector.cc.

367  {
368  return 0;
369 }
float * QwMollerDetector::GetRawChannelArray ( )

Definition at line 371 of file QwMollerDetector.cc.

References fSTR7200_Channel.

371  {
372  size_t len = 0;
373  for (size_t i = 0; i < fSTR7200_Channel.size(); i++){
374  for (size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
375  len++;
376  }
377  }
378  float *result = new float[len];
379 
380  //float result[96];
381 
382  int n = 0;
383  for (size_t i = 0; i < fSTR7200_Channel.size(); i++){
384  for (size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
385  result[n+j] = fSTR7200_Channel[i][j].GetValue();
386  }
387  n=fSTR7200_Channel[i].size();
388  }
389 
390  return result;
391 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
void QwMollerDetector::IncrementErrorCounters ( )
inlinevirtual

Increment the error counters.

Implements VQwSubsystemParity.

Definition at line 115 of file QwMollerDetector.h.

115 {};
Int_t QwMollerDetector::LoadChannelMap ( TString  mapfile)
virtual

Load the channel map

Parameters
mapfileMap file
Returns
Zero if successful

Implements VQwSubsystem.

Definition at line 33 of file QwMollerDetector.cc.

References QwMollerChannelID::fChannelName, QwMollerChannelID::fChannelNumber, VQwSubsystem::fDetectorMapsNames, QwMollerChannelID::fDetectorType, QwMollerChannelID::fIndex, QwMollerChannelID::fModuleNumber, QwMollerChannelID::fModuleType, fMollerChannelID, fPrevious_STR7200_Channel, fSTR7200_Channel, QwMollerChannelID::fWordInSubbank, VQwSubsystem::GetSubbankIndex(), QwParameterFile::GetUInt(), VQwSubsystem::RegisterROCNumber(), and VQwSubsystem::RegisterSubbank().

34 {
35  TString varname, varvalue;
36  TString modtype, dettype, name, keyword;
37  Int_t modnum, channum;
38  Int_t currentrocread = 0;
39  Int_t currentbankread = 0;
40  Int_t wordsofar = 0;
41  Int_t currentsubbankindex = -1;
42 
43  QwParameterFile mapstr(mapfile.Data()); // Open the file
44  fDetectorMapsNames.push_back(mapstr.GetParamFilename());
45  while (mapstr.ReadNextLine()) {
46  mapstr.TrimComment('!'); // Remove everything after a '!' character.
47  mapstr.TrimWhitespace(); // Get rid of leading and trailing whitespace (spaces or tabs).
48  if (mapstr.LineIsEmpty()) continue;
49 
50  if (mapstr.HasVariablePair("=", varname, varvalue)) {
51  // This is a declaration line. Decode it.
52 
53  varname.ToLower();
54  UInt_t value = QwParameterFile::GetUInt(varvalue);
55  if (varname == "roc") {
56  currentrocread=value;
57  RegisterROCNumber(value,0);
58  } else if (varname == "bank") {
59  currentbankread=value;
60  RegisterSubbank(value);
61  if(currentsubbankindex != GetSubbankIndex(currentrocread,currentbankread)){
62  currentsubbankindex = GetSubbankIndex(currentrocread,currentbankread);
63  }
64  }
65  } else {
66  Bool_t lineok = kTRUE;
67 
68  // Break this line into tokens to process it.
69  modtype = mapstr.GetTypedNextToken<TString>();
70  modnum = mapstr.GetTypedNextToken<Int_t>();
71  channum = mapstr.GetTypedNextToken<Int_t>();
72  dettype = mapstr.GetTypedNextToken<TString>();
73  name = mapstr.GetTypedNextToken<TString>();
74  dettype.ToLower();
75  name.ToLower();
76 
77  QwMollerChannelID newChannelID;
78  newChannelID.fModuleType = modtype;
79  newChannelID.fModuleNumber = modnum;
80  newChannelID.fChannelName = name;
81  newChannelID.fDetectorType = dettype;
82  newChannelID.fChannelNumber = channum;
83  newChannelID.fWordInSubbank = wordsofar;
84 
85  if (modtype == "SIS3801"){
86  wordsofar += 1;
87  }else if(modtype == "SIS7200"){
88  wordsofar += 1;
89  }else if(modtype == "VQWK"){
90  wordsofar += 6;
91  }else {
92  std::cerr << "Unknown module type: " << modtype << ". Skipping channel " << name << '.' << std::endl;
93  lineok = kFALSE;
94  }
95 
96  if (name.Length() == 0){
97  lineok = kFALSE;
98  }
99 
100 // add new modules until current number (modnum) is reached
101  std::size_t chan_size;
102  chan_size = fSTR7200_Channel.size();
103  while ((Int_t) chan_size <= modnum) {
104  std::vector<QwSTR7200_Channel> new_module;
105  fSTR7200_Channel.push_back(new_module);
106  }
107 
108  //change this line if names are supposed to be exclusive, as of now,
109  newChannelID.fIndex = -1; // GetChannelIndex(name, modnum);
110 
111  if (newChannelID.fIndex == -1 && lineok){
112  QwSTR7200_Channel localSTR7200_Channel(newChannelID.fChannelName);
113  fSTR7200_Channel[modnum].push_back(localSTR7200_Channel);
114 // fSTR7200_Channel[modnum][fMollerChannelID.size() - 1].SetDefaultSampleSize(fSample_size);
115  newChannelID.fIndex = fSTR7200_Channel[modnum].size() - 1;
116  //std::cout << name << ':' << newChannelID.fIndex << ':' << wordsofar << '\n';
117  }
118 
119  // Push a new record into the element array
120  if(lineok){
121  fMollerChannelID.push_back(newChannelID);
122  }
123  }
124  } // end looping over parameter file
125 
127 
128 // for (size_t i = 0; i < fMollerChannelID.size(); i++){
129 // std::cout << i << ": " << fMollerChannelID[i].fChannelName << ' ' << fMollerChannelID[i].fChannelNumber << ' ' << fMollerChannelID[i].fIndex << std::endl;
130 // }
131 
132  return 0;
133 }
Int_t GetSubbankIndex() const
Definition: VQwSubsystem.h:303
static UInt_t GetUInt(const TString &varvalue)
class QwScaler_Channel< 0xffffffff, 0 > QwSTR7200_Channel
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_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.
std::vector< QwMollerChannelID > fMollerChannelID
std::vector< TString > fDetectorMapsNames
Definition: VQwSubsystem.h:321
std::vector< std::vector< QwSTR7200_Channel > > fPrevious_STR7200_Channel

+ Here is the call graph for this function:

Int_t QwMollerDetector::LoadEventCuts ( TString &  filename)
Int_t QwMollerDetector::LoadEventCuts ( TString  filename)
virtual

Load the event cuts file.

Implements VQwSubsystemParity.

Definition at line 338 of file QwMollerDetector.cc.

338 {return 0;}
Int_t QwMollerDetector::LoadInputParameters ( TString  mapfile)
virtual

Mandatory parameter file definition.

Implements VQwSubsystem.

Definition at line 136 of file QwMollerDetector.cc.

136 { return 0;}
VQwSubsystem & QwMollerDetector::operator+= ( VQwSubsystem value)
virtual

Implements VQwSubsystemParity.

Definition at line 254 of file QwMollerDetector.cc.

References Compare(), and fSTR7200_Channel.

254  {
255  //std::cout << "QwMollerDetector addition assignment (operator+=)" << std::endl;
256  if(Compare(value)){
257  QwMollerDetector* input = dynamic_cast<QwMollerDetector *> (value);
258  for(size_t i = 0; i < input->fSTR7200_Channel.size(); i++){
259  for(size_t j = 0; j < input->fSTR7200_Channel[i].size(); j++){
260  this->fSTR7200_Channel[i][j] += input->fSTR7200_Channel[i][j];
261  //std::cout << "+= " << this->fSTR7200_Channel[i][j].GetValue() << std::endl;
262  }
263  }
264  }
265  return *this;
266 }
Bool_t Compare(VQwSubsystem *source)
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
Implementation of the analysis of Moller data (copied from QwComptonElectronDetector.h)

+ Here is the call graph for this function:

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

Implements VQwSubsystemParity.

Definition at line 268 of file QwMollerDetector.cc.

References Compare(), and fSTR7200_Channel.

268  {
269  //std::cout << "QwMollerDetector subtraction assignment (operator-=)" << std::endl;
270  if(Compare(value)){
271  QwMollerDetector* input = dynamic_cast<QwMollerDetector *> (value);
272  for(size_t i = 0; i < input->fSTR7200_Channel.size(); i++){
273  for(size_t j = 0; j < input->fSTR7200_Channel[i].size(); j++){
274  this->fSTR7200_Channel[i][j] -= input->fSTR7200_Channel[i][j];
275  }
276  }
277  }
278  return *this;
279 }
Bool_t Compare(VQwSubsystem *source)
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
Implementation of the analysis of Moller data (copied from QwComptonElectronDetector.h)

+ Here is the call graph for this function:

VQwSubsystem & QwMollerDetector::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 240 of file QwMollerDetector.cc.

References Compare(), and fSTR7200_Channel.

240  {
241  // std::cout << "QwMollerDetector assignment (operator=)" << std::endl;
242  if(Compare(value)){
243  //VQwSubsystem::operator=(value);
244  QwMollerDetector* input = dynamic_cast<QwMollerDetector *> (value);
245  for(size_t i = 0; i < input->fSTR7200_Channel.size(); i++){
246  for(size_t j = 0; j < input->fSTR7200_Channel[i].size(); j++){
247  this->fSTR7200_Channel[i][j] = input->fSTR7200_Channel[i][j];
248  }
249  }
250  }
251  return *this;
252 }
Bool_t Compare(VQwSubsystem *source)
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
Implementation of the analysis of Moller data (copied from QwComptonElectronDetector.h)

+ Here is the call graph for this function:

void QwMollerDetector::print ( )

Definition at line 444 of file QwMollerDetector.cc.

References fMollerChannelID, and fSTR7200_Channel.

444  {
445  std::cout << " " << fSTR7200_Channel.size() << std::endl;
446  UInt_t max = 0;
447  for(size_t i = 0; i < fSTR7200_Channel.size(); i++){
448  UInt_t next = fSTR7200_Channel[i].size();
449  if (next > max){
450  max = next;
451  }
452  }
453 
454  for(size_t i = 0; i < max; i++){
455  std::cout << fMollerChannelID[i].fChannelName << ":\t" << (fMollerChannelID[i].fChannelName.Length() < 14 ? "\t" : "");
456  for(size_t j = 0; j < fSTR7200_Channel.size(); j++){
457 
458  if ( i < fSTR7200_Channel[j].size()){
459  std::cout << "0x" << std::hex << (int)fSTR7200_Channel[j][i].GetValue() << std::dec;
460  } else {
461  std::cout << " ";
462  }
463  std::cout << "\t\t";
464  }
465  std::cout << std::endl;
466  }
467 
468 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
std::vector< QwMollerChannelID > fMollerChannelID
void QwMollerDetector::PrintErrorCounters ( ) const
virtual

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

Implements VQwSubsystemParity.

Definition at line 356 of file QwMollerDetector.cc.

References fQwMollerErrorCount, and fSTR7200_Channel.

356  {
357  std::cout << "***************QwMoller Error Summary****************" << std::endl;
358  for (size_t i = 0; i < fSTR7200_Channel.size(); i++){
359  for (size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
360  fSTR7200_Channel[i][j].PrintErrorCounters();
361  }
362  }
363  std::cout << "total failed events: " << fQwMollerErrorCount << std::endl;
364  std::cout << "************End QwMoller Error Summary***************" << std::endl;
365 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
void QwMollerDetector::PrintValue ( ) const
virtual

Print values of all channels.

Reimplemented from VQwSubsystemParity.

Definition at line 470 of file QwMollerDetector.cc.

References fSTR7200_Channel.

470  {
471  for(size_t i = 0; i < fSTR7200_Channel.size(); i++){
472  for(size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
473  fSTR7200_Channel[i][j].PrintValue();
474  }
475  }
476 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
Int_t QwMollerDetector::ProcessConfigurationBuffer ( const UInt_t  roc_id,
const UInt_t  bank_id,
UInt_t *  buffer,
UInt_t  num_words 
)
virtual

Implements VQwSubsystem.

Definition at line 140 of file QwMollerDetector.cc.

140  {
141  return 0;
142 }
Int_t QwMollerDetector::ProcessConfigurationBuffer ( UInt_t  ev_type,
const UInt_t  roc_id,
const UInt_t  bank_id,
UInt_t *  buffer,
UInt_t  num_words 
)

Definition at line 144 of file QwMollerDetector.cc.

145 {
146  return 0;
147 }
Int_t QwMollerDetector::ProcessEvBuffer ( UInt_t  roc_id,
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 154 of file QwMollerDetector.cc.

References fMollerChannelID, and fSTR7200_Channel.

Referenced by ProcessEvBuffer().

155 {
156  Int_t index = 0; // GetSubbankIndex(roc_id, bank_id);
157 
158  if (index >= 0 && num_words > 0){
159  //we want to process this ROC
160 
161  //Loop through all the channels as defined in map file.. should be 96 in standard 3 module, 32 channel Moller configuration
162  for(size_t i = 0; i < fMollerChannelID.size(); i++){
163 
164  Int_t wordsLeft = num_words - fMollerChannelID[i].fWordInSubbank;
165 
166 // std::cout << std::dec << fMollerChannelID[i].fChannelName << ' ' << fMollerChannelID[i].fIndex << " in module " << fMollerChannelID[i].fModuleNumber << " has data " << std::hex << buffer[fMollerChannelID[i].fWordInSubbank] << std::dec << std::endl;
167 
168  UInt_t mod_index = fMollerChannelID[i].fModuleNumber;
169  Int_t chan_index = fMollerChannelID[i].fIndex;
170 // char *junk = new char[2];
171  if (mod_index < fSTR7200_Channel.size()) {
172  //mod_index should be less than 3, next_module is reference to vector where the Channel should be located
173  // std::cout << std::hex << buffer[fMollerChannelID[i].fWordInSubbank] << '\n';
174  //std::cin.getline(junk, 1);
175 // std::cout << '(' << mod_index << ',' << chan_index << ')' << buffer[fMollerChannelID[i].fWordInSubbank] - fSTR7200_Channel[mod_index][chan_index].GetValue() << ' ' << std::endl;
176 
177  fSTR7200_Channel[mod_index][chan_index].ProcessEvBuffer(&(buffer[fMollerChannelID[i].fWordInSubbank]), wordsLeft);
178  } else {
179  std::cout << "Problem reading buffer, incorrect structure of map file?" << std::endl;
180  }
181 
182  }
183  }
184 // std::cout << fSTR7200_Channel[2][0].GetValue() << std::endl;
185 // print();
186  return 0;
187 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
std::vector< QwMollerChannelID > fMollerChannelID

+ Here is the caller graph for this function:

Int_t QwMollerDetector::ProcessEvBuffer ( UInt_t  ev_type,
UInt_t  roc_id,
UInt_t  bank_id,
UInt_t *  buffer,
UInt_t  num_words 
)
virtual

Reimplemented from VQwSubsystem.

Definition at line 149 of file QwMollerDetector.cc.

References ProcessEvBuffer().

150 {
151  return ProcessEvBuffer(roc_id, bank_id, buffer, num_words);
152 }
Int_t ProcessEvBuffer(UInt_t roc_id, 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...

+ Here is the call graph for this function:

void QwMollerDetector::ProcessEvent ( )
virtual

Implements VQwSubsystem.

Definition at line 191 of file QwMollerDetector.cc.

References fPrevious_STR7200_Channel, and fSTR7200_Channel.

192 {
193  for(size_t i = 0; i < fSTR7200_Channel.size(); i++){
194  for(size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
195  fSTR7200_Channel[i][j].ProcessEvent();
196  QwSTR7200_Channel tempscaler(fSTR7200_Channel[i][j]);
197  tempscaler = fSTR7200_Channel[i][j];
199  fPrevious_STR7200_Channel[i][j] = tempscaler;
200  // Store a temproary copy of this channel's raw value as a scaler channel
201  // Subtract the corresponding fPrevious_STR7200_Channel from this scaler channel
202  // Put the temprary copy into the fPrevious_STR7200_Channel
203  }
204  }
205 }
class QwScaler_Channel< 0xffffffff, 0 > QwSTR7200_Channel
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
std::vector< std::vector< QwSTR7200_Channel > > fPrevious_STR7200_Channel
void QwMollerDetector::ProcessOptions ( QwOptions options)
virtual

Process the command line options.

Reimplemented from VQwSubsystem.

Definition at line 135 of file QwMollerDetector.cc.

135 {}
void QwMollerDetector::Ratio ( VQwSubsystem value1,
VQwSubsystem value2 
)
virtual

Implements VQwSubsystemParity.

Definition at line 295 of file QwMollerDetector.cc.

References Compare(), and fSTR7200_Channel.

295  {
296  if (Compare(value1) && Compare(value2)) {
297  QwMollerDetector* v1 = dynamic_cast<QwMollerDetector *> (value1);
298  QwMollerDetector* v2 = dynamic_cast<QwMollerDetector *> (value2);
299 
300  for(size_t i = 0; i < v1->fSTR7200_Channel.size(); i++){
301  for(size_t j = 0; j < v1->fSTR7200_Channel[i].size(); j++){
302  fSTR7200_Channel[i][j].Ratio(v1->fSTR7200_Channel[i][j],v2->fSTR7200_Channel[i][j]);
303  }
304  }
305  }
306  return;
307 }
Bool_t Compare(VQwSubsystem *source)
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
Implementation of the analysis of Moller data (copied from QwComptonElectronDetector.h)

+ Here is the call graph for this function:

void QwMollerDetector::Scale ( Double_t  factor)
virtual

Implements VQwSubsystemParity.

Definition at line 309 of file QwMollerDetector.cc.

References fSTR7200_Channel.

309  {
310  for(size_t i = 0; i < fSTR7200_Channel.size(); i++){
311  for(size_t j = 0; j < fSTR7200_Channel[i].size(); j++){
312  fSTR7200_Channel[i][j].Scale(factor);
313  }
314  }
315 }
std::vector< std::vector< QwSTR7200_Channel > > fSTR7200_Channel
Bool_t QwMollerDetector::SingleEventCuts ( )
void QwMollerDetector::Sum ( VQwSubsystem value1,
VQwSubsystem value2 
)
virtual

Implements VQwSubsystemParity.

Definition at line 281 of file QwMollerDetector.cc.

References Compare().

281  {
282  if (Compare(value1) && Compare(value2)) {
283  *this = value1;
284  *this += value2;
285  }
286 }
Bool_t Compare(VQwSubsystem *source)

+ Here is the call graph for this function:

void QwMollerDetector::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 120 of file QwMollerDetector.h.

120  {
121  };

Field Documentation

const Bool_t QwMollerDetector::bDEBUG = kFALSE
staticprivate

Definition at line 153 of file QwMollerDetector.h.

Referenced by ApplySingleEventCuts().

std::vector<QwMollerChannelID> QwMollerDetector::fMollerChannelID
protected

Definition at line 145 of file QwMollerDetector.h.

Referenced by GetChannelIndex(), LoadChannelMap(), print(), and ProcessEvBuffer().

UInt_t QwMollerDetector::fNumberOfEvents
private

Definition at line 154 of file QwMollerDetector.h.

std::vector< std::vector<QwSTR7200_Channel> > QwMollerDetector::fPrevious_STR7200_Channel
protected

Definition at line 149 of file QwMollerDetector.h.

Referenced by LoadChannelMap(), and ProcessEvent().

Int_t QwMollerDetector::fQwMollerErrorCount
private

Definition at line 152 of file QwMollerDetector.h.

Referenced by PrintErrorCounters().


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