PedStudy.cxx File Reference

#include "PedStudy.h"
#include <BeamDataUtil/BDDevices.h>
#include <BeamDataUtil/BDSwicPeds.h>
#include <HistMan/HistMan.h>
#include <RawData/RawBeamMonBlock.h>
#include <RawData/RawBeamMonHeaderBlock.h>
#include <RawData/RawBeamSwicData.h>
#include <RawData/RawDataBlock.h>
#include <RawData/RawRecord.h>
#include <TH2I.h>
#include <TSystem.h>
#include <TFile.h>
#include <TTree.h>
#include <MessageService/MsgService.h>
#include <list>
#include <sstream>
#include <fstream>
#include <TCanvas.h>

Go to the source code of this file.

Functions

 CVSID ("$Id: PedStudy.cxx,v 1.3 2005/05/12 17:52:36 bv Exp $")
void pedviewer_updater (void *ptr)
void pedviewer_clicker (void *ptr)

Function Documentation

CVSID ( "$Id: PedStudy.  cxx,
v 1.3 2005/05/12 17:52:36 bv Exp $"   
)
void pedviewer_clicker ( void *  ptr  ) 

Definition at line 249 of file PedStudy.cxx.

References PedViewer::cur, PedViewer::cur_file_num, and PedStudy::Hists::perfile.

00250 {
00251     int event = gPad->GetEvent();
00252 
00253     if (event != 1) return;     // click
00254 
00255     // from root/tutorials/DynamicSlice
00256     TObject *select = gPad->GetSelected();
00257     if(!select) return;
00258     if (!select->InheritsFrom("TProfile")) {gPad->SetUniqueID(0); return;}
00259     gPad->GetCanvas()->FeedbackMode(kTRUE);
00260 
00261     // Get hist X coords
00262     int px = gPad->GetEventX();
00263     Float_t upx = gPad->AbsPixeltoX(px);
00264     Float_t x = gPad->PadtoX(upx);
00265 
00266     PedViewer* viewer = (PedViewer*)ptr;
00267     PedStudy::Hists& hists = viewer->cur->second;
00268 
00269     TProfile* h1 = hists.perfile[viewer->cur_file_num];
00270     int binx = h1->GetXaxis()->FindBin(x);
00271     if (!binx) return;
00272     if (binx>96) return;
00273 
00274     int channel = binx - 1;
00275 
00276     stringstream ss;
00277 
00278     ss << "E:" <<  h1->GetName()
00279        << " E:" << h1->GetTitle()
00280        << " " << channel
00281        << " " << h1->GetBinContent(binx)
00282        << ends;
00283 
00284     ofstream o("pedstudy.log",ios_base::app);
00285     o << ss.str() << endl;
00286     cerr << ss.str() << endl;
00287 }

void pedviewer_updater ( void *  ptr  ) 

Definition at line 213 of file PedStudy.cxx.

References PedStudy::Hists::all, PedViewer::cur, PedViewer::cur_file_num, PedViewer::oned, and PedStudy::Hists::perfile.

00214 {
00215     int event = gPad->GetEvent();
00216 
00217     if (event != 51) return;    // movement
00218 
00219     // from root/tutorials/DynamicSlice
00220     TObject *select = gPad->GetSelected();
00221     if(!select) return;
00222     if (!select->InheritsFrom("TH2")) {gPad->SetUniqueID(0); return;}
00223     gPad->GetCanvas()->FeedbackMode(kTRUE);
00224 
00225     // Get hist X coords
00226     int px = gPad->GetEventX();
00227     Float_t upx = gPad->AbsPixeltoX(px);
00228     Float_t x = gPad->PadtoX(upx);
00229 
00230     PedViewer* viewer = (PedViewer*)ptr;
00231     PedStudy::Hists& hists = viewer->cur->second;
00232 
00233     static int lastbinx = 0;
00234     int binx = hists.all->GetXaxis()->FindBin(x);
00235     if (!binx) return;
00236     if (binx>(int)hists.perfile.size()) return;
00237     if (binx == lastbinx) return;
00238     lastbinx = binx;
00239 
00240     viewer->cur_file_num = binx-1;
00241     TProfile* h1 = hists.perfile[binx-1];
00242     viewer->oned->cd();
00243     cerr << binx << ": " << h1->GetName() << " " << h1->GetTitle() << endl;
00244     h1->Draw();
00245     viewer->oned->Update();
00246     //viewer->colz->cd();
00247 }


Generated on 8 Jul 2019 for loon by  doxygen 1.6.1