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


C++ TObject::GetTitle方法代码示例

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


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

示例1: ScaleAll1file

void ScaleAll1file( TDirectory *target, FileInfo_t& source ) {

  cout << "Target path: " << target->GetPath() << endl;
  TString path( (char*)strstr( target->GetPath(), ":" ) );
  path.Remove( 0, 2 );

  source.fp->cd( path );
  TDirectory *current_sourcedir = gDirectory;

  // loop over all keys in this directory

  bool newdir = true;

  TIter nextkey( current_sourcedir->GetListOfKeys() );
  TKey *key;
  while ( (key = (TKey*)nextkey())) {

    // read object from first source file
    source.fp->cd( path );
    TObject *obj = key->ReadObj();

    if ( obj->IsA()->InheritsFrom( "TH1" ) ) {
      // descendant of TH1 -> scale it

      if (newdir) {
	newdir=false;
	cout << "Scaling histograms: " << endl;
      }

      cout << obj->GetName() << " ";
      TH1 *h1 = (TH1*)obj;

      h1->Scale(source.weight);

    } else if ( obj->IsA()->InheritsFrom( "TDirectory" ) ) {
      // it's a subdirectory

      newdir = true;

      cout << "\n=====> Found subdirectory " << obj->GetName();
      cout << "<=====\n" << endl;

      // create a new subdir of same name and title in the target file
      target->cd();
      TDirectory *newdir = target->mkdir( obj->GetName(), obj->GetTitle() );

      // newdir is now the starting point of another round of merging
      // newdir still knows its depth within the target file via
      // GetPath(), so we can still figure out where we are in the recursion
      ScaleAll1file( newdir, source );

    } else {

      // object is of no type that we know or can handle
      cout << "\n======> Unknown object type, name: " 
           << obj->GetName() << " title: " << obj->GetTitle();
      cout << "<======\n" << endl;
    }

    // now write the scaledd histogram (which is "in" obj) to the target file
    // note that this will just store obj in the current directory level,
    // which is not persistent until the complete directory itself is stored
    // by "target->Write()" below
    if ( obj ) {
      target->cd();

      obj->Write( key->GetName() );
    }

  } // while ( ( TKey *key = (TKey*)nextkey() ) )

  cout << endl;

  // save modifications to target file
  target->Write();

}
开发者ID:pdudero,项目名称:usercode,代码行数:77,代码来源:multiscale2.C

示例2: drawLoop


//.........这里部分代码省略.........
      gLegend->SetHeader(gDirectory->GetName());
      Color_t color = 1;
      Style_t style = 22;
      TGraph *h1 =(TGraph*)obj;
      h1->SetLineColor(color);
      h1->SetMarkerStyle(style);
      h1->SetMarkerColor(color);
      h1->GetHistogram()->Draw();
      h1->Draw();
      TString tmpName(first_source->GetName());
      gLegend->AddEntry(h1,tmpName,"LP");
      c1->Update();

      // loop over all source files and add the content of the
      // correspondant histogram to the one pointed to by "h1"
      TFile *nextsource = (TFile*)sourcelist->After( first_source );
      while ( nextsource ) {
        
        // make sure we are at the correct directory level by cd'ing to path
        nextsource->cd( path );
        TKey *key2 = (TKey*)gDirectory->GetListOfKeys()->FindObject(h1->GetName());
        if (key2) {
           TGraph *h2 = (TGraph*)key2->ReadObj();
	   color++;
	   style++;
	   h2->SetLineColor(color);
	   h2->SetMarkerStyle(style);
	   h2->SetMarkerColor(color);
           h2->Draw("same");
	   TString tmpName(nextsource->GetName());
	   gLegend->AddEntry(h2,tmpName,"LP");
	   gLegend->Draw("same");
	   c1->Update();
           //- delete h2;
        }

        nextsource = (TFile*)sourcelist->After( nextsource );
      }
    }
    else if ( obj->IsA()->InheritsFrom( "TTree" ) ) {
      std::cout << "I don't draw trees" << std::endl;
    } else if ( obj->IsA()->InheritsFrom( "TDirectory" ) ) {
      // it's a subdirectory
      std::cout << "Found subdirectory " << obj->GetName() << std::endl;

      // create a new subdir of same name and title in the target file
      target->cd();
      TDirectory *newdir = target->mkdir( obj->GetName(), obj->GetTitle() );

      // create a new subdir of same name in the file system
      TString newSysString(sysString+"/"+obj->GetName());
      if(makeGraphic) gSystem->mkdir(newSysString.Data(),kTRUE);

      // newdir is now the starting point of another round of merging
      // newdir still knows its depth within the target file via
      // GetPath(), so we can still figure out where we are in the recursion
      drawLoop( newdir, sourcelist, c1 );

    } else {
      // object is of no type that we know or can handle
      std::cout << "Unknown object type, name: " 
           << obj->GetName() << " title: " << obj->GetTitle() << std::endl;
    }
 
    // now write the merged TCanvas (which is "in" obj) to the target file
    // note that this will just store obj in the current directory level,
    // which is not persistent until the complete directory itself is stored
    // by "target->Write()" below
    if ( obj ) {
      target->cd();

	if ( obj->IsA()->InheritsFrom( "TH1") || obj->IsA()->InheritsFrom("TGraph")) {
	  //	 && !obj->IsA()->InheritsFrom("TH2") ) {
	  TString newName(obj->GetName());
	  newName.ReplaceAll("(",1,"_",1);
	  newName.ReplaceAll(")",1,"_",1);
	  c1->SetName(newName);
	  c1->Write( c1->GetName(),TObject::kOverwrite );
	  
	  if(makeGraphic) {
	    if (gROOT->IsBatch()) {
	      c1->Print("temp.eps");
	      gSystem->Exec("pstopnm -ppm -xborder 0 -yborder 0 -portrait temp.eps");
	      char tempCommand[200];
	      sprintf(tempCommand,"ppmtogif temp.eps001.ppm > %s/%s.gif",sysString.Data(),c1->GetName());
	      gSystem->Exec(tempCommand);
	    } else {	    
	      c1->Print(sysString + "/" + TString(c1->GetName())+".gif");
	    }
	  }
	  
	}
    }
    //if(gLegend) delete gLegend;
  } // while ( ( TKey *key = (TKey*)nextkey() ) )

  // save modifications to target file
  target->SaveSelf(kTRUE);
  TH1::AddDirectory(status);
}
开发者ID:Andrej-CMS,项目名称:cmssw,代码行数:101,代码来源:multiPlotter.cpp

示例3: MergeRootfile

void MergeRootfile( TFile *source ) {
   TString path(gDirectory->GetPath());
   source->cd( path );
   cerr << "Browsing " << path << endl;

   //gain time, do not add the objects in the list in memory
   TH1::AddDirectory(kFALSE);

   // loop over all keys in this directory
   TIter nextkey( gDirectory->GetListOfKeys() );
   TKey *key, *oldkey=0;
   while ( (key = (TKey*)nextkey())) {

      //keep only the highest cycle number for each key
      if (oldkey && !strcmp(oldkey->GetName(),key->GetName())) continue;

      // read object from first source file
      TObject *obj = key->ReadObj();

      cerr << "NAME IS " << obj->GetName() << endl;

      if ( obj->IsA()->InheritsFrom( TH1::Class() ) ) {
         cerr << "   HELLO, we have the histogram " << obj->GetName() << endl;
         TH1 *h = (TH1*)obj;
         ProcessHisto(h);
      } else if ( obj->IsA()->InheritsFrom( THnBase::Class() )) {
         cerr << "   HELLO-SPARSE " << obj->GetName() << endl;
         THnBase *h = (THnBase*)obj;
         ProcessSparse(h);
      } else if ( obj->IsA()->InheritsFrom( TDirectory::Class() ) ) {
         // it's a subdirectory

         //cerr << "Found subdirectory " << obj->GetName() << endl;
	 source->cd( path + "/" + obj->GetName() );
         MergeRootfile(source);
         source->cd( path );
      } else if ( obj->IsA()->InheritsFrom( TCollection::Class() )) {
        TCollection *coll = (TCollection *)obj;
        //cerr << "List of something in " << obj->GetName() << endl;
        TIter nextelem(coll);
        TObject *elem;
        while ((elem = nextelem())) {
          if (elem->IsA()->InheritsFrom( TH1::Class() )) {
            cerr << "   HELLO, we have the histogram " << elem->GetName() << endl;
            TH1 *h = (TH1 *)elem;
            ProcessHisto(h);
          } else if (elem->IsA()->InheritsFrom( THnBase::Class() )) {
            cerr << "   HELLO-SPARSE " << elem->GetName() << endl;
            THnBase *h = (THnBase *)elem;
            ProcessSparse(h);
          }
        }
      } else {

         // object is of no type that we know or can handle
         cerr << "Unknown object type, name: "
           << obj->GetName() << " title: " << obj->GetTitle() << endl;
      }
      delete obj;

   } // while ( ( TKey *key = (TKey*)nextkey() ) )
}
开发者ID:jblomer,项目名称:kvhisto,代码行数:62,代码来源:hadd.C

示例4: MergeRootfile

void MergeRootfile( TDirectory *target, TList *sourcelist ) {

   //  cout << "Target path: " << target->GetPath() << endl;
   TString path( (char*)strstr( target->GetPath(), ":" ) );
   path.Remove( 0, 2 );

   TFile *first_source = (TFile*)sourcelist->First();
   first_source->cd( path );
   TDirectory *current_sourcedir = gDirectory;
   //gain time, do not add the objects in the list in memory
   Bool_t status = TH1::AddDirectoryStatus();
   TH1::AddDirectory(kFALSE);

   // loop over all keys in this directory
   TChain *globChain = 0;
   TIter nextkey( current_sourcedir->GetListOfKeys() );
   TKey *key, *oldkey=0;
   while ( (key = (TKey*)nextkey())) {

      //keep only the highest cycle number for each key
      if (oldkey && !strcmp(oldkey->GetName(),key->GetName())) continue;

      // read object from first source file
      first_source->cd( path );
      TObject *obj = key->ReadObj();

      if ( obj->IsA()->InheritsFrom( TH1::Class() ) ) {
         // descendant of TH1 -> merge it

         //      cout << "Merging histogram " << obj->GetName() << endl;
         TH1 *h1 = (TH1*)obj;

         // loop over all source files and add the content of the
         // correspondant histogram to the one pointed to by "h1"
         TFile *nextsource = (TFile*)sourcelist->After( first_source );
         while ( nextsource ) {

            // make sure we are at the correct directory level by cd'ing to path
            nextsource->cd( path );
            TKey *key2 = (TKey*)gDirectory->GetListOfKeys()->FindObject(h1->GetName());
            if (key2) {
               TH1 *h2 = (TH1*)key2->ReadObj();
               h1->Add( h2 );
               delete h2;
            }

            nextsource = (TFile*)sourcelist->After( nextsource );
         }
      }
      else if ( obj->IsA()->InheritsFrom( TTree::Class() ) ) {

         // loop over all source files create a chain of Trees "globChain"
         const char* obj_name= obj->GetName();

         globChain = new TChain(obj_name);
         globChain->Add(first_source->GetName());
         TFile *nextsource = (TFile*)sourcelist->After( first_source );
         //      const char* file_name = nextsource->GetName();
         // cout << "file name  " << file_name << endl;
         while ( nextsource ) {

            globChain->Add(nextsource->GetName());
            nextsource = (TFile*)sourcelist->After( nextsource );
         }

      } else if ( obj->IsA()->InheritsFrom( TDirectory::Class() ) ) {
         // it's a subdirectory

         cout << "Found subdirectory " << obj->GetName() << endl;

         // create a new subdir of same name and title in the target file
         target->cd();
         TDirectory *newdir = target->mkdir( obj->GetName(), obj->GetTitle() );

         // newdir is now the starting point of another round of merging
         // newdir still knows its depth within the target file via
         // GetPath(), so we can still figure out where we are in the recursion
         MergeRootfile( newdir, sourcelist );

      } else {

         // object is of no type that we know or can handle
         cout << "Unknown object type, name: "
         << obj->GetName() << " title: " << obj->GetTitle() << endl;
      }

      // now write the merged histogram (which is "in" obj) to the target file
      // note that this will just store obj in the current directory level,
      // which is not persistent until the complete directory itself is stored
      // by "target->Write()" below
      if ( obj ) {
         target->cd();

         //!!if the object is a tree, it is stored in globChain...
         if(obj->IsA()->InheritsFrom( TTree::Class() ))
            globChain->Merge(target->GetFile(),0,"keep");
         else
            obj->Write( key->GetName() );
      }

//.........这里部分代码省略.........
开发者ID:Y--,项目名称:root,代码行数:101,代码来源:hadd.C

示例5: dataMCplots


//.........这里部分代码省略.........
      f_WW = getFile(infiles[i].data(), xSecWW, &scaleWW);

    if( infiles[i].find("WZ_") != std::string::npos )
      f_WZ = getFile(infiles[i].data(), xSecWZ, &scaleWZ);

    if( infiles[i].find("ZZ_") != std::string::npos )
      f_ZZ = getFile(infiles[i].data(), xSecZZ, &scaleZZ);

    if( infiles[i].find("V12015") != std::string::npos )
      f_data0 = getFile(infiles[i].data(), dummy, &dummy);

    if( infiles[i].find("V42015") != std::string::npos )
      f_data1 = getFile(infiles[i].data(), dummy, &dummy);

  }

  setNCUStyle(true);
  
  Double_t up_height     = 0.8;
  Double_t dw_correction = 1.455;
  Double_t dw_height     = (1-up_height)*dw_correction;

  TCanvas c("c","",0,0,1000,900);
  c.Divide(1,2);

  TPad* c_up = (TPad*) c.GetListOfPrimitives()->FindObject("c_1");
  TPad* c_dw = (TPad*) c.GetListOfPrimitives()->FindObject("c_2"); 

  c_up->SetPad(0,1-up_height,1,1);
  c_dw->SetPad(0,0,1,dw_height);
  c_dw->SetBottomMargin(0.25);

  // To get the name of histograms
  
  TFile *f_ = TFile::Open(infiles[0].data());
  f_->cd();
  
  TDirectory *current_sourcedir = gDirectory;
  TIter nextkey( current_sourcedir->GetListOfKeys() );
  TKey *key;

  vector<std::string> h_name;

  while ( (key = (TKey*)nextkey()) ) {

    TObject *obj = key->ReadObj();

    if ( obj->IsA()->InheritsFrom("TH1") ) 
      h_name.push_back(obj->GetTitle());

  }

  // Draw and output
  
  for(unsigned int i = 0; i < h_name.size()-1; i++){

    if( h_name[i]=="eleHoverE" || h_name[i]=="eleMiniIsoEA" || h_name[i]=="muMiniIsoEA" )
      c_up->cd()->SetLogy(1);
    else
      c_up->cd()->SetLogy(0);
    
    TH1D *h_data = (TH1D*)(f_data1->Get(h_name[i].data()))->Clone("h_data");
    TH1D *h_bkg  = (TH1D*)(f_data1->Get(h_name[i].data()))->Clone("h_bkg");

    myPlot(((TH1D*)(f_DY100->Get(h_name[i].data()))),
	   ((TH1D*)(f_DY200->Get(h_name[i].data()))),
	   ((TH1D*)(f_DY400->Get(h_name[i].data()))),
	   ((TH1D*)(f_DY600->Get(h_name[i].data()))),
	   ((TH1D*)(f_TTbar->Get(h_name[i].data()))),
	   ((TH1D*)(f_WW->Get(h_name[i].data()))),
	   ((TH1D*)(f_WZ->Get(h_name[i].data()))),
	   ((TH1D*)(f_ZZ->Get(h_name[i].data()))),
	   ((TH1D*)(f_data0->Get(h_name[i].data()))),
	   ((TH1D*)(f_data1->Get(h_name[i].data()))),
	   scaleDY100,
	   scaleDY200,
	   scaleDY400,
	   scaleDY600,
	   scaleTTbar,
	   scaleWW,
	   scaleWZ,
	   scaleZZ,
	   h_data,
	   h_bkg);

    c_up->RedrawAxis();

    c_dw->cd();

    myRatio(h_data, h_bkg);

    c.Draw();
    
    if( i == 0 ) c.Print(Form("%s.pdf(", pdfName.data()), "pdf");
    else if( i == h_name.size()-2 ) c.Print(Form("%s.pdf)", pdfName.data()), "pdf");
    else c.Print(Form("%s.pdf", pdfName.data()), "pdf");
    
  }

}
开发者ID:yuchanggit,项目名称:ZpZHllbb_13TeV,代码行数:101,代码来源:dataMCplots.C

示例6: bfcread_histBranch

void bfcread_histBranch(
 Int_t nevents=1, 
 const char *MainFile=
 "/afs/rhic.bnl.gov/star/data/samples/gstar.dst.root",
  const char *fname="qa_hist.out")
{
//
  cout << " events to process  = " << nevents << endl;
  cout << " Input File Name = " << MainFile << endl;
  cout << " Output file containing printouts = " << fname << endl;

  ofstream fout(fname);

  fout << " Running: bfcread_histBranch.C " << endl;
  fout << " events to process  = " << nevents << endl;
  fout << " Input File Name = " << MainFile << endl;
  fout << " Output file containing printouts = " << fname << endl;
  fout << endl << endl;

    gSystem->Load("St_base");
    gSystem->Load("StChain");
    gSystem->Load("StIOMaker");
    gSystem->Load("libglobal_Tables");

//  Setup top part of chain
    chain = new StChain("bfc");
    chain->SetDebug();
   
  StIOMaker *IOMk = new StIOMaker("IO","r",MainFile,"bfcTree");
  IOMk->SetDebug();
  IOMk->SetIOMode("r");
  IOMk->SetBranch("*",0,"0");                 //deactivate all branches
  IOMk->SetBranch("histBranch",0,"r"); //activate hist Branch

// --- now execute chain member functions
  chain->Init();

  TDataSet *ds=0;
  TDataSet *obj=0;

  int istat=0;
  int i=0;
  int countev=0;
  int countevhds=0;

// Event loop
EventLoop: if (i < nevents && !istat) {

    chain->Clear();
    istat = chain->Make(i);

//  count # times Make is called
    i++;

// Now look at the data in the event:
    int countObj=0;
    int countHist=0;

    if (!istat) {

    countev++;

    cout << " start event # " << countev << endl;

      ds=chain->GetDataSet("hist");
      TDataSetIter tabiter(ds);
      if (ds) {

        countevhds++;

        TDataSetIter nextHistList(ds);
        St_ObjectSet *histContainer = 0;
        TList *dirList = 0;

// loop over directories:
        while (histContainer = (St_ObjectSet *)nextHistList()) {
          dirList = (TList *) histContainer->GetObject();

	  cout << " QAInfo: found directory: " << 
                    histContainer->GetName() << endl;
	  fout << " QAInfo: found directory: " << 
                    histContainer->GetName() << endl;

          countObj++;

// Notes for future reference (if we want to generalize this...)
//    dirList is returned  0 for non-histogram file
//       in that case, use GetList instead of GetObject 

         TIter nextHist(dirList);
         TObject  *o = 0;

// loop over histograms in the directory:
          while (o= nextHist()) {
           countHist++;
           cout << " QAInfo:   Hist name: " << o->GetName() << 
                     " ==> Title: " << o->GetTitle() << endl; 
           fout << " QAInfo:   Hist name: " << o->GetName() << 
                     " ==> Title: " << o->GetTitle() << endl; 

//.........这里部分代码省略.........
开发者ID:star-bnl,项目名称:star-macros,代码行数:101,代码来源:bfcread_histBranch.C

示例7: generatePlots

void generatePlots(Files *inputs, const string &path)
{
    Files::const_iterator first_source = inputs->begin();
    TDirectory *folder = dynamic_cast<TDirectory *>(first_source->second->Get(path.c_str()));
    if (!folder)
    {
        cerr << "Failed to extract folder: " << path << endl;

        return;
    }
    //
    //gain time, do not add the objects in the list in memory
    //
    Bool_t status = TH1::AddDirectoryStatus();
    TH1::AddDirectory(kFALSE);

    // loop over all keys in this directory
    TIter nextkey(folder->GetListOfKeys() );

    for(TKey *key, *oldkey=0; key = (TKey*) nextkey(); )
    {
        //keep only the highest cycle number for each key
        if (oldkey
            && !strcmp(oldkey->GetName(), key->GetName()))

            continue;

        // read object from first source file
        //
        TObject *obj = key->ReadObj();

        if ( obj->IsA()->InheritsFrom(TH1::Class()))
        {
            cout << obj->GetName() << endl;

            TCanvas *canvas = new TCanvas();

            canvas->SetWindowSize(640, 480);

            THStack *stack = new THStack();
            TLegend  *legend = new TLegend(.6, .98, .98, .58);
            legend->SetBorderSize(1);
            legend->SetLineStyle(1);
            legend->SetTextFont(43);
            legend->SetTextSizePixels(12);
            legend->SetFillColor(0);

            TH1 *h1 = dynamic_cast<TH1*>(obj);
            legend->AddEntry(h1, style(h1, first_source->first).c_str(), "pl");
            h1->Scale(1.0 / h1->Integral());

            stack->Add(h1);

            // loop over all source files and add the content of the
            // correspondant histogram to the one pointed to by "h1"
            for(Files::const_iterator input = ++inputs->begin();
                    inputs->end() != input;
                    ++input)
            {
                TH1 *h2 = dynamic_cast<TH1*>(input->second->Get((path + "/" + obj->GetName()).c_str()));
                if (!h2)
                {
                    cerr << "Failed to extract plot from input: " << endl;

                    continue;
                }

                h2->Scale(1. / h2->Integral());
                legend->AddEntry(h2, style(h2, input->first).c_str(), "pl");
                stack->Add(h2);
            }

            stack->Draw("h nostack");
            legend->Draw();
            stack->GetXaxis()->SetTitle(h1->GetXaxis()->GetTitle());

            canvas->Update();
        } else {
            // object is of no type that we know or can handle
            //
            cout << "Unknown object type, name: "
                << obj->GetName() << " title: " << obj->GetTitle() << endl;
        }
    }

    // save modifications to target file
    TH1::AddDirectory(status);
}
开发者ID:skhal,项目名称:bsm_mc,代码行数:88,代码来源:plot.cpp

示例8: log

//-----------------------------------------------------------------------------
StatusCode
RootHistCnv::RDirectoryCnv::fillObjRefs(IOpaqueAddress* pAddr,DataObject* pObj)  {
  MsgStream log(msgSvc(), "RDirectoryCnv");
  IRegistry* pReg = pObj->registry();
  std::string full  = pReg->identifier();
  const std::string& fname = pAddr->par()[0];

  TFile *tf;
  findTFile(full,tf).ignore();

  // cd to TFile:
  setDirectory(full);
  TIter nextkey(gDirectory->GetListOfKeys());
  while (TKey *key = (TKey*)nextkey()) {
    IOpaqueAddress* pA = 0;
    TObject *obj = key->ReadObj();
    std::string title = obj->GetTitle();
    std::string sid = obj->GetName();
    std::string f2 = full + "/" + sid;
    int idh = ::strtol(sid.c_str(),NULL,10);
    // introduced by Grigori Rybkine
    std::string clname = key->GetClassName();
    std::string clnm = clname.substr(0,3);
    TClass* isa = obj->IsA();
    if (isa->InheritsFrom("TTree")) {
      createAddress(full, CLID_ColumnWiseTuple, idh, obj, pA).ignore();
      TTree* tree = (TTree*) obj;
      tree->Print();
      log << MSG::DEBUG << "Reg CWNT \"" << obj->GetTitle()
       	  << "\" as " << f2 << endmsg;
      title = "/" + sid;
    } else if (isa->InheritsFrom("TDirectory")) {
      createAddress(full,CLID_NTupleDirectory, title, obj, pA).ignore();
    } else if ( isa == TProfile::Class() ) {
      createAddress(full,CLID_ProfileH,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TProfile2D::Class() ) {
      createAddress(full,CLID_ProfileH2,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH1C::Class() ) {
      createAddress(full,CLID_H1D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH1S::Class() ) {
      createAddress(full,CLID_H1D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH1I::Class() ) {
      createAddress(full,CLID_H1D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH1F::Class() ) {
      createAddress(full,CLID_H1D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH1D::Class() ) {
      createAddress(full,CLID_H1D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH2C::Class() ) {
      createAddress(full,CLID_H2D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH2S::Class() ) {
      createAddress(full,CLID_H2D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH2I::Class() ) {
      createAddress(full,CLID_H2D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH2F::Class() ) {
      createAddress(full,CLID_H2D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH2D::Class() ) {
      createAddress(full,CLID_H2D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH3C::Class() ) {
      createAddress(full,CLID_H3D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH3S::Class() ) {
      createAddress(full,CLID_H3D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH3I::Class() ) {
      createAddress(full,CLID_H3D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH3F::Class() ) {
      createAddress(full,CLID_H3D,idh,obj,pA).ignore();
      title = sid;
    } else if ( isa == TH3D::Class() ) {
      createAddress(full,CLID_H3D,idh,obj,pA).ignore();
      title = sid;
    } else {
      log << MSG::ERROR << "Encountered an unknown object with key: "
      	  << obj->GetName() << " in ROOT file " << fname << endmsg;
      return StatusCode::FAILURE;
    }
    if ( 0 != pA )    {
      StatusCode sc = dataManager()->registerAddress(pReg, title, pA);
      if ( !sc.isSuccess() )  {
        log << MSG::ERROR << "Failed to register address for " << full  << endmsg;
        return sc;
      }
      log << MSG::VERBOSE << "Created address for " << clnm
          << "'" << title << "' in " << full << endmsg;
    }
  }
//.........这里部分代码省略.........
开发者ID:l1calo,项目名称:gaudi,代码行数:101,代码来源:RDirectoryCnv.cpp


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