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


C++ TVector2::X方法代码示例

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


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

示例1: testPadDimensions

void testPadDimensions(AliMq::Station12Type station, AliMp::PlaneType plane)
{
  AliMpDataProcessor mp;
  AliMpDataMap* dataMap = mp.CreateDataMap("data");
  AliMpDataStreams dataStreams(dataMap);

  AliMpSectorReader r(dataStreams, station, plane);
  AliMpSector* sector = r.BuildSector();
  AliMpSectorSegmentation segmentation(sector);  
  segmentation.PrintZones(); 
  
  TVector2 previousDimensions;
  for (Int_t i=1; i<segmentation.MaxPadIndexX()+1;i++) 
    for (Int_t j=1;j<segmentation.MaxPadIndexY()+1;++j) {

       if ( segmentation.HasPadByIndices(i,j) ) {

        // Check pad dimensions
	AliMpPad pad = segmentation.PadByIndices(i,j);
	TVector2 dimensions = segmentation.PadDimensions(segmentation.Zone(pad));
	
	if ( dimensions.X() != previousDimensions.X() || 
	     dimensions.Y() != previousDimensions.Y() ) {

          // Print dimensions
	  cout << "Pad: " << "(" << i << "," << j << ")";
	  cout << "  dimensions: (" << dimensions.X() << ", " << dimensions.Y() << ")" 
	       << endl;
          
	  previousDimensions = dimensions;
        }	     
     }
   }
}
开发者ID:ktf,项目名称:AliRoot,代码行数:34,代码来源:testSt12PadDimensions.C

示例2: getCeF3Position

void getCeF3Position( std::vector<float> cef3, float& xPos, float& yPos ) {

  xPos=0.;
  yPos=0.;

  float r02 = cef3[0]/cef3[2];
  float r13 = cef3[1]/cef3[3];

  TF1* f1_d02 = getCef3Function("diag02");
  TF1* f1_d13 = getCef3Function("diag13");

  float diag02 = f1_d02->GetX(r02, -50., 50.);
  float diag13 = f1_d13->GetX(r13, -50., 50.);

  TVector2 v( diag13, diag02 );
  float pi = 3.14159;
  float theta = pi/4.; // 45 degrees 
  TVector2 d = v.Rotate(+theta);

  xPos = d.X();
  yPos = d.Y();
  //xPos = diag02;
  //yPos = diag13;


  delete f1_d02;
  delete f1_d13;

}
开发者ID:clarajorda,项目名称:BTFAnalysis,代码行数:29,代码来源:positionAnalysis.cpp

示例3: Discretize

TVector2 HashTable::Discretize(TVector2 position) {
  position /= _NG_H_;
  position.Set(
    floor(position.X()),
    floor(position.Y())
  );
  return position;
}
开发者ID:carbolymer,项目名称:SPH,代码行数:8,代码来源:HashTable.cpp

示例4: X

matrixstack::Vector::Vector(const TVector2 &v): TVectorT<double>(2)
{
    X() = v.X();
    Y() = v.Y();
}
开发者ID:A2-Collaboration-dev,项目名称:a2display,代码行数:5,代码来源:matrixstack.cpp

示例5: GetHash

unsigned int HashTable::GetHash(TVector2 position) {
  unsigned long int x = (unsigned long int) position.X();
  unsigned long int y = (unsigned long int) position.Y();
  return ((x*_HT_P1_)^(y*_HT_P2_))%_HT_NH_;
}
开发者ID:carbolymer,项目名称:SPH,代码行数:5,代码来源:HashTable.cpp

示例6:

inline TVector3 Pi_versor_reco_from_2hits(double deltaz, TVector2 hit1, TVector2 hit2)
{
    double px = (hit2.X() - hit1.X())/deltaz;
    double py = (hit2.Y() - hit1.Y())/deltaz;
    return TVector3(px, py, 1);
}
开发者ID:12345ieee,项目名称:spectrometer,代码行数:6,代码来源:analysis.cpp

示例7:

HHKinFit2::HHFitObjectMET::HHFitObjectMET(TVector2 const& v,TVector2 const& vfit)
  :HHFitObject(HHLorentzVector(v.X(),v.Y(),0,sqrt(v.X()*v.X()+v.Y()*v.Y()))){
  this->setFit4Vector(HHLorentzVector(vfit.X(),vfit.Y(),0,sqrt(vfit.X()*vfit.X()+vfit.Y()*vfit.Y())));
}
开发者ID:thomas-mueller,项目名称:HHKinFit2,代码行数:4,代码来源:HHFitObjectMET.cpp

示例8: main

int main( int argc, char* argv[] ) {


  std::string runName = "precalib_BGO_pedestal_noSource";
  if( argc>1 ) {
    std::string runName_str(argv[1]);
    runName = runName_str;
  }

  std::string tag = "V00";
  if( argc>2 ) {
    std::string tag_str(argv[2]);
    tag = tag_str;
  }

  TString runName_tstr(runName);
  bool isOnlyRunNumber = !(runName_tstr.BeginsWith("BTF_"));


  TChain* tree = new TChain("recoTree");
  if( isOnlyRunNumber ) {
    std::cout << "-> We believe you are passing the program only the run number!" << std::endl;
    std::cout << "-> So for instance you are passing '246' for run 'BTF_246_20140501-212512_beam'" << std::endl;
    std::cout << "(if this is not the case this means TROUBLE)" << std::endl;
    std::cout << "-> Will look for runs matching run number: " << runName << std::endl;
    tree->Add(Form("analysisTrees_%s/Reco_BTF_%s_*beam.root/recoTree", tag.c_str(), runName.c_str()) );
    if( tree->GetEntries()==0 ) {
      std::cout << "WARNING! Didn't find any events matching run: " << runName << std::endl;
      std::cout << "Exiting" << std::endl;
      exit(1913);
    }
  } else {
    std::string fileName = "analysisTrees_"+tag+"/Reco_" + runName + ".root";
    TFile* file = TFile::Open(fileName.c_str());
    if( file==0 ) {
      std::cout << "ERROR! Din't find file " << fileName << std::endl;
      std::cout << "Exiting." << std::endl;
      exit(11);
    }
    tree = (TChain*)file->Get("recoTree");
  }





  UInt_t evtNumber;
  tree->SetBranchAddress( "evtNumber", &evtNumber );
  UInt_t adcData[40];
  tree->SetBranchAddress( "adcData", adcData );
  UInt_t adcBoard[40];
  tree->SetBranchAddress( "adcBoard", adcBoard );
  UInt_t adcChannel[40];
  tree->SetBranchAddress( "adcChannel", adcChannel );


  unsigned int runNumber;
  int nHodoFibersX;
  int nHodoFibersY;
  int nHodoClustersX;
  int nHodoClustersY;
  float cef3_corr[CEF3_CHANNELS];
  float bgo_corr[BGO_CHANNELS];
  float scintFront;
  float pos_hodoClustX[HODOX_CHANNELS];
  float pos_hodoClustY[HODOY_CHANNELS];
  int nFibres_hodoClustX[HODOX_CHANNELS];
  int nFibres_hodoClustY[HODOY_CHANNELS];
  float xBeam, yBeam;
  bool isSingleEle_scintFront;
  bool cef3_ok;
  bool cef3_corr_ok;
  bool bgo_ok;
  bool bgo_corr_ok;

  tree->SetBranchAddress( "runNumber", &runNumber );

  tree->SetBranchAddress( "scintFront", &scintFront );
  tree->SetBranchAddress( "cef3_corr", cef3_corr );
  tree->SetBranchAddress( "bgo_corr", bgo_corr );

  tree->SetBranchAddress( "nHodoFibersX", &nHodoFibersX );
  tree->SetBranchAddress( "nHodoFibersY", &nHodoFibersY );
  tree->SetBranchAddress( "nHodoClustersX", &nHodoClustersX );
  tree->SetBranchAddress( "pos_hodoClustX", pos_hodoClustX );
  tree->SetBranchAddress( "nFibres_hodoClustX", nFibres_hodoClustX );
  tree->SetBranchAddress( "nHodoClustersY", &nHodoClustersY );
  tree->SetBranchAddress( "pos_hodoClustY", pos_hodoClustY );
  tree->SetBranchAddress( "nFibres_hodoClustY", nFibres_hodoClustY );
  tree->SetBranchAddress( "scintFront", &scintFront );
  tree->SetBranchAddress( "isSingleEle_scintFront", &isSingleEle_scintFront );
  tree->SetBranchAddress( "xBeam", &xBeam );
  tree->SetBranchAddress( "yBeam", &yBeam );

  tree->SetBranchAddress( "cef3_ok", &cef3_ok );
  tree->SetBranchAddress( "cef3_corr_ok", &cef3_corr_ok );
  tree->SetBranchAddress( "bgo_ok", &bgo_ok );
  tree->SetBranchAddress( "bgo_corr_ok", &bgo_corr_ok );


//.........这里部分代码省略.........
开发者ID:clarajorda,项目名称:BTFAnalysis,代码行数:101,代码来源:positionAnalysis.cpp


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