73 template <
class T>
void CleanVec(std::vector<T> &
v)
75 std::vector<T>().
swap(v);
82 :
SubsysReco(name), _get_truth_pv(
true), _get_reco_cluster(
true), _get_centrality(
true), _get_trkr_hit(
true), _outputFile(outputfile), IsData(isData), svtx_evalstack(nullptr), truth_eval(nullptr), clustereval(nullptr), hiteval(nullptr),
83 dst_clustermap(nullptr), clusterhitmap(nullptr), hitsets(nullptr), _tgeometry(nullptr), m_truth_info(nullptr), m_CentInfo(nullptr)
85 std::cout <<
"dNdEtaINTT::dNdEtaINTT(const std::string &name) Calling ctor" << std::endl;
94 std::cout <<
"dNdEtaINTT::Init(PHCompositeNode *topNode) Initializing" << std::endl <<
"Running on Data or simulation? -> IsData = " <<
IsData << std::endl;
97 outtree =
new TTree(
"EventTree",
"EventTree");
149 std::cout <<
"dNdEtaINTT::InitRun(PHCompositeNode *topNode) Initializing for Run XXX" << std::endl;
157 std::cout <<
"dNdEtaINTT::process_event(PHCompositeNode *topNode) Processing Event" <<
eventNum << std::endl;
179 m_CentInfo = findNode::getClass<CentralityInfo>(topNode,
"CentralityInfo");
182 std::cout <<
PHWHERE <<
"Error, can't find CentralityInfov1" << std::endl;
186 dst_clustermap = findNode::getClass<TrkrClusterContainerv4>(topNode,
"TRKR_CLUSTER");
189 std::cout <<
PHWHERE <<
"Error, can't find trkr clusters" << std::endl;
193 clusterhitmap = findNode::getClass<TrkrClusterHitAssoc>(topNode,
"TRKR_CLUSTERHITASSOC");
196 std::cout <<
PHWHERE <<
"Error, can't find cluster-hit map" << std::endl;
200 hitsets = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
203 std::cout <<
PHWHERE <<
"Error, can't find cluster-hit map" << std::endl;
207 _tgeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
210 std::cout <<
PHWHERE <<
"Error, can't find Acts geometry" << std::endl;
215 m_truth_info = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
218 std::cout <<
PHWHERE <<
"Error, can't find G4TruthInfo" << std::endl;
224 std::cout <<
"Running on simulation" << std::endl;
226 eventheader = findNode::getClass<EventHeader>(topNode,
"EventHeader");
229 std::cout <<
PHWHERE <<
"Error, can't find EventHeader" << std::endl;
259 std::cout <<
"dNdEtaINTT::ResetEvent(PHCompositeNode *topNode) Resetting internal structures, prepare for next event" << std::endl;
266 std::cout <<
"dNdEtaINTT::EndRun(const int runnumber) Ending Run for Run " << runnumber << std::endl;
273 std::cout <<
"dNdEtaINTT::End(PHCompositeNode *topNode) This is the End - Output to " <<
_outputFile << std::endl;
276 outtree->Write(
"", TObject::kOverwrite);
286 std::cout <<
"dNdEtaINTT::Reset(PHCompositeNode *topNode) being Reset" << std::endl;
291 void dNdEtaINTT::Print(
const std::string &what)
const { std::cout <<
"dNdEtaINTT::Print(const std::string &what) const Printing info for " << what << std::endl; }
300 while (ancestor !=
nullptr)
311 std::cout <<
"Get centrality info." << std::endl;
326 std::cout <<
"Glauber parameter information: (ncoll,npart) = (" <<
ncoll_ <<
", " <<
npart_ <<
")" << std::endl;
331 std::cout <<
"Get TrkrHit info." << std::endl;
355 std::cout <<
"Get reconstructed cluster info." << std::endl;
357 std::vector<int> _NClus = {0, 0};
358 std::map<int, unsigned int> AncG4P_cluster_count;
359 AncG4P_cluster_count.clear();
367 for (
auto iter = range.first; iter != range.second; ++iter)
379 if (cluster ==
nullptr)
381 std::cout <<
"cluster is nullptr, ckey=" << ckey << std::endl;
385 ClusX_.push_back(globalpos(0));
386 ClusY_.push_back(globalpos(1));
387 ClusZ_.push_back(globalpos(2));
389 TVector3
pos(globalpos(0), globalpos(1), globalpos(2));
390 ClusR_.push_back(pos.Perp());
409 if (g4pancestor && AncG4P_cluster_count[g4pancestor->
get_track_id()] == 0)
412 TLorentzVector g4pAncvec;
413 g4pAncvec.SetPxPyPzE(g4pancestor->
get_px(), g4pancestor->
get_py(), g4pancestor->
get_pz(), g4pancestor->
get_e());
426 NClus_ = _NClus[0] + _NClus[1];
428 std::cout <<
"Number of clusters (total,0,1)=(" <<
NClus_ <<
"," << _NClus[0] <<
"," << _NClus[1] <<
")" << std::endl;
431 int uniqueAncG4P = 0, N_MatchedClus = 0;
432 for (
auto it = AncG4P_cluster_count.cbegin();
it != AncG4P_cluster_count.cend(); ++
it)
436 N_MatchedClus +=
it->second;
438 std::cout <<
"(# of unique ancestor G4P, # of matched clusters, ratio)=(" << uniqueAncG4P <<
"," << N_MatchedClus <<
"," << (float)uniqueAncG4P / N_MatchedClus <<
")" << std::endl;
443 std::cout <<
"Get truth primary vertex info." << std::endl;
448 for (
auto iter = vrange.first; iter != vrange.second; ++iter)
450 const int point_id = iter->first;