]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegmentManuIndex.cxx
mapping/data/station2/non-bending_plane/zones_special_outer.dat
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentManuIndex.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 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
28 #include <TString.h>
29
30 #include "AliMUONSegmentManuIndex.h"
31 #include "AliLog.h"
32
33 //___________________________________________
34 ClassImp(AliMUONSegmentManuIndex)
35
36 //
37 //___________________________________________
38 AliMUONSegmentManuIndex::AliMUONSegmentManuIndex() 
39 {
40   //Default constructor
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 //___________________________________________
47 AliMUONSegmentManuIndex::AliMUONSegmentManuIndex(Int_t channelId, Int_t manuId, Int_t busPatchId,  Int_t manuChannelId) : TNamed()
48 {  
49   // Constructor to be used
50   fName = Name(manuId, manuChannelId).Data();
51   fTitle= Name(manuId, manuChannelId).Data();
52   fChannelId     = channelId;
53   fManuId        = manuId;
54   fBusPatchId    = busPatchId;
55   fManuChannelId = manuChannelId;  
56 }
57 //_______________________________________________
58 AliMUONSegmentManuIndex::~AliMUONSegmentManuIndex()
59 {
60   // Destructor
61 }
62 //___________________________________________
63 Int_t AliMUONSegmentManuIndex::Compare(const TObject *obj) const
64 {
65   // Comparison of two AliMUONSegmentManuIndex objects
66  AliMUONSegmentManuIndex * myobj = ( AliMUONSegmentManuIndex *) obj;
67   return (fChannelId > myobj->GetChannelId()) ? 1 : -1;
68 }
69 //___________________________________________
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 //___________________________________________
79 void AliMUONSegmentManuIndex::Print(const char* /*opt*/) const
80 {
81   // Printing AliMUONSegmentManuIndex information
82   AliInfo(Form("Name=%s Id=%d BusPatch=%d ManuId=%d ManuChannelId=%d\n",fName.Data(),fChannelId,fBusPatchId,fManuId,fManuChannelId));   
83 }