00001 /*************************************************************************** 00002 * 00003 * $Id: StRTSBaseMaker.cxx,v 1.15 2012/01/25 23:10:06 genevb Exp $ 00004 * 00005 * Author: Valeri Fine, BNL Feb 2008 00006 *************************************************************************** 00007 * 00008 * Description: Create the DAQ table from the RTS_READER 00009 * StRTSBaseMaker is a base class for the concrete 00010 * StMaker classes that access the concrete detector 00011 * subsystem to feed the suitable offline production 00012 * datasets 00013 * Input: RTS_Reader 00014 * Output: daq tables 00015 * 00016 *************************************************************************** 00017 * 00018 * $Log: StRTSBaseMaker.cxx,v $ 00019 * Revision 1.15 2012/01/25 23:10:06 genevb 00020 * Move StMaker name logic before StMaker instantiation 00021 * 00022 * Revision 1.14 2011/06/20 15:13:51 fisyak 00023 * Force to call Finish with SIGTERM signal obtained from condor_vacate_job after time limit reached 00024 * 00025 * Revision 1.13 2010/03/17 16:01:08 fine 00026 * RT #1880. Fix the the bug of the assert condition 00027 * 00028 * Revision 1.12 2010/03/17 15:58:30 fine 00029 * RT #1880. Fix the the bug of the assert condition 00030 * 00031 * Revision 1.11 2010/02/01 01:46:59 fine 00032 * RT #1840 Add the method GetNextLegacy(int) 00033 * 00034 * Revision 1.10 2009/11/10 19:17:39 fine 00035 * Add doxygen docs 00036 * 00037 * Revision 1.9 2009/11/10 17:41:19 fine 00038 * remove the compilation warning on SL5 00039 * 00040 * Revision 1.8 2009/10/09 20:30:08 fine 00041 * make the global daqReader to be the static data-member to fix issue #1657 00042 * 00043 * Revision 1.7 2009/07/22 21:42:52 fine 00044 * Add DAQ event header to pass 00045 * 00046 * Revision 1.6 2009/04/28 16:31:19 fine 00047 * downgrade the message level from INFO to DEBUG 00048 * 00049 * Revision 1.5 2008/12/03 20:41:00 fine 00050 * add the DetectorName method to make DAQ_READER happy 00051 * 00052 * Revision 1.4 2008/12/02 23:40:08 fine 00053 * GetNext should not virtual 00054 * 00055 * Revision 1.3 2008/12/02 22:55:14 fine 00056 * Add a few access methods 00057 * 00058 * Revision 1.2 2008/11/21 18:16:46 fine 00059 * Change the return type of the GetNextDaqElement method to be StRtsTable * 00060 * 00061 * Revision 1.1 2008/01/29 15:14:05 fine 00062 * Introduce the base class to access RTS raw data 00063 * 00064 * Revision 1.2 2008/01/29 01:42:48 fine 00065 * Add the static dara-member impl 00066 * 00067 * Revision 1.1 2008/01/25 22:30:23 fine 00068 * Add the base maker for all RTS-based makers and template for the TofEventMaker 00069 * 00070 * Revision 1.4 2008/01/12 00:22:01 fine 00071 * Update the test macro 00072 * 00073 **************************************************************************/ 00074 #include "StRTSBaseMaker.h" 00075 00076 #include "StRtsTable.h" 00077 00078 const char *StRTSBaseMaker::fRTSRootDataset="RTS/"; // The name of the Root dataset 00079 00080 ClassImp(StRTSBaseMaker); 00082 00088 //_____________________________________________________________ 00089 StRTSBaseMaker::StRTSBaseMaker(const char *detectorName,const char *makerName) 00090 :StMaker((makerName && makerName[0] ? makerName : detectorName)) 00091 ,fDaq_Dta(0), fDetectorName(detectorName) 00092 { 00093 LOG_DEBUG << "StRTSBaseMaker::ctor" << endm; 00094 } 00095 00097 //_____________________________________________________________ 00098 StRTSBaseMaker::~StRTSBaseMaker() 00099 { } 00100 00101 //_____________________________________________________________ 00103 00125 //_____________________________________________________________ 00126 StRtsTable *StRTSBaseMaker::GetNextDaqElement(const char *elementPath) 00127 { 00128 // Query: RTS/tpx/cld[%d] cluster data from DAQ system 00129 // Return: the pointer the StRtsTable object filled with the query data 00130 // = 0; the no data for the "elementPath" was found 00131 fDaq_Dta = 0; 00132 if (elementPath && elementPath[0]) { 00133 TString path = fRTSRootDataset; 00134 path +=elementPath; 00135 fDaq_Dta = dynamic_cast<StRtsTable *>(GetDataSet((const char*)path)); 00136 } 00137 return fDaq_Dta; 00138 } 00139 //__________________________________________________________________________________________ 00141 00152 //_____________________________________________________________ 00153 StRtsTable *StRTSBaseMaker::GetNext(const char* bank) 00154 { 00155 // Get the next "bank" element 00156 StRtsTable *daqData = 0; 00157 if (bank && bank[0]) { 00158 TString query = DetectorName(); 00159 query += "/"; query += bank; 00160 daqData = GetNextDaqElement(query); 00161 } else { 00162 LOG_ERROR << "No bank name was provided to query DAQ data from " 00163 << DetectorName() << " detector" << endm; 00164 } 00165 return daqData; 00166 } 00167 00168 //__________________________________________________________________________________________ 00170 00176 //_____________________________________________________________ 00177 StRtsTable *StRTSBaseMaker::GetNextRaw() 00178 { 00179 // Get "raw" DAQ data assuming the maker name 00180 // matches the "detector name" 00181 return GetNext("raw"); 00182 } 00183 00184 //__________________________________________________________________________________________ 00186 00192 //_____________________________________________________________ 00193 StRtsTable *StRTSBaseMaker::GetNextRaw(int sec) 00194 { 00195 // Get "raw" DAQ data assuming the maker name 00196 // matches the "detector name" 00197 assert(sec > 0 && "Only positive value is allowed"); 00198 return GetNext(Form("raw[%i]",sec)); 00199 } 00200 //__________________________________________________________________________________________ 00202 00208 //_____________________________________________________________ 00209 StRtsTable *StRTSBaseMaker::GetNextAdc() 00210 { 00211 // Get "adc" DAQ data assuming the maker name 00212 // matches the "detector name" 00213 return GetNext("adc"); 00214 } 00215 //__________________________________________________________________________________________ 00217 00223 //_____________________________________________________________ 00224 StRtsTable *StRTSBaseMaker::GetNextAdc(int sec) 00225 { 00226 // Get "adc" DAQ data assuming the maker name 00227 // matches the "detector name" 00228 assert(sec > 0 && "Only positive value is allowed"); 00229 return GetNext(Form("adc[%i]",sec)); 00230 } 00231 //__________________________________________________________________________________________ 00233 00239 //_____________________________________________________________ 00240 StRtsTable *StRTSBaseMaker::GetNextLegacy() 00241 { 00242 // Get "legacy" DAQ data assuming the maker name 00243 // matches the "detector name" 00244 return GetNext("legacy"); 00245 } 00246 00247 //__________________________________________________________________________________________ 00249 00255 //_____________________________________________________________ 00256 StRtsTable *StRTSBaseMaker::GetNextLegacy(int sec) 00257 { 00258 // Get "legacy" DAQ data assuming the maker name 00259 // matches the "detector name" 00260 assert(sec > 0 && "Only positive value is allowed"); 00261 return GetNext(Form("legacy[%i]",sec)); 00262 } 00263 00264 //_____________________________________________________________ 00265 Int_t StRTSBaseMaker::Sector () const 00266 { 00267 return fDaq_Dta ? fDaq_Dta->Sector() : -1; 00268 } 00269 //_____________________________________________________________ 00270 Int_t StRTSBaseMaker::Pad () const 00271 { 00272 return fDaq_Dta ? fDaq_Dta->Pad() : -1; 00273 } 00274 00275 //_____________________________________________________________ 00276 Int_t StRTSBaseMaker::Rdo () const 00277 { 00278 return fDaq_Dta ? fDaq_Dta->Rdo() : -1; 00279 } 00280 00281 //_____________________________________________________________ 00282 Int_t StRTSBaseMaker::Row () const 00283 { 00284 return fDaq_Dta ? fDaq_Dta->Row() : -1; 00285 } 00286 00287 //_____________________________________________________________ 00288 UInt_t StRTSBaseMaker::Token() { 00289 // current token 00290 return StRtsTable::Token(); 00291 } 00292 //_____________________________________________________________ 00293 UInt_t StRTSBaseMaker::Trgcmd() { 00294 // current trigger command 00295 return StRtsTable::Trgcmd(); 00296 } 00297 00298 //_____________________________________________________________ 00299 UInt_t StRTSBaseMaker::Daqcmd() { 00300 // current DAQ command 00301 return StRtsTable::Daqcmd(); 00302 } 00303 00304 //_____________________________________________________________ 00305 UInt_t StRTSBaseMaker::Trgword() { 00306 // the Trigger Word 00307 return StRtsTable::Trgword(); 00308 } 00309 00310 //_____________________________________________________________ 00311 UInt_t StRTSBaseMaker::Phyword() { 00312 // the Physics Word 00313 return StRtsTable::Phyword(); 00314 } 00315 00316 //_____________________________________________________________ 00317 UInt_t StRTSBaseMaker::Daqbits() { 00318 // "offline" bits aka L3 summary... 00319 return StRtsTable::Daqbits(); 00320 } 00321 00322 //_____________________________________________________________ 00323 UInt_t StRTSBaseMaker::Daqbits_l1() { 00324 // triggers satisfying l1 00325 return StRtsTable::Daqbits_l1(); 00326 } 00327 00328 //_____________________________________________________________ 00329 UInt_t StRTSBaseMaker::Daqbits_l2() { 00330 // triggers satisfying l2 00331 return StRtsTable::Daqbits_l2(); 00332 } 00333 00334 //_____________________________________________________________ 00335 UInt_t StRTSBaseMaker::Evpgroups() 00336 { 00337 // evp groups aka L3 summary[2] 00338 return StRtsTable::Evpgroups(); 00339 } 00340 00341 //_____________________________________________________________ 00342 UInt_t StRTSBaseMaker::Detectors() const { 00343 // detectors present bit mask according to DAQ! 00344 return StRtsTable::Detectors(); 00345 } 00346