本文整理汇总了C++中Mapper::FiberXY方法的典型用法代码示例。如果您正苦于以下问题:C++ Mapper::FiberXY方法的具体用法?C++ Mapper::FiberXY怎么用?C++ Mapper::FiberXY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mapper
的用法示例。
在下文中一共展示了Mapper::FiberXY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dqmDisplay
// inputs data file and event in file to display (default is to integrate all)
void dqmDisplay(TString fdat, int ndisplay = -1){
gStyle->SetOptStat(0);
TFile *f = new TFile(fdat);
if (f->IsZombie()){
cout << "Cannot open file: " << fdat << endl;
return;
}
TBEvent *event = new TBEvent();
TTree *t1041 = (TTree*)f->Get("t1041");
TBranch *bevent = t1041->GetBranch("tbevent");
bevent->SetAddress(&event);
Bool_t singleEvent = (ndisplay >= 0);
Mapper * mapper = Mapper::Instance();
TH2F * hModU = (TH2F*)moduleHistogram(true, "RO", threshold, 2500, singleEvent);
TH2F * hModD = (TH2F*)moduleHistogram(false, "RO", threshold, 2500, singleEvent);
TH2F * hChanU = (TH2F*)channelHistogram(true, "RO", threshold, 2500, singleEvent);
TH2F * hChanD = (TH2F*)channelHistogram(false, "RO", threshold, 2500, singleEvent);
TH2F * hModU_time = (TH2F*)moduleHistogram(true, "Timing", 0, -1, singleEvent);
TH2F * hModD_time = (TH2F*)moduleHistogram(false, "Timing", 0, -1, singleEvent);
TH2F * hChanU_time = (TH2F*)channelHistogram(true, "Timing", 0, -1, singleEvent);
TH2F * hChanD_time = (TH2F*)channelHistogram(false, "Timing", 0, -1, singleEvent);
int nPerMod = t1041->GetEntries() / 16;
int nPerFiber = t1041->GetEntries() / 64;
TH2F * hModU_nhits = (TH2F*)moduleHistogram(true, "nHits", nPerMod * .85, nPerMod * 1.1, singleEvent);
TH2F * hModD_nhits = (TH2F*)moduleHistogram(false, "nHits", nPerMod * .85, nPerMod * 1.1, singleEvent);
TH2F * hChanU_nhits = (TH2F*)channelHistogram(true, "nHits", nPerFiber * .25, nPerFiber * 1.1, singleEvent);
TH2F * hChanD_nhits = (TH2F*)channelHistogram(false, "nHits", nPerFiber * .25, nPerFiber * 1.1, singleEvent);
TH2F * hModU_ntriggers = (TH2F*)moduleHistogram(true, "nTriggers", nPerMod * .95, nPerMod * 1.3, singleEvent);
TH2F * hModD_ntriggers = (TH2F*)moduleHistogram(false, "nTriggers", nPerMod * .95, nPerMod * 1.3, singleEvent);
TH2F * hChanU_ntriggers = (TH2F*)channelHistogram(true, "nTriggers", nPerFiber * .95, nPerFiber * 1.3, singleEvent);
TH2F * hChanD_ntriggers = (TH2F*)channelHistogram(false, "nTriggers", nPerFiber * .95, nPerFiber * 1.3, singleEvent);
Int_t start = 0;
Int_t end = t1041->GetEntries();
if (singleEvent) {
start = ndisplay;
end = ndisplay + 1;
}
for (Int_t i=start; i < end; i++) {
t1041->GetEntry(i);
for (Int_t j = 0; j < event->NPadeChan(); j++){
PadeChannel pch = event->GetPadeChan(j);
UShort_t max = pch.GetMax();
Int_t maxTime = pch.GetPeak();
if (max>MAXADC) continue; // skip channels with bad adc readings (should be RARE)
int channelID=pch.GetChannelID(); // boardID*100+channelNum in PADE
int moduleID,fiberID;
mapper->ChannelID2ModuleFiber(channelID,moduleID,fiberID); // get module and fiber IDs
float xm,ym,xf,yf;
mapper->ModuleXY(moduleID,xm,ym);
mapper->FiberXY(fiberID, xf, yf);
if(moduleID < 0) {
hModU_ntriggers->Fill(xm, ym);
hChanU_ntriggers->Fill(xf, yf);
}
else {
hModD_ntriggers->Fill(xm, ym);
hChanD_ntriggers->Fill(xf, yf);
}
if(max <= threshold) continue;
if (moduleID < 0) {
hModU->Fill(xm, ym, max);
hModU_time->Fill(xm, ym, maxTime);
hModU_nhits->Fill(xm, ym);
hChanU->Fill(xf, yf, max);
hChanU_time->Fill(xf, yf, maxTime);
hChanU_nhits->Fill(xf, yf);
}
else {
hModD->Fill(xm, ym, max);
hModD_time->Fill(xm, ym, maxTime);
hModD_nhits->Fill(xm, ym);
hChanD->Fill(xf, yf, max);
hChanD_time->Fill(xf, yf, maxTime);
hChanD_nhits->Fill(xf, yf);
}
}
//.........这里部分代码省略.........
示例2: beamPosition
//.........这里部分代码省略.........
channelID=hit.GetChannelID();
}
else{
PadeChannel pch = event->GetPadeChan(j);
pch.GetPedestal(ped,sig);
max = pch.GetMax()-ped;
maxTime = pch.GetPeak();
channelID=pch.GetChannelID(); // boardID*100+channelNum in PADE
}
if (max<0.1) continue;
int moduleID,fiberID;
mapper->ChannelID2ModuleFiber(channelID,moduleID,fiberID); // get module and fiber IDs
double x,y;
mapper->ModuleXY(moduleID,x,y);
if (moduleID<0) {
if(max > m_u_maxADC){
m_u_maxADC = max;
m_u_maxX = x;
m_u_maxY = y;
}
}
else {
if(max > m_d_maxADC){
m_d_maxADC = max;
m_d_maxX = x;
m_d_maxY = y;
}
}
mapper->FiberXY(fiberID, x, y);
if (moduleID<0) {
if(max > c_u_maxADC){
c_u_maxADC = max;
c_u_maxX = x;
c_u_maxY = y;
}
}
else {
if(max > c_d_maxADC){
c_d_maxADC = max;
c_d_maxX = x;
c_d_maxY = y;
}
}
}
Hodoscope hsch = event->GetHSChan();
std::map<std::pair<int,int>, int > fibers = hsch.GetFibers();
// typedef std::map<std::pair<int,int>, int >::iterator it_type;
std::pair<int,int> fibers_mappairY1;
fibers_mappairY1.first = hodoY1;
std::pair<int,int> fibers_mappairY2;
fibers_mappairY2.first = hodoY2;
for(int iBinY=0;iBinY<64;iBinY++){
fibers_mappairY1.second = iBinY;
fibers_mappairY2.second = iBinY;