Changes in configuration
[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{
22private:
23 AliEveHOMERSource(const AliEveHOMERSource&); // Not implemented
24 AliEveHOMERSource& operator=(const AliEveHOMERSource&); // Not implemented
25
a15e6d7d 26public:
27 struct SourceId
28 {
29 TString fDet, fSDet, fSSDet, fType;
30
25c3aaf7 31 SourceId(): fDet(), fSDet(), fSSDet(), fType() {}
32
a15e6d7d 33 struct CmpByDet
34 {
25c3aaf7 35 bool operator()(const SourceId& s1, const SourceId& s2) const
a15e6d7d 36 {
37 Int_t r;
38 if ((r = s1.fDet .CompareTo(s2.fDet) )) return r < 0;
39 if ((r = s1.fSDet .CompareTo(s2.fSDet) )) return r < 0;
40 if ((r = s1.fSSDet.CompareTo(s2.fSSDet))) return r < 0;
41 if ((r = s1.fType .CompareTo(s2.fType) )) return r < 0;
42 return false;
43 }
44 };
45
46 struct CmpByType
47 {
25c3aaf7 48 bool operator()(const SourceId& s1, const SourceId& s2) const
a15e6d7d 49 {
50 Int_t r;
51 if ((r = s1.fType .CompareTo(s2.fType) )) return r < 0;
52 if ((r = s1.fDet .CompareTo(s2.fDet) )) return r < 0;
53 if ((r = s1.fSDet .CompareTo(s2.fSDet) )) return r < 0;
54 if ((r = s1.fSSDet.CompareTo(s2.fSSDet))) return r < 0;
55 return false;
56 }
57 };
58
59 };
60
61 struct SourceState
62 {
63 Bool_t fState;
64 AliHLTHOMERSourceDesc *fHandle;
65
66 SourceState() : fState(kFALSE), fHandle(0) {}
67 SourceState(Bool_t state) : fState(state), fHandle(0) {}
68 };
69
d810d0de 70protected:
a15e6d7d 71 const SourceId *fSrcId;
72 SourceState *fSrcState;
d810d0de 73
74public:
75 AliEveHOMERSource(const Text_t* n="HOMER Source", const Text_t* t="");
d810d0de 76 virtual ~AliEveHOMERSource() {}
77
a15e6d7d 78 const SourceId* GetSourceId() const { return fSrcId; }
79 void SetSourceId(const SourceId* id) { fSrcId = id; }
80
81 SourceState* GetSourceState() const { return fSrcState; }
82 void SetSourceState(SourceState* st) { fSrcState = st; TEveElement::SetRnrState(st->fState); }
83
84 void SetSource(const SourceId* id, SourceState* st) { fSrcId = id; fSrcState = st; TEveElement::SetRnrState(st->fState); }
85
86 virtual Bool_t SingleRnrState() const { return kTRUE; }
87 virtual void SetRnrState(Bool_t rnr);
d810d0de 88
89 ClassDef(AliEveHOMERSource, 1);
90}; // endclass AliEveHOMERSource
91
92#endif