本文整理汇总了C++中TNamed::SetUniqueID方法的典型用法代码示例。如果您正苦于以下问题:C++ TNamed::SetUniqueID方法的具体用法?C++ TNamed::SetUniqueID怎么用?C++ TNamed::SetUniqueID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TNamed
的用法示例。
在下文中一共展示了TNamed::SetUniqueID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}};
示例2: SaveInformation
/**
* Store some information on the output
*
* @param dir Where to store
* @param method Method used
* @param mId Method identifier
* @param regParam Regularization parameter
* @param sys Collision system
* @param sNN Center of mass energy
* @param trigger Trigger mask
* @param minIpZ Least z coordinate of interaction point
* @param maxIpZ Largest z coordinate of interaction point
* @param self Self-consistency check
*/
void SaveInformation(TDirectory* dir,
const TString& method,
Int_t mId,
Double_t regParam,
UShort_t sys,
UShort_t sNN,
UInt_t trigger,
Double_t minIpZ,
Double_t maxIpZ,
Bool_t self) const
{
dir->cd();
TParameter<bool>* pM = new TParameter<bool>("self", self);
pM->SetBit(BIT(19));
pM->Write();
TNamed* outMeth = new TNamed("method", method.Data());
outMeth->SetUniqueID(mId);
outMeth->Write();
TParameter<double>* pR = new TParameter<double>("regParam", regParam);
pR->SetBit(BIT(19));
pR->Write();
TString tS = (sys == 1 ? "pp" : sys == 2 ? "PbPb" : sys == 3 ? "pPb" : "?");
TNamed* pS = new TNamed("sys", tS.Data()); pS->SetUniqueID(sys);
pS->Write();
TString tE;
if (sNN < 1000) tE = Form("%dGeV", sNN);
else if (sNN < 3000) tE = Form("%4.2fTeV", float(sNN)/1000);
else tE = Form("%dTeV", sNN/1000);
TNamed* pE = new TNamed("sNN", tE.Data()); pE->SetUniqueID(sNN);
pE->Write();
TString tT;
/**
* Bits of the trigger pattern
*/
enum {
/** In-elastic collision */
kInel = 0x0001,
/** In-elastic collision with at least one SPD tracklet */
kInelGt0 = 0x0002,
/** Non-single diffractive collision */
kNSD = 0x0004,
/** Empty bunch crossing */
kEmpty = 0x0008,
/** A-side trigger */
kA = 0x0010,
/** B(arrel) trigger */
kB = 0x0020,
/** C-side trigger */
kC = 0x0080,
/** Empty trigger */
kE = 0x0100,
/** pileup from SPD */
kPileUp = 0x0200,
/** true NSD from MC */
kMCNSD = 0x0400,
/** Offline MB triggered */
kOffline = 0x0800,
/** At least one SPD cluster */
kNClusterGt0 = 0x1000,
/** V0-AND trigger */
kV0AND = 0x2000,
/** Satellite event */
kSatellite = 0x4000
};
if ((trigger & kInel) != 0x0) AppendAnd(tT, "INEL");
if ((trigger & kInelGt0) != 0x0) AppendAnd(tT, "INEL>0");
if ((trigger & kNSD) != 0x0) AppendAnd(tT, "NSD");
if ((trigger & kV0AND) != 0x0) AppendAnd(tT, "V0AND");
if ((trigger & kA) != 0x0) AppendAnd(tT, "A");
if ((trigger & kB) != 0x0) AppendAnd(tT, "B");
if ((trigger & kC) != 0x0) AppendAnd(tT, "C");
if ((trigger & kE) != 0x0) AppendAnd(tT, "E");
if ((trigger & kMCNSD) != 0x0) AppendAnd(tT, "MCNSD");
if ((trigger & kNClusterGt0) != 0x0) AppendAnd(tT, "NCluster>0");
if ((trigger & kSatellite) != 0x0) AppendAnd(tT, "Satellite");
TNamed* pT = new TNamed("trigger", tT.Data()); pT->SetUniqueID(trigger);
pT->Write();
TParameter<double>* pY = new TParameter<double>("minIpZ", minIpZ);
pY->SetBit(BIT(19));
//.........这里部分代码省略.........