本文整理汇总了C++中TAxis::Draw方法的典型用法代码示例。如果您正苦于以下问题:C++ TAxis::Draw方法的具体用法?C++ TAxis::Draw怎么用?C++ TAxis::Draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAxis
的用法示例。
在下文中一共展示了TAxis::Draw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startCorrelation
void startCorrelation(int run,int eventNumber){
//int entry=65000;
char runRootDirectory[FILENAME_MAX];
sprintf(runRootDirectory,"/unix/anita3/flight0809/root/");
char headName[FILENAME_MAX];
char eventName[FILENAME_MAX];
char gpsName[FILENAME_MAX];
RawAnitaEvent *evPtr = 0;
RawAnitaHeader *hdPtr = 0;
Adu5Pat *patPtr =0;
sprintf(headName,"%s/run%d/headFile%d.root",runRootDirectory,run,run);
sprintf(eventName,"%s/run%d/eventFile%d.root",runRootDirectory,run,run);
sprintf(gpsName,"%s/run%d/gpsFile%d.root",runRootDirectory,run,run);
TFile *eventFile = new TFile(eventName);
TFile *headFile = new TFile(headName);
TFile *fpGps = new TFile(gpsName);
if(!fpGps){
std::cout << "no GPS file\n";
return;
}
TTree *adu5PatTree = (TTree*) fpGps->Get("adu5PatTree");
TTree *eventTree = (TTree*)eventFile->Get("eventTree");
TTree *headTree = (TTree*)headFile->Get("headTree");
eventTree->SetBranchAddress("event",&evPtr);
headTree->SetBranchAddress("header",&hdPtr);
headTree->BuildIndex("eventNumber");
adu5PatTree->SetBranchAddress("pat",&patPtr);
adu5PatTree->BuildIndex("realTime");
int entry=headTree->GetEntryNumberWithBestIndex(eventNumber);
eventTree->GetEntry(entry);
headTree->GetEntry(entry);
/*
//for(int phi=0;phi<16;phi++){
while(hdPtr->triggerTimeNs<349.99e6 || hdPtr->triggerTimeNs>350.005e6 || hdPtr->l3TrigPattern==0){
if(lastEvent==hdPtr->eventNumber){
std::cout << "no more entries in run" << std::endl;
return;
}
std::cout << "opened entry " << entry << " (event " << hdPtr->eventNumber << ") with triggerTimeNs " << hdPtr->triggerTimeNs << std::endl;
lastEvent=hdPtr->eventNumber;
entry++;
eventTree->GetEntry(entry);
headTree->GetEntry(entry);
adu5PatTree->GetEntry(entry);
}
//}
*/
std::cout << "opened entry " << entry << " (event " << hdPtr->eventNumber << ") with triggerTimeNs " << hdPtr->triggerTimeNs << std::endl;
//get the pat ptr that corresponds to the timing of the event
Int_t patEntry;
patEntry = adu5PatTree->GetEntryNumberWithBestIndex(hdPtr->realTime);
adu5PatTree->GetEntry(patEntry);
std::cout << patPtr->realTime << " " << hdPtr->realTime << std::endl;
if(patPtr->realTime != hdPtr->realTime){
std:: cout << "pat time doesn't match head time, pat realTime: " << patPtr->realTime << " head realTime: " << hdPtr->realTime << std::endl;
//return;
}
for(int chan=0;chan<90;chan++){
if(evPtr->xMax[chan]>130 || evPtr->xMin[chan]<-130){
saturatedChannel[chan]=1;
std::cout << "saturated " << chan << std::endl;
}
else saturatedChannel[chan]=0;
}
//entry++;
TH2D *crossCorrelation = crossCorrelate(evPtr,hdPtr,patPtr);
sprintf(headName,"crossCorrCan");
TCanvas *crossCorrCan = (TCanvas*)gROOT->FindObject(headName);
if(!crossCorrCan)
crossCorrCan = new TCanvas(headName,headName,800,400);
crossCorrCan->Clear();
//sumCrossCorrs->Draw("aitoff");
crossCorrelation->Draw("colz");
TAxis *phiSectors = new TAxis(16,1,16);
phiSectors->Draw();
//std::cout << "event " << hdPtr->eventNumber << " time " <<
double theta,phi;
//.........这里部分代码省略.........