当前位置: 首页>>代码示例>>C++>>正文


C++ TCanvas::AbsPixeltoY方法代码示例

本文整理汇总了C++中TCanvas::AbsPixeltoY方法的典型用法代码示例。如果您正苦于以下问题:C++ TCanvas::AbsPixeltoY方法的具体用法?C++ TCanvas::AbsPixeltoY怎么用?C++ TCanvas::AbsPixeltoY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCanvas的用法示例。


在下文中一共展示了TCanvas::AbsPixeltoY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: run_ana_8He


//.........这里部分代码省略.........
                }

            }// HoughPar Loop




            for (Int_t i=0; i<4; i++) {
                //fQuadrant[i]  = fHoughSpaceLine_buff->GetHoughQuadrant(i); //Obsolete
                quadrant = &protoevent->GetQuadrantArray()->at(i);
                qNumHits.push_back(quadrant->GetNumHits());
                Int_t qNumHit = quadrant->GetNumHits();
                Double_t *rad_graph = new Double_t[qNumHit];
                Double_t *posz_graph = new Double_t[qNumHit];



                Double_t rad_max=0.0;

                for(Int_t j=0; j<qNumHit; j++) {
                    ATHit* qhit = quadrant->GetHit(j);
                    TVector3 position = qhit->GetPosition();
                    //position.SetZ( (qhit->GetTimeStamp()-390)*2.8*80/10.0 );
                    //position.SetZ( (390-qhit->GetTimeStamp())*2.8*80.0/100.0 );
                    Double_t radius = TMath::Sqrt( TMath::Power(position.X(),2) + TMath::Power(position.Y(),2) );
                    if(radius>rad_max) rad_max=radius;
                    fQuadHist[i]->Fill(radius,position.Z(),qhit->GetCharge());
                    rad_graph[j] = radius;
                    posz_graph[j] = position.Z();


                    Int_t pixelY = ctest->YtoAbsPixel(position.Z());
                    Int_t pixelX = ctest->XtoAbsPixel(radius);
                    Int_t pixelYback = ctest->AbsPixeltoY(pixelY);
                    Int_t pixelXback = ctest->AbsPixeltoX(pixelX);

                    Int_t mda = HoughFit[i]->DistancetoPrimitive(-pixelX,pixelY); //Minimum Distance of Approach in Pixels
                    DistHist[i]->Fill(mda);

                    Double_t geo_dist_STD = 0.0;
                    Double_t geo_dist = TMath::Abs (TMath::Cos(HoughPar.at(i).first)*radius  + TMath::Sin(HoughPar.at(i).first)*position.Z()  - HoughPar.at(i).second);
                    if(stdhough)  geo_dist_STD = TMath::Abs (TMath::Cos(HoughParSTD.at(i).first)*radius  + TMath::Sin(HoughParSTD.at(i).first)*position.Z()  - HoughParSTD.at(i).second);

                    // An example to make annotations to each one of the TGraph points
                    /*	TLatex *latex = new TLatex(gr->GetX()[5], gr->GetY()[5],"my annotation");
                    gr->GetListOfFunctions()->Add(latex);
                    gr->Draw("alp");
                    latex->SetTextSize(0.07);
                    latex->SetTextColor(kRed);*/


                    /*if(debug){
                    	    std::cout<<" ___________________________________________________________________________________________________"<<std::endl;
                    		  std::cout<<" Hit : "<<j<<" - Radius : "<<radius<<" - Z pos : "<<position.Z()<<"        -  Distance to Hough Space : "<<mda<<" Geomtrical Distance : "<<geo_dist<<std::endl;
                    			//std::cout<<" Pixel X : "<<pixelX<<" Pixel Y : "<<pixelY<<std::endl;
                    			//std::cout<<" Pixel Back X : "<<pixelXback<<" Pixel Back Y : "<<pixelYback<<std::endl;

                    }*/

                    if(geo_dist<HoughDist) HitPatternFilter[i]->SetPoint(HitPatternFilter[i]->GetN(),radius,position.Z());
                    if(stdhough)
                        if(geo_dist_STD<HoughDist) HitPatternFilterSTD[i]->SetPoint(HitPatternFilterSTD[i]->GetN(),radius,position.Z());

                }//NumHit loop

                Double_t par0=0.0;
开发者ID:ATTPC,项目名称:ATTPCROOTv2,代码行数:67,代码来源:run_ana_8He.C


注:本文中的TCanvas::AbsPixeltoY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。