GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StogsAFP.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Olivier Stezowski *
3  * stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
23 #ifndef _StogsAFP
24 #define _StogsAFP
25 
26 #include "NarvalInterface.h"
27 #include "FrameBlock.h"
28 #include "Trigger.h"
29 
31 
35 class BashColor;
36 class TChain;
37 class SBREvent;
38 class TEntryList;
39 
40 using namespace ADF;
41 using namespace std;
42 
43 
45 {
46 private:
48  ADF::FileBlock fSourceOfFrames;
49 
50 private:
51  ADF::AgataFrameTrigger fEndOfFrame;
52 
53 public:
54  void ResetStats(){fNEvts=0; fRejectedEvents=0;}
55 
56 protected:
60 
61 private:
62  bool fdebug;
63  BashColor *fBashColor;
64 
65 private:
66  unsigned int fNEvts;
67 
68 protected:
69  ULong64_t fNEntries;
70 
71  unsigned int fRejectedEvents;
72  TChain *fDataChain;
73  TEntryList *fEntryList;
74 
75  ULong64_t fCurrentEntry;
76 
77  bool ReadConfFile(TString ConfFilePath);
78 
80  void InitDataChainADHitTree();
81  void InitDataChainStogs();
82 
83  bool ReadEventStogs();
84  bool ReadEventADHitTree();
85 
86 public:
87  void SetADHitTreeMode(bool active){IsADHitTreeModeOn = active;}
88  void Print();
89 
90 private:
91  static const Int_t MaxHits = 500; // Max number of hits in one event
92  static const Int_t MaxCore = 180; // Max number of cores in one event
93 
94 private:
95  ULong64_t fTimestamp;
96  unsigned int fEventNumber;
97 
98  Int_t NbHits; // Number of hits in the array
99  Int_t LastNbHits;
100  Float_t HitE[MaxHits]; // Energie of the hit
101  Float_t HitX[MaxHits]; // X position of the hit in the Crystal Frame
102  Float_t HitY[MaxHits]; // Y position of the hit in the Crystal Frame
103  Float_t HitZ[MaxHits]; // Z position of the hit in the Crystal Frame
104  Float_t HitGX[MaxHits]; // Position x of hit with , in global frame
105  Float_t HitGY[MaxHits]; // Position y of hit with , in global frame
106  Float_t HitGZ[MaxHits]; // Position z of hit with , in global frame
107  Int_t HitId[MaxHits]; // Crystal ID in which a hit occurs
108  Int_t HitSg[MaxHits]; // Segment ID in which a hit occurs
109 
110  Int_t NbCores; // for more than 1 frame (built event)
111  Int_t LastNbCores;
112  Int_t NbHitsPerCrystal[MaxCore]; // Number of hits for each cryst ID i.e. dans each data:psa frames
113  Float_t CoreE0[MaxCore]; // Core energie, high gain
114  Float_t CoreE1[MaxCore]; // Core energie, low gain
115  Float_t CoreT0[MaxCore]; // Core time, high gain
116  Float_t CoreT1[MaxCore]; // Core time, low gain
117 
118 
119  SBREvent *fStogsEv;
120 
121 protected:
124 
125  void SetSpatialResolution(double res){fSpatialResolution = res;}
126  SBREvent *ProcessPacking(SBREvent *StogsEvt);
127 
128 protected:
129 
132  void ApplyEnergyResolution(SBREvent *StogsEvt);
133  void ApplySmearing(SBREvent *StogsEvt);
134  SBREvent *FilterEvent(SBREvent *GlobEvt);
135 
136 public:
137  StogsAFP();
138  virtual ~StogsAFP();
139 
141  static void process_config (const char *, unsigned int *) ;
142 
144  virtual void process_initialise (unsigned int *error_code);
145 
147  virtual void process_reset (unsigned int *error_code);
148 
150  virtual unsigned int ProcessBlock (ADF::FrameBlock &) ;
151 };
152 
153 #endif
header file for FrameBlock.cpp
It defines the interface needed to be a narval actor (producer).
A Block of Frames.
Definition: FrameBlock.h:43
void ResetStats()
Definition: StogsAFP.h:54
ADF::SharedFP * fFrameEventPsa_Out
Definition: StogsAFP.h:57
header file for Trigger.cpp
ADF::SharedFP * fSPSAFrame
Definition: StogsAFP.h:58
TEntryList * fEntryList
Definition: StogsAFP.h:73
unsigned int fRejectedEvents
Definition: StogsAFP.h:71
Frames are extracted/added directly, one by one from/to a file.
Definition: FrameBlock.h:367
double fSpatialResolution
Definition: StogsAFP.h:123
bool fProcessPacking
Definition: StogsAFP.h:122
To be used for Agata Data Flow.
Definition: Trigger.h:462
TChain * fDataChain
Definition: StogsAFP.h:72
bool fApplySmearing
Definition: StogsAFP.h:131
A Shared Frame Pointer.
Definition: Frame.h:597
bool fApplyEnergyResolution
Definition: StogsAFP.h:130
ADF::AgataFrameTrigger fTrigger
Definition: StogsAFP.h:59
ULong64_t fCurrentEntry
Definition: StogsAFP.h:75
header file for NarvalInterface.cpp
Float_t CoreE1
Definition: Producer.C:296
void SetADHitTreeMode(bool active)
Definition: StogsAFP.h:87
bool IsADHitTreeModeOn
Definition: StogsAFP.h:79
ULong64_t fNEntries
Definition: StogsAFP.h:69
void SetSpatialResolution(double res)
Definition: StogsAFP.h:125