本文整理汇总了C++中TFile::Print方法的典型用法代码示例。如果您正苦于以下问题:C++ TFile::Print方法的具体用法?C++ TFile::Print怎么用?C++ TFile::Print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFile
的用法示例。
在下文中一共展示了TFile::Print方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Terminate
void mySelector::Terminate()
{
// The Terminate() function is the last function to be called during
// a query. It always runs on the client, it can be used to present
// the results graphically or save the results to file.
TString option = GetOption();
TString output = "gr_";
output += option;
output += ".root";
TFile *hfile = new TFile(output,"RECREATE","FONLL CCbar cross section");
hfile->cd();
const Int_t npoint = eventnumber;
Float_t x[npoint];
Float_t y[npoint];
Float_t ylow[npoint];
Float_t yup[npoint];
for(int i=0;i<npoint;i++)
{
x[i] = Pt[i];
y[i] = Central[i];
ylow[i] = Down[i];
yup[i] = Up[i];
}
//TGraph *grFONLLD0 = new TGraph(npoint,Pt,Central);
TDirectoryFile *ratioErr = new TDirectoryFile(option,"ratio error of scale pp500 to pp200 ");
ratioErr->SetName(option);
ratioErr->Add(hRatio);
TGraph *grFONLLRatio = new TGraph(npoint,x,y);
grFONLLRatio->SetName("grFONLLRatio");
TGraph *grFONLLRatio_u = new TGraph(npoint,x,yup);
grFONLLRatio_u->SetName("grFONLLRatio_u");
TGraph *grFONLLRatio_d = new TGraph(npoint,x,ylow);
grFONLLRatio_d->SetName("grFONLLRatio_d");
grFONLLRatio->Print();
///grFONLLRatio->Write();
ratioErr->Add(grFONLLRatio);
grFONLLRatio_u->Print();
//grFONLLRatio_u->Write();
ratioErr->Add(grFONLLRatio_u);
grFONLLRatio_d->Print();
//grFONLLRatio_d->Write();
ratioErr->Add(grFONLLRatio_d);
ratioErr->Write();
hfile->Print();
hfile->Close();
tNow.Set();
cout<<"----------End of job----------"<<endl;
tNow.Print();
}
示例2: phOpt
// ----------------------------------------------------------------------
// create PH vs VCal scans for a grid of phscale and phoffset values
void phOpt(string rootfile = "phOpt.root", string cfgdirectory = "testROC") {
ConfigParameters *configParameters = ConfigParameters::Singleton();
configParameters->setDirectory(cfgdirectory);
string cfgFile = configParameters->getDirectory() + string("/configParameters.dat");
configParameters->readConfigParameterFile(cfgFile);
PixTestParameters *ptp = new PixTestParameters(configParameters->getDirectory() + "/" + configParameters->getTestParameterFileName());
PixSetup *ap = new PixSetup("DEBUG", ptp, configParameters);
cout << "pxar: dumping results into " << rootfile << endl;
TFile *rfile = TFile::Open(rootfile.c_str(), "RECREATE");
PixTestFactory *factory = PixTestFactory::instance();
PixTest *pt = factory->createTest("DacScan", ap);
pt->setDAC("ctrlreg", 4);
pt->setParameter("PHmap", "1");
pt->setParameter("DAC", "Vcal");
pt->setParameter("DACLO", "0");
pt->setParameter("DACHI", "255");
int cycle(0);
TH1D *h1(0);
for (unsigned int io = 0; io < 26; ++io) {
for (unsigned int is = 0; is < 52; ++is) {
pt->setDAC("phoffset", io*10);
pt->setDAC("phscale", is*5);
pt->doTest();
h1 = (TH1D*)rfile->Get(Form("DacScan/ph_Vcal_c11_r20_C0_V%d", cycle));
h1->SetTitle(Form("ph_Vcal_c11_r20_C0_V%d phscale=%d phoffset=%d", cycle, is*5, io*10));
++cycle;
}
}
rfile->Print();
delete pt;
rfile->Close();
ap->killApi();
}
示例3: MergeMetHists
//.........这里部分代码省略.........
vPaths.push_back(jer10_path);
TFile *f = 0;
TH1 *hist_data = 0, *hist_bg = 0;
int iNHists = vPaths.size();
std::vector<TH1*> vHist;
for (int n= 0; n < iNHists; ++n)
{
TH1 *temp=0;
vHist.push_back(temp);
}
int NfilesOpened = 0;
//for (int i=1; i<=1; ++i)
for (int i=1; i<=Nfiles; ++i)
{
std::stringstream file;
file << filenamebase << i;
//file << "myhisto_PhoJetAna_Pyth_phojet22_1Njet15_test_040208.root";
f = new TFile (file.str().c_str());
if (f->IsZombie())
{
std::cout << "ERROR::File " << file.str() << " did not open! Exiting." << std::endl;
exit (1);
} else {
NfilesOpened++;
if (debug)
{
std::cout << "File Added::";
f->Print();
}
}
gROOT->ls();
TFolder *fold = (TFolder*) gDirectory->FindObjectAny("Ana");
assert(fold != NULL && "folder null");
TFolder *dir = (TFolder*) fold->FindObjectAny("MyJetFilter");
assert(dir != NULL && "dir null");
TFolder *dir2 = (TFolder*) dir->FindObjectAny("Hist");
assert(dir2 != NULL && "Hist null");
//TH1 *h = dynamic_cast<TH1*> (dir3->FindObjectAny(name.c_str()));
//assert (h!=NULL && "hist null");
//h->Draw();
//return;
for (unsigned int iPath = 0; iPath < vPaths.size(); ++iPath)
{
//std::cout << "iPath = " << iPath << std::endl;
TFolder *dir3 = (TFolder*) dir2->FindObjectAny(vPaths.at(iPath).c_str());
assert(dir3 != NULL && "data null");
//f->cd();
//gDirectory->pwd();
//f->cd(vPaths.at(iPath).c_str());
//gDirectory->pwd();
//if (iPath<2) f->ls();
//TH1 *hTemp = dynamic_cast<TH1*> (gDirectory->FindObjectAny(name.c_str()));
std::stringstream histpath;
histpath << vPaths.at(iPath) << name;
//TFolder *ana = (TFolder*) gDirectory->FindObjectAny("Ana");
示例4: main
int main(int argc, char ** argv) {
TStopwatch comulativeWatch;
comulativeWatch.Start(true);
readInputs(argc,argv);
cout<<"Currrent Subversion Revision: "<<SVN_REV<<endl;
cout << "starting main loop.." << endl;
RunListOK = ReadRunList();
if(!RunListOK)exit(-1);
TSystem* sys = gSystem;
std::string currentDir = sys->pwd();
for (unsigned int i = 0; i < RunParameters.size(); i++) {
cout << RunParameters[i].getRunNumber();
if (i+1 < RunParameters.size()) cout << ", ";
}
cout << " will be analysed.." << endl;
if (!RunListOK) return 0;
/**Start with Analyising, read RunParameteres of the Run and start analysis with that parameters
*/
for (unsigned int i = 0; i < RunParameters.size(); i++) {
TStopwatch runWatch;
runWatch.Start(true);
RunParameters[i].Print();
bool DO_ALIGNMENT = RunParameters[i].doAlignment();
bool DO_ALIGNMENTANALYSIS = RunParameters[i].doAlignmentAnalysis();
bool DO_TRANSPARENT_ANALYSIS = RunParameters[i].doTransparentAnalysis();
time_t rawtime;
tm *timestamp;
time (&rawtime);
timestamp = gmtime(&rawtime);
ostringstream logfilename;
logfilename << "analyse_log_" << RunParameters[i].getRunNumber() << "_" << timestamp->tm_year << "-" << timestamp->tm_mon << "-" << timestamp->tm_mday << "." << timestamp->tm_hour << "." << timestamp->tm_min << "." << timestamp->tm_sec << ".log";
//
// FILE *log;
// log = freopen(logfilename.str().c_str(), "w", stdout);
TSettings *settings = 0;
cout<<"settings"<<endl;
settings = new TSettings((TRunInfo*)&RunParameters[i]);
TResults *currentResults =new TResults(settings);
currentResults->Print();
TRawEventSaver *eventSaver;
eventSaver = new TRawEventSaver(settings);
eventSaver->saveEvents(RunParameters[i].getEvents());
delete eventSaver;
//Calculate Pedestal
sys->cd(currentDir.c_str());
TPedestalCalculation* pedestalCalculation;
pedestalCalculation = new TPedestalCalculation(settings);
pedestalCalculation->calculateSlidingPedestals(RunParameters[i].getEvents());
delete pedestalCalculation;
if(RunParameters[i].doPedestalAnalysis()){
sys->cd(currentDir.c_str());
TAnalysisOfPedestal *analysisOfPedestal;
analysisOfPedestal = new TAnalysisOfPedestal(settings);
analysisOfPedestal->setResults(currentResults);
analysisOfPedestal->doAnalysis(RunParameters[i].getEvents());
delete analysisOfPedestal;
}
THTMLGenerator *htmlGen = new THTMLGenerator(settings);
htmlGen->setFileGeneratingPath(settings->getAbsoluteOuputPath(true));
htmlGen->setMainPath("./");
htmlGen->setSubdirPath("");
htmlGen->setFileName("overview.html");
htmlGen->addSection("Pedestal","<a href=\"./pedestalAnalysis/pedestal.html\">PEDESTAL</a>");
htmlGen->addSection("Clustering","<a href=\"./clustering/clustering.html\">CLUSTERING</a>");
htmlGen->addSection("Selection","<a href=\"./selections/selection.html\">SELECTION</a>");
htmlGen->addSection("Alignment","<a href=\"./alignment/alignment.html\">ALIGNMENT</a>");
htmlGen->addSection("Landau","<a href=\"./selectionAnalysis/landaus.html\">LANDAU-DISTRIBUTIONS</a>");
htmlGen->generateHTMLFile();
delete htmlGen;
sys->cd(currentDir.c_str());
TClustering* clustering;
clustering=new TClustering(settings);//int seedDetSigma=10,int hitDetSigma=7,int seedDiaSigma=5, int hitDiaSigma=3);
clustering->ClusterEvents(RunParameters[i].getEvents());
delete clustering;
if(RunParameters[i].doClusterAnalysis()){
sys->cd(currentDir.c_str());
TAnalysisOfClustering* analysisClustering;
analysisClustering = new TAnalysisOfClustering(settings);
analysisClustering->setResults(currentResults);
analysisClustering->doAnalysis(RunParameters[i].getEvents());
delete analysisClustering;
}
sys->cd(currentDir.c_str());
TSelectionClass* selectionClass = new TSelectionClass(settings);
selectionClass->SetResults(currentResults);
//.........这里部分代码省略.........