本文整理汇总了C++中TDatime::GetHour方法的典型用法代码示例。如果您正苦于以下问题:C++ TDatime::GetHour方法的具体用法?C++ TDatime::GetHour怎么用?C++ TDatime::GetHour使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDatime
的用法示例。
在下文中一共展示了TDatime::GetHour方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateTrainDir
bool CreateTrainDir(AliAnalysisAlien *plugin, const TMap &lookup){
//
// Make train data dir name and JDL, C and sh file names
//
TObjArray infos;
bool found = FindDataSample(lookup, infos);
if(!found){
printf("sample %s not found\n", g_sample.Data());
return false;
}
TString type; GetData(infos, type, 2);
// check whether the train dir is already provided or needs to be specified
if(!g_train_dir.Length()){
// Query number of train runs before
const char *gridhome = gGrid->GetHomeDirectory();
const char gridoutdir[256];
sprintf(gridoutdir, "%sAnalysis_pPb/%s", gridhome, type.Data());
TGridResult *trainruns = gGrid->Ls(gridoutdir);
int nruns = trainruns->GetEntries();
// Get Date and time
TDatime time;
g_train_dir = Form("%d_%d%02d%02d_%02d%02d", nruns, time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute());
}
plugin->SetGridWorkingDir(Form("Analysis_pPb/%s/%s", type.Data(), g_train_dir.Data()));
plugin->SetJDLName(Form("TPCTOFanalysispPb_%s_%s.jdl", type.Data(), g_train_dir.Data()));
plugin->SetExecutable(Form("TPCTOFanalysispPb_%s_%s.sh", type.Data(), g_train_dir.Data()));
plugin->SetAnalysisMacro(Form("TPCTOFanalysispPb_%s_%s.C", type.Data(), g_train_dir.Data()));
return true;
}
示例2: checkPullTree
//.........这里部分代码省略.........
UShort_t tpcSignalN = 0; // Number of clusters used for dEdx
UChar_t pidType = 0;
Int_t fMultiplicity = 0;
//Double_t phiPrime = 0;
// Only activate the branches of interest to save processing time
tree->SetBranchStatus("*", 0); // Disable all branches
tree->SetBranchStatus("pTPC", 1);
tree->SetBranchStatus("dEdx", 1);
tree->SetBranchStatus("dEdxExpected", 1);
tree->SetBranchStatus("tanTheta", 1);
tree->SetBranchStatus("tpcSignalN", 1);
tree->SetBranchStatus("pidType", 1);
//tree->SetBranchStatus("phiPrime", 1);
if (isNonPP)
tree->SetBranchStatus("fMultiplicity", 1);
tree->SetBranchAddress("dEdx", &dEdx);
tree->SetBranchAddress("dEdxExpected", &dEdxExpected);
tree->SetBranchAddress("tanTheta", &tanTheta);
tree->SetBranchAddress("tpcSignalN", &tpcSignalN);
tree->SetBranchAddress("pTPC", &pTPC);
tree->SetBranchAddress("pidType", &pidType);
//tree->SetBranchAddress("phiPrime", &phiPrime);
if (isNonPP)
tree->SetBranchAddress("fMultiplicity", &fMultiplicity);
// Output file
TDatime daTime;
TString savefileName = Form("%s%s_checkPullSigma_%04d_%02d_%02d__%02d_%02d.root", fileNameTree.ReplaceAll(".root", "").Data(),
recalculateExpecteddEdx ? "_recalcdEdx" : "",
daTime.GetYear(), daTime.GetMonth(), daTime.GetDay(), daTime.GetHour(), daTime.GetMinute());
TFile* fSave = TFile::Open(Form("%s/%s", pathTree.Data(), savefileName.Data()), "recreate");
if (!fSave) {
std::cout << "Failed to open save file \"" << Form("%s/%s", pathTree.Data(), savefileName.Data()) << "\"!" << std::endl;
return -1;
}
const Double_t pBoundLow = 0.1;
const Double_t pBoundUp = 5;
const Int_t nBins1 = TMath::Ceil(180 / downScaleFactor);
const Int_t nBins2 = TMath::Ceil(100 / downScaleFactor);
const Int_t nBins3 = TMath::Ceil(60 / downScaleFactor);
const Int_t nPbinsForMap = nBins1 + nBins2 + nBins3;
Double_t binsPforMap[nPbinsForMap + 1];
Double_t binWidth1 = (1.0 - pBoundLow) / nBins1;
Double_t binWidth2 = (2.0 - 1.0 ) / nBins2;
Double_t binWidth3 = (pBoundUp - 2.0) / nBins3;
for (Int_t i = 0; i < nBins1; i++) {
binsPforMap[i] = pBoundLow + i * binWidth1;
}
for (Int_t i = nBins1, j = 0; i < nBins1 + nBins2; i++, j++) {
binsPforMap[i] = 1.0 + j * binWidth2;
}
for (Int_t i = nBins1 + nBins2, j = 0; i < nBins1 + nBins2 + nBins3; i++, j++) {
binsPforMap[i] = 2.0 + j * binWidth3;
}
binsPforMap[nPbinsForMap] = pBoundUp;