#define scan_waveform_cxx // The class definition in scan_waveform.h has been generated automatically // by the ROOT utility TTree::MakeSelector(). This class is derived // from the ROOT class TSelector. For more information on the TSelector // framework see $ROOTSYS/README/README.SELECTOR or the ROOT User Manual. // The following methods are defined in this file: // Begin(): called every time a loop on the tree starts, // a convenient place to create your histograms. // SlaveBegin(): called after Begin(), when on PROOF called only on the // slave servers. // Process(): called for each event, in this function you decide what // to read and fill your histograms. // SlaveTerminate: called at the end of the loop on the tree, when on PROOF // called only on the slave servers. // Terminate(): called at the end of the loop on the tree, // a convenient place to draw/fit your histograms. // // To use this file, try the following session on your Tree T: // // Root > T->Process("scan_waveform.C") // Root > T->Process("scan_waveform.C","some options") // Root > T->Process("scan_waveform.C+") // #include "scan_waveform.h" #include #include void scan_waveform::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(); TCanvas *c1 = new TCanvas("c1"); c1->Draw(); } void scan_waveform::SlaveBegin(TTree * /*tree*/) { // The SlaveBegin() function is called after the Begin() function. // When running with PROOF SlaveBegin() is called on each slave server. // The tree argument is deprecated (on PROOF 0 is passed). TString option = GetOption(); } Bool_t scan_waveform::Process(Long64_t entry) { GetEntry(entry); int Nbins = waveform->size(); char title[256]; sprintf(title, "Event %d ROC:%d SLOT:%d CHAN:%d", eventnum, rocid, slot, channel); TH1D *h = new TH1D("h", title, Nbins, 0.0, (double)Nbins); for(unsigned int ibin=1; ibin<=Nbins; ibin++) h->SetBinContent(ibin, waveform->at(ibin-1)); h->GetYaxis()->SetRangeUser(0.0, 4096.0); h->Draw(); c1->Update(); cout << "Press Enter to Continue"; cin.ignore(); delete h; return kTRUE; } void scan_waveform::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. } void scan_waveform::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. }