21 case P1:
Name(
"OnlMonPropP1" );
Title(
"Prop Tube: P1");
break;
22 case P2:
Name(
"OnlMonPropP2" );
Title(
"Prop Tube: P2");
break;
34 string name_regex =
"";
36 case P1: name_regex =
"^P1";
break;
37 case P2: name_regex =
"^P2";
break;
40 if (list_det_id.size() == 0) {
41 cout <<
"OnlMonProp::InitRunOnlMon(): Found no ID for '" << name_regex <<
"'." << endl;
44 m_pl0 = list_det_id[0];
47 for (
int pl = 0; pl <
N_PL; pl++) {
51 oss <<
"h1_ele_" << pl;
52 h1_ele[pl] =
new TH1D(oss.str().c_str(),
"", n_ele, 0.5, n_ele+0.5);
54 oss << name <<
";Element ID;Hit count";
55 h1_ele[pl]->SetTitle(oss.str().c_str());
57 const double DT = 80/9.0;
59 const double T0 = 0.5*DT;
60 const double T1 = 100.5*DT;
63 oss <<
"h1_time_" << pl;
64 h1_time[pl] =
new TH1D(oss.str().c_str(),
"", NT, T0, T1);
67 oss << name <<
";tdcTime;Hit count";
68 h1_time[pl]->SetTitle(oss.str().c_str());
79 SQEvent* event_header = findNode::getClass<SQEvent >(topNode,
"SQEvent");
80 SQHitVector* hit_vec = findNode::getClass<SQHitVector>(topNode,
"SQHitVector");
84 int pl = (*it)->get_detector_id() - m_pl0;
85 if (pl < 0 || pl >=
N_PL)
continue;
86 h1_ele [pl]->Fill((*it)->get_element_id());
87 h1_time[pl]->Fill((*it)->get_tdc_time ());
101 for (
int pl = 0; pl <
N_PL; pl++) {
103 oss <<
"h1_ele_" << pl;
105 if (! h1_ele[pl])
return 1;
107 oss <<
"h1_time_" << pl;
109 if (! h1_time[pl])
return 1;
120 for (
int pl = 0; pl <
N_PL; pl++) {
130 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)
int EndOnlMon(PHCompositeNode *topNode)
std::vector< SQHit * >::const_iterator ConstIter
int InitRunOnlMon(PHCompositeNode *topNode)
void RegisterHist(TH1 *h1, const HistMode_t mode=MODE_ADD)
int ProcessEventOnlMon(PHCompositeNode *topNode)
virtual const std::string Name() const
Returns the name of this module.
int InitOnlMon(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)
static GeomSvc * instance()
singlton instance
TH1 * FindMonHist(const std::string name, const bool non_null=true)
int getPlaneNElements(int detectorID)
OnlMonProp(const PropType_t type)