diff --git a/Tracker/TrackerRecAlgs/TrackerSPFit/src/TrackerSPFit.cxx b/Tracker/TrackerRecAlgs/TrackerSPFit/src/TrackerSPFit.cxx index 98b1c29f1f14f6f217b27d6223f7112e286e2111..6902a70138cdad5f8957f0f7e0886d36e6d8213e 100755 --- a/Tracker/TrackerRecAlgs/TrackerSPFit/src/TrackerSPFit.cxx +++ b/Tracker/TrackerRecAlgs/TrackerSPFit/src/TrackerSPFit.cxx @@ -73,6 +73,38 @@ namespace Tracker , m_chi2(0) , m_edm(0) , m_ndf(0) + , m_preYhistX_s1l1m0(0) + , m_preYhistY_s1l1m0(0) + , m_preXhistX_s1l1m0(0) + , m_preXhistY_s1l1m0(0) + , m_preYhistX_s1l1m1(0) + , m_preYhistY_s1l1m1(0) + , m_preXhistX_s1l1m1(0) + , m_preXhistY_s1l1m1(0) + , m_preYhistX_s1l1m2(0) + , m_preYhistY_s1l1m2(0) + , m_preXhistX_s1l1m2(0) + , m_preXhistY_s1l1m2(0) + , m_preYhistX_s1l1m3(0) + , m_preYhistY_s1l1m3(0) + , m_preXhistX_s1l1m3(0) + , m_preXhistY_s1l1m3(0) + , m_preYhistX_s1l1m4(0) + , m_preYhistY_s1l1m4(0) + , m_preXhistX_s1l1m4(0) + , m_preXhistY_s1l1m4(0) + , m_preYhistX_s1l1m5(0) + , m_preYhistY_s1l1m5(0) + , m_preXhistX_s1l1m5(0) + , m_preXhistY_s1l1m5(0) + , m_preYhistX_s1l1m6(0) + , m_preYhistY_s1l1m6(0) + , m_preXhistX_s1l1m6(0) + , m_preXhistY_s1l1m6(0) + , m_preYhistX_s1l1m7(0) + , m_preYhistY_s1l1m7(0) + , m_preXhistX_s1l1m7(0) + , m_preXhistY_s1l1m7(0) , m_thistSvc("THistSvc", name) { declareProperty("MaxChi2", m_maxchi2=20); @@ -149,7 +181,71 @@ namespace Tracker m_chi2=new TH1D("chi2","chi2",100,0,100); m_edm=new TH1D("edm","edm",100,0,0.01); m_ndf=new TH1D("ndf","ndf",10,0,10); + m_preYhistX_s1l1m0=new TProfile("YvsX_s1l1m0","residual vs x for staion 1 layer 1 module 0",100,-150,150,-0.1,0.1); + m_preXhistX_s1l1m0=new TProfile("XvsX_s1l1m0","residual vs x for staion 1 layer 1 module 0",100,-150,150,-0.1,0.1); + m_preXhistY_s1l1m0=new TProfile("XvsY_s1l1m0","residual vs x for staion 1 layer 1 module 0",100,-150,150,-0.1,0.1); + m_preYhistY_s1l1m0=new TProfile("YvsY_s1l1m0","residual vs x for staion 1 layer 1 module 0",100,-150,150,-0.1,0.1); + m_preYhistX_s1l1m1=new TProfile("YvsX_s1l1m1","residual vs x for staion 1 layer 1 module 1",100,-150,150,-0.1,0.1); + m_preXhistX_s1l1m1=new TProfile("XvsX_s1l1m1","residual vs x for staion 1 layer 1 module 1",100,-150,150,-0.1,0.1); + m_preXhistY_s1l1m1=new TProfile("XvsY_s1l1m1","residual vs x for staion 1 layer 1 module 1",100,-150,150,-0.1,0.1); + m_preYhistY_s1l1m1=new TProfile("YvsY_s1l1m1","residual vs x for staion 1 layer 1 module 1",100,-150,150,-0.1,0.1); + m_preYhistX_s1l1m2=new TProfile("YvsX_s1l1m2","residual vs x for staion 1 layer 1 module 2",100,-150,150,-0.1,0.1); + m_preXhistX_s1l1m2=new TProfile("XvsX_s1l1m2","residual vs x for staion 1 layer 1 module 2",100,-150,150,-0.1,0.1); + m_preXhistY_s1l1m2=new TProfile("XvsY_s1l1m2","residual vs x for staion 1 layer 1 module 2",100,-150,150,-0.1,0.1); + m_preYhistY_s1l1m2=new TProfile("YvsY_s1l1m2","residual vs x for staion 1 layer 1 module 2",100,-150,150,-0.1,0.1); + m_preYhistX_s1l1m3=new TProfile("YvsX_s1l1m3","residual vs x for staion 1 layer 1 module 3",100,-150,150,-0.1,0.1); + m_preXhistX_s1l1m3=new TProfile("XvsX_s1l1m3","residual vs x for staion 1 layer 1 module 3",100,-150,150,-0.1,0.1); + m_preXhistY_s1l1m3=new TProfile("XvsY_s1l1m3","residual vs x for staion 1 layer 1 module 3",100,-150,150,-0.1,0.1); + m_preYhistY_s1l1m3=new TProfile("YvsY_s1l1m3","residual vs x for staion 1 layer 1 module 3",100,-150,150,-0.1,0.1); + m_preYhistX_s1l1m4=new TProfile("YvsX_s1l1m4","residual vs x for staion 1 layer 1 module 4",100,-150,150,-0.1,0.1); + m_preXhistX_s1l1m4=new TProfile("XvsX_s1l1m4","residual vs x for staion 1 layer 1 module 4",100,-150,150,-0.1,0.1); + m_preXhistY_s1l1m4=new TProfile("XvsY_s1l1m4","residual vs x for staion 1 layer 1 module 4",100,-150,150,-0.1,0.1); + m_preYhistY_s1l1m4=new TProfile("YvsY_s1l1m4","residual vs x for staion 1 layer 1 module 4",100,-150,150,-0.1,0.1); + m_preYhistX_s1l1m5=new TProfile("YvsX_s1l1m5","residual vs x for staion 1 layer 1 module 5",100,-150,150,-0.1,0.1); + m_preXhistX_s1l1m5=new TProfile("XvsX_s1l1m5","residual vs x for staion 1 layer 1 module 5",100,-150,150,-0.1,0.1); + m_preXhistY_s1l1m5=new TProfile("XvsY_s1l1m5","residual vs x for staion 1 layer 1 module 5",100,-150,150,-0.1,0.1); + m_preYhistY_s1l1m5=new TProfile("YvsY_s1l1m5","residual vs x for staion 1 layer 1 module 5",100,-150,150,-0.1,0.1); + m_preYhistX_s1l1m6=new TProfile("YvsX_s1l1m6","residual vs x for staion 1 layer 1 module 6",100,-150,150,-0.1,0.1); + m_preXhistX_s1l1m6=new TProfile("XvsX_s1l1m6","residual vs x for staion 1 layer 1 module 6",100,-150,150,-0.1,0.1); + m_preXhistY_s1l1m6=new TProfile("XvsY_s1l1m6","residual vs x for staion 1 layer 1 module 6",100,-150,150,-0.1,0.1); + m_preYhistY_s1l1m6=new TProfile("YvsY_s1l1m6","residual vs x for staion 1 layer 1 module 6",100,-150,150,-0.1,0.1); + m_preYhistX_s1l1m7=new TProfile("YvsX_s1l1m7","residual vs x for staion 1 layer 1 module 7",100,-150,150,-0.1,0.1); + m_preXhistX_s1l1m7=new TProfile("XvsX_s1l1m7","residual vs x for staion 1 layer 1 module 7",100,-150,150,-0.1,0.1); + m_preXhistY_s1l1m7=new TProfile("XvsY_s1l1m7","residual vs x for staion 1 layer 1 module 7",100,-150,150,-0.1,0.1); + m_preYhistY_s1l1m7=new TProfile("YvsY_s1l1m7","residual vs x for staion 1 layer 1 module 7",100,-150,150,-0.1,0.1); CHECK(m_thistSvc->regTree("/TrackerSPFit/spfit",m_tree)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_x_s1l1m0",m_preYhistX_s1l1m0)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_x_s1l1m0",m_preXhistX_s1l1m0)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_y_s1l1m0",m_preXhistY_s1l1m0)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_y_s1l1m0",m_preYhistY_s1l1m0)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_x_s1l1m1",m_preYhistX_s1l1m1)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_x_s1l1m1",m_preXhistX_s1l1m1)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_y_s1l1m1",m_preXhistY_s1l1m1)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_y_s1l1m1",m_preYhistY_s1l1m1)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_x_s1l1m2",m_preYhistX_s1l1m2)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_x_s1l1m2",m_preXhistX_s1l1m2)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_y_s1l1m2",m_preXhistY_s1l1m2)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_y_s1l1m2",m_preYhistY_s1l1m2)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_x_s1l1m3",m_preYhistX_s1l1m3)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_x_s1l1m3",m_preXhistX_s1l1m3)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_y_s1l1m3",m_preXhistY_s1l1m3)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_y_s1l1m3",m_preYhistY_s1l1m3)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_x_s1l1m4",m_preYhistX_s1l1m4)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_x_s1l1m4",m_preXhistX_s1l1m4)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_y_s1l1m4",m_preXhistY_s1l1m4)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_y_s1l1m4",m_preYhistY_s1l1m4)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_x_s1l1m5",m_preYhistX_s1l1m5)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_x_s1l1m5",m_preXhistX_s1l1m5)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_y_s1l1m5",m_preXhistY_s1l1m5)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_y_s1l1m5",m_preYhistY_s1l1m5)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_x_s1l1m6",m_preYhistX_s1l1m6)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_x_s1l1m6",m_preXhistX_s1l1m6)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_y_s1l1m6",m_preXhistY_s1l1m6)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_y_s1l1m6",m_preYhistY_s1l1m6)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_x_s1l1m7",m_preYhistX_s1l1m7)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_x_s1l1m7",m_preXhistX_s1l1m7)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualX_y_s1l1m7",m_preXhistY_s1l1m7)); + CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_residualY_y_s1l1m7",m_preYhistY_s1l1m7)); CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_x",m_hist_x)); CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_y",m_hist_y)); CHECK(m_thistSvc->regHist("/TrackerSPFit/sp/sp_z",m_hist_z)); @@ -220,6 +316,7 @@ namespace Tracker m_tree->Branch("track_p2",&m_track_p2); m_tree->Branch("track_p3",&m_track_p3); if(m_saveallcluster){ + m_tree->Branch("cluster_all_identify",&m_cluster_all_identify); m_tree->Branch("cluster_all_local_x",&m_cluster_all_local_x); m_tree->Branch("cluster_all_local_y",&m_cluster_all_local_y); m_tree->Branch("cluster_global_x",&m_cluster_all_global_x); @@ -234,21 +331,26 @@ namespace Tracker m_tree->Branch("cluster_all_strip",&m_cluster_all_strip); } if(m_saveallsp){ + m_tree->Branch("sp_all_identify0", &m_sp_all_identify0); + m_tree->Branch("sp_all_identify1", &m_sp_all_identify1); + m_tree->Branch("sp_all_x_local", &m_sp_all_x_local); + m_tree->Branch("sp_all_y_local", &m_sp_all_y_local); m_tree->Branch("sp_all_x", &m_sp_all_x); m_tree->Branch("sp_all_y", &m_sp_all_y); m_tree->Branch("sp_all_z", &m_sp_all_z); m_tree->Branch("sp_all_station", &m_sp_all_station); m_tree->Branch("sp_all_layer", &m_sp_all_layer); m_tree->Branch("sp_all_module", &m_sp_all_module); -// if(m_saveallcluster){ -// m_tree->Branch("sp_all_clus1_index", &m_sp_all_clus1_index); -// m_tree->Branch("sp_all_clus2_index", &m_sp_all_clus2_index); -// } + // if(m_saveallcluster){ + // m_tree->Branch("sp_all_clus1_index", &m_sp_all_clus1_index); + // m_tree->Branch("sp_all_clus2_index", &m_sp_all_clus2_index); + // } } } //------------------------------------------------------------------------- void TrackerSPFit::clearVariables() const { if(m_saveallcluster){ + m_cluster_all_identify.clear(); m_cluster_all_local_x.clear(); m_cluster_all_local_y.clear(); m_cluster_all_global_x.clear(); @@ -263,13 +365,17 @@ namespace Tracker m_cluster_all_strip.clear(); } if(m_saveallsp){ + m_sp_all_identify0.clear(); + m_sp_all_identify1.clear(); + m_sp_all_x_local.clear(); + m_sp_all_y_local.clear(); m_sp_all_x.clear(); m_sp_all_y.clear(); m_sp_all_z.clear(); -// if(m_saveallcluster){ -// m_sp_all_clus1_index.clear(); -// m_sp_all_clus2_index.clear(); -// } + // if(m_saveallcluster){ + // m_sp_all_clus1_index.clear(); + // m_sp_all_clus2_index.clear(); + // } m_sp_all_station.clear(); m_sp_all_layer.clear(); m_sp_all_module.clear(); @@ -337,23 +443,24 @@ namespace Tracker ++m_numberOfCluster; const Tracker::FaserSCT_Cluster* clus=&(**clusters); m_cluster_all_global_x.push_back(clus->globalPosition().x()); - m_cluster_all_global_y.push_back(clus->globalPosition().y()); - m_cluster_all_global_z.push_back(clus->globalPosition().z()); - m_cluster_all_local_x.push_back(clus->localPosition().x()); - m_cluster_all_local_y.push_back(clus->localPosition().y()); - m_cluster_all_phiwidth.push_back(clus->width().phiR()); - Identifier elementID = clus->identify(); - m_cluster_all_station.push_back( m_idHelper->station(elementID)); - m_cluster_all_layer.push_back( m_idHelper->layer(elementID)); - int ietamodule = m_idHelper->eta_module(elementID); - int iphimodule = m_idHelper->phi_module(elementID); - if(ietamodule<0)iphimodule+=4; - m_cluster_all_module.push_back(iphimodule); - m_cluster_all_side.push_back(m_idHelper->side(elementID)); - m_cluster_all_strip.push_back(m_idHelper->strip(elementID)); - m_cluster_all_size.push_back(clus->rdoList().size()); - } - } + m_cluster_all_global_y.push_back(clus->globalPosition().y()); + m_cluster_all_global_z.push_back(clus->globalPosition().z()); + m_cluster_all_local_x.push_back(clus->localPosition().x()); + m_cluster_all_local_y.push_back(clus->localPosition().y()); + m_cluster_all_phiwidth.push_back(clus->width().phiR()); + Identifier elementID = clus->identify(); + m_cluster_all_station.push_back( m_idHelper->station(elementID)); + m_cluster_all_identify.push_back( elementID.get_compact()); + m_cluster_all_layer.push_back( m_idHelper->layer(elementID)); + int ietamodule = m_idHelper->eta_module(elementID); + int iphimodule = m_idHelper->phi_module(elementID); + if(ietamodule<0)iphimodule+=4; + m_cluster_all_module.push_back(iphimodule); + m_cluster_all_side.push_back(m_idHelper->side(elementID)); + m_cluster_all_strip.push_back(m_idHelper->strip(elementID)); + m_cluster_all_size.push_back(clus->rdoList().size()); + } + } } @@ -380,23 +487,28 @@ namespace Tracker for (; sp_begin != sp_end; ++sp_begin){ ++m_numberOfSP; const Tracker::FaserSCT_SpacePoint* sp=&(**sp_begin); + m_sp_all_x_local.push_back(sp->localParameters().x()); + m_sp_all_y_local.push_back(sp->localParameters().y()); m_sp_all_x.push_back(sp->globalPosition().x()); m_sp_all_y.push_back(sp->globalPosition().y()); m_sp_all_z.push_back(sp->globalPosition().z()); m_sp_all_station.push_back(m_idHelper->station(elementID)); m_sp_all_layer.push_back(m_idHelper->layer(elementID)); + m_sp_all_identify0.push_back(sp->clusterList().first->identify().get_compact()); + m_sp_all_identify1.push_back(sp->clusterList().second->identify().get_compact()); int ietamodule = m_idHelper->eta_module(elementID); int iphimodule = m_idHelper->phi_module(elementID); if(ietamodule<0)iphimodule+=4; m_sp_all_module.push_back(iphimodule); + ATH_MSG_DEBUG( "SCT spacepoint found: " << sp->globalPosition().x()<<" , "<<sp->globalPosition().y()<<" , "<<sp->globalPosition().z()<<" , "<<m_idHelper->station(elementID)<<" , "<<m_idHelper->layer(elementID)<<" , "<<m_idHelper->eta_module(elementID)<<" , "<<m_idHelper->phi_module(elementID) ); /* to be updated - if(m_saveallcluster){ - const Tracker::FaserSCT_ClusterCollection *ptr1 = sct_clcontainer->indexFindPtr(sp->elemIDList().first()); - const Tracker::FaserSCT_ClusterCollection *ptr2 = sct_clcontainer->indexFindPtr(sp->elemIDList().second()); - m_sp_all_clus1_index.push_back(findClusterIndex(sp,ptr1)); - m_sp_all_clus2_index.push_back(findClusterIndex(sp,ptr2)); - } - */ + if(m_saveallcluster){ + const Tracker::FaserSCT_ClusterCollection *ptr1 = sct_clcontainer->indexFindPtr(sp->elemIDList().first()); + const Tracker::FaserSCT_ClusterCollection *ptr2 = sct_clcontainer->indexFindPtr(sp->elemIDList().second()); + m_sp_all_clus1_index.push_back(findClusterIndex(sp,ptr1)); + m_sp_all_clus2_index.push_back(findClusterIndex(sp,ptr2)); + } + */ } } } @@ -444,11 +556,12 @@ namespace Tracker m_hist_eta->Fill(sp->eta()); m_hist_phi->Fill(sp->phi()); Amg::Vector3D gloPos=sp->globalPosition(); + Amg::Vector3D newgloPos; m_hist_x->Fill(gloPos.x()); m_hist_y->Fill(gloPos.y()); m_hist_z->Fill(gloPos.z()); struct SP_Seed tmp{gloPos,sp->globCovariance(),ilayer,imodule}; - ATH_MSG_DEBUG( "TrackerSPFit algorithm found no space points" ); + ATH_MSG_DEBUG( "TrackerSPFit algorithm found no space points" ); if(istation==1) sp_sta0.push_back(tmp); else if(istation==2) @@ -477,6 +590,7 @@ namespace Tracker ATH_MSG_INFO( "TrackerSPFit found "<<tracks_sta0.size()<<" track segments in station 0 " ); if(tracks_sta0.size()>0){ ifTrack=true; + ATH_MSG_DEBUG( "TrackerSPFit fill the track info0 " ); for(auto track:tracks_sta0){ auto pre=track.predicted; auto pos=track.pos; @@ -495,9 +609,11 @@ namespace Tracker m_sp_track_y_residual.push_back(pre.y()-pos.y()); m_sp_track_z_residual.push_back(pre.z()-pos.z()); ATH_MSG_DEBUG(" fill the result "<<pre.x()<<" "<<pre.y()<<" "<<pre.z()<<" "<<pos.x()<<" "<<pos.y()<<" "<<pos.z()); + ATH_MSG_DEBUG(" Station/layer/module =1"<<"/"<<track.layer<<"/"<<track.module<<" , and track ID "<<m_numberOfTrack/3); m_sp_track_station.push_back(0); m_sp_track_layer.push_back(track.layer); m_sp_track_module.push_back(track.module); + if(m_bias){ m_track_chi2.push_back(track.chi2); m_track_edm.push_back(track.edm); @@ -510,6 +626,59 @@ namespace Tracker if(track.layer==0){ m_residual_x_plane0->Fill(pre.x()-pos.x());m_residual_y_plane0->Fill(pre.y()-pos.y());} if(track.layer==1){ m_residual_x_plane1->Fill(pre.x()-pos.x());m_residual_y_plane1->Fill(pre.y()-pos.y());} if(track.layer==2){ m_residual_x_plane2->Fill(pre.x()-pos.x());m_residual_y_plane2->Fill(pre.y()-pos.y());} + if(track.layer==1){ + ATH_MSG_DEBUG(" only fill the layer 1, module = "<<track.module); + ATH_MSG_DEBUG(" measured = "<<pos.x()<<" , "<<pos.y()<<" , "<<pos.z()); + ATH_MSG_DEBUG(" predicted = "<<pre.x()<<" , "<<pre.y()<<" , "<<pre.z()); + if(track.module==0){ + m_preYhistX_s1l1m0->Fill(pos.x(),pos.y()-pre.y()); + m_preYhistY_s1l1m0->Fill(pos.y(),pos.y()-pre.y()); + m_preXhistX_s1l1m0->Fill(pos.x(),pos.x()-pre.x()); + m_preXhistY_s1l1m0->Fill(pos.y(),pos.x()-pre.x()); + } + if(track.module==1){ + m_preYhistX_s1l1m1->Fill(pos.x(),pos.y()-pre.y()); + m_preYhistY_s1l1m1->Fill(pos.y(),pos.y()-pre.y()); + m_preXhistX_s1l1m1->Fill(pos.x(),pos.x()-pre.x()); + m_preXhistY_s1l1m1->Fill(pos.y(),pos.x()-pre.x()); + } + if(track.module==2){ + m_preYhistX_s1l1m2->Fill(pos.x(),pos.y()-pre.y()); + m_preYhistY_s1l1m2->Fill(pos.y(),pos.y()-pre.y()); + m_preXhistX_s1l1m2->Fill(pos.x(),pos.x()-pre.x()); + m_preXhistY_s1l1m2->Fill(pos.y(),pos.x()-pre.x()); + } + if(track.module==3){ + m_preYhistX_s1l1m3->Fill(pos.x(),pos.y()-pre.y()); + m_preYhistY_s1l1m3->Fill(pos.y(),pos.y()-pre.y()); + m_preXhistX_s1l1m3->Fill(pos.x(),pos.x()-pre.x()); + m_preXhistY_s1l1m3->Fill(pos.y(),pos.x()-pre.x()); + } + if(track.module==4){ + m_preYhistX_s1l1m4->Fill(pos.x(),pos.y()-pre.y()); + m_preYhistY_s1l1m4->Fill(pos.y(),pos.y()-pre.y()); + m_preXhistX_s1l1m4->Fill(pos.x(),pos.x()-pre.x()); + m_preXhistY_s1l1m4->Fill(pos.y(),pos.x()-pre.x()); + } + if(track.module==5){ + m_preYhistX_s1l1m5->Fill(pos.x(),pos.y()-pre.y()); + m_preYhistY_s1l1m5->Fill(pos.y(),pos.y()-pre.y()); + m_preXhistX_s1l1m5->Fill(pos.x(),pos.x()-pre.x()); + m_preXhistY_s1l1m5->Fill(pos.y(),pos.x()-pre.x()); + } + if(track.module==6){ + m_preYhistX_s1l1m6->Fill(pos.x(),pos.y()-pre.y()); + m_preYhistY_s1l1m6->Fill(pos.y(),pos.y()-pre.y()); + m_preXhistX_s1l1m6->Fill(pos.x(),pos.x()-pre.x()); + m_preXhistY_s1l1m6->Fill(pos.y(),pos.x()-pre.x()); + } + if(track.module==7){ + m_preYhistX_s1l1m7->Fill(pos.x(),pos.y()-pre.y()); + m_preYhistY_s1l1m7->Fill(pos.y(),pos.y()-pre.y()); + m_preXhistX_s1l1m7->Fill(pos.x(),pos.x()-pre.x()); + m_preXhistY_s1l1m7->Fill(pos.y(),pos.x()-pre.x()); + } + } } } } @@ -610,6 +779,26 @@ namespace Tracker ATH_MSG_INFO( m_numberOfCluster<< " sct Cluster processed" ); ATH_MSG_INFO( m_numberOfSPCol<< " sct SP collections processed" ); ATH_MSG_INFO( m_numberOfSP<< " sct SP processed" ); + + + //do a fitting + TF1* fpol1=new TF1("fpol1","pol1(0)"); + m_preYhistX_s1l1m0->Fit(fpol1); + ATH_MSG_INFO("Fitting the residualY vs X for module 0 : parameter = "<<fpol1->GetParameter(0)<<" "<<fpol1->GetParameter(1)); + m_preYhistX_s1l1m1->Fit(fpol1); + ATH_MSG_INFO("Fitting the residualY vs X for module 1 : parameter = "<<fpol1->GetParameter(0)<<" "<<fpol1->GetParameter(1)); + m_preYhistX_s1l1m2->Fit(fpol1); + ATH_MSG_INFO("Fitting the residualY vs X for module 2 : parameter = "<<fpol1->GetParameter(0)<<" "<<fpol1->GetParameter(1)); + m_preYhistX_s1l1m3->Fit(fpol1); + ATH_MSG_INFO("Fitting the residualY vs X for module 3 : parameter = "<<fpol1->GetParameter(0)<<" "<<fpol1->GetParameter(1)); + m_preYhistX_s1l1m4->Fit(fpol1); + ATH_MSG_INFO("Fitting the residualY vs X for module 4 : parameter = "<<fpol1->GetParameter(0)<<" "<<fpol1->GetParameter(1)); + m_preYhistX_s1l1m5->Fit(fpol1); + ATH_MSG_INFO("Fitting the residualY vs X for module 5 : parameter = "<<fpol1->GetParameter(0)<<" "<<fpol1->GetParameter(1)); + m_preYhistX_s1l1m6->Fit(fpol1); + ATH_MSG_INFO("Fitting the residualY vs X for module 6 : parameter = "<<fpol1->GetParameter(0)<<" "<<fpol1->GetParameter(1)); + m_preYhistX_s1l1m7->Fit(fpol1); + ATH_MSG_INFO("Fitting the residualY vs X for module 7 : parameter = "<<fpol1->GetParameter(0)<<" "<<fpol1->GetParameter(1)); return StatusCode::SUCCESS; } @@ -630,15 +819,17 @@ namespace Tracker for(unsigned int i0=0;i0<layer0.size();i0++){ for(unsigned int i1=0;i1<layer1.size();i1++){ for(unsigned int i2=0;i2<layer2.size();i2++){ - if(m_bias){ - //for biased residual - auto tmp=makeTrackSeg(layer0[i0],layer1[i1],layer2[i2],maxchi2); - tracks.insert(tracks.end(),tmp.begin(),tmp.end()); - } - else{ - //for un-biased residual - auto tmp=makeTrackSeg(layer0[i0],layer1[i1],layer2[i2]); - tracks.insert(tracks.end(),tmp.begin(),tmp.end()); + auto tmp_bias=makeTrackSeg(layer0[i0],layer1[i1],layer2[i2],maxchi2); + if(tmp_bias.size()>0){ + if(m_bias){ + //for biased residual + tracks.insert(tracks.end(),tmp_bias.begin(),tmp_bias.end()); + } + else{ + //for un-biased residual + auto tmp=makeTrackSeg(layer0[i0],layer1[i1],layer2[i2]); + tracks.insert(tracks.end(),tmp.begin(),tmp.end()); + } } } } @@ -716,7 +907,7 @@ namespace Tracker m_ndf->Fill(ndf); if(chi2<maxchi2){ -// result.Print(std::cout); + // result.Print(std::cout); const double *fitParam=result.GetParams(); ATH_MSG_DEBUG(" fit status: ook "<<chi2<<" "<<edm<<" "<<ndf<<" "<<fitParam[0]<<" "<<fitParam[1]<<" "<<fitParam[2]<<" "<<fitParam[3]); Amg::Vector3D err0(sqrt((sp0.cov)(0,0)),sqrt((sp0.cov)(1,1)),sqrt((sp0.cov)(2,2))); @@ -738,20 +929,21 @@ namespace Tracker return Amg::Vector3D(p[0]+p[1]*z,p[2]+p[3]*z,z); } + /* * need to be updated - int TrackerSPFit::findClusterIndex(const Tracker::FaserSCT_SpacePoint* sp, const Tracker::FaserSCT_ClusterCollection* ptr)const { - if (ptr!=nullptr) { - //loop though collection to find matching PRD. - Tracker::FaserSCT_ClusterCollection::const_iterator collIt = ptr->begin(); - Tracker::FaserSCT_ClusterCollection::const_iterator collItEnd = ptr->end(); - for ( ; collIt!=collItEnd; collIt++) { - if ( (*collIt)->identify()==id1 ) - clus1= &(**collIt); - } - } + int TrackerSPFit::findClusterIndex(const Tracker::FaserSCT_SpacePoint* sp, const Tracker::FaserSCT_ClusterCollection* ptr)const { + if (ptr!=nullptr) { +//loop though collection to find matching PRD. +Tracker::FaserSCT_ClusterCollection::const_iterator collIt = ptr->begin(); +Tracker::FaserSCT_ClusterCollection::const_iterator collItEnd = ptr->end(); +for ( ; collIt!=collItEnd; collIt++) { +if ( (*collIt)->identify()==id1 ) +clus1= &(**collIt); +} +} - } - */ +} +*/ } diff --git a/Tracker/TrackerRecAlgs/TrackerSPFit/src/TrackerSPFit.h b/Tracker/TrackerRecAlgs/TrackerSPFit/src/TrackerSPFit.h index ae76af9941ae8b6b6480699108d0ebf48b1125b7..3db42689651f647cb465eb6f671346780ec96940 100755 --- a/Tracker/TrackerRecAlgs/TrackerSPFit/src/TrackerSPFit.h +++ b/Tracker/TrackerRecAlgs/TrackerSPFit/src/TrackerSPFit.h @@ -27,6 +27,7 @@ #include <vector> #include "TH1.h" #include "TH2.h" +#include "TF1.h" #include "TTree.h" #include "TGraph2DErrors.h" #include "TMath.h" @@ -161,6 +162,39 @@ namespace Tracker TH1* m_edm; TH1* m_ndf; ServiceHandle<ITHistSvc> m_thistSvc; + //for alignment constants + TProfile* m_preYhistX_s1l1m0; + TProfile* m_preYhistY_s1l1m0; + TProfile* m_preXhistX_s1l1m0; + TProfile* m_preXhistY_s1l1m0; + TProfile* m_preYhistX_s1l1m1; + TProfile* m_preYhistY_s1l1m1; + TProfile* m_preXhistX_s1l1m1; + TProfile* m_preXhistY_s1l1m1; + TProfile* m_preYhistX_s1l1m2; + TProfile* m_preYhistY_s1l1m2; + TProfile* m_preXhistX_s1l1m2; + TProfile* m_preXhistY_s1l1m2; + TProfile* m_preYhistX_s1l1m3; + TProfile* m_preYhistY_s1l1m3; + TProfile* m_preXhistX_s1l1m3; + TProfile* m_preXhistY_s1l1m3; + TProfile* m_preYhistX_s1l1m4; + TProfile* m_preYhistY_s1l1m4; + TProfile* m_preXhistX_s1l1m4; + TProfile* m_preXhistY_s1l1m4; + TProfile* m_preYhistX_s1l1m5; + TProfile* m_preYhistY_s1l1m5; + TProfile* m_preXhistX_s1l1m5; + TProfile* m_preXhistY_s1l1m5; + TProfile* m_preYhistX_s1l1m6; + TProfile* m_preYhistY_s1l1m6; + TProfile* m_preXhistX_s1l1m6; + TProfile* m_preXhistY_s1l1m6; + TProfile* m_preYhistX_s1l1m7; + TProfile* m_preYhistY_s1l1m7; + TProfile* m_preXhistX_s1l1m7; + TProfile* m_preXhistY_s1l1m7; mutable int m_eventNumber; mutable std::vector<double> m_sp_track_x; @@ -195,6 +229,7 @@ namespace Tracker mutable std::vector<double> m_cluster_all_local_x; mutable std::vector<double> m_cluster_all_local_y; mutable std::vector<double> m_cluster_all_phiwidth; + mutable std::vector<long long int> m_cluster_all_identify; mutable std::vector<int> m_cluster_all_size; mutable std::vector<int> m_cluster_all_station; mutable std::vector<int> m_cluster_all_layer; @@ -202,12 +237,16 @@ namespace Tracker mutable std::vector<int> m_cluster_all_side; mutable std::vector<int> m_cluster_all_strip; bool m_saveallsp; + mutable std::vector<double> m_sp_all_x_local; + mutable std::vector<double> m_sp_all_y_local; mutable std::vector<double> m_sp_all_x; mutable std::vector<double> m_sp_all_y; mutable std::vector<double> m_sp_all_z; mutable std::vector<int> m_sp_all_station; mutable std::vector<int> m_sp_all_layer; mutable std::vector<int> m_sp_all_module; + mutable std::vector<long long int> m_sp_all_identify0; + mutable std::vector<long long int> m_sp_all_identify1; };