Update master to aliroot
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHOMERSource.h
CommitLineData
d810d0de 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 *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
9
a15e6d7d 10#ifndef AliEveAliEVEHOMERSource_H
11#define AliEveAliEVEHOMERSource_H
d810d0de 12
13#include <TEveElement.h>
14
15#include <TNamed.h>
16
17class AliHLTHOMERSourceDesc;
18
19class AliEveHOMERSource : public TEveElement,
a15e6d7d 20 public TNamed
d810d0de 21{
a15e6d7d 22public:
23 struct SourceId
24 {
25 TString fDet, fSDet, fSSDet, fType;
26
25c3aaf7 27 SourceId(): fDet(), fSDet(), fSSDet(), fType() {}
28
a15e6d7d 29 struct CmpByDet
30 {
25c3aaf7 31 bool operator()(const SourceId& s1, const SourceId& s2) const
a15e6d7d 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 {
25c3aaf7 44 bool operator()(const SourceId& s1, const SourceId& s2) const
a15e6d7d 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
d810d0de 66
d810d0de 67 AliEveHOMERSource(const Text_t* n="HOMER Source", const Text_t* t="");
d810d0de 68 virtual ~AliEveHOMERSource() {}
69
a15e6d7d 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; }
fbc350a3 79 virtual Bool_t SetRnrState(Bool_t rnr);
d810d0de 80
4b456ebb 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};
d810d0de 91
92#endif