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


C++ TNamed::SetTitle方法代码示例

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


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

示例1: SetNomsCases

//_____________________________________________________
void KVTrieurLin::SetNomsCases(void)
{
//
// On affecte les noms aux cases
//
   Char_t nomt[80];
   if (noms_cases) {
      Double_t xpas = (xmax - xmin) / nb_cases;
      for (Int_t i = 0; i < nb_cases; i++) {
         if (i == 0) {
            sprintf(nomt, "%s < %f", nom_var, xmin + (i + 1) * xpas);
         } else if (i == nb_cases - 1) {
            sprintf(nomt, "%f #leq %s", xmin + i * xpas, nom_var);
         } else {
            sprintf(nomt, "%f #leq %s < %f", xmin + i * xpas, nom_var,
                    xmin + (i + 1) * xpas);
         }
         TNamed* nom = (TNamed*) noms_cases->At(i);
         nom->SetTitle(nomt);
      }
   }
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:23,代码来源:KVTrieurLin.cpp

示例2: dumpObject

bool PlotManager::dumpObject(const string& objName,
                             const string& objTitle,
                             const string& srcObjName)
{
  if ( ! isSetup_ ) return false;
  
  // Push to base directory
  string pwd(gDirectory->GetPath());
  
  string newObjPath = dirname(objName);
  string newObjName = basename(objName);
  
  if ( newObjPath.empty() ) {
    theOutFile_->cd();
  }
  else if ( theOutFile_->cd(newObjPath.c_str()) == kFALSE ) {
    cout << "Cannot find dir, do mkdirs : " << newObjPath << endl;
    mkdirs(theOutFile_, newObjPath)->cd();
  }

  TNamed* srcObj = dynamic_cast<TNamed*>(theSrcFile_->Get(srcObjName.c_str()));

  if ( srcObj == NULL ) {
    cerr << "Cannot get object : " << srcObjName << endl;
    return false;
  }

  TNamed* saveObj = dynamic_cast<TNamed*>(srcObj->Clone(newObjName.c_str()));
  saveObj->SetTitle(objTitle.c_str());
  
  // Save histogram
  saveObj->Write();
  
  // Pop directory
  gDirectory->cd(pwd.c_str());
  
  return true;
}
开发者ID:Andrej-CMS,项目名称:cmssw,代码行数:38,代码来源:makePlot.cpp

示例3: setTitleStyle

void  PlotAlignmentValidation::setTitleStyle( TNamed &hist,const char* titleX, const char* titleY,int subDetId)
{
  std::stringstream titel_Xaxis;
  std::stringstream titel_Yaxis;
  TString titelXAxis=titleX;
  TString titelYAxis=titleY;
  cout<<"plot "<<titelXAxis<<" vs "<<titelYAxis<<endl;
 
 if ( titelXAxis.Contains("medianX")||titelXAxis.Contains("medianY")||titelXAxis.Contains("meanX")||titelXAxis.Contains("rmsX")||titelXAxis.Contains("meanY") ){
    std::string histTitel="";
    if (titelXAxis.Contains("medianX")) histTitel="Distribution of the median of the residuals in ";
    if (titelXAxis.Contains("medianY")) histTitel="Distribution of the median of the y residuals in ";
    if (titelXAxis.Contains("meanX")) histTitel="Distribution of the mean of the residuals in ";
    if (titelXAxis.Contains("meanY")) histTitel="Distribution of the mean of the residuals in ";
    if (titelXAxis.Contains("rmsX")) histTitel="Distribution of the rms of the residuals in ";

      switch (subDetId) {
	case 1: histTitel+="TPB";break;
	case 2: histTitel+="TPE";break;
	case 3: histTitel+="TIB";break;
	case 4: histTitel+="TID";break;
	case 5: histTitel+="TOB";break;
	case 6: histTitel+="TEC";break;
      }
    hist.SetTitle(histTitel.c_str());
  }
  
  else{
    switch (subDetId){
    case 1: hist.SetTitle("Pixel Barrel");break;
    case 2: hist.SetTitle("Pixel Endcap");break;
    case 3: hist.SetTitle("Tracker Inner Barrel");break;
    case 4: hist.SetTitle("Tracker Inner Disk");break;
    case 5: hist.SetTitle("Tracker Outer Barrel");break;
    case 6: hist.SetTitle("Tracker End Cap");break;
      //default:hist.SetTitle();
    }    
  }
 
}
开发者ID:hooberman,项目名称:UserCode,代码行数:40,代码来源:PlotAlignmentValidation.C

示例4: CheckRanges

//_____________________________________________________________________________
void ProofEventProc::CheckRanges()
{
   // Check the processed event ranges when there is enough information
   // The result is added to the output list

   // Must be something in output
   if (!fOutput || (fOutput && fOutput->GetSize() <= 0)) return;

   // Create the result object and add it to the list
   TNamed *nout = new TNamed("Range_Check", "OK");
   fOutput->Add(nout);
   
   // Get info to check from the input list
   if (!fInput || (fInput && fInput->GetSize() <= 0)) {
      nout->SetTitle("No input list");
      return;
   }
   TNamed *ffst = dynamic_cast<TNamed *>(fInput->FindObject("Range_First_File"));
   if (!ffst) {
      nout->SetTitle("No first file");
      return;
   }
   TNamed *flst = dynamic_cast<TNamed *>(fInput->FindObject("Range_Last_File"));
   if (!flst) {
      nout->SetTitle("No last file");
      return;
   }
   TParameter<Int_t> *fnum =
      dynamic_cast<TParameter<Int_t> *>(fInput->FindObject("Range_Num_Files"));
   if (!fnum) {
      nout->SetTitle("No number of files");
      return;
   }

   // Check first file
   TString fn(ffst->GetTitle()), sfst(ffst->GetTitle());
   Ssiz_t ifst = fn.Index("?fst=");
   if (ifst == kNPOS) {
      nout->SetTitle("No first entry information in first file name");
      return;
   }
   fn.Remove(ifst);
   sfst.Remove(0, ifst + sizeof("?fst=") - 1);
   if (!sfst.IsDigit()) {
      nout->SetTitle("Badly formatted first entry information in first file name");
      return;
   }
   Long64_t fst = (Long64_t) sfst.Atoi();
   ProcFileElements *pfef = dynamic_cast<ProcFileElements *>(fOutput->FindObject(fn));
   if (!pfef) {
      nout->SetTitle("ProcFileElements for first file not found in the output list");
      return;
   }
   if (pfef->GetFirst() != fst) {
      TString t = TString::Format("First entry differs {found: %lld, expected: %lld}", pfef->GetFirst(), fst);
      nout->SetTitle(t.Data());
      return;
   }

   // Check last file
   fn = flst->GetTitle();
   TString slst(flst->GetTitle());
   Ssiz_t ilst = fn.Index("?lst=");
   if (ilst == kNPOS) {
      nout->SetTitle("No last entry information in last file name");
      return;
   }
   fn.Remove(ilst);
   slst.Remove(0, ilst + sizeof("?lst=") - 1);
   if (!slst.IsDigit()) {
      nout->SetTitle("Badly formatted last entry information in last file name");
      return;
   }
   Long64_t lst = (Long64_t) slst.Atoi();
   ProcFileElements *pfel = dynamic_cast<ProcFileElements *>(fOutput->FindObject(fn));
   if (!pfel) {
      nout->SetTitle("ProcFileElements for last file not found in the output list");
      return;
   }
   if (pfel->GetLast() != lst) {
      nout->SetTitle("Last entry differs");
      return;
   }

   // Check Number of files
   Int_t nproc = 0;
   TIter nxo(fOutput);
   TObject *o = 0;
   while ((o = nxo())) {
      if (dynamic_cast<ProcFileElements *>(o)) nproc++;
   }
   if (fnum->GetVal() != nproc) {
      nout->SetTitle("Number of processed files differs");
      return;
   }
}
开发者ID:adevress,项目名称:root-1,代码行数:97,代码来源:ProofEventProc.C


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