StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEvtTrigDetSumsMaker.cxx
1 // //
3 // StEvtTrigDetSumsMaker populates the TrigDetSums table from StEvent. //
4 // This allows the table to be filled with the same information when //
5 // reading event.root files that was available when the files were //
6 // created. In particular, database values of RICH scalers are slightly //
7 // different. Using StEvtTrigDetSumsMaker also avoids the unnecessary //
8 // overhead of going to the database for information already available. //
9 // //
10 // Note that trigDetSums is used by StDetectorDbRichScalers, which in //
11 // turn is used by St_spaceChargeCorC, used by StMagUtilities. It //
12 // should be placed before any use of StMagUtilities in the chain. //
13 // //
15 
16 #include "StEvtTrigDetSumsMaker.h"
17 #include "StDetectorDbMaker/St_trigDetSumsC.h"
18 #include "StEventTypes.h"
19 
20 St_trigDetSums* St_trigDetSumsC::fgTableCopy = 0;
21 
22 ClassImp(StEvtTrigDetSumsMaker)
23 //_____________________________________________________________________________
24 Int_t StEvtTrigDetSumsMaker::Make(){
25 
26  // Get StEvent and related info, determine if things are OK
27  StEvent* event = (StEvent*) GetInputDS("StEvent");
28  if (!event) {
29  LOG_ERROR << "StEvtTrigDetSumsMaker: no StEvent" << endm;
30  return kStErr;
31  }
32  if (event->Find("trigDetSums")) {
33  LOG_WARN << "StEvtTrigDetSumsMaker: StEvent already contains trigDetSums...skipping" << endm;
34  return kStOK;
35  }
36  StRunInfo* runInfo = event->runInfo();
37  if (!runInfo) {
38  LOG_ERROR << "StEvtTrigDetSumsMaker: no runInfo" << endm;
39  return kStErr;
40  }
41 
42  delete St_trigDetSumsC::instance();
43  St_trigDetSums* table = new St_trigDetSums("trigDetSums",1);
44  trigDetSums_st* row = table->GetTable();
45 
46  row->zdcX = runInfo->zdcCoincidenceRate();
47  row->zdcWest = runInfo->zdcWestRate();
48  row->zdcEast = runInfo->zdcWestRate();
49  row->bbcX = runInfo->bbcCoincidenceRate();
50  row->bbcWest = runInfo->bbcWestRate();
51  row->bbcEast = runInfo->bbcWestRate();
52  row->bbcYellowBkg = runInfo->bbcYellowBackgroundRate();
53  row->bbcBlueBkg = runInfo->bbcBlueBackgroundRate();
54  row->L0 = runInfo->l0RateToRich();
55 
56  table->SetNRows(1);
57  new St_trigDetSumsC(table);
58  return kStOK;
59 }
60 
61 //_____________________________________________________________________________
62 // $Id: StEvtTrigDetSumsMaker.cxx,v 1.3 2015/06/26 21:38:00 genevb Exp $
63 // $Log: StEvtTrigDetSumsMaker.cxx,v $
64 // Revision 1.3 2015/06/26 21:38:00 genevb
65 // Not necessary when trigDetSums is already available from StEvent
66 //
67 // Revision 1.2 2012/10/15 17:38:34 genevb
68 // Add CVS logging
69 //
70 //
71 
Definition: Stypes.h:40
Definition: Stypes.h:44