QwAnalysis
QwDelayLine Class Reference

#include <QwDelayLine.h>

Public Member Functions

 QwDelayLine ()
 
 QwDelayLine (const Int_t pk, const Int_t oct, const Int_t pl, const Int_t dir, const Int_t firstwire)
 
virtual ~QwDelayLine ()
 
void ProcessHits (Bool_t k)
 
void Wirenumber (Double_t &)
 

Data Fields

EQwDetectorPackage fPackage
 
Int_t fOctant
 
Int_t fPlane
 
EQwDirectionID fDirection
 
Int_t fFirstWire
 
Bool_t Fill
 
Bool_t Processed
 
Bool_t Ambiguous
 
vector< vector< Int_t > > Wire
 
vector< std::pair< Int_t, Int_t > > Hitscount
 
vector< std::pair< Double_t,
Double_t > > 
Windows
 
vector< Double_t > LeftHits
 
vector< Double_t > RightHits
 

Static Public Attributes

static const Double_t kTimeStep =2.6
 
static const Int_t kWireStep =8
 

Detailed Description

Author
siyuan yang

Definition at line 31 of file QwDelayLine.h.

Constructor & Destructor Documentation

QwDelayLine::QwDelayLine ( )
inline

Definition at line 34 of file QwDelayLine.h.

Bool_t Processed
Definition: QwDelayLine.h:49
Int_t fFirstWire
Definition: QwDelayLine.h:45
Int_t fOctant
Definition: QwDelayLine.h:42
EQwDetectorPackage fPackage
Definition: QwDelayLine.h:41
EQwDirectionID fDirection
Definition: QwDelayLine.h:44
Int_t fPlane
Definition: QwDelayLine.h:43
Bool_t Fill
Definition: QwDelayLine.h:48
Bool_t Ambiguous
Definition: QwDelayLine.h:50
QwDelayLine::QwDelayLine ( const Int_t  pk,
const Int_t  oct,
const Int_t  pl,
const Int_t  dir,
const Int_t  firstwire 
)
inline

Definition at line 35 of file QwDelayLine.h.

35 :fPackage((EQwDetectorPackage)pk),fOctant(oct),fPlane(pl),fDirection((EQwDirectionID)dir),fFirstWire(firstwire),Fill(false),Processed(false),Ambiguous(false){};
Bool_t Processed
Definition: QwDelayLine.h:49
Int_t fFirstWire
Definition: QwDelayLine.h:45
Int_t fOctant
Definition: QwDelayLine.h:42
EQwDetectorPackage fPackage
Definition: QwDelayLine.h:41
EQwDirectionID fDirection
Definition: QwDelayLine.h:44
EQwDetectorPackage
Definition: QwTypes.h:70
Int_t fPlane
Definition: QwDelayLine.h:43
Bool_t Fill
Definition: QwDelayLine.h:48
EQwDirectionID
Definition: QwTypes.h:41
Bool_t Ambiguous
Definition: QwDelayLine.h:50
QwDelayLine::~QwDelayLine ( )
virtual

Definition at line 127 of file QwDelayLine.cc.

128 {
129 }

Member Function Documentation

void QwDelayLine::ProcessHits ( Bool_t  k)

Definition at line 81 of file QwDelayLine.cc.

References Hitscount, LeftHits, Processed, RightHits, Windows, and Wirenumber().

81  {
82  // The loop over the hits is assumming that both lists are ordered forwards in time.
83  Double_t delta_t=0;
84  Int_t hitscount=LeftHits.size();
85  Int_t hitscount_R=RightHits.size();
86  Int_t wincount=Windows.size();
87  //Int_t first_match=0;
88 
89  if(hitscount ==0 || hitscount_R ==0){
90  }// do nothing
91  else{
92  for(Int_t i=0;i<hitscount;i++)
93  {
94  //for(Int_t j=first_match;j<hitscount_R;j++)
95  for(Int_t j=0;j<hitscount_R;j++)
96  {
97  if(k==false)
98  delta_t=-(LeftHits.at( i )-RightHits.at( j ));
99  else delta_t= LeftHits.at( i )-RightHits.at( j );
100 
101  if(delta_t < Windows.at ( 0 ).first)
102  {
103  // std::cout << " delta_t is unphysical,continue" << std::endl;
104  continue;
105  }
106  else if(delta_t > Windows.at ( wincount-1 ).second)
107  {
108  // std::cout << " delta_t is unphysical,continue" << std::endl;
109  continue;
110  }
111  else
112  {
113  Wirenumber(delta_t);
114  std::pair<Int_t,Int_t> hitspair(i,j);
115  Hitscount.push_back (hitspair);
116  //first_match = j+1;
117  }
118  }
119  }
120  }
121  Processed = true;
122 }
Bool_t Processed
Definition: QwDelayLine.h:49
vector< std::pair< Double_t, Double_t > > Windows
Definition: QwDelayLine.h:54
vector< Double_t > RightHits
Definition: QwDelayLine.h:56
vector< Double_t > LeftHits
Definition: QwDelayLine.h:55
vector< std::pair< Int_t, Int_t > > Hitscount
Definition: QwDelayLine.h:53
void Wirenumber(Double_t &)
Definition: QwDelayLine.cc:20

+ Here is the call graph for this function:

void QwDelayLine::Wirenumber ( Double_t &  time)

Definition at line 20 of file QwDelayLine.cc.

References Ambiguous, fFirstWire, kTimeStep, kWireStep, Windows, and Wire.

Referenced by ProcessHits().

20  {
21  Double_t f1tdc_resolution_ns = 0.116312881651642913;
22  Int_t temp = 0;
23  vector<Int_t> tempwire;
24  Int_t Guess = (Int_t) (f1tdc_resolution_ns*(time-(Windows.at( 0 ).first+Windows.at( 0 ).second) /2)/kTimeStep);
25  // there's two conditions:
26  // first, that the value of time-average value of the first window can not be smaller than -2.6;
27  // second, the right bound of the last window minus the left bound of the first window should be
28  // smaller than Windows.size()*kTimeStep(because we must require that Guess shoulde be smaller than
29  // the Windows.size(),otherwise, the first command below Window.at(Guess) will be out of boundary!!)
30 
31  if(Guess >= (Int_t) Windows.size()) Guess = (Int_t) Windows.size() - 1;
32  if(time < Windows.at(Guess).second)
33  {
34  for(Int_t i= Guess; i >= 0 ; --i)
35  {
36  if(time < Windows.at( i ).second && time >= Windows.at( i ).first)
37  {
38  temp=fFirstWire+i*kWireStep;
39  tempwire.push_back ( temp );
40  Wire.push_back ( tempwire );
41  Ambiguous=false;
42  break;
43  }
44  else if(time < Windows.at( i ).first && time >= Windows.at( i-1 ).second)
45  {
46  temp= fFirstWire + i*kWireStep;
47  tempwire.push_back(temp);
48  tempwire.push_back ( temp-kWireStep );
49  Wire.push_back ( tempwire );
50  Ambiguous=true;
51  break;
52  }
53 
54  }
55  }
56  else
57  {
58  for(size_t i=Guess+1;i<Windows.size();i++)
59  {
60  if (time < Windows.at( i ).second && time >= Windows.at( i ).first)
61  {
62  temp=fFirstWire+i*kWireStep;
63  tempwire.push_back(temp);
64  Wire.push_back(tempwire);
65  Ambiguous=false;
66  break;
67  }
68  else if(time < Windows.at( i ).first && time >= Windows.at( i-1 ).second)
69  {
70  temp= fFirstWire + i*kWireStep;
71  tempwire.push_back(temp);
72  tempwire.push_back(temp-kWireStep);
73  Wire.push_back(tempwire);
74  Ambiguous=true;
75  break;
76  }
77  }
78  }
79 }
vector< vector< Int_t > > Wire
Definition: QwDelayLine.h:52
static const Double_t kTimeStep
Definition: QwDelayLine.h:57
Int_t fFirstWire
Definition: QwDelayLine.h:45
vector< std::pair< Double_t, Double_t > > Windows
Definition: QwDelayLine.h:54
static const Int_t kWireStep
Definition: QwDelayLine.h:58
Bool_t Ambiguous
Definition: QwDelayLine.h:50

+ Here is the caller graph for this function:

Field Documentation

Bool_t QwDelayLine::Ambiguous

Definition at line 50 of file QwDelayLine.h.

Referenced by Wirenumber().

EQwDirectionID QwDelayLine::fDirection

Definition at line 44 of file QwDelayLine.h.

Int_t QwDelayLine::fFirstWire

Definition at line 45 of file QwDelayLine.h.

Referenced by Wirenumber().

Bool_t QwDelayLine::Fill

Definition at line 48 of file QwDelayLine.h.

Int_t QwDelayLine::fOctant

Definition at line 42 of file QwDelayLine.h.

EQwDetectorPackage QwDelayLine::fPackage

Definition at line 41 of file QwDelayLine.h.

Int_t QwDelayLine::fPlane

Definition at line 43 of file QwDelayLine.h.

vector<std::pair<Int_t,Int_t> > QwDelayLine::Hitscount

Definition at line 53 of file QwDelayLine.h.

Referenced by ProcessHits().

const Double_t QwDelayLine::kTimeStep =2.6
static

Definition at line 57 of file QwDelayLine.h.

Referenced by Wirenumber().

const Int_t QwDelayLine::kWireStep =8
static

Definition at line 58 of file QwDelayLine.h.

Referenced by Wirenumber().

vector<Double_t> QwDelayLine::LeftHits

Definition at line 55 of file QwDelayLine.h.

Referenced by ProcessHits().

Bool_t QwDelayLine::Processed

Definition at line 49 of file QwDelayLine.h.

Referenced by ProcessHits().

vector<Double_t> QwDelayLine::RightHits

Definition at line 56 of file QwDelayLine.h.

Referenced by ProcessHits().

vector<std::pair<Double_t,Double_t> > QwDelayLine::Windows

Definition at line 54 of file QwDelayLine.h.

Referenced by ProcessHits(), and Wirenumber().

vector<vector<Int_t> > QwDelayLine::Wire

Definition at line 52 of file QwDelayLine.h.

Referenced by Wirenumber().


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