8 #include <phgenfit/Track.h>
9 #include <calobase/RawClusterContainer.h>
10 #include <calobase/RawCluster.h>
13 #include <trackbase_historic/SvtxVertexMap.h>
14 #include <trackbase_historic/SvtxVertex.h>
15 #include <trackbase_historic/SvtxHitMap.h>
16 #include <trackbase_historic/SvtxHit.h>
17 #include <trackbase_historic/SvtxClusterMap.h>
18 #include <trackbase_historic/SvtxCluster.h>
29 #include <TLorentzVector.h>
45 cout<<
"deleting RCE"<<endl;
59 _treeSignal =
new TTree(
"recoSignal",
"strong saharah bush");
60 _treeSignal->SetAutoSave(300);
67 _treeSignal->Branch(
"refit", &
_b_refit);
82 _allTracks = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
88 _clusterMap = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
91 _truthinfo = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
105 if (abs(iter->second->get_charge())==1&&iter->second->get_pt()>
_kTrackPtCut&&abs(iter->second->get_eta())<1.)
117 if (thisTrack->
get_charge()*-1==jter->second->get_charge()&&jter->second->get_pt()>
_kTrackPtCut&&abs(iter->second->get_eta())<1.)
129 std::pair<PHGenFit::Track*,PHGenFit::Track*> refit_tracks =
refitTracks(vtxCan,thisTrack,jter->second);
154 cout<<
"photon not reconstructed"<<endl;
199 if(!(recoVertex&&reco1&&reco2)) {
202 TVector3 nextPos = recoVertex->
getPos();
203 nextPos.SetMagThetaPhi(
_regressor->
regress(reco1,reco2,recoVertex),nextPos.Theta(),nextPos.Phi());
205 using namespace genfit;
207 std::vector<GFRaveTrackParameters*>
tracks;
217 if (recos.first&&recos.second)
219 cout<<
"reconstructing photon from refit tracks"<<endl;
224 return new TLorentzVector(tlv1+tlv2);
232 cout<<
"reconstructing photon from svtx tracks"<<endl;
237 return new TLorentzVector(tlv1+tlv2);
243 std::pair<PHGenFit::Track*,PHGenFit::Track*>
r;
246 cerr<<
"WARNING: No vertex to refit tracks"<<endl;
288 float dR = sqrt(recoVertPos.x()*recoVertPos.x()+recoVertPos.y()*recoVertPos.y())-sqrt(track->
get_x()*track->
get_x()+track->
get_y()*track->
get_y());
289 float dZ = recoVertPos.z()-track->
get_z();
296 float vtxR=sqrt(recoVertPos.x()*recoVertPos.x()+recoVertPos.y()*recoVertPos.y());
298 return sqrt(vtxR*vtxR+trackR*trackR-2*vtxR*trackR*cos(recoVertPos.Phi()-track->
get_phi()))<
_kVtxRPhiCut;
302 return sqrt(recoVertPos.x()*recoVertPos.x()+recoVertPos.y()*recoVertPos.y()) >
_kVtxRCut;
306 cout<<
"Did RecoConversionEval with "<<
totalTracks<<
" total tracks\n\t";
307 cout<<1-(float)
passedpTEtaQ/totalTracks<<
"+/-"<<sqrt((
float)
passedpTEtaQ)/totalTracks<<
" of tracks were rejected by pTEtaQ\n\t";
316 cout<<
"good end"<<endl;
321 static const double eps = 0.000001;
332 double D = a*c - b*
b;
337 tc = (b>c ? d/b : e/
c);
340 sc = (b*e - c*d) / D;
341 tc = (a*e - b*d) / D;