FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndGemSensorMonitor Class Reference

#include <PndGemSensorMonitor.h>

Inheritance diagram for PndGemSensorMonitor:
PndGemSensor

Public Member Functions

 PndGemSensorMonitor ()
 
 PndGemSensorMonitor (TString tempName, Int_t detId, Int_t iType, Double_t x0, Double_t y0, Double_t z0, Double_t rotation, Double_t innerRad, Double_t outerRad, Double_t d, Double_t stripAngle0, Double_t stripAngle1, Double_t pitch0, Double_t pitch1)
 
 PndGemSensorMonitor (TString tempName, Int_t stationNr, Int_t sectorNr, Int_t iType, Double_t x0, Double_t y0, Double_t z0, Double_t rotation, Double_t innerRad, Double_t outerRad, Double_t d, Double_t stripAngle0, Double_t stripAngle1, Double_t pitch0, Double_t pitch1)
 
 PndGemSensorMonitor (const PndGemSensor &tempSensor)
 
virtual ~PndGemSensorMonitor ()
 
void ActivateChannel (Int_t channelNr, Int_t sideId, Int_t eventNr, Int_t digiNr, Double_t channelTime, Double_t channelCharge)
 
void CheckNeighbours (Int_t channelNr, Int_t sideId, Int_t eventNr, Int_t digiNr, Double_t channelTime, Double_t channelCharge)
 
Bool_t ChannelIsActive (Int_t channelNr, Int_t sideId, Double_t timeNow)
 
Double_t ChannelLastActiveAt (Int_t channelNr, Int_t sideId, Double_t timeNow, Int_t eventNr=-1)
 
Double_t ChannelLastActiveAt (Int_t channelNr, Int_t sideId)
 
Bool_t ChannelLastActivation (Int_t channelNr, Int_t sideId, Int_t &eventNr, Int_t &digiNr, Double_t &channelTime, Double_t &channelCharge)
 
void Print ()
 
TString GetDetectorName () const
 
void SetDetectorId (Int_t stationNr, Int_t sensorNr)
 
Int_t GetDetectorId () const
 
Int_t GetSystemId () const
 
Int_t GetStationNr () const
 
Int_t GetSensorNr () const
 
Int_t GetType () const
 
Double_t GetX0 () const
 
Double_t GetY0 () const
 
Double_t GetZ0 () const
 
Double_t GetRotation () const
 
Double_t GetInnerRadius () const
 
Double_t GetOuterRadius () const
 
Double_t GetD () const
 
Double_t GetStripAngle (Int_t index) const
 
Double_t GetPitch (Int_t index) const
 
Double_t GetSigmaX () const
 
Double_t GetSigmaY () const
 
Double_t GetSigmaXY () const
 
Int_t GetNChannels () const
 
Int_t GetNChannelsFront () const
 
Int_t GetNChannelsBack () const
 
Int_t GetSideChannels (Int_t si) const
 
Int_t GetChannel (Double_t x, Double_t y, Int_t iSide)
 
Int_t GetChannel2 (Double_t x, Double_t y, Int_t iSide, Double_t &feeDist)
 
Bool_t Inside (Double_t x, Double_t y)
 
Bool_t Inside (Double_t radius)
 
Double_t GetStripOrientation (Double_t x, Double_t y, Int_t iSide)
 
Double_t GetDistance (Int_t iSide, Double_t chan1, Double_t chan2)
 
Int_t GetDistance (Int_t iSide, Int_t chanMin, Int_t chanMax, Int_t chanTest)
 
Double_t GetDistance2 (Int_t iSide, Double_t chan1, Double_t chan2)
 
Int_t GetSensorPart (Int_t iSide, Int_t chan)
 
Double_t GetMeanChannel (Int_t iSide, Double_t chan1, Double_t weight1, Double_t chan2, Double_t weight2)
 
Int_t GetNeighbours (Int_t iSide, Int_t iChan, Int_t &nChan1, Int_t &nChan2, Int_t &nChan3)
 
Int_t Intersect (Double_t iFStrip, Double_t iBStrip, Double_t &xCross, Double_t &yCross, Double_t &zCross)
 
Int_t Intersect (Double_t iFStrip, Double_t iBStrip, Double_t &xCross, Double_t &yCross, Double_t &zCross, Double_t &dr, Double_t &dp)
 
Int_t Intersect (Double_t iFStrip, Double_t iBStrip, Double_t &xCross, Double_t &yCross, Double_t &zCross, Double_t &dx, Double_t &dy, Double_t &dr, Double_t &dp)
 
void Reset ()
 

Private Member Functions

 ClassDef (PndGemSensorMonitor, 1)
 

Private Attributes

std::vector< Double_tfFLATime
 
std::vector< Double_tfFLACharge
 
std::vector< Int_t > fFLADigiNr
 
std::vector< Int_t > fFLAEventNr
 
std::vector< Double_tfFMeanTimeD
 
std::vector< Int_t > fFNofDigis
 
Int_t fFSLChan
 
std::vector< Double_tfBLATime
 
std::vector< Double_tfBLACharge
 
std::vector< Int_t > fBLADigiNr
 
std::vector< Int_t > fBLAEventNr
 
std::vector< Double_tfBMeanTimeD
 
std::vector< Int_t > fBNofDigis
 
Int_t fBSLChan
 
Double_t fSensorRecoveryTime
 
Double_t fSensorFirstTime
 
Double_t fSensorLastTime
 

Detailed Description

PndGemSensor.h

Author
Radoslaw Karabowicz r.kar.nosp@m.abow.nosp@m.icz@g.nosp@m.si.d.nosp@m.e
Since
25/03/2013
Version
1.0

This class monitors the digis in the sensor, on front and back. It derives from PndGemSensor, so that we have information about number of digis, positions and so on.

Definition at line 30 of file PndGemSensorMonitor.h.

Constructor & Destructor Documentation

PndGemSensorMonitor::PndGemSensorMonitor ( )

Default constructor

Definition at line 25 of file PndGemSensorMonitor.cxx.

25  :
26  PndGemSensor(),
27  fFLATime(0),
28  fFLACharge(0),
29  fFLADigiNr(0),
30  fFLAEventNr(0),
31  fFMeanTimeD(0),
32  fFNofDigis(0),
33  fFSLChan(0),
34  fBLATime(0),
35  fBLACharge(0),
36  fBLADigiNr(0),
37  fBLAEventNr(0),
38  fBMeanTimeD(0),
39  fBNofDigis(0),
40  fBSLChan(0),
41  fSensorRecoveryTime(100.),
42  fSensorFirstTime(0.),
43  fSensorLastTime(0.)
44 {
45 }
std::vector< Int_t > fBLADigiNr
std::vector< Double_t > fBMeanTimeD
std::vector< Double_t > fFLACharge
std::vector< Double_t > fBLACharge
std::vector< Int_t > fFLADigiNr
std::vector< Double_t > fFMeanTimeD
std::vector< Int_t > fBLAEventNr
std::vector< Int_t > fBNofDigis
std::vector< Double_t > fFLATime
std::vector< Int_t > fFLAEventNr
std::vector< Double_t > fBLATime
std::vector< Int_t > fFNofDigis
PndGemSensorMonitor::PndGemSensorMonitor ( TString  tempName,
Int_t  detId,
Int_t  iType,
Double_t  x0,
Double_t  y0,
Double_t  z0,
Double_t  rotation,
Double_t  innerRad,
Double_t  outerRad,
Double_t  d,
Double_t  stripAngle0,
Double_t  stripAngle1,
Double_t  pitch0,
Double_t  pitch1 
)

Standard constructor

Parameters
fNameUnique sensor name
detIdUnique detector identifier
iTypeSensor type (1,2,3)
pos[]sensor centre coordinate in global c.s [cm]
rotationrotation in global c.s. [rad]
innerRadiussensor inner radius in [cm]
outerRadiussensor outer radius in [cm]
dsensor thickness in [cm]
stripAngle[]strip angle, if 0 - radial strips, measuring theta, if 60 - modified radial strips, joining inner ring with outer rotated by 60 deg. if 90 - concentric strips, measuring radius
pitch[]readout radial/angle strip pitch or pixel width in x/y [cm]

Definition at line 51 of file PndGemSensorMonitor.cxx.

57  :
58  PndGemSensor(tempName,detId,iType,x0,y0,z0,rotation,innerRad,outerRad,d,stripAngle0,stripAngle1,pitch0,pitch1),
59  fFLATime(0),
60  fFLACharge(0),
61  fFLADigiNr(0),
62  fFLAEventNr(0),
63  fFMeanTimeD(0),
64  fFNofDigis(0),
65  fFSLChan(0),
66  fBLATime(0),
67  fBLACharge(0),
68  fBLADigiNr(0),
69  fBLAEventNr(0),
70  fBMeanTimeD(0),
71  fBNofDigis(0),
72  fBSLChan(0),
73  fSensorRecoveryTime(100.),
74  fSensorFirstTime(0.),
75  fSensorLastTime(0.)
76 {
77 }
Double_t z0
Definition: checkhelixhit.C:62
Double_t x0
Definition: checkhelixhit.C:70
std::vector< Int_t > fBLADigiNr
std::vector< Double_t > fBMeanTimeD
TObjArray * d
TGeoRotation rotation
std::vector< Double_t > fFLACharge
std::vector< Double_t > fBLACharge
std::vector< Int_t > fFLADigiNr
Double_t y0
Definition: checkhelixhit.C:71
std::vector< Double_t > fFMeanTimeD
std::vector< Int_t > fBLAEventNr
std::vector< Int_t > fBNofDigis
std::vector< Double_t > fFLATime
std::vector< Int_t > fFLAEventNr
std::vector< Double_t > fBLATime
std::vector< Int_t > fFNofDigis
PndGemSensorMonitor::PndGemSensorMonitor ( TString  tempName,
Int_t  stationNr,
Int_t  sectorNr,
Int_t  iType,
Double_t  x0,
Double_t  y0,
Double_t  z0,
Double_t  rotation,
Double_t  innerRad,
Double_t  outerRad,
Double_t  d,
Double_t  stripAngle0,
Double_t  stripAngle1,
Double_t  pitch0,
Double_t  pitch1 
)

Definition at line 81 of file PndGemSensorMonitor.cxx.

References fBLACharge, fBLADigiNr, fBLAEventNr, fBLATime, fBMeanTimeD, fBNofDigis, fFLACharge, fFLADigiNr, fFLAEventNr, fFLATime, fFMeanTimeD, fFNofDigis, PndGemSensor::GetNChannelsBack(), and PndGemSensor::GetNChannelsFront().

87  :
88  PndGemSensor(tempName,stationNr,sectorNr,iType,x0,y0,z0,rotation,innerRad,outerRad,d,stripAngle0,stripAngle1,pitch0,pitch1),
89  fFLATime(0),
90  fFLACharge(0),
91  fFLADigiNr(0),
92  fFLAEventNr(0),
93  fFMeanTimeD(0),
94  fFNofDigis(0),
95  fFSLChan(0),
96  fBLATime(0),
97  fBLACharge(0),
98  fBLADigiNr(0),
99  fBLAEventNr(0),
100  fBMeanTimeD(0),
101  fBNofDigis(0),
102  fBSLChan(0),
103  fSensorRecoveryTime(100.),
104  fSensorFirstTime(0.),
105  fSensorLastTime(0.)
106 {
107  fFLATime .resize(this->GetNChannelsFront(),-1.);
108  fFLACharge .resize(this->GetNChannelsFront(),-1.);
109  fFLADigiNr .resize(this->GetNChannelsFront(),-1);
110  fFLAEventNr.resize(this->GetNChannelsFront(),-1);
111  fFMeanTimeD.resize(this->GetNChannelsFront(), 0.);
112  fFNofDigis .resize(this->GetNChannelsFront(), 0);
113  fBLATime .resize(this->GetNChannelsBack (),-1.);
114  fBLACharge .resize(this->GetNChannelsBack (),-1.);
115  fBLADigiNr .resize(this->GetNChannelsBack (),-1);
116  fBLAEventNr.resize(this->GetNChannelsBack (),-1);
117  fBMeanTimeD.resize(this->GetNChannelsBack (), 0.);
118  fBNofDigis .resize(this->GetNChannelsBack (), 0);
119 }
Double_t z0
Definition: checkhelixhit.C:62
Double_t x0
Definition: checkhelixhit.C:70
std::vector< Int_t > fBLADigiNr
std::vector< Double_t > fBMeanTimeD
TObjArray * d
TGeoRotation rotation
Int_t GetNChannelsBack() const
Definition: PndGemSensor.h:112
std::vector< Double_t > fFLACharge
std::vector< Double_t > fBLACharge
std::vector< Int_t > fFLADigiNr
Double_t y0
Definition: checkhelixhit.C:71
std::vector< Double_t > fFMeanTimeD
std::vector< Int_t > fBLAEventNr
std::vector< Int_t > fBNofDigis
std::vector< Double_t > fFLATime
Int_t GetNChannelsFront() const
Definition: PndGemSensor.h:111
std::vector< Int_t > fFLAEventNr
std::vector< Double_t > fBLATime
std::vector< Int_t > fFNofDigis
PndGemSensorMonitor::PndGemSensorMonitor ( const PndGemSensor tempSensor)

Definition at line 123 of file PndGemSensorMonitor.cxx.

References fBLACharge, fBLADigiNr, fBLAEventNr, fBLATime, fBMeanTimeD, fBNofDigis, fFLACharge, fFLADigiNr, fFLAEventNr, fFLATime, fFMeanTimeD, fFNofDigis, PndGemSensor::GetNChannelsBack(), and PndGemSensor::GetNChannelsFront().

123  :
124  PndGemSensor(tempSensor),
125  fFLATime(0),
126  fFLACharge(0),
127  fFLADigiNr(0),
128  fFLAEventNr(0),
129  fFMeanTimeD(0),
130  fFNofDigis(0),
131  fFSLChan(0),
132  fBLATime(0),
133  fBLACharge(0),
134  fBLADigiNr(0),
135  fBLAEventNr(0),
136  fBMeanTimeD(0),
137  fBNofDigis(0),
138  fBSLChan(0),
139  fSensorRecoveryTime(100.),
140  fSensorFirstTime(0.),
141  fSensorLastTime(0.)
142 {
143  fFLATime .resize(this->GetNChannelsFront(),-1.);
144  fFLACharge .resize(this->GetNChannelsFront(),-1.);
145  fFLADigiNr .resize(this->GetNChannelsFront(),-1);
146  fFLAEventNr.resize(this->GetNChannelsFront(),-1);
147  fFMeanTimeD.resize(this->GetNChannelsFront(), 0.);
148  fFNofDigis .resize(this->GetNChannelsFront(), 0);
149  fBLATime .resize(this->GetNChannelsBack (),-1.);
150  fBLACharge .resize(this->GetNChannelsBack (),-1.);
151  fBLADigiNr .resize(this->GetNChannelsBack (),-1);
152  fBLAEventNr.resize(this->GetNChannelsBack (),-1);
153  fBMeanTimeD.resize(this->GetNChannelsBack (), 0.);
154  fBNofDigis .resize(this->GetNChannelsBack (), 0);
155 }
std::vector< Int_t > fBLADigiNr
std::vector< Double_t > fBMeanTimeD
Int_t GetNChannelsBack() const
Definition: PndGemSensor.h:112
std::vector< Double_t > fFLACharge
std::vector< Double_t > fBLACharge
std::vector< Int_t > fFLADigiNr
std::vector< Double_t > fFMeanTimeD
std::vector< Int_t > fBLAEventNr
std::vector< Int_t > fBNofDigis
std::vector< Double_t > fFLATime
Int_t GetNChannelsFront() const
Definition: PndGemSensor.h:111
std::vector< Int_t > fFLAEventNr
std::vector< Double_t > fBLATime
std::vector< Int_t > fFNofDigis
PndGemSensorMonitor::~PndGemSensorMonitor ( )
virtual

Destructor

Definition at line 160 of file PndGemSensorMonitor.cxx.

160 { }

Member Function Documentation

void PndGemSensorMonitor::ActivateChannel ( Int_t  channelNr,
Int_t  sideId,
Int_t  eventNr,
Int_t  digiNr,
Double_t  channelTime,
Double_t  channelCharge 
)

Modifiers

Definition at line 164 of file PndGemSensorMonitor.cxx.

References CheckNeighbours(), Double_t, fBLACharge, fBLADigiNr, fBLAEventNr, fBLATime, fBMeanTimeD, fBNofDigis, fBSLChan, fFLACharge, fFLADigiNr, fFLAEventNr, fFLATime, fFMeanTimeD, fFNofDigis, and fFSLChan.

164  {
165  if ( sideId == 0 ) {
166  // had to comment it out. but be careful with stat options here: if this function is called from PndGemFindHits
167  // while looping over clusters, it will cause problems, as digis may belong to different clusters....
168 
169  // if ( channelTime > fFLATime[fFSLChan] + 21 && fFLATime[fFSLChan] > -0.5 ) {
170  // cout << "SENSOR " << GetStationNr() << "." << GetSensorNr() << ".F not hitted for " << channelTime-fFLATime[fFSLChan] << " ns (from "
171  // << fFLATime[fFSLChan] << " to " << channelTime << ")"
172  // << " EVENT " << fFLAEventNr[fFSLChan] << " vs " << eventNr << endl;
173  // }
174  // if ( fFLAEventNr[channelNr] == eventNr ) {
175  // cout << "****** " << GetStationNr() << "." << GetSensorNr() << ".F hitted twice after " << channelTime-fFLATime[channelNr] << " ns (at "
176  // << fFLATime[channelNr] << " and " << channelTime << ")"
177  // << " IN EVENT " << eventNr << endl;
178  // }
179  if ( fFNofDigis[channelNr] > 0 ) {
180  fFMeanTimeD[channelNr] = fFMeanTimeD[channelNr] + (channelTime-fFLATime[channelNr]-fFMeanTimeD[channelNr])/((Double_t)fFNofDigis[channelNr]);
181  }
182  fFLATime [channelNr] = channelTime;
183  fFLACharge [channelNr] = channelCharge;
184  fFLADigiNr [channelNr] = digiNr;
185  fFLAEventNr[channelNr] = eventNr;
186  fFNofDigis [channelNr] += 1;
187  fFSLChan = channelNr;
188  }
189  else {
190  // if ( channelTime > fBLATime[fBSLChan] + 21 && fBLATime[fFSLChan] > -0.5 ) {
191  // cout << "SENSOR " << GetStationNr() << "." << GetSensorNr() << ".B not hitted for " << channelTime-fBLATime[fBSLChan] << " ns (from "
192  // << fBLATime[fBSLChan] << " to " << channelTime << ")"
193  // << " EVENT " << fBLAEventNr[fBSLChan] << " vs " << eventNr << endl;
194  // }
195  // if ( fBLAEventNr[channelNr] == eventNr ) {
196  // cout << "****** " << GetStationNr() << "." << GetSensorNr() << ".F hitted twice after " << channelTime-fBLATime[channelNr] << " ns (at "
197  // << fBLATime[channelNr] << " and " << channelTime << ")"
198  // << " IN EVENT " << eventNr << endl;
199  // }
200  if ( fBNofDigis[channelNr] > 0 ) {
201  fBMeanTimeD[channelNr] = fBMeanTimeD[channelNr] + (channelTime-fBLATime[channelNr]-fBMeanTimeD[channelNr])/((Double_t)fBNofDigis[channelNr]);
202  }
203  fBLATime [channelNr] = channelTime;
204  fBLACharge [channelNr] = channelCharge;
205  fBLADigiNr [channelNr] = digiNr;
206  fBLAEventNr[channelNr] = eventNr;
207  fBNofDigis [channelNr] += 1;
208  fBSLChan = channelNr;
209  }
210  CheckNeighbours(channelNr, sideId, eventNr, digiNr, channelTime, channelCharge);
211 }
std::vector< Int_t > fBLADigiNr
std::vector< Double_t > fBMeanTimeD
std::vector< Double_t > fFLACharge
std::vector< Double_t > fBLACharge
std::vector< Int_t > fFLADigiNr
Double_t
std::vector< Double_t > fFMeanTimeD
std::vector< Int_t > fBLAEventNr
std::vector< Int_t > fBNofDigis
std::vector< Double_t > fFLATime
std::vector< Int_t > fFLAEventNr
std::vector< Double_t > fBLATime
std::vector< Int_t > fFNofDigis
void CheckNeighbours(Int_t channelNr, Int_t sideId, Int_t eventNr, Int_t digiNr, Double_t channelTime, Double_t channelCharge)
Bool_t PndGemSensorMonitor::ChannelIsActive ( Int_t  channelNr,
Int_t  sideId,
Double_t  timeNow 
)

Accessors

Definition at line 231 of file PndGemSensorMonitor.cxx.

231  { // channelNr sideId timeNow //[R.K.03/2017] unused variable(s)
232  // Empty function!!
233  return kFALSE;
234 }
Bool_t PndGemSensorMonitor::ChannelLastActivation ( Int_t  channelNr,
Int_t  sideId,
Int_t &  eventNr,
Int_t &  digiNr,
Double_t channelTime,
Double_t channelCharge 
)

Definition at line 279 of file PndGemSensorMonitor.cxx.

279  { // channelNr sideId eventNr digiNr channelTime channelCharge //[R.K.03/2017] unused variable(s)
280  // Empty function
281  return kFALSE;
282 }
Double_t PndGemSensorMonitor::ChannelLastActiveAt ( Int_t  channelNr,
Int_t  sideId,
Double_t  timeNow,
Int_t  eventNr = -1 
)

Definition at line 258 of file PndGemSensorMonitor.cxx.

References fBLATime, and fFLATime.

Referenced by PndGemMonitor::ChannelLastActiveAt().

258  { // eventNr //[R.K.03/2017] unused variable(s)
259  if ( sideId == 0 && fFLATime[channelNr] < -0.5 ) return -1.;
260  if ( sideId == 1 && fBLATime[channelNr] < -0.5 ) return -1.;
261 
262  if ( sideId == 0 ) {
263  // if ( eventNr == fFLAEventNr[channelNr] )
264  // cout << "channel " << channelNr << " in sensor " << GetStationNr() << "." << GetSensorNr() << ".F, two hits in ev " << eventNr
265  // << " 1st @ " << fFLATime[channelNr] << ", now @ " << timeNow << " (diffr=" << timeNow-fFLATime[channelNr] << ")" << endl;
266  return timeNow-fFLATime[channelNr];
267  }
268  else {
269  // if ( eventNr == fBLAEventNr[channelNr] )
270  // cout << "channel " << channelNr << " in sensor " << GetStationNr() << "." << GetSensorNr() << ".B, two hits in ev " << eventNr
271  // << " 1st @ " << fBLATime[channelNr] << ", now @ " << timeNow << " (diffr=" << timeNow-fBLATime[channelNr] << ")" << endl;
272  return timeNow-fBLATime[channelNr];
273  }
274 
275 }
std::vector< Double_t > fFLATime
std::vector< Double_t > fBLATime
Double_t PndGemSensorMonitor::ChannelLastActiveAt ( Int_t  channelNr,
Int_t  sideId 
)

Definition at line 238 of file PndGemSensorMonitor.cxx.

References fBLATime, and fFLATime.

238  {
239  if ( sideId == 0 && fFLATime[channelNr] < -0.5 ) return -1.;
240  if ( sideId == 1 && fBLATime[channelNr] < -0.5 ) return -1.;
241 
242  if ( sideId == 0 ) {
243  // if ( eventNr == fFLAEventNr[channelNr] )
244  // cout << "channel " << channelNr << " in sensor " << GetStationNr() << "." << GetSensorNr() << ".F, two hits in ev " << eventNr
245  // << " 1st @ " << fFLATime[channelNr] << ", now @ " << timeNow << " (diffr=" << timeNow-fFLATime[channelNr] << ")" << endl;
246  return fFLATime[channelNr];
247  }
248  else {
249  // if ( eventNr == fBLAEventNr[channelNr] )
250  // cout << "channel " << channelNr << " in sensor " << GetStationNr() << "." << GetSensorNr() << ".B, two hits in ev " << eventNr
251  // << " 1st @ " << fBLATime[channelNr] << ", now @ " << timeNow << " (diffr=" << timeNow-fBLATime[channelNr] << ")" << endl;
252  return fBLATime[channelNr];
253  }
254 }
std::vector< Double_t > fFLATime
std::vector< Double_t > fBLATime
void PndGemSensorMonitor::CheckNeighbours ( Int_t  channelNr,
Int_t  sideId,
Int_t  eventNr,
Int_t  digiNr,
Double_t  channelTime,
Double_t  channelCharge 
)

Definition at line 215 of file PndGemSensorMonitor.cxx.

References PndGemSensor::GetNeighbours().

Referenced by ActivateChannel().

215  { // eventNr digiNr channelTime channelCharge //[R.K.03/2017] unused variable(s)
216  Int_t nChan[3]={-1,-1,-1};
217  Int_t nofChan = GetNeighbours(sideId,channelNr,nChan[0],nChan[1],nChan[2]);
218  // cout << "------ check " << nofChan << " neighbours of channel " << channelNr << " on sensor " << this->GetDetectorId() << "." << sideId << " : " << endl;
219  for ( Int_t ichan = 0 ; ichan < nofChan ; ichan++ ) {
220  // cout << " ---------------- channel " << nChan[ichan] << " at a distance " << GetDistance(sideId,channelNr,nChan[ichan]) << flush;
221  // if ( GetDistance(sideId,channelNr,nChan[ichan]) > 1.1 ||
222  // GetDistance(sideId,channelNr,nChan[ichan]) < 0.9 ) cout << " OOOOOOOOOOOOOOOOOOOOOO" << flush;
223  // cout << " // difference = " << channelNr-nChan[ichan] << flush;
224  // cout << endl;
225  }
226 
227 }
Int_t GetNeighbours(Int_t iSide, Int_t iChan, Int_t &nChan1, Int_t &nChan2, Int_t &nChan3)
PndGemSensorMonitor::ClassDef ( PndGemSensorMonitor  ,
 
)
private
Int_t PndGemSensor::GetChannel ( Double_t  x,
Double_t  y,
Int_t  iSide 
)
inherited

Calculate channel number for a coordinate pair.

Parameters
xx coordinate in global c.s. [cm]
yy coordinate in global c.s. [cm]
iSide0 = front side, 1 = back side iChan channel number. -1 if point is outside sensor. Will return the same for both sides in case of pixel sensor.

Definition at line 267 of file PndGemSensor.cxx.

References Double_t, PndGemSensor::fInnerRadius, PndGemSensor::fNChannelsBack, PndGemSensor::fNChannelsFront, PndGemSensor::fOuterRadius, PndGemSensor::fPitch, PndGemSensor::fType, PndGemSensor::Inside(), Pi, and CAMath::Sqrt().

Referenced by PndGemFindHits::ConfirmHits(), PndGemDigitize::DigitizeEvent(), MyMainFrame::DoInfoStatusBar(), and PndGemDigitize::SimulateGaussianResponse().

267  {
268 
269  if (iSide !=0 && iSide != 1) {
270  cout << "-W- PndGemSensor::GetChannel: Illegal side number "
271  << iSide << endl;
272  return -1;
273  }
274 
275  if ( !Inside(x,y) ) return -1;
276  Double_t radius = TMath::Sqrt(x*x+y*y);
277 
278  if ( fType == 1 ) {
279  cout << "do not use this type anymore" << endl;
280  return -1;
281  }
282  if ( fType == 0 ) { // angle info for iSide 0, radius info for iSide 1
283  if ( iSide == 0 ) {
284  Double_t hitPhi = TMath::ACos(y/radius);
285  if ( x < 0. )
286  hitPhi = 2.*TMath::Pi()-hitPhi;
287  hitPhi = 2.*TMath::Pi()-hitPhi;
288  return (Int_t)(TMath::Ceil((hitPhi*fInnerRadius)/fPitch[iSide]));
289  }
290  if ( iSide == 1 ) {
291  if ( x < 0. )
292  return (Int_t)(TMath::Ceil((radius-fInnerRadius)/fPitch[1]));
293  else
294  return (Int_t)(TMath::Ceil((radius-fInnerRadius)/fPitch[1])) + fNChannelsBack/2;
295  }
296  }
297  if ( fType == 2 ) { // x y strips
298  if ( iSide == 0 ) { // x information encoded
299 // Int_t nlStrips = (Int_t)(TMath::Ceil((fOuterRadius-fInnerRadius)/fPitch[0]));
300 // Int_t nsStrips = (Int_t)(TMath::Ceil(fInnerRadius/fPitch[0]));
301  Int_t nlStrips = (Int_t)((fOuterRadius-fInnerRadius)/fPitch[0] + 0.5);
302  Int_t nsStrips = (Int_t)(fInnerRadius/fPitch[0] + 0.5);
303  if ( x <= -fInnerRadius )
304  return (Int_t)((x+fOuterRadius)/fPitch[0]);
305  if ( x < 0. && y >= 0. )
306  return nlStrips +(Int_t)((x+fInnerRadius)/fPitch[0]);
307  if ( x < 0. && y < 0. )
308  return nlStrips+ nsStrips+(Int_t)((x+fInnerRadius)/fPitch[0]);
309  // now x can't be smaller than 0.
310  if ( x >= fInnerRadius )
311  return nlStrips+4*nsStrips+(Int_t)((x-fInnerRadius)/fPitch[0]);
312  if ( y >= 0. )
313  return nlStrips+2*nsStrips+(Int_t)((x)/fPitch[0]);
314  if ( y < 0. )
315  return nlStrips+3*nsStrips+(Int_t)((x)/fPitch[0]);
316  }
317  if ( iSide == 1 ) { // y information encoded
318  if ( x < 0. )
319  return (Int_t)((y+fOuterRadius)/fPitch[1]);
320  if ( x >= 0. )
321  return (Int_t)((y+fOuterRadius)/fPitch[1])+fNChannelsBack/2;
322  }
323  }
324  if ( fType == 3 ) { // angle info for iSide 0, radius info for iSide 1
325  if ( iSide == 0 ) {
326  Double_t hitPhi = TMath::ACos(y/radius);
327  if ( x < 0. )
328  hitPhi = 2.*TMath::Pi()-hitPhi;
329  hitPhi = 2.*TMath::Pi()-hitPhi;
330  //extract radial tree factor at the OuterRadius
331  Int_t ifac=1;
332  //extract highest bit number
333  ifac = (Int_t) (fOuterRadius / fInnerRadius);
334  ifac |= (ifac >> 1);
335  ifac |= (ifac >> 2);
336  ifac |= (ifac >> 4);
337  ifac -= (ifac >> 1);
338  //extract radial tree factor at the radius
339  Int_t ifac_r=1;
340  ifac_r = (Int_t) ( radius / fInnerRadius);
341  ifac_r |= (ifac_r >> 1);
342  ifac_r |= (ifac_r >> 2);
343  ifac_r |= (ifac_r >> 4);
344  ifac_r -= (ifac_r >> 1);
345  Int_t ich_step;
346  if ( ifac_r == 0 ) return -1;
347  else ich_step = (Int_t) (ifac / ifac_r);
348  return (Int_t)( ich_step * TMath::Ceil(hitPhi*fNChannelsFront/ich_step/2./TMath::Pi()));
349  }
350  if ( iSide == 1 ) {
351  if ( x < 0. )
352  return (Int_t)(TMath::Ceil((radius-fInnerRadius)/fPitch[1]));
353  else
354  return (Int_t)(TMath::Ceil((radius-fInnerRadius)/fPitch[1])) + fNChannelsBack/2;
355  }
356  }
357  return -1;
358 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Double_t fOuterRadius
Definition: PndGemSensor.h:204
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Bool_t Inside(Double_t x, Double_t y)
Double_t x
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Double_t y
Double_t Pi
Int_t PndGemSensor::GetChannel2 ( Double_t  x,
Double_t  y,
Int_t  iSide,
Double_t feeDist 
)
inherited

Definition at line 824 of file PndGemSensor.cxx.

References CAMath::Abs(), CAMath::Cos(), Double_t, PndGemSensor::fInnerRadius, PndGemSensor::fNChannelsBack, PndGemSensor::fNChannelsFront, PndGemSensor::fOuterRadius, PndGemSensor::fPitch, PndGemSensor::fStripAngle, PndGemSensor::fType, PndGemSensor::Inside(), Pi, CAMath::Sqrt(), and x.

Referenced by PndGemDigitize::SimulateGaussianResponse().

824  {
825  feeDist = -1.;
826 
827  if (iSide !=0 && iSide != 1) {
828  cout << "-W- PndGemSensor::GetChannel: Illegal side number "
829  << iSide << endl;
830  return -1;
831  }
832 
833  if ( !Inside(x,y) ) return -1;
834  Double_t radius = TMath::Sqrt(x*x+y*y);
835 
836  if ( fType == 1 ) {
837  cout << "-E- !!! do not use this type anymore" << endl;
838  return -1;
839  }
840  if ( fType == 0 ) { // angle info for iSide 0, radius info for iSide 1
841  if ( iSide == 0 ) {
842  feeDist = fOuterRadius - radius;
843 
844  Double_t hitPhi = TMath::ACos(y/radius);
845  if ( x < 0. )
846  hitPhi = 2.*TMath::Pi()-hitPhi;
847  hitPhi = 2.*TMath::Pi()-hitPhi;
848  return (Int_t)(TMath::Ceil((hitPhi*fInnerRadius)/fPitch[iSide]));
849  }
850  if ( iSide == 1 ) {
851  Double_t hitPhi = TMath::ACos(y/radius);
852  if ( x < 0. )
853  hitPhi = 2.*TMath::Pi()-hitPhi;
854  hitPhi = 2.*TMath::Pi()-hitPhi;
855  // feeDist = hitPhi;
856  if ( hitPhi < TMath::Pi()/2. )
857  feeDist = hitPhi*radius;
858  else if ( hitPhi < TMath::Pi() )
859  feeDist = (TMath::Pi()-hitPhi)*radius;
860  else if ( hitPhi < 3.*TMath::Pi()/2. )
861  feeDist = (hitPhi-TMath::Pi())*radius;
862  else
863  feeDist = (2.*TMath::Pi()-hitPhi)*radius;
864  feeDist -= fStripAngle[1]/2.; // that's the width of middle bar
865 
866  if ( x < 0. )
867  return (Int_t)(TMath::Ceil((radius-fInnerRadius)/fPitch[1]));
868  else
869  return (Int_t)(TMath::Ceil((radius-fInnerRadius)/fPitch[1])) + fNChannelsBack/2;
870  }
871  }
872  if ( fType == 2 ) { // x y strips
873  if ( iSide == 0 ) { // x information encoded
874  Double_t hitPhi = TMath::ACos(y/radius);
875  if ( x < 0. )
876  hitPhi = 2.*TMath::Pi()-hitPhi;
877  hitPhi = 2.*TMath::Pi()-hitPhi;
878  Double_t feeY = TMath::Cos(hitPhi)*fOuterRadius;
879  feeDist = TMath::Abs(feeY)-TMath::Abs(y);
880 
881  //Int_t nlStrips = (Int_t)(TMath::Ceil((fOuterRadius-fInnerRadius)/fPitch[0]));
882  //Int_t nsStrips = (Int_t)(TMath::Ceil(fInnerRadius/fPitch[0]));
883  Int_t nlStrips = (Int_t)((fOuterRadius-fInnerRadius)/fPitch[0] + 0.5);
884  Int_t nsStrips = (Int_t)(fInnerRadius/fPitch[0] + 0.5);
885  if ( x <= -fInnerRadius )
886  return (Int_t)((x+fOuterRadius)/fPitch[0]);
887  if ( x < 0. && y >= 0. )
888  return (Int_t)(nlStrips +(x+fInnerRadius)/fPitch[0]);
889  if ( x < 0. && y < 0. )
890  return (Int_t)(nlStrips+ nsStrips+(x+fInnerRadius)/fPitch[0]);
891  // now x can't be smaller than 0.
892  if ( x >= fInnerRadius )
893  return (Int_t)(nlStrips+4*nsStrips+(x-fInnerRadius)/fPitch[0]);
894  if ( y >= 0. )
895  return (Int_t)(nlStrips+2*nsStrips+(x)/fPitch[0]);
896  if ( y < 0. )
897  return (Int_t)(nlStrips+3*nsStrips+(x)/fPitch[0]);
898  }
899  if ( iSide == 1 ) { // y information encoded
900  feeDist = TMath::Abs(x) - fStripAngle[1]/2.;
901 
902  if ( x < 0. )
903  return (Int_t)((y+fOuterRadius)/fPitch[1]);
904  if ( x >= 0. )
905  return (Int_t)((y+fOuterRadius)/fPitch[1]+fNChannelsBack/2);
906  }
907  }
908  if ( fType == 3 ) { // angle info for iSide 0, radius info for iSide 1
909  if ( iSide == 0 ) {
910  feeDist = fOuterRadius - radius;
911 
912  Double_t hitPhi = TMath::ACos(y/radius);
913  if ( x < 0. )
914  hitPhi = 2.*TMath::Pi()-hitPhi;
915  hitPhi = 2.*TMath::Pi()-hitPhi;
916  //extract channel factor at the Outer radius
917  Int_t ifac=1;
918  ifac = (Int_t) (fOuterRadius / fInnerRadius);
919  ifac |= (ifac >> 1);
920  ifac |= (ifac >> 2);
921  ifac |= (ifac >> 4);
922  ifac -= (ifac >> 1);
923  //extract channel factor at the hit radius
924  Int_t ifac_r=1;
925  ifac_r = (Int_t) ( radius / fInnerRadius);
926  ifac_r |= (ifac_r >> 1);
927  ifac_r |= (ifac_r >> 2);
928  ifac_r |= (ifac_r >> 4);
929  ifac_r -= (ifac_r >> 1);
930  //calculate channel step at the radius
931  Int_t ich_step;
932  if ( ifac_r == 0 ) return -1;
933  else ich_step = (Int_t) (ifac / ifac_r);
934  //return channel number exists at the radius (use ceil as type0)
935  return (Int_t)( ich_step * TMath::Ceil(hitPhi*fNChannelsFront/ich_step/2./TMath::Pi()));
936  }
937  if ( iSide == 1 ) {
938  Double_t hitPhi = TMath::ACos(y/radius);
939  if ( x < 0. )
940  hitPhi = 2.*TMath::Pi()-hitPhi;
941  hitPhi = 2.*TMath::Pi()-hitPhi;
942  if ( hitPhi < TMath::Pi()/2. )
943  feeDist = hitPhi*radius;
944  else if ( hitPhi < TMath::Pi() )
945  feeDist = (TMath::Pi()-hitPhi)*radius;
946  else if ( hitPhi < 3.*TMath::Pi()/2. )
947  feeDist = (hitPhi-TMath::Pi())*radius;
948  else
949  feeDist = (2.*TMath::Pi()-hitPhi)*radius;
950  feeDist -= fStripAngle[1]/2.; // that's the width of middle bar
951  if ( x < 0. )
952  return (Int_t)(TMath::Ceil((radius-fInnerRadius)/fPitch[1]));
953  else
954  return (Int_t)(TMath::Ceil((radius-fInnerRadius)/fPitch[1])) + fNChannelsBack/2;
955  }
956  }
957  return -1.;
958 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Double_t fOuterRadius
Definition: PndGemSensor.h:204
static T Cos(const T &x)
Definition: PndCAMath.h:43
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Double_t fStripAngle[2]
Definition: PndGemSensor.h:206
Bool_t Inside(Double_t x, Double_t y)
Double_t x
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Double_t y
Double_t Pi
Double_t PndGemSensor::GetD ( ) const
inlineinherited
Int_t PndGemSensor::GetDetectorId ( ) const
inlineinherited
TString PndGemSensor::GetDetectorName ( ) const
inlineinherited

Accessors

Definition at line 86 of file PndGemSensor.h.

Referenced by PndGemFindHits::FindHits(), and PndGemFindHits::FindHits2().

86 { return fName.Data(); }
Double_t PndGemSensor::GetDistance ( Int_t  iSide,
Double_t  chan1,
Double_t  chan2 
)
inherited

Definition at line 494 of file PndGemSensor.cxx.

References CAMath::Abs(), Double_t, PndGemSensor::fInnerRadius, PndGemSensor::fNChannelsBack, PndGemSensor::fNChannelsFront, PndGemSensor::fOuterRadius, PndGemSensor::fPitch, and PndGemSensor::fType.

Referenced by PndGemFindClustersTB::AnalyzeClusters(), PndGemFindClustersTB::CompareDigiToClusters(), and PndGemDigitize::SimulateGaussianResponse().

494  {
495  if ( chan1 == -1 || chan2 == -1 ){
496  //cout<<"-W- !!! GetDistance(): channel number is -1 !!"<<endl;
497  return -1.;
498  }
499  if ( iSide == 0 && ( chan1 - fNChannelsFront/2. - 1 ) * ( chan2 - fNChannelsFront/2. ) < 0. ) return -1.;
500  if ( iSide == 1 && ( chan1 - fNChannelsBack /2. - 1 ) * ( chan2 - fNChannelsBack /2. ) < 0. ) return -1.;
501  if ( fType == 0 ) {
502  return TMath::Abs(chan1-chan2);
503  }
504  if ( fType == 1 ) {
505  return TMath::Abs(chan1-chan2);
506  }
507  if ( fType == 2 ) {
508  if ( iSide == 0 ) {
509  //Int_t nlStrips = (Int_t)(TMath::Ceil((fOuterRadius-fInnerRadius)/fPitch[0]));
510 // Int_t nsStrips = (Int_t)(TMath::Ceil(fInnerRadius/fPitch[0]));
511  //Int_t nlStrips = (Int_t)((fOuterRadius-fInnerRadius)/fPitch[0] + 0.5); //[R.K. 01/2017] unused variable?
512  Int_t nsStrips = (Int_t)(fInnerRadius/fPitch[0] +0.5);
513  Int_t part1 = 666;
514  Int_t part2 = 666;
515  //if ( TMath::Abs(chan1-fNChannelsFront/2) >= nsStrips*2 ) part1 = 0;
516  if ( TMath::Abs(chan1-fNChannelsFront/2 +0.5 ) > nsStrips*2 ) part1 = 0;
517  //else if ( TMath::Abs(chan1-fNChannelsFront/2) < nsStrips ) {
518  else if ( TMath::Abs(chan1-fNChannelsFront/2 +0.5 ) < nsStrips ) {
519  part1 = -1;
520  if ( chan1 < fNChannelsFront/2 ) chan1 = chan1-nsStrips;
521  else chan1 = chan1+nsStrips;
522  }
523  else part1 = 1;
524  //if ( TMath::Abs(chan2-fNChannelsFront/2) >= nsStrips*2 ) part2 = 0;
525  if ( TMath::Abs(chan2-fNChannelsFront/2 +0.5 ) > nsStrips*2 ) part2 = 0;
526  //else if ( TMath::Abs(chan2-fNChannelsFront/2) < nsStrips ) {
527  else if ( TMath::Abs(chan2-fNChannelsFront/2 +0.5 ) < nsStrips ) {
528  part2 = -1;
529  if ( chan2 < fNChannelsFront/2 ) chan2 = chan2-nsStrips;
530  else chan2 = chan2+nsStrips;
531  }
532  else part2 = 1;
533 
534  if ( part1*part2 == -1 ) return -1;
535  return TMath::Abs(chan1-chan2);
536  }
537  if ( iSide == 1 ) {
538  return TMath::Abs(chan1-chan2);
539  }
540  }
541  if ( fType == 3 ) {
542  if ( iSide == 0 ) {
543  // radial tree
544  // it returns distance assuming the inner ring as possible minimum situation.
545  Int_t ifac=1;
546  Double_t retval;
547  //extract channel step at the inner radius as radial tree factor
548  ifac = (Int_t) (fOuterRadius / fInnerRadius);
549  ifac |= (ifac >> 1);
550  ifac |= (ifac >> 2);
551  ifac |= (ifac >> 4);
552  ifac -= (ifac >> 1);
553  retval=(Double_t) TMath::Abs( (Int_t)(chan1/ifac) - (Int_t)(chan2/ifac) );
554 
555  //cout << "-I- PndGemSensor::GetDistance("<<iSide<<","<<chan1<<","<<chan2<<") returns " << retval <<endl;
556 
557  return retval;
558  }
559  if ( iSide == 1 ) {
560  return TMath::Abs(chan1-chan2);
561  }
562  }
563  return -1; // ?ADDED (Stefano)
564 }
Double_t fOuterRadius
Definition: PndGemSensor.h:204
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Int_t PndGemSensor::GetDistance ( Int_t  iSide,
Int_t  chanMin,
Int_t  chanMax,
Int_t  chanTest 
)
inherited

Definition at line 568 of file PndGemSensor.cxx.

References CAMath::Abs(), Double_t, PndGemSensor::fInnerRadius, PndGemSensor::fNChannelsBack, PndGemSensor::fNChannelsFront, PndGemSensor::fOuterRadius, PndGemSensor::fPitch, PndGemSensor::fType, and CAMath::Min().

568  {
569  if ( chanMin == -1 || chanMax == -1 || chanTest ==-1 ){
570  //cout<<"-W- !!! GetDistance(): channel number is -1 !!"<<endl;
571  return -1.;
572  }
573  if ( iSide == 0 && ( chanMin - fNChannelsFront/2 ) * ( chanTest - fNChannelsFront/2 ) < 0. ) return -1;
574  if ( iSide == 1 && ( chanMin - fNChannelsBack /2 ) * ( chanTest - fNChannelsBack /2 ) < 0. ) return -1;
575  if ( fType == 0 ) {
576  if ( chanTest > chanMin && chanTest < chanMax ) return 0;
577  return TMath::Min(TMath::Abs(chanTest-chanMax),TMath::Abs(chanTest-chanMin));
578  }
579  if ( fType == 1 ) {
580  if ( chanTest > chanMin && chanTest < chanMax ) return 0;
581  return TMath::Min(TMath::Abs(chanTest-chanMax),TMath::Abs(chanTest-chanMin));
582  }
583  if ( fType == 2 ) {
584  if ( iSide == 0 ) {
585  //Int_t nlStrips = (Int_t)(TMath::Ceil((fOuterRadius-fInnerRadius)/fPitch[0]));
586 // Int_t nsStrips = (Int_t)(TMath::Ceil(fInnerRadius/fPitch[0]));
587  //Int_t nlStrips = (Int_t)((fOuterRadius-fInnerRadius)/fPitch[0] + 0.5); //[R.K. 01/2017] unused variable?
588  Int_t nsStrips = (Int_t)(fInnerRadius/fPitch[0] + 0.5);
589  // THIS BROKEN VERTICAL STRIPS NEED SPECIAL ATTENTION
590  // DO NOT YET CONSIDER ALL THE PROBLEMS...
591  //if ( TMath::Abs(chanMin-fNChannelsFront/2) < nsStrips ) {
592  if ( TMath::Abs(chanMin-fNChannelsFront/2 +0.5) < nsStrips ) {
593  // cout << "chanMin " << chanMin << " is in bad position, consider " << fNChannelsFront << "/" << nlStrips << "/" << nsStrips << flush;
594  if ( chanMin < fNChannelsFront/2 ) chanMin -= nsStrips;
595  else chanMin += nsStrips;
596  // cout << " -----> " << chanMin << " ( " << chanMax << " , " << chanTest << " )" << endl;
597  }
598  //if ( TMath::Abs(chanMax-fNChannelsFront/2) < nsStrips ) {
599  if ( TMath::Abs(chanMax-fNChannelsFront/2 +0.5) < nsStrips ) {
600  // cout << "chanMax " << chanMax << " is in bad position, consider " << fNChannelsFront << "/" << nlStrips << "/" << nsStrips << flush;
601  if ( chanMax < fNChannelsFront/2 ) chanMax -= nsStrips;
602  else chanMax += nsStrips;
603  // cout << " -----> " << chanMax << " ( " << chanMin << " , " << chanTest << " )" << endl;
604  }
605  //if ( TMath::Abs(chanTest-fNChannelsFront/2) < nsStrips ) {
606  if ( TMath::Abs(chanTest-fNChannelsFront/2 +0.5) < nsStrips ) {
607  // cout << "chanTest " << chanTest << " is in bad position, consider " << fNChannelsFront << "/" << nlStrips << "/" << nsStrips << flush;
608  if ( chanTest < fNChannelsFront/2 ) chanTest -= nsStrips;
609  else chanTest += nsStrips;
610  // cout << " -----> " << chanTest << " ( " << chanMin << " , " << chanMax << " )" << endl;
611  }
612  if ( chanTest > chanMin && chanTest < chanMax ) return 0;
613  return TMath::Min(TMath::Abs(chanTest-chanMax),TMath::Abs(chanTest-chanMin));
614  }
615  if ( iSide == 1 ) {
616  if ( chanTest > chanMin && chanTest < chanMax ) return 0;
617  return TMath::Min(TMath::Abs(chanTest-chanMax),TMath::Abs(chanTest-chanMin));
618  }
619  }
620  if ( fType == 3 ) {
621  if ( iSide == 0 ) {
622  // radial tree
623  if ( chanTest > chanMin && chanTest < chanMax ) return 0;
624  // it returns distance assuming the inner ring as possible minimum situation.
625  Int_t ifac=1;
626  Double_t disMin, disMax, retval;
627  //extract channel step at the inner radius as radial tree factor
628  ifac = (Int_t) (fOuterRadius / fInnerRadius);
629  ifac |= (ifac >> 1);
630  ifac |= (ifac >> 2);
631  ifac |= (ifac >> 4);
632  ifac -= (ifac >> 1);
633  disMin=(Double_t) TMath::Abs( (Int_t)(chanTest/ifac) - (Int_t)(chanMin/ifac) );
634  disMax=(Double_t) TMath::Abs( (Int_t)(chanTest/ifac) - (Int_t)(chanMax/ifac) );
635  retval = TMath::Min(disMin,disMax);
636  //cout << "-I- PndGemSensor::GetDistance("<<iSide<<","<<chanMin<<","<<chanMax<<","<<chanTest<<") returns " << retval <<endl;
637 
638  return retval;
639  }
640  if ( iSide == 1 ) {
641  if ( chanTest > chanMin && chanTest < chanMax ) return 0;
642  return TMath::Min(TMath::Abs(chanTest-chanMax),TMath::Abs(chanTest-chanMin));
643  }
644  }
645  return -1; // ? ADDED (Stefano)
646 }
Double_t fOuterRadius
Definition: PndGemSensor.h:204
static T Abs(const T &x)
Definition: PndCAMath.h:39
static T Min(const T &x, const T &y)
Definition: PndCAMath.h:35
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Double_t PndGemSensor::GetDistance2 ( Int_t  iSide,
Double_t  chan1,
Double_t  chan2 
)
inherited

Definition at line 653 of file PndGemSensor.cxx.

References CAMath::Abs(), Double_t, PndGemSensor::fInnerRadius, PndGemSensor::fNChannelsBack, PndGemSensor::fNChannelsFront, PndGemSensor::fOuterRadius, PndGemSensor::fPitch, and PndGemSensor::fType.

Referenced by PndGemFindClusters::CompareDigiToClustersDigis().

653  {
654  if ( chan1 == -1 || chan2 == -1 ) return -1.;
655  if ( iSide == 0 && ( chan1 - fNChannelsFront/2. ) * ( chan2 - fNChannelsFront/2. ) < 0. ) return -1.;
656  if ( iSide == 1 && ( chan1 - fNChannelsBack /2. ) * ( chan2 - fNChannelsBack /2. ) < 0. ) return -1.;
657  if ( fType == 0 ) {
658  return TMath::Abs(chan1-chan2);
659  }
660  if ( fType == 1 ) {
661  return TMath::Abs(chan1-chan2);
662  }
663  if ( fType == 2 ) {
664  if ( iSide == 0 ) {
665 // Int_t nlStrips = (Int_t)(TMath::Ceil((fOuterRadius-fInnerRadius)/fPitch[0]));
666 // Int_t nsStrips = (Int_t)(TMath::Ceil(fInnerRadius/fPitch[0]));
667  //Int_t nlStrips = (Int_t)((fOuterRadius-fInnerRadius)/fPitch[0] + 0.5); //[R.K. 01/2017] unused variable?
668  Int_t nsStrips = (Int_t)(fInnerRadius/fPitch[0] + 0.5);
669  Int_t part1 = 666;
670  Int_t part2 = 666;
671  //if ( TMath::Abs(chan1-fNChannelsFront/2) > nsStrips*2 ) part1 = 0;
672  if ( TMath::Abs(chan1-fNChannelsFront/2 +0.5 ) > nsStrips*2 ) part1 = 0;
673  //else if ( TMath::Abs(chan1-fNChannelsFront/2) < nsStrips ) {
674  else if ( TMath::Abs(chan1-fNChannelsFront/2 +0.5 ) < nsStrips ) {
675  part1 = -1;
676  if ( chan1 < fNChannelsFront/2 ) chan1 = chan1-nsStrips;
677  else chan1 = chan1+nsStrips;
678  }
679  else part1 = 1;
680  //if ( TMath::Abs(chan2-fNChannelsFront/2) > nsStrips*2 ) part2 = 0;
681  if ( TMath::Abs(chan2-fNChannelsFront/2 +0.5 ) > nsStrips*2 ) part2 = 0;
682  //else if ( TMath::Abs(chan2-fNChannelsFront/2) < nsStrips ) {
683  else if ( TMath::Abs(chan2-fNChannelsFront/2 +0.5) < nsStrips ) {
684  part2 = -1;
685  if ( chan2 < fNChannelsFront/2 ) chan2 = chan2-nsStrips;
686  else chan2 = chan2+nsStrips;
687  }
688  else part2 = 1;
689 
690  if ( part1*part2 == -1 ) return -1;
691  return TMath::Abs(chan1-chan2);
692  }
693  if ( iSide == 1 ) {
694  return TMath::Abs(chan1-chan2);
695  }
696  }
697  // radial tree
698  if ( fType == 3 ) {
699  if ( iSide == 0 ) {
700  Int_t ifac=1,ifac_test=1, ifac1=1, ifac2=1,icom_ifac=0;
701  Int_t ideno,iring_test=0,iring1=0,iring2=0; //,icom_ring=0; //[R.K. 01/2017] unused variable?
702  Int_t itest1,itest2,i1ok=0,i2ok=0;
703  Int_t icom_chstep=0;
704  Double_t retval;
705  //extract the radial tree factor of outer radius
706  ifac = (Int_t) (fOuterRadius / fInnerRadius);
707  ifac |= (ifac >> 1);
708  ifac |= (ifac >> 2);
709  ifac |= (ifac >> 4);
710  ifac -= (ifac >> 1);
711  //find minimum ring for ch1 and ch2
712  itest1=(Int_t)chan1;
713  itest2=(Int_t)chan2;
714  for( ideno=ifac; ideno>=1; ideno/=2){
715  iring_test++;
716  //cout << "ideno="<< ideno <<" iring_test="<<iring_test<<" ifac_test="<<ifac_test<<endl;
717  itest1%=ideno;
718  if( itest1 == 0 && i1ok == 0){
719  //cout <<"Minimum ring of ch1 found at #"<<iring_test<<endl;
720  iring1=iring_test;
721  ifac1=ifac_test;
722  i1ok=1;
723  }
724  itest2%=ideno;
725  if( itest2 == 0 && i2ok == 0){
726  //cout <<"Minimum ring of ch2 found at #"<<iring_test<<endl;
727  iring2=iring_test;
728  ifac2=ifac_test;
729  i2ok=1;
730  }
731  ifac_test*=2;
732  }
733  //take minimum common ring
734  if( iring1 >= iring2 ){
735  //icom_ring=iring1; //[R.K. 01/2017] unused variable?
736  icom_ifac=ifac1;
737  }
738  else{
739  //icom_ring=iring2; //[R.K. 01/2017] unused variable?
740  icom_ifac=ifac2;
741  }
742  //channel step at the common ring
743  if(ifac%icom_ifac == 0){
744  icom_chstep=ifac/icom_ifac;
745  }
746  else{
747  cout<<"-W- !!! something wrong on ifac..in PndGemSensor::GetDistance2() !!!"<<endl;
748  }
749  retval = TMath::Abs(chan1-chan2)/(Double_t)icom_chstep;
750 
751  //cout << "-I- PndGemSensor::GetDistance2("<<iSide<<","<<chan1<<","<<chan2<<") returns "<< retval <<" for Common ring #"<<icom_ring<<" ifac="<<icom_ifac<<" ch_step="<<icom_chstep<<endl;
752 
753  return retval;
754  }
755  if ( iSide == 1 ) {
756  return TMath::Abs(chan1-chan2);
757  }
758  }
759  return -1; // ? ADDED (Stefano)
760 }
Double_t fOuterRadius
Definition: PndGemSensor.h:204
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Double_t PndGemSensor::GetInnerRadius ( ) const
inlineinherited

Definition at line 102 of file PndGemSensor.h.

References PndGemSensor::fInnerRadius.

Referenced by MyMainFrame::DrawDigis(), and PndGemIdealHitProducer::Exec().

102 { return fInnerRadius; }
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Double_t PndGemSensor::GetMeanChannel ( Int_t  iSide,
Double_t  chan1,
Double_t  weight1,
Double_t  chan2,
Double_t  weight2 
)
inherited

Definition at line 764 of file PndGemSensor.cxx.

References CAMath::Abs(), Double_t, PndGemSensor::fInnerRadius, PndGemSensor::fNChannelsBack, PndGemSensor::fNChannelsFront, PndGemSensor::fOuterRadius, PndGemSensor::fPitch, and PndGemSensor::fType.

Referenced by PndGemFindClustersTB::AddDigiToCluster(), and PndGemFindClusters::AddDigiToCluster().

764  {
765  if ( chan1 == -1 || chan2 == -1 ) return -1.;
766  if ( iSide == 0 && ( chan1 - fNChannelsFront/2. ) * ( chan2 - fNChannelsFront/2. ) < 0. ) return -1.;
767  if ( iSide == 1 && ( chan1 - fNChannelsBack /2. ) * ( chan2 - fNChannelsBack /2. ) < 0. ) return -1.;
768  if ( fType == 0 ) {
769  return (chan1*weight1+chan2*weight2)/(weight1+weight2);
770  }
771  if ( fType == 1 ) {
772  return (chan1*weight1+chan2*weight2)/(weight1+weight2);
773  }
774  if ( fType == 2 ) {
775  if ( iSide == 0 ) {
776  //Int_t nlStrips = (Int_t)(TMath::Ceil((fOuterRadius-fInnerRadius)/fPitch[0]));
777 // Int_t nsStrips = (Int_t)(TMath::Ceil(fInnerRadius/fPitch[0]));
778  Int_t nlStrips = (Int_t)((fOuterRadius-fInnerRadius)/fPitch[0] + 0.5);
779  Int_t nsStrips = (Int_t)(fInnerRadius/fPitch[0] + 0.5);
780  Int_t part1 = 666;
781  Int_t part2 = 666;
782  //if ( TMath::Abs(chan1-fNChannelsFront/2) >= nsStrips*2 ) part1 = 0;
783  if ( TMath::Abs(chan1-fNChannelsFront/2 +0.5 ) > nsStrips*2 ) part1 = 0;
784  //else if ( TMath::Abs(chan1-fNChannelsFront/2) < nsStrips ) {
785  else if ( TMath::Abs(chan1-fNChannelsFront/2 +0.5 ) < nsStrips ) {
786  part1 = -1;
787  if ( chan1 < fNChannelsFront/2 ) chan1 = chan1-nsStrips;
788  else chan1 = chan1+nsStrips;
789  }
790  else part1 = 1;
791  //if ( TMath::Abs(chan2-fNChannelsFront/2) >= nsStrips*2 ) part2 = 0;
792  if ( TMath::Abs(chan2-fNChannelsFront/2 +0.5) > nsStrips*2 ) part2 = 0;
793  //else if ( TMath::Abs(chan2-fNChannelsFront/2) < nsStrips ) {
794  else if ( TMath::Abs(chan2-fNChannelsFront/2 +0.5) < nsStrips ) {
795  part2 = -1;
796  if ( chan2 < fNChannelsFront/2 ) chan2 = chan2-nsStrips;
797  else chan2 = chan2+nsStrips;
798  }
799  else part2 = 1;
800 
801  if ( part1*part2 == -1 ) return -1;
802 
803  Double_t meanCh = (chan1*weight1+chan2*weight2)/(weight1+weight2);
804 
805  if ( part1+part2 < 0 ) {
806  if ( meanCh > nlStrips && meanCh < nlStrips+nsStrips ) meanCh += nsStrips;
807  if ( meanCh > fNChannelsFront/2+nsStrips && meanCh < fNChannelsFront-nlStrips ) meanCh -= nsStrips;
808  }
809 
810  return meanCh;
811  }
812  if ( iSide == 1 ) {
813  return (chan1*weight1+chan2*weight2)/(weight1+weight2);
814  }
815  }
816  if ( fType == 3 ) {
817  return (chan1*weight1+chan2*weight2)/(weight1+weight2);
818  }
819  return -1; // ? ADDED (Stefano)
820 }
Double_t fOuterRadius
Definition: PndGemSensor.h:204
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Int_t PndGemSensor::GetNChannels ( ) const
inlineinherited
Int_t PndGemSensor::GetNChannelsBack ( ) const
inlineinherited

Definition at line 112 of file PndGemSensor.h.

References PndGemSensor::fNChannelsBack.

Referenced by MyMainFrame::DrawDigis(), and PndGemSensorMonitor().

112 { return fNChannelsBack; }
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t PndGemSensor::GetNChannelsFront ( ) const
inlineinherited

Definition at line 111 of file PndGemSensor.h.

References PndGemSensor::fNChannelsFront.

Referenced by MyMainFrame::DrawDigis(), and PndGemSensorMonitor().

111 { return fNChannelsFront; }
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Int_t PndGemSensor::GetNeighbours ( Int_t  iSide,
Int_t  iChan,
Int_t &  nChan1,
Int_t &  nChan2,
Int_t &  nChan3 
)
inherited

Definition at line 362 of file PndGemSensor.cxx.

References PndGemSensor::fType.

Referenced by CheckNeighbours().

362  {
363  nChan1=-1;
364  nChan2=-1;
365  nChan3=-1;
366  if ( fType == 0 ) {
367  nChan1 = iChan-1;
368  nChan2 = iChan+1;
369  return 2;
370  }
371  if ( fType == 1 ) {
372  nChan1 = iChan-1;
373  nChan2 = iChan+1;
374  return 2;
375  }
376  if ( fType == 2 ) {
377  if ( iSide == 1 ) {
378  nChan1 = iChan-1;
379  nChan2 = iChan+1;
380  return 2;
381  }
382  if ( iSide == 0 ) {
383  nChan1 = iChan-1;
384  nChan2 = iChan+1;
385  return 2;
386  }
387  }
388  if ( fType == 3 ) {
389  if ( iSide == 0 ) {// radial tree
390  // need to decide what to return...(?)
391  nChan1 = iChan-1;
392  nChan2 = iChan+1;
393  return 2;
394  }
395  if ( iSide == 1 ) {
396  nChan1 = iChan-1;
397  nChan2 = iChan+1;
398  }
399  }
400  return 0;
401 }
Double_t PndGemSensor::GetOuterRadius ( ) const
inlineinherited
Double_t PndGemSensor::GetPitch ( Int_t  index) const
inlineinherited

Definition at line 106 of file PndGemSensor.h.

References PndGemSensor::fPitch.

Referenced by MyMainFrame::DrawDigis(), and PndGemIdealHitProducer::Exec().

106 { return fPitch[index]; }
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t PndGemSensor::GetRotation ( ) const
inlineinherited

Definition at line 101 of file PndGemSensor.h.

References PndGemSensor::fRotation.

101 { return fRotation; }
Double_t fRotation
Definition: PndGemSensor.h:202
Int_t PndGemSensor::GetSensorNr ( ) const
inlineinherited

Definition at line 95 of file PndGemSensor.h.

References PndGemSensor::fDetectorId.

Referenced by PndGemStation::AddSensor(), PndGemMonitor::CreateSensorMonitor(), PndGemFindHits::Exec(), PndGemFindHits::FindHits(), PndGemFindHits::FindHits2(), and PndGemSensor::Print().

95  { // sensor number within station
96  return ( ( fDetectorId & ( 3<< 6) ) >> 6 ); }
Int_t fDetectorId
Definition: PndGemSensor.h:199
Int_t PndGemSensor::GetSensorPart ( Int_t  iSide,
Int_t  chan 
)
inherited

Definition at line 405 of file PndGemSensor.cxx.

References CAMath::Abs(), PndGemSensor::fInnerRadius, PndGemSensor::fNChannelsFront, PndGemSensor::fPitch, and PndGemSensor::fType.

Referenced by PndGemFindClustersTB::CheckCluster().

405  {
406  if ( fType == 0 ) {
407  return -1;
408  }
409  if ( fType == 1 ) {
410  return -1;
411  }
412  if ( fType == 2 ) {
413  if ( iSide == 1 ) {
414  return -1;
415  }
416  if ( iSide == 0 ) {
417 // Int_t nsStrips = (Int_t)(TMath::Ceil(fInnerRadius/fPitch[0]));
418  Int_t nsStrips = (Int_t)(fInnerRadius/fPitch[0]+0.5);
419  //if ( TMath::Abs(chan-fNChannelsFront/2) > nsStrips*2 )
420  if ( TMath::Abs(chan-fNChannelsFront/2 +0.5 ) > nsStrips*2 )
421  return 0;
422  //else if ( TMath::Abs(chan-fNChannelsFront/2) < nsStrips )
423  else if ( TMath::Abs(chan-fNChannelsFront/2 +0.5) < nsStrips )
424  return 2;
425  else
426  return 1;
427  }
428  }
429  if ( fType == 3 ) {
430  //should it be irregular??
431  return -1;
432  }
433  return -1;
434 }
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Int_t PndGemSensor::GetSideChannels ( Int_t  si) const
inlineinherited

Definition at line 114 of file PndGemSensor.h.

References PndGemSensor::fNChannelsBack, and PndGemSensor::fNChannelsFront.

Referenced by PndGemDigiAna::CreateHistos().

114 { if ( si==0 ) return fNChannelsFront; return fNChannelsBack;} // will return NChFront for si==0, and NChBack for anything else
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Double_t PndGemSensor::GetSigmaX ( ) const
inlineinherited

Definition at line 107 of file PndGemSensor.h.

References PndGemSensor::fSigmaX.

107 { return fSigmaX; }
Double_t fSigmaX
Definition: PndGemSensor.h:218
Double_t PndGemSensor::GetSigmaXY ( ) const
inlineinherited

Definition at line 109 of file PndGemSensor.h.

References PndGemSensor::fSigmaXY.

109 { return fSigmaXY; }
Double_t fSigmaXY
Definition: PndGemSensor.h:220
Double_t PndGemSensor::GetSigmaY ( ) const
inlineinherited

Definition at line 108 of file PndGemSensor.h.

References PndGemSensor::fSigmaY.

108 { return fSigmaY; }
Double_t fSigmaY
Definition: PndGemSensor.h:219
Int_t PndGemSensor::GetStationNr ( ) const
inlineinherited

Definition at line 93 of file PndGemSensor.h.

References PndGemSensor::fDetectorId.

Referenced by PndGemMonitor::CreateSensorMonitor(), PndGemFindHits::FindHits(), and PndGemFindHits::FindHits2().

93  {
94  return ( ( fDetectorId & (8191<< 8) ) >> 8 ); }
Int_t fDetectorId
Definition: PndGemSensor.h:199
Double_t PndGemSensor::GetStripAngle ( Int_t  index) const
inlineinherited

Definition at line 105 of file PndGemSensor.h.

References PndGemSensor::fStripAngle.

Referenced by MyMainFrame::DrawDigis(), and PndGemIdealHitProducer::Exec().

105 { return fStripAngle[index]; }
Double_t fStripAngle[2]
Definition: PndGemSensor.h:206
Double_t PndGemSensor::GetStripOrientation ( Double_t  x,
Double_t  y,
Int_t  iSide 
)
inherited

Activate the channels corresponding to a MCPoint.

Parameters
iptIndex of MCPoint
xx coordinate of point (global c.s.)
yy coordinate of point (global c.s.) kTRUE if the point is inside the sensor, else kFALSE

Definition at line 438 of file PndGemSensor.cxx.

References Double_t, PndGemSensor::fType, PndGemSensor::Inside(), Pi, and CAMath::Sqrt().

Referenced by PndGemDigitize::SimulateGaussianResponse().

438  {
439  if (iSide !=0 && iSide != 1) return -1.;
440  if ( !Inside(x,y) ) return -1.;
441 
442  if ( fType == 1 ) {
443  return -1.;
444  }
445  if ( fType == 0 ) { // angle info for iSide 0, radius info for iSide 1
446  if ( iSide == 0 ) {
447  Double_t radius = TMath::Sqrt(x*x+y*y);
448  Double_t hitPhi = TMath::ACos(y/radius);
449  if ( x < 0. )
450  hitPhi = 2.*TMath::Pi()-hitPhi;
451  hitPhi = 2.*TMath::Pi()-hitPhi;
452  return hitPhi;
453  }
454  if ( iSide == 1 ) {
455  Double_t radius = TMath::Sqrt(x*x+y*y);
456  Double_t hitPhi = TMath::ACos(y/radius);
457  if ( x < 0. )
458  hitPhi = 2.*TMath::Pi()-hitPhi;
459  hitPhi = 2.*TMath::Pi()-hitPhi;
460  return hitPhi+TMath::Pi()/2.;
461  }
462  }
463  if ( fType == 2 ) { // x y strips
464  if ( iSide == 0 ) { // x information encoded
465  return 0.;
466  }
467  if ( iSide == 1 ) { // y information encoded
468  return TMath::Pi()/2.;
469  }
470  }
471  if ( fType == 3 ) { // angle info for iSide 0, radius info for iSide 1
472  if ( iSide == 0 ) {
473  Double_t radius = TMath::Sqrt(x*x+y*y);
474  Double_t hitPhi = TMath::ACos(y/radius);
475  if ( x < 0. )
476  hitPhi = 2.*TMath::Pi()-hitPhi;
477  hitPhi = 2.*TMath::Pi()-hitPhi;
478  return hitPhi;
479  }
480  if ( iSide == 1 ) {
481  Double_t radius = TMath::Sqrt(x*x+y*y);
482  Double_t hitPhi = TMath::ACos(y/radius);
483  if ( x < 0. )
484  hitPhi = 2.*TMath::Pi()-hitPhi;
485  hitPhi = 2.*TMath::Pi()-hitPhi;
486  return hitPhi+TMath::Pi()/2.;
487  }
488  }
489  return -1.;
490 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Double_t
Bool_t Inside(Double_t x, Double_t y)
Double_t x
Double_t y
Double_t Pi
Int_t PndGemSensor::GetSystemId ( ) const
inlineinherited

Definition at line 91 of file PndGemSensor.h.

References PndGemSensor::fDetectorId.

91  {
92  return ( ( fDetectorId & ( 31<<27) ) >> 27); }
Int_t fDetectorId
Definition: PndGemSensor.h:199
Int_t PndGemSensor::GetType ( ) const
inlineinherited

Definition at line 97 of file PndGemSensor.h.

References PndGemSensor::fType.

97 { return fType; }
Double_t PndGemSensor::GetX0 ( ) const
inlineinherited

Definition at line 98 of file PndGemSensor.h.

References PndGemSensor::fPosition.

Referenced by PndSttMvdGemTracking::SetupGEMPlanes().

98 { return fPosition[0]; }
Double_t fPosition[3]
Definition: PndGemSensor.h:201
Double_t PndGemSensor::GetY0 ( ) const
inlineinherited

Definition at line 99 of file PndGemSensor.h.

References PndGemSensor::fPosition.

Referenced by PndSttMvdGemTracking::SetupGEMPlanes().

99 { return fPosition[1]; }
Double_t fPosition[3]
Definition: PndGemSensor.h:201
Double_t PndGemSensor::GetZ0 ( ) const
inlineinherited
Bool_t PndGemSensor::Inside ( Double_t  x,
Double_t  y 
)
inherited

Test whether a coordinate pair (x,y) in global coordinates is inside the sensor

Definition at line 1027 of file PndGemSensor.cxx.

References CAMath::Abs(), Double_t, PndGemSensor::fInnerRadius, PndGemSensor::fOuterRadius, PndGemSensor::fStripAngle, and y.

Referenced by PndGemSensor::GetChannel(), PndGemSensor::GetChannel2(), PndGemSensor::GetStripOrientation(), and PndGemSensor::Intersect().

1027  {
1028  if ( TMath::Abs(x) < fStripAngle[1]/2. ) return kFALSE;
1029  Double_t radSq = x*x+y*y;
1030  if ( radSq < fInnerRadius*fInnerRadius ) return kFALSE;
1031  if ( radSq > fOuterRadius*fOuterRadius ) return kFALSE;
1032  return kTRUE;
1033 }
Double_t fOuterRadius
Definition: PndGemSensor.h:204
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Double_t fStripAngle[2]
Definition: PndGemSensor.h:206
Double_t x
Double_t y
Bool_t PndGemSensor::Inside ( Double_t  radius)
inherited

Definition at line 1037 of file PndGemSensor.cxx.

References PndGemSensor::fInnerRadius, and PndGemSensor::fOuterRadius.

1037  {
1038  if ( radius < fInnerRadius ) return kFALSE;
1039  if ( radius > fOuterRadius ) return kFALSE;
1040  return kTRUE;
1041 }
Double_t fOuterRadius
Definition: PndGemSensor.h:204
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Int_t PndGemSensor::Intersect ( Double_t  iFStrip,
Double_t  iBStrip,
Double_t xCross,
Double_t yCross,
Double_t zCross 
)
inherited

Calculates the coordinates of the intersections of front strip i with back strip j in the global coordinate system

Parameters
iFStripFront strip number
iBStripBack strip number
xCrossVector of x coordinates of crossings [cm]
yCrossVector of y coordinates of crossings [cm] Number of intersections

Definition at line 1045 of file PndGemSensor.cxx.

References CAMath::Cos(), Double_t, PndGemSensor::fDetectorId, PndGemSensor::fInnerRadius, PndGemSensor::fNChannelsBack, PndGemSensor::fNChannelsFront, PndGemSensor::fOuterRadius, PndGemSensor::fPitch, PndGemSensor::fPosition, PndGemSensor::fType, PndGemSensor::Inside(), phi, Pi, and CAMath::Sin().

Referenced by PndGemFindHits::FindHits(), and PndGemFindHits::FindHits2().

1045  {
1046  // cout << "trying to find intersection of strip " << iFStrip << " and " << iBStrip << endl;
1047 
1048  if ( fType == -1 ) {
1049  cout << "-E- !!! not supported anymore" << endl;
1050  return -1;
1051  }
1052  // the hits are on different sides
1053  if ( iFStrip < fNChannelsFront/2 && iBStrip >= fNChannelsBack/2 ) return -1;
1054  if ( iFStrip >= fNChannelsFront/2 && iBStrip < fNChannelsBack/2 ) return -1;
1055 
1056  Double_t bs = iBStrip;
1057  if ( bs >= fNChannelsBack/2 ) bs -= fNChannelsBack/2;
1058  if ( fType == 0 ) { // r phi strips
1059  Double_t phi = fPitch[0]*((Double_t)iFStrip-0.5) / fInnerRadius;
1060  Double_t radius = fPitch[1]*((Double_t) bs -0.5) + fInnerRadius;
1061  yCross = radius*TMath::Cos(phi);
1062  xCross = -radius*TMath::Sin(phi);
1063  zCross = fPosition[2];
1064  if ( Inside(xCross,yCross) )
1065  return fDetectorId;
1066  else
1067  return -1;
1068  }
1069  if ( fType == 2 ) { // x y strips
1070  //Int_t nlStrips = (Int_t)(TMath::Ceil((fOuterRadius-fInnerRadius)/fPitch[0]));
1071  //Int_t nsStrips = (Int_t)(TMath::Ceil(fInnerRadius/fPitch[0]));
1072  Int_t nlStrips = (Int_t)((fOuterRadius-fInnerRadius)/fPitch[0] + 0.5);
1073  Int_t nsStrips = (Int_t)(fInnerRadius/fPitch[0] + 0.5);
1074  //Double_t x = -666.; //[R.K. 01/2017] unused variable?
1075  yCross = -fOuterRadius+(Double_t(bs)+0.5)*fPitch[1];
1076  zCross = fPosition[2];
1077  if ( iFStrip < nlStrips ) {
1078  xCross = -fOuterRadius+(Double_t(iFStrip)+0.5)*fPitch[0];
1079  if ( !Inside(xCross,yCross) ) return -1;
1080  return fDetectorId;
1081  }
1082  if ( iFStrip < nlStrips+ nsStrips ) {
1083  if ( bs < fNChannelsBack/4 ) return -1;
1084  xCross = -fOuterRadius+(Double_t(iFStrip)+0.5)*fPitch[0];
1085  if ( !Inside(xCross,yCross) ) return -1;
1086  return fDetectorId;
1087  }
1088  if ( iFStrip < nlStrips+2*nsStrips ) {
1089  if ( bs >= fNChannelsBack/4 ) return -1;
1090  xCross = -fOuterRadius+(Double_t(iFStrip-nsStrips)+0.5)*fPitch[0];
1091  if ( !Inside(xCross,yCross) ) return -1;
1092  return fDetectorId;
1093  }
1094  if ( iFStrip < nlStrips+3*nsStrips ) {
1095  if ( bs < fNChannelsBack/4 ) return -1;
1096  xCross = -fOuterRadius+(Double_t(iFStrip-nsStrips)+0.5)*fPitch[0];
1097  if ( !Inside(xCross,yCross) ) return -1;
1098  return fDetectorId;
1099  }
1100  if ( iFStrip < nlStrips+4*nsStrips ) {
1101  if ( bs >= fNChannelsBack/4 ) return -1;
1102  xCross = -fOuterRadius+(Double_t(iFStrip-3*nsStrips)+0.5)*fPitch[0];
1103  if ( !Inside(xCross,yCross) ) return -1;
1104  return fDetectorId;
1105  }
1106  }
1107  if ( fType == 3 ) {
1108  Double_t phi = 2. * TMath::Pi() * ((Double_t)iFStrip-0.5) / (Double_t)fNChannelsFront;
1109  Double_t radius = fPitch[1]*((Double_t) bs -0.5) + fInnerRadius;
1110  yCross = radius*TMath::Cos(phi);
1111  xCross = -radius*TMath::Sin(phi);
1112  zCross = fPosition[2];
1113  if ( Inside(xCross,yCross) )
1114  return fDetectorId;
1115  else
1116  return -1;
1117  }
1118  return -1;
1119 }
static T Sin(const T &x)
Definition: PndCAMath.h:42
Double_t fOuterRadius
Definition: PndGemSensor.h:204
static T Cos(const T &x)
Definition: PndCAMath.h:43
Double_t fPosition[3]
Definition: PndGemSensor.h:201
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Bool_t Inside(Double_t x, Double_t y)
Int_t fDetectorId
Definition: PndGemSensor.h:199
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Double_t Pi
Int_t PndGemSensor::Intersect ( Double_t  iFStrip,
Double_t  iBStrip,
Double_t xCross,
Double_t yCross,
Double_t zCross,
Double_t dr,
Double_t dp 
)
inherited

Definition at line 1124 of file PndGemSensor.cxx.

References CAMath::Cos(), Double_t, PndGemSensor::fDetectorId, PndGemSensor::fInnerRadius, PndGemSensor::fNChannelsBack, PndGemSensor::fNChannelsFront, PndGemSensor::fOuterRadius, PndGemSensor::fPitch, PndGemSensor::fPosition, PndGemSensor::fType, PndGemSensor::Inside(), phi, Pi, CAMath::Sin(), and CAMath::Sqrt().

1125  {
1126  // cout << "trying to find intersection of strip " << iFStrip << " and " << iBStrip << endl;
1127 
1128  if ( fType == -1 ) {
1129  cout << "-E- !!! not supported anymore" << endl;
1130  return -1;
1131  }
1132  // the hits are on different sides
1133  //cout << iFStrip << " of " << fNChannelsFront << " and " << iBStrip << " of " << fNChannelsBack << endl;
1134  if ( iFStrip < fNChannelsFront/2 && iBStrip >= fNChannelsBack/2 ) return -1;
1135  if ( iFStrip >= fNChannelsFront/2 && iBStrip < fNChannelsBack/2 ) return -1;
1136  Double_t bs = iBStrip;
1137  if ( bs >= fNChannelsBack/2 ) bs -= fNChannelsBack/2;
1138  if ( fType == 0 ) { // r phi strips
1139  Double_t phi = fPitch[0]*((Double_t)iFStrip-0.5) / fInnerRadius;
1140  Double_t radius = fPitch[1]*((Double_t) bs -0.5) + fInnerRadius;
1141  yCross = radius*TMath::Cos(phi);
1142  xCross = -radius*TMath::Sin(phi);
1143  zCross = fPosition[2];
1144 
1145  dp = fPitch[0]*radius/fInnerRadius/TMath::Sqrt(12.);
1146  dr = fPitch[1]/TMath::Sqrt(12.);
1147 
1148  if ( Inside(xCross,yCross) )
1149  return fDetectorId;
1150  else
1151  return -1;
1152  }
1153  if ( fType == 2 ) { // x y strips
1154  //Int_t nlStrips = (Int_t)(TMath::Ceil((fOuterRadius-fInnerRadius)/fPitch[0]));
1155 // Int_t nsStrips = (Int_t)(TMath::Ceil(fInnerRadius/fPitch[0]));
1156  Int_t nlStrips = (Int_t)((fOuterRadius-fInnerRadius)/fPitch[0] + 0.5);
1157  Int_t nsStrips = (Int_t)(fInnerRadius/fPitch[0] + 0.5);
1158  //Double_t x = -666.; //[R.K. 01/2017] unused variable?
1159  yCross = -fOuterRadius+(Double_t(bs)+0.5)*fPitch[1];
1160  zCross = fPosition[2];
1161 
1162  if ( iFStrip < nlStrips )
1163  xCross = -fOuterRadius+(Double_t(iFStrip)+0.5)*fPitch[0];
1164  else if ( iFStrip < nlStrips+ nsStrips ) {
1165  if ( bs < fNChannelsBack/4 ) return -1;
1166  xCross = (Double_t(iFStrip-nlStrips-1*nsStrips)+0.5)*fPitch[0];
1167  }
1168  else if ( iFStrip < nlStrips+2*nsStrips ) {
1169  if ( bs >= fNChannelsBack/4 ) return -1;
1170  xCross = (Double_t(iFStrip-nlStrips-2*nsStrips)+0.5)*fPitch[0];
1171  }
1172  else if ( iFStrip < nlStrips+3*nsStrips ) {
1173  if ( bs < fNChannelsBack/4 ) return -1;
1174  xCross = (Double_t(iFStrip-nlStrips-2*nsStrips)+0.5)*fPitch[0];
1175  }
1176  else if ( iFStrip < nlStrips+4*nsStrips ) {
1177  if ( bs >= fNChannelsBack/4 ) return -1;
1178  xCross = (Double_t(iFStrip-nlStrips-3*nsStrips)+0.5)*fPitch[0];
1179  }
1180  else
1181  xCross = (Double_t(iFStrip-nlStrips-3*nsStrips)+0.5)*fPitch[0];
1182 
1183  if ( !Inside(xCross,yCross) ) return -1;
1184 
1185  /*
1186  Double_t rMax = TMath::Sqrt( (TMath::Abs(xCross)+fPitch[0])*(TMath::Abs(xCross)+fPitch[0])+
1187  (TMath::Abs(yCross)+fPitch[1])*(TMath::Abs(yCross)+fPitch[1]) );
1188  Double_t rMin = TMath::Sqrt( (TMath::Abs(xCross)-fPitch[0])*(TMath::Abs(xCross)-fPitch[0])+
1189  (TMath::Abs(yCross)-fPitch[1])*(TMath::Abs(yCross)-fPitch[1]) );
1190 ` Double_t phi1 = TMath::ATan( (TMath::Abs(yCross)-fPitch[1])/(TMath::Abs(xCross)+fPitch[0]) );
1191  Double_t phi2 = TMath::ATan( (TMath::Abs(yCross)+fPitch[1])/(TMath::Abs(xCross)-fPitch[0]) );
1192  dp = TMath::Abs(phi1-phi2);
1193  dp = TMath::Tan(dp)*(rMax+rMin)/2./TMath::Sqrt(12.);
1194  dr = (rMax-rMin)/TMath::Sqrt(12.);
1195  // if ( dp > 350 )
1196  // dp = TMath::Abs(360.-dp);
1197  */
1198  dr = fPitch[0]/TMath::Sqrt(12.);
1199  dp = fPitch[1]/TMath::Sqrt(12.);
1200 
1201  return fDetectorId;
1202  }
1203  if ( fType == 3 ) { // r_a phi strips
1204  Double_t phi = 2. * TMath::Pi() * ((Double_t)iFStrip-0.5) / (Double_t)fNChannelsFront;
1205  Double_t radius = fPitch[1]*((Double_t) bs -0.5) + fInnerRadius;
1206  yCross = radius*TMath::Cos(phi);
1207  xCross = -radius*TMath::Sin(phi);
1208  zCross = fPosition[2];
1209  //extract channel factor at the hit radius
1210  Int_t ifac_r=1;
1211  ifac_r = (Int_t) ( radius / fInnerRadius);
1212  ifac_r |= (ifac_r >> 1);
1213  ifac_r |= (ifac_r >> 2);
1214  ifac_r |= (ifac_r >> 4);
1215  ifac_r -= (ifac_r >> 1);
1216  dp = fPitch[0]*radius/fInnerRadius/ifac_r/TMath::Sqrt(12.);
1217  dr = fPitch[1]/TMath::Sqrt(12.);
1218 
1219  if ( Inside(xCross,yCross) )
1220  return fDetectorId;
1221  else
1222  return -1;
1223  }
1224 
1225  return -1;
1226 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
static T Sin(const T &x)
Definition: PndCAMath.h:42
Double_t fOuterRadius
Definition: PndGemSensor.h:204
static T Cos(const T &x)
Definition: PndCAMath.h:43
Double_t fPosition[3]
Definition: PndGemSensor.h:201
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Bool_t Inside(Double_t x, Double_t y)
Int_t fDetectorId
Definition: PndGemSensor.h:199
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Double_t Pi
Int_t PndGemSensor::Intersect ( Double_t  iFStrip,
Double_t  iBStrip,
Double_t xCross,
Double_t yCross,
Double_t zCross,
Double_t dx,
Double_t dy,
Double_t dr,
Double_t dp 
)
inherited

Definition at line 1230 of file PndGemSensor.cxx.

References CAMath::Abs(), CAMath::Cos(), Double_t, PndGemSensor::fDetectorId, PndGemSensor::fInnerRadius, PndGemSensor::fNChannelsBack, PndGemSensor::fNChannelsFront, PndGemSensor::fOuterRadius, PndGemSensor::fPitch, PndGemSensor::fPosition, PndGemSensor::fType, PndGemSensor::Inside(), phi, Pi, CAMath::Sin(), and CAMath::Sqrt().

1231  {
1232  // cout << "trying to find intersection of strip " << iFStrip << " and " << iBStrip << endl;
1233  if ( fType == -1 ) {
1234  cout << "-E- !!! not supported anymore" << endl;
1235  return -1;
1236  }
1237  // the hits are on different sides
1238  //cout << iFStrip << " of " << fNChannelsFront << " and " << iBStrip << " of " << fNChannelsBack << endl;
1239  if ( iFStrip < fNChannelsFront/2 && iBStrip >= fNChannelsBack/2 ) return -1;
1240  if ( iFStrip >= fNChannelsFront/2 && iBStrip < fNChannelsBack/2 ) return -1;
1241  Double_t bs = iBStrip;
1242  if ( bs >= fNChannelsBack/2 ) bs -= fNChannelsBack/2;
1243  if ( fType == 0 ) { // r phi strips
1244  Double_t phi = fPitch[0]*((Double_t)iFStrip-0.5) / fInnerRadius; // the angle is counted from Y axis
1245  Double_t radius = fPitch[1]*((Double_t) bs -0.5) + fInnerRadius;
1246  yCross = radius*TMath::Cos(phi);
1247  xCross = -radius*TMath::Sin(phi);
1248  zCross = fPosition[2];
1249 
1250  dp = fPitch[0]*radius/fInnerRadius/TMath::Sqrt(12.);
1251  dr = fPitch[1]/TMath::Sqrt(12.);
1254 
1255  if ( Inside(xCross,yCross) )
1256  return fDetectorId;
1257  else
1258  return -1;
1259  }
1260  if ( fType == 2 ) { // x y strips
1261  //Int_t nlStrips = (Int_t)(TMath::Ceil((fOuterRadius-fInnerRadius)/fPitch[0]));
1262  //Int_t nsStrips = (Int_t)(TMath::Ceil(fInnerRadius/fPitch[0]));
1263  Int_t nlStrips = (Int_t)((fOuterRadius-fInnerRadius)/fPitch[0] + 0.5);
1264  Int_t nsStrips = (Int_t)(fInnerRadius/fPitch[0] + 0.5);
1265  //cout << " nlStrips="<<nlStrips<<" nsStrips="<<nsStrips<<endl;
1266  //Double_t x = -666.; //[R.K. 01/2017] unused variable?
1267  yCross = -fOuterRadius+(Double_t(bs)+0.5)*fPitch[1];
1268  zCross = fPosition[2];
1269 
1270  if ( iFStrip < nlStrips )
1271  xCross = -fOuterRadius+(Double_t(iFStrip)+0.5)*fPitch[0];
1272  else if ( iFStrip < nlStrips+ nsStrips ) {
1273  if ( bs < fNChannelsBack/4 ) return -1;
1274  xCross = (Double_t(iFStrip-nlStrips-1*nsStrips)+0.5)*fPitch[0];
1275  }
1276  else if ( iFStrip < nlStrips+2*nsStrips ) {
1277  if ( bs >= fNChannelsBack/4 ) return -1;
1278  xCross = (Double_t(iFStrip-nlStrips-2*nsStrips)+0.5)*fPitch[0];
1279  }
1280  else if ( iFStrip < nlStrips+3*nsStrips ) {
1281  if ( bs < fNChannelsBack/4 ) return -1;
1282  xCross = (Double_t(iFStrip-nlStrips-2*nsStrips)+0.5)*fPitch[0];
1283  }
1284  else if ( iFStrip < nlStrips+4*nsStrips ) {
1285  if ( bs >= fNChannelsBack/4 ) return -1;
1286  xCross = (Double_t(iFStrip-nlStrips-3*nsStrips)+0.5)*fPitch[0];
1287  }
1288  else
1289  xCross = (Double_t(iFStrip-nlStrips-3*nsStrips)+0.5)*fPitch[0];
1290 
1291 
1292  if ( !Inside(xCross,yCross) ) return -1;
1293 
1294  /*
1295  Double_t rMax = TMath::Sqrt( (TMath::Abs(xCross)+fPitch[0])*(TMath::Abs(xCross)+fPitch[0])+
1296  (TMath::Abs(yCross)+fPitch[1])*(TMath::Abs(yCross)+fPitch[1]) );
1297  Double_t rMin = TMath::Sqrt( (TMath::Abs(xCross)-fPitch[0])*(TMath::Abs(xCross)-fPitch[0])+
1298  (TMath::Abs(yCross)-fPitch[1])*(TMath::Abs(yCross)-fPitch[1]) );
1299 ` Double_t phi1 = TMath::ATan( (TMath::Abs(yCross)-fPitch[1])/(TMath::Abs(xCross)+fPitch[0]) );
1300  Double_t phi2 = TMath::ATan( (TMath::Abs(yCross)+fPitch[1])/(TMath::Abs(xCross)-fPitch[0]) );
1301  dp = TMath::Abs(phi1-phi2);
1302  dp = TMath::Tan(dp)*(rMax+rMin)/2./TMath::Sqrt(12.);
1303  dr = (rMax-rMin)/TMath::Sqrt(12.);
1304  // if ( dp > 350 )
1305  // dp = TMath::Abs(360.-dp);
1306  */
1307  dx = fPitch[0]/TMath::Sqrt(12.);
1308  dy = fPitch[1]/TMath::Sqrt(12.);
1309  dr = 0.;
1310  dp = 0.;
1311 
1312  return fDetectorId;
1313  }
1314  if ( fType == 3 ) { // r_a phi strips
1315  Double_t radius = fPitch[1]*((Double_t) bs -0.5) + fInnerRadius;
1316  //extract channel factor at the Outer radius
1317  Int_t ifac=1;
1318  ifac = (Int_t) (fOuterRadius / fInnerRadius);
1319  ifac |= (ifac >> 1);
1320  ifac |= (ifac >> 2);
1321  ifac |= (ifac >> 4);
1322  ifac -= (ifac >> 1);
1323  //extract channel factor at the hit radius
1324  Int_t ifac_r=1;
1325  ifac_r = (Int_t) ( radius / fInnerRadius);
1326  if ( ifac_r == 0 ) {
1327  cout<<"-W- PndGemSensor::Intersect() radius (" << radius << ") in smaller than InnerRadius (" << fInnerRadius << ").. return -1! (strip " << iFStrip << " / " << iBStrip << " )" <<endl;
1328  return -1;
1329  }
1330  ifac_r |= (ifac_r >> 1);
1331  ifac_r |= (ifac_r >> 2);
1332  ifac_r |= (ifac_r >> 4);
1333  ifac_r -= (ifac_r >> 1);
1334  //calculate channel step at the radius
1335  Int_t ich_step;
1336  if ( ifac_r == 0 ) return -1;
1337  else ich_step = (Int_t) (ifac / ifac_r);
1338  Double_t phi = 2. * TMath::Pi() * ((Double_t)iFStrip-0.5*(Double_t)ich_step) / (Double_t)fNChannelsFront;
1339  yCross = radius*TMath::Cos(phi);
1340  xCross = -radius*TMath::Sin(phi);
1341  zCross = fPosition[2];
1342  dp = fPitch[0]*radius/fInnerRadius/ifac_r/TMath::Sqrt(12.);
1343  dr = fPitch[1]/TMath::Sqrt(12.);
1344  dx = dr*TMath::Abs(TMath::Sin(phi))+dp*TMath::Abs(TMath::Cos(phi));
1345  dy = dr*TMath::Abs(TMath::Cos(phi))+dp*TMath::Abs(TMath::Sin(phi));
1346 
1347  if ( Inside(xCross,yCross) )
1348  return fDetectorId;
1349  else
1350  return -1;
1351  }
1352 
1353  return -1;
1354 }
double dy
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
static T Sin(const T &x)
Definition: PndCAMath.h:42
Double_t fOuterRadius
Definition: PndGemSensor.h:204
static T Cos(const T &x)
Definition: PndCAMath.h:43
Double_t fPosition[3]
Definition: PndGemSensor.h:201
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t
Double_t fInnerRadius
Definition: PndGemSensor.h:203
double dx
Bool_t Inside(Double_t x, Double_t y)
Int_t fDetectorId
Definition: PndGemSensor.h:199
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Double_t Pi
void PndGemSensorMonitor::Print ( )

Screen output

Definition at line 286 of file PndGemSensorMonitor.cxx.

References fBLATime, and fFLATime.

286  {
287  cout << "---> sensor has " << fFLATime.size() << " Front and " << fBLATime.size() << " Back strips" << endl;
288 
289  for ( size_t ichan = 0 ; ichan < fFLATime.size() ; ichan++ ) {
290  cout << ichan << ":" << fFLATime[ichan] << " . " << flush;
291  }
292  cout << endl;
293 
294  // for ( Int_t ibin = 0 ; ibin < 10 ; ibin++ ) {
295  // cout << " | " << flush;
296  // for ( Int_t ichan = 0 ; ichan < fFLATime.size() ; ichan+=10 ) {
297  // if ( fFNofDigis[ichan] == 0 ) {cout << " " << flush;continue;}
298  // cout << fFNofDigis[ichan] % 2 << flush;
299  // fFNofDigis[ichan] = fFNofDigis[ichan]/2;
300  // }
301  // cout << " | " << endl;
302  // }
303 }
std::vector< Double_t > fFLATime
std::vector< Double_t > fBLATime
void PndGemSensor::Reset ( )
inherited

The index of the MCPoint that has caused a combination of front and back strip to be fired. Returns -1 for combinations of strips fired by different points (fake hits)

Parameters
iFStripFront strip number
iBStripBack strip number Index of MCPointClear the maps of fired strips

Definition at line 214 of file PndGemSensor.cxx.

Referenced by PndGemStation::Reset().

214  {
215 }
void PndGemSensor::SetDetectorId ( Int_t  stationNr,
Int_t  sensorNr 
)
inlineinherited

Definition at line 87 of file PndGemSensor.h.

References PndGemSensor::fDetectorId, and kGEM.

Referenced by PndGemSensor::PndGemSensor().

87  {
88  fDetectorId = kGEM << 27 | 0 << 21 | stationNr << 8 | sensorNr << 6; }
Int_t fDetectorId
Definition: PndGemSensor.h:199

Member Data Documentation

std::vector<Double_t> PndGemSensorMonitor::fBLACharge
private

Definition at line 114 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), and PndGemSensorMonitor().

std::vector<Int_t> PndGemSensorMonitor::fBLADigiNr
private

Definition at line 115 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), and PndGemSensorMonitor().

std::vector<Int_t> PndGemSensorMonitor::fBLAEventNr
private

Definition at line 116 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), and PndGemSensorMonitor().

std::vector<Double_t> PndGemSensorMonitor::fBLATime
private
std::vector<Double_t> PndGemSensorMonitor::fBMeanTimeD
private

Definition at line 117 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), and PndGemSensorMonitor().

std::vector<Int_t> PndGemSensorMonitor::fBNofDigis
private

Definition at line 118 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), and PndGemSensorMonitor().

Int_t PndGemSensorMonitor::fBSLChan
private

Definition at line 119 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel().

std::vector<Double_t> PndGemSensorMonitor::fFLACharge
private

Definition at line 106 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), and PndGemSensorMonitor().

std::vector<Int_t> PndGemSensorMonitor::fFLADigiNr
private

Definition at line 107 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), and PndGemSensorMonitor().

std::vector<Int_t> PndGemSensorMonitor::fFLAEventNr
private

Definition at line 108 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), and PndGemSensorMonitor().

std::vector<Double_t> PndGemSensorMonitor::fFLATime
private

----------— Data members -----------------------—

Definition at line 105 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), ChannelLastActiveAt(), PndGemSensorMonitor(), and Print().

std::vector<Double_t> PndGemSensorMonitor::fFMeanTimeD
private

Definition at line 109 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), and PndGemSensorMonitor().

std::vector<Int_t> PndGemSensorMonitor::fFNofDigis
private

Definition at line 110 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel(), and PndGemSensorMonitor().

Int_t PndGemSensorMonitor::fFSLChan
private

Definition at line 111 of file PndGemSensorMonitor.h.

Referenced by ActivateChannel().

Double_t PndGemSensorMonitor::fSensorFirstTime
private

Definition at line 122 of file PndGemSensorMonitor.h.

Double_t PndGemSensorMonitor::fSensorLastTime
private

Definition at line 123 of file PndGemSensorMonitor.h.

Double_t PndGemSensorMonitor::fSensorRecoveryTime
private

Definition at line 121 of file PndGemSensorMonitor.h.


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