11 #include <calobase/RawTowerGeomContainer.h>
12 #include <calobase/RawTowerContainer.h>
13 #include <calobase/RawTowerGeom.h>
14 #include <calobase/RawTowerv1.h>
16 #include <calobase/RawClusterContainer.h>
17 #include <calobase/RawCluster.h>
19 #include <g4vertex/GlobalVertexMap.h>
20 #include <g4vertex/GlobalVertex.h>
41 string caloname =
"NONE";
52 findNode::getClass<SvtxTrackMap>(_topNode,
"SvtxTrackMap_FastSim");
55 cout <<
PHWHERE <<
"SvtxTrackMap node not found on node tree"
83 float cx = cluster->
get_x();
84 float cy = cluster->
get_y();
88 ( caloname ==
"FEMC" || caloname ==
"EEMC" ) )
91 track_itr != trackmap->
end(); track_itr++)
101 state_itr != track->
end_states(); state_itr++)
109 dr = sqrt( pow( cx - temp->
get_x(), 2 ) + pow( cy - temp->
get_y(), 2 ) );
115 if ( ( best_track_dr != best_track_dr ) ||
133 float max_dr_barrel = 10;
135 float ctheta = atan2( cluster->
get_r() , cluster->
get_z() );
136 float ceta = -log( tan( ctheta / 2.0 ) );
137 float cphi = cluster->
get_phi();
141 ( caloname ==
"CEMC" ) )
144 track_itr != trackmap->
end(); track_itr++)
154 state_itr != track->
end_states(); state_itr++)
162 dr = sqrt( pow( ceta - temp->
get_eta(), 2 ) + pow( cphi - temp->
get_phi(), 2 ) );
168 if ( ( best_track_dr != best_track_dr ) ||
169 (dr < max_dr_barrel &&
170 dr < best_track_dr) )
192 string clusternodename =
"CLUSTER_" + detName;
193 RawClusterContainer *clusterList = findNode::getClass<RawClusterContainer>(_topNode,clusternodename.c_str());
195 cerr <<
PHWHERE <<
" ERROR: Can't find node " << clusternodename << endl;
202 for (
unsigned int k = 0;
k < clusterList->
size(); ++
k) {
208 double cluster_theta = atan2( cluster->
get_r() , cluster->
get_z() );
209 double cluster_eta = -log(tan(cluster_theta/2.0));
211 double deta = eta-cluster_eta;
212 double r = sqrt(pow(dphi,2)+pow(deta,2));
216 cluster_min_dr = cluster;
245 return cluster_min_dr;
253 string towernodename =
"TOWER_CALIB_" + detName;
255 RawTowerContainer* towerList = findNode::getClass<RawTowerContainer>(_topNode, towernodename.c_str());
258 std::cout <<
PHWHERE <<
": Could not find node " << towernodename.c_str() << std::endl;
261 string towergeomnodename =
"TOWERGEOM_" + detName;
262 RawTowerGeomContainer *towergeo = findNode::getClass<RawTowerGeomContainer>(_topNode, towergeomnodename.c_str());
265 cout <<
PHWHERE <<
": Could not find node " << towergeomnodename.c_str() << endl;
273 float energy_3x3 = 0.0;
274 float energy_5x5 = 0.0;
276 for (
int iphi = binphi-2; iphi <= binphi+2; ++iphi) {
277 for (
int ieta = bineta-2; ieta <= bineta+2; ++ieta) {
289 if (ieta < 0)
continue;
295 if (abs(iphi - binphi)<=1 and abs(ieta - bineta)<=1 )
311 string towernodename =
"TOWER_CALIB_" + detName;
313 RawTowerContainer* towers = findNode::getClass<RawTowerContainer>(_topNode, towernodename.c_str());
316 std::cout <<
PHWHERE <<
": Could not find node " << towernodename.c_str() << std::endl;
319 string towergeomnodename =
"TOWERGEOM_" + detName;
320 RawTowerGeomContainer *towergeom = findNode::getClass<RawTowerGeomContainer>(_topNode, towergeomnodename.c_str());
323 cout <<
PHWHERE <<
": Could not find node " << towergeomnodename.c_str() << endl;
328 float r_dist = 9999.0;
335 for (; itr != begin_end.second; ++itr)
343 float temp_rdist = sqrt(pow(tkx-x,2) + pow(tky-y,2)) ;
344 if(temp_rdist< r_dist){
351 (fabs(tky-y)<(tgeo->
get_size_y()/2.0)) )
break;
356 if(twr_j>=0 && twr_k>=0){
357 for(
int ij = -1; ij <=1; ij++){
358 for(
int ik = -1; ik <=1; ik++){
361 if(rawtower) twr_sum += rawtower->
get_energy();