本文整理汇总了C++中TEventList::Enter方法的典型用法代码示例。如果您正苦于以下问题:C++ TEventList::Enter方法的具体用法?C++ TEventList::Enter怎么用?C++ TEventList::Enter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEventList
的用法示例。
在下文中一共展示了TEventList::Enter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: putIntoEventList
/////////////////////////
// Put entries into the event list
SEXP putIntoEventList(SEXP eventList, SEXP entryNums)
{
TEventList* el = checkForEventListWrapper(eventList);
for ( unsigned int i = 0; i < GET_LENGTH(entryNums); ++i ) {
el->Enter( INTEGER(entryNums)[i] );
}
return R_NilValue;
}
示例2: Process
void KVEventListMaker::Process(){
if (!IsReady()) return;
//open file where tree is stored
TFile *file = new TFile(GetFileName().Data(),"update");
KVList *kevtlist = new KVList();
TTree *tt = NULL;
//just count the number of branches
KVString lname = GetBranchName();
Int_t nbre=0;
lname.Begin(" ");
while (!lname.End()) {KVString stamp=lname.Next(); nbre+=1;}
if (nbre==0) return;
Int_t *variable = new Int_t[nbre];
KVString evtname;
Bool_t ok=kFALSE;
//check if the tree are there
if ( (tt = (TTree *)file->Get(GetTreeName().Data())) ){
Int_t nentries = tt->GetEntries();
printf("nbre d entree %d\n",nentries);
TBranch* bb = NULL;
nbre=0;
lname.Begin(" ");
//loop on branche names validity, if there is one wrong name
//the program will exit
while (!lname.End()) {
KVString stamp = lname.Next();
if ( (bb = tt->GetBranch(stamp.Data())) ){
tt->SetBranchAddress(stamp.Data(),&variable[nbre]);
nbre+=1;
ok=kTRUE;
}
}
if (!ok) return;
TEventList *el = NULL;
//loop on tree entries
for (Int_t kk=0;kk<nentries;kk+=1){
if (kk%10000==0) printf("%d evts lus\n",kk);
tt->GetEntry(kk);
evtname="";
nbre=0;
lname.Begin(" ");
//compute the name of the TEventList
//using branch name and branch value
while (!lname.End()) {
KVString stamp = lname.Next();
if ( (bb = tt->GetBranch(stamp.Data())) ){
KVString val; val.Form("%s_%d_",stamp.Data(),variable[nbre]);
evtname+=val;
nbre+=1;
}
}
if ( !(el = (TEventList *)kevtlist->FindObject(evtname.Data())) ){
printf("creation de %s \n",evtname.Data());
kevtlist->Add(new TEventList(evtname.Data()));
el = (TEventList *)kevtlist->Last();
}
el->Enter(kk);
}
//write TEventList created
if (ktag_tree){
for (Int_t nn=0;nn<kevtlist->GetEntries();nn+=1){
KVString tampname;
tampname.Form("%s_%s",GetTreeName().Data(),kevtlist->At(nn)->GetName());
((TEventList*) kevtlist->At(nn))->SetName(tampname.Data());
kevtlist->At(nn)->Write();
}
}
else {
kevtlist->Write();
}
}
else printf("%s n existe pas\n",GetTreeName().Data());
delete [] variable;
//close the file
file->Close();
}