StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuScalerCutter.cxx
1 
25 //
26 
27 #include "StMuDSTMaker/COMMON/StMuDst.h"
28 #include "StMuDSTMaker/COMMON/StMuEvent.h"
29 #include "StMessMgr.h"
30 #include "StMuScalerCutter.h"
31 
32 ClassImp(StMuScalerCutter)
33 
34 // The constructor. Initialize data members here.
35 StMuScalerCutter::StMuScalerCutter(const Char_t *name) : StMaker(name) {}
36 
38 {
39  // Result is kStSkip if scalers are corrupt
40 
41  StMuDst* mu = (StMuDst*) GetInputDS("MuDst");
42  if (!mu){
43  LOG_WARN << "StMuScalerCutter::Make : No MuDst" << endm;
44  return kStOK; // if no event, we're done
45  }
46 
47  return (accept(mu->event()) ? kStOK : kStSkip);
48 }
49 
50 bool StMuScalerCutter::accept(StMuEvent* event)
51 {
52  // Result is false if scalers are corrupt
53 
54  if (!event) return true;
55  StRunInfo& runInfo = event->runInfo();
56  int run = runInfo.runId();
57  double zdce = runInfo.zdcEastRate();
58  double zdcw = runInfo.zdcWestRate();
59  double zdcx = runInfo.zdcCoincidenceRate();
60  //double bbce = runInfo.bbcEastRate();
61  double bbcw = runInfo.bbcWestRate();
62  double bbcx = runInfo.bbcCoincidenceRate();
63  double bbcbb = runInfo.bbcBlueBackgroundRate();
64  //double bbcyb = runInfo.bbcYellowBackgroundRate();
65 
66  // only for Run 8 dAu
67  if (run > 8330000 && run < 9029000) {
68 
69  // zdcx check
70  if (zdcx/bbcx > 0.42 ||
71  zdcx/zdcw > 0.35) return false;
72 
73  // zdce check
74  if (run > 8361110 && run < 8363032) {
75  if (zdce/bbcx > 2.9 ||
76  zdce/zdcw > 1.8) return false;
77  } else {
78  if (zdce/bbcx > 1.9 ||
79  zdce/zdcw > 1.8) return false;
80  }
81 
82  // bbcbb check (for 1-second scalers)
83  double R1 = 1.4923e-3*pow(zdcw,-2.57818)*pow(bbcw,3.6488);
84  double R2 = bbcbb/R1;
85  if (((R2 > 0.2) && (R2 < 0.72)) ||
86  ((R2 > 1.4) && (R2 < 4.6) )) return false;
87 
88  } // Run 8 dAu cuts
89 
90  return true;
91 }
Apply cuts to events based on corrupt RICH scalers.
Definition: Stypes.h:49
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
Definition: Stypes.h:40