GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CrystalFrame.h
Go to the documentation of this file.
1 
2 /***************************************************************************
3  * Copyright (C) 2004 by Olivier Stezowski *
4  * stezow(AT)ipnl.in2p3.fr *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20  ***************************************************************************/
21 
24 #ifndef ADF_CrystalFrame
25 #define ADF_CrystalFrame
26 
27 #ifndef ADF_AgataDataFrame
28 #include "AgataDataFrame.h"
29 #endif
30 #ifndef ADF_ADFObjects
31 #include "ADFObjects.h"
32 #endif
33 
34 namespace ADF
35 {
36 
38 
42 class GeSegment
43 {
44 private:
45  UShort_t fStatus; // segment status
46  UShort_t fID; // segment ID
47  Double32_t fE; // Energy in this segment
48 
49  Signal *fSignal; // signal associated to the segment
50 
51 public:
52  GeSegment(UInt_t length, const char *type) : fStatus(0u), fID(0u), fE(0.0), fSignal(0x0)
53  { fSignal = Signal::New(length,type) ;}
54  virtual ~GeSegment();
55 
56  virtual Signal *GetSignal()
57  { return fSignal; }
58 
59  virtual UShort_t GetStatus() const
60  {return fStatus;}
61  virtual void SetStatus(UShort_t s)
62  {fStatus=s;}
63 
64  virtual Double_t GetE() const
65  {return fE;}
66  virtual void SetE(Double_t e)
67  { fE = e; }
68 
69  virtual UShort_t GetID() const
70  {return fID;}
71  virtual void SetID(UShort_t id)
72  {fID=id;}
73 
74  virtual void Reset(UInt_t l = 0u)
75  { fStatus = fID = 0u; fE = 0.0; fSignal->Reset(l); }
76 };
77 
79 
83 class GeCore : public GeSegment
84 {
85 private:
86  Double32_t fT; // Time for the core
87 
88 public:
89  GeCore(UInt_t length, const char *type):
90  GeSegment(length,type), fT(0.0) {;}
91  virtual ~GeCore() {;}
92 
93  virtual Double_t GetT() const
94  {return fT;}
95  virtual void SetT(Double_t t)
96  { fT = t; }
97 
98  virtual void Reset(UInt_t l = 0u)
99  { fT = 0.0; GeSegment::Reset(l); }
100 };
101 
103 
107 {
108 public:
109  static UInt_t kDefaultLength;
110  static const UShort_t kNbSegments = 36u, kNbCores = 2u;
111 
112 public:
114  {;}
115  virtual ~CrystalInterface() {;}
116 
118  virtual Int_t GetUID() const = 0;
120  virtual void SetUID(Int_t) = 0;
121 
123 
125  virtual GeSegment *GetSegment(UShort_t) = 0;
126 
128 
130  virtual GeCore *GetCore(UShort_t) = 0;
131 };
132 
134 
137 class ACrystalFrame : public AgataDataFrame< CrystalInterface >
138 {
139 protected:
141  AgataDataFrame< CrystalInterface >(akey) {;}
142 public:
143  virtual ~ACrystalFrame()
144  {;}
145 };
146 
147 // typedef ProxyDataFrame<ACrystalFrame,CrystalInterface> CrystalFrame;
148 
149 } // namespace ADF
150 #endif
151 
152 
153 
154 
155 
156 
virtual Double_t GetE() const
Definition: CrystalFrame.h:64
Base class for a Key.
Definition: Key.h:56
virtual ~ACrystalFrame()
Definition: CrystalFrame.h:143
virtual void SetStatus(UShort_t s)
Definition: CrystalFrame.h:61
virtual GeCore * GetCore(UShort_t)=0
to get each core
static const UShort_t kNbCores
Definition: CrystalFrame.h:110
static Signal * New(UInt_t length, const char *type="US")
method to allocate a new signal
Definition: Signals.cpp:27
virtual GeSegment * GetSegment(UShort_t)=0
to get individual segment
virtual Signal * GetSignal()
Definition: CrystalFrame.h:56
General interface for a AgataDataFrame.
virtual ~CrystalInterface()
Definition: CrystalFrame.h:115
virtual void SetUID(Int_t)=0
to set the crystal ID
General interface for a CrystalFrame.
Definition: CrystalFrame.h:137
Data produced fro a Crystal.
Definition: CrystalFrame.h:106
header file for AgataDataFrame.cpp
virtual void Reset(UInt_t l=0u)=0
Get the signal from the given array.
virtual void SetID(UShort_t id)
Definition: CrystalFrame.h:71
static UInt_t kDefaultLength
Definition: CrystalFrame.h:109
Base class for a Signal.
Definition: Signals.h:39
virtual void Reset(UInt_t l=0u)
Definition: CrystalFrame.h:74
virtual Int_t GetUID() const =0
to get the crystal ID
virtual void SetE(Double_t e)
Definition: CrystalFrame.h:66
virtual ~GeCore()
Definition: CrystalFrame.h:91
virtual UShort_t GetStatus() const
Definition: CrystalFrame.h:59
header file for ADFObjects.cpp
virtual Double_t GetT() const
Definition: CrystalFrame.h:93
ACrystalFrame(Key *akey)
Definition: CrystalFrame.h:140
virtual UShort_t GetID() const
Definition: CrystalFrame.h:69
virtual void Reset(UInt_t l=0u)
Definition: CrystalFrame.h:98
Base class for a DataInterface.
Definition: GObject.h:340
virtual void SetT(Double_t t)
Definition: CrystalFrame.h:95
GeCore(UInt_t length, const char *type)
Definition: CrystalFrame.h:89
virtual ~GeSegment()
GeSegment(UInt_t length, const char *type)
Definition: CrystalFrame.h:52
static const UShort_t kNbSegments
Definition: CrystalFrame.h:110