]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegmentIndex.cxx
New classes for Segmentation and Mapping
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentIndex.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 indexing in a detection element    
20 //        Gines MARTINEZ, SUBATECH July 04                
21 //  This class is the basic component of 
22 //  AliMUONSegmentationDetectionElement and contains al the 
23 //  info about a segment (pad or strip):
24 //          Id-indetectionelement,  ix ,iy 
25 //  Detailed information in Alice Technical Note xxxxxxxx (2004)
26 //====================================================================
27
28 #include "AliMUONSegmentIndex.h"
29
30 //___________________________________________
31 ClassImp(AliMUONSegmentIndex)
32
33 //
34 //___________________________________________
35 AliMUONSegmentIndex::AliMUONSegmentIndex() : TNamed()
36 {
37   fChannelId = 0;
38   fPadX = 0;
39   fPadY = 0;
40   fCathode=0;  
41 }
42 //___________________________________________
43 AliMUONSegmentIndex::AliMUONSegmentIndex(const Int_t channelId, const Int_t padX, const Int_t padY, const Int_t cathode) : TNamed()
44 {
45   char name[10];
46   sprintf(name,"%d-%d",padX,padY);
47   fName = name;
48   fTitle = name;
49   fChannelId = channelId;
50   fPadX = padX;
51   fPadY = padY;
52   fCathode=cathode;  
53 }
54 //_______________________________________________
55 AliMUONSegmentIndex::~AliMUONSegmentIndex()
56 {
57
58 }
59 //___________________________________________
60 Int_t AliMUONSegmentIndex::Compare(const TObject *obj) const
61 {
62   AliMUONSegmentIndex * myobj = ( AliMUONSegmentIndex *) obj;
63   return (fChannelId > myobj->GetChannelId()) ? 1 : -1;
64 }
65 //___________________________________________
66 void AliMUONSegmentIndex::Print() const
67 {
68   printf("%s id=%d ix=%d iy=%d cathode=%d\n",fName.Data(),fChannelId,fPadX,fPadY,fCathode);   
69 }