]>
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 indexing in a detection element for electronics | |
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, #manu, #manuchannel | |
25 | // Detailed information in Alice Technical Note xxxxxxxx (2004) | |
26 | //==================================================================== | |
27 | ||
212bb69d | 28 | #include <TString.h> |
74f8c8e3 | 29 | |
30 | #include "AliMUONSegmentManuIndex.h" | |
8c343c7c | 31 | #include "AliLog.h" |
74f8c8e3 | 32 | |
33 | //___________________________________________ | |
34 | ClassImp(AliMUONSegmentManuIndex) | |
35 | ||
36 | // | |
37 | //___________________________________________ | |
38 | AliMUONSegmentManuIndex::AliMUONSegmentManuIndex() | |
39 | { | |
212bb69d | 40 | //Default constructor |
74f8c8e3 | 41 | fChannelId= 0;; // Id of the channel within the detection element |
42 | fManuId= 0;; // Manu id in the detection element | |
43 | fBusPatchId= 0;; // BusPatchId in the detection element up to 4 for slats | |
44 | fManuChannelId= 0;; | |
45 | } | |
46 | //___________________________________________ | |
5d0435dd | 47 | AliMUONSegmentManuIndex::AliMUONSegmentManuIndex(Int_t channelId, Int_t manuId, Int_t busPatchId, Int_t manuChannelId) : TNamed() |
74f8c8e3 | 48 | { |
212bb69d | 49 | // Constructor to be used |
50 | fName = Name(manuId, manuChannelId).Data(); | |
51 | fTitle= Name(manuId, manuChannelId).Data(); | |
74f8c8e3 | 52 | fChannelId = channelId; |
53 | fManuId = manuId; | |
54 | fBusPatchId = busPatchId; | |
55 | fManuChannelId = manuChannelId; | |
56 | } | |
57 | //_______________________________________________ | |
58 | AliMUONSegmentManuIndex::~AliMUONSegmentManuIndex() | |
59 | { | |
212bb69d | 60 | // Destructor |
74f8c8e3 | 61 | } |
62 | //___________________________________________ | |
63 | Int_t AliMUONSegmentManuIndex::Compare(const TObject *obj) const | |
64 | { | |
212bb69d | 65 | // Comparison of two AliMUONSegmentManuIndex objects |
74f8c8e3 | 66 | AliMUONSegmentManuIndex * myobj = ( AliMUONSegmentManuIndex *) obj; |
67 | return (fChannelId > myobj->GetChannelId()) ? 1 : -1; | |
68 | } | |
69 | //___________________________________________ | |
212bb69d | 70 | TString AliMUONSegmentManuIndex::Name(Int_t manuid, Int_t manuchannel) |
71 | { | |
72 | // Definition of the name for TMap indexing | |
73 | char name[15]; | |
74 | Int_t absid = manuid*64 + manuchannel; | |
75 | sprintf(name,"%d",absid); | |
76 | return TString(name); | |
77 | } | |
78 | //___________________________________________ | |
337c9041 | 79 | void AliMUONSegmentManuIndex::Print(const char* /*opt*/) const |
74f8c8e3 | 80 | { |
212bb69d | 81 | // Printing AliMUONSegmentManuIndex information |
8c343c7c | 82 | AliInfo(Form("Name=%s Id=%d BusPatch=%d ManuId=%d ManuChannelId=%d\n",fName.Data(),fChannelId,fBusPatchId,fManuId,fManuChannelId)); |
74f8c8e3 | 83 | } |