75 MsgStream log(
msgSvc(), name());
76 log << MSG::INFO <<
"in initialize()" << endreq;
80 StatusCode sc = service(
"NTupleSvc",
ntupleSvc);
81 NTuplePtr mt(
ntupleSvc,
"FILE169/CgemSegmentHelix");
82 if ( mt ) helix_ntuple = mt;
84 helix_ntuple =
ntupleSvc->book(
"FILE169/CgemSegmentHelix", CLID_ColumnWiseTuple,
"SegFit");
87 status = helix_ntuple->addItem(
"run", cgem_run);
88 status = helix_ntuple->addItem(
"evt", cgem_evt);
89 status = helix_ntuple->addItem(
"ntrack",truth_ntrack,0,10);
90 status = helix_ntuple->addIndexedItem(
"truth_dr", truth_ntrack , truth_dr);
91 status = helix_ntuple->addIndexedItem(
"truth_dz", truth_ntrack , truth_dz);
92 status = helix_ntuple->addIndexedItem(
"truth_phi0", truth_ntrack , truth_phi0);
93 status = helix_ntuple->addIndexedItem(
"truth_kappa", truth_ntrack , truth_kappa);
94 status = helix_ntuple->addIndexedItem(
"truth_tanl", truth_ntrack , truth_tanl);
95 status = helix_ntuple->addIndexedItem(
"truth_charge", truth_ntrack , truth_charge);
96 status = helix_ntuple->addIndexedItem(
"truth_CosTheta", truth_ntrack , truth_CosTheta);
97 status = helix_ntuple->addItem(
"nsegment",cgem_nsegment,0,1000);
98 status = helix_ntuple->addIndexedItem(
"segmentid", cgem_nsegment , cgem_segmentid);
99 status = helix_ntuple->addIndexedItem(
"dr_ini", cgem_nsegment , cgem_dr_ini);
100 status = helix_ntuple->addIndexedItem(
"dz_ini", cgem_nsegment , cgem_dz_ini);
101 status = helix_ntuple->addIndexedItem(
"phi0_ini", cgem_nsegment , cgem_phi0_ini);
102 status = helix_ntuple->addIndexedItem(
"kappa_ini", cgem_nsegment , cgem_kappa_ini);
103 status = helix_ntuple->addIndexedItem(
"tanl_ini", cgem_nsegment , cgem_tanl_ini);
104 status = helix_ntuple->addIndexedItem(
"dr", cgem_nsegment , cgem_dr);
105 status = helix_ntuple->addIndexedItem(
"dz", cgem_nsegment , cgem_dz);
106 status = helix_ntuple->addIndexedItem(
"phi0", cgem_nsegment , cgem_phi0);
107 status = helix_ntuple->addIndexedItem(
"kappa", cgem_nsegment , cgem_kappa);
108 status = helix_ntuple->addIndexedItem(
"tanl", cgem_nsegment , cgem_tanl);
109 status = helix_ntuple->addIndexedItem(
"chisq", cgem_nsegment , cgem_chisq);
110 status = helix_ntuple->addIndexedItem(
"fitFlag", cgem_nsegment , cgem_fitFlag);
111 status = helix_ntuple->addIndexedItem(
"charge", cgem_nsegment , cgem_charge);
113 status = helix_ntuple->addItem(
"n_layer",n_layer,0,3);
114 status = helix_ntuple->addIndexedItem(
"n_stripX", n_layer , n_stripX);
115 status = helix_ntuple->addIndexedItem(
"n_stripV", n_layer , n_stripV);
116 status = helix_ntuple->addIndexedItem(
"mc_phi", n_layer , mc_phi);
117 status = helix_ntuple->addIndexedItem(
"mc_v", n_layer , mc_v);
118 status = helix_ntuple->addIndexedItem(
"rec_phi", n_layer , rec_phi);
119 status = helix_ntuple->addIndexedItem(
"rec_v", n_layer , rec_v);
125 wide_delta = 570./2/10000;
126 pitch = (650.-570.)/2/10000;
128 ISvcLocator* svcLocator = Gaudi::svcLocator();
130 StatusCode sc=svcLocator->service(
"CgemGeomSvc", ISvc);
133 for(
int i=0; i<nCgemLayer; i++)
146 sc = service (
"CgemCalibFunSvc", myCgemCalibSvc);
147 if ( sc.isFailure() ){
148 cout<< name() <<
"Could not load MdcCalibFunSvc!" << endl;
152 return StatusCode::SUCCESS;
166 MsgStream log(
msgSvc(), name());
167 log << MSG::INFO <<
"in excute()" << endreq;
169 const double pi = 4.*atan(1);
179 int vec_clusterid[3];
182 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
184 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
185 return StatusCode::FAILURE;
187 cgem_evt = eventHeader->eventNumber();
188 cgem_run = eventHeader->runNumber();
195 SmartDataPtr<RecCgemSegmentCol> recCgemSegmentCol(eventSvc(),
"/Event/Recon/RecCgemSegmentCol");
196 if (!recCgemSegmentCol){
197 log << MSG::WARNING <<
"Could not retrieve Cgem segment list" << endreq;
200 return StatusCode::SUCCESS;
202 RecCgemSegmentCol::iterator itSeg;
215 SmartDataPtr<RecCgemClusterCol> recCgemClusterCol(eventSvc(),
"/Event/Recon/RecCgemClusterCol");
216 if (!recCgemClusterCol){
217 log << MSG::WARNING <<
"Could not retrieve Cgem cluster list" << endreq;
218 return StatusCode::FAILURE;
221 SmartDataPtr<Event::CgemMcHitCol> recCgemMcHitCol(eventSvc(),
"/Event/MC/CgemMcHitCol");
222 if (!recCgemMcHitCol)
224 log << MSG::WARNING <<
"Could not find event" << endreq;
225 return StatusCode::FAILURE;
228 SmartDataPtr<McParticleCol> mcParticleCol(eventSvc(),
"/Event/MC/McParticleCol");
229 if (!mcParticleCol) {
230 log << MSG::ERROR<<
"Could not find McParticle" << endreq;
234 Hep3Vector truth_p;
HepPoint3D truth_position;
double mc_charge(0.);
235 McParticleCol::iterator iter_mc = mcParticleCol->begin();
236 for (;iter_mc != mcParticleCol->end(); ++iter_mc ) {
237 int pdg=(*iter_mc)->particleProperty();
238 if(fabs(pdg)!=13)
continue;
239 if(truth_ntrack >=10)
continue;
240 if(pdg<0)mc_charge = 1.;
242 double truth_x = (*iter_mc)->initialPosition().x();
243 double truth_y = (*iter_mc)->initialPosition().y();
244 double truth_z = (*iter_mc)->initialPosition().z();
246 double truth_px = (*iter_mc)->initialFourMomentum().px();
247 double truth_py = (*iter_mc)->initialFourMomentum().py();
248 double truth_pz = (*iter_mc)->initialFourMomentum().pz();
249 double truth_P = sqrt(truth_px*truth_px+truth_py*truth_py+truth_pz*truth_pz);
250 truth_CosTheta[truth_ntrack] = truth_pz/truth_P;
252 truth_position =
HepPoint3D(truth_x, truth_y, truth_z);
253 truth_p = Hep3Vector(truth_px, truth_py, truth_pz);
257 tmp_helix->
pivot(tmp_pivot);
258 truth_dr[truth_ntrack] = tmp_helix->
dr();
259 truth_dz[truth_ntrack] = tmp_helix->
dz();
260 truth_phi0[truth_ntrack] = tmp_helix->
phi0();
261 truth_kappa[truth_ntrack] = tmp_helix->
kappa();
262 truth_tanl[truth_ntrack] = tmp_helix->
tanl();
263 truth_charge[truth_ntrack] = mc_charge;
265 cout<<
"Track Helix : "<<endl
266 <<
"dr = "<<tmp_helix->
dr()<<
"\tphi0 = "<<tmp_helix->
phi0()<<
"\tkappa = "<<tmp_helix->
kappa()
267 <<
"\ndz = "<<tmp_helix->
dz()<<
"\ttanl = "<<tmp_helix->
tanl()<<
"\tpt = "<<1./tmp_helix->
kappa()<<endl<<endl;
274 bool use_truth_hits =
true;
276 SmartDataPtr<Event::CgemMcHitCol> lv_CgemMcHitCol(eventSvc(),
"/Event/MC/CgemMcHitCol");
277 if (!lv_CgemMcHitCol)
279 log << MSG::WARNING <<
"Could not find event" << endreq;
280 return StatusCode::FAILURE;
282 Event::CgemMcHitCol::iterator iter_truth = lv_CgemMcHitCol->begin();
283 for( ; iter_truth != lv_CgemMcHitCol->end(); ++iter_truth){
284 if(fabs((*iter_truth)->GetPDGCode())!=13)
continue;
285 double tmp_x = ((*iter_truth)->GetPositionXOfPrePoint()+(*iter_truth)->GetPositionXOfPostPoint())/2;
286 double tmp_y = ((*iter_truth)->GetPositionYOfPrePoint()+(*iter_truth)->GetPositionYOfPostPoint())/2;
287 double tmp_z = ((*iter_truth)->GetPositionZOfPrePoint()+(*iter_truth)->GetPositionZOfPostPoint())/2;
288 double tmp_phi = atan2(tmp_y,tmp_x);
289 while(tmp_phi < 0) tmp_phi += 2*
pi;
290 mc_phi[(*iter_truth)->GetLayerID()] = tmp_phi;
292 mc_v[(*iter_truth)->GetLayerID()] = tmp_v;
293 CgemSegmentFun::vec_z[(*iter_truth)->GetLayerID()] = ((*iter_truth)->GetPositionZOfPostPoint()+(*iter_truth)->GetPositionZOfPrePoint())/2./10.;
298 double Ini_d0(0.), Ini_phi0(0.), Ini_kappa(0.), Ini_z0(0.), Ini_tanl(0.);
302 itSeg = recCgemSegmentCol->begin();
304 for(;itSeg != recCgemSegmentCol->end(); ++itSeg){
305 if(cgem_nsegment >= 1000){check_segOver++;
continue;}
306 cgem_segmentid[cgem_nsegment] = (*itSeg)->getsegmentid();
307 vec_clusterid[0] = (*itSeg)->getclusterid_1();
308 vec_clusterid[1] = (*itSeg)->getclusterid_2();
309 vec_clusterid[2] = (*itSeg)->getclusterid_3();
310 int IsTruth = (*itSeg)->getmatch();
314 Double_t arglist[10];
317 m_pMnTrk =
new TMinuit(5);
318 m_pMnTrk -> SetPrintLevel(-1);
320 m_pMnTrk -> SetErrorDef(1.0);
322 m_pMnTrk -> mnparm(0,
"dr" , 0, 0.1 , -10, 10, ierflg);
323 m_pMnTrk -> mnparm(1,
"phi0" , 0, 0.16, 0, 6.3, ierflg);
324 m_pMnTrk -> mnparm(2,
"kappa", 0, 0.4, -100, 100, ierflg);
325 m_pMnTrk -> mnparm(3,
"dz" , 0, 0.5 , -50, 50, ierflg);
326 m_pMnTrk -> mnparm(4,
"tanL" , 0, 0.005 , -10, 10, ierflg);
333 m_pMnTrk -> mnexcm(
"Set NOW", arglist, 0, ierflg);
336 RecCgemClusterCol::iterator itTrk=recCgemClusterCol->begin();
337 for(; itTrk != recCgemClusterCol->end(); ++itTrk){
338 if((*itTrk)->getflag() == 0){
339 n_stripX[(*itTrk)->getlayerid()] = (*itTrk)->getclusterflage()-(*itTrk)->getclusterflagb()+1;
342 if((*itTrk)->getflag() == 1){
343 n_stripV[(*itTrk)->getlayerid()] = (*itTrk)->getclusterflage()-(*itTrk)->getclusterflagb()+1;
346 if((*itTrk)->getflag() != 2)
continue;
347 if(!CheckClusterID((*itTrk)->getlayerid(), (*itTrk)->getclusterid(), vec_clusterid))
continue;
349 double tmp_phi = (*itTrk)->getrecphi();
354 rec_phi[(*itTrk)->getlayerid()] = (*itTrk)->getrecphi();
363 double Ini_d0(0.), Ini_phi0(0.), Ini_kappa(0.), Ini_z0(0.), Ini_tanl(0.);
366 int charge = GetChargeOfTrack();
367 cgem_charge[cgem_nsegment] = charge;
370 double ErrMatrix[5][5] ;
371 double TrkPar[5] = {Ini_d0, Ini_phi0, Ini_kappa, Ini_z0, Ini_tanl};
373 double TrkParErr[5] ;
375 int fit = mnTrkFit(TrkPar, TrkParErr, &ErrMatrix[0][0], chisq);
376 int fitAgain = 0;
double kappa_err;
380 double tmp_recphi[3], tmp_kappa[8];
381 for(
int ii = 0, mm = 0; ii < 2; ii++)
382 for(
int jj = 0; jj < 2; jj++)
383 for(
int kk = 0; kk < 2; kk++, mm++){
387 charge = GetChargeOfTrack(tmp_recphi);
391 double kappa_s = GetMin(tmp_kappa);
392 double kappa_l = GetMax(tmp_kappa);
393 kappa_err = (kappa_s - kappa_l)/2.;
394 double TrkPar[5] = {Ini_d0, Ini_phi0, (kappa_l+kappa_s)/2., Ini_z0, Ini_tanl};
396 fitAgain = mnTrkFit(TrkPar, TrkParErr, &ErrMatrix[0][0], chisq);
410 cgem_fitFlag[cgem_nsegment] = fit;
411 if(fit==1||fitAgain){
413 for (
int ie = 0, k = 0 ; ie < 5 ; ie++){
414 for (
int je = ie ; je < 5 ; je ++, k++) {
415 helixErr[k] = ErrMatrix[ie][je];
421 for (
int ie = 0, k = 0 ; ie < 5 ; ie++){
422 for (
int je = ie ; je < 5 ; je ++, k++) {
423 if(ie==2&&je<2)helixErr[k] = ErrMatrix[ie+2][je];
424 else if(je<2&&ie>2) helixErr[k] = ErrMatrix[ie-1][je];
425 else if(je>2&&ie>2) helixErr[k] = ErrMatrix[ie-1][je-1];
426 else if(je==2) helixErr[k] = 0.;
427 else helixErr[k] = ErrMatrix[ie][je];
429 if(k==9)helixErr[k] = pow(kappa_err,2);
433 TrkParErr[0] = 0.8812/0.0677*TrkParErr[0];
434 TrkParErr[1] = 0.266/0.004*TrkParErr[1];
435 TrkParErr[2] = kappa_err;
436 helixErr[0] = 0.8812/0.0677*helixErr[0];
437 helixErr[5] = 0.266/0.004*helixErr[5];
447 (*itSeg)->sethelix(TrkPar);
448 (*itSeg)->sethelix_err(helixErr);
449 (*itSeg)->setmatch(IsTruth);
450 cgem_dr[cgem_nsegment] = TrkPar[0];
451 cgem_phi0[cgem_nsegment] = TrkPar[1];
452 cgem_kappa[cgem_nsegment] = TrkPar[2];
453 cgem_dz[cgem_nsegment] = TrkPar[3];
454 cgem_tanl[cgem_nsegment] = TrkPar[4];
455 cgem_chisq[cgem_nsegment] = chisq;
457 cout<<
"fit success" << endl
458 <<
"dr = " <<TrkPar[0]<<
" +- "<<TrkParErr[0]<<
"\t\t"
459 <<
"phi0 = "<<TrkPar[1]<<
" +- "<<TrkParErr[1]<<
"\t\t"
460 <<
"kappa= "<<TrkPar[2]<<
" +- "<<TrkParErr[2]<<
"\n"
461 <<
"dz = " <<TrkPar[3]<<
" +- "<<TrkParErr[3]<<
"\t\t"
462 <<
"tanl = "<<TrkPar[4]<<
" +- "<<TrkParErr[4]<<
"\n\n"
463 <<
"kappa_err= "<<TrkParErr[2]<<endl;
464 cout<<
"chisq = "<<chisq<<endl;
470 double fail_helix[5], fail_helix_err[15] ;
471 for(
int i = 0; i <15; i++){
472 if(i<5)fail_helix[i] = -999.;
473 fail_helix_err[i] = -999.;
475 (*itSeg)->sethelix(fail_helix);
476 (*itSeg)->sethelix_err(fail_helix_err);
477 (*itSeg)->setmatch(IsTruth);
478 cgem_dr[cgem_nsegment] = -999.;
479 cgem_phi0[cgem_nsegment] = -999.;
480 cgem_kappa[cgem_nsegment] = -999.;
481 cgem_dz[cgem_nsegment] = -999.;
482 cgem_tanl[cgem_nsegment] = -999.;
483 cgem_chisq[cgem_nsegment] = -999.;
534 helix_ntuple->write();
550 return StatusCode::SUCCESS;
555 MsgStream log(
msgSvc(), name());
556 log << MSG::INFO <<
"in excute()" << endreq;
558 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
560 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
561 return StatusCode::FAILURE;
563 m_run = eventHeader->runNumber();
564 m_evt = eventHeader->eventNumber();
567 SmartDataPtr<RecCgemClusterCol> recCgemClusterCol(eventSvc(),
"/Event/Recon/RecCgemClusterCol");
568 if (!recCgemClusterCol){
569 log << MSG::WARNING <<
"Could not retrieve Cgem cluster list" << endreq;
570 return StatusCode::FAILURE;
572 RecCgemClusterCol::iterator itCluBegin=recCgemClusterCol->begin();
574 SmartDataPtr<RecCgemSegmentCol> recCgemSegmentCol(eventSvc(),
"/Event/Recon/RecCgemSegmentCol");
575 if (!recCgemSegmentCol){
576 log << MSG::WARNING <<
"Could not retrieve Cgem segment list" << endreq;
579 return StatusCode::SUCCESS;
587 RecCgemSegmentCol::iterator itSeg = recCgemSegmentCol->begin();
588 for( ;itSeg != recCgemSegmentCol->end(); ++itSeg)
590 cluId[0] = (*itSeg)->getclusterid_1();
591 cluId[1] = (*itSeg)->getclusterid_2();
592 cluId[2] = (*itSeg)->getclusterid_3();
595 cout<<
"input clusters: "<<endl;
597 double vec_Q[3], vec_T[3];
598 for(
int i=0; i<3; i++)
600 RecCgemClusterCol::iterator itClu = itCluBegin+cluId[i];
603 vec_Q[i]=(*itClu)->getenergydeposit();
607 cout <<
"layer "<<i<<
", cluster id = "<<cluId[i]<<
", itCluId = "<<(*itClu)->getclusterid()
612 int charge = estiChargeOfSeg();
615 double dr_ini, phi0_ini, kappa_ini, dZ_ini, tanL_ini;
617 double dr_ini0 = dr_ini;
618 double phi0_ini0 = phi0_ini;
619 double kappa_ini0 = kappa_ini;
620 double dZ_ini0 = dZ_ini;
621 double tanL_ini0 = tanL_ini;
623 double helix[5] = {dr_ini, phi0_ini, kappa_ini, dZ_ini, tanL_ini};
626 HepVector vec_trkpar(5);
627 for(
int i = 0; i < 5; i++){
628 vec_trkpar[i] = helix[i];
634 int iView(0), mode(2);
635 for(
int i=0; i<3; i++)
639 double phi_pos = pos.phi();
640 Hep3Vector p3 = cgem_helix.
momentum(dphi);
641 double phi_p = p3.phi();
642 double dPhi = phi_p-phi_pos;
643 while(dPhi>CLHEP::pi) dPhi-=CLHEP::twopi;
644 while(dPhi<-CLHEP::pi) dPhi+=CLHEP::twopi;
651 Double_t arglist[10];
654 m_pMnTrk =
new TMinuit(5);
655 m_pMnTrk -> SetPrintLevel(-1);
656 m_pMnTrk -> mnexcm(
"Set NOW", arglist, 1, ierflg);
658 m_pMnTrk -> SetErrorDef(1.0);
660 bool fitSucceed =
false;
661 bool fitUsable =
false;
663 int nFitTried = 0;
int iFitStored = 0;
664 double chi2_min = 999;
665 double chi2_saved = 999;
666 double chi2_fixKapa_min = 990;
667 while((nFitTried<3&&!fitSucceed)||(nFitTried<5&&!fitUsable)) {
668 m_pMnTrk-> mnparm(0,
"dr" , dr_ini, 0.001 , dr_ini-10, dr_ini+10, ierflg);
669 m_pMnTrk-> mnparm(1,
"phi0" , phi0_ini, 0.001, phi0_ini-1.0, phi0_ini+1.0, ierflg);
670 m_pMnTrk-> mnparm(2,
"kappa", kappa_ini, max(fabs(kappa_ini)*0.01,0.01), kappa_ini-5.0, kappa_ini+5.0,ierflg);
671 if(nFitTried>=3) m_pMnTrk->FixParameter(2);
672 m_pMnTrk -> mnparm(3,
"dz" , dZ_ini, 0.01 , dZ_ini-20.0, dZ_ini+20.0, ierflg);
673 m_pMnTrk -> mnparm(4,
"tanL" , tanL_ini, 0.001 , tanL_ini-1.0, tanL_ini+1.0, ierflg);
675 m_pMnTrk -> mnexcm(
"MIGRAD", arglist, 1, ierflg);
677 double trkpar[5], trkparErr[5], emat[25], chisq;
678 Double_t fmin, edm, errdef;
680 m_pMnTrk -> mnstat(fmin, edm, errdef, nvpar, nparx, istat);
681 for(
int i=0; i<5; i++){
682 m_pMnTrk -> GetParameter(i, trkpar[i], trkparErr[i]);
685 m_pMnTrk -> mnemat(emat, 5);
691 cout<<
"Fit ierflg="<<ierflg<<
", istat="<<istat<<endl;
693 cout<<setw(10)<<
" "<<setw(10)<<
"dr"<<setw(10)<<
"phi0"<<setw(10)<<
"kappa"<<setw(10)<<
"dz"<<setw(10)<<
"tanL"<<endl;
694 cout<<setw(10)<<
"MC truth"<<setw(10)<<m_helix_mc[0]<<setw(10)<<m_helix_mc[1]<<setw(10)<<m_helix_mc[2]<<setw(10)<<m_helix_mc[3]<<setw(10)<<m_helix_mc[4]<<endl;
695 cout<<setw(10)<<
"ini"<<setw(10)<<dr_ini<<setw(10)<<phi0_ini<<setw(10)<<kappa_ini<<setw(10)<<dZ_ini<<setw(10)<<tanL_ini<<endl;
697 cout<<setw(10)<<
"fit"<<setw(10)<<trkpar[0]<<setw(10)<<trkpar[1]<<setw(10)<<trkpar[2]<<setw(10)<<trkpar[3]<<setw(10)<<trkpar[4]<<
"chi2="<<chisq<<endl;
698 cout<<setw(10)<<
"fit err"<<setw(10)<<trkparErr[0]<<setw(10)<<trkparErr[1]<<setw(10)<<trkparErr[2]<<setw(10)<<trkparErr[3]<<setw(10)<<trkparErr[4]<<endl;
720 if( (0==ierflg) && (istat==3) ){
726 cout<<
"TMinuit tried "<<nFitTried<<
" times!"<<endl;
731 kappa_ini=trkpar[2]+0.5*pow(-1,nFitTried);
735 if(nFitTried>=3) kappa_ini=0.5*pow(-1,nFitTried);
737 if( (0==ierflg) && (istat>0) ){
738 if(nFitTried<4) fitUsable =
true;
739 if((nFitTried<4&&istat>istat_last)||(nFitTried>3&&chisq<chi2_fixKapa_min)) {
741 chi2_fixKapa_min = chisq;
743 for(
int ii=0; ii<5; ii++)
745 helix[ii]=trkpar[ii];
746 for(
int jj=ii; jj<5; jj++)
748 helixErr[k]=emat[ii*5+jj];
753 iFitStored = nFitTried;
760 cout<<
"Fit results "<<iFitStored<<
" are saved!"<<endl;
762 if(m_checkIdx&&cgem_nsegment<1000) {
763 cgem_segmentid[cgem_nsegment]=(*itSeg)->getsegmentid();
764 cgem_dr_ini[cgem_nsegment]=dr_ini0;
765 cgem_dz_ini[cgem_nsegment]=dZ_ini0;
766 cgem_phi0_ini[cgem_nsegment]=phi0_ini0;
767 cgem_kappa_ini[cgem_nsegment]=kappa_ini0;
768 cgem_tanl_ini[cgem_nsegment]=tanL_ini0;
769 cgem_dr[cgem_nsegment]=helix[0];
770 cgem_dz[cgem_nsegment]=helix[3];
771 cgem_phi0[cgem_nsegment]=helix[1];
772 cgem_kappa[cgem_nsegment]=helix[2];
773 cgem_tanl[cgem_nsegment]=helix[4];
774 cgem_chisq[cgem_nsegment]=chi2_saved;
775 cgem_fitFlag[cgem_nsegment]=iFitStored;
776 cgem_charge[cgem_nsegment]=charge;
781 (*itSeg)->sethelix(helix);
782 (*itSeg)->sethelix_err(helixErr);
788 if(m_checkIdx) helix_ntuple->write();
790 return StatusCode::SUCCESS;