当前位置: 首页>>代码示例>>C++>>正文


C++ TDatime::Set方法代码示例

本文整理汇总了C++中TDatime::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ TDatime::Set方法的具体用法?C++ TDatime::Set怎么用?C++ TDatime::Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TDatime的用法示例。


在下文中一共展示了TDatime::Set方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SlaveTerminate

void mySelector::SlaveTerminate()
{
   // The SlaveTerminate() function is called after all entries or objects
   // have been processed. When running with PROOF SlaveTerminate() is called
   // on each slave server.
  cout<<"-------------End of Slave Job----------------"<<endl;
  tNow.Set();tNow.Print();
  cout<<"Number of Event: "<<fNumberOfEvents<<", elapsed time: "<<tNow.Convert()-tBegin.Convert()<<"seconds,rate: "<<float(fNumberOfEvents)/(tNow.Convert()-tBegin.Convert())<<endl;
}
开发者ID:heavyflavor,项目名称:script,代码行数:9,代码来源:UseTDirectoryFile.C

示例2: xrootdTestVanderbilt

void xrootdTestVanderbilt(const int iOption=0) {

  TDatime *dateTime = new TDatime;
  int iDate = dateTime->GetDate();
  int iTime = dateTime->GetTime();
  cout << "  Begin Vanderbilt access testing " << iDate << " at " << iTime << endl;

  if(iOption == 0 || iOption == 1) {
    TFile *f = TFile::Open("root://cmsxrootd.fnal.gov//store/test/xrootd/T2_US_Vanderbilt//store/mc/SAM/GenericTTbar/GEN-SIM-RECO/CMSSW_5_3_1_START53_V5-v1/0013/CE4D66EB-5AAE-E111-96D6-003048D37524.root");
    if(f) {
      cout << "\n cmsxrootd.fnal.gov successful access to Vanderbilt" << endl;
      f->ls();
      f->Close();
    }
    else {
      cout << "\n cmsxrootd.fnal.gov unsuccessful access to Vanderbilt" << endl;
    }
    dateTime->Set();     // set to system date/time
    iDate = dateTime->GetDate();
    iTime = dateTime->GetTime();
    cout << "  Completed Vanderbilt access test from FNAL on " << iDate << " at " << iTime << endl;
  } // check on iOption = 0 or iOption = 1
  if(iOption == 0 || iOption == 2) {
    TFile *g = TFile::Open("root://cms-xrd-global.cern.ch//store/test/xrootd/T2_US_Vanderbilt//store/mc/SAM/GenericTTbar/GEN-SIM-RECO/CMSSW_5_3_1_START53_V5-v1/0013/CE4D66EB-5AAE-E111-96D6-003048D37524.root");
    if(g) {
      cout << "\n cms-xrd-global.cern.ch successful access to Vanderbilt" << endl;
      g->ls();
      g->Close();
    }
    else {
      cout << "\n cms-xrd-global.cern.ch unsuccessful access to Vanderbilt" << endl;
    }
    dateTime->Set();     // set to system date/time
    iDate = dateTime->GetDate();
    iTime = dateTime->GetTime();
    cout << "  Completed Vanderbilt access test from CERN on " << iDate << " at " << iTime << endl;
  } // check on iOption = 0 or iOption = 2
  dateTime->Set();     // set to system date/time
  cout << "\n  Completed Vanderbilt access testing " << iDate << " at " << iTime << endl;
return;
}
开发者ID:ravijanjam,项目名称:LegacyCMSSW,代码行数:41,代码来源:xrootdTestVanderbilt.C

示例3: Begin

void mySelector::Begin(TTree * /*tree*/)
{
   // The Begin() function is called at the start of the query.
   // When running with PROOF Begin() is only called on the client.
   // The tree argument is deprecated (on PROOF 0 is passed).

   TString option = GetOption();
   tBegin.Set();
   fNumberOfEvents = 0;
   cout<<"-------Begin of job-------"<<endl;
   tBegin.Print();
}
开发者ID:heavyflavor,项目名称:script,代码行数:12,代码来源:UseTDirectoryFile.C

示例4: Begin

void MySelector::Begin(TTree * /*tree*/)
{
   // The Begin() function is called at the start of the query.
   // When running with PROOF Begin() is only called on the client.
   // The tree argument is deprecated (on PROOF 0 is passed).

   TString option = GetOption();

   // some time measurement
   tBegin.Set(); printf("*==* ---------- Begin of Job ----------");
   tBegin.Print();
}
开发者ID:0x0all,项目名称:ROOT,代码行数:12,代码来源:MySelector.C

示例5: 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();
}
开发者ID:heavyflavor,项目名称:script,代码行数:50,代码来源:UseTDirectoryFile.C

示例6: SlaveTerminate

void MySelector::SlaveTerminate()
{
   // The SlaveTerminate() function is called after all entries or
   // objects have been processed. When running with PROOF
   // SlaveTerminate() is called on each slave server.

  // some statistics at end of job
  printf("\n *==* ---------- End of Slave Job ----------   ");
  tNow.Set(); tNow.Print();
  printf(
  "Number of Events: %i, elapsed time: %i sec, rate: %g evts/sec\n"
  ,fNumberOfEvents,
  tNow.Convert()-tBegin.Convert(),
   float(fNumberOfEvents)/(tNow.Convert()-tBegin.Convert()) );
}
开发者ID:0x0all,项目名称:ROOT,代码行数:15,代码来源:MySelector.C

示例7: SetDate

//_____________________________________________________________________________
void THaRunBase::SetDate( UInt_t tloc )
{
  // Set timestamp of this run to 'tloc' which is in Unix time
  // format (number of seconds since 01 Jan 1970).

#if ROOT_VERSION_CODE >= ROOT_VERSION(3,1,6)
  TDatime date( tloc );
#else
  time_t t = tloc;
  struct tm* tp = localtime(&t);
  TDatime date;
  date.Set( tp->tm_year, tp->tm_mon+1, tp->tm_mday,
	    tp->tm_hour, tp->tm_min, tp->tm_sec );
#endif
  SetDate( date );
}
开发者ID:hansenjo,项目名称:analyzer,代码行数:17,代码来源:THaRunBase.C

示例8: 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.

   // finally, store all output
   TFile hfile("MySelector_Result.root","RECREATE","MuonResults");
   fOutput->Write();

   //Example to retrieve output from output list
   h_resistance=
      dynamic_cast<TH1F *>(fOutput->FindObject("resistance"));
   TCanvas c_result("cresult","Resistance",100,100,300,300);
   h_resistance->Draw();
   c_result.SaveAs("ResistanceDistribution.png");

   tNow.Set(); printf("*==* ---------- End of Job ---------- ");
   tNow.Print();
}
开发者ID:0x0all,项目名称:ROOT,代码行数:21,代码来源:MySelector.C

示例9: LEDRef_evtdis

// main method
void LEDRef_evtdis(const int runno = 615,
		   const int gainv = 0,  /*0=low, 1=high*/
		   const int evtnum= -10,
		   int ymax=1023, // set the scale of plots
		   const int delay = 1)  // -1=no delay, wait for input, X>=0 => sleep aprox. X sec. after making plot
{
  // set ranges to plot
  const int strip_f = 0; // first
  const int strip_l = NSTRIPS - 1;
  
  const int nsamples = 65; // number of ADC time samples per channel and event
  
  const int saveplot = 0;
  const int numbering      = 1; // 0: no numbering, 1: nubering on each plot
  const int dofit = 0; // 0: no fit, 1: try to fit the spectra 
  const int debug    = 0;
  const float gammaN = 2;
  // end of setup    
  
  // Assume we are just interested in the 1st segment, _0.root below for fname*
  Char_t fname[256];
  sprintf(fname, "/local/data/Run_%09d.Seq_1A.Stream_0.root",runno);
  cout << "TOTCHAN " << TOTCHAN << endl;

  // set up a raw reader of the data
  AliRawReader *rawReader = NULL;
  rawReader = new AliRawReaderRoot(fname);
  AliCaloRawStream *in = NULL; 
  in = new AliCaloRawStream(rawReader,"EMCAL");

  // set up histograms
  TH1F *hfit[TOTCHAN];
  TF1 *f1[TOTCHAN];
  char ch_label[TOTCHAN][100];
  char buff1[100];
  char name[80];
  for(int i=0; i<TOTCHAN; i++) {
    sprintf(buff1,"hfit_%d",i);
    hfit[i] = new TH1F(buff1,"hfit", nsamples , -0.5, nsamples - 0.5);
    hfit[i]->SetDirectory(0);
    sprintf(name,"f1_%d",i);
    f1[i] = new TF1(name,fitfun,0,70,5);
    f1[i]->SetLineWidth(2);
    f1[i]->SetLineColor(2);

    //	int idx = istrip + NSTRIPS * gain; // encoding used later
    int gain = i / (NSTRIPS);
    int istrip = i % NSTRIPS;
    sprintf(ch_label[i], "Strip%02d", istrip);
  }
  
  TCanvas *cc1 = new TCanvas("cc1","3 columns of 8 strips each",600,800);
  int numcol = NSETS;
  int numrow = NSTRIPS_IN_SET;
  cc1->Divide(numcol, numrow);
  
  TText *t = new TText;
  t->SetTextSize(0.17);
  int clr[2] = {4,2}; // colors
  
  // figure out which events we should look at
  int firstevent = evtnum;
  int lastevent = evtnum;
  if (evtnum < 0) { // get a bunch of events
    firstevent = 0;
    lastevent = - evtnum;
  }
  if (evtnum == 0) { // get all events
    firstevent = 0;
    lastevent = 1000000;
  }
  
  Int_t iev =0;
  AliRawEventHeaderBase *aliHeader=NULL;    
  while ( rawReader->NextEvent() && iev < firstevent) {
    aliHeader = (AliRawEventHeaderBase*) rawReader->GetEventHeader();
    iev++;
  }
  
  // loop over selected events
  while ( rawReader->NextEvent() && iev <= lastevent) {
    aliHeader = (AliRawEventHeaderBase*) rawReader->GetEventHeader();
    int runNumber = aliHeader->Get("RunNb"); 
    
    cout << "Found run number " << runNumber << endl;
    
    // reset histograms
    for(int i=0; i<TOTCHAN; i++) {
      hfit[i]->Reset();
    }
    
    // get events (the "1" ensures that we actually select all events for now)
    if ( 1 || aliHeader->Get("Type") == AliRawEventHeaderBase::kPhysicsEvent ) {
      const UInt_t * evtId = aliHeader->GetP("Id");
      int evno_raw = (int) evtId[0];
      int timestamp = aliHeader->Get("Timestamp");
      
      cout << " evno " << evno_raw
	   << " size " << aliHeader->GetEventSize()
//.........这里部分代码省略.........
开发者ID:alisw,项目名称:AliRoot,代码行数:101,代码来源:LEDRef_evtdis.C


注:本文中的TDatime::Set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。