]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegmentPosition.cxx
New classes for Segmentation and Mapping
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentPosition.cxx
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
28 #include "AliMUONSegmentPosition.h"
29
30 //___________________________________________
31 ClassImp(AliMUONSegmentPosition)
32
33 //
34 //___________________________________________
35 AliMUONSegmentPosition::AliMUONSegmentPosition() : TNamed()
36 {
37   fChannelId = 0;
38   fX = 0.;
39   fY = 0.;  
40 }
41 //___________________________________________
42 AliMUONSegmentPosition::AliMUONSegmentPosition(const Int_t channelId, const Float_t x, const Float_t y, const Int_t cathode) : TNamed()
43 {
44   char name[10];
45   sprintf(name,"%5.2f-%5.2f",x,y);
46   fName = name;
47   fTitle= name;
48   fChannelId = channelId;
49   fX = x;
50   fY = y;
51   fCathode=cathode;
52 }
53 //_______________________________________________
54 AliMUONSegmentPosition::~AliMUONSegmentPosition()
55 {
56
57 }
58 //___________________________________________
59 Int_t AliMUONSegmentPosition::Compare(const TObject *obj) const
60 {
61   AliMUONSegmentPosition * myobj = ( AliMUONSegmentPosition *) obj;
62   return (fChannelId > myobj->GetChannelId()) ? 1 : -1;
63 }
64 //___________________________________________
65 void AliMUONSegmentPosition::Print() const
66 {
67   printf("%s id=%d x=%f y=%f cathode=%d\n",fName.Data(),fChannelId, fX, fY,fCathode);   
68 }