本文整理汇总了C++中TBenchmark::Show方法的典型用法代码示例。如果您正苦于以下问题:C++ TBenchmark::Show方法的具体用法?C++ TBenchmark::Show怎么用?C++ TBenchmark::Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBenchmark
的用法示例。
在下文中一共展示了TBenchmark::Show方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RunSingleTrackEfficiencyTaskHFCJ
void RunSingleTrackEfficiencyTaskHFCJ()
{
TBenchmark fBenchMark;
fBenchMark.Start("AliCFSingleTrackEfficiencyTask");
Load();
if(fAnalysisMode=="grid"){
//gSystem->Exec(Form("alien-token-init %s",fUsername.Data()));
TGrid::Connect("alien://") ;
}
if(IsPlugin) {
AliAnalysisGrid *alienHandler = CreateAlienHandler();
if(!alienHandler) return;
}
printf("CREATE ANALYSIS MANAGER\n");
AliAnalysisManager *mgr = new AliAnalysisManager("My Manager","My Manager");
mgr->SetDebugLevel(10);
if(IsPlugin) mgr->SetGridHandler(alienHandler);
AliMCEventHandler* mcHandler = new AliMCEventHandler();
if (!readAOD) mgr->SetMCtruthEventHandler(mcHandler);
AliInputEventHandler* dataHandler;
if (readAOD) dataHandler = new AliAODInputHandler();
else dataHandler = new AliESDInputHandler();
mgr->SetInputEventHandler(dataHandler);
if (!readAOD) {
gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C");
AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kTRUE);
}
gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
AliAnalysisTaskSE *setupTask = AddTaskPIDResponse(kTRUE, kTRUE, kTRUE, 2, kFALSE, "", kTRUE, kFALSE, -1);
if(ifTaskPIDQA){
gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C");
AliAnalysisTaskPIDqa *pidQA = AddTaskPIDqa();
}
printf("Prepare to create the task\n");
gROOT->LoadMacro("./AddSingleTrackEfficiencyTaskDhCorrelations.C");
//NCharge Filterbin0 + kFAST configuration + w/o external cut file
AliCFSingleTrackEfficiencyTask *taskNchF0wFile = AddSingleTrackEfficiencyTaskDhCorrelations(kTRUE, "NchFbit0woFile", AliPID::kPion, 0, AliVEvent::kAnyINT, kFALSE, AliCFSingleTrackEfficiencyTask::kFast, AliSingleTrackEffCuts::kNoBayesianPID, "", "");
//NCharge Filterbin0 + kFAST configuration + w external cut file
AliCFSingleTrackEfficiencyTask *taskNchF0 = AddSingleTrackEfficiencyTaskDhCorrelations(kTRUE, "NchFbit0", AliPID::kPion, 0, AliVEvent::kAnyINT, kFALSE, AliCFSingleTrackEfficiencyTask::kFast, AliSingleTrackEffCuts::kNoBayesianPID, "AssocPartCuts_Std_NewPoolsAndCode_10000Tr.root", "AssociatedTrkCuts");
//Pion Filterbin0+ kFAST configuration + w external cut file
AliCFSingleTrackEfficiencyTask *taskPionF0 = AddSingleTrackEfficiencyTaskDhCorrelations(kTRUE, "PionFbit0", AliPID::kPion, 211, AliVEvent::kAnyINT, kFALSE, AliCFSingleTrackEfficiencyTask::kFast, AliSingleTrackEffCuts::kNoBayesianPID,"AssocPartCuts_Std_NewPoolsAndCode_10000Tr.root", "AssociatedTrkCuts");
//Kaons Filterbin0+ kFAST configuration + w external cut file
AliCFSingleTrackEfficiencyTask *taskKaonF0 = AddSingleTrackEfficiencyTaskDhCorrelations(kTRUE, "KaonFbit0", AliPID::kKaon, 321, AliVEvent::kAnyINT, kFALSE, AliCFSingleTrackEfficiencyTask::kFast, AliSingleTrackEffCuts::kNoBayesianPID,"AssocPartCuts_Std_NewPoolsAndCode_10000Tr.root", "AssociatedTrkCuts");
//Protons Filterbin0+ kFAST configuration + w external cut file
AliCFSingleTrackEfficiencyTask *taskProtF0 = AddSingleTrackEfficiencyTaskDhCorrelations(kTRUE, "ProtonFbit0", AliPID::kProton, 2212, AliVEvent::kAnyINT, kFALSE, AliCFSingleTrackEfficiencyTask::kFast, AliSingleTrackEffCuts::kNoBayesianPID,"AssocPartCuts_Std_NewPoolsAndCode_10000Tr.root", "AssociatedTrkCuts");
//Electron Filterbin0+ kFAST configuration + w external cut file
AliCFSingleTrackEfficiencyTask *taskElecF0 = AddSingleTrackEfficiencyTaskDhCorrelations(kTRUE, "ElectronFbit0", AliPID::kElectron,11, AliVEvent::kAnyINT, kFALSE, AliCFSingleTrackEfficiencyTask::kFast, AliSingleTrackEffCuts::kNoBayesianPID, "AssocPartCuts_Std_NewPoolsAndCode_10000Tr.root", "AssociatedTrkCuts");
// Run the analysis
TChain * analysisChain=0;
if(analysisChain) printf("CHAIN HAS %d ENTRIES\n",(Int_t)analysisChain->GetEntries());
if(!mgr->InitAnalysis()) return;
mgr->PrintStatus();
if(fAnalysisMode=="grid" && !IsPlugin) fAnalysisMode="local";
if(fAnalysisMode!="proof") {
mgr->StartAnalysis(fAnalysisMode.Data(),analysisChain,nEntries,firstentry);
}
fBenchMark.Stop("AliCFSingleTrackEfficiencyTask");
fBenchMark.Show("AliCFSingleTrackEfficiencyTask");
return;
}
示例2: ExoticEvts
//------ main -------------------------------------------------------
void ExoticEvts(TChain *ch, int iRunEvents)
{
TBenchmark timer;
timer.Start("phoana_time");
if (ch == NULL) {
std::cout << "NULL chain!" << std::endl;
assert(false);
}
if (ch->GetEntries()<1)
{
std::cout << "No entries found!" << std::endl;
return;
}
gROOT->Reset();
Stuple stuple;
ReadInAll *readIn = new ReadInAll(ch, &stuple);
readIn->CentralPhotons(1);
readIn->CentralElectrons(1);
readIn->CentralJets(1);
readIn->Met(1);
readIn->Init();
unsigned int iENTRIES = (unsigned int) ch->GetEntries();
unsigned int iEvt2Process = 0; //_____________________________________________ events to be processed
if (iRunEvents < 0 ) {
iRunEvents = iENTRIES; //______________________________________________ requested all entries
iEvt2Process = iENTRIES;
} else if (iRunEvents > 0 && iRunEvents <= iENTRIES) iEvt2Process = iRunEvents;
else iEvt2Process = iENTRIES; //______________________________________________ default
std::cout << " ==> Entries found :: " << iENTRIES << std::endl;
//do a check for the MC. this is a common mistake I make
if (stuple.evt_McFlag== 1)
{
std::cout << red << "THIS IS NOT DATA!"
<< " returning!" << clearatt << std::endl;
assert (false);
}
unsigned int iEvtProc = 0; //______________________________________________ number of events processed
unsigned int iEleEvts = 0, iPhoEvts = 0, iPhoEleEvts =0, iOther=0;
unsigned int iFirst400 =0;
std::cout << "Init done. Ready, Set , GO... " << std::endl;
timer.Start("looptimer");
int iCurrTree = -1;
unsigned iProgressBy = (unsigned) (iEvt2Process/10.);
for ( ; iEvtProc < iEvt2Process; ++iEvtProc) {
ch->GetEntry(iEvtProc);
if (iCurrTree != ch->GetTreeNumber())
{
std::cout << green << "Opening file " << ch->GetFile()->GetName() << clearatt << std::endl;
iCurrTree = ch->GetTreeNumber();
}
if (iEvtProc > 0 && (iEvtProc%iProgressBy == 0)) {
std::cout << iEvtProc << "\t events processed [" << (int)( iEvtProc/(double)iEvt2Process * 100)<< "%] ";
timer.Show("looptimer");
timer.Start("looptimer");
}
//___________________________________________________________________________ drop the first 400pb-1
if (stuple.evt_McFlag == 0) { //______________________________________________ if data
if (stuple.evt_RunNumber < 190851) {
iFirst400++;
continue;
}
}
if (ExoticEvent(stuple))
{
std::cout << " Entry # = " << iEvtProc << std::endl;
std::cout << green << " ---------- EXOTIC EVENT: Run, Event: " << stuple.evt_RunNumber
<< ", " << stuple.evt_RunNumber << " ------------------ " << std::endl;
std::cout << std::setw(8) << "npho[T/L]" << std::setw(8) << "nele[T/L]" << std::setw(6) << "Njet" << std::setw(10) << "Ht" <<std::setw(10) << "Met" << std::endl;
std::cout << std::setw(1) << stuple.pho_num << "[" << stuple.pho_Ntight << "/" << stuple.pho_num - stuple.pho_Ntight << "]"
<< std::setw(8) << stuple.ele_num << "[" << stuple.ele_Ntight << "/" << stuple.ele_num - stuple.ele_Ntight << "]"
<< std::setw(4) << stuple.jet_NJet15 << std::setw(10) << stuple.met_Ht << std::setw(10) << stuple.met_Met << std::endl;
std::cout << blue << std::setw(3) << "obj" << std::setw(3) << "ind" << std::setw(8) << "TightId" << std::setw(8) << "Et" << std::setw(10) << "eta" << std::endl;
for (unsigned int i = 0; i < stuple.pho_num; ++i)
{
std::cout << cyan << std::setw(3) << "g" <<std::setw(3) << i << std::setw(8) << stuple.pho_TightId[i] << std::setw(8) << stuple.pho_Etc[i] << std::setw(10) << stuple.pho_DetEta[i] << std::endl;
}
for (unsigned int i = 0; i < stuple.ele_num; ++i)
{
std::cout << std::setw(3) << "e" <<std::setw(3) << i << std::setw(8) << stuple.ele_TightId[i] << std::setw(8) << stuple.ele_Etc[i] << std::setw(10) << stuple.ele_DetEta[i] << std::endl;
}
for (unsigned int i = 0; i < stuple.jet_num; ++i)
{
std::cout << red << std::setw(3) << "jet" <<std::setw(3) << i << std::setw(8) << "" << std::setw(8) << stuple.jet_Pt[i] << std::setw(10) << stuple.jet_DetEta[i] << std::endl;
}
//.........这里部分代码省略.........
示例3: AliCFSingleTrackTask
//.........这里部分代码省略.........
printf("CREATE MC KINE CUTS\n");
TObjArray* mcList = new TObjArray(0) ;
mcList->AddLast(mcKineCuts);
mcList->AddLast(mcGenCuts);
printf("CREATE ACCEPTANCE CUTS\n");
TObjArray* accList = new TObjArray(0) ;
accList->AddLast(mcAccCuts);
printf("CREATE RECONSTRUCTION CUTS\n");
TObjArray* recList = new TObjArray(0) ;
recList->AddLast(recKineCuts);
recList->AddLast(recQualityCuts);
recList->AddLast(recIsPrimaryCuts);
printf("CREATE PID CUTS\n");
TObjArray* fPIDCutList = new TObjArray(0) ;
fPIDCutList->AddLast(cutPID);
//CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK
printf("CREATE INTERFACE AND CUTS\n");
AliCFManager* man = new AliCFManager() ;
man->SetNStepEvent(1);
man->SetEventCutsList(0,evtList);
man->SetParticleContainer(container);
man->SetParticleCutsList(0,mcList);
man->SetParticleCutsList(1,accList);
man->SetParticleCutsList(2,recList);
man->SetParticleCutsList(3,fPIDCutList);
//CREATE THE TASK
printf("CREATE TASK\n");
// create the task
AliCFSingleTrackTask *task = new AliCFSingleTrackTask("AliSingleTrackTask");
task->SetCFManager(man); //here is set the CF manager
task->SetQAList(qaList);
if (readAOD) task->SetReadAODData() ;
if (readTPCTracks) task->SetReadTPCTracks();
//SETUP THE ANALYSIS MANAGER TO READ INPUT CHAIN AND WRITE DESIRED OUTPUTS
printf("CREATE ANALYSIS MANAGER\n");
// Make the analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
if (useGrid) mgr->SetAnalysisType(AliAnalysisManager::kGridAnalysis);
else mgr->SetAnalysisType(AliAnalysisManager::kLocalAnalysis);
AliMCEventHandler* mcHandler = new AliMCEventHandler();
mgr->SetMCtruthEventHandler(mcHandler);
AliInputEventHandler* dataHandler ;
if (readAOD) dataHandler = new AliAODInputHandler();
else dataHandler = new AliESDInputHandler();
mgr->SetInputEventHandler(dataHandler);
// Create and connect containers for input/output
//------ input data ------
AliAnalysisDataContainer *cinput0 = mgr->CreateContainer("cchain0",TChain::Class(),AliAnalysisManager::kInputContainer);
// ----- output data -----
//slot 0 : default output tree (by default handled by AliAnalysisTaskSE)
AliAnalysisDataContainer *coutput0 = mgr->CreateContainer("ctree0", TTree::Class(),AliAnalysisManager::kOutputContainer,"output.root");
//now comes user's output objects :
// output TH1I for event counting
AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist0", TH1I::Class(),AliAnalysisManager::kOutputContainer,"output.root");
// output Correction Framework Container (for acceptance & efficiency calculations)
AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("ccontainer0", AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,"output.root");
// output QA histograms
AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("clist0", TList::Class(),AliAnalysisManager::kOutputContainer,"output.root");
cinput0->SetData(analysisChain);
mgr->AddTask(task);
mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
mgr->ConnectOutput(task,0,coutput0);
mgr->ConnectOutput(task,1,coutput1);
mgr->ConnectOutput(task,2,coutput2);
mgr->ConnectOutput(task,3,coutput3);
printf("READY TO RUN\n");
//RUN !!!
if (mgr->InitAnalysis()) {
mgr->PrintStatus();
mgr->StartAnalysis("local",analysisChain);
}
benchmark.Stop("AliSingleTrackTask");
benchmark.Show("AliSingleTrackTask");
return kTRUE ;
}