32 int ret = GetNodes(topNode);
40 vector<int> vec_id_h1 = ExtractParticleID(g4hc_h1t, g4hc_h1b);
41 vector<int> vec_id_h2 = ExtractParticleID(g4hc_h2t, g4hc_h2b);
42 vector<int> vec_id_h3 = ExtractParticleID(g4hc_h3t, g4hc_h3b);
43 vector<int> vec_id_h4 = ExtractParticleID(g4hc_h4t, g4hc_h4b);
46 map<int, int> map_nhit;
47 CountHitPlanesPerParticle(vec_id_h1, map_nhit);
48 CountHitPlanesPerParticle(vec_id_h2, map_nhit);
49 CountHitPlanesPerParticle(vec_id_h3, map_nhit);
50 CountHitPlanesPerParticle(vec_id_h4, map_nhit);
54 for (map<int, int>::iterator it = map_nhit.begin(); it != map_nhit.end(); it++) {
55 if (it->second >= m_npl_per_par) n_par_ok++;
68 g4hc_h1t = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_H1T");
69 g4hc_h1b = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_H1B");
70 g4hc_h2t = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_H2T");
71 g4hc_h2b = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_H2B");
72 g4hc_h3t = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_H3T");
73 g4hc_h3b = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_H3B");
74 g4hc_h4t = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_H4T");
75 g4hc_h4b = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_H4B");
77 if (!g4hc_h1t || !g4hc_h1b || !g4hc_h2t || !g4hc_h2b ||
78 !g4hc_h3t || !g4hc_h3b || !g4hc_h4t || !g4hc_h4b ) {
84 void RequireParticlesInAcc::ExtractParticleID(
const PHG4HitContainer* g4hc, vector<int>& vec_par_id)
96 ExtractParticleID(g4hc_t, vec);
97 ExtractParticleID(g4hc_b, vec);
98 sort(vec.begin(), vec.end());
99 vec.erase(unique(vec.begin(), vec.end()), vec.end());
103 void RequireParticlesInAcc::CountHitPlanesPerParticle(
const vector<int> vec_id, map<int, int>& map_nhit)
105 for (vector<int>::const_iterator it = vec_id.begin(); it != vec_id.end(); it++) {
107 if (map_nhit.find(
id) == map_nhit.end()) map_nhit[
id] = 1;
virtual int get_trkid() const
ConstRange getHits(const unsigned int detid) const
return all hits matching a given detid
RequireParticlesInAcc(const std::string &name="ACCEPTANCE")
std::pair< ConstIterator, ConstIterator > ConstRange
Map::const_iterator ConstIterator
int InitRun(PHCompositeNode *topNode)
int Init(PHCompositeNode *topNode)
virtual ~RequireParticlesInAcc()
int End(PHCompositeNode *topNode)
Called at the end of all processing.
int process_event(PHCompositeNode *topNode)