• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TNamed类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetOption

//_____________________________________________________________________________
void ProofSimple::Begin(TTree * /*tree*/)
{
   // The Begin() function is called at the start of the query.
   // When running with PROOF Begin() is only called on the client.
   // The tree argument is deprecated (on PROOF 0 is passed).

   TString option = GetOption();
   Ssiz_t iopt = kNPOS;

   // Histos array
   if (fInput->FindObject("ProofSimple_NHist")) {
      TParameter<Long_t> *p =
         dynamic_cast<TParameter<Long_t>*>(fInput->FindObject("ProofSimple_NHist"));
      fNhist = (p) ? (Int_t) p->GetVal() : fNhist;
   } else if ((iopt = option.Index("nhist=")) != kNPOS) {
      TString s;
      Ssiz_t from = iopt + strlen("nhist=");
      if (option.Tokenize(s, from, ";") && s.IsDigit()) fNhist = s.Atoi();
   }
   if (fNhist < 1) {
      Abort("fNhist must be > 0! Hint: proof->SetParameter(\"ProofSimple_NHist\","
            " (Long_t) <nhist>)", kAbortProcess);
      return;
   }

   if (fInput->FindObject("ProofSimple_NHist3")) {
      TParameter<Long_t> *p =
         dynamic_cast<TParameter<Long_t>*>(fInput->FindObject("ProofSimple_NHist3"));
      fNhist3 = (p) ? (Int_t) p->GetVal() : fNhist3;
   } else if ((iopt = option.Index("nhist3=")) != kNPOS) {
      TString s;
      Ssiz_t from = iopt + strlen("nhist3=");
      if (option.Tokenize(s, from, ";") && s.IsDigit()) fNhist3 = s.Atoi();
   }

   // Ntuple
   TNamed *nm = dynamic_cast<TNamed *>(fInput->FindObject("ProofSimple_Ntuple"));
   if (nm) {

      // Title is in the form
      //         merge                  merge via file
      //           |<fout>                      location of the output file if merge
      //           |retrieve                    retrieve to client machine
      //         dataset                create a dataset
      //           |<dsname>                    dataset name (default: dataset_ntuple)
      //         |plot                  for a final plot
      //         <empty> or other       keep in memory

      fHasNtuple = 1;
      
      TString ontp(nm->GetTitle());
      if (ontp.Contains("|plot") || ontp == "plot") {
         fPlotNtuple = kTRUE;
         ontp.ReplaceAll("|plot", "");
         if (ontp == "plot") ontp = "";
      }
      if (ontp.BeginsWith("dataset")) fHasNtuple = 2;
   }
}
开发者ID:My-Source,项目名称:root,代码行数:60,代码来源:ProofSimple.C


示例2: GetOption

//_____________________________________________________________________________
void ProofEventProc::SlaveBegin(TTree * /*tree*/)
{
   // The SlaveBegin() function is called after the Begin() function.
   // When running with PROOF SlaveBegin() is called on each slave server.
   // The tree argument is deprecated (on PROOF 0 is passed).

   TString option = GetOption();

   // How much to read
   fFullRead = kFALSE;
   TNamed *nm = 0;
   if (fInput) {
      if ((nm = dynamic_cast<TNamed *>(fInput->FindObject("ProofEventProc_Read")))) {
         if (!strcmp(nm->GetTitle(), "readall")) fFullRead = kTRUE;
      }
   }
   if (!nm) {
      // Check option
      if (option == "readall") fFullRead = kTRUE;
   }
   Info("SlaveBegin", "'%s' reading", (fFullRead ? "full" : "optimized"));

   fPtHist = new TH1F("pt_dist","p_{T} Distribution",100,0,5);
   fPtHist->SetDirectory(0);
   fPtHist->GetXaxis()->SetTitle("p_{T}");
   fPtHist->GetYaxis()->SetTitle("dN/p_{T}dp_{T}");

   fOutput->Add(fPtHist);

   fPzHist = new TH1F("pz_dist","p_{Z} Distribution",100,0,5.);
   fPzHist->SetDirectory(0);
   fPzHist->GetXaxis()->SetTitle("p_{Z}");
   fPzHist->GetYaxis()->SetTitle("dN/dp_{Z}");

   fOutput->Add(fPzHist);

   fPxPyHist = new TH2F("px_py","p_{X} vs p_{Y} Distribution",100,-5.,5.,100,-5.,5.);
   fPxPyHist->SetDirectory(0);
   fPxPyHist->GetXaxis()->SetTitle("p_{X}");
   fPxPyHist->GetYaxis()->SetTitle("p_{Y}");

   fOutput->Add(fPxPyHist);
   
   // Abort test, if any
   TParameter<Int_t> *pi = 0;
   if (fInput) 
      pi = dynamic_cast<TParameter<Int_t> *>(fInput->FindObject("ProofEventProc_TestAbort"));
   if (pi) fTestAbort = pi->GetVal();
   if (fTestAbort < -1 || fTestAbort > 1) {
      Info("SlaveBegin", "unsupported value for the abort test: %d not in [-1,1] - ignore", fTestAbort);
      fTestAbort = -1;
   } else if (fTestAbort > -1) {
      Info("SlaveBegin", "running abort test: %d", fTestAbort);
   }

   if (fTestAbort == 0) 
      Abort("Test abortion during init", kAbortProcess);
}
开发者ID:adevress,项目名称:root-1,代码行数:59,代码来源:ProofEventProc.C


示例3: it

void KVCanvas::ShowShortcutsInfos()
{
   std::cout << std::endl << std::endl;
   TNamed* info = 0;
   TIter it(&fShortCuts);
   while ((info = (TNamed*)it())) {
      std::cout << Form("%20s", info->GetName()) << "   " << info->GetTitle() << std::endl;
   }
   std::cout << std::endl;
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:10,代码来源:KVCanvas.cpp


示例4: execCreateAndMerge

void execCreateAndMerge() { 
//-------------------------------------------------------------------------- 
for ( Int_t ifile = 0 ; ifile < 4 ; ifile++ ) { 
   TFile* outputFile = TFile::Open(Form("a_file_%d.root",ifile),"RECREATE"); 
   TNamed* namedObj = new TNamed(Form("namedObj%d",ifile),Form("namedObj%d",ifile)); 
   namedObj->Write(); 
   outputFile->Close(); 
} 
cout << "4 a files created" << endl; 
//-------------------------------------------------------------------------- 
//-------------------------------------------------------------------------- 
for ( Int_t ifile = 0 ; ifile < 4 ; ifile++ ) { 
   TFile* outputFile = TFile::Open(Form("b_file_%d.root",ifile),"RECREATE"); 
   TNamed* namedObj = new TNamed("namedObj","namedObj"); 
   namedObj->Write(); 
   outputFile->Close(); 
} 
cout << "4 b files created" << endl; 
//-------------------------------------------------------------------------- 
//-------------------------------------------------------------------------- 
TFileMerger* aMerger = new TFileMerger(kFALSE); 
 for ( Int_t ifile = 0 ; ifile < 4 ; ifile++ ) { 
    TFile* inFile = TFile::Open(Form("a_file_%d.root",ifile)); 
    aMerger->AddFile(inFile); 
 } 
 aMerger->OutputFile("a_file.root"); 
 aMerger->Merge(); 
 cout << "4 a files merged" << endl; 
//-------------------------------------------------------------------------- 
//-------------------------------------------------------------------------- 
 TFileMerger* bMerger = new TFileMerger(kFALSE); 
 for ( Int_t ifile = 0 ; ifile < 4 ; ifile++ ) { 
    TFile* inFile = TFile::Open(Form("b_file_%d.root",ifile)); 
    bMerger->AddFile(inFile); 
 } 
 bMerger->OutputFile("b_file.root"); 
 bMerger->Merge(); 
cout << "4 b files merged" << endl; 
//-------------------------------------------------------------------------- 
//-------------------------------------------------------------------------- 
TFile* inAFile = TFile::Open("a_file.root"); 
cout << "******* MERGED A FILE ******** 4 objects with different names" << endl; 
inAFile->ls(); 
cout << "******************************" << endl; 
//-------------------------------------------------------------------------- 
//-------------------------------------------------------------------------- 
TFile* inBFile = TFile::Open("b_file.root"); 
cout << "******* MERGED B FILE ******** 4 objects with the same names" << endl; 
inBFile->ls(); 
cout << "******************************" << endl; 
//-------------------------------------------------------------------------- 
} 
开发者ID:asmagina1995,项目名称:roottest,代码行数:52,代码来源:execCreateAndMerge.C


示例5: AddAllManagers

Bool_t AddAllManagers(TList *listManagers,TString anSrc, TString anMode,TString input,TString inputMC) {
   TIter next(listManagers);
   Int_t counter=0;
   TNamed *name;
   while ((name = (TNamed *)next.Next())) {
      if (!AddAnalysisManager(name->GetName(), anSrc, anMode,input,inputMC,name->GetTitle(),Form("%d",counter++))) {
         Printf("Error: Problem adding %s",name->GetName());
         return kFALSE;
      }
   }

   return kTRUE;
}
开发者ID:fbellini,项目名称:AliRsn,代码行数:13,代码来源:RunALICE.C


示例6: saveSummaryLoop

void RootWImage::saveSummaryLoop(TPad* basePad, std::string baseName, TFile* myTargetFile) {
  TList* aList;
  TObject* anObject;
  TPad* myPad;
  std::string myClass;
  std::string myName;

  TNamed* aNamed;

  // TSystemFile* aFile;
  // string aFileName;
  // string aFileNameTail;
  // TFile* myRootFile;

  aList = basePad->GetListOfPrimitives();
  for (int i=0; i<aList->GetEntries(); ++i) {
    anObject = aList->At(i);
    myClass = anObject->ClassName();
    if (myClass=="TPad") { // Go one step inside
      myPad = (TPad*) anObject;
      saveSummaryLoop(myPad, baseName, myTargetFile);
    } else if (
	       (myClass=="TProfile") ||
	       (myClass=="TGraph") ||
	       (myClass=="TH1D") ||
	       (myClass=="TH2C") ||
	       (myClass=="TH2D") ||
	       (myClass=="THStack") 
	       ) {
      aNamed = (TNamed*) anObject;
      myTargetFile->cd();
      myName = Form("%s.%s", baseName.c_str(), aNamed->GetName());
      myName = RootWeb::cleanUpObjectName(myName);
      aNamed->SetName(myName.c_str());
      aNamed->Write();
    } else if (
	       (myClass=="TEllipse") ||
	       (myClass=="TFrame") ||
	       (myClass=="TLatex") ||
	       (myClass=="TLegend") ||
	       (myClass=="TLine") ||
	       (myClass=="TPaveText") ||
	       (myClass=="TPolyLine") ||
	       (myClass=="TText") 
	       ) {
    } else {
      std::cerr << Form("Unhandled class %s", myClass.c_str()) << std::endl;
    }
  }
}
开发者ID:Deepali-Garg,项目名称:Ph2_ACF,代码行数:50,代码来源:rootweb.cpp


示例7: while

const char *Next(int &kind,int &idx,double &exe,double &heap,double &free,double &inc) {		  
  if(!inp) return 0;
  kind=0;idx=0;exe=0;heap=0;free=0,inc=0;
  TString ts;
  char *endMaker,*clear,*ctr,*doPs,*fr,*to,*and;
  while(fgets(line,500,inp)) {
    doPs = strstr(line,"doPs for");
    if (!doPs) 				continue;
    endMaker = strstr(line,"EndMaker");
    clear    = strstr(line,"Clear");
    ctr      = strstr(line,"constructor");
    kind = 0;
    if (ctr     ) kind = 1;
    if (clear   ) kind = 2;
    if (endMaker) kind = 3;
    if (!kind)				continue;
    fr = doPs+8 +strspn(doPs+8," \t");
    to = strstr(fr,":");
    ts = ""; ts.Append(fr,to-fr);
    if (!ts.Length()) 			continue;
    fr = strstr(fr,"total");  if (!fr) 	continue;
    fr = strstr(fr,"="    );  if (!fr) 	continue;
    exe = atof(fr+1);
    fr  = strstr(fr,"heap" ); if (!fr) 	continue;
    fr  = strstr(fr,"="    ); if (!fr) 	continue;
    heap = atof(fr+1);
    and  = strstr(fr,"and");
    if (and) free = atof(and+3);
    fr  = strstr(fr,"("    ); if (!fr) 	continue;
    inc = atof(fr+1);
    if (kind==1) 			continue;
    TNamed *tn = (TNamed*)hash.FindObject(ts.Data());
    if (!tn) {
      tn = new TNamed(ts.Data(),"");
      hash.Add(tn);
      fNMakers++;
      tn->SetUniqueID((UInt_t)fNMakers);
      mArray.AddAtAndExpand(tn,fNMakers);
    }
    idx = tn->GetUniqueID();
    return tn->GetName();
  }
  fclose(inp); inp = 0;
  return 0;  
}};
开发者ID:star-bnl,项目名称:star-macros,代码行数:45,代码来源:LeakFinder.C


示例8: EventInfo

//______________________________________________________________________
void EventInfo(Int_t event, Int_t px, Int_t , TObject *selected)
{
   //draw the tooltip showing the backtrace for the bin at px
   if (!gTip) return;
   gTip->Hide();
   if (event == kMouseLeave)
      return;
   Double_t xpx  = gPad->AbsPixeltoX(px);
   Int_t bin = hleaks->GetXaxis()->FindBin(xpx);
   if (bin <=0 || bin > hleaks->GetXaxis()->GetNbins()) return;
   Int_t nbytes = (Int_t)hleaks->GetBinContent(bin);
   Int_t entry  = (Int_t)hentry->GetBinContent(bin);
   Int_t btid   = (Int_t)V4[entry];
   Double_t  time = 0.0001*V3[entry];
   TH1I *hbtids = (TH1I*)T->GetUserInfo()->FindObject("btids");
   if (!hbtids) return;
   if (!btidlist) btidlist = (TObjArray*)T->GetUserInfo()->FindObject("FAddrsList");
   if (!btidlist) btidlist = (TObjArray*)f->Get("FAddrsList"); //old memstat files
   if (!btidlist) return;
   Int_t nbt = (Int_t)hbtids->GetBinContent(btid-1);
   TString ttip;
   for (Int_t i=0;i<nbt;i++) {
      Int_t j = (Int_t)hbtids->GetBinContent(btid+i);
      TNamed *nm = (TNamed*)btidlist->At(j);
      if (nm==0) break;
      char *title = (char*)nm->GetTitle();
      Int_t nch = strlen(title);
      if (nch < 20) continue;
      if (nch > 100) title[100] =0;
      const char *bar = strstr(title,"| ");
      if (!bar) continue;
      if (strstr(bar,"operator new")) continue;
      if (strstr(bar,"libMemStat")) continue;
      if (strstr(bar,"G__Exception")) continue;
      ttip += TString::Format("%2d %s\n",i,bar+1);
   }
   
   if (selected) {
      TString form1 = TString::Format("  Leak number=%d, leaking %d bytes at entry=%d    time=%gseconds\n\n",bin,nbytes,entry,time);
      gTip->SetText(TString::Format("%s%s",form1.Data(),ttip.Data() ));
      gTip->SetPosition(px+15, 100);
      gTip->Reset();
   }
}
开发者ID:My-Source,项目名称:root,代码行数:45,代码来源:memstat.C


示例9: Book

	/// Store an object to send back. We encase it in a FlowObject because the list
	/// of objects that goes back is "flat" and FlowObject holds onto
	/// a tag that tells us where this should be stored later. Helps!
	void Book(TObject *o)
	{
		string objName("");
		if (o->InheritsFrom("TNamed")) {
			TNamed *n = static_cast<TNamed*>(o);
			objName = n->GetName();
		}
		else {
			objName = o->ClassName();
		}

		///
		/// If this is a replacement, then boom!
		///

		if (dynamic_cast<TObject*> (GetOutputList()->FindObject(objName.c_str())) == 0) {
			GetOutputList()->Add(o->Clone());
		}
	}
开发者ID:gordonwatts,项目名称:TMVATests,代码行数:22,代码来源:query0.cpp


示例10: GetNpar

void KVNameValueList::ClearSelection(TRegexp& sel)
{
   // Remove from list all parameters whose name matches the regular expression
   // Examples:
   //  remove all parameters starting with "toto": TRegexp sel("^toto")
   //  remove all parameters with "toto" in name:  TRegexp sel("toto")

   TList toBeRemoved;
   Int_t np1 = GetNpar();
   for (Int_t ii = 0; ii < np1; ii += 1) {
      TString name = GetParameter(ii)->GetName();
      if (name.Contains(sel)) toBeRemoved.Add(new TNamed(name.Data(), ""));
   }
   if (toBeRemoved.GetEntries()) {
      TIter next(&toBeRemoved);
      TNamed* tbr;
      while ((tbr = (TNamed*)next())) RemoveParameter(tbr->GetName());
      toBeRemoved.Delete();
   }
}
开发者ID:FableQuentin,项目名称:kaliveda,代码行数:20,代码来源:KVNameValueList.cpp


示例11: GetAction

//_____________________________________________________________________________
Int_t ProofAux::GetAction(TList *input)
{
   // Get the required action.
   // Returns -1 if unknown.

   Int_t action = -1;
   // Determine the test type
   TNamed *ntype = dynamic_cast<TNamed*>(input->FindObject("ProofAux_Action"));
   if (ntype) {
      if (!strcmp(ntype->GetTitle(), "GenerateTrees")) {
         action = 0;
      } else if (!strcmp(ntype->GetTitle(), "GenerateTreesSameFile")) {
         action = 1;
      } else {
         Warning("GetAction", "unknown action: '%s'", ntype->GetTitle());
      }
   }
   // Done
   return action;
}
开发者ID:gganis,项目名称:proof,代码行数:21,代码来源:ProofAux.C


示例12: sprintf

void KVTrieur::Copy(TObject & a) const
{
#else
void KVTrieur::Copy(TObject & a)
{
#endif
//
// Methode de Copy
//
   Char_t nom[80];

#ifdef DEBUG_KVTrieur
   cout << "Copy de " << a.GetName() << "..." << endl;
#endif
#ifdef DEBUG_KVTrieur
   sprintf(nom, "Copy de %s", a.GetName());
#else
   sprintf(nom, "Copy_%s", a.GetName());
#endif
   ((KVTrieur &) a).SetName(nom);
   ((KVTrieur &) a).SetTitle(nom);

   ((KVTrieur &) a).nb_cases = this->nb_cases;
   if (this->noms_cases) {
      ((KVTrieur &) a).noms_cases =
          new TClonesArray("TNamed", this->nb_cases);
      TClonesArray *tca = ((KVTrieur &) a).noms_cases;
      Char_t nomc[80];
      for (Int_t i = 0; i < this->nb_cases; i++) {
         TNamed *c = (TNamed *) this->noms_cases->At(i);
         sprintf(nomc, "%s_C%d", this->GetName(), i + 1);
         new((*tca)[i]) TNamed(nomc, c->GetTitle());
      }
   } else {
      ((KVTrieur &) a).noms_cases = 0;
   }
#ifdef DEBUG_KVTrieur
   cout << "Nom de la Copy (arguement): " << nom << endl;
   cout << "Nom de la Copy (resultat) : " << GetName() << endl;
#endif
}
开发者ID:pwigg,项目名称:kaliveda,代码行数:41,代码来源:KVTrieur.cpp


示例13: sprintf

//_____________________________________________________
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


示例14: pwd

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


示例15: GetOption

void ProofNtuple::SlaveBegin(TTree * /*tree*/)
{
   // The SlaveBegin() function is called after the Begin() function.
   // When running with PROOF SlaveBegin() is called on each slave server.
   // The tree argument is deprecated (on PROOF 0 is passed).

   TString option = GetOption();

   // We may be creating a dataset or a merge file: check it
   TNamed *nm = dynamic_cast<TNamed *>(fInput->FindObject("SimpleNtuple.root"));
   if (nm) {
      // Just create the object
      UInt_t opt = TProofOutputFile::kRegister | TProofOutputFile::kOverwrite | TProofOutputFile::kVerify;
      fProofFile = new TProofOutputFile("SimpleNtuple.root",
                                        TProofOutputFile::kDataset, opt, nm->GetTitle());
   } else {
      // For the ntuple, we use the automatic file merging facility
      // Check if an output URL has been given
      TNamed *out = (TNamed *) fInput->FindObject("PROOF_OUTPUTFILE_LOCATION");
      Info("SlaveBegin", "PROOF_OUTPUTFILE_LOCATION: %s", (out ? out->GetTitle() : "undef"));
      fProofFile = new TProofOutputFile("SimpleNtuple.root", (out ? out->GetTitle() : "M"));
      out = (TNamed *) fInput->FindObject("PROOF_OUTPUTFILE");
      if (out) fProofFile->SetOutputFileName(out->GetTitle());
   }

   // Open the file
   fFile = fProofFile->OpenFile("RECREATE");
   if (fFile && fFile->IsZombie()) SafeDelete(fFile);

   // Cannot continue
   if (!fFile) {
      Info("SlaveBegin", "could not create '%s': instance is invalid!", fProofFile->GetName());
      return;
   }

   // Now we create the ntuple
   fNtp = new TNtuple("ntuple","Demo ntuple","px:py:pz:random:i");
   // File resident
   fNtp->SetDirectory(fFile);
   fNtp->AutoSave();

   // Should we generate the random numbers or take them from the ntuple ?
   TNamed *unr = (TNamed *) fInput->FindObject("PROOF_USE_NTP_RNDM");
   if (unr) {
      // Get the ntuple from the input list
      if (!(fNtpRndm = dynamic_cast<TNtuple *>(fInput->FindObject("NtpRndm")))) {
         Warning("SlaveBegin",
                 "asked to use rndm ntuple but 'NtpRndm' not found in the"
                 " input list! Using the random generator");
         fInput->Print();
      } else {
         Info("SlaveBegin", "taking randoms from input ntuple 'NtpRndm'");
      }
   }

   // Init the random generator, if required
   if (!fNtpRndm) fRandom = new TRandom3(0);
}
开发者ID:dawehner,项目名称:root,代码行数:58,代码来源:ProofNtuple.C


示例16: rename

void rename(const char* oldname, const char* newname)
{
	_file0->ReOpen("UPDATE");

	TObject* o = _file0->Get(oldname);
	if(!o) {
		cerr << "Object '" << oldname << "' not found in _file0" << endl;
		exit(1);
	}

	TNamed* n = dynamic_cast<TNamed*>(o);
	if(!n) {
		cerr << "Object '" << oldname << "' does not derive from TNamed" << endl;
		exit(1);
	}

	// this simply adds another TKey (I guess),
	// the object is still there with its old name
	n->SetName(newname);
	_file0->Write();

	exit(0);
}
开发者ID:A2Felix,项目名称:ant,代码行数:23,代码来源:rename.C


示例17: SlaveBegin

//_____________________________________________________________________________
void ProofJob::SlaveBegin(TTree * /*tree*/)
{

  cout << "      Starting babyTupler job     " << endl;
  
  // ############################
  // #   Get input from PROOF   #
  // ############################

    // Dataset name
    TNamed *dsname = (TNamed *) fInput->FindObject("PROOF_DATASETNAME"); 
    datasetName = dsname->GetTitle();
  
    cout << "     > Dataset : " << datasetName << endl;

    // XML config
    TNamed *xfname = (TNamed *) fInput->FindObject("PROOF_XMLFILENAME");
    string xmlFileName = xfname->GetTitle();
  
    // Output file
    TNamed *out = (TNamed *) fInput->FindObject("PROOF_OUTPUTFILE");
    fProofFile = new TProofOutputFile(out->GetTitle());
    TDirectory *savedir = gDirectory;
    fFile = fProofFile->OpenFile("UPDATE");
    if (fFile && fFile->IsZombie()) SafeDelete(fFile);
    savedir->cd();

  // #######################
  // #   Load the config   #
  // #######################

    sel = Void;
    anaEL = new AnalysisEnvironmentLoader(xmlFileName.c_str());
    anaEL->LoadSamples(datasets, datasetName); 
    anaEL->LoadSelection(sel);  
    anaEL->LoadGeneralInfo(DataType, Luminosity, LumiError, verbosity);

    LoadCorrectionFiles(); 

    // Retrieve the current dataset according to its name
    for(unsigned int d=0;d<datasets.size();d++)
      if (datasets[d].Name() == datasetName) dataset = &datasets[d];

  // #############################
  // #   Initialise the TTree    #
  // #############################

    theTree=new TTree("babyTuple","babyTuple");
    theTree->SetDirectory(fFile);

    InitializeBranches(theTree,&myEvent);
  
}
开发者ID:MichaelButtignol,项目名称:MonotopBabyTuples,代码行数:54,代码来源:ProofJob.C


示例18: ParseInput

//_____________________________________________________________________________
void ProofTests::ParseInput()
{
   // This function sets some control member variables based on the input list
   // content. Called by Begin and SlaveBegin.

   // Determine the test type
   TNamed *ntype = dynamic_cast<TNamed*>(fInput->FindObject("ProofTests_Type"));
   if (ntype) {
      if (!strcmp(ntype->GetTitle(), "InputData")) {
         fTestType = 0;
      } else if (!strcmp(ntype->GetTitle(), "PackTest1")) {
         fTestType = 1;
      } else if (!strcmp(ntype->GetTitle(), "PackTest2")) {
         fTestType = 2;
      } else {
         Warning("ParseInput", "unknown type: '%s'", ntype->GetTitle());
      }
   }
   Info("ParseInput", "test type: %d (from '%s')", fTestType, ntype ? ntype->GetTitle() : "undef");
}
开发者ID:dawehner,项目名称:root,代码行数:21,代码来源:ProofTests.C


示例19: 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


示例20: next

void CalibrationScanAnalysis::addFile(TFile* newFile) {
  int isha,vfs;
  TList* keyList = newFile->GetDirectory(DATAPATH)->GetListOfKeys();
  TIter next(keyList);
  TNamed* ishaObj = NULL;
  TNamed* vfsObj  = NULL;
  TNamed* obj = NULL;
  while ((obj = (TNamed*)(next()))) {
    if(strncmp(obj->GetName(),"<isha>",6)==0) ishaObj = (TNamed*)obj;
    if(strncmp(obj->GetName(),"<vfs>",5)==0)  vfsObj  = (TNamed*)obj;
  }
  if(!ishaObj || !vfsObj) {
     std::cerr << "Error: Unexpected file structure. ISHA/VFS values not found." << std::endl;
     newFile->Close();
     delete newFile;
     return;
  }
  isha = atoi(ishaObj->GetName()+8);
  vfs  = atoi(vfsObj->GetName()+7 );
  std::cout << "Loaded File for ISHA/VFS = " << isha << "/" << vfs << std::endl;
  files_[std::make_pair(isha,vfs)] = newFile;
}
开发者ID:Andrej-CMS,项目名称:cmssw,代码行数:22,代码来源:CalibrationScanAnalysis.C



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TNode类代码示例发布时间:2022-05-31
下一篇:
C++ TName类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap