]>
Commit | Line | Data |
---|---|---|
74f8c8e3 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
18 | //=================================================================== | |
19 | // Segment element position in local coordinates of the detection element | |
20 | // Gines MARTINEZ, SUBATECH July 04 | |
21 | // This class is one of the basic component of | |
22 | // AliMUONSegmentationDetectionElement and contains al the | |
23 | // info about a segment (pad or strip): | |
24 | // Id-indetectionelement, x_local, y_local | |
25 | // Detailed information in Alice Technical Note xxxxxxxx (2004) | |
26 | //==================================================================== | |
27 | ||
212bb69d | 28 | #include <TMath.h> |
29 | ||
74f8c8e3 | 30 | #include "AliMUONSegmentPosition.h" |
31 | ||
32 | //___________________________________________ | |
33 | ClassImp(AliMUONSegmentPosition) | |
34 | ||
35 | // | |
36 | //___________________________________________ | |
37 | AliMUONSegmentPosition::AliMUONSegmentPosition() : TNamed() | |
38 | { | |
212bb69d | 39 | //Default constructor |
74f8c8e3 | 40 | fChannelId = 0; |
41 | fX = 0.; | |
42 | fY = 0.; | |
43 | } | |
44 | //___________________________________________ | |
45 | AliMUONSegmentPosition::AliMUONSegmentPosition(const Int_t channelId, const Float_t x, const Float_t y, const Int_t cathode) : TNamed() | |
46 | { | |
212bb69d | 47 | // Constructor to be used |
48 | fName = Name(x,y,cathode); | |
49 | fTitle= Name(x,y,cathode); | |
74f8c8e3 | 50 | fChannelId = channelId; |
51 | fX = x; | |
52 | fY = y; | |
53 | fCathode=cathode; | |
54 | } | |
55 | //_______________________________________________ | |
56 | AliMUONSegmentPosition::~AliMUONSegmentPosition() | |
57 | { | |
212bb69d | 58 | // Destructor |
74f8c8e3 | 59 | } |
60 | //___________________________________________ | |
61 | Int_t AliMUONSegmentPosition::Compare(const TObject *obj) const | |
62 | { | |
212bb69d | 63 | // Comparison of two AliMUONSegmentPosition objects |
74f8c8e3 | 64 | AliMUONSegmentPosition * myobj = ( AliMUONSegmentPosition *) obj; |
65 | return (fChannelId > myobj->GetChannelId()) ? 1 : -1; | |
66 | } | |
67 | //___________________________________________ | |
212bb69d | 68 | TString AliMUONSegmentPosition::Name(Float_t x, Float_t y, Int_t cathode) |
69 | { | |
70 | // Definition of the name of AliMUONSegmentPosition | |
71 | // Our convention since the smaller pad pich is 5 mm is to choice a 3mm unit: | |
72 | // So for a position pair x,y and cathode plane icathode the name will be: | |
73 | // xp = TMath::Nint(x*10./3.); | |
74 | // yp = TMath::Nint(y+10./3.); | |
75 | // sprintf(name,"%d-%d-%d",xp,yp,cathode); | |
76 | Int_t xp = TMath::Nint(x*10./3.); | |
77 | Int_t yp = TMath::Nint(y*10./3.); | |
78 | char name[15]; | |
79 | sprintf(name,"%d-%d-%d",xp,yp,cathode); | |
80 | return TString(name); | |
81 | } | |
82 | //___________________________________________ | |
74f8c8e3 | 83 | void AliMUONSegmentPosition::Print() const |
84 | { | |
212bb69d | 85 | // Printing AliMUONSegmentManuIndex information |
86 | Info("Print","Name=%s Id=%d X=%f Y=%f Cathode=%d\n",fName.Data(),fChannelId, fX, fY,fCathode); | |
74f8c8e3 | 87 | } |