// $Id$ // // File: DTrackCandidate_factory_CDC_or_FDCpseudo.cc // Created: Thu Apr 16 09:14:49 EDT 2009 // Creator: davidl (on Darwin harriet.jlab.org 9.6.0 i386) // #include #include using namespace std; #include "DTrackCandidate_factory_CDC_or_FDCpseudo.h" using namespace jana; //------------------ // init //------------------ jerror_t DTrackCandidate_factory_CDC_or_FDCpseudo::init(void) { DEBUG_LEVEL = 0; gPARMS->SetDefaultParameter("TRKFIND:DEBUG_LEVEL", DEBUG_LEVEL); return NOERROR; } //------------------ // brun //------------------ jerror_t DTrackCandidate_factory_CDC_or_FDCpseudo::brun(jana::JEventLoop *eventLoop, int runnumber) { return NOERROR; } //------------------ // evnt //------------------ jerror_t DTrackCandidate_factory_CDC_or_FDCpseudo::evnt(JEventLoop *loop, int eventnumber) { /// This factory simply combines the list of candidates from the /// DTrackCandidate:CDC and DTrackCandidate:FDCpseudo factories /// into a single lit. It simply copies the pointers and flags /// itself as not being the owner of any of these objects. vector cdc; vector fdc; loop->Get(cdc, "CDC"); loop->Get(fdc, "FDCpseudo"); // Add FDC candidates if(DEBUG_LEVEL>2)_DBG_<<"Copying "<2)_DBG_<<"Checking "<momentum(); DVector3 pos1 = cdc[i]->position(); double q1 = cdc[i]->charge(); bool is_clone = false; for(unsigned int j=0; j<_data.size(); j++){ DVector3 mom2 = _data[j]->momentum(); DVector3 pos2 = _data[j]->position(); double q2 = _data[j]->charge(); double curvature_diff = fabs(1.0/mom1.Mag() - 1.0/mom2.Mag())/((1.0/mom1.Mag() + 1.0/mom2.Mag())/2.0); double relative_mom_diff = fabs(mom1.Mag()-mom2.Mag())/((mom1.Mag()+mom2.Mag())/2.0); if(DEBUG_LEVEL>4)_DBG_<<"q1="<1)_DBG_<<" CDC candidate "<