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"
32 //___________________________________________
33 ClassImp(AliMUONSegmentManuIndex)
36 //___________________________________________
37 AliMUONSegmentManuIndex::AliMUONSegmentManuIndex()
40 fChannelId= 0;; // Id of the channel within the detection element
41 fManuId= 0;; // Manu id in the detection element
42 fBusPatchId= 0;; // BusPatchId in the detection element up to 4 for slats
45 //___________________________________________
46 AliMUONSegmentManuIndex::AliMUONSegmentManuIndex(const Int_t channelId, const Int_t manuId, const Int_t busPatchId, Int_t manuChannelId) : TNamed()
48 // Constructor to be used
49 fName = Name(manuId, manuChannelId).Data();
50 fTitle= Name(manuId, manuChannelId).Data();
51 fChannelId = channelId;
53 fBusPatchId = busPatchId;
54 fManuChannelId = manuChannelId;
56 //_______________________________________________
57 AliMUONSegmentManuIndex::~AliMUONSegmentManuIndex()
61 //___________________________________________
62 Int_t AliMUONSegmentManuIndex::Compare(const TObject *obj) const
64 // Comparison of two AliMUONSegmentManuIndex objects
65 AliMUONSegmentManuIndex * myobj = ( AliMUONSegmentManuIndex *) obj;
66 return (fChannelId > myobj->GetChannelId()) ? 1 : -1;
68 //___________________________________________
69 TString AliMUONSegmentManuIndex::Name(Int_t manuid, Int_t manuchannel)
71 // Definition of the name for TMap indexing
73 Int_t absid = manuid*64 + manuchannel;
74 sprintf(name,"%d",absid);
77 //___________________________________________
78 void AliMUONSegmentManuIndex::Print() const
80 // Printing AliMUONSegmentManuIndex information
81 Info("Print","Name=%s Id=%d BusPatch=%d ManuId=%d ManuChannelId=%d\n",fName.Data(),fChannelId,fBusPatchId,fManuId,fManuChannelId);