1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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 //====================================================================
30 #include "AliMUONSegmentManuIndex.h"
33 //___________________________________________
34 ClassImp(AliMUONSegmentManuIndex)
37 //___________________________________________
38 AliMUONSegmentManuIndex::AliMUONSegmentManuIndex()
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
46 //___________________________________________
47 AliMUONSegmentManuIndex::AliMUONSegmentManuIndex(Int_t channelId, Int_t manuId, Int_t busPatchId, Int_t manuChannelId) : TNamed()
49 // Constructor to be used
50 fName = Name(manuId, manuChannelId).Data();
51 fTitle= Name(manuId, manuChannelId).Data();
52 fChannelId = channelId;
54 fBusPatchId = busPatchId;
55 fManuChannelId = manuChannelId;
57 //_______________________________________________
58 AliMUONSegmentManuIndex::~AliMUONSegmentManuIndex()
62 //___________________________________________
63 Int_t AliMUONSegmentManuIndex::Compare(const TObject *obj) const
65 // Comparison of two AliMUONSegmentManuIndex objects
66 AliMUONSegmentManuIndex * myobj = ( AliMUONSegmentManuIndex *) obj;
67 return (fChannelId > myobj->GetChannelId()) ? 1 : -1;
69 //___________________________________________
70 TString AliMUONSegmentManuIndex::Name(Int_t manuid, Int_t manuchannel)
72 // Definition of the name for TMap indexing
74 Int_t absid = manuid*64 + manuchannel;
75 sprintf(name,"%d",absid);
78 //___________________________________________
79 void AliMUONSegmentManuIndex::Print() const
81 // Printing AliMUONSegmentManuIndex information
82 AliInfo(Form("Name=%s Id=%d BusPatch=%d ManuId=%d ManuChannelId=%d\n",fName.Data(),fChannelId,fBusPatchId,fManuId,fManuChannelId));