本文整理汇总了C++中Mapper::SetEpoch方法的典型用法代码示例。如果您正苦于以下问题:C++ Mapper::SetEpoch方法的具体用法?C++ Mapper::SetEpoch怎么用?C++ Mapper::SetEpoch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mapper
的用法示例。
在下文中一共展示了Mapper::SetEpoch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: beamPosition
// inputs data file and event in file to display (default is to integrate all)
void beamPosition(TString fdat, int firstTime = 1){
gInterpreter->GenerateDictionary("std::map<std::pair<int,int>, int >","map");
if (firstTime) {
// std::cout << "doing this!" << std::endl;
gROOT->ProcessLine("#include \"include/TBEvent.h\"");
gROOT->ProcessLine("#include \"include/TBRecHit.h\"");
gROOT->ProcessLine("#include \"include/Mapper.h\"");
gROOT->ProcessLine("#include <map>");
}
gStyle->SetOptStat(0);
// TFile *f = new TFile(fdat);
// if (f->IsZombie()){
// cout << "Cannot open file: " << fdat << endl;
// return;
// }
TChain *t1041 = new TChain("t1041");
int numFiles = t1041->Add(fdat);
cout << "Files: #" << numFiles << " :: " << fdat << endl;
if (numFiles<1){
cout << "Cannot open file: " << fdat << endl;
return;
}
//---- Histograms
TH2F *hHS_Shashlik_X_HS1_SHUp = new TH2F("hHS_Shashlik_X_HS1_SHUp", "Hodoscope 1 vs Shashlik X Up", 128, -64, 64, 64, 0, 64);
TH2F *hHS_Shashlik_Y_HS1_SHUp = new TH2F("hHS_Shashlik_Y_HS1_SHUp", "Hodoscope 1 vs Shashlik Y Up", 128, -64, 64, 64, 0, 64);
TH2F *hHS_Shashlik_X_HS2_SHUp = new TH2F("hHS_Shashlik_X_HS2_SHUp", "Hodoscope 2 vs Shashlik X Up", 128, -64, 64, 64, 0, 64);
TH2F *hHS_Shashlik_Y_HS2_SHUp = new TH2F("hHS_Shashlik_Y_HS2_SHUp", "Hodoscope 2 vs Shashlik Y Up", 128, -64, 64, 64, 0, 64);
TH2F *hHS_Shashlik_X_HS1_SHDo = new TH2F("hHS_Shashlik_X_HS1_SHDo", "Hodoscope 1 vs Shashlik X Do", 128, -64, 64, 64, 0, 64);
TH2F *hHS_Shashlik_Y_HS1_SHDo = new TH2F("hHS_Shashlik_Y_HS1_SHDo", "Hodoscope 1 vs Shashlik Y Do", 128, -64, 64, 64, 0, 64);
TH2F *hHS_Shashlik_X_HS2_SHDo = new TH2F("hHS_Shashlik_X_HS2_SHDo", "Hodoscope 2 vs Shashlik X Do", 128, -64, 64, 64, 0, 64);
TH2F *hHS_Shashlik_Y_HS2_SHDo = new TH2F("hHS_Shashlik_Y_HS2_SHDo", "Hodoscope 2 vs Shashlik Y Do", 128, -64, 64, 64, 0, 64);
hHS_Shashlik_X_HS1_SHUp->GetXaxis()->SetTitle("Shashlik");
hHS_Shashlik_X_HS1_SHUp->GetYaxis()->SetTitle("Hodoscope");
hHS_Shashlik_X_HS2_SHUp->GetXaxis()->SetTitle("Shashlik");
hHS_Shashlik_X_HS2_SHUp->GetYaxis()->SetTitle("Hodoscope");
hHS_Shashlik_X_HS1_SHDo->GetXaxis()->SetTitle("Shashlik");
hHS_Shashlik_X_HS1_SHDo->GetYaxis()->SetTitle("Hodoscope");
hHS_Shashlik_X_HS2_SHDo->GetXaxis()->SetTitle("Shashlik");
hHS_Shashlik_X_HS2_SHDo->GetYaxis()->SetTitle("Hodoscope");
hHS_Shashlik_Y_HS1_SHUp->GetXaxis()->SetTitle("Shashlik");
hHS_Shashlik_Y_HS1_SHUp->GetYaxis()->SetTitle("Hodoscope");
hHS_Shashlik_Y_HS2_SHUp->GetXaxis()->SetTitle("Shashlik");
hHS_Shashlik_Y_HS2_SHUp->GetYaxis()->SetTitle("Hodoscope");
hHS_Shashlik_Y_HS1_SHDo->GetXaxis()->SetTitle("Shashlik");
hHS_Shashlik_Y_HS1_SHDo->GetYaxis()->SetTitle("Hodoscope");
hHS_Shashlik_Y_HS2_SHDo->GetXaxis()->SetTitle("Shashlik");
hHS_Shashlik_Y_HS2_SHDo->GetYaxis()->SetTitle("Hodoscope");
//---- setup histograms
//---- fill histograms
TBEvent *event = new TBEvent();
// TTree *t1041 = (TTree*) f->Get("t1041");
t1041->SetBranchAddress("tbevent",&event);
Int_t start=0; Int_t end=t1041->GetEntries();
bool haverechits=false;
std::vector<TBRecHit> *rechits=0;
if(t1041->GetListOfBranches()->FindObject("tbrechits")) {
std::cout << " found rechits " << std::endl;
t1041->SetBranchAddress("tbrechits",&rechits);
haverechits = true;
}
Mapper *mapper = Mapper::Instance();
int nEntries = 0;
for (Int_t i = start; i<end; i++) {
if ((i%20) == 0) {
std::cout << " i = " << i << " :: " << (end-start) << std::endl;
}
t1041->GetEntry(i);
if (i==0) mapper->SetEpoch(event->GetTimeStamp());
float m_u_maxADC = 0;
float m_u_maxX = -99;
float m_u_maxY = -99;
float m_d_maxADC = 0;
//.........这里部分代码省略.........