23 #include "Riostream.h"
24 #include "TVirtualPad.h"
25 #include "TVirtualX.h"
65 AliMpArea c( (xmin+xmax)/2.0, (ymin+ymax)/2.0 ,
66 (xmax-xmin)/2.0, (ymax-ymin)/2.0 );
90 Init(-1,-1,-1,-1,TVector2(0,0),TVector2(0,0),0);
95 Int_t ix, Int_t iy, Double_t x, Double_t y,
96 Double_t dx, Double_t dy, Double_t charge)
114 Init(detElemId,cathode,ix,iy,TVector2(x,y),TVector2(dx,dy),charge);
119 Double_t dx, Double_t dy, Double_t charge)
121 fIsSaturated(kFALSE),
135 Init(-1,-1,-1,-1,TVector2(x,y),TVector2(dx,dy),charge);
142 fIsSaturated(kFALSE),
156 Init(-1,-1,-1,-1,position,dimensions,charge);
177 static Double_t precision = 1E-4;
178 static TVector2 precisionAdjustment(-precision,-precision);
186 const TVector2& precision)
205 if ( a1.LeftBorder() > a2.RightBorder() - precision.X() ||
206 a1.RightBorder() < a2.LeftBorder() + precision.X() )
211 if ( a1.DownBorder() > a2.UpBorder() - precision.Y() ||
212 a1.UpBorder() < a2.DownBorder() + precision.Y() )
222 const TVector2& precision,
234 overlapRegion =
Overlap(d1,d2);
235 if ( !overlapRegion.
IsValid() )
237 cerr <<
"Something is wrong : the 2 pads below are flagged as overlapping"
238 <<
", but the overlapRegion is not valid"
287 if (
Ix() > pad->
Ix() )
291 else if (
Ix() < pad->
Ix() )
298 if (
Iy() > pad->
Iy() )
302 else if (
Iy() < pad->
Iy() )
309 if (
X() > pad->
X() )
313 else if (
X() < pad->
X() )
320 if (
Y() > pad->
Y() )
324 else if (
Y() < pad->
Y() )
367 AliError(Form(
"Incorrect coordinates index %d (only 0,1 are valid)",ixy));
375 const TVector2& position,
376 const TVector2& dimensions,
403 return Intersect(a1,a2);
415 gPad->PaintBox(ll.X(),ll.Y(),ur.X(),ur.Y());
426 ios_base::fmtflags oldflags = cout.flags();
429 cout <<
"DetEle " << setw(5) <<
DetElemId()
430 <<
" Cath " << setw(2) <<
Cathode()
431 <<
" (Ix,Iy)=(" << setw(3) <<
Ix() <<
"," << setw(3) <<
Iy() <<
") ";
433 cout.setf(ios::fixed);
435 cout <<
" (x,y)=(" << setw(9) <<
X() <<
"," << setw(9) <<
Y() <<
") "
436 <<
" (dx,dy)=(" << setw(9) <<
DX() <<
"," << setw(9) <<
DY() <<
") "
439 cout << setw(7) <<
Charge();
440 if ( sopt.Contains(
"full") )
446 <<
" Status=" << setw(4) <<
Status()
449 if ( sopt.Contains(
"corners") )
451 cout << Form(
" (xmin,xmax)=(%e,%e) (ymin,ymax)=(%e,%e)",
453 Y()-
DY(),
Y()+
DY()) << endl;
457 cout.flags(oldflags);
475 AliError(Form(
"Incorrect coordinates index %d (only 0,1 are valid)",ixy));
494 AliError(Form(
"Incorrect coordinates index %d (only 0,1 are valid)",ixy));
521 AliError(Form(
"Incorrect coordinates index %d (only 0,1 are valid)",ixy));
static Bool_t AreOverlapping(const AliMUONPad &d1, const AliMUONPad &d2, const TVector2 &precision, AliMpArea &overlapArea)
static AliMpArea Overlap(const AliMUONPad &d1, const AliMUONPad &d2)
Bool_t IsReal() const
Return info whether this is a real pad or a virtual one.
Bool_t IsSaturated() const
Return info whether this pad is saturated or not.
Double_t LeftBorder() const
Double_t ChargeBackup() const
Return backup charge.
TVector2 Dimensions() const
Return half dimensions in x and y (cm)
A rectangle area positioned in plane..
Bool_t fIsSaturated
whether this pad is saturated or not
virtual Int_t Compare(const TObject *obj) const
Double_t DY() const
Return half dimensions in y (cm)
static Bool_t AreNeighbours(const AliMUONPad &d1, const AliMUONPad &d2)
void Shift(Int_t ixy, Double_t shift)
void SetSize(Int_t ixy, Double_t Size)
Double_t Y() const
Return position in y (cm)
TVector2 fDimensions
half dimensions in x and y (cm)
Bool_t fIsReal
whether this is a real pad or a virtual one
Int_t Iy() const
Return y-index.
virtual void Paint(Option_t *opt="")
Double_t X() const
Return position in x (cm)
TVector2 fPosition
positions in x and y (cm)
Int_t Cathode() const
Return cathode number.
Double_t UpBorder() const
Bool_t IsUsed() const
Return true if is used.
Double_t Size(Int_t ixy) const
Double_t DownBorder() const
TVector2 Position() const
Return positions in x and y (cm)
Double_t fCharge
pad charge
void SetCoord(Int_t ixy, Double_t Coord)
Int_t Ix() const
Return x-index.
Int_t fDetElemId
detection element id
Bool_t IsValid() const
Return validity.
void Print(Option_t *opt="") const
Double_t Charge() const
Return pad charge.
Double_t Coord(Int_t ixy) const
Int_t fClusterId
cluster id this pad belongs to (-1 if not attached to a cluster)
Int_t DetElemId() const
Return detection element id.
void Init(Int_t detElemId, Int_t cathode, Int_t ix, Int_t iy, const TVector2 &position, const TVector2 &dimensions, Double_t charge)
Int_t fCathode
cathode number
Int_t Status() const
Return status word.
Double_t fChargeBackup
backup charge (usefull if clustering somehow plays with the charge, this one is the "original" one) ...
Double_t RightBorder() const
Combination of digit and mppad informations.
Double_t DX() const
Return half dimensions in x (cm)