19 #include <trackbase_historic/SvtxVertexMap.h>
29 fout =
new TFile(
"readback_ntuple.root",
"RECREATE");
31 ntp =
new TNtuple(
"ntp",
"ntp",
"pt:x:y:z:dcaxy:dcaz:vtxid:nclus:qual");
55 cout <<
"TPCGemGainCalb::process_event(PHCompositeNode *topNode) Processing Event" << endl;
62 std::cout <<
"Vertex map has " <<
_vertex_map->
size() <<
" entries" << std::endl;
67 auto vertex = vert_iter->second;
68 vertex_x =
vertex->get_x();
69 vertex_y =
vertex->get_y();
70 vertex_z =
vertex->get_z();
72 std::cout <<
" vertex (x,y,z) = " << vertex_x <<
" , " << vertex_y <<
" , " << vertex_z << std::endl;
80 double mean_clusters = 0;
82 float pt,
x,
y,
z, dcaxy, dcaz, vtxid, nclus, qual;
83 std::cout <<
"Track map has " << _track_map->size() <<
" entries" << std::endl;
84 for (
auto phtrk_iter = _track_map->begin();
85 phtrk_iter != _track_map->end();
88 _track = phtrk_iter->second;
97 nclus = (float)
_track-> size_cluster_keys();
103 <<
": Processing itrack: " << phtrk_iter->first
104 <<
": nclus: " << nclus
109 <<
", dcaxy " << dcaxy
111 <<
", vtxid " << vtxid
129 double cluster_avge_adc = 0.0;
130 double cluster_avge_wt = 0.0;
146 std::cout <<
" cluster " << cluster_key <<
" layer " << layer <<
" zelement " << zelement <<
" phielement " << phielement << std::endl;
150 double radius = sqrt( cluster->
getX()*cluster->
getX() + cluster->
getY()*cluster->
getY() );
151 std::cout <<
" cluster radius " << radius <<
" cluster adc " << cluster->
getAdc() << std::endl;
155 cluster_avge_wt += 1.0;
159 std::cout <<
"Failed to find cluster with key :" << cluster_key << std::endl;
163 if(
Verbosity() > 2) std::cout <<
" TPC cluster_avge_adc " << cluster_avge_adc/cluster_avge_wt << std::endl;
167 std::cout <<
"---- tracks with > 20 clusters " << ntracks <<
" mean nclusters " << mean_clusters /(
double) ntracks <<
" mean pT " << mean_pt / (
double) ntracks << std::endl;
171 cout <<
"TPCGemGainCalb::process_event(PHCompositeNode *topNode) Leaving process_event" << endl;
201 _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
204 cerr <<
PHWHERE <<
" ERROR: Can't find node TRKR_CLUSTER" << endl;
209 _vertex_map = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMap");
212 cerr <<
PHWHERE <<
" ERROR: Can't find SvtxVertexMap." << endl;
217 _track_map = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
220 cerr <<
PHWHERE <<
" ERROR: Can't find SvtxTrackMap: " << endl;