QwAnalysis
QwDriftChamberVDC Class Reference

#include <QwDriftChamberVDC.h>

+ Inheritance diagram for QwDriftChamberVDC:
+ Collaboration diagram for QwDriftChamberVDC:

Public Member Functions

 QwDriftChamberVDC (TString name)
 
virtual ~QwDriftChamberVDC ()
 
void SubtractReferenceTimes ()
 
void ProcessEvent ()
 
Int_t LoadChannelMap (TString mapfile)
 Mandatory map file definition. More...
 
void ProcessOptions (QwOptions &options)
 Process the command line options. More...
 
void ReadEvent (TString &)
 
void ClearEventData ()
 
- Public Member Functions inherited from QwDriftChamber
 QwDriftChamber (const TString &region_tmp)
 Constructor with name. More...
 
 QwDriftChamber (const TString &region_tmp, std::vector< QwHit > &fWireHits_TEMP)
 Constructor with name and hit list. More...
 
virtual ~QwDriftChamber ()
 Virtual destructor. More...
 
virtual Int_t LoadInputParameters (TString mapfile)
 Mandatory parameter file definition. More...
 
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...
 
Int_t ProcessConfigurationBuffer (const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
 
void PrintConfigurationBuffer (UInt_t *buffer, UInt_t num_words)
 
void ReportConfiguration ()
 
void FillDriftDistanceToHits ()
 
void FillHardwareErrorSummary ()
 Hardware error summary. More...
 
void GetTDCHitList (QwHitContainer &grandHitContainer)
 
- 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 ConstructBranchAndVector (TTree *tree, TString &prefix, std::vector< Double_t > &values)
 Construct the branch and tree vector. 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...
 
virtual void FillTreeVector (std::vector< Double_t > &values) const
 Fill the tree vector. 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...
 
virtual Int_t LoadEventCuts (TString mapfile)
 Optional event cut file. 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, QwDriftChamberVDC >
virtual ~MQwCloneable ()
 Virtual destructor. More...
 
virtual VQwSubsystemClone () const
 Concrete clone method. More...
 
const VQwFactory< VQwSubsystem > * Factory () const
 Factory getter. More...
 
- Public Member Functions inherited from VQwCloneable< VQwSubsystem >
virtual ~VQwCloneable ()
 Virtual destructor. More...
 
std::string GetClassName () const
 Get demangled name of this class. More...
 

Static Public Member Functions

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

Protected Member Functions

void FillRawTDCWord (Int_t bank_index, Int_t slot_num, Int_t chan, UInt_t data)
 
Int_t AddChannelDefinition ()
 
Int_t BuildWireDataStructure (const UInt_t chan, const EQwDetectorPackage package, const Int_t octant, const Int_t plane, const Int_t wire)
 
Double_t CalculateDriftDistance (Double_t drifttime, QwDetectorID detector)
 
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...
 
Int_t LoadTimeWireOffset (TString t0_map)
 
void LoadTtoDParameters (TString ttod_map)
 
void SubtractWireTimeOffset ()
 
void UpdateHits ()
 
void GetHitList (QwHitContainer &grandHitContainer)
 Get the hit list. More...
 
- Protected Member Functions inherited from QwDriftChamber
Int_t LinkReferenceChannel (const UInt_t chan, const Int_t plane, const Int_t wire)
 
void ClearAllBankRegistrations ()
 
Int_t RegisterROCNumber (const UInt_t roc_id, const UInt_t bank_id)
 Tell the object that it will decode data from this ROC and sub-bank. More...
 
Int_t RegisterSubbank (const UInt_t bank_id)
 
Int_t RegisterSlotNumber (const UInt_t slot_id)
 
Int_t GetTDCIndex (size_t bank_index, size_t slot_num) const
 
Bool_t IsSlotRegistered (Int_t bank_index, Int_t slot_num) const
 
void InitHistogramPointers ()
 
- 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...
 
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

Bool_t fUseTDCHits
 
Bool_t fDisableWireTimeOffset
 
Int_t fR3Octant
 
std::vector< std::vector
< QwDelayLine > > 
fDelayLineArray
 
std::vector< std::vector
< QwDelayLineID > > 
fDelayLinePtrs
 
std::vector< QwHitfWireHitsVDC
 
std::vector< std::vector
< std::vector< Double_t > > > 
fTimeWireOffsets
 
std::vector< Double_t > fTtoDNumbers
 
- Protected Attributes inherited from QwDriftChamber
TString fRegion
 
size_t fCurrentBankIndex
 Name of this subsystem (the region). More...
 
Int_t fCurrentSlot
 
Int_t fCurrentTDCIndex
 
UInt_t kMaxNumberOfChannelsPerTDC
 
Int_t fNumberOfTDCs
 
std::vector< std::vector< Int_t > > fTDC_Index
 
std::vector< std::pair< Int_t,
Int_t > > 
fReferenceChannels
 
std::vector< std::vector
< Double_t > > 
fReferenceData
 
std::vector< std::vector
< Double_t > > 
fReferenceMaster
 
std::vector< QwHitfTDCHits
 
std::vector< QwHit > & fWireHits
 
std::vector< Int_t > fWiresPerPlane
 
MQwF1TDC fF1TDCDecoder
 
QwF1TDContainerfF1TDContainer
 
F1TDCReferenceContainerfF1RefContainer
 
std::vector< TH1F * > TotHits
 
std::vector< TH1F * > TOFP
 
std::vector< TH1F * > TOFP_raw
 
std::vector< TH1F * > WiresHit
 
std::vector< TH2F * > TOFW
 
std::vector< TH2F * > TOFW_raw
 
std::vector< TH2F * > HitsWire
 
std::vector< std::vector
< QwDetectorID > > 
fTDCPtrs
 
std::vector< std::vector
< QwDetectorInfo > > 
fWireData
 
std::vector< std::vector
< UInt_t > > 
fDirectionData
 
- 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 kBackPlaneNum =16
 
static const UInt_t kLineNum =8
 
- Static Protected Attributes inherited from QwDriftChamber
static bool fPrintF1TDCConfiguration = true
 
static const UInt_t kMaxNumberOfSlotsPerROC = 21
 
static const Int_t kReferenceChannelPlaneNumber = 99
 
static const Int_t kCodaMasterPlaneNumber = 98
 

Detailed Description

Definition at line 22 of file QwDriftChamberVDC.h.

Constructor & Destructor Documentation

QwDriftChamberVDC::QwDriftChamberVDC ( TString  name)

Definition at line 27 of file QwDriftChamberVDC.cc.

References fDelayLineArray, fDelayLinePtrs, kBackPlaneNum, and kLineNum.

27  :
29 {
30  std::vector<QwDelayLine> temp;
31  temp.clear();
32  temp.resize ( kLineNum );
33  fDelayLineArray.resize ( kBackPlaneNum, temp );
34  fDelayLinePtrs.resize ( 21 );
35 }
static const UInt_t kLineNum
static const UInt_t kBackPlaneNum
std::vector< std::vector< QwDelayLine > > fDelayLineArray
QwDriftChamber()
Private default constructor (not implemented, will throw linker error on use)
std::vector< std::vector< QwDelayLineID > > fDelayLinePtrs
std::vector< QwHit > fWireHitsVDC
virtual QwDriftChamberVDC::~QwDriftChamberVDC ( )
inlinevirtual

Definition at line 30 of file QwDriftChamberVDC.h.

30 { };

Member Function Documentation

Int_t QwDriftChamberVDC::AddChannelDefinition ( )
protectedvirtual

Implements QwDriftChamber.

Definition at line 443 of file QwDriftChamberVDC.cc.

References QwDriftChamber::fTDC_Index, QwDriftChamber::fTDCPtrs, QwDriftChamber::fWireData, QwDriftChamber::fWiresPerPlane, QwDriftChamber::kCodaMasterPlaneNumber, QwDriftChamber::kReferenceChannelPlaneNumber, and OK.

Referenced by LoadChannelMap().

444 {
445  bool temp_local_debug = false;
446  // if (temp_local_debug){
447  // std::cout << " QwDriftChamberVDC::AddChannelDefinition"<<std::endl;
448  // std::cout << "plane " << plane << " wire " << wire << std::endl;
449  // }
450 
451  std::size_t i =0;
452 
453  fWireData.resize ( fWiresPerPlane.size() );
454  for ( i=1; i<fWiresPerPlane.size(); i++ )
455  {
456  if ( temp_local_debug )
457  {
458  std::cout << "wire #" << i
459  << " " << fWiresPerPlane.at ( i )
460  << std::endl;
461  }
462  fWireData.at ( i ).resize ( fWiresPerPlane.at ( i ) );
463  }
464 
465  Int_t mytdc = 0;
466  for ( i=0; i<fTDC_Index.size(); i++ )
467  {
468  for ( size_t j=0; j<fTDC_Index.at ( i ).size(); j++ )
469  {
470  mytdc = fTDC_Index.at ( i ).at ( j );
471  if ( mytdc not_eq -1 )
472  {
473  for ( size_t k=0; k<fTDCPtrs.at ( mytdc ).size(); k++ )
474  {
475  Int_t package = fTDCPtrs.at ( mytdc ).at ( k ).fPackage;
476  Int_t plane = fTDCPtrs.at ( mytdc ).at ( k ).fPlane;
477  if ( ( plane>0 ) and ( plane not_eq ( Int_t ) kReferenceChannelPlaneNumber ) and ( plane not_eq ( Int_t ) kCodaMasterPlaneNumber) )
478  {
479  Int_t wire = fTDCPtrs.at ( mytdc ).at ( k ).fElement;
480  Int_t window_number=0;
481  if ( wire<9 ) window_number=18;
482  else if ( wire==152 ) window_number=16;
483  else window_number=17;
484  for ( Int_t index=0;index<window_number;index++ )
485  {
486 
487  fWireData.at ( 4* ( package-1 ) +plane ).at ( wire-1 ).SetElectronics ( i,j,k );
488  wire+=8;
489  if ( temp_local_debug )
490  {
491  std::cout << "mytdc " << mytdc
492  << "wire #" << wire
493  << " plane " << plane
494  << " (i j k) (" << i <<" " << j << " "<< k << ")"
495  << std::endl;
496  }
497  }
498  }
499  }
500  }
501  }
502  }
503  // std::cout << " QwDriftChamberVDC::AddChannelDefinition END"<<std::endl;
504  return OK;
505 }
std::vector< std::vector< Int_t > > fTDC_Index
static const Int_t kCodaMasterPlaneNumber
std::vector< std::vector< QwDetectorID > > fTDCPtrs
#define OK
static const Int_t kReferenceChannelPlaneNumber
std::vector< Int_t > fWiresPerPlane
std::vector< std::vector< QwDetectorInfo > > fWireData

+ Here is the caller graph for this function:

Int_t QwDriftChamberVDC::BuildWireDataStructure ( const UInt_t  chan,
const EQwDetectorPackage  package,
const Int_t  octant,
const Int_t  plane,
const Int_t  wire 
)
protectedvirtual

Implements QwDriftChamber.

Definition at line 397 of file QwDriftChamberVDC.cc.

References QwDriftChamber::fCurrentTDCIndex, QwDriftChamber::fTDCPtrs, QwDriftChamber::fWiresPerPlane, and OK.

Referenced by LoadChannelMap().

402 {
403 
404  Int_t r3_wire_number_per_plane = 279;
405 
406 
407  // We should not see when plane is equal to "kReferenceChannelPlaneNumber"
408  //, because in LocalChannelMap, we assigned "reference channels" already into whatever objects.
409  // And Since it is the same structure as HDC, but R3 uses its own method to select the refernece signals,
410  // which I want to undestand how and why soon, all if conditions are invaild for Region 3.
411  // Wednesday, February 8 10:51:20 EST 2012, jhlee
412 
413  // if ( plane == kReferenceChannelPlaneNumber )
414  // {
415  // printf("Can we See this?t\n");
416  // LinkReferenceChannel ( chan, plane, wire );
417  // }
418  // else
419  // {
420  fTDCPtrs.at ( fCurrentTDCIndex ).at ( chan ).fOctant = octant;
421  fTDCPtrs.at ( fCurrentTDCIndex ).at ( chan ).fPackage = package;
422  fTDCPtrs.at ( fCurrentTDCIndex ).at ( chan ).fPlane = plane;
423  fTDCPtrs.at ( fCurrentTDCIndex ).at ( chan ).fElement = wire;
424 
425  Int_t real_size = 0;
426  real_size = 4 * ( ( Int_t ) package-1 ) +plane;
427  if ( real_size >= ( Int_t ) fWiresPerPlane.size() ) // plane is Int_t
428  {
429  fWiresPerPlane.resize ( real_size + 1 );
430  // size() is one more larger than last plane number
431  // For VDC, plane 1,2,....,8
432  // vector 0,1,2,....,8
433  // thus, vector.size() returns 9
434  // So the magic number "1" is.
435  // Wednesday, July 28 21:58:13 EDT 2010, jhlee
436  }
437  fWiresPerPlane.at ( real_size ) = r3_wire_number_per_plane;
438  // }
439  return OK;
440 }
std::vector< std::vector< QwDetectorID > > fTDCPtrs
#define OK
std::vector< Int_t > fWiresPerPlane

+ Here is the caller graph for this function:

Double_t QwDriftChamberVDC::CalculateDriftDistance ( Double_t  drifttime,
QwDetectorID  detector 
)
protectedvirtual

Implements QwDriftChamber.

Definition at line 276 of file QwDriftChamberVDC.cc.

References fTtoDNumbers.

277 {
278  // Double_t angle_degree = 45.0;
279  Double_t distance_mm = 0.0;
280  Double_t distance_cm = 0.0;
281  Double_t dt = drifttime;
282  Double_t resolution = 0.5; //resolution is 0.5ns
283 
284  Int_t index = (Int_t) (dt/resolution);
285 
286  Int_t maximum_allowed_drifttime_by_john = 310;
287  Int_t minimum_allowed_drifttime_by_john = 0;
288 
289  if(dt >= minimum_allowed_drifttime_by_john && dt < maximum_allowed_drifttime_by_john) {
290  distance_mm = ( dt-resolution*index ) / resolution * ( fTtoDNumbers.at ( index+1 )-fTtoDNumbers.at ( index ) ) + fTtoDNumbers.at ( index );
291  }
292  else {
293  distance_mm=-50;
294  }
295  distance_cm = 0.1*distance_mm;
296 
297  return distance_cm;
298 }
std::vector< Double_t > fTtoDNumbers
void QwDriftChamberVDC::ClearEventData ( )
virtual

Implements QwDriftChamber.

Definition at line 866 of file QwDriftChamberVDC.cc.

References F1TDCReferenceContainer::ClearEventData(), fDelayLineArray, QwDriftChamber::fF1RefContainer, QwDriftChamber::fReferenceData, QwDriftChamber::fReferenceMaster, QwDriftChamber::fTDCHits, QwDriftChamber::fWireHits, and VQwSubsystem::SetDataLoaded().

867 {
868  SetDataLoaded ( kFALSE );
869 
870  fTDCHits.clear();
871  fWireHits.clear();
872 
873  std::size_t index = 0;
874  std::size_t j = 0;
875  std::size_t i = 0;
876 
877  for ( i=0;i<fDelayLineArray.size();i++ )
878  {
879  index = fDelayLineArray.at ( i ).size();
880 
881  for ( j=0;j<index;j++ )
882  {
883  fDelayLineArray.at ( i ).at ( j ).Processed=kFALSE;
884  fDelayLineArray.at ( i ).at ( j ).LeftHits.clear();
885  fDelayLineArray.at ( i ).at ( j ).RightHits.clear();
886  fDelayLineArray.at ( i ).at ( j ).Hitscount.clear();
887  fDelayLineArray.at ( i ).at ( j ).Wire.clear();
888  }
889  }
890 
892 
893  for ( i=0;i<fReferenceData.size(); i++ )
894  {
895  fReferenceData.at ( i ).clear();
896  }
897  for( i=0;i<fReferenceMaster.size();i++)
898  fReferenceMaster.at(i).clear();
899  return;
900 }
std::vector< std::vector< Double_t > > fReferenceMaster
std::vector< std::vector< QwDelayLine > > fDelayLineArray
std::vector< std::vector< Double_t > > fReferenceData
std::vector< QwHit > & fWireHits
std::vector< QwHit > fTDCHits
F1TDCReferenceContainer * fF1RefContainer
void SetDataLoaded(Bool_t flag)
Definition: VQwSubsystem.h:305

+ Here is the call graph for this function:

void QwDriftChamberVDC::ConstructHistograms ( TDirectory *  folder,
TString &  prefix 
)
protectedvirtual

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

Implements QwDriftChamber.

Definition at line 926 of file QwDriftChamberVDC.cc.

References QwDriftChamber::fWiresPerPlane, VQwSubsystem::GetSubsystemName(), QwDriftChamber::HitsWire, QwDriftChamber::TOFP, QwDriftChamber::TOFP_raw, QwDriftChamber::TOFW, QwDriftChamber::TOFW_raw, QwDriftChamber::TotHits, and QwDriftChamber::WiresHit.

927 {
928  // If we have defined a subdirectory in the ROOT file, then change into it.
929  if ( folder ) folder->cd();
930  // Now create the histograms...
931  TString region = GetSubsystemName();
932  // Loop over the number of planes.
933 
934  const Short_t buffer_size = 2000;
935  Float_t bin_offset = -0.5;
936 
937  std::size_t total_plane_number = 0;
938  total_plane_number = fWiresPerPlane.size();
939 
940  TotHits.resize ( total_plane_number );
941  TOFP.resize ( total_plane_number );
942  TOFP_raw.resize ( total_plane_number );
943  WiresHit.resize ( total_plane_number );
944  TOFW.resize ( total_plane_number );
945  TOFW_raw.resize ( total_plane_number );
946  HitsWire.resize ( total_plane_number );
947 
948  std::size_t iplane = 0;
949  // std::cout << "QwDriftChamberVDC::ConstructHistograms, "
950  // << "we are contructing histograms with index from 0 to " <<total_plane_number
951  // << "\n"
952  // << "Thus, fWiresPerPlane.size() returns "
953  // << total_plane_number
954  // << " and its array definition is ["
955  // << total_plane_number
956  // << "]."
957  // << " And hist[i] <-> hist.at(i) <-> fWiresPerplane[i] <-> fWiresPerPlane.at(i)"
958  // << std::endl;
959 
960  // wire_per_plane is the number of wire per plane?
961  //
962  // we skip the first zero-th plane or wire histogram. thus
963  // i starts with '1'. hist[0] is NULL
964 
965  for ( iplane=1; iplane< total_plane_number; iplane++ )
966  {
967  // std::cout << "QwDriftChamberVDC iplane" << iplane << std::endl;
968  // push_back can "push" iplane = 1 into TotHits.at(0) ??
969  TotHits[iplane] = new TH1F (
970  Form ( "%s%sWiresPlane%zu", prefix.Data(), region.Data(), iplane ),
971  Form ( "Total hits on all wires in plane %zu", iplane ),
972  fWiresPerPlane[iplane], bin_offset, fWiresPerPlane[iplane]+bin_offset
973  );
974 
975  TotHits[iplane]->GetXaxis()->SetTitle ( "Wire #" );
976  TotHits[iplane]->GetYaxis()->SetTitle ( "Events" );
977 
978  WiresHit[iplane] = new TH1F (
979  Form ( "%s%sNumberHitsPlane%zu", prefix.Data(), region.Data(), iplane ),
980  Form ( "Number of Wires Hit in plane %zu",iplane ),
981  20, bin_offset, 20+bin_offset
982  );
983  WiresHit[iplane]->GetXaxis()->SetTitle ( "Wires Hit per Event" );
984  WiresHit[iplane]->GetYaxis()->SetTitle ( "Events" );
985 
986  HitsWire[iplane] = new TH2F (
987  Form ( "%s%sNumberHitsVsWirePlane%zu", prefix.Data(), region.Data(), iplane ),
988  Form ( "hits on all wires per event in plane %zu", iplane ),
989  fWiresPerPlane[iplane],bin_offset,fWiresPerPlane[iplane]+bin_offset,
990  7, -bin_offset, 7-bin_offset
991  );
992  HitsWire[iplane]->GetXaxis()->SetTitle ( "Wire Number" );
993  HitsWire[iplane]->GetYaxis()->SetTitle ( "Hits" );
994 
995  TOFP[iplane] = new TH1F (
996  Form ( "%s%sTimePlane%zu", prefix.Data(), region.Data(), iplane ),
997  Form ( "Subtracted time of flight for events in plane %zu", iplane ),
998  310,0,0
999  );
1000  TOFP[iplane] -> SetDefaultBufferSize ( buffer_size );
1001  TOFP[iplane] -> GetXaxis()->SetTitle ( "Time of Flight" );
1002  TOFP[iplane] -> GetYaxis()->SetTitle ( "Hits" );
1003 
1004 
1005  TOFP_raw[iplane] = new TH1F (
1006  Form ( "%s%sRawTimePlane%zu", prefix.Data(), region.Data(), iplane ),
1007  Form ( "Raw time of flight for events in plane %zu", iplane ),
1008  // 400,-65000,65000);
1009  310, 0,0
1010  );
1011  TOFP_raw[iplane] -> SetDefaultBufferSize ( buffer_size );
1012  TOFP_raw[iplane]->GetXaxis()->SetTitle ( "Time of Flight" );
1013  TOFP_raw[iplane]->GetYaxis()->SetTitle ( "Hits" );
1014 
1015  TOFW[iplane] = new TH2F (
1016  Form ( "%s%sTimeVsWirePlane%zu", prefix.Data(), region.Data(), iplane ),
1017  Form ( "Subtracted time of flight for each wire in plane %zu", iplane ),
1018  fWiresPerPlane[iplane], bin_offset, fWiresPerPlane[iplane]+bin_offset,
1019  100,-2000,2000
1020  );
1021  // why this range is not -65000 ??
1022  TOFW[iplane]->GetXaxis()->SetTitle ( "Wire Number" );
1023  TOFW[iplane]->GetYaxis()->SetTitle ( "Time of Flight" );
1024 
1025  TOFW_raw[iplane] = new TH2F (
1026  Form ( "%s%sRawTimeofFlightperWirePlane%zu", prefix.Data() ,region.Data(),iplane ),
1027  Form ( "Raw time of flight for each wire in plane %zu",iplane ),
1028  fWiresPerPlane[iplane], bin_offset, fWiresPerPlane[iplane]+bin_offset,
1029  100,-40000,65000
1030  );
1031  // why this range is not -65000 ??
1032  TOFW_raw[iplane]->GetXaxis()->SetTitle ( "Wire Number" );
1033  TOFW_raw[iplane]->GetYaxis()->SetTitle ( "Time of Flight" );
1034  }
1035  return;
1036 }
std::vector< TH1F * > TOFP
std::vector< TH1F * > WiresHit
std::vector< TH2F * > HitsWire
std::vector< TH2F * > TOFW_raw
std::vector< TH2F * > TOFW
std::vector< TH1F * > TOFP_raw
std::vector< TH1F * > TotHits
std::vector< Int_t > fWiresPerPlane
TString GetSubsystemName() const
Definition: VQwSubsystem.h:93

+ Here is the call graph for this function:

void QwDriftChamberVDC::DefineOptions ( QwOptions options)
static

Definition at line 905 of file QwDriftChamberVDC.cc.

References QwOptions::AddOptions(), and default_bool_value.

906 {
907  options.AddOptions("Tracking options") ( "use-tdchit",
908  po::value<bool>()->default_bool_value(false),
909  "create TDC-based tree" );
910  options.AddOptions("Tracking options") ( "disable-wireoffset",
911  po::value<bool>()->default_bool_value(false),
912  "disable subtraction of t0 for every wire" );
913  options.AddOptions("Tracking options") ("R3-octant",
914  po::value<int>()->default_value(1),
915  "MD Package 2 of R3 is in front of" );
916 }
#define default_bool_value(b)
Definition: QwOptions.h:51
po::options_description_easy_init AddOptions(const std::string &blockname="Specialized options")
Add an option to a named block or create new block.
Definition: QwOptions.h:164

+ Here is the call graph for this function:

void QwDriftChamberVDC::FillHistograms ( )
protectedvirtual

Fill the histograms for this subsystem.

Implements QwDriftChamber.

Definition at line 1040 of file QwDriftChamberVDC.cc.

References QwDetectorInfo::ClearHits(), QwLog::endl(), QwDetectorID::fElement, QwDetectorID::fPlane, QwDriftChamber::fTDCHits, QwDriftChamber::fWireData, QwDriftChamber::fWireHits, QwDriftChamber::fWiresPerPlane, QwDetectorInfo::GetNumHits(), VQwSubsystem::HasDataLoaded(), QwDriftChamber::HitsWire, QwMessage, QwDriftChamber::TOFP, QwDriftChamber::TOFP_raw, QwDriftChamber::TOFW, QwDriftChamber::TOFW_raw, QwDriftChamber::TotHits, and QwDriftChamber::WiresHit.

1041 {
1042 
1043  Bool_t local_debug = false;
1044  if ( not HasDataLoaded() ) return;
1045 
1046  QwDetectorID this_detid;
1047  QwDetectorInfo *this_det;
1048 
1049  std::vector<Int_t> wireshitperplane ( fWiresPerPlane.size(),0 );
1050 
1051  UInt_t raw_time = 0;
1052  Double_t time = 0.0;
1053 
1054  Int_t plane = 0;
1055  Int_t element = 0;
1056  EQwDetectorPackage package = kPackage1; // this is weird.....
1057 
1058  Int_t plane_index = 0;
1059 
1060  std::vector<QwHit>::iterator end=fTDCHits.end();
1061  for ( std::vector<QwHit>::iterator hit=fTDCHits.begin(); hit!=end; hit++ )
1062  {
1063 
1064  this_detid = hit->GetDetectorID();
1065  plane = this_detid.fPlane;
1066  element = this_detid.fElement;
1067  // package = //kthis_detid.fPackage;
1068 
1069  // I guess, plane_index is calculated from kPackageUp instead of kPackageUp and kPackageDown
1070  // See the FillRawTDCWordtop
1071  plane_index = 4* ( ( Int_t ) package -1 ) + plane;
1072 
1073  if ( plane<=0 or element<=0 )
1074  {
1075  if ( local_debug )
1076  {
1077  QwMessage << "QwDriftChamberVDC::FillHistograms: Bad plane or element index:"
1078  << " fPlane = " << plane
1079  << " fElement= " << element
1080  << QwLog::endl;
1081  }
1082  continue;
1083  }
1084 
1085  raw_time = hit->GetRawTime();
1086  time = hit->GetTimeNs();
1087 
1088  // Fill ToF histograms
1089  TOFP_raw[plane_index]->Fill ( raw_time );
1090  TOFW_raw[plane_index]->Fill ( element, raw_time );
1091 
1092 
1093  if ( local_debug )
1094  {
1095  QwMessage << " QwDriftChamberVDC::FillHistograms() plane " << plane
1096  << " element " << element
1097  << " package " << package
1098  << " plane_index " << plane_index
1099  << QwLog::endl;
1100  }
1101  }
1102 
1103  end=fWireHits.end();
1104  for ( std::vector<QwHit>::iterator hit1=fWireHits.begin(); hit1!=end; hit1++ )
1105  {
1106 
1107  this_detid = hit1->GetDetectorID();
1108  plane = this_detid.fPlane;
1109  element = this_detid.fElement;
1110  package = this_detid.fPackage;
1111 
1112  if ( plane<=0 or element<=0 )
1113  {
1114  if ( local_debug )
1115  {
1116  QwMessage << "QwDriftChamberVDC::FillHistograms: Bad plane or element index:"
1117  << " fPlane = " << plane
1118  << " fElement= " << element
1119  << QwLog::endl;
1120  }
1121  continue;
1122  }
1123 
1124  plane_index = 4* ( ( Int_t ) package -1 ) + plane;
1125  this_det = & ( fWireData.at ( plane_index ).at ( element-1 ) );
1126 
1127 
1128  if ( hit1->IsFirstDetectorHit() )
1129  {
1130  // If this is the first hit for this detector, then let's plot the
1131  // total number of hits this wire had.
1132  // std::cout << "this_det->GetNumHits: " << this_det->GetNumHits() << std::endl;
1133  HitsWire[plane_index]->Fill ( element,this_det->GetNumHits() );
1134 
1135  // // // Also increment the total number of events in whichthis wire was hit.
1136  TotHits[plane_index]->Fill ( element,1 );
1137  // Increment the number of wires hit in this plane
1138  wireshitperplane.at ( plane_index ) += 1;
1139  }
1140  // Fill ToF histograms
1141 
1142  time = hit1->GetTimeNs();
1143 
1144  TOFP[plane_index]->Fill ( time );
1145  TOFW[plane_index]->Fill ( element,time );
1146  this_det->ClearHits();
1147 
1148 
1149  }
1150 
1151  std::size_t iplane = 0;
1152 
1153  for ( iplane=1; iplane<fWiresPerPlane.size(); iplane++ )
1154  {
1155  WiresHit[iplane]->Fill ( wireshitperplane[iplane] );
1156  }
1157  return;
1158 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
std::vector< TH1F * > TOFP
std::vector< TH1F * > WiresHit
std::vector< TH2F * > HitsWire
std::vector< TH2F * > TOFW_raw
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
std::vector< TH2F * > TOFW
EQwDetectorPackage
Definition: QwTypes.h:70
std::vector< TH1F * > TOFP_raw
Int_t fElement
trace number for R1; wire number for R2 &amp; R3; PMT number for others
Definition: QwTypes.h:253
Int_t fPlane
R or theta index for R1; plane index for R2 &amp; R3.
Definition: QwTypes.h:251
std::vector< TH1F * > TotHits
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
std::vector< QwHit > & fWireHits
std::vector< QwHit > fTDCHits
std::vector< Int_t > fWiresPerPlane
std::vector< std::vector< QwDetectorInfo > > fWireData

+ Here is the call graph for this function:

void QwDriftChamberVDC::FillRawTDCWord ( Int_t  bank_index,
Int_t  slot_num,
Int_t  chan,
UInt_t  data 
)
protectedvirtual
Todo:
Should this direction be properly initialized by fTDCPtrs.at(tdcindex).at(chan).fDirection ?

Implements QwDriftChamber.

Definition at line 301 of file QwDriftChamberVDC.cc.

References fDelayLinePtrs, QwDriftChamber::fF1RefContainer, QwDriftChamber::fReferenceData, QwDriftChamber::fReferenceMaster, QwDriftChamber::fTDCHits, QwDriftChamber::fTDCPtrs, QwDriftChamber::GetTDCIndex(), QwDriftChamber::kCodaMasterPlaneNumber, kDirectionNull, QwDriftChamber::kReferenceChannelPlaneNumber, kRegionID3, F1TDCReferenceContainer::SetReferenceSignal(), and QwHit::WireMatches().

302 {
303  Bool_t local_debug = false;
304 
305  if (local_debug) printf("\n");
306  Int_t tdcindex = 0;
307  tdcindex = GetTDCIndex ( bank_index,slot_num );
308  if ( tdcindex not_eq -1 )
309  {
310  Int_t hitCount = 1;
311 
312  /// \todo Should this direction be properly initialized by fTDCPtrs.at(tdcindex).at(chan).fDirection ?
313  EQwDirectionID direction = kDirectionNull;
314 
315  fF1RefContainer->SetReferenceSignal(bank_index, slot_num, chan, data, false);
316 
317  Int_t octant = fTDCPtrs.at(tdcindex).at(chan).fOctant;
318  Int_t plane = fTDCPtrs.at(tdcindex).at(chan).fPlane;
319  Int_t wire = fTDCPtrs.at(tdcindex).at(chan).fElement;
320 
321  // And this below line was missing.
322  EQwDetectorPackage package = fTDCPtrs.at(tdcindex).at(chan).fPackage;
323  // But I did the correct way to assign the correct package in fTDCPtrs
324  // *** Break *** segmentation violation
325  // due to FillHistograms()
326  // I guess, plane_index is calculated from kPackageUp instead of kPackageUp and kPackageDown
327  // In here I use kPackageNull as an initial value,
328  // and save the correct package number in fTDCPtrs in order to use
329  // the correct reference time according to package number,
330  // and use kpackageUp instead of access fPackage in fTDCPtrs in FillHistograms.
331  // Monday, February 13 14:27:50 EST 2012, jhlee
332 
333 
334 
335  if ( plane == -1 or wire == -1 )
336  {
337  // This channel is not connected to anything. Do nothing.
338  }
339  else if ( plane == kReferenceChannelPlaneNumber )
340  {
341  if (local_debug) {
342  std::cout << " -------------------------"
343  << " plane " << plane
344  << " slot " << slot_num
345  << " wire " << wire
346  << " data " << data
347  << std::endl;
348  }
349 
350  fReferenceData.at ( wire ).push_back ( data );
351  }
352  else if ( plane == kCodaMasterPlaneNumber )
353  {
354  if (local_debug) {
355  std::cout << " -------------------------" << " plane " << plane
356  << " slot " << slot_num
357  << " wire " << wire
358  << " data " << data
359  << std::endl;
360  }
361  fReferenceMaster.at ( wire ).push_back ( data );
362  }
363  else
364  {
365  plane=fDelayLinePtrs.at ( slot_num ).at ( chan ).fBackPlane;
366  //std::cout<<"At QwDriftChamberVDC::FillRawTDCWord_1"<<endl;
367  hitCount = std::count_if ( fTDCHits.begin(), fTDCHits.end(),
368  boost::bind (
369  &QwHit::WireMatches,_1, kRegionID3, boost::ref ( package ), boost::ref ( plane ), boost::ref ( wire )
370  )
371  );
372 
373  fTDCHits.push_back (
374  QwHit (
375  bank_index,
376  slot_num,
377  chan,
378  hitCount,
379  kRegionID3,
380  package,
381  octant,
382  plane,
383  direction,
384  wire,
385  data
386  )
387  );
388  //in order-> bank index, slot num, chan, hitcount, region=3, package, plane,,direction, wire,wire hit time
389 
390  }
391 
392  }
393 }
std::vector< std::vector< Double_t > > fReferenceMaster
static const Int_t kCodaMasterPlaneNumber
EQwDetectorPackage
Definition: QwTypes.h:70
std::vector< std::vector< QwDetectorID > > fTDCPtrs
void SetReferenceSignal(Int_t bank_index, Int_t slot, Int_t chan, UInt_t data, Bool_t debug=false)
Bool_t WireMatches(EQwRegionID region, EQwDetectorPackage package, Int_t plane, Int_t wire)
Definition: QwHit.cc:357
std::vector< std::vector< QwDelayLineID > > fDelayLinePtrs
std::vector< std::vector< Double_t > > fReferenceData
Int_t GetTDCIndex(size_t bank_index, size_t slot_num) const
EQwDirectionID
Definition: QwTypes.h:41
static const Int_t kReferenceChannelPlaneNumber
Hit structure uniquely defining each hit.
Definition: QwHit.h:43
std::vector< QwHit > fTDCHits
F1TDCReferenceContainer * fF1RefContainer

+ Here is the call graph for this function:

void QwDriftChamberVDC::GetHitList ( QwHitContainer grandHitContainer)
inlineprotectedvirtual

Get the hit list.

Reimplemented from QwDriftChamber.

Definition at line 76 of file QwDriftChamberVDC.h.

References QwHitContainer::Append(), QwDriftChamber::fTDCHits, fUseTDCHits, and QwDriftChamber::fWireHits.

77  {
78  if(fUseTDCHits) grandHitContainer.Append(fTDCHits);
79  else grandHitContainer.Append(fWireHits);
80  };
std::vector< QwHit > & fWireHits
std::vector< QwHit > fTDCHits
void Append(const QwHitContainer &mylist)

+ Here is the call graph for this function:

Int_t QwDriftChamberVDC::LoadChannelMap ( TString  mapfile)
virtual

Mandatory map file definition.

Implements VQwSubsystem.

Definition at line 641 of file QwDriftChamberVDC.cc.

References AddChannelDefinition(), BuildWireDataStructure(), QwDriftChamber::fCurrentBankIndex, QwDriftChamber::fCurrentSlot, fDelayLineArray, fDelayLinePtrs, VQwSubsystem::fDetectorMaps, QwDriftChamber::fF1RefContainer, fR3Octant, QwParameterFile::GetUInt(), QwOptions::GetValue(), gQwOptions, QwDriftChamber::kCodaMasterPlaneNumber, kDirectionNull, kDirectionU, kDirectionV, QwDriftChamber::kReferenceChannelPlaneNumber, QwDriftChamber::LinkReferenceChannel(), LoadTimeWireOffset(), LoadTtoDParameters(), OK, QwDriftChamber::RegisterROCNumber(), QwDriftChamber::RegisterSlotNumber(), and QwDriftChamber::RegisterSubbank().

642 {
643  //some type(like string,Int_t)need to be changed to root type
644  LoadTimeWireOffset ( "R3_timeoffset.map" );
645  LoadTtoDParameters ( "R3_TtoDTable.map" );
646  TString varname,varvalue;
647  UInt_t value = 0;
648  UInt_t channum = 0; //store temporary channel number
649  UInt_t lnnum = 0; //store line number
650  Int_t bpnum = 0; // temp backplane
651  UInt_t plnum,firstwire,LR; //store temp package,plane,firstwire and left or right information
652 
653  TString name = "";
654 
655  plnum = firstwire = LR = 0;
656 
657  TString pknum,dir;
658  Bool_t IsFirstChannel = kTRUE;
659 
660  std::vector<Double_t> tmpWindows;
661  QwParameterFile mapstr ( mapfile.Data() );
662  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
663  EQwDirectionID direction = kDirectionNull;
664 
665  std::string string_a;
666  std::pair<Double_t,Double_t> pair_a;
667 
668  Int_t extra_reference_channel_number_for_R3 = 97;
669 
670  while ( mapstr.ReadNextLine() )
671  {
672  mapstr.TrimComment ( '!' );
673  mapstr.TrimWhitespace();
674  if ( mapstr.LineIsEmpty() ) continue;
675 
676  if ( mapstr.HasVariablePair ( "=",varname,varvalue ) ) //to judge whether we find a new slot
677  {
678  varname.ToLower();
679  value = QwParameterFile::GetUInt ( varvalue );
680  if ( value ==0 )
681  {
682  value = atol ( varvalue.Data() );
683  }
684  if ( varname == "roc" )
685  {
686  RegisterROCNumber ( value , 0 );
687  }
688  else if ( varname=="bank" )
689  {
690  RegisterSubbank ( value );
691  }
692  else if ( varname == "slot" )
693  {
694  RegisterSlotNumber ( value );
695  }
696  continue; //go to the next line
697  }
698 
699  channum = mapstr.GetTypedNextToken<Int_t>();
700  bpnum = mapstr.GetTypedNextToken<Int_t>();
701  name = mapstr.GetTypedNextToken<TString>();
702 
703 
704 
705  if ( bpnum == kReferenceChannelPlaneNumber || bpnum == kCodaMasterPlaneNumber || bpnum == extra_reference_channel_number_for_R3) {
706 
707  fF1RefContainer -> AddF1TDCReferenceSignal(new F1TDCReferenceSignal(fCurrentBankIndex, fCurrentSlot, channum, name));
708  //
709  // old map uses 0, so simply set lnnum = 0
710  //
711  if ( bpnum != extra_reference_channel_number_for_R3 ) {
712  lnnum = 0;
713  LinkReferenceChannel ( channum, bpnum, lnnum);
714  }
715  continue;
716  }
717 
718  //
719  // read third one as string, so it must be converted to integer
720  // out of Reference channels
721  //
722 
723  lnnum = name.Atoi();
724 
725  if ( channum ==0 and bpnum ==0 )
726  {
727  if ( IsFirstChannel == kTRUE ) IsFirstChannel = kFALSE;
728  else continue;
729  }
730 
731 
732  LR = mapstr.GetTypedNextToken<Int_t>();
733 
734  fDelayLinePtrs.at ( value ).push_back ( QwDelayLineID ( bpnum,lnnum,LR ) ); //the slot and channel number must be in order
735 
736  pknum = mapstr.GetTypedNextToken<TString>();
737  plnum = mapstr.GetTypedNextToken<Int_t>();
738  dir = mapstr.GetTypedNextToken<TString>();
739  firstwire= mapstr.GetTypedNextToken<Int_t>();
740 
741  Int_t octant = 0;
742  EQwDetectorPackage package = kPackageNull;
743  fR3Octant = gQwOptions.GetValue<Int_t>("R3-octant");
744  if ( pknum=="u" )
745  {
746  package = kPackage1;
747  octant = (fR3Octant + 4) % 8;
748  }
749  else if ( pknum=="v" )
750  {
751  package = kPackage2;
752  octant = fR3Octant;
753  }
754 
755  BuildWireDataStructure ( channum,package,octant,plnum,firstwire );
756 
757  if ( fDelayLineArray.at ( bpnum ).at ( lnnum ).Fill == kFALSE ) //if this delay line has not been Filled in the data
758  {
759  string_a = mapstr.GetTypedNextToken<std::string>();
760  while ( string_a.size() !=0 )
761  {
762  tmpWindows.push_back ( atof ( string_a.c_str() ) );
763  string_a = mapstr.GetTypedNextToken<std::string>();
764  }
765 
766  fDelayLineArray.at ( bpnum ).at ( lnnum ).fOctant = octant;
767  fDelayLineArray.at ( bpnum ).at ( lnnum ).fPackage = package;
768  fDelayLineArray.at ( bpnum ).at ( lnnum ).fPlane = plnum;
769 
770  if ( dir == "u" ) direction = kDirectionU;
771  else if ( dir == "v" ) direction = kDirectionV;
772 
773  fDelayLineArray.at ( bpnum ).at ( lnnum ).fDirection = direction;
774  fDelayLineArray.at ( bpnum ).at ( lnnum ).fFirstWire = firstwire;
775 
776  for ( size_t i=0;i<tmpWindows.size() /2;i++ )
777  {
778  pair_a.first = tmpWindows.at ( 2*i );
779  pair_a.second = tmpWindows.at ( 2*i+1 );
780  fDelayLineArray.at ( bpnum ).at ( lnnum ).Windows.push_back ( pair_a );
781  }
782 
783  // std::cout << "DelayLine: back plane: " << bpnum
784  // << "line number " << lnnum
785  // << " Windows.size: " << fDelayLineArray.at ( bpnum ).at ( lnnum ).Windows.size()
786  // << std::endl;
787  fDelayLineArray.at ( bpnum ).at ( lnnum ).Fill = kTRUE;
788  tmpWindows.clear();
789  }
790  }
791 
793 
794  mapstr.Close(); // Close the file (ifstream)
795  return OK;
796 }
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
size_t fCurrentBankIndex
Name of this subsystem (the region).
void LoadTtoDParameters(TString ttod_map)
Int_t BuildWireDataStructure(const UInt_t chan, const EQwDetectorPackage package, const Int_t octant, const Int_t plane, const Int_t wire)
static UInt_t GetUInt(const TString &varvalue)
static const Int_t kCodaMasterPlaneNumber
QwOptions gQwOptions
Definition: QwOptions.cc:27
EQwDetectorPackage
Definition: QwTypes.h:70
T GetValue(const std::string &key)
Get a templated value.
Definition: QwOptions.h:240
Int_t LinkReferenceChannel(const UInt_t chan, const Int_t plane, const Int_t wire)
std::vector< std::vector< QwDelayLine > > fDelayLineArray
Int_t LoadTimeWireOffset(TString t0_map)
#define OK
std::vector< std::vector< QwDelayLineID > > fDelayLinePtrs
Int_t RegisterSubbank(const UInt_t bank_id)
EQwDirectionID
Definition: QwTypes.h:41
Int_t RegisterSlotNumber(const UInt_t slot_id)
static const Int_t kReferenceChannelPlaneNumber
Int_t RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id)
Tell the object that it will decode data from this ROC and sub-bank.
F1TDCReferenceContainer * fF1RefContainer

+ Here is the call graph for this function:

Int_t QwDriftChamberVDC::LoadTimeWireOffset ( TString  t0_map)
protectedvirtual

Implements QwDriftChamber.

Definition at line 1162 of file QwDriftChamberVDC.cc.

References VQwSubsystem::fDetectorMaps, fTimeWireOffsets, and OK.

Referenced by LoadChannelMap().

1163 {
1164  //std::cout << "beginning to load t0 file... " << std::endl;
1165  //
1166  QwParameterFile mapstr ( t0_map.Data() );
1167  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
1168 
1169  TString varname,varvalue;
1170  Int_t plane=0,wire=0;
1171  Double_t t0 = 0.0;
1172  EQwDetectorPackage package = kPackageNull;
1173 
1174  while ( mapstr.ReadNextLine() )
1175  {
1176  mapstr.TrimComment ( '!' );
1177  mapstr.TrimWhitespace();
1178  if ( mapstr.LineIsEmpty() ) continue;
1179  if ( mapstr.HasVariablePair ( "=",varname,varvalue ) )
1180  {
1181  varname.ToLower();
1182  if ( varname=="package" )
1183  {
1184  package = ( EQwDetectorPackage ) atoi ( varvalue.Data() );
1185  if ( package> ( Int_t ) fTimeWireOffsets.size() ) fTimeWireOffsets.resize ( package );
1186  }
1187  else if ( varname=="plane" )
1188  {
1189  //std::cout << "package: " << fTimeWireOffsets.at(package-1).size()<< std::endl;
1190  plane = atoi ( varvalue.Data() );
1191  if ( plane> ( Int_t ) fTimeWireOffsets.at ( package-1 ).size() ) fTimeWireOffsets.at ( package-1 ).resize ( plane );
1192  //std::cout << "plane: " << fTimeWireOffsets.at(package-1).size()<< std::endl;
1193 
1194  // To Siyuan, * : can package be obtained before plane in while loop? if plane is before package
1195  // we have at(-1), thus, if condition is always "false", I guess.
1196  // * : if, else if then can we expect something more?
1197  // from Han
1198  }
1199  continue;
1200  }
1201 
1202  wire = mapstr.GetTypedNextToken<Int_t>();
1203  t0 = mapstr.GetTypedNextToken<Int_t>();
1204 
1205  if ( wire > ( Int_t ) fTimeWireOffsets.at ( package-1 ).at ( plane-1 ).size() )
1206  {
1207  fTimeWireOffsets.at ( package-1 ).at ( plane-1 ).resize ( wire );
1208 
1209  fTimeWireOffsets.at ( package-1 ).at ( plane-1 ).at ( wire-1 ) = t0;
1210  }
1211 
1212  }
1213  //
1214  mapstr.Close(); // Close the file (ifstream)
1215  return OK;
1216 }
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
EQwDetectorPackage
Definition: QwTypes.h:70
std::vector< std::vector< std::vector< Double_t > > > fTimeWireOffsets
#define OK

+ Here is the caller graph for this function:

void QwDriftChamberVDC::LoadTtoDParameters ( TString  ttod_map)
protected

Definition at line 1395 of file QwDriftChamberVDC.cc.

References VQwSubsystem::fDetectorMaps, and fTtoDNumbers.

Referenced by LoadChannelMap().

1396 {
1397 
1398  QwParameterFile mapstr ( ttod_map.Data() );
1399  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
1400 
1401  while ( mapstr.ReadNextLine() )
1402  {
1403  mapstr.TrimComment ( '!' );
1404  mapstr.TrimWhitespace();
1405  if ( mapstr.LineIsEmpty() ) continue;
1406 
1407  Double_t t __attribute__((unused)) // unused but function call still required
1408  = mapstr.GetTypedNextToken<Double_t>();
1409  Double_t d = mapstr.GetTypedNextToken<Double_t>();
1410  fTtoDNumbers.push_back ( d );
1411  }
1412 
1413  mapstr.Close(); // Close the file (ifstream)
1414  return;
1415 }
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
std::vector< Double_t > fTtoDNumbers

+ Here is the caller graph for this function:

void QwDriftChamberVDC::ProcessEvent ( )
virtual

Implements QwDriftChamber.

Definition at line 841 of file QwDriftChamberVDC.cc.

References fDisableWireTimeOffset, QwDriftChamber::FillDriftDistanceToHits(), QwDriftChamber::fWireHits, VQwSubsystem::HasDataLoaded(), invalid(), SubtractReferenceTimes(), SubtractWireTimeOffset(), and UpdateHits().

842 {
843  if ( not HasDataLoaded() ) return;
844 
845  SubtractReferenceTimes(); // A.U. unit
846  UpdateHits();
847 
848  if ( fDisableWireTimeOffset == false ){
849 
852 
853  std::vector<QwHit>::iterator it;
854  it=std::remove_if(fWireHits.begin(),fWireHits.end(),invalid);
855  if(it!=fWireHits.end())
856  fWireHits.erase(it,fWireHits.end());
857  }
858 
859  return;
860 }
bool invalid(QwHit &hit)
Bool_t HasDataLoaded() const
Definition: VQwSubsystem.h:94
std::vector< QwHit > & fWireHits
void FillDriftDistanceToHits()

+ Here is the call graph for this function:

void QwDriftChamberVDC::ProcessOptions ( QwOptions options)
virtual

Process the command line options.

Reimplemented from VQwSubsystem.

Definition at line 918 of file QwDriftChamberVDC.cc.

References fDisableWireTimeOffset, fR3Octant, fUseTDCHits, and QwOptions::GetValue().

919 {
920  fUseTDCHits=options.GetValue<bool> ( "use-tdchit" );
921  fDisableWireTimeOffset=options.GetValue<bool> ( "disable-wireoffset" );
922  fR3Octant=options.GetValue<int> ( "R3-octant" );
923 }
T GetValue(const std::string &key)
Get a templated value.
Definition: QwOptions.h:240

+ Here is the call graph for this function:

void QwDriftChamberVDC::ReadEvent ( TString &  eventfile)

Definition at line 801 of file QwDriftChamberVDC.cc.

References VQwSubsystem::fDetectorMaps, QwDriftChamber::fTDCHits, kDirectionNull, and kRegionID3.

802 {
803  TString varname,varvalue;
804  UInt_t slotnum = 0;
805  UInt_t channum = 0; //store temporary channel number
806  // UInt_t pknum,plnum; //store temp package,plane,firstwire and left or right information
807  UInt_t value = 0;
808  Double_t signal = 0.0; // Double_t? unsigned Int_t ? by jhlee
809  EQwDetectorPackage package = kPackageNull;
810  EQwDirectionID direction = kDirectionNull;
811 
812  QwParameterFile mapstr ( eventfile.Data() );
813  fDetectorMaps.insert(mapstr.GetParamFileNameContents());
814 
815  while ( mapstr.ReadNextLine() )
816  {
817  mapstr.TrimComment ( '!' );
818  mapstr.TrimWhitespace();
819  if ( mapstr.LineIsEmpty() ) continue;
820  if ( mapstr.HasVariablePair ( "=",varname,varvalue ) ) //to judge whether we find a new crate
821  {
822  varname.ToLower();
823  value = atol ( varvalue.Data() );
824  continue;
825  }
826 
827  slotnum = mapstr.GetTypedNextToken<Int_t>();
828  channum = mapstr.GetTypedNextToken<Int_t>();
829  signal = mapstr.GetTypedNextToken<Double_t>();
830  //std::cout << "signal is: " << signal << endl;
831  fTDCHits.push_back ( QwHit ( value,slotnum,channum,0, kRegionID3,package,0,0,direction,0, ( UInt_t ) signal ) );
832  } //only know TDC information and time value
833 
834  mapstr.Close(); // Close the file (ifstream)
835  return;
836 }
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
EQwDetectorPackage
Definition: QwTypes.h:70
EQwDirectionID
Definition: QwTypes.h:41
Hit structure uniquely defining each hit.
Definition: QwHit.h:43
std::vector< QwHit > fTDCHits
void QwDriftChamberVDC::SubtractReferenceTimes ( )
virtual

Implements QwDriftChamber.

Definition at line 37 of file QwDriftChamberVDC.cc.

References QwDriftChamber::fF1RefContainer, QwDriftChamber::fF1TDContainer, QwDriftChamber::fTDCHits, F1TDCReferenceContainer::GetReferenceTimeAU(), VQwSubsystem::GetSubsystemName(), kPackage1, kPackage2, QwMessage, and QwF1TDContainer::ReferenceSignalCorrection().

Referenced by ProcessEvent().

38 {
39 
40 
41  UInt_t bank_index = 0;
42  Double_t raw_time_arb_unit = 0.0;
43  Double_t ref_time_arb_unit = 0.0;
44  Double_t time_arb_unit = 0.0;
45  EQwDetectorPackage package = kPackageNull;
46  Bool_t local_debug = false;
47  Int_t slot_num = 0;
48 
49  TString reference_name1 = "MasterTrigger";
50  TString reference_name2 = "CopyMasterTrigger";
51 
52  std::vector<QwHit>::iterator end=fTDCHits.end();
53  for ( std::vector<QwHit>::iterator hit=fTDCHits.begin(); hit!=end; hit++ )
54  {
55 
56  bank_index = hit -> GetSubbankID();
57  slot_num = hit -> GetModule();
58  raw_time_arb_unit = (Double_t) hit -> GetRawTime();
59  package = hit -> GetPackage();
60 
61 
62  // John L. introduced this package match reference time subtraction for only Region 3,
63  // I was told it would be better to extend this concept to Region2, so I did, and I
64  // got the worst result..... Q2 = +2.735199e-02 its RMS +1.192504e-02
65  // if I don't use this method in Region2, Q2 = +2.292274e-02 and RMS = +7.133603e-03
66  // if I don't use this method in Region3, I couldn't get "peak" structure
67  // in time distributions of four VDC chambers.
68  //
69  // Why does this method give us a good result for only Region 3? MUX?
70  // I don't know ..
71  // Friday, February 17 14:01:12 EST 2012, jhlee
72 
73  if (package == kPackage1) { // Up is 1
74  reference_name1 = "TrigScintPkg1";
75  }
76  else if (package == kPackage2) {// Down is 2
77  reference_name1 = "TrigScintPkg2";
78  }
79  else {
80  reference_name1 = "MasterTrigger";
81  }
82 
83  ref_time_arb_unit = fF1RefContainer->GetReferenceTimeAU(bank_index, reference_name1);
84 
85  // printf("%f\n", ref_time_arb_unit);
86 
87  if(ref_time_arb_unit== 0.0 ) {
88  ref_time_arb_unit = fF1RefContainer->GetReferenceTimeAU(bank_index, reference_name2);
89  }
90  // printf("%f\n", ref_time_arb_unit);
91  // second time, it returns 0.0, we simply ignore this event ....
92  // set time zero. ReferenceSignalCorrection() will return zero, and increase RFM counter...
93  //
94  time_arb_unit = fF1TDContainer->ReferenceSignalCorrection(raw_time_arb_unit, ref_time_arb_unit, bank_index, slot_num);
95 
96  hit -> SetTime(time_arb_unit);
97  hit -> SetRawRefTime((UInt_t) ref_time_arb_unit);
98  if(local_debug) {
99  QwMessage << this->GetSubsystemName()
100  << " Package " << std::setw(2) << package
101  << " BankIndex " << std::setw(2) << bank_index
102  << " Slot " << std::setw(2) << slot_num
103  << " RawTime : " << std::setw(6) << raw_time_arb_unit
104  << " RefTime : " << std::setw(6) << ref_time_arb_unit
105  << " time : " << std::setw(6) << time_arb_unit
106  << std::endl;
107 
108  }
109 
110  }
111 
112 
113 
114  return;
115 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
Double_t GetReferenceTimeAU(Int_t bank_index, TString name)
EQwDetectorPackage
Definition: QwTypes.h:70
Double_t ReferenceSignalCorrection(Double_t raw_time, Double_t ref_time, Int_t bank_index, Int_t slot)
QwF1TDContainer * fF1TDContainer
std::vector< QwHit > fTDCHits
TString GetSubsystemName() const
Definition: VQwSubsystem.h:93
F1TDCReferenceContainer * fF1RefContainer

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwDriftChamberVDC::SubtractWireTimeOffset ( )
protectedvirtual

Implements QwDriftChamber.

Definition at line 1219 of file QwDriftChamberVDC.cc.

References VQwSubsystemTracking::fF1TDCResolutionNS, fTimeWireOffsets, and QwDriftChamber::fWireHits.

Referenced by ProcessEvent().

1220 {
1221  Int_t plane = 0;
1222  Int_t wire = 0;
1223  EQwDetectorPackage package = kPackageNull;
1224 
1225  Double_t t0_NS = 0.0;
1226 
1227  Double_t educated_guess_t0_correction_NS = 91;
1228  // Double_t educated_guess_t0_correction_AU = educated_guess_t0_correction_NS/fF1TDCResolutionNS;
1229 
1230  std::size_t nhits = fWireHits.size();
1231 
1232  for(std::size_t i=0;i<nhits;i++)
1233  {
1234  package = fWireHits.at(i).GetPackage();
1235  plane = fWireHits.at(i).GetPlane();
1236  wire = fWireHits.at(i).GetElement();
1237  t0_NS = fTimeWireOffsets.at ( package-1 ).at ( plane-1 ).at ( wire-1 );
1238  t0_NS += educated_guess_t0_correction_NS;
1239 
1240  // real_time=fWireHits.at(i).GetTime()-t0-91;
1241  fWireHits.at(i).SubtractTimeNsOffset(t0_NS); // time unit is ns Replace fTimeNs
1242  fWireHits.at(i).SubtractTimeAuOffset(t0_NS/fF1TDCResolutionNS); // time unit is a.u. Replace fTime
1243  }
1244  return;
1245 }
EQwDetectorPackage
Definition: QwTypes.h:70
std::vector< std::vector< std::vector< Double_t > > > fTimeWireOffsets
std::vector< QwHit > & fWireHits

+ Here is the caller graph for this function:

void QwDriftChamberVDC::UpdateHits ( )
protected

Definition at line 1249 of file QwDriftChamberVDC.cc.

References QwHit::ApplyTimeCalibration(), QwElectronicsID::fChannel, fDelayLineArray, fDelayLinePtrs, VQwSubsystemTracking::fDetectorInfo, VQwSubsystemTracking::fF1TDCResolutionNS, QwElectronicsID::fModule, QwDriftChamber::fTDCHits, QwDriftChamber::fWireData, QwDriftChamber::fWireHits, QwGeometry::in(), kRegionID3, QwHit::SetAmbiguityID(), VQwTrackingElement::SetDetectorInfo(), QwHit::SetHitNumberR(), and QwHit::SetTime().

Referenced by ProcessEvent().

1250 {
1251 
1252  Double_t real_time_au = 0.0;
1253  Double_t tmpTime_au = 0.0;
1254  Double_t left_time_au = 0.0;
1255  Double_t right_time_au = 0.0;
1256 
1257  Int_t tmpCrate = 0;
1258  Int_t tmpModule = 0;
1259  Int_t tmpChan = 0;
1260  Int_t tmpbp = 0;
1261  Int_t tmpln = 0;
1262  Int_t wire_hit = 0;
1263  Int_t mycount = 0;
1264 
1265  Bool_t kDir = kTRUE;
1266  Bool_t tmpAM = kFALSE;
1267 
1268  std::vector<Int_t> wire_array;
1269  wire_array.clear();
1270 
1271  Int_t channel_offset = 64;
1272 
1273  QwElectronicsID tmpElectronicsID;
1274 
1275  // processing the delay line starts....
1276  std::vector<QwHit>::iterator end=fTDCHits.end();
1277  for ( std::vector<QwHit>::iterator iter=fTDCHits.begin();iter!=end;iter++ )
1278  {
1279  //this for loop will Fill in the tdc hits data Int_to the corresponding delay line
1280  tmpElectronicsID = iter->GetElectronicsID();
1281  tmpCrate = iter->GetSubbankID();
1282  tmpTime_au = iter->GetTime(); // a.u.
1283  tmpModule = tmpElectronicsID.fModule;
1284  tmpChan = tmpElectronicsID.fChannel;
1285 
1286  if ( tmpCrate==3 ) tmpChan+=channel_offset; // ROC10
1287 
1288  if ( fDelayLinePtrs.at ( tmpModule ).at ( tmpChan ).fSide == 0 ) {
1290  .at( fDelayLinePtrs.at ( tmpModule ).at ( tmpChan ).fBackPlane )
1291  .at( fDelayLinePtrs.at ( tmpModule ).at ( tmpChan ).fLineNumber)
1292  .LeftHits.push_back ( tmpTime_au );
1293  }
1294  else {
1296  .at ( fDelayLinePtrs.at ( tmpModule ).at ( tmpChan ).fBackPlane )
1297  .at ( fDelayLinePtrs.at ( tmpModule ).at ( tmpChan ).fLineNumber )
1298  .RightHits.push_back ( tmpTime_au );
1299  }
1300  }
1301 
1302  for ( std::vector<QwHit>::iterator iter=fTDCHits.begin();iter!=end;iter++ )
1303  {
1304  tmpElectronicsID = iter->GetElectronicsID();
1305  tmpCrate = iter->GetSubbankID();
1306  // if(tmpCrate == 0) break;
1307  // tmpTime_au = iter->GetTime();
1308  tmpModule = tmpElectronicsID.fModule;
1309  tmpChan = tmpElectronicsID.fChannel;
1310  // Int_t tmpROC = tmpElectronicsID.fROC;
1311  if ( tmpCrate==3 ) tmpChan+=channel_offset; // ROC10
1312 
1313  tmpbp = fDelayLinePtrs.at ( tmpModule ).at ( tmpChan ).fBackPlane;
1314  tmpln = fDelayLinePtrs.at ( tmpModule ).at ( tmpChan ).fLineNumber;
1315 
1316  Int_t plane = fDelayLineArray.at ( tmpbp ).at ( tmpln ).fPlane ;
1317  Int_t octant = fDelayLineArray.at ( tmpbp ).at ( tmpln ).fOctant;
1318  EQwDetectorPackage package = fDelayLineArray.at ( tmpbp ).at ( tmpln ).fPackage;
1319  EQwDirectionID direction = fDelayLineArray.at ( tmpbp ).at ( tmpln ).fDirection;
1320 
1321  // QwMessage << "QwDriftChamberVDC::ProcessEvent() :"
1322  // << " plane = " << plane
1323  // << " direction = " << direction
1324  // << " package = " << package
1325  // << " roc = " << tmpROC
1326  // << " slot = " << tmpModule
1327  // << " chan = " << tmpChan
1328 
1329  // << QwLog::endl;
1330 
1331  if ( fDelayLineArray.at ( tmpbp ).at ( tmpln ).Processed == kFALSE ) //if this delay line has been Processed
1332  {
1333  wire_array.clear();
1334 
1335  if ( tmpbp==0 || tmpbp ==3 || tmpbp==4 || tmpbp==7 || tmpbp==8 || tmpbp==11 || tmpbp==12 || tmpbp==15 ) {
1336  kDir = kTRUE; //true means left-right
1337  }
1338  else {
1339  kDir = kFALSE;
1340  }
1341 
1342  fDelayLineArray.at ( tmpbp ).at ( tmpln ).ProcessHits ( kDir );
1343 
1344  std::size_t Wirecount = fDelayLineArray.at ( tmpbp ).at ( tmpln ).Wire.size();
1345  // std::cout << "Wirecount " << Wirecount << std::endl;
1346  for ( std::size_t i=0;i<Wirecount;i++ )
1347  {
1348  std::size_t Ambiguitycount = fDelayLineArray.at ( tmpbp ).at ( tmpln ).Wire.at ( i ).size(); //if there's a ambiguity, it's 2; if not, this is 1
1349  if ( Ambiguitycount==1 ) tmpAM = kFALSE;
1350  else tmpAM = kTRUE;
1351 
1352  Int_t order_L = fDelayLineArray.at ( tmpbp ).at ( tmpln ).Hitscount.at ( i ).first;
1353  Int_t order_R = fDelayLineArray.at ( tmpbp ).at ( tmpln ).Hitscount.at ( i ).second;
1354 
1355  left_time_au = fDelayLineArray.at ( tmpbp ).at ( tmpln ).LeftHits.at ( order_L );
1356  right_time_au = fDelayLineArray.at ( tmpbp ).at ( tmpln ).RightHits.at ( order_R );
1357 
1358  for ( std::size_t j=0;j<Ambiguitycount;++j )
1359  {
1360  real_time_au = ( left_time_au+right_time_au ) /2.0; // a.u.
1361 
1362  wire_hit = fDelayLineArray.at ( tmpbp ).at ( tmpln ).Wire.at ( i ).at ( j );
1363 
1364  wire_array.push_back ( wire_hit );
1365 
1366  mycount = count ( wire_array.begin(), wire_array.end(), wire_hit ) - 1;
1367 
1368  Int_t temp_Chan=0;
1369  if ( tmpCrate==3 ) temp_Chan=tmpChan-channel_offset;
1370  else temp_Chan=tmpChan;
1371 
1372  const QwDetectorInfo* local_info = fDetectorInfo.in(package).at(plane-1);
1373 
1374  QwHit NewQwHit ( tmpCrate, tmpModule, temp_Chan, mycount, kRegionID3, package, octant, plane, direction, wire_hit );
1375 
1376  NewQwHit.SetHitNumberR ( order_R );
1377  NewQwHit.SetDetectorInfo ( local_info );
1378  NewQwHit.SetAmbiguityID ( tmpAM, j );
1379 
1380  NewQwHit.SetTime ( real_time_au );
1381  NewQwHit.ApplyTimeCalibration( fF1TDCResolutionNS ); // Fill fTimeRes and fTimeNs in QwHit
1382 
1383  fWireData.at ( 4* ( package-1 ) +plane ).at ( wire_hit-1 ).PushHit ( ( Int_t ) real_time_au );
1384 
1385  fWireHits.push_back ( NewQwHit );
1386  }
1387  }
1388  }
1389  }
1390 }
const QwGeometry in(const EQwRegionID &r) const
Get detectors in given region.
Definition: QwGeometry.h:92
EQwDetectorPackage
Definition: QwTypes.h:70
QwGeometry fDetectorInfo
Geometry information of this subsystem.
std::vector< std::vector< QwDelayLine > > fDelayLineArray
std::vector< std::vector< QwDelayLineID > > fDelayLinePtrs
EQwDirectionID
Definition: QwTypes.h:41
std::vector< QwHit > & fWireHits
Hit structure uniquely defining each hit.
Definition: QwHit.h:43
std::vector< QwHit > fTDCHits
std::vector< std::vector< QwDetectorInfo > > fWireData

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

std::vector< std::vector<QwDelayLine> > QwDriftChamberVDC::fDelayLineArray
protected

Definition at line 89 of file QwDriftChamberVDC.h.

Referenced by ClearEventData(), LoadChannelMap(), QwDriftChamberVDC(), and UpdateHits().

std::vector< std::vector<QwDelayLineID> > QwDriftChamberVDC::fDelayLinePtrs
protected

Definition at line 90 of file QwDriftChamberVDC.h.

Referenced by FillRawTDCWord(), LoadChannelMap(), QwDriftChamberVDC(), and UpdateHits().

Bool_t QwDriftChamberVDC::fDisableWireTimeOffset
protected

Definition at line 85 of file QwDriftChamberVDC.h.

Referenced by ProcessEvent(), and ProcessOptions().

Int_t QwDriftChamberVDC::fR3Octant
protected

Definition at line 86 of file QwDriftChamberVDC.h.

Referenced by LoadChannelMap(), and ProcessOptions().

std::vector< std::vector< std::vector<Double_t> > > QwDriftChamberVDC::fTimeWireOffsets
protected

Definition at line 92 of file QwDriftChamberVDC.h.

Referenced by LoadTimeWireOffset(), and SubtractWireTimeOffset().

std::vector< Double_t> QwDriftChamberVDC::fTtoDNumbers
protected

Definition at line 93 of file QwDriftChamberVDC.h.

Referenced by CalculateDriftDistance(), and LoadTtoDParameters().

Bool_t QwDriftChamberVDC::fUseTDCHits
protected

Definition at line 80 of file QwDriftChamberVDC.h.

Referenced by GetHitList(), and ProcessOptions().

std::vector< QwHit > QwDriftChamberVDC::fWireHitsVDC
protected

Definition at line 91 of file QwDriftChamberVDC.h.

const UInt_t QwDriftChamberVDC::kBackPlaneNum =16
staticprotected

Definition at line 87 of file QwDriftChamberVDC.h.

Referenced by QwDriftChamberVDC().

const UInt_t QwDriftChamberVDC::kLineNum =8
staticprotected

Definition at line 88 of file QwDriftChamberVDC.h.

Referenced by QwDriftChamberVDC().


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