20 Name(
"OnlMonTrigNim");
31 h2_count =
new TH2D(
"h2_count",
"N of events in which each plane has hit;;", 8, 0.5, 8.5, 10, 0.5, 10.5);
32 for (
int ii = 1; ii <= 5; ii++) {
35 h2_count->GetYaxis()->SetBinLabel(ii, oss.str().c_str());
38 h2_count->GetYaxis()->SetBinLabel(ii + 5, oss.str().c_str());
40 h2_count->GetXaxis()->SetBinLabel(1,
"H1X");
41 h2_count->GetXaxis()->SetBinLabel(2,
"H1Y");
42 h2_count->GetXaxis()->SetBinLabel(3,
"H2X");
43 h2_count->GetXaxis()->SetBinLabel(4,
"H2Y");
44 h2_count->GetXaxis()->SetBinLabel(5,
"H3X");
45 h2_count->GetXaxis()->SetBinLabel(6,
"H4X");
46 h2_count->GetXaxis()->SetBinLabel(7,
"H4Y1");
47 h2_count->GetXaxis()->SetBinLabel(8,
"H4Y2");
49 RegisterHist(h2_count);
56 SQEvent*
event = findNode::getClass<SQEvent >(topNode,
"SQEvent");
57 SQHitVector* hit_vec = findNode::getClass<SQHitVector>(topNode,
"SQHitVector");
64 lhm[(*it)->get_detector_id()].push_back(*it);
69 bool hit_h1x = lhm.find(geom->
getDetectorID(
"H1B" )) != lhm.end()
71 bool hit_h1y = lhm.find(geom->
getDetectorID(
"H1L" )) != lhm.end()
73 bool hit_h2x = lhm.find(geom->
getDetectorID(
"H2B" )) != lhm.end()
75 bool hit_h2y = lhm.find(geom->
getDetectorID(
"H2L" )) != lhm.end()
77 bool hit_h3x = lhm.find(geom->
getDetectorID(
"H3B" )) != lhm.end()
79 bool hit_h4x = lhm.find(geom->
getDetectorID(
"H4B" )) != lhm.end()
81 bool hit_h4y1 = lhm.find(geom->
getDetectorID(
"H4Y1L")) != lhm.end()
83 bool hit_h4y2 = lhm.find(geom->
getDetectorID(
"H4Y2L")) != lhm.end()
87 bool trig_flag[10] = {
99 for (
int i_trig = 0; i_trig < 10; i_trig++) {
100 if (! trig_flag[i_trig])
continue;
101 h2_count->Fill(0.0, i_trig+1);
102 if (hit_h1x ) h2_count->Fill(1, i_trig+1);
103 if (hit_h1y ) h2_count->Fill(2, i_trig+1);
104 if (hit_h2x ) h2_count->Fill(3, i_trig+1);
105 if (hit_h2y ) h2_count->Fill(4, i_trig+1);
106 if (hit_h3x ) h2_count->Fill(5, i_trig+1);
107 if (hit_h4x ) h2_count->Fill(6, i_trig+1);
108 if (hit_h4y1) h2_count->Fill(7, i_trig+1);
109 if (hit_h4y2) h2_count->Fill(8, i_trig+1);
122 h2_count = (TH2*)FindMonHist(
"h2_count");
123 return (h2_count ? 0 : 1);
128 static TH2* h2_rate = 0;
129 if (! h2_rate)
delete h2_rate;
130 h2_rate = (TH2*)h2_count->Clone(
"h2_rate");
131 h2_rate->SetTitle(
"Percent of events in which each plane has hit");
132 for (
int iy = 1; iy <= h2_rate->GetNbinsY(); iy++) {
133 double cont0 = h2_rate->GetBinContent(0, iy);
134 if (cont0 <= 0)
continue;
135 for (
int ix = 1; ix <= h2_rate->GetNbinsX(); ix++) {
136 double cont = h2_rate->GetBinContent(ix, iy);
137 h2_rate->SetBinContent(ix, iy, 100 * cont / cont0);
140 h2_rate->GetZaxis()->SetRangeUser(0, 100);
147 h2_count->Draw(
"colz");
149 h2_rate->Draw(
"colz");
150 h2_rate->SetMarkerSize(2.0);
151 gStyle->SetPaintTextFormat(
"3.0f");
152 h2_rate->Draw(
"TEXTsame");
154 if (h2_count->Integral() == 0) {
std::vector< SQHit * >::const_iterator ConstIter
int InitRunOnlMon(PHCompositeNode *topNode)
int ProcessEventOnlMon(PHCompositeNode *topNode)
int EndOnlMon(PHCompositeNode *topNode)
void SetStatus(const MonStatus_t stat)
int InitOnlMon(PHCompositeNode *topNode)
std::map< short, HitList_t > HitListMap_t
An SQ interface class to hold a list of SQHit objects.
An SQ interface class to hold one event header.
static GeomSvc * instance()
singlton instance
int getDetectorID(const std::string &detectorName) const
Get the plane position.
void AddMessage(const char *msg)