本文整理汇总了C++中TGraphErrors::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ TGraphErrors::Delete方法的具体用法?C++ TGraphErrors::Delete怎么用?C++ TGraphErrors::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGraphErrors
的用法示例。
在下文中一共展示了TGraphErrors::Delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProfileY
void KVCanvas::ProfileY(TH2* hh)
{
TObject* obj = 0;
if ((obj = gROOT->FindObject(Form("%s_pfy", hh->GetName())))) obj->Delete();
TProfile* pfy = hh->ProfileY("_pfy", 1, -1, "i");
TGraphErrors* gr = gHistoManipulator->MakeGraphFrom(pfy);
pfy->Delete();
TGraph* gg = gHistoManipulator->PermuteAxis(gr);
gr->Delete();
gg->SetName(Form("%s_pfy", hh->GetName()));
gg->SetLineColor(kBlack);
gg->Draw("PEZ");
Modified();
Update();
}
示例2: if
//.........这里部分代码省略.........
nextReferencePartition = yCoordinate;
int firstRef = vectorOfReferenceChambers.at(0);
int lastRef = vectorOfReferenceChambers.at(vectorOfReferenceChambers.size() - 1);
int ccham = currentChNumber+1;
if(! (lastRef > ccham && firstRef < ccham) ){
// all partitions are possible, chambers are out of the reference scope
prevReferencePartition = this->getChamberNumber(1)->getClones();
nextReferencePartition = 1; // 3 in case of ecap chamber
}
}
if (positive){ startCounter = prevReferencePartition; endCounter = nextReferencePartition; }
else { startCounter = nextReferencePartition ; endCounter = prevReferencePartition ; }
for (int currentCounter = startCounter ; currentCounter <= endCounter; currentCounter ++ ){
assert(currentCounter > 0 && currentCounter < 4);
vectorOfpartitionsAndHit.push_back(currentCounter);
}
}
else{
vectorOfpartitionsAndHit.push_back(this->getChamberNumber(currentChNumber+1)->getXYCoordinatesOfCluster(clusterNum[referenceChambersIncrementor]).at(1));
referenceChambersIncrementor ++;
}
prevReference = 0 ; nextReference = 0 ; prevReferencePartition = 0 ; nextReferencePartition = 0; currentChamberIsReference = false;
//cout << "Chamber " << l+1 << " " << coordinates.at(1) << " " << fitfunc->Eval(l+1) << " " << endl;
int channelNumberToStore = channelNum;
if (channelNumberToStore < 96/this->getChamberNumber(1)->getClones()){
channelNumberToStore += 1;
} // add one to represent the fired channel, or none if the channel is on the right border
vectorOfpartitionsAndHit.push_back(channelNumberToStore); // the last element is the number of the channel
// Debug lines
/**
cout << "Chamber is " << currentChNumber+1 << " partitions " ;
for (int thesize = 0 ; thesize < vectorOfpartitionsAndHit.size() - 1; thesize++){
cout << vectorOfpartitionsAndHit.at(thesize) << " " ;
}
cout << "channel " << vectorOfpartitionsAndHit.at(vectorOfpartitionsAndHit.size()-1) << endl;
*/
mapOfHits[currentChNumber+1] = vectorOfpartitionsAndHit;
}
// ---------- scintilators coordinates estimate
for (int scintNum = 0 ; scintNum < 31 ; scintNum++){
if(this->getTriggerObjectNumber(1)->getChannel(scintNum+1)->hasHit() && vectorOfClusterNumberCombinations.size() == 1 ) {
if (scintNum < 10) { scintilatorsCoordinates[scintNum+1] = graphXZ->Eval(0); topScintToString = boost::lexical_cast<string>(scintNum+1); }
else { scintilatorsCoordinates[scintNum+1] = graphXZ->Eval(lastFitPoint+1); botScintToString = boost::lexical_cast<string>(scintNum+1); }
}
}
}
// get only vertical tracks from the A partition if there are only two scint hits
if (keepRecoTrack && isVerticalTrack && !mapOfHits.empty() && scintilatorsCoordinates.size() == 2){
graphXZ->SetName(boost::lexical_cast<string>(eventNum).c_str());
string partition;
if (mapOfHits.find(vectorOfReferenceChambers.at(0))->second.at(0) == 1) partition = "A";
else if (mapOfHits.find(vectorOfReferenceChambers.at(0))->second.at(0) == 2) partition = "B";
else partition = "C";
graphXZ->SetTitle(("Correlation factor is "+boost::lexical_cast<string>(graphXZ->GetCorrelationFactor()) + " trigger channels top: " + topScintToString + " bottom: " + botScintToString ).c_str());
if(abs(graphXZ->GetCorrelationFactor()) >= correlationFactor) {
string scintCombination="_"+topScintToString+"_"+botScintToString+"_"+partition;
TDirectory * dir = fileForRecoTracks->GetDirectory(scintCombination.c_str(),true);
if(!dir) {
//fileForRecoTracks->ls();
fileForRecoTracks->mkdir(scintCombination.c_str()) ;
fileForRecoTracks->cd("");
}
fileForRecoTracks->cd(scintCombination.c_str());
//cout << fileForRecoTracks->GetPath() << endl;
}
else{ fileForRecoTracks->cd("") ; fileForRecoTracks->cd("badTracks") ; }
graphXZ->Write(graphXZ->GetName(),TObject::kOverwrite);
fileForRecoTracks->cd("");
//fileForRecoTracks->Write(graphXZ->GetName(),TObject::kOverwrite);
}
fitfunc->Delete();
//histXZ->Delete();
graphXZ->Delete();
}
return mapOfHits;
}
示例3: Calibration
//.........这里部分代码省略.........
for (int i=0; i<numberoffiles; i++){
gROOT->Reset();
for (int k=0; k<numberofchambers; k++){
histo[i][k]= (TH1F*) files[i]->Get(energy[k]);
if (!histo[i][k]){std::cerr << "Could not get histogram " << energy[k] << "in file "
<< files[i]->GetName() << std::endl;}
std::cout << "=========================================================================" << std::endl;
std::cout << files[i]->GetName() << std::endl;
canname = filename[i] + histo[i][k]->GetName();
can[i][k] = new TCanvas(canname, canname,800,600);
can[i][k]->cd();
histo[i][k]->Draw();
TF1 *fit = 0;
double mpc = 0;
double minfit = 0.;
double maxfit = 0.05;
histo[i][k]->Fit("landau","R+","same",minfit,maxfit);
fit = (TF1*) histo[i][k]->GetFunction("landau");
mpc = fit->GetParameter(1) - mpshift * fit->GetParameter(2);
mpv.push_back(mpc);
mpvr.push_back(fit->GetParError(1));
chamr.push_back(0.);
thesigma.push_back(fit->GetParameter(2));
thesigmaerr.push_back(fit->GetParError(2));
// if(i==0) {mpvname = "grMPV_50GeV"; sigmaname = "grSigma_50GeV";}
// if(i==1) {mpvname = "grMPV_100GeV";sigmaname = "grSigma_100GeV";}
// if(i==2) {mpvname = "grMPV_150GeV";sigmaname = "grSigma_150GeV";}
// if(i==3) {mpvname = "grMPV_200GeV";sigmaname = "grSigma_200GeV";}
mpvname[i] = "grMPV_" + filename[i];
sigmaname[i] = "grSigma" + filename[i];
// std::cout << "Chamber " << k << " MPV "<< mpc << std::endl;
can[i][k]->Print(canname + ".root",".root");
can[i][k]->Close();
}// end of loop over histos
TGraphErrors *gr = new TGraphErrors(mpv.size(),&chamb[0],&mpv[0],&mpvr[0],&chamr[0]);
gr->SetMarkerStyle(20);
gr->SetMarkerSize(1.0);
// gr->GetYaxis()->SetRangeUser(0.,100.);
//gr->GetXaxis()->SetRangeUser(0.,300.);
gr->SetTitle(mpvname[i]);
gr->GetHistogram()->SetXTitle(" Chamber ");
gr->GetHistogram()->SetYTitle(" Landau MPV (MIPs) ");
gr->GetYaxis()->SetTitleOffset(1.6);
TCanvas *c1 = new TCanvas("c1","mpv",200,10,700,500);
gr->Draw("APL");
c1->Update();
c1->Print(mpvname[i]+".png",".png");
c1->Close();
mpv.clear();
mpvr.clear();
TGraphErrors *grs = new TGraphErrors(thesigma.size(),&chamb[0],&thesigma[0],&thesigmaerr[0],&chamr[0]);
grs->SetMarkerStyle(20);
grs->SetMarkerSize(1.0);
// grs->GetYaxis()->SetRangeUser(0.,100.);
//grs->GetXaxis()->SetRangeUser(0.,300.);
grs->SetTitle(sigmaname[i]);
grs->GetHistogram()->SetXTitle(" Chamber ");
grs->GetHistogram()->SetYTitle(" Sigma ");
grs->GetYaxis()->SetTitleOffset(1.6);
TCanvas *c2 = new TCanvas("c2","sigma",200,10,700,500);
grs->Draw("APL");
c2->Update();
c2->Print(sigmaname[i]+".png",".png");
c2->Close();
thesigma.clear();
thesigmaerr.clear();
chamr.clear();
gr->Delete();
c1->Close();
c1->Close();
}// end of loop over files
}