27 m_list_det_name.push_back(
"H4Tu");
28 m_list_det_name.push_back(
"H4Td");
34 m_list_det_name.push_back(
"H4Bu");
35 m_list_det_name.push_back(
"H4Bd");
41 m_list_det_name.push_back(
"H4Y1Ll");
42 m_list_det_name.push_back(
"H4Y1Lr");
48 m_list_det_name.push_back(
"H4Y1Rl");
49 m_list_det_name.push_back(
"H4Y1Rr");
55 m_list_det_name.push_back(
"H4Y2Ll");
56 m_list_det_name.push_back(
"H4Y2Lr");
62 m_list_det_name.push_back(
"H4Y2Rl");
63 m_list_det_name.push_back(
"H4Y2Rr");
76 const double DT = 40/9.0;
78 const double T0 = 100.5*DT;
79 const double T1 = 450.5*DT;
84 string det_name[N_PL];
87 for (
int i_pl = 0; i_pl < N_PL; i_pl++) {
88 det_name[i_pl] = m_list_det_name[i_pl];
90 m_list_det.push_back(det_id);
93 oss <<
"h1_ele_" << i_pl;
94 h1_ele[i_pl] =
new TH1D(oss.str().c_str(),
"", n_ele, 0.5, n_ele+0.5);
96 oss << det_name[i_pl] <<
";Element ID;Hit count";
97 h1_ele[i_pl]->SetTitle(oss.str().c_str());
101 oss <<
"h1_time_" << i_pl;
102 h1_time[i_pl] =
new TH1D(oss.str().c_str(),
"", NT, T0, T1);
104 oss << det_name[i_pl] <<
";tdcTime;Hit count";
105 h1_time[i_pl]->SetTitle(oss.str().c_str());
111 h2_ele =
new TH2D(
"h2_ele",
"", n_ele, 0.5, n_ele+0.5, n_ele, 0.5, n_ele+0.5);
113 oss <<
";Element ID of " << det_name[0] <<
";Element ID of " << det_name[1] <<
";Hit count";
114 h2_ele->SetTitle(oss.str().c_str());
116 h2_time =
new TH2D(
"h2_time",
"", NT, T0, T1, NT, T0, T1);
118 oss <<
";tdcTime of " << det_name[0] <<
";tdcTime ID of " << det_name[1] <<
";Hit count";
119 h2_time->SetTitle(oss.str().c_str());
129 SQEvent* event_header = findNode::getClass<SQEvent >(topNode,
"SQEvent");
130 SQHitVector* hit_vec = findNode::getClass<SQHitVector>(topNode,
"SQHitVector");
134 for (
int i_pl = 0; i_pl < N_PL; i_pl++) {
137 h1_ele [i_pl]->Fill((*it)->get_element_id());
138 h1_time[i_pl]->Fill((*it)->get_tdc_time ());
141 if (hv[0]->size() == 1 && hv[1]->
size() == 1) {
142 h2_ele ->Fill( hv[0]->at(0)->get_element_id(), hv[1]->at(0)->get_element_id() );
143 h2_time->Fill( hv[0]->at(0)->get_tdc_time (), hv[1]->at(0)->get_tdc_time () );
145 for (
int i_pl = 0; i_pl < N_PL; i_pl++)
delete hv[i_pl];
158 for (
int pl = 0; pl < N_PL; pl++) {
160 oss <<
"h1_ele_" << pl;
162 if (! h1_ele[pl])
return 1;
164 oss <<
"h1_time_" << pl;
166 if (! h1_time[pl])
return 1;
170 if (! h2_ele || ! h2_time)
return 1;
181 TVirtualPad* pad00 = pad0->cd(1);
183 pad00->cd(1); h1_ele[0]->Draw();
184 pad00->cd(2); h1_ele[1]->Draw();
186 h2_ele->Draw(
"colz");
187 if (h1_ele[0]->Integral() + h1_ele[1]->Integral() == 0) {
201 TVirtualPad* pad10 = pad1->cd(1);
203 pad10->cd(1); h1_time[0]->Draw();
204 pad10->cd(2); h1_time[1]->Draw();
206 h2_time->Draw(
"colz");
207 if (h1_time[0]->Integral() + h1_time[1]->Integral() == 0) {
void AutoSetRangeX(TH2 *h2, const int margin_lo=5, const int margin_hi=5)
void AutoSetRange(TH1 *h1, const int margin_lo=5, const int margin_hi=5)
Adjust the axis range via "h1->GetXaxis()->SetRange(bin_lo, bin_hi)" to zoom up non-empty bins...
OnlMonCanvas * GetCanvas(const int num=0)
std::vector< SQHit * >::const_iterator ConstIter
int InitOnlMon(PHCompositeNode *topNode)
virtual ConstIter end() const
void SetStatus(const MonStatus_t stat)
int EndOnlMon(PHCompositeNode *topNode)
void RegisterHist(TH1 *h1, const HistMode_t mode=MODE_ADD)
int InitRunOnlMon(PHCompositeNode *topNode)
virtual const std::string Name() const
Returns the name of this module.
An SQ interface class to hold a list of SQHit objects.
An SQ interface class to hold one event header.
void AutoSetRangeY(TH2 *h2, const int margin_lo=5, const int margin_hi=5)
int ProcessEventOnlMon(PHCompositeNode *topNode)
static GeomSvc * instance()
singlton instance
virtual size_t size() const
int getDetectorID(const std::string &detectorName) const
Get the plane position.
TH1 * FindMonHist(const std::string name, const bool non_null=true)
int getPlaneNElements(int detectorID)
void AddMessage(const char *msg)
OnlMonH4(const HodoType_t type)
SQHitVector * FindHits(const SQHitVector *vec_in, const std::string det_name)
Extract a set of hits that are of the given detector (det_name).