本文整理汇总了C++中TNamed::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ TNamed::GetName方法的具体用法?C++ TNamed::GetName怎么用?C++ TNamed::GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TNamed
的用法示例。
在下文中一共展示了TNamed::GetName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: ShowShortcutsInfos
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;
}
示例3: addFile
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;
}
示例4: 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;
}
}
}
示例5: 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;
}};
示例6: 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());
}
}
示例7: ClearSelection
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();
}
}
示例8: GetEventInfo
const AliEventInfo* GetEventInfo()
{
// Fill the event info object
AliCentralTrigger *aCTP = NULL;
if (AliEveEventManager::AssertRawReader())
{
fEventInfo.SetEventType(AliEveEventManager::AssertRawReader()->GetType());
ULong64_t mask = AliEveEventManager::AssertRawReader()->GetClassMask();
fEventInfo.SetTriggerMask(mask);
UInt_t clmask = AliEveEventManager::AssertRawReader()->GetDetectorPattern()[0];
fEventInfo.SetTriggerCluster(AliDAQ::ListOfTriggeredDetectors(clmask));
aCTP = new AliCentralTrigger();
TString configstr("");
if (!aCTP->LoadConfiguration(configstr)) { // Load CTP config from OCDB
printf("No trigger configuration found in OCDB! The trigger configuration information will not be used!");
// delete aCTP;
return 0;
}
aCTP->SetClassMask(mask);
aCTP->SetClusterMask(clmask);
if (AliEveEventManager::AssertRunLoader())
{
AliCentralTrigger* rlCTP = AliEveEventManager::AssertRunLoader()->GetTrigger();
if (rlCTP)
{
rlCTP->SetClassMask(mask);
rlCTP->SetClusterMask(clmask);
}
}
}
else
{
fEventInfo.SetEventType(AliRawEventHeaderBase::kPhysicsEvent);
if (AliEveEventManager::AssertRunLoader() &&
(!AliEveEventManager::AssertRunLoader()->LoadTrigger()))
{
aCTP = AliEveEventManager::AssertRunLoader()->GetTrigger();
fEventInfo.SetTriggerMask(aCTP->GetClassMask());
// get inputs from actp - just get
AliESDEvent *esdEvent = AliEveEventManager::Instance()->GetESD();
if(esdEvent)
{
AliESDHeader* esdheader = esdEvent->GetHeader();
esdheader->SetL0TriggerInputs(aCTP->GetL0TriggerInputs());
esdheader->SetL1TriggerInputs(aCTP->GetL1TriggerInputs());
esdheader->SetL2TriggerInputs(aCTP->GetL2TriggerInputs());
fEventInfo.SetTriggerCluster(AliDAQ::ListOfTriggeredDetectors(aCTP->GetClusterMask()));
}
else
{
cout<<"tpc_raw -- no ESD event"<<endl;
}
}
else
{
printf("No trigger can be loaded! The trigger information will not be used!");
return 0;
}
}
AliTriggerConfiguration *config = aCTP->GetConfiguration();
if (!config)
{
printf("No trigger configuration has been found! The trigger configuration information will not be used!");
// if (AliEveEventManager::AssertRawReader()) delete aCTP;
return 0;
}
TString declTriggerClasses;
// Load trigger aliases and declare the trigger classes included in aliases
AliCDBEntry * entry = AliCDBManager::Instance()->Get("GRP/CTP/Aliases");
if (entry) {
THashList * lst = dynamic_cast<THashList*>(entry->GetObject());
if (lst) {
lst->Sort(kFALSE); // to avoid problems with substrings
if (AliEveEventManager::AssertRawReader()) AliEveEventManager::AssertRawReader()->LoadTriggerAlias(lst);
// Now declare all the triggers present in the aliases
TIter iter(lst);
TNamed *nmd = 0;
while((nmd = dynamic_cast<TNamed*>(iter.Next()))){
declTriggerClasses += " ";
declTriggerClasses += nmd->GetName();
}
}
else {
printf("Cannot cast the object with trigger aliases to THashList!");
}
}
else {
printf("No OCDB entry for the trigger aliases!");
}
// Load trigger classes for this run
//.........这里部分代码省略.........
示例9: add_periods
void add_periods(const char *newname, const char *perioddir)
{
int i, j, K, N, L;
char str[1024];
TList *keys;
TFile *fIn;
TFile *f0;
TSystemFile *fSys;
char prefix[128];
char *ptr;
TNamed *obj;
TH1D *h;
TH1D *hist[MAXHIST];
TSystemDirectory *dir = new TSystemDirectory("MyDir", perioddir);
TList *files = dir->GetListOfFiles();
if (!files) {
printf("%s - nothing to do(files)\n", perioddir);
delete dir;
return;
}
N = files->GetEntries() - 2;
if (N <= 1) {
printf("%s - nothing to do\n", perioddir);
delete dir;
return;
}
TFile *fNew = new TFile(newname, "RECREATE");
if (!fNew->IsOpen()) {
delete dir;
delete files;
return;
}
fSys = (TSystemFile *) files->At(2);
if (!fSys) {
printf("Can not open the first file\n");
delete dir;
delete files;
return;
}
sprintf(str, "%s/%s", perioddir, fSys->GetName());
f0 = new TFile(str);
if (!f0->IsOpen()) {
printf("Can not open the first file\n");
delete dir;
delete files;
return;
}
keys = f0->GetListOfKeys();
K = keys->GetEntries();
if (K <= 0) {
printf("Nothing to do: K=0\n");
delete dir;
delete files;
return;
}
L = 0;
for (j=0; j<K; j++) {
obj = (TNamed *) keys->At(j);
if (!obj) continue;
obj = (TNamed *) f0->Get(obj->GetName());
if (!obj) continue;
if (strcmp(obj->ClassName(), "TH1D")) continue;
hist[L] = (TH1D *)obj;
L++;
}
if (!L) {
printf("Nothing to do: L=0\n");
f0->Close();
delete dir;
delete files;
return;
}
for (i=1; i<N; i++) {
fSys = (TSystemFile *) files->At(i+2); // skip . and ..
if (!fSys) continue;
sprintf(str, "%s/%s", perioddir, fSys->GetName());
fIn = new TFile(str);
if (!fIn->IsOpen()) continue;
for (j=0; j<L; j++) {
h = (TH1D *) fIn->Get(hist[j]->GetName());
if (!h) continue;
hist[j]->Add(h);
}
// printf("%s\n", fSys->GetName());
fIn->Close();
}
fNew->cd();
for (j=0; j<L; j++) hist[j]->Write();
fNew->Close();
f0->Close();
delete files;
delete dir;
}
示例10: SETUP
//.........这里部分代码省略.........
Form("%s/lib:%s", aliPhysicsDir.Data(), gSystem->GetDynamicPath()) );
}
}
else {
// AliRoot enabled from a single metaparfile. Assume that ALICE_ROOT and
// ALICE_PHYSICS are already defined on master and each worker.
// Note: this is the VAF case.
aliRootDir = gSystem->Getenv("ALICE_ROOT"); // NULL --> ""
aliPhysicsDir = gSystem->Getenv("ALICE_PHYSICS"); // NULL --> ""
if (aliRootDir.IsNull()) {
::Error(gMessTag.Data(),
"ALICE_ROOT environment variable not defined on PROOF node, and not"
"loading from a PARfile containing AliRoot version in its name");
return -1;
}
if (aliPhysicsDir.EqualTo(aliRootDir)) {
// AliPhysics does not exist if it points to the same directory of AliRoot
aliPhysicsDir = "";
}
::Info(gMessTag.Data(),
"Enabling ALICE software located on PROOF node (VAF mode)");
}
}
//
// Where are AliRoot and AliPhysics? Inform user
//
::Info(gMessTag.Data(), ">> ALICE_ROOT=%s", aliRootDir.Data());
::Info(gMessTag.Data(), ">> ALICE_PHYSICS=%s", aliPhysicsDir.Data());
//
// Common operations on Client and PROOF Master/Workers
//
// Add standard AliRoot Core include and macro path
gSystem->AddIncludePath( Form("-I\"%s/include\"", aliRootDir.Data()) );
gROOT->SetMacroPath( Form("%s:%s/macros", gROOT->GetMacroPath(), aliRootDir.Data()) );
// Same for AliPhysics
if (!aliPhysicsDir.IsNull()) {
gSystem->AddIncludePath( Form("-I\"%s/include\"", aliPhysicsDir.Data()) );
gROOT->SetMacroPath( Form("%s:%s/macros", gROOT->GetMacroPath(), aliPhysicsDir.Data()) );
}
//
// Process input parameters
//
TString extraLibs, mode;
Bool_t enableAliEn = kFALSE;
if (inputList) {
TIter it(inputList);
TNamed *pair;
while ((pair = dynamic_cast<TNamed *>(it.Next()))) {
if ( strcmp(pair->GetName(), "ALIROOT_EXTRA_LIBS") == 0 )
extraLibs = pair->GetTitle();
else if ( strcmp(pair->GetName(), "ALIROOT_ENABLE_ALIEN") == 0 )
enableAliEn = ( *(pair->GetTitle()) != '\0' );
else if ( strcmp(pair->GetName(), "ALIROOT_MODE") == 0 )
mode = pair->GetTitle();
}
}
//
// Load extra libraries and set AliRoot Core mode
//
if (!SETUP_SetAliRootCoreMode(mode, extraLibs)) {
::Error(gMessTag.Data(), "Error loading libraries while setting AliRoot mode.");
::Error(gMessTag.Data(), "Did you enable the right version of ROOT?");
return -1;
}
//
// Enable AliEn
//
if (enableAliEn) {
::Info(gMessTag.Data(), "Connecting to AliEn...");
TGrid::Connect("alien:");
if (!gGrid) {
::Error(gMessTag.Data(), "Cannot connect to AliEn");
return -1;
}
else {
::Info(gMessTag.Data(), "Successfully connected to AliEn");
}
}
return 0;
}