diff --git a/Detector/DetCRD/compact/CRD_common_v01/DC_Simple_v01_05.xml b/Detector/DetCRD/compact/CRD_common_v01/DC_Simple_v01_05.xml index 6c05c4fa0be671f7c782628aa5b7440484628380..383019ecbed184c7ca139c4222c2b1d32e8ed641 100644 --- a/Detector/DetCRD/compact/CRD_common_v01/DC_Simple_v01_05.xml +++ b/Detector/DetCRD/compact/CRD_common_v01/DC_Simple_v01_05.xml @@ -12,12 +12,12 @@ <define> - <constant name="DC_layer_number" value="100"/> + <constant name="DC_layer_number" value="55"/> <constant name="Alpha" value="12*deg"/> <constant name="Gas_radius_min" value="DC_rbegin+DC_inner_wall_thickness+DC_safe_distance"/> <constant name="Gas_half_length" value="DC_half_length-DC_Endcap_dz-DC_safe_distance"/> <constant name="Gas_length" value="Gas_half_length*2"/> - <constant name="DC_cell_width" value="10*mm"/> + <constant name="DC_cell_width" value="18*mm"/> <constant name="DC_inner_wall_radius_min" value="DC_rbegin"/> <constant name="DC_inner_wall_radius_max" value="DC_rbegin+DC_inner_wall_thickness"/> <constant name="DC_Endcap_rmin" value="DC_rbegin"/> @@ -25,7 +25,7 @@ <constant name="DC_construct_wire" value="0"/> - <constant name="DC_layer_width" value="9.57687*mm"/> + <constant name="DC_layer_width" value="18*mm"/> </define> diff --git a/Detector/DetCRD/compact/CRD_o1_v01/CRD_o1_v01-onlyTracker.xml b/Detector/DetCRD/compact/CRD_o1_v01/CRD_o1_v01-onlyTracker.xml index 3ac63dc4b86b225ce8fbfe75d19e05f64eda90e3..d80301fb225b570f93d4a5bf91454456ab8b2a25 100644 --- a/Detector/DetCRD/compact/CRD_o1_v01/CRD_o1_v01-onlyTracker.xml +++ b/Detector/DetCRD/compact/CRD_o1_v01/CRD_o1_v01-onlyTracker.xml @@ -31,7 +31,7 @@ <include ref="../CRD_common_v01/VXD_v01_01.xml"/> <include ref="../CRD_common_v01/FTD_SkewRing_v01_01.xml"/> <include ref="../CRD_common_v01/SIT_SimplePixel_v01_01.xml"/> - <include ref="../CRD_common_v01/DC_Simple_v01_04_noWire.xml"/> + <include ref="../CRD_common_v01/DC_Simple_v01_05.xml"/> <include ref="../CRD_common_v01/SET_SimplePixel_v01_01.xml"/> <fields> diff --git a/Detector/DetDriftChamber/src/driftchamber/DriftChamber.cpp b/Detector/DetDriftChamber/src/driftchamber/DriftChamber.cpp index 634698ce11ffbb74d3002b21205e5ecb61e1b6d2..ab80570fc43edff76944768898b0d9333dbd745c 100644 --- a/Detector/DetDriftChamber/src/driftchamber/DriftChamber.cpp +++ b/Detector/DetDriftChamber/src/driftchamber/DriftChamber.cpp @@ -240,6 +240,8 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, }//end of loop over cell dd4hep::Transform3D transform_layer(dd4hep::Rotation3D(), dd4hep::Position(0,0,0)); + dd4hep::PlacedVolume layer_phy = det_chamber_vol.placeVolume(layer_vol,transform_layer); + layer_phy.addPhysVolID("layer", layer_id); }//end of loop over layers diff --git a/Reconstruction/RecGenfitAlg/src/GenfitTrack.cpp b/Reconstruction/RecGenfitAlg/src/GenfitTrack.cpp index ccd4c72a9a5d73ed0d4e66162aabccaf534ac386..19bb23c791f094d1c1c0bb175279ee5ea645600c 100644 --- a/Reconstruction/RecGenfitAlg/src/GenfitTrack.cpp +++ b/Reconstruction/RecGenfitAlg/src/GenfitTrack.cpp @@ -68,27 +68,16 @@ const int GenfitTrack::s_PDG[2][5] bool sortDCSimHit(edm4hep::SimTrackerHit hit1,edm4hep::SimTrackerHit hit2) -//sortDCSimHit(edm4hep::ConstSimTrackerHit hit1,edm4hep::ConstSimTrackerHit hit2) { - //std::cout<<"hit1"<<hit1<<std::endl; - //std::cout<<"hit2"<<hit2<<std::endl; bool isEarly=hit1.getTime()<hit2.getTime(); return isEarly; } bool sortDCDigi(std::pair<double,edm4hep::TrackerHit*> hitPair1,std::pair<double,edm4hep::TrackerHit*> hitPair2) -//sortDCDigi(std::pair<double,edm4hep::ConstTrackerHit*> hitPair1,std::pair<double,edm4hep::ConstTrackerHit*> hitPair2) { bool isEarly=hitPair1.first<hitPair2.first; return isEarly; } -//bool sortDCDigiLayer(std::pair<int,edm4hep::TrackerHit> hitPair1,std::pair<int,edm4hep::TrackerHit> hitPair2) -//bool sortDCDigiLayer(std::pair<int,edm4hep::ConstTrackerHit> hitPair1,std::pair<int,edm4hep::ConstTrackerHit> hitPair2) -//{ -// bool isEarly=hitPair1.first<hitPair2.first; -// return isEarly; -//} - GenfitTrack::GenfitTrack(const GenfitField* genfitField, const dd4hep::DDSegmentation::GridDriftChamber* seg, @@ -164,7 +153,6 @@ bool GenfitTrack::createGenfitTrackFromEDM4HepTrack(int pidType, ///Skip track w.o. hit if(track.trackerHits_size()<=0) { - std::cout << " track.trackerHits_size = " << track.trackerHits_size() << std::endl; if(m_debug){ std::cout<<"createGenfitTrackFromEDM4HepTrack skip track w/o hit"<<std::endl; } @@ -269,23 +257,12 @@ GenfitTrack::getISurface(edm4hep::TrackerHit* hit){ dd4hep::rec::ISurface* iSurface=nullptr; if(iter!=surfaceMap->end()){iSurface=(*iter).second;} - //std::multimap< unsigned long, dd4hep::rec::ISurface*>::const_iterator it,itend; - //it=surfaceMap->begin(); - //itend= surfaceMap->end(); - //std::cout<<" print map "<<detectorName<<std::endl; - //for(; it!=itend; it++){ - // dd4hep::rec::ISurface* surf = it->second; - // dd4hep::rec::Vector3D origin = surf->origin(); - // std::cout <<"surf id "<< surf->id() << " origin xyz " << origin.x() - // << " " << origin.y() << " " << origin.z() << std::endl; - //} return iSurface; } /// Add a 1d strip or 2d pixel smeared by sigma bool GenfitTrack::addSiliconMeasurement(edm4hep::TrackerHit* hit, -//GenfitTrack::addSiliconMeasurement(edm4hep::ConstTrackerHit* hit, float sigmaU,float sigmaV,int cellID,int hitID) { if(m_debug>0) std::cout<<"addSiliconMeasurement "<<*hit<<std::endl; @@ -326,8 +303,6 @@ GenfitTrack::addSiliconMeasurement(edm4hep::TrackerHit* hit, genfit::PlanarMeasurementSDT* planarMeasurement=new genfit::PlanarMeasurementSDT( hitCoords,hitCov,cellID,hitID,nullptr); planarMeasurement->setTrackerHit(hit); - //genfit::PlanarMeasurement* planarMeasurement=new genfit::PlanarMeasurement( - // hitCoords,hitCov,cellID,hitID,nullptr); planarMeasurement->setPlane(plane); m_track->insertPoint(new genfit::TrackPoint(planarMeasurement,m_track)); @@ -416,9 +391,7 @@ int GenfitTrack::addWireMeasurementsFromList(std::vector<edm4hep::TrackerHit*>& int sortMethod, bool truthAmbig,float skipCorner,float skipNear) { if(m_debug>0){ std::cout<<"addWireMeasurementsFromList"<<std::endl; } - //podio::RelationRange<edm4hep::TrackerHit> hits_t=track.getTrackerHits(); std::vector<edm4hep::TrackerHit*> sortedTrackerHits; - // sortedTrackerHits.reserve(100); getSortedTrackerHits(hits,assoHits,sortedTrackerHits,sortMethod); if(m_debug>0){ @@ -593,7 +566,6 @@ void GenfitTrack::setDebugLocal(int debug){ #ifdef GENFIT_MY_DEBUG if(m_track){ for(unsigned int i=0;i<m_track->getNumReps();i++){ - //m_track->getTrackRep(i)->setDebugLvlLocal(debug); } } m_debugLocal=debug; @@ -611,10 +583,8 @@ void GenfitTrack::printSeed() const mom.Print(); print(pos,mom); TMatrixDSym covSeed=m_track->getCovSeed(); - //if(m_debug>1) std::cout << " covSeed = " << std::endl; covSeed.Print(); - //std::cout<<" pdg "<<0<<getRep(0)<<std::endl;//FIXME } void GenfitTrack::printFitted(int repID) const @@ -650,9 +620,6 @@ void GenfitTrack::print( TLorentzVector pos, TVector3 mom, m_track->getTrackRep(i)->Print(); } } - //for(unsigned int i=0; i<m_track->getNumPoints(); i++){ - // m_track->getPoint(i)->print(); - //} } /// Get position, momentum, cov on plane of hitID-th hit @@ -761,7 +728,6 @@ double GenfitTrack::extrapolateToHit(TVector3& poca, TVector3& pocaDir, int chargeId; mcParticle.getCharge() >0 ? chargeId=0 : chargeId=1;//s_PDG[0]: positive particle genfit::RKTrackRep* rep = new genfit::RKTrackRep(s_PDG[chargeId][repID]); - //genfit::MeasuredStateOnPlane state(rep); genfit::StateOnPlane state(rep); rep->setPosMom(state, pos, mom); @@ -803,35 +769,6 @@ double GenfitTrack::extrapolateToHit(TVector3& poca, TVector3& pocaDir, return extrapoLen/GenfitUnit::mm*dd4hep::mm; }//end of extrapolateToHit -/////Add space point measurement from edm4hep::Track to genfit track -//int GenfitTrack::addHitsOnEdm4HepTrack(const edm4hep::Track& track, -// const edm4hep::MCRecoTrackerAssociationCollection* assoHits, -// std::vector<float> sigma,bool smear, -// bool measurementTypeSi, bool measurementTypeDC){ -// ///Get TrackerHit on Track -// int hitID=0; -// for(unsigned int iHit=0;iHit<track.trackerHits_size();iHit++){ -// edm4hep::TrackerHit hit=track.getTrackerHits(iHit); -// ///Get hit type -// int detTypeID=getDetTypeID(hit.getCellID()); -// if(m_debug>=2)std::cout<<"addHitsOnEdm4HepTrack "<<iHit<<" hit "<<hit -// <<" detTypeID "<<detTypeID<<" type "<<hit.getType()<<std::endl; -// -// bool hitIsSpapcePoint=UTIL::BitSet32(hit.getType())[ -// UTIL::ILDTrkHitTypeBit::COMPOSITE_SPACEPOINT]; -// bool hitIsPlanar=UTIL::BitSet32(hit.getType())[ -// UTIL::ILDTrkHitTypeBit::ONE_DIMENSIONAL]; -// if(m_debug>2){ -// std::cout<<detTypeID<<" COMPOSITE_SPACEPOINT "<<hitIsSpapcePoint -// <<std::endl; -// std::cout<<detTypeID<<" ONE_DIMENSIONAL "<<hitIsPlanar<<std::endl; -// } -// -// } -// -// return 1; -//} - ///Add space point measurement of silicon from edm4hep::Track to genfit track int GenfitTrack::addSpacePointsSi(const edm4hep::Track& track, std::vector<float> sigmaU,std::vector<float> sigmaV) @@ -844,8 +781,6 @@ int GenfitTrack::addSpacePointsSi(const edm4hep::Track& track, edm4hep::TrackerHit hit=track.getTrackerHits(iHit); edm4hep::Vector3d pos=hit.getPosition(); - //edm4hep::Vector3d pos=simTrackerHitAsso.getPosition(); - TVector3 p(pos.x,pos.y,pos.z); p.Print(); @@ -919,18 +854,6 @@ int GenfitTrack::addSpacePointsDC(const edm4hep::Track& track, return nHitAdd; }//end of addSpacePointsDC -//double GenfitTrack::extrapolateToPoint(TVector3& pos, TVector3& mom, -// TMatrixDSym& cov, -// const TVector3& point, -// int repID,// same with pidType -// bool stopAtBoundary, -// bool calcJacobianNoise) const -//{ -// return extrapolateToPoint(pos,mom,cov,point,repID,stopAtBoundary, -// calcJacobianNoise); -// -//}//end of extrapolateToPoint - double GenfitTrack::extrapolateToPoint(TVector3& pos, TVector3& mom, TMatrixDSym& cov, const TVector3& point, int repID,// same with pidType @@ -975,7 +898,6 @@ double GenfitTrack::extrapolateToPoint(TVector3& pos, TVector3& mom, "In extrapolateToPoint KalmanFittedStateOnPlane is null"<<std::endl; return trackLength*dd4hep::cm;//FIXME unit } - //rep->setDebugLvl(10); trackLength = rep->extrapolateToPoint(*state, point*(1/dd4hep::cm),stopAtBoundary, calcJacobianNoise); @@ -1142,47 +1064,30 @@ bool GenfitTrack::storeTrack(edm4hep::MutableReconstructedParticle& recParticle, // getNumRawMeasurements unsigned int nPoints = m_track->getNumPoints(); - std::cout << " nPoints = " << nPoints << std::endl; unsigned int nPointsWithMea = m_track->getNumPointsWithMeasurement(); - std::cout << " nPointsWithMea = " << nPointsWithMea << std::endl; std::vector<double> hitMomMag; - //std::cout << __FILE__ << " " << __LINE__ << std::endl; while(1){ genfit::TrackPoint* point = m_track->getPointWithFitterInfo(id); - //std::cout << __FILE__ << " " << __LINE__ << std::endl; if(!point)break; - //std::cout << __FILE__ << " " << __LINE__ << " id = " << id << std::endl; id++; genfit::AbsMeasurement* absMea = point->getRawMeasurement(); - //std::cout << __FILE__ << " " << __LINE__ << " absMea: " << std::endl; - //absMea->Print(); // getPoint FitterInfo genfit::AbsFitterInfo* FitterInfo = point->getFitterInfo(); - //std::cout << __FILE__ << " " << __LINE__ << " FitterInfo: " << std::endl; - //FitterInfo->Print(); genfit::KalmanFitterInfo *KalmanfitterInfo = dynamic_cast<genfit::KalmanFitterInfo*>(FitterInfo); - //std::cout << __FILE__ << " " << __LINE__ << " KalmanfitterInfo: " << std::endl; - //KalmanfitterInfo->Print(); - unsigned int nNumMea = KalmanfitterInfo->getNumMeasurements(); - //std::cout << __FILE__ << " " << __LINE__ << " nNumMea = " << nNumMea << std::endl; bool flag = false; for(int i=0;i<nNumMea;i++) { genfit::MeasurementOnPlane* MeaOnPlane = KalmanfitterInfo->getMeasurementOnPlane(i); - //std::cout << __FILE__ << " " << __LINE__ << " MeaOnPlane: " << std::endl; - //MeaOnPlane->Print(); double weight = MeaOnPlane->getWeight(); - std::cout << __FILE__ << " " << __LINE__ << " weight = " << weight << std::endl; - if(weight>0.8) flag = true; } if(flag) fitid++; @@ -1226,15 +1131,9 @@ bool GenfitTrack::storeTrack(edm4hep::MutableReconstructedParticle& recParticle, } } - std::cout << " id = " << id << std::endl; - std::cout << " fitid = " << fitid << std::endl; - nFittedDC = dcFit; nFittedSDT = SDTHit; - std::cout<<"nDC: "<<nFittedDC<<", nSDT: "<<nFittedSDT<<std::endl; - std::cout<<"nFittedDC: "<<dcFit<<", nFittedSDT: "<<sdtFit<<std::endl; - if(fitid<1e-9) return false; if(m_debug>0)std::cout<<m_name<<" store track ndfCut "<<ndfCut<<" chi2Cut " @@ -1271,8 +1170,6 @@ bool GenfitTrack::storeTrack(edm4hep::MutableReconstructedParticle& recParticle, TVector3 mom; pos.SetXYZ(fittedPos.X(),fittedPos.Y(),fittedPos.Z()); mom.SetXYZ(fittedMom.X(),fittedMom.Y(),fittedMom.Z()); - //std::cout << "fitted momx = " << mom.X() << "momy = " << mom.Y() << "momz = " << mom.Z() << " mom.Mag = " << mom.Mag() << std::endl; - //std::cout << "fitted posx = " << pos.X() << "posy = " << pos.Y() << "posz = " << pos.Z() << std::endl; double radius = 80.022; // cm const TVector3 linePoint(0,0,0); const TVector3 lineDirection(0,0,1); @@ -1283,15 +1180,12 @@ bool GenfitTrack::storeTrack(edm4hep::MutableReconstructedParticle& recParticle, double tracklength = extrapolateToCylinder(pos,mom,radius,linePoint,lineDirection,repID); hitMomMag.push_back(mom.Mag()); - //std::cout << "momx = " << mom.X() << "momy = " << mom.Y() << "momz = " << mom.Z() << " mom.Mag = " << mom.Mag() << std::endl; - //std::cout << "posx = " << pos.X() << "posy = " << pos.Y() << "posz = " << pos.Z() << std::endl; trackL.push_back(tracklength); } for(int j=0;j<hitMomMag.size()-1;j++) { hitMom.push_back(hitMomMag[j]-hitMomMag[j+1]); - //std::cout << " Error Dep = " << hitMomMag[j]-hitMomMag[j+1] << std::endl; } if(m_debug>0)std::cout<<m_name<<" fit result: get status OK? pidType " @@ -1341,11 +1235,8 @@ bool GenfitTrack::storeTrack(edm4hep::MutableReconstructedParticle& recParticle, ///track status at POCA to referencePoint: origin const TVector3 referencePoint(0,0,0); - //TVector3 pocaToOrigin_pos.SetXYZ(1e9*dd4hep::cm,1e9*dd4hep::cm,1e9*dd4hep::cm); - //TVector3 pocaToOrigin_mom.SetXYZ(1e9*dd4hep::GeV,1e9*dd4hep::GeV,1e9*dd4hep::GeV); - //TMatrixDSym pocaToOrigin_cov; if(extrapolateToPoint(pocaToOrigin_pos,pocaToOrigin_mom,pocaToOrigin_cov, referencePoint) > 1e6*dd4hep::cm){ if(m_debug>0)std::cout<<m_name<<" extrapolate to origin failed"<<std::endl; @@ -1369,12 +1260,6 @@ bool GenfitTrack::storeTrack(edm4hep::MutableReconstructedParticle& recParticle, covMatrix_6[i][0]=fittedCov[i][0]/dd4hep::mm;//d0 row covMatrix_6[i][2]=fittedCov[i][1]/dd4hep::mm;//omega row covMatrix_6[i][3]=fittedCov[i][2]/dd4hep::mm;//z0 row - //covMatrix_6[0][i]=fittedCov[0][i]/GenfitUnit::cm*dd4hep::cm;//d0 column - //covMatrix_6[2][i]=fittedCov[2][i]*GenfitUnit::cm/dd4hep::cm;//omega column - //covMatrix_6[3][i]=fittedCov[3][i]/GenfitUnit::cm*dd4hep::cm;//z0 column - //covMatrix_6[i][0]=fittedCov[i][0]/GenfitUnit::cm*dd4hep::cm;//d0 row - //covMatrix_6[i][2]=fittedCov[i][2]*GenfitUnit::cm/dd4hep::cm;//omega row - //covMatrix_6[i][3]=fittedCov[i][3]/GenfitUnit::cm*dd4hep::cm;//z0 row } double Bz=m_genfitField->getBz(referencePoint)/GenfitUnit::tesla; @@ -1403,34 +1288,15 @@ bool GenfitTrack::storeTrack(edm4hep::MutableReconstructedParticle& recParticle, //ngenfitHit = m_genfitHitVec.size(); ngenfitHit = nPoints; - std::cout << " m_genfitHitVec size = " << m_genfitHitVec.size() << std::endl; - // for(long unsigned int i=0; i<m_genfitHitVec.size();i++) - // { - // GenfitHit * genfitHit = GetHit(i); - // edm4hep::TrackerHit* trackHit = - // const_cast<edm4hep::TrackerHit*>(genfitHit->getTrackerHit()); - // - // track.addToTrackerHits(*trackHit); - // } - //track.setType(); + track.setChi2(chi2); track.setNdf(ndf); - //track.setDEdx(); - //track.setRadiusOfInnermostHit();//FIXME - //track.addToTrackerHits(); - - //new ReconstructedParticle - //recParticle->setType(); - //dcRecParticle->setEnergy(); recParticle.setMomentum(edm4hep::Vector3f(pocaToOrigin_mom.X(), pocaToOrigin_mom.Y(),pocaToOrigin_mom.Z())); recParticle.setReferencePoint(edm4hep::Vector3f(referencePoint.X(), referencePoint.Y(),referencePoint.Z())); recParticle.setCharge(charge); - //recParticle->setMass(); - //recParticle.setCovMatrix(trackState->covMatrix); - //recParticle->setStartVertex(); recParticle.addToTracks(track); if(m_debug>2){ std::cout<<m_name<<" storeTrack trackState "<<trackState<<std::endl; @@ -1533,9 +1399,6 @@ void GenfitTrack::getTrackFromEDMTrack(const edm4hep::Track& edm4HepTrack, double charge_double; CEPC::getPosMomFromTrackState(edm4HepTrack.getTrackStates(0),Bz,pos,mom,charge_double,cov); - //std::cout<<__LINE__<<" Bz "<<Bz<<" charge "<<charge_double<<std::endl; - //pos.Print(); - //mom.Print(); charge=(int) charge_double; trackParam[0]=pos[0]*GenfitUnit::mm; trackParam[1]=pos[1]*GenfitUnit::mm; @@ -1555,16 +1418,12 @@ void GenfitTrack::getTrackFromEDMTrack(const edm4hep::Track& edm4HepTrack, void GenfitTrack::getTrackFromEDMTrackFinding(const edm4hep::Track& edm4HepTrack, double& charge, TVectorD& trackParam, TMatrixDSym& cov,TVector3& pos, TVector3& mom){ - //double Bz=m_genfitField->getBz(TVector3{0.,0.,0.})/GenfitUnit::tesla; + // FIXME - //double BZ=GenfitField::getBzFinding(TVector3{0.,0.,0.}); double Bz=3*GenfitUnit::tesla; double charge_double; CEPC::getPosMomFromTrackState(edm4HepTrack.getTrackStates(1),Bz,pos,mom,charge_double,cov); - //std::cout<<__LINE__<<" Bz "<<Bz<<" charge "<<charge_double<<std::endl; - //pos.Print(); - //mom.Print(); charge=(int) charge_double; trackParam[0]=pos[0]*GenfitUnit::mm; trackParam[1]=pos[1]*GenfitUnit::mm; @@ -1637,8 +1496,6 @@ int GenfitTrack::getSigmas(int cellID,std::vector<float> sigmaUVec, } if(m_debug){ std::cout<<"sigmaUID "<<sigmaUID<<" sigmaVID "<<sigmaVID<<std::endl; - //std::cout<<"pos "<<pos_smeared[0]<<" "<<pos_smeared[1]<<" "<<pos_smeared[2]<<std::endl; - //std::cout<<"angle "<<atan2(pos_smeared[1],pos_smeared[0])<<std::endl; std::cout<<"sigmaU "<<sigmaUVec[sigmaUID]*GenfitUnit::mm <<" sigmaV "<<sigmaVVec[sigmaVID]*GenfitUnit::mm<<std::endl; } @@ -1660,8 +1517,6 @@ void GenfitTrack::getSortedTrackerHitsTrF( std::vector<std::pair<double,edm4hep::TrackerHit*> > sortedDCTrackerHitPair; for(auto trackerHit : trackerHits){ - //edm4hep::TrackerHit* thisHit = trackerHit; - //if(!isCDCHit(thisHit))continue;//skip non-DC trackerHit double time=trackerHit->getTime(); if(0==sortMethod){ diff --git a/Reconstruction/RecGenfitAlg/src/GenfitTrack.h b/Reconstruction/RecGenfitAlg/src/GenfitTrack.h index 91fe15b9d4cc6d15368c0bc8502722ebb01be679..58f25014c6184885b9351211aafd187ed8097d7c 100644 --- a/Reconstruction/RecGenfitAlg/src/GenfitTrack.h +++ b/Reconstruction/RecGenfitAlg/src/GenfitTrack.h @@ -164,10 +164,6 @@ class GenfitTrack { /// Output: pos and mom of POCA point to point /// Input: genfitTrack,point,repID,stopAtBoundary and calcAverageState /// repID same with pidType -// double extrapolateToPoint(TVector3& pos, TVector3& mom,TMatrixDSym& cov, -// const TVector3& point, int repID=0, bool stopAtBoundary = false, -// bool calcJacobianNoise = true) const; - double extrapolateToPoint(TVector3& pos, TVector3& mom, TMatrixDSym& cov, const TVector3& point, int repID=0, bool stopAtBoundary = false, bool calcJacobianNoise = true) const; diff --git a/Reconstruction/RecGenfitAlg/src/RecGenfitAlgSDT.cpp b/Reconstruction/RecGenfitAlg/src/RecGenfitAlgSDT.cpp index f3a1255099e3d02649d970b1f8776a95d39c798d..c15dee5e0848a6c4ce4ac367ae185cbaea1483ef 100644 --- a/Reconstruction/RecGenfitAlg/src/RecGenfitAlgSDT.cpp +++ b/Reconstruction/RecGenfitAlg/src/RecGenfitAlgSDT.cpp @@ -365,13 +365,6 @@ StatusCode RecGenfitAlgSDT::execute() std::chrono::time_point<std::chrono::high_resolution_clock> start; if(m_tuple) start=std::chrono::high_resolution_clock::now(); - /////retrieve EventHeader - //auto header = _headerCol.get()->at(0); - //int evtNo = header.getEventNumber(); - //int runNo = header.getRunNumber(); - //info()<<"run "<<header.getEventNumber() - // <<" "<<header.getRunNumber()<<std::endl; - ///retrieve silicon Track and TrackHits const edm4hep::TrackCollection* sdtTrackCol=nullptr; if(m_SDTTrackCol.exist())sdtTrackCol=m_SDTTrackCol.get(); @@ -430,14 +423,7 @@ StatusCode RecGenfitAlgSDT::execute() GenfitTrack* genfitTrack=new GenfitTrack(m_genfitField, m_gridDriftChamber,m_geomSvc); genfitTrack->setDebug(m_debug); - //if(m_useTruthTrack){ - // //single track only FIXME - // if(!genfitTrack->createGenfitTrackFromMCParticle(pidType, - // *(mcParticleCol->begin()), eventStartTime)){ - // debug()<<"createGenfitTrackFromMCParticle failed!"<<endmsg; - // return StatusCode::SUCCESS; - // } - //}else{ + if(!genfitTrack->createGenfitTrackFromEDM4HepTrack(pidType, sdtTrack, eventStartTime,m_isUseCovTrack)){ debug()<<"createGenfitTrackFromEDM4HepTrack from SDT track failed!"<<endmsg; @@ -479,9 +465,6 @@ StatusCode RecGenfitAlgSDT::execute() m_sigmaHitU[0],r_NoiseAssociationCol.get(),m_sortMethod,m_truthAmbig, m_skipCorner,m_skipNear);//mm } else { - //nHitAdded+=genfitTrack->addWireMeasurementsOnTrack(sdtTrack, - // m_sigmaHitU[0],assoDCHitsCol,m_sortMethod,m_truthAmbig, - // m_skipCorner,m_skipNear);//mm nHitAdded+=genfitTrack->addWireMeasurementsOnTrack(sdtTrack, m_sigmaHitU[0],r_SmearAssociationCol.get(),m_sortMethod,m_truthAmbig, m_skipCorner,m_skipNear);//mm @@ -505,12 +488,6 @@ StatusCode RecGenfitAlgSDT::execute() m_genfitFitter->setDebugGenfit(m_debugGenfit); m_genfitFitter->processTrack(genfitTrack,m_resortHits.value()); - ///---------------------------------- - ///Get TrackLength - ///--------------------------------- - //TVector3 pos, TVector3 mom; - //double tracklength = genfitTrack->extrapolateToCylinder(); - ///----------------------------------- ///Store track ///----------------------------------- @@ -566,23 +543,8 @@ StatusCode RecGenfitAlgSDT::execute() debugEvent(sdtTrackCol,sdtRecTrackCol,eventStartTime,nFittedSDT); } - - - //if(m_genfitDisplay) while(1){ - // std::cout<<"Press any key to finish..."<<std::endl; - // //system ("pause"); - //} - - if(m_tuple) sc=m_tuple->write(); - // time(&timep); - // std::cout << "Myliu say: the time is " - // << ctime(&timep) - // << "at the end of RecGenfitAlgSDT::execute()" - // << std::endl; - // system("/scratchfs/bes/myliu/script/memory_rec.sh"); - return StatusCode::SUCCESS; } @@ -612,15 +574,6 @@ void RecGenfitAlgSDT::debugTrack(int iStrack,int pidType,const GenfitTrack* genf TVector3 pocaToOrigin_pos,TVector3 pocaToOrigin_mom, TMatrixDSym pocaToOrigin_cov) { - - // time_t timep; - // time(&timep); - // std::cout << "Myliu say: the time is " - // << ctime(&timep) - // << "at the begin of debugTrack()" - // << std::endl; - // system("/scratchfs/bes/myliu/script/memory_rec.sh"); - /// Get fit status const genfit::FitStatus* fitState = genfitTrack->getFitStatus(); int charge= fitState->getCharge(); @@ -751,28 +704,12 @@ void RecGenfitAlgSDT::debugTrack(int iStrack,int pidType,const GenfitTrack* genf <<" ndf "<<m_nDofKal[iStrack][pidType] <<" chi2 "<<m_chi2Kal[pidType]<<endmsg; } - // time(&timep); - // std::cout << "Myliu say: the time is " - // << ctime(&timep) - // << "at the end of debugTrack()" - // << std::endl; - // system("/scratchfs/bes/myliu/script/memory_rec.sh"); } void RecGenfitAlgSDT::debugEvent(const edm4hep::TrackCollection* sdtTrackCol, const edm4hep::TrackCollection* sdtRecTrackCol, double eventStartTime,int nFittedSDT) { - - // time_t timep; - // time(&timep); - // std::cout << "Myliu say: the time is " - // << ctime(&timep) - // << "at the begin of debugEvent()" - // << std::endl; - // system("/scratchfs/bes/myliu/script/memory_rec.sh"); - - int iSdtTrack=0; m_nSdtTrack=sdtTrackCol->size(); for(auto sdtTrack: *sdtTrackCol){ @@ -883,12 +820,9 @@ void RecGenfitAlgSDT::debugEvent(const edm4hep::TrackCollection* sdtTrackCol, m_nSdtRecTrack=sdtRecTrackCol->size(); int isdttrack=0; for(auto sdtRecTrack: *sdtRecTrackCol){ - std::cout << " sdtRecTrack.trackerHits_size() = " << sdtRecTrack.trackerHits_size() << std::endl; for(int iHit=0;iHit<sdtRecTrack.trackerHits_size();iHit++) { edm4hep::TrackerHit sdtRecTrackHit = sdtRecTrack.getTrackerHits(iHit); - //std::cout << " sdtRecTrackHit eDep = " << sdtRecTrackHit.getEDep() << std::endl; - } for(unsigned int i=0; i<sdtRecTrack.trackStates_size(); i++) { edm4hep::TrackState trackStat=sdtRecTrack.getTrackStates(i); @@ -973,27 +907,11 @@ void RecGenfitAlgSDT::debugEvent(const edm4hep::TrackCollection* sdtTrackCol, iDCDigi++; } - // time(&timep); - // std::cout << "Myliu say: the time is " - // << ctime(&timep) - // << "at the end of debugEvent()" - // << std::endl; - // system("/scratchfs/bes/myliu/script/memory_rec.sh"); } void RecGenfitAlgSDT::selectHits(const edm4hep::Track&, std::vector<edm4hep::TrackerHit*>& dcDigiSelected) { - - // time_t timep; - // time(&timep); - // std::cout << "Myliu say: the time is " - // << ctime(&timep) - // << "at the begin of selectHits()" - // << std::endl; - // system("/scratchfs/bes/myliu/script/memory_rec.sh"); - - //for single track only, FIXME double eventStartTime=0; unsigned int pidType=1;//mu @@ -1014,8 +932,6 @@ void RecGenfitAlgSDT::selectHits(const edm4hep::Track&, double docaExt=1e9; bool stopAtBoundary=false; bool calcJacobianNoise=true; - //for(auto mcParticle : *mcParticleCol){ - //} edm4hep::MCParticle mcParticle=*(mcParticleCol->begin());//FIXME single track only genfitTrack->extrapolateToHit(poca,pocaDir,pocaOnWire,docaExt, @@ -1053,10 +969,4 @@ void RecGenfitAlgSDT::selectHits(const edm4hep::Track&, } }//end loop over track delete genfitTrack; - // time(&timep); - // std::cout << "Myliu say: the time is " - // << ctime(&timep) - // << "at the end of selectHits()" - // << std::endl; - // system("/scratchfs/bes/myliu/script/memory_rec.sh"); }//end of select hit