StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRTSBaseMaker.cxx
1 /***************************************************************************
2  *
3  * $Id: StRTSBaseMaker.cxx,v 1.15 2012/01/25 23:10:06 genevb Exp $
4  *
5  * Author: Valeri Fine, BNL Feb 2008
6  ***************************************************************************
7  *
8  * Description: Create the DAQ table from the RTS_READER
9  * StRTSBaseMaker is a base class for the concrete
10  * StMaker classes that access the concrete detector
11  * subsystem to feed the suitable offline production
12  * datasets
13  * Input: RTS_Reader
14  * Output: daq tables
15  *
16  ***************************************************************************
17  *
18  * $Log: StRTSBaseMaker.cxx,v $
19  * Revision 1.15 2012/01/25 23:10:06 genevb
20  * Move StMaker name logic before StMaker instantiation
21  *
22  * Revision 1.14 2011/06/20 15:13:51 fisyak
23  * Force to call Finish with SIGTERM signal obtained from condor_vacate_job after time limit reached
24  *
25  * Revision 1.13 2010/03/17 16:01:08 fine
26  * RT #1880. Fix the the bug of the assert condition
27  *
28  * Revision 1.12 2010/03/17 15:58:30 fine
29  * RT #1880. Fix the the bug of the assert condition
30  *
31  * Revision 1.11 2010/02/01 01:46:59 fine
32  * RT #1840 Add the method GetNextLegacy(int)
33  *
34  * Revision 1.10 2009/11/10 19:17:39 fine
35  * Add doxygen docs
36  *
37  * Revision 1.9 2009/11/10 17:41:19 fine
38  * remove the compilation warning on SL5
39  *
40  * Revision 1.8 2009/10/09 20:30:08 fine
41  * make the global daqReader to be the static data-member to fix issue #1657
42  *
43  * Revision 1.7 2009/07/22 21:42:52 fine
44  * Add DAQ event header to pass
45  *
46  * Revision 1.6 2009/04/28 16:31:19 fine
47  * downgrade the message level from INFO to DEBUG
48  *
49  * Revision 1.5 2008/12/03 20:41:00 fine
50  * add the DetectorName method to make DAQ_READER happy
51  *
52  * Revision 1.4 2008/12/02 23:40:08 fine
53  * GetNext should not virtual
54  *
55  * Revision 1.3 2008/12/02 22:55:14 fine
56  * Add a few access methods
57  *
58  * Revision 1.2 2008/11/21 18:16:46 fine
59  * Change the return type of the GetNextDaqElement method to be StRtsTable *
60  *
61  * Revision 1.1 2008/01/29 15:14:05 fine
62  * Introduce the base class to access RTS raw data
63  *
64  * Revision 1.2 2008/01/29 01:42:48 fine
65  * Add the static dara-member impl
66  *
67  * Revision 1.1 2008/01/25 22:30:23 fine
68  * Add the base maker for all RTS-based makers and template for the TofEventMaker
69  *
70  * Revision 1.4 2008/01/12 00:22:01 fine
71  * Update the test macro
72  *
73  **************************************************************************/
74 #include "StRTSBaseMaker.h"
75 
76 #include "StRtsTable.h"
77 
78 const char *StRTSBaseMaker::fRTSRootDataset="RTS/"; // The name of the Root dataset
79 
80 ClassImp(StRTSBaseMaker);
82 
88 //_____________________________________________________________
89 StRTSBaseMaker::StRTSBaseMaker(const char *detectorName,const char *makerName)
90  :StMaker((makerName && makerName[0] ? makerName : detectorName))
91  ,fDaq_Dta(0), fDetectorName(detectorName)
92 {
93  LOG_DEBUG << "StRTSBaseMaker::ctor" << endm;
94 }
95 
97 //_____________________________________________________________
99 { }
100 
101 //_____________________________________________________________
103 
125 //_____________________________________________________________
127 {
128  // Query: RTS/tpx/cld[%d] cluster data from DAQ system
129  // Return: the pointer the StRtsTable object filled with the query data
130  // = 0; the no data for the "elementPath" was found
131  fDaq_Dta = 0;
132  if (elementPath && elementPath[0]) {
133  TString path = fRTSRootDataset;
134  path +=elementPath;
135  fDaq_Dta = dynamic_cast<StRtsTable *>(GetDataSet((const char*)path));
136  }
137  return fDaq_Dta;
138 }
139 //__________________________________________________________________________________________
141 
152 //_____________________________________________________________
154 {
155  // Get the next "bank" element
156  StRtsTable *daqData = 0;
157  if (bank && bank[0]) {
158  TString query = DetectorName();
159  query += "/"; query += bank;
160  daqData = GetNextDaqElement(query);
161  } else {
162  LOG_ERROR << "No bank name was provided to query DAQ data from "
163  << DetectorName() << " detector" << endm;
164  }
165  return daqData;
166 }
167 
168 //__________________________________________________________________________________________
170 
176 //_____________________________________________________________
178 {
179  // Get "raw" DAQ data assuming the maker name
180  // matches the "detector name"
181  return GetNext("raw");
182 }
183 
184 //__________________________________________________________________________________________
186 
192 //_____________________________________________________________
194 {
195  // Get "raw" DAQ data assuming the maker name
196  // matches the "detector name"
197  assert(sec > 0 && "Only positive value is allowed");
198  return GetNext(Form("raw[%i]",sec));
199 }
200 //__________________________________________________________________________________________
202 
208 //_____________________________________________________________
210 {
211  // Get "adc" DAQ data assuming the maker name
212  // matches the "detector name"
213  return GetNext("adc");
214 }
215 //__________________________________________________________________________________________
217 
223 //_____________________________________________________________
225 {
226  // Get "adc" DAQ data assuming the maker name
227  // matches the "detector name"
228  assert(sec > 0 && "Only positive value is allowed");
229  return GetNext(Form("adc[%i]",sec));
230 }
231 //__________________________________________________________________________________________
233 
239 //_____________________________________________________________
241 {
242  // Get "legacy" DAQ data assuming the maker name
243  // matches the "detector name"
244  return GetNext("legacy");
245 }
246 
247 //__________________________________________________________________________________________
249 
255 //_____________________________________________________________
257 {
258  // Get "legacy" DAQ data assuming the maker name
259  // matches the "detector name"
260  assert(sec > 0 && "Only positive value is allowed");
261  return GetNext(Form("legacy[%i]",sec));
262 }
263 
264 //_____________________________________________________________
265 Int_t StRTSBaseMaker::Sector () const
266 {
267  return fDaq_Dta ? fDaq_Dta->Sector() : -1;
268 }
269 //_____________________________________________________________
270 Int_t StRTSBaseMaker::Pad () const
271 {
272  return fDaq_Dta ? fDaq_Dta->Pad() : -1;
273 }
274 
275 //_____________________________________________________________
276 Int_t StRTSBaseMaker::Rdo () const
277 {
278  return fDaq_Dta ? fDaq_Dta->Rdo() : -1;
279 }
280 
281 //_____________________________________________________________
282 Int_t StRTSBaseMaker::Row () const
283 {
284  return fDaq_Dta ? fDaq_Dta->Row() : -1;
285 }
286 
287 //_____________________________________________________________
289  // current token
290  return StRtsTable::Token();
291 }
292 //_____________________________________________________________
294  // current trigger command
295  return StRtsTable::Trgcmd();
296 }
297 
298 //_____________________________________________________________
300  // current DAQ command
301  return StRtsTable::Daqcmd();
302 }
303 
304 //_____________________________________________________________
306  // the Trigger Word
307  return StRtsTable::Trgword();
308 }
309 
310 //_____________________________________________________________
312  // the Physics Word
313  return StRtsTable::Phyword();
314 }
315 
316 //_____________________________________________________________
318  // "offline" bits aka L3 summary...
319  return StRtsTable::Daqbits();
320 }
321 
322 //_____________________________________________________________
324  // triggers satisfying l1
325  return StRtsTable::Daqbits_l1();
326 }
327 
328 //_____________________________________________________________
330  // triggers satisfying l2
331  return StRtsTable::Daqbits_l2();
332 }
333 
334 //_____________________________________________________________
336 {
337  // evp groups aka L3 summary[2]
338  return StRtsTable::Evpgroups();
339 }
340 
341 //_____________________________________________________________
343  // detectors present bit mask according to DAQ!
344  return StRtsTable::Detectors();
345 }
346 
static UInt_t Evpgroups()
evp groups aka L3 summary[2]
StRtsTable * GetNextDaqElement(const char *elementPath)
Query the STAR production chain for the DAQ data.
Class StRTSBaseMaker - is an abstract StMaker to define the interface to access the DAQ data from the...
static UInt_t Trgcmd()
current trigger command
static UInt_t Phyword()
the Physics Word
static UInt_t Daqbits_l2()
triggers satisfying l2
StRTSBaseMaker(const char *detectorName, const char *makerName="")
StRTSBaseMaker( const char *detectorName,TVirtualPad *pad) ctor.
static UInt_t Daqcmd()
current DAQ command
virtual StRtsTable * GetNextRaw()
This is an overloaded member function, provided for convenience.
static UInt_t Daqbits_l1()
triggers satisfying l1
static UInt_t Trgword()
the Trigger Word
StRtsTable * GetNext(const char *bank)
This is an overloaded member function, provided for convenience.
virtual StRtsTable * GetNextAdc()
This is an overloaded member function, provided for convenience.
UInt_t Detectors() const
detectors present bit mask according to DAQ!
static UInt_t Token()
current token
virtual StRtsTable * GetNextLegacy()
This is an overloaded member function, provided for convenience.
virtual ~StRTSBaseMaker()
StRTSBaseMaker class dtor.
static UInt_t Daqbits()
&quot;offline&quot; bits aka L3 summary...