QwAnalysis
QwRaster Class Reference

#include <QwRaster.h>

+ Inheritance diagram for QwRaster:
+ Collaboration diagram for QwRaster:

Public Member Functions

 QwRaster (const TString &name)
 Constructor with name. More...
 
virtual ~QwRaster ()
 Virtual destructor. More...
 
void ProcessOptions (QwOptions &options)
 Process the command line options. More...
 
Int_t LoadEventCuts (TString filename)
 Optional event cut file. More...
 
Bool_t ApplySingleEventCuts ()
 
void PrintErrorCounters () const
 
Bool_t CheckRunningAverages (Bool_t)
 
Int_t LoadChannelMap (TString mapfile)
 Mandatory map file definition. More...
 
Int_t GetDetectorInfo (std::vector< std::vector< QwDetectorInfo > > &detector_info)
 
Int_t LoadInputParameters (TString parameterfile)
 Mandatory parameter file definition. More...
 
Int_t ProcessConfigurationBuffer (const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
 
void InitializeChannel (TString name, TString datatosave)
 
void ClearEventData ()
 
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 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...
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, std::vector< Double_t > &values)
 Construct the branch and tree vector. More...
 
void FillTreeVector (std::vector< Double_t > &values) const
 Fill the tree vector. More...
 
void FillDB (QwDatabase *db, TString type)
 
void GetHitList (QwHitContainer &grandHitContainer)
 Get the hit list. More...
 
void ReportConfiguration ()
 
void PrintValue ()
 
void PrintInfo ()
 
- Public Member Functions inherited from VQwSubsystemTracking
 VQwSubsystemTracking (TString name)
 Constructor with name. More...
 
virtual ~VQwSubsystemTracking ()
 Default destructor. More...
 
Int_t LoadGeometryDefinition (TString mapfile)
 Load geometry definition for tracking subsystems. More...
 
Int_t LoadCrosstalkDefinition (TString mapfile)
 Load crosstalk definition for tracking subsystems. More...
 
const QwGeometryGetDetectorInfo () const
 Get the detector geometry information. More...
 
virtual void FillHardwareErrorSummary ()
 Hardware error summary. More...
 
virtual void ConstructBranch (TTree *tree, TString &prefix)
 Construct the branch and tree vector. More...
 
virtual void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &trim_file)
 Construct the branch and tree vector based on the trim file. More...
 
- 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...
 
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 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 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...
 
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, QwRaster >
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 Member Functions

void FillRawWord (Int_t bank_index, Int_t slot_num, Int_t chan, UInt_t data)
 
void ClearAllBankRegistrations ()
 
Int_t RegisterROCNumber (const UInt_t roc_id)
 
Int_t RegisterSubbank (const UInt_t bank_id)
 
Int_t RegisterSlotNumber (const UInt_t slot_id)
 
EQwModuleType RegisterModuleType (TString moduletype)
 
Int_t GetModuleIndex (size_t bank_index, size_t slot_num) const
 
Bool_t IsSlotRegistered (Int_t bank_index, Int_t slot_num) const
 
Int_t LinkChannelToSignal (const UInt_t chan, const TString &name)
 
Int_t FindSignalIndex (const EQwModuleType modtype, const TString &name) const
 
- 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

EQwModuleType fCurrentType
 
Bool_t fDEBUG
 
MQwV775TDC fQDCTDC
 
TString fRegion
 
size_t fCurrentBankIndex
 Name of this subsystem (the region). More...
 
Int_t fCurrentSlot
 
Int_t fCurrentIndex
 
UInt_t fBankID [2]
 
Int_t fNumberOfModules
 
std::vector< std::vector< Int_t > > fModuleIndex
 
std::vector< EQwModuleTypefModuleTypes
 Module index, indexed by bank_index and slot_number. More...
 
std::vector< std::vector
< std::pair< EQwModuleType,
Int_t > > > 
fModulePtrs
 
std::vector< std::vector
< QwPMT_Channel > > 
fPMTs
 
std::vector< QwSIS3801D24_ChannelfSCAs
 
std::map< TString, size_t > fSCAs_map
 
std::vector< Int_t > fSCAs_offset
 
TH2D * fRateMap
 
- Protected Attributes inherited from VQwSubsystemTracking
QwGeometry fDetectorInfo
 Geometry information of this subsystem. More...
 
size_t fTreeArrayIndex
 Tree indices. More...
 
size_t fTreeArrayNumEntries
 
Double_t fF1TDCResolutionNS
 
- 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...
 

Static Protected Attributes

static const UInt_t kMaxNumberOfModulesPerROC = 21
 
static const UInt_t kMaxNumberOfChannelsPerModule = 32
 

Private Member Functions

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

Private Attributes

Double_t fPositionOffsetX
 
Double_t fPositionOffsetY
 
Double_t fChannel_Offset_X
 
Double_t fChannel_Offset_Y
 
Double_t fCal_Factor_QDC_X
 
Double_t fCal_Factor_QDC_Y
 
Double_t fPositionX_ADC
 
Double_t fPositionY_ADC
 
Double_t fbpm_3h07a_slope
 
Double_t fbpm_3h07a_intercept
 
Double_t fbpm_3h09b_slope
 
Double_t fbpm_3h09b_intercept
 
Double_t fbpm_3h07a_xp
 
Double_t fbpm_3h07a_xm
 
Double_t fbpm_3h07a_yp
 
Double_t fbpm_3h07a_ym
 
Double_t fbpm_3h09b_xp
 
Double_t fbpm_3h09b_xm
 
Double_t fbpm_3h09b_yp
 
Double_t fbpm_3h09b_ym
 
Double_t fbpm_3h07a_pos_x
 
Double_t fbpm_3h07a_pos_y
 
Double_t fbpm_3h09b_pos_x
 
Double_t fbpm_3h09b_pos_y
 

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

Detailed Description

Definition at line 31 of file QwRaster.h.

Constructor & Destructor Documentation

QwRaster::QwRaster ( )
private

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

QwRaster::QwRaster ( const TString &  name)

Constructor with name.

Definition at line 24 of file QwRaster.cc.

References ClearAllBankRegistrations().

25 : VQwSubsystem(name),
27 {
29 }
void ClearAllBankRegistrations()
Definition: QwRaster.cc:603
VQwSubsystemTracking()
Private default constructor (not implemented, will throw linker error on use)

+ Here is the call graph for this function:

QwRaster::~QwRaster ( )
virtual

Virtual destructor.

Definition at line 32 of file QwRaster.cc.

References fPMTs, and fSCAs.

33 {
34  fPMTs.clear();
35  fSCAs.clear();
36 }
std::vector< QwSIS3801D24_Channel > fSCAs
Definition: QwRaster.h:109
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107

Member Function Documentation

Bool_t QwRaster::ApplySingleEventCuts ( )
inline

Definition at line 47 of file QwRaster.h.

47 { return kTRUE; };
Bool_t QwRaster::CheckRunningAverages ( Bool_t  )
inline

Definition at line 49 of file QwRaster.h.

49 { return kTRUE; };
void QwRaster::ClearAllBankRegistrations ( )
protected

Definition at line 603 of file QwRaster.cc.

References VQwSubsystem::ClearAllBankRegistrations(), fModuleIndex, fModulePtrs, fModuleTypes, and fNumberOfModules.

Referenced by QwRaster().

604 {
606  fModuleIndex.clear();
607  fModulePtrs.clear();
608  fModuleTypes.clear();
609  fNumberOfModules = 0;
610 }
std::vector< std::vector< Int_t > > fModuleIndex
Definition: QwRaster.h:101
std::vector< std::vector< std::pair< EQwModuleType, Int_t > > > fModulePtrs
Definition: QwRaster.h:104
Int_t fNumberOfModules
Definition: QwRaster.h:99
void ClearAllBankRegistrations()
Clear all registration of ROC and Bank IDs for this subsystem.
std::vector< EQwModuleType > fModuleTypes
Module index, indexed by bank_index and slot_number.
Definition: QwRaster.h:103

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwRaster::ClearEventData ( )
virtual

Implements VQwSubsystem.

Definition at line 202 of file QwRaster.cc.

References fPMTs, fSCAs, and VQwSubsystem::SetDataLoaded().

203 {
204  SetDataLoaded(kFALSE);
205 
206  for (size_t i=0; i<fPMTs.size(); i++)
207  {
208  for (size_t j=0; j<fPMTs.at(i).size(); j++)
209  {
210  fPMTs.at(i).at(j).SetValue(0);
211  }
212  }
213 
214  /*for (size_t i=0; i<fADC_Data.size(); i++)
215  {
216  if (fADC_Data.at(i) != NULL)
217  {
218  fADC_Data.at(i)->ClearEventData();
219  }
220  }*/
221 
222  for (size_t i=0; i<fSCAs.size(); i++) {
223  fSCAs.at(i).ClearEventData();
224  }
225 
226 }
std::vector< QwSIS3801D24_Channel > fSCAs
Definition: QwRaster.h:109
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107
void SetDataLoaded(Bool_t flag)
Definition: VQwSubsystem.h:305

+ Here is the call graph for this function:

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

Construct the branch and tree vector.

Reimplemented from VQwSubsystemTracking.

Definition at line 495 of file QwRaster.cc.

References fPMTs, fSCAs, VQwSubsystemTracking::fTreeArrayIndex, and VQwSubsystemTracking::fTreeArrayNumEntries.

496 {
497  fTreeArrayIndex = values.size();
498 
499  TString basename;
500  if (prefix=="") basename = "beamline";
501  else basename = prefix;
502 
503  values.push_back(0.0);
504  TString list = "PositionX_ADC/D";
505  values.push_back(0.0);
506  list += ":PositionY_ADC/D";
507  list += ":bpm_3h07a_pos_x/D";
508  list += ":bpm_3h07a_pos_y/D";
509  list += ":bpm_3h09b_pos_x/D";
510  list += ":bpm_3h09b_pos_y/D";
511 
512  for (size_t i=0; i<fPMTs.size(); i++) {
513  for (size_t j=0; j<fPMTs.at(i).size(); j++) {
514  TString element_name = fPMTs.at(i).at(j).GetElementName();
515  if (element_name=="") {
516  // This channel is not used, so skip setting up the tree.
517  } else {
518  values.push_back(0.0);
519  list += ":"+element_name+"_raw/D";
520  }
521  }
522  }
523 
524  for (size_t i=0; i<fSCAs.size(); i++){
525  if (fSCAs.at(i).GetElementName() != "") {
526  values.push_back(0.0);
527  list += ":" + fSCAs.at(i).GetElementName() + "/D";
528  }
529  }
530 
531  if (list[0]==':') {
532  list = list(1,list.Length()-1);
533  }
534 
535  fTreeArrayNumEntries = values.size() - fTreeArrayIndex;
536  tree->Branch(basename, &values[fTreeArrayIndex], list);
537 
538  return;
539 }
std::vector< QwSIS3801D24_Channel > fSCAs
Definition: QwRaster.h:109
size_t fTreeArrayIndex
Tree indices.
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107
void QwRaster::ConstructHistograms ( TDirectory *  folder,
TString &  prefix 
)
virtual

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

Implements VQwSubsystem.

Definition at line 394 of file QwRaster.cc.

References QwHistogramHelper::Construct1DHist(), MQwHistograms::fHistograms, fPMTs, fRateMap, fSCAs, and gQwHists.

395 {
396  TString basename;
397 
398  if (prefix == "") basename = "";
399  else basename = prefix;
400 
401  if (folder != NULL) folder->cd();
402 
403  for (size_t i=0; i<fPMTs.size(); i++)
404  {
405  for (size_t j=0; j<fPMTs.at(i).size(); j++)
406  fPMTs.at(i).at(j).ConstructHistograms(folder, basename);
407  }
408 
409  for (size_t i=0; i<fSCAs.size(); i++) {
410  fSCAs.at(i).ConstructHistograms(folder, prefix);
411  }
412 
413  fHistograms.push_back( gQwHists.Construct1DHist(TString("raster_position_x")));
414  fHistograms.push_back( gQwHists.Construct1DHist(TString("raster_position_y")));
415 
416  fRateMap = new TH2D("raster_rate_map","Raster Rate Map",125,0,0,125,0,0);
417 
418  fRateMap->GetXaxis()->SetTitle(" X [mm]");
419  fRateMap->GetYaxis()->SetTitle(" Y [mm]");
420 
421  gStyle -> SetPalette(1);
422  fRateMap->SetOption("colz");
423 
424  fHistograms.push_back( gQwHists.Construct1DHist(TString("bpm_3h07a_pos_x")));
425  fHistograms.push_back( gQwHists.Construct1DHist(TString("bpm_3h07a_pos_y")));
426  fHistograms.push_back( gQwHists.Construct1DHist(TString("bpm_3h09b_pos_x")));
427  fHistograms.push_back( gQwHists.Construct1DHist(TString("bpm_3h09b_pos_y")));
428 
429 }
std::vector< QwSIS3801D24_Channel > fSCAs
Definition: QwRaster.h:109
std::vector< TH1_ptr > fHistograms
Histograms associated with this data element.
Definition: MQwHistograms.h:46
TH2D * fRateMap
Definition: QwRaster.h:132
QwHistogramHelper gQwHists
Globally defined instance of the QwHistogramHelper class.
TH1F * Construct1DHist(const TString &inputfile, const TString &name_title)
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107

+ Here is the call graph for this function:

void QwRaster::FillDB ( QwDatabase db,
TString  type 
)
inline

Definition at line 70 of file QwRaster.h.

70 {return;};
void QwRaster::FillHistograms ( )
virtual

Fill the histograms for this subsystem.

Implements VQwSubsystem.

Definition at line 431 of file QwRaster.cc.

References fbpm_3h07a_pos_x, fbpm_3h07a_pos_y, fbpm_3h09b_pos_x, fbpm_3h09b_pos_y, MQwHistograms::fHistograms, fPMTs, fPositionX_ADC, fPositionY_ADC, fRateMap, fSCAs, and VQwSubsystem::HasDataLoaded().

432 {
433 
434  if (! HasDataLoaded()) return;
435 
436  for (size_t i=0; i<fPMTs.size(); i++)
437  {
438  for (size_t j=0; j<fPMTs.at(i).size(); j++)
439  {
440  fPMTs.at(i).at(j).FillHistograms();
441  }
442  }
443 
444  for (size_t i=0; i<fSCAs.size(); i++) {
445  fSCAs.at(i).FillHistograms();
446  }
447 
448  // FR fudge factor is 3.2, by Dave Mack
449  // See hclog ttps://hallcweb.jlab.org/hclog/1010_archive/101012134143.html
450  // I inverse x axis and multiply the FR fudge factor to x and y values
451  // in order to see the unit is mm in the FR plot
452  // Tuesday, October 12 17:11:52 EDT 2010, jhlee
453 
454  Double_t fudge_factor = 3.2;
455 
456  Double_t raster_x_mm = 0.0;
457  Double_t raster_y_mm = 0.0;
458 
459  raster_x_mm = - fudge_factor*fPositionX_ADC;
460  raster_y_mm = fudge_factor*fPositionY_ADC;
461 
462  for (size_t j=0; j<fHistograms.size();j++)
463  {
464  if (fHistograms.at(j)->GetTitle()==TString("raster_position_x"))
465  {
466  fHistograms.at(j)->Fill(raster_x_mm);
467  }
468  if (fHistograms.at(j)->GetTitle()==TString("raster_position_y"))
469  {
470  fHistograms.at(j)->Fill(raster_y_mm);
471  }
472  if (fHistograms.at(j)->GetTitle()==TString("bpm_3h07a_pos_x"))
473  {
474  fHistograms.at(j)->Fill(fbpm_3h07a_pos_x);
475  }
476  if (fHistograms.at(j)->GetTitle()==TString("bpm_3h07a_pos_y"))
477  {
478  fHistograms.at(j)->Fill(fbpm_3h07a_pos_y);
479  }
480  if (fHistograms.at(j)->GetTitle()==TString("bpm_3h09b_pos_x"))
481  {
482  fHistograms.at(j)->Fill(fbpm_3h09b_pos_x);
483  }
484  if (fHistograms.at(j)->GetTitle()==TString("bpm_3h09b_pos_y"))
485  {
486  fHistograms.at(j)->Fill(fbpm_3h09b_pos_y);
487  }
488  }
489 
490  fRateMap->Fill(raster_x_mm, raster_y_mm);
491 
492 }
Double_t fPositionY_ADC
Definition: QwRaster.h:146
std::vector< QwSIS3801D24_Channel > fSCAs
Definition: QwRaster.h:109
std::vector< TH1_ptr > fHistograms
Histograms associated with this data element.
Definition: MQwHistograms.h:46
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
Double_t fbpm_3h07a_pos_y
Definition: QwRaster.h:163
TH2D * fRateMap
Definition: QwRaster.h:132
Double_t fbpm_3h07a_pos_x
Definition: QwRaster.h:162
Double_t fbpm_3h09b_pos_y
Definition: QwRaster.h:165
Double_t fbpm_3h09b_pos_x
Definition: QwRaster.h:164
Double_t fPositionX_ADC
Definition: QwRaster.h:145
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107

+ Here is the call graph for this function:

void QwRaster::FillRawWord ( Int_t  bank_index,
Int_t  slot_num,
Int_t  chan,
UInt_t  data 
)
protected

Definition at line 691 of file QwRaster.cc.

References fModulePtrs, fPMTs, GetModuleIndex(), and kUnknownModuleType.

Referenced by ProcessEvBuffer().

694 {
695  Int_t modindex = GetModuleIndex(bank_index,slot_num);
696 
697  // std::cout<<"modtype="<< fModulePtrs.at(modindex).at(chan).first
698  // <<" chanindex="<<fModulePtrs.at(modindex).at(chan).second<<" data="<<data<<"\n";
699 
700  if (modindex != -1)
701  {
702  EQwModuleType modtype = fModulePtrs.at(modindex).at(chan).first;
703  Int_t chanindex = fModulePtrs.at(modindex).at(chan).second;
704 
705  if (modtype == kUnknownModuleType || chanindex == -1)
706  {
707  // This channel is not connected to anything.
708  // Do nothing.
709  }
710  else
711  {
712  fPMTs.at(modtype).at(chanindex).SetValue(data);
713  }
714  }
715 }
EQwModuleType
Definition: QwTypes.h:148
Int_t GetModuleIndex(size_t bank_index, size_t slot_num) const
Definition: QwRaster.cc:718
std::vector< std::vector< std::pair< EQwModuleType, Int_t > > > fModulePtrs
Definition: QwRaster.h:104
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Fill the tree vector.

Reimplemented from VQwSubsystemTracking.

Definition at line 542 of file QwRaster.cc.

References fbpm_3h07a_pos_x, fbpm_3h07a_pos_y, fbpm_3h09b_pos_x, fbpm_3h09b_pos_y, fPMTs, fPositionX_ADC, fPositionY_ADC, fSCAs, VQwSubsystemTracking::fTreeArrayIndex, and VQwSubsystem::HasDataLoaded().

543 {
544  if (! HasDataLoaded()) return;
545 
546  Int_t index = fTreeArrayIndex;
547  values[index++] = fPositionX_ADC;
548  values[index++] = fPositionY_ADC;
549  values[index++] = fbpm_3h07a_pos_x;
550  values[index++] = fbpm_3h07a_pos_y;
551  values[index++] = fbpm_3h09b_pos_x;
552  values[index++] = fbpm_3h09b_pos_y;
553 
554  //fill trigvalues
555  for (size_t i=0; i<fPMTs.size(); i++)
556  {
557  for (size_t j=0; j<fPMTs.at(i).size(); j++)
558  {
559  if (fPMTs.at(i).at(j).GetElementName()=="") {}
560  else
561  {
562  values[index++] = fPMTs.at(i).at(j).GetValue();
563  }
564  }
565  }
566 
567  for (size_t i=0; i<fSCAs.size(); i++) {
568  if (fSCAs.at(i).GetElementName()!="") {
569  values[index] = fSCAs.at(i).GetValue();
570  index++;
571  }
572  }
573 }
Double_t fPositionY_ADC
Definition: QwRaster.h:146
std::vector< QwSIS3801D24_Channel > fSCAs
Definition: QwRaster.h:109
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
Double_t fbpm_3h07a_pos_y
Definition: QwRaster.h:163
size_t fTreeArrayIndex
Tree indices.
Double_t fbpm_3h07a_pos_x
Definition: QwRaster.h:162
Double_t fbpm_3h09b_pos_y
Definition: QwRaster.h:165
Double_t fbpm_3h09b_pos_x
Definition: QwRaster.h:164
Double_t fPositionX_ADC
Definition: QwRaster.h:145
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107

+ Here is the call graph for this function:

Int_t QwRaster::FindSignalIndex ( const EQwModuleType  modtype,
const TString &  name 
) const
protected

Definition at line 733 of file QwRaster.cc.

References fPMTs.

Referenced by LoadChannelMap().

734 {
735  Int_t chanindex = -1;
736  if (modtype < (Int_t) fPMTs.size())
737  {
738  for (size_t chan = 0; chan < fPMTs.at(modtype).size(); chan++)
739  {
740  if (name == fPMTs.at(modtype).at(chan).GetElementName())
741  {
742  chanindex = chan;
743  break;
744  }
745  }
746  }
747  return chanindex;
748 }
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107

+ Here is the caller graph for this function:

Int_t QwRaster::GetDetectorInfo ( std::vector< std::vector< QwDetectorInfo > > &  detector_info)
inline

Definition at line 53 of file QwRaster.h.

53 {return 0;};
void QwRaster::GetHitList ( QwHitContainer grandHitContainer)
inlinevirtual

Get the hit list.

Implements VQwSubsystemTracking.

Definition at line 72 of file QwRaster.h.

72 {};
Int_t QwRaster::GetModuleIndex ( size_t  bank_index,
size_t  slot_num 
) const
protected

Definition at line 718 of file QwRaster.cc.

References fModuleIndex.

Referenced by FillRawWord(), IsSlotRegistered(), and ProcessEvBuffer().

719 {
720  Int_t modindex = -1;
721  // bank_index and slot_num are unsigned int and always positive
722  if (/* bank_index >= 0 && */ bank_index < fModuleIndex.size())
723  {
724  if (/* slot_num >= 0 && */ slot_num < fModuleIndex.at(bank_index).size())
725  {
726  modindex = fModuleIndex.at(bank_index).at(slot_num);
727  }
728  }
729  return modindex;
730 }
std::vector< std::vector< Int_t > > fModuleIndex
Definition: QwRaster.h:101

+ Here is the caller graph for this function:

void QwRaster::InitializeChannel ( TString  name,
TString  datatosave 
)
Bool_t QwRaster::IsSlotRegistered ( Int_t  bank_index,
Int_t  slot_num 
) const
inlineprotected

Definition at line 122 of file QwRaster.h.

References GetModuleIndex().

Referenced by ProcessEvBuffer().

122  {
123  return (GetModuleIndex(bank_index,slot_num) != -1);
124  };
Int_t GetModuleIndex(size_t bank_index, size_t slot_num) const
Definition: QwRaster.cc:718

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Int_t QwRaster::LinkChannelToSignal ( const UInt_t  chan,
const TString &  name 
)
protected

Definition at line 682 of file QwRaster.cc.

References fCurrentIndex, fCurrentType, fModulePtrs, and fPMTs.

Referenced by LoadChannelMap().

683 {
684  fPMTs.at(fCurrentType).push_back(QwPMT_Channel(name));
685  fModulePtrs.at(fCurrentIndex).at(chan).first = fCurrentType;
686  fModulePtrs.at(fCurrentIndex).at(chan).second =
687  fPMTs.at(fCurrentType).size() -1;
688  return 0;
689 }
Int_t fCurrentIndex
Definition: QwRaster.h:90
std::vector< std::vector< std::pair< EQwModuleType, Int_t > > > fModulePtrs
Definition: QwRaster.h:104
EQwModuleType fCurrentType
Definition: QwRaster.h:80
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107

+ Here is the caller graph for this function:

Int_t QwRaster::LoadChannelMap ( TString  mapfile)
virtual

Mandatory map file definition.

Implements VQwSubsystem.

Definition at line 44 of file QwRaster.cc.

References fBankID, fCurrentIndex, fCurrentType, VQwSubsystem::fDetectorMaps, FindSignalIndex(), fModulePtrs, fSCAs, fSCAs_map, fSCAs_offset, QwParameterFile::GetUInt(), kUnknownModuleType, LinkChannelToSignal(), RegisterModuleType(), RegisterROCNumber(), RegisterSlotNumber(), and RegisterSubbank().

45 {
46  TString varname, varvalue;
47  TString modtype, dettype, name;
48  Int_t modnum = 0, channum = 0;
49 
50  QwParameterFile mapstr(mapfile.Data()); //Open the file
51  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
52 
53  while (mapstr.ReadNextLine())
54  {
55  mapstr.TrimComment('!'); // Remove everything after a '!' character.
56  mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
57  if (mapstr.LineIsEmpty()) continue;
58 
59  if (mapstr.HasVariablePair("=",varname,varvalue)){
60  // This is a declaration line. Decode it.
61  varname.ToLower();
62  UInt_t value = QwParameterFile::GetUInt(varvalue);
63  if (varname=="roc") {
64  RegisterROCNumber(value);
65  } else if (varname=="qdc_bank") {
66  RegisterSubbank(value);
67  fBankID[0] = value;
68  } else if (varname=="sca_bank") {
69  fBankID[1] = value;
70  RegisterSubbank(value);
71  } else if (varname=="slot") {
72  RegisterSlotNumber(value);
73  } else if (varname=="module") {
74  RegisterModuleType(varvalue);
75  }
76  } else {
77  // Break this line into tokens to process it.
78  modtype = mapstr.GetTypedNextToken<TString>();
79  modnum = mapstr.GetTypedNextToken<Int_t>();
80  channum = mapstr.GetTypedNextToken<Int_t>();
81  dettype = mapstr.GetTypedNextToken<TString>();
82  name = mapstr.GetTypedNextToken<TString>();
83 
84  // Push a new record into the element array
85  if (modtype=="SIS3801") {
86  QwSIS3801D24_Channel localchannel(name);
87  localchannel.SetNeedsExternalClock(kFALSE);
88  fSCAs.push_back(localchannel);
89  fSCAs_map[name] = fSCAs.size()-1;
90  Int_t offset = QwSIS3801D24_Channel::GetBufferOffset(modnum,channum);
91  fSCAs_offset.push_back(offset);
92  } else if (modtype=="V792" || modtype=="V775") {
93  RegisterModuleType(modtype);
94  // Check to see if we've encountered this channel or name yet
95  if (fModulePtrs.at(fCurrentIndex).at(channum).first != kUnknownModuleType) {
96  // We've seen this channel
97  } else if (FindSignalIndex(fCurrentType, name)>=0) {
98  // We've seen this signal
99  } else {
100  // If not, push a new record into the element array
101  LinkChannelToSignal(channum, name);
102  }
103  } else {
104  std::cerr << "LoadChannelMap: Unknown line: " << mapstr.GetLine().c_str() << std::endl;
105  }
106  }
107  }
108  mapstr.Close(); // Close the file (ifstream)
109  //ReportConfiguration();
110  return 0;
111 }
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
std::map< TString, size_t > fSCAs_map
Definition: QwRaster.h:110
UInt_t fBankID[2]
Definition: QwRaster.h:92
EQwModuleType RegisterModuleType(TString moduletype)
Definition: QwRaster.cc:662
static UInt_t GetUInt(const TString &varvalue)
Int_t RegisterSubbank(const UInt_t bank_id)
Definition: QwRaster.cc:621
Int_t LinkChannelToSignal(const UInt_t chan, const TString &name)
Definition: QwRaster.cc:682
std::vector< QwSIS3801D24_Channel > fSCAs
Definition: QwRaster.h:109
Int_t FindSignalIndex(const EQwModuleType modtype, const TString &name) const
Definition: QwRaster.cc:733
Int_t RegisterSlotNumber(const UInt_t slot_id)
Definition: QwRaster.cc:632
Int_t RegisterROCNumber(const UInt_t roc_id)
Definition: QwRaster.cc:612
class QwScaler_Channel< 0x00ffffff, 0 > QwSIS3801D24_Channel
Int_t fCurrentIndex
Definition: QwRaster.h:90
std::vector< std::vector< std::pair< EQwModuleType, Int_t > > > fModulePtrs
Definition: QwRaster.h:104
std::vector< Int_t > fSCAs_offset
Definition: QwRaster.h:111
EQwModuleType fCurrentType
Definition: QwRaster.h:80

+ Here is the call graph for this function:

Int_t QwRaster::LoadEventCuts ( TString  mapfile)
inlinevirtual

Optional event cut file.

Reimplemented from VQwSubsystem.

Definition at line 46 of file QwRaster.h.

46 { return 0; };
Int_t QwRaster::LoadInputParameters ( TString  mapfile)
virtual

Mandatory parameter file definition.

Implements VQwSubsystem.

Definition at line 113 of file QwRaster.cc.

References fbpm_3h07a_intercept, fbpm_3h07a_slope, fbpm_3h09b_intercept, fbpm_3h09b_slope, fCal_Factor_QDC_X, fCal_Factor_QDC_Y, fChannel_Offset_X, fChannel_Offset_Y, VQwSubsystem::fDetectorMaps, fPositionOffsetX, and fPositionOffsetY.

114 {
115  Bool_t ldebug=kFALSE;
116  TString varname, varvalue;
117  Double_t varped;
118  Double_t varcal;
119  TString localname;
120 
121  Int_t lineread=0;
122 
123  QwParameterFile mapstr(parameterfile.Data()); //Open the file
124  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
125 
126  if (ldebug) std::cout<<"\nReading raster parameter file: "<<parameterfile<<"\n";
127 
128  while (mapstr.ReadNextLine())
129  {
130  lineread+=1;
131  mapstr.TrimComment('!'); // Remove everything after a '!' character.
132  mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
133  if (mapstr.LineIsEmpty()) continue;
134 
135  if (mapstr.HasVariablePair("=",varname,varvalue))
136  {
137  varname.ToLower();
138  Double_t value = atof(varvalue.Data());
139  if (varname=="position_offset_x")
140  {
141  fPositionOffsetX = value;
142  }
143  else if (varname=="position_offset_y")
144  {
145  fPositionOffsetY = value;
146  }
147  else if (varname=="cal_factor_qdc_x")
148  {
149  fCal_Factor_QDC_X = value;
150  }
151  else if (varname=="cal_factor_qdc_y")
152  {
153  fCal_Factor_QDC_Y = value;
154  }
155  else if (varname=="channel_offset_x")
156  {
157  fChannel_Offset_X = value;
158  }
159  else if (varname=="channel_offset_y")
160  {
161  fChannel_Offset_Y = value;
162  }
163  else if (varname=="bpm_3h07a_slope")
164  {
165  fbpm_3h07a_slope = value;
166  }
167  else if (varname=="bpm_3h07a_intercept")
168  {
169  fbpm_3h07a_intercept = value;
170  }
171  else if (varname=="bpm_3h09b_slope")
172  {
173  fbpm_3h09b_slope = value;
174  }
175  else if (varname=="bpm_3h09b_intercept")
176  {
177  fbpm_3h09b_intercept = value;
178  }
179 
180  if (ldebug) std::cout<<"inputs for "<<varname<<": "<<value<<"\n";
181  }
182 
183  else
184  {
185  varname = mapstr.GetTypedNextToken<TString>(); //name of the channel
186  varname.ToLower();
187  varname.Remove(TString::kBoth,' ');
188  varped= mapstr.GetTypedNextToken<Double_t>(); // value of the pedestal
189  varcal= mapstr.GetTypedNextToken<Double_t>(); // value of the calibration factor
190  if (ldebug) std::cout<<"inputs for channel "<<varname
191  <<": ped="<<varped<<", cal="<<varcal<<"\n";
192  }
193  }
194  if (ldebug) std::cout<<" line read in the parameter file ="<<lineread<<" \n";
195 
196  ldebug=kFALSE;
197  mapstr.Close(); // Close the file (ifstream)
198  return 0;
199 }
Double_t fbpm_3h09b_intercept
Definition: QwRaster.h:151
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
Double_t fChannel_Offset_Y
Definition: QwRaster.h:141
Double_t fbpm_3h09b_slope
Definition: QwRaster.h:150
Double_t fPositionOffsetX
Definition: QwRaster.h:138
Double_t fbpm_3h07a_slope
Definition: QwRaster.h:148
Double_t fChannel_Offset_X
Definition: QwRaster.h:140
Double_t fCal_Factor_QDC_X
Definition: QwRaster.h:142
Double_t fPositionOffsetY
Definition: QwRaster.h:139
Double_t fbpm_3h07a_intercept
Definition: QwRaster.h:149
Double_t fCal_Factor_QDC_Y
Definition: QwRaster.h:143
void QwRaster::PrintErrorCounters ( ) const
inline

Definition at line 48 of file QwRaster.h.

48 {};
void QwRaster::PrintInfo ( )

Definition at line 750 of file QwRaster.cc.

References fPMTs, and VQwSubsystem::fSystemName.

751 {
752  std::cout << "QwRaster: " << fSystemName << std::endl;
753 
754  for (size_t i=0; i<fPMTs.size(); i++)
755  {
756  for (size_t j=0; j<fPMTs.at(i).size(); j++)
757  {
758  fPMTs.at(i).at(j).PrintInfo();
759  }
760  }
761 
762  return;
763 }
TString fSystemName
Name of this subsystem.
Definition: VQwSubsystem.h:315
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107
void QwRaster::PrintValue ( )
inline

Definition at line 75 of file QwRaster.h.

75 { };
Int_t QwRaster::ProcessConfigurationBuffer ( const UInt_t  roc_id,
const UInt_t  bank_id,
UInt_t *  buffer,
UInt_t  num_words 
)
virtual

Implements VQwSubsystem.

Definition at line 229 of file QwRaster.cc.

230 {
231  return 0;
232 }
Int_t QwRaster::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 235 of file QwRaster.cc.

References MQwV775TDC::DecodeTDCWord(), Qw::e, fBankID, FillRawWord(), fModulePtrs, fQDCTDC, fSCAs, fSCAs_offset, GetModuleIndex(), VQwSubsystem::GetSubbankIndex(), MQwV775TDC::GetTDCChannelNumber(), MQwV775TDC::GetTDCData(), MQwV775TDC::GetTDCSlotNumber(), IsSlotRegistered(), MQwV775TDC::IsValidDataword(), and VQwSubsystem::SetDataLoaded().

236 {
237  Int_t index = 0;
238 
239  index = GetSubbankIndex(roc_id,bank_id);
240 
241  // This is a QADC/TDC bank
242  if (bank_id==fBankID[0])
243  {
244  if (index>=0 && num_words>0)
245  {
246  // We want to process this ROC. Begin looping through the data.
247  SetDataLoaded(kTRUE);
248  for (size_t i=0; i<num_words ; i++)
249  {
250  // Decode this word as a V775TDC word.
251  fQDCTDC.DecodeTDCWord(buffer[i]);
252 
253  if (! IsSlotRegistered(index, fQDCTDC.GetTDCSlotNumber())) continue;
254 
255  if (fQDCTDC.IsValidDataword())
256  {
257  // This is a V775 TDC data word
258  try
259  {
261  fQDCTDC.GetTDCData());
262  }
263  catch (std::exception& e)
264  {
265  std::cerr << "Standard exception from Raster::FillRawTDCWord: "
266  << e.what() << std::endl;
267  Int_t chan = fQDCTDC.GetTDCChannelNumber();
268  std::cerr << " Parameters: index=="<<index
269  << "; GetV775SlotNumber()=="<<fQDCTDC.GetTDCSlotNumber()
270  << "; GetV775ChannelNumber()=="<<chan
271  << "; GetV775Data()=="<<fQDCTDC.GetTDCData()
272  << std::endl;
273  Int_t modindex = GetModuleIndex(index, fQDCTDC.GetTDCSlotNumber());
274  std::cerr << " GetModuleIndex()=="<<modindex
275  << "; fModulePtrs.at(modindex).size()=="
276  << fModulePtrs.at(modindex).size()
277  << "; fModulePtrs.at(modindex).at(chan).first {module type}=="
278  << fModulePtrs.at(modindex).at(chan).first
279  << "; fModulePtrs.at(modindex).at(chan).second {signal index}=="
280  << fModulePtrs.at(modindex).at(chan).second
281  << std::endl;
282  }
283  }
284  }
285  }
286  }
287 
288  else if (bank_id==fBankID[1]) { // SIS Scalar
289 
290  // Check if scaler buffer contains more than one event
291  if (buffer[0]/32!=1) return 0;
292 
293  if (index>=0 && num_words>0) {
294  SetDataLoaded(kTRUE);
295  UInt_t words_read = 0;
296  for (size_t i=0; i<fSCAs.size(); i++) {
297  words_read += fSCAs.at(i).ProcessEvBuffer(&(buffer[fSCAs_offset.at(i)]),
298  num_words-fSCAs_offset.at(i));
299  }
300  }
301  }
302 
303  return 0;
304 }
Int_t GetSubbankIndex() const
Definition: VQwSubsystem.h:303
UInt_t GetTDCChannelNumber()
Definition: MQwV775TDC.h:43
Bool_t IsSlotRegistered(Int_t bank_index, Int_t slot_num) const
Definition: QwRaster.h:122
UInt_t GetTDCData()
Definition: MQwV775TDC.h:44
UInt_t fBankID[2]
Definition: QwRaster.h:92
std::vector< QwSIS3801D24_Channel > fSCAs
Definition: QwRaster.h:109
static const double e
Definition: QwUnits.h:91
void FillRawWord(Int_t bank_index, Int_t slot_num, Int_t chan, UInt_t data)
Definition: QwRaster.cc:691
MQwV775TDC fQDCTDC
Definition: QwRaster.h:83
void DecodeTDCWord(UInt_t &word, const UInt_t roc_id=0)
Definition: MQwV775TDC.cc:53
UInt_t GetTDCSlotNumber()
Definition: MQwV775TDC.h:42
Int_t GetModuleIndex(size_t bank_index, size_t slot_num) const
Definition: QwRaster.cc:718
std::vector< std::vector< std::pair< EQwModuleType, Int_t > > > fModulePtrs
Definition: QwRaster.h:104
std::vector< Int_t > fSCAs_offset
Definition: QwRaster.h:111
Bool_t IsValidDataword()
Definition: MQwV775TDC.h:39
void SetDataLoaded(Bool_t flag)
Definition: VQwSubsystem.h:305

+ Here is the call graph for this function:

void QwRaster::ProcessEvent ( )
virtual

Implements VQwSubsystem.

Definition at line 307 of file QwRaster.cc.

References fbpm_3h07a_intercept, fbpm_3h07a_pos_x, fbpm_3h07a_pos_y, fbpm_3h07a_slope, fbpm_3h07a_xm, fbpm_3h07a_xp, fbpm_3h07a_ym, fbpm_3h07a_yp, fbpm_3h09b_intercept, fbpm_3h09b_pos_x, fbpm_3h09b_pos_y, fbpm_3h09b_slope, fbpm_3h09b_xm, fbpm_3h09b_xp, fbpm_3h09b_ym, fbpm_3h09b_yp, fCal_Factor_QDC_X, fCal_Factor_QDC_Y, fChannel_Offset_X, fChannel_Offset_Y, fPMTs, fPositionOffsetX, fPositionOffsetY, fPositionX_ADC, fPositionY_ADC, fSCAs, and VQwSubsystem::HasDataLoaded().

308 {
309  if (! HasDataLoaded()) return;
310 
311  for (size_t i=0; i<fPMTs.size(); i++) {
312  for (size_t j=0; j<fPMTs.at(i).size(); j++) {
313  fPMTs.at(i).at(j).ProcessEvent();
314  }
315  }
316 
317  /*for (size_t i=0; i<fADC_Data.size(); i++)
318  {
319  if (fADC_Data.at(i) != NULL)
320  {
321  fADC_Data.at(i)->ProcessEvent();
322  }
323  }*/
324 
325  for (size_t i=0; i<fSCAs.size(); i++) {
326  fSCAs.at(i).ProcessEvent();
327  }
328 
329  //Fill trigger data
330  for (size_t i=0; i<fPMTs.size(); i++)
331  {
332  for (size_t j=0; j<fPMTs.at(i).size(); j++)
333  {
334 
335  TString element_name = fPMTs.at(i).at(j).GetElementName();
336  if (element_name==TString("raster_posx_adc"))
337  {
338  fPositionX_ADC = fPMTs.at(i).at(j).GetValue();
340  }
341  else if (element_name==TString("raster_posy_adc"))
342  {
343  fPositionY_ADC = fPMTs.at(i).at(j).GetValue();
345  }
346 
347  else if (element_name==TString("bpm_3h07a_xp_adc"))
348  {
349  fbpm_3h07a_xp = fPMTs.at(i).at(j).GetValue();
350  }
351  else if (element_name==TString("bpm_3h07a_xm_adc"))
352  {
353  fbpm_3h07a_xm = fPMTs.at(i).at(j).GetValue();
354  }
355  else if (element_name==TString("bpm_3h07a_yp_adc"))
356  {
357  fbpm_3h07a_yp = fPMTs.at(i).at(j).GetValue();
358  }
359  else if (element_name==TString("bpm_3h07a_ym_adc"))
360  {
361  fbpm_3h07a_ym = fPMTs.at(i).at(j).GetValue();
362  }
363  else if (element_name==TString("bpm_3h09b_xp_adc"))
364  {
365  fbpm_3h09b_xp = fPMTs.at(i).at(j).GetValue();
366  }
367  else if (element_name==TString("bpm_3h09b_xm_adc"))
368  {
369  fbpm_3h09b_xm = fPMTs.at(i).at(j).GetValue();
370  }
371  else if (element_name==TString("bpm_3h09b_yp_adc"))
372  {
373  fbpm_3h09b_yp = fPMTs.at(i).at(j).GetValue();
374  }
375  else if (element_name==TString("bpm_3h09b_ym_adc"))
376  {
377  fbpm_3h09b_ym = fPMTs.at(i).at(j).GetValue();
378  }
379  }
380  }
381 
390 
391 }
Double_t fbpm_3h09b_intercept
Definition: QwRaster.h:151
Double_t fbpm_3h07a_ym
Definition: QwRaster.h:156
Double_t fChannel_Offset_Y
Definition: QwRaster.h:141
Double_t fbpm_3h09b_slope
Definition: QwRaster.h:150
Double_t fPositionY_ADC
Definition: QwRaster.h:146
std::vector< QwSIS3801D24_Channel > fSCAs
Definition: QwRaster.h:109
Double_t fPositionOffsetX
Definition: QwRaster.h:138
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
Double_t fbpm_3h07a_slope
Definition: QwRaster.h:148
Double_t fChannel_Offset_X
Definition: QwRaster.h:140
Double_t fbpm_3h07a_xm
Definition: QwRaster.h:154
Double_t fbpm_3h07a_pos_y
Definition: QwRaster.h:163
Double_t fCal_Factor_QDC_X
Definition: QwRaster.h:142
Double_t fbpm_3h07a_pos_x
Definition: QwRaster.h:162
Double_t fbpm_3h09b_pos_y
Definition: QwRaster.h:165
Double_t fPositionOffsetY
Definition: QwRaster.h:139
Double_t fbpm_3h09b_pos_x
Definition: QwRaster.h:164
Double_t fbpm_3h07a_intercept
Definition: QwRaster.h:149
Double_t fbpm_3h07a_xp
Definition: QwRaster.h:153
Double_t fbpm_3h09b_ym
Definition: QwRaster.h:160
Double_t fbpm_3h09b_yp
Definition: QwRaster.h:159
Double_t fbpm_3h09b_xp
Definition: QwRaster.h:157
Double_t fCal_Factor_QDC_Y
Definition: QwRaster.h:143
Double_t fPositionX_ADC
Definition: QwRaster.h:145
Double_t fbpm_3h07a_yp
Definition: QwRaster.h:155
Double_t fbpm_3h09b_xm
Definition: QwRaster.h:158
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107

+ Here is the call graph for this function:

void QwRaster::ProcessOptions ( QwOptions options)
virtual

Process the command line options.

Reimplemented from VQwSubsystem.

Definition at line 39 of file QwRaster.cc.

40 {
41  //Handle command line options
42 }
EQwModuleType QwRaster::RegisterModuleType ( TString  moduletype)
protected

Definition at line 662 of file QwRaster.cc.

References fCurrentIndex, fCurrentType, fModuleTypes, fPMTs, kSIS3801, and kV792_ADC.

Referenced by LoadChannelMap().

663 {
664  moduletype.ToUpper();
665 
666  // Check to see if we've already registered a type for the current slot,
667  // if so, throw an error...
668 
669  if (moduletype=="V792"){
671  } else if (moduletype=="SIS3801") {
673  }
675  if ((Int_t) fPMTs.size() <= fCurrentType){
676  fPMTs.resize(fCurrentType+1);
677  }
678  return fCurrentType;
679 }
Int_t fCurrentIndex
Definition: QwRaster.h:90
EQwModuleType fCurrentType
Definition: QwRaster.h:80
std::vector< std::vector< QwPMT_Channel > > fPMTs
Definition: QwRaster.h:107
std::vector< EQwModuleType > fModuleTypes
Module index, indexed by bank_index and slot_number.
Definition: QwRaster.h:103

+ Here is the caller graph for this function:

Int_t QwRaster::RegisterROCNumber ( const UInt_t  roc_id)
protected

Definition at line 612 of file QwRaster.cc.

References fCurrentBankIndex, fModuleIndex, VQwSubsystem::GetSubbankIndex(), kMaxNumberOfModulesPerROC, and VQwSubsystem::RegisterROCNumber().

Referenced by LoadChannelMap().

613 {
615  fCurrentBankIndex = GetSubbankIndex(roc_id, 0);
616  std::vector<Int_t> tmpvec(kMaxNumberOfModulesPerROC,-1);
617  fModuleIndex.push_back(tmpvec);
618  return fCurrentBankIndex;
619 }
Int_t GetSubbankIndex() const
Definition: VQwSubsystem.h:303
size_t fCurrentBankIndex
Name of this subsystem (the region).
Definition: QwRaster.h:88
static const UInt_t kMaxNumberOfModulesPerROC
Definition: QwRaster.h:97
std::vector< std::vector< Int_t > > fModuleIndex
Definition: QwRaster.h:101
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.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Int_t QwRaster::RegisterSlotNumber ( const UInt_t  slot_id)
protected

Definition at line 632 of file QwRaster.cc.

References fCurrentBankIndex, fCurrentIndex, fCurrentSlot, fModuleIndex, fModulePtrs, fModuleTypes, fNumberOfModules, kMaxNumberOfChannelsPerModule, kMaxNumberOfModulesPerROC, and kUnknownModuleType.

Referenced by LoadChannelMap().

633 {
634 
635  std::pair<EQwModuleType, Int_t> tmppair;
636  tmppair.first = kUnknownModuleType;
637  tmppair.second = -1;
638  if (slot_id<kMaxNumberOfModulesPerROC)
639  {
640  // fCurrentBankIndex is unsigned int and always positive
641  if (/* fCurrentBankIndex >= 0 && */ fCurrentBankIndex <= fModuleIndex.size())
642  {
643  fModuleTypes.resize(fNumberOfModules+1);
644  fModulePtrs.resize(fNumberOfModules+1);
646  tmppair);
647  fNumberOfModules = fModulePtrs.size();
648  fModuleIndex.at(fCurrentBankIndex).at(slot_id) = fNumberOfModules-1;
649  fCurrentSlot = slot_id;
651  }
652  }
653  else
654  {
655  std::cerr << "QwRaster::RegisterSlotNumber: Slot number "
656  << slot_id << " is larger than the number of slots per ROC, "
657  << kMaxNumberOfModulesPerROC << std::endl;
658  }
659  return fCurrentIndex;
660 }
size_t fCurrentBankIndex
Name of this subsystem (the region).
Definition: QwRaster.h:88
Int_t fCurrentSlot
Definition: QwRaster.h:89
static const UInt_t kMaxNumberOfChannelsPerModule
Definition: QwRaster.h:98
static const UInt_t kMaxNumberOfModulesPerROC
Definition: QwRaster.h:97
std::vector< std::vector< Int_t > > fModuleIndex
Definition: QwRaster.h:101
Int_t fCurrentIndex
Definition: QwRaster.h:90
std::vector< std::vector< std::pair< EQwModuleType, Int_t > > > fModulePtrs
Definition: QwRaster.h:104
Int_t fNumberOfModules
Definition: QwRaster.h:99
std::vector< EQwModuleType > fModuleTypes
Module index, indexed by bank_index and slot_number.
Definition: QwRaster.h:103

+ Here is the caller graph for this function:

Int_t QwRaster::RegisterSubbank ( const UInt_t  bank_id)
protected

Definition at line 621 of file QwRaster.cc.

References fCurrentBankIndex, fModuleIndex, kMaxNumberOfModulesPerROC, and VQwSubsystem::RegisterSubbank().

Referenced by LoadChannelMap().

622 {
623  Int_t stat = VQwSubsystem::RegisterSubbank(bank_id);
625  std::vector<Int_t> tmpvec(kMaxNumberOfModulesPerROC,-1);
626  fModuleIndex.push_back(tmpvec);
627  //std::cout<<"RASTER Register Subbank "<<bank_id<<" with BankIndex "<<fCurrentBankIndex<<std::endl;
628  return stat;
629 }
size_t fCurrentBankIndex
Name of this subsystem (the region).
Definition: QwRaster.h:88
static const UInt_t kMaxNumberOfModulesPerROC
Definition: QwRaster.h:97
std::vector< std::vector< Int_t > > fModuleIndex
Definition: QwRaster.h:101
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...

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwRaster::ReportConfiguration ( )

Definition at line 576 of file QwRaster.cc.

577 {
578  /*std::cout << "Configuration of raster:"<< std::endl;
579  for (size_t i = 0; i<fROC_IDs.size(); i++)
580  {
581  for (size_t j=0; j<fBank_IDs.at(i).size(); j++)
582  {
583 
584  Int_t ind = GetSubbankIndex(fROC_IDs.at(i),fBank_IDs.at(i).at(j));
585  std::cout << "ROC " << fROC_IDs.at(i)
586  << ", subbank 0x" << std::hex<<fBank_IDs.at(i).at(j)<<std::dec
587  << ": subbank index==" << ind << std::endl;
588 
589  for (size_t k=0; k<kMaxNumberOfModulesPerROC; k++)
590  {
591  Int_t QadcTdcindex = GetModuleIndex(ind,k);
592  if (QadcTdcindex != -1)
593  {
594  std::cout << " Slot "<<k<<" Module#"<<QadcTdcindex<< std::endl;
595  }
596  }
597  }
598  }*/
599 
600 }

Field Documentation

UInt_t QwRaster::fBankID[2]
protected

Definition at line 92 of file QwRaster.h.

Referenced by LoadChannelMap(), and ProcessEvBuffer().

Double_t QwRaster::fbpm_3h07a_intercept
private

Definition at line 149 of file QwRaster.h.

Referenced by LoadInputParameters(), and ProcessEvent().

Double_t QwRaster::fbpm_3h07a_pos_x
private

Definition at line 162 of file QwRaster.h.

Referenced by FillHistograms(), FillTreeVector(), and ProcessEvent().

Double_t QwRaster::fbpm_3h07a_pos_y
private

Definition at line 163 of file QwRaster.h.

Referenced by FillHistograms(), FillTreeVector(), and ProcessEvent().

Double_t QwRaster::fbpm_3h07a_slope
private

Definition at line 148 of file QwRaster.h.

Referenced by LoadInputParameters(), and ProcessEvent().

Double_t QwRaster::fbpm_3h07a_xm
private

Definition at line 154 of file QwRaster.h.

Referenced by ProcessEvent().

Double_t QwRaster::fbpm_3h07a_xp
private

Definition at line 153 of file QwRaster.h.

Referenced by ProcessEvent().

Double_t QwRaster::fbpm_3h07a_ym
private

Definition at line 156 of file QwRaster.h.

Referenced by ProcessEvent().

Double_t QwRaster::fbpm_3h07a_yp
private

Definition at line 155 of file QwRaster.h.

Referenced by ProcessEvent().

Double_t QwRaster::fbpm_3h09b_intercept
private

Definition at line 151 of file QwRaster.h.

Referenced by LoadInputParameters(), and ProcessEvent().

Double_t QwRaster::fbpm_3h09b_pos_x
private

Definition at line 164 of file QwRaster.h.

Referenced by FillHistograms(), FillTreeVector(), and ProcessEvent().

Double_t QwRaster::fbpm_3h09b_pos_y
private

Definition at line 165 of file QwRaster.h.

Referenced by FillHistograms(), FillTreeVector(), and ProcessEvent().

Double_t QwRaster::fbpm_3h09b_slope
private

Definition at line 150 of file QwRaster.h.

Referenced by LoadInputParameters(), and ProcessEvent().

Double_t QwRaster::fbpm_3h09b_xm
private

Definition at line 158 of file QwRaster.h.

Referenced by ProcessEvent().

Double_t QwRaster::fbpm_3h09b_xp
private

Definition at line 157 of file QwRaster.h.

Referenced by ProcessEvent().

Double_t QwRaster::fbpm_3h09b_ym
private

Definition at line 160 of file QwRaster.h.

Referenced by ProcessEvent().

Double_t QwRaster::fbpm_3h09b_yp
private

Definition at line 159 of file QwRaster.h.

Referenced by ProcessEvent().

Double_t QwRaster::fCal_Factor_QDC_X
private

Definition at line 142 of file QwRaster.h.

Referenced by LoadInputParameters(), and ProcessEvent().

Double_t QwRaster::fCal_Factor_QDC_Y
private

Definition at line 143 of file QwRaster.h.

Referenced by LoadInputParameters(), and ProcessEvent().

Double_t QwRaster::fChannel_Offset_X
private

Definition at line 140 of file QwRaster.h.

Referenced by LoadInputParameters(), and ProcessEvent().

Double_t QwRaster::fChannel_Offset_Y
private

Definition at line 141 of file QwRaster.h.

Referenced by LoadInputParameters(), and ProcessEvent().

size_t QwRaster::fCurrentBankIndex
protected

Name of this subsystem (the region).

Definition at line 88 of file QwRaster.h.

Referenced by RegisterROCNumber(), RegisterSlotNumber(), and RegisterSubbank().

Int_t QwRaster::fCurrentIndex
protected
Int_t QwRaster::fCurrentSlot
protected

Definition at line 89 of file QwRaster.h.

Referenced by RegisterSlotNumber().

EQwModuleType QwRaster::fCurrentType
protected

Definition at line 80 of file QwRaster.h.

Referenced by LinkChannelToSignal(), LoadChannelMap(), and RegisterModuleType().

Bool_t QwRaster::fDEBUG
protected

Definition at line 81 of file QwRaster.h.

std::vector< std::vector<Int_t> > QwRaster::fModuleIndex
protected
std::vector< std::vector< std::pair< EQwModuleType, Int_t> > > QwRaster::fModulePtrs
protected
std::vector< EQwModuleType > QwRaster::fModuleTypes
protected

Module index, indexed by bank_index and slot_number.

Definition at line 103 of file QwRaster.h.

Referenced by ClearAllBankRegistrations(), RegisterModuleType(), and RegisterSlotNumber().

Int_t QwRaster::fNumberOfModules
protected

Definition at line 99 of file QwRaster.h.

Referenced by ClearAllBankRegistrations(), and RegisterSlotNumber().

Double_t QwRaster::fPositionOffsetX
private

Definition at line 138 of file QwRaster.h.

Referenced by LoadInputParameters(), and ProcessEvent().

Double_t QwRaster::fPositionOffsetY
private

Definition at line 139 of file QwRaster.h.

Referenced by LoadInputParameters(), and ProcessEvent().

Double_t QwRaster::fPositionX_ADC
private

Definition at line 145 of file QwRaster.h.

Referenced by FillHistograms(), FillTreeVector(), and ProcessEvent().

Double_t QwRaster::fPositionY_ADC
private

Definition at line 146 of file QwRaster.h.

Referenced by FillHistograms(), FillTreeVector(), and ProcessEvent().

MQwV775TDC QwRaster::fQDCTDC
protected

Definition at line 83 of file QwRaster.h.

Referenced by ProcessEvBuffer().

TH2D* QwRaster::fRateMap
protected

Definition at line 132 of file QwRaster.h.

Referenced by ConstructHistograms(), and FillHistograms().

TString QwRaster::fRegion
protected

Definition at line 85 of file QwRaster.h.

std::map<TString,size_t> QwRaster::fSCAs_map
protected

Definition at line 110 of file QwRaster.h.

Referenced by LoadChannelMap().

std::vector<Int_t> QwRaster::fSCAs_offset
protected

Definition at line 111 of file QwRaster.h.

Referenced by LoadChannelMap(), and ProcessEvBuffer().

const UInt_t QwRaster::kMaxNumberOfChannelsPerModule = 32
staticprotected

Definition at line 98 of file QwRaster.h.

Referenced by RegisterSlotNumber().

const UInt_t QwRaster::kMaxNumberOfModulesPerROC = 21
staticprotected

Definition at line 97 of file QwRaster.h.

Referenced by RegisterROCNumber(), RegisterSlotNumber(), and RegisterSubbank().


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