15 , m_list_name(list_name)
16 , m_name_file(
"embedding_data.root")
29 SQRun* sq_run = findNode::getClass<SQRun>(topNode,
"SQRun");
33 mi_evt = findNode::getClass<SQEvent >(topNode,
"SQEvent");
34 mi_vec_hit = findNode::getClass<SQHitVector >(topNode,
"SQHitVector");
35 if (!mi_evt || !mi_vec_hit) {
36 cout <<
PHWHERE <<
": Cannot find SQEvent and/or SQHitVector." << endl;
40 mo_file =
new TFile(m_name_file.c_str(),
"RECREATE");
41 mo_tree =
new TTree(m_name_tree.c_str(),
"Created by GenEmbeddingDataNim4");
42 mo_tree->Branch(
"SQEvent" , &mi_evt);
43 mo_tree->Branch(
"SQHitVector", &mi_vec_hit);
44 mo_tree->Branch(
"qa_data" , &mo_qa_data);
52 if (std::find(m_list_spill_id.begin(), m_list_spill_id.end(), spill_id) == m_list_spill_id.end()) {
61 mo_qa_data.
D1 = mo_qa_data.
D2 = mo_qa_data.
D3p = mo_qa_data.
D3m = 0;
65 if ( 0 < det_id && det_id <= 6) mo_qa_data.
D1++;
66 else if (12 < det_id && det_id <= 18) mo_qa_data.
D2++;
67 else if (18 < det_id && det_id <= 24) mo_qa_data.
D3p++;
68 else if (24 < det_id && det_id <= 30) mo_qa_data.
D3m++;
85 m_list_spill_id.clear();
86 ifstream ifs(m_list_name);
89 while (ifs >> run >> spill) {
90 if (run == run_id) m_list_spill_id.push_back(spill);
93 int n_sp = m_list_spill_id.size();
94 cout <<
"GenEmbeddingDataNim4::ReadSpillList(): " << n_sp <<
" spills." << endl;
95 if (m_list_spill_id.size() == 0) {
96 cout <<
"!!ERROR!! No good spill from the list. Abort." << endl;
int Init(PHCompositeNode *topNode)
void ReadSpillList(const int run_id)
int End(PHCompositeNode *topNode)
Called at the end of all processing.
GenEmbeddingDataNim4(const std::string list_name, const std::string name="GenEmbeddingDataNim4")
int InitRun(PHCompositeNode *topNode)
int process_event(PHCompositeNode *topNode)
virtual int get_qie_rf_intensity(const short i) const =0
Return the i-th QIE RF intensity, where i=-16...+16.
virtual int get_qie_turn_id() const =0
Return the QIE turn ID.
virtual int get_qie_rf_id() const =0
Return the QIE RF ID.
virtual int get_spill_id() const =0
Return the spill ID.
virtual ConstIter end() const =0
virtual ConstIter begin() const =0
std::vector< SQHit * >::iterator Iter
An SQ interface class to hold one detector hit.
virtual short get_detector_id() const
Return the detector ID of this hit.
An SQ interface class to hold the run-level info.
virtual int get_run_id() const
Return the run ID.