21 case D0 :
Name(
"OnlMonChamD0" );
Title(
"Chamber: D0" );
break;
22 case D1 :
Name(
"OnlMonChamD1" );
Title(
"Chamber: D1" );
break;
23 case D2 :
Name(
"OnlMonChamD2" );
Title(
"Chamber: D2" );
break;
24 case D3p:
Name(
"OnlMonChamD3p");
Title(
"Chamber: D3p");
break;
25 case D3m:
Name(
"OnlMonChamD3m");
Title(
"Chamber: D3m");
break;
36 const double DT = 40/9.0;
42 string name_regex =
"";
44 case D0 : name_regex =
"^D0" ;
break;
45 case D1 : name_regex =
"^D1" ;
break;
46 case D2 : name_regex =
"^D2" ; NT=150; T0=100.5*DT; T1=250.5*DT;
break;
47 case D3p: name_regex =
"^D3p"; NT=150; T0=100.5*DT; T1=250.5*DT;
break;
48 case D3m: name_regex =
"^D3m"; NT=150; T0=100.5*DT; T1=250.5*DT;
break;
51 if (list_det_id.size() == 0) {
52 cout <<
"OnlMonCham::InitRunOnlMon(): Found no ID for '" << name_regex <<
"'." << endl;
55 m_pl0 = list_det_id[0];
58 for (
int pl = 0; pl <
N_PL; pl++) {
62 oss <<
"h1_ele_" << pl;
63 h1_ele[pl] =
new TH1D(oss.str().c_str(),
"", n_ele, 0.5, n_ele+0.5);
65 oss << name <<
";Element ID;Hit count";
66 h1_ele[pl]->SetTitle(oss.str().c_str());
69 oss <<
"h1_time_" << pl;
70 h1_time[pl] =
new TH1D(oss.str().c_str(),
"", NT, T0, T1);
73 oss << name <<
";tdcTime;Hit count";
74 h1_time[pl]->SetTitle(oss.str().c_str());
85 SQEvent* event_header = findNode::getClass<SQEvent >(topNode,
"SQEvent");
86 SQHitVector* hit_vec = findNode::getClass<SQHitVector>(topNode,
"SQHitVector");
90 int pl = (*it)->get_detector_id() - m_pl0;
91 if (pl < 0 || pl >=
N_PL)
continue;
92 h1_ele [pl]->Fill((*it)->get_element_id());
93 h1_time[pl]->Fill((*it)->get_tdc_time ());
107 for (
int pl = 0; pl <
N_PL; pl++) {
109 oss <<
"h1_ele_" << pl;
111 if (! h1_ele[pl])
return 1;
113 oss <<
"h1_time_" << pl;
115 if (! h1_time[pl])
return 1;
126 for (
int pl = 0; pl <
N_PL; pl++) {
136 for (
int pl = 0; pl <
N_PL; pl++) {
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...
std::string getDetectorName(const int &detectorID) const
OnlMonCanvas * GetCanvas(const int num=0)
std::vector< SQHit * >::const_iterator ConstIter
OnlMonCham(const ChamType_t type)
void RegisterHist(TH1 *h1, const HistMode_t mode=MODE_ADD)
int InitOnlMon(PHCompositeNode *topNode)
virtual const std::string Name() const
Returns the name of this module.
int EndOnlMon(PHCompositeNode *topNode)
An SQ interface class to hold a list of SQHit objects.
An SQ interface class to hold one event header.
std::vector< int > getDetectorIDs(std::string pattern)
int InitRunOnlMon(PHCompositeNode *topNode)
static GeomSvc * instance()
singlton instance
TH1 * FindMonHist(const std::string name, const bool non_null=true)
int getPlaneNElements(int detectorID)
int ProcessEventOnlMon(PHCompositeNode *topNode)