]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - MUON/AliMUONSegmentIndex.cxx
Logging of Debug, Info and Error Messages follwing AliRoot Standard http://aliweb...
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentIndex.cxx
... / ...
CommitLineData
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 <TString.h>
29
30#include "AliMUONSegmentIndex.h"
31#include "AliLog.h"
32
33//___________________________________________
34ClassImp(AliMUONSegmentIndex)
35
36//
37//___________________________________________
38AliMUONSegmentIndex::AliMUONSegmentIndex() : TNamed()
39{
40 // Constructor by default
41 fChannelId = 0;
42 fPadX = 0;
43 fPadY = 0;
44 fCathode=0;
45}
46//___________________________________________
47AliMUONSegmentIndex::AliMUONSegmentIndex(const Int_t channelId, const Int_t padX, const Int_t padY, const Int_t cathode) : TNamed()
48{
49 // Constructor to be used
50 fName = Name(padX, padY, cathode).Data();
51 fTitle = Name(padX, padY, cathode).Data();
52 fChannelId = channelId;
53 fPadX = padX;
54 fPadY = padY;
55 fCathode=cathode;
56}
57//_______________________________________________
58AliMUONSegmentIndex::~AliMUONSegmentIndex()
59{
60 // Destructor
61}
62//___________________________________________
63Int_t AliMUONSegmentIndex::Compare(const TObject *obj) const
64{
65 // Comparison of two AliMUONSegmentIndex objects
66 AliMUONSegmentIndex * myobj = ( AliMUONSegmentIndex *) obj;
67 return (fChannelId > myobj->GetChannelId()) ? 1 : -1;
68}
69//___________________________________________
70TString AliMUONSegmentIndex::Name(Int_t padx, Int_t pady, Int_t cathode)
71{
72 // Definition of the name of the object
73 char name[15];
74 sprintf(name,"%d-%d-%d",padx,pady,cathode);
75 return TString(name);
76}
77
78//___________________________________________
79void AliMUONSegmentIndex::Print() const
80{
81 // Printing information of AliMUONSegmentIndex
82 AliInfo(Form("Name=%s Id=%d PadX=%d PadY=%d Cathode=%d\n",fName.Data(),fChannelId,fPadX,fPadY,fCathode));
83}