Moving to standard names
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHOMERSource.h
... / ...
CommitLineData
1// $Id$
2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
9
10#ifndef AliEveAliEVEHOMERSource_H
11#define AliEveAliEVEHOMERSource_H
12
13#include <TEveElement.h>
14
15#include <TNamed.h>
16
17class AliHLTHOMERSourceDesc;
18
19class AliEveHOMERSource : public TEveElement,
20 public TNamed
21{
22public:
23 struct SourceId
24 {
25 TString fDet, fSDet, fSSDet, fType;
26
27 SourceId(): fDet(), fSDet(), fSSDet(), fType() {}
28
29 struct CmpByDet
30 {
31 bool operator()(const SourceId& s1, const SourceId& s2) const
32 {
33 Int_t r;
34 if ((r = s1.fDet .CompareTo(s2.fDet) )) return r < 0;
35 if ((r = s1.fSDet .CompareTo(s2.fSDet) )) return r < 0;
36 if ((r = s1.fSSDet.CompareTo(s2.fSSDet))) return r < 0;
37 if ((r = s1.fType .CompareTo(s2.fType) )) return r < 0;
38 return false;
39 }
40 };
41
42 struct CmpByType
43 {
44 bool operator()(const SourceId& s1, const SourceId& s2) const
45 {
46 Int_t r;
47 if ((r = s1.fType .CompareTo(s2.fType) )) return r < 0;
48 if ((r = s1.fDet .CompareTo(s2.fDet) )) return r < 0;
49 if ((r = s1.fSDet .CompareTo(s2.fSDet) )) return r < 0;
50 if ((r = s1.fSSDet.CompareTo(s2.fSSDet))) return r < 0;
51 return false;
52 }
53 };
54
55 };
56
57 struct SourceState
58 {
59 Bool_t fState;
60 AliHLTHOMERSourceDesc *fHandle;
61
62 SourceState() : fState(kFALSE), fHandle(0) {}
63 SourceState(Bool_t state) : fState(state), fHandle(0) {}
64 };
65
66
67 AliEveHOMERSource(const Text_t* n="HOMER Source", const Text_t* t="");
68 virtual ~AliEveHOMERSource() {}
69
70 const SourceId* GetSourceId() const { return fSrcId; }
71 void SetSourceId(const SourceId* id) { fSrcId = id; }
72
73 SourceState* GetSourceState() const { return fSrcState; }
74 void SetSourceState(SourceState* st) { fSrcState = st; TEveElement::SetRnrState(st->fState); }
75
76 void SetSource(const SourceId* id, SourceState* st) { fSrcId = id; fSrcState = st; TEveElement::SetRnrState(st->fState); }
77
78 virtual Bool_t SingleRnrState() const { return kTRUE; }
79 virtual Bool_t SetRnrState(Bool_t rnr);
80
81protected:
82 const SourceId *fSrcId;
83 SourceState *fSrcState;
84
85private:
86 AliEveHOMERSource(const AliEveHOMERSource&); // Not implemented
87 AliEveHOMERSource& operator=(const AliEveHOMERSource&); // Not implemented
88
89 ClassDef(AliEveHOMERSource, 0); // Description of an HOMER source.
90};
91
92#endif