本文整理汇总了C++中TGraphErrors::GetCorrelationFactor方法的典型用法代码示例。如果您正苦于以下问题:C++ TGraphErrors::GetCorrelationFactor方法的具体用法?C++ TGraphErrors::GetCorrelationFactor怎么用?C++ TGraphErrors::GetCorrelationFactor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGraphErrors
的用法示例。
在下文中一共展示了TGraphErrors::GetCorrelationFactor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
fitfunc->SetLineColor(kBlue);
vector<double> coordinates;
double xCoordinate = 0;
int yCoordinate = 0;
int zCoorinate = 0;
for (int ii=0 ; ii < vectorOfReferenceChambers.size() ; ii++){
coordinates = this->getChamberNumber(vectorOfReferenceChambers[ii])->getXYCoordinatesOfCluster(clusterNum[ii]);
xCoordinate = coordinates.at(0);
yCoordinate = coordinates.at(1);
zCoorinate = 10*vectorOfReferenceChambers[ii];
Double_t errorValue = this->getChamberNumber(vectorOfReferenceChambers[ii])->getSizeOfCluster(clusterNum[ii]);
// histXZ->SetBinContent(zCoorinate,xCoordinate);
// histXZ->SetBinError(zCoorinate,errorValue/2);
//cout << xCoordinate << " " << yCoordinate << endl;
graphXZ->SetPoint(ii,vectorOfReferenceChambers[ii],xCoordinate);
graphXZ->SetPointError(ii,0,errorValue/2);
}
Double_t params[2];
graphXZ->Fit(fitfunc,"RFQ");
fitfunc->GetParameters(params);
//cout << "par1 " << params[0] << " par2 " << params[1] << " chi2 " << fitfunc->GetChisquare() << endl;
// The resudials - difference between estimated fit value and the middle of the nearest cluster
int prevReference = 0 , nextReference = 0 , prevReferencePartition = 0 , nextReferencePartition = 0;
bool currentChamberIsReference = false;
int startCounter = 0, endCounter = 0;
if ( abs(graphXZ->GetCorrelationFactor()) >= correlationFactor && abs(graphXZ->GetCorrelationFactor()) > currentBestCorrFact ) {
// in case of only one partition, get the partition number of the first reference point
currentBestCorrFact = abs(graphXZ->GetCorrelationFactor());
int referenceChambersIncrementor = 0;
bool negativeChannelNumberIsFound = false;
// ---------
for ( int currentChNumber = 0 ; currentChNumber < this->getNumberOfChambers() ; currentChNumber++ ) {
// check where the chamber is according to the reference chambers
vector<double> vectorOfpartitionsAndHit;
double channelNum = fitfunc->Eval(currentChNumber+1);
/** four cases 1. the chamber is before the first reference 2. the chamber is after the last reference 3. the chamber is between two references 4. the chamber is a reference */
for(int refCheck = 0 ; refCheck < vectorOfReferenceChambers.size(); refCheck++){
// find the surounding references
if (currentChNumber+1 == vectorOfReferenceChambers.at(refCheck)){
currentChamberIsReference = true;
break;
}
if ( vectorOfReferenceChambers.at(refCheck) > currentChNumber+1 && refCheck == 0 ){
// its before the first reference chamber
nextReference = vectorOfReferenceChambers.at(refCheck);
nextReferencePartition = this->getChamberNumber(nextReference)->getXYCoordinatesOfCluster(clusterNum[refCheck]).at(1);
break;
}
if ( vectorOfReferenceChambers.at(refCheck) < currentChNumber+1 && refCheck == vectorOfReferenceChambers.size() - 1 ){
// its after the last chamber
prevReference = vectorOfReferenceChambers.at(refCheck);