#include <PlotMan.h>
Public Member Functions | |
| PlotMan (bool interactive=false) | |
| ~PlotMan () | |
| void | AddCamAna (CamAna *camana, bool dohist=true, bool docanv=true) |
| CamAna * | GetCamAna (std::string caname) |
| CamAna * | GetCamAna (unsigned int canum) |
| void | AllFiltersOn (bool filt) |
| void | FilterOn (bool filt, std::string caname) |
| void | FilterOn (bool filt, unsigned int canum) |
| void | FOn (unsigned int canum, bool on=true) |
| void | FOn (std::string caname, bool on=true) |
| void | FOff (unsigned int canum) |
| void | AllFiltersRev (bool filt) |
| void | FilterRev (bool filt, std::string caname) |
| void | FilterRev (bool filt, unsigned int canum) |
| void | AddFile (std::string fname) |
| void | AddFileChecked (std::string fname) |
| void | AddList (std::string lname) |
| void | AddDirectory (std::string dname) |
| void | FileSuffix (std::string fsuf) |
| std::string | FileSuffix () |
| void | BuildChain (bool checked=false) |
| void | ChainReport () |
| void | ReadNEntries (bool b) |
| bool | ReadNEntries () |
| void | SetBranchStatus (const char *branch, int status) |
| void | UpdateCanvases (TFolder *tfol=0) |
| void | WriteOut (std::string fn="PlotMan.root") |
| void | CloseWindow () |
| void | SpinChain (int nevents=0) |
| void | StopSpinning () |
| void | DoFinish (bool dofinish=true) |
| void | FinishSpin () |
| void | SetEntries (int entries) |
| void | SetUpdateInterval (int interval) |
| void | SetUpdateFraction (int frac) |
| void | SetUpdateSleep (int sleep) |
| void | ManUpdateSleep () |
| void | Next () |
| void | Prev () |
| void | ReDraw () |
| void | StepEvent (int nevents=1) |
| void | StepPassEvent (int nevents=1) |
| void | JumpToEvent (int event) |
| void | JumpToRun (int run) |
| void | ManRunJump () |
| void | JumpToSnarl (int snarl) |
| void | ManSnarlJump () |
| void | Reset () |
| void | SetLoud (int loud=0, std::string lstream="PlotMan") |
| int | GetLoud (std::string lstream="PlotMan") |
Private Member Functions | |
| void | ControlWindow (const TGWindow *p=0, UInt_t w=100, UInt_t h=100) |
| bool | FillCamEvent (const AtmosEvent *event) |
Private Attributes | |
| std::vector< std::string > | fRootFiles |
| std::string | fRootFilesSuf |
| bool | fChainBuilt |
| bool | fChainCurrent |
| std::vector< CamAna * > | fCamAnas |
| std::vector< int > | fEventsRun |
| std::vector< int > | fEventsPassed |
| std::vector< bool > | fFilterOn |
| std::vector< bool > | fFilterRev |
| int | fEvent |
| int | fEntries |
| bool | fReadNEntries |
| bool | fStopSpinning |
| bool | fSpinning |
| int | fUpdateInterval |
| int | fUpdateFraction |
| int | fUpdateSleep |
| bool | fDoFinish |
| TGMainFrame * | cgMain |
| TGHProgressBar * | fProgress |
| TGNumberEntry * | cgRun |
| TGNumberEntry * | cgSubRun |
| TGNumberEntry * | cgSnarl |
| TGNumberEntry * | cgSleep |
|
|
Definition at line 33 of file PlotMan.cxx. References cgMain, cgSleep, ControlWindow(), fChain, fChainBuilt, fChainCurrent, fDoFinish, fEntries, fEvent, fProgress, fReadNEntries, fRootFilesSuf, fSpinning, fStopSpinning, fUpdateFraction, fUpdateInterval, and fUpdateSleep. 00034 {
00035 fSpinning = false;
00036 fStopSpinning = false;
00037 fDoFinish = true;
00038 fChain = new TChain("ntp");
00039 fRootFilesSuf = ".root";
00040 fChainBuilt = false;
00041 fChainCurrent = false;
00042
00043 fEvent = -1;
00044 fEntries = 0;
00045 fReadNEntries = false;
00046 fUpdateInterval = 0;
00047 fUpdateFraction = 0;
00048 fUpdateSleep = 0;
00049
00050 fProgress = 0;
00051 cgSleep = 0;
00052 cgMain = 0;
00053
00054 if(interactive && gApplication) this->ControlWindow(0,1,1);
00055 }
|
|
|
Definition at line 57 of file PlotMan.cxx. 00058 {
00059 }
|
|
||||||||||||||||
|
Definition at line 61 of file PlotMan.cxx. References cgMain, fCamAnas, fEventsPassed, fEventsRun, fFilterOn, fFilterRev, Form(), CamAna::MakeCanvases(), CamAna::MakeHistos(), and MSG. 00062 {
00063 MSG("PlotMan", Msg::kSynopsis) << "Adding CamAna: " << camana->GetName()
00064 << endl;
00065 fCamAnas.push_back(camana);
00066 if(dohist) camana->MakeHistos();
00067 if(docanv) camana->MakeCanvases();
00068
00069 fEventsRun.push_back(0);
00070 fEventsPassed.push_back(0);
00071 fFilterOn.push_back(false);
00072 fFilterRev.push_back(false);
00073
00074 if (cgMain) {
00075 MSG("PlotMan",Msg::kSynopsis) << " CamAna filters" << endl;
00076 TGCompositeFrame *cgH1 = new TGHorizontalFrame(cgMain);
00077
00078 TGLabel *cgLabel = new TGLabel(cgH1,
00079 Form("%d)%s",fCamAnas.size()-1,camana->GetName()));
00080 cgH1->AddFrame(cgLabel, new TGLayoutHints(kLHintsLeft));
00081
00082 TGCheckButton *cgCheck = new TGCheckButton(cgH1, "Filt", 2);
00083 cgCheck->Connect("Pressed()", "PlotMan", this,
00084 Form("FilterOn(=true, %d)",fCamAnas.size()-1));
00085 cgCheck->Connect("Released()", "PlotMan", this,
00086 Form("FilterOn(=false, %d)",fCamAnas.size()-1));
00087 cgH1->AddFrame(cgCheck, new TGLayoutHints(kLHintsRight));
00088
00089 MSG("PlotMan",Msg::kSynopsis) << " CamAna filters" << endl;
00090 cgCheck = new TGCheckButton(cgH1, "Rev", 2);
00091 cgCheck->Connect("Pressed()", "PlotMan", this,
00092 Form("FilterRev(=true, %d)",fCamAnas.size()-1));
00093 cgCheck->Connect("Released()", "PlotMan", this,
00094 Form("FilterRev(=false, %d)",fCamAnas.size()-1));
00095 cgH1->AddFrame(cgCheck, new TGLayoutHints(kLHintsRight));
00096
00097 cgMain->AddFrame(cgH1, new TGLayoutHints(kLHintsExpandX));
00098
00099 cgMain->Resize();
00100 cgMain->MapSubwindows();
00101 cgMain->Layout();
00102 cgMain->MapWindow();
00103 }
00104 }
|
|
|
Definition at line 225 of file PlotMan.cxx. References UtilFile::DirFileList(), fChainCurrent, fRootFiles, fRootFilesSuf, and MSG. 00226 {
00227 fRootFiles =
00228 UtilFile::DirFileList(dname,fRootFilesSuf,true,true,fRootFiles);
00229 fChainCurrent = false;
00230 MSG("PlotMan",Msg::kSynopsis) << "Added file directory: " << dname << endl;
00231 }
|
|
|
Definition at line 167 of file PlotMan.cxx. References UtilFile::CheckFile(), fChainCurrent, fRootFiles, and MSG. 00167 {
00168 if (! UtilFile::CheckFile(fname) ) {
00169 MSG("PlotMan",Msg::kWarning)<< "No such file " << fname << endl;
00170 return;
00171 }
00172 fRootFiles.push_back(fname);
00173 fChainCurrent = false;
00174 MSG("PlotMan",Msg::kSynopsis) << "Added file: " << fname << endl;
00175 }
|
|
|
Definition at line 177 of file PlotMan.cxx. References fChain, fEntries, fProgress, and MSG. Referenced by BuildChain(). 00177 {
00178 int nentries = 0;
00179 TFile *tf = TFile::Open(fname.c_str());
00180 if (!tf) {
00181 MSG("PlotMan",Msg::kError) << "zero TFile" << endl;
00182 return;
00183 }
00184 if (tf->IsZombie()) {
00185 MSG("PlotMan",Msg::kError) << "zombie TFile" << endl;
00186 return;
00187 }
00188 TObject *obj = tf->Get("ntp");
00189 if (!obj) {
00190 MSG("PlotMan",Msg::kError) << "zero TObject ntp" << endl;
00191 return;
00192 }
00193
00194 //TChain in file
00195 if (obj->InheritsFrom("TChain")) {
00196 nentries = (dynamic_cast<TChain*>(obj))->GetEntries();
00197 fChain->Add(dynamic_cast<TChain*>(obj));
00198 }
00199 //TTree in file
00200 else if (obj->InheritsFrom("TTree")) {
00201 nentries = (dynamic_cast<TTree*>(obj))->GetEntries();
00202 //Include the 0 to read header from file and get nentries
00203 fChain->Add(fname.c_str(),0);
00204 }
00205 else {
00206 MSG("PlotMan",Msg::kError) << "TObject not a TChain or TTree" << endl;
00207 return;
00208 }
00209 MSG("PlotMan",Msg::kSynopsis) << "Added file " << fname << " with "
00210 << nentries << " entries" << endl;
00211 tf->Close();
00212 fEntries += nentries;
00213 if(fProgress) fProgress->SetRange(0,fEntries);
00214 }
|
|
|
Definition at line 216 of file PlotMan.cxx. References fChainCurrent, UtilFile::FileFileList(), fRootFiles, fRootFilesSuf, and MSG. 00217 {
00218 fRootFiles = UtilFile::FileFileList(lname, fRootFilesSuf,
00219 true, true, fRootFiles);
00220 fChainCurrent = false;
00221 MSG("PlotMan",Msg::kSynopsis) << "Added file list: " << lname << " nfiles = "
00222 << fRootFiles.size() << endl;
00223 }
|
|
|
Definition at line 118 of file PlotMan.cxx. References fFilterOn.
|
|
|
Definition at line 142 of file PlotMan.cxx. References fFilterRev. 00142 {
00143 for(unsigned int i=0;i<fFilterRev.size();i++) fFilterRev[i] = filt;
00144 }
|
|
|
Definition at line 234 of file PlotMan.cxx. References AddFileChecked(), fChain, fChainBuilt, fEntries, fRootFiles, MSG, and SetEntries(). Referenced by JumpToEvent(), JumpToRun(), JumpToSnarl(), SpinChain(), StepEvent(), and StepPassEvent(). 00234 {
00235 MSG("PlotMan",Msg::kSynopsis) << "Building chain for " << fRootFiles.size()
00236 << " files";
00237 if(checked) MSG("PlotMan",Msg::kSynopsis) << " with checking";
00238 MSG("PlotMan",Msg::kSynopsis) << endl;
00239
00240 sort(fRootFiles.begin(),fRootFiles.end());
00241 VS::iterator nend = unique(fRootFiles.begin(),fRootFiles.end());
00242 if (nend != fRootFiles.end()) {
00243 MSG("PlotMan",Msg::kWarning) << "Redundant items in the list of root files:"
00244 << endl;
00245
00246 //This doesn't exactly work, whatever
00247 for(VS::iterator i=nend;i!=fRootFiles.end();i++)
00248 MSG("PlotMan",Msg::kWarning)<< " " << i->c_str() << endl;
00249 }
00250 for (VS::iterator i=fRootFiles.begin();i!=nend;i++) {
00251 if(checked) AddFileChecked(*i);
00252 else fChain->Add(i->c_str());
00253 MSG("PlotMan",Msg::kVerbose) << "Added file " << *i << endl;
00254 }
00255 if(fReadNEntries) SetEntries(fChain->GetEntries());
00256 fChainBuilt = true;
00257 MSG("PlotMan",Msg::kSynopsis) << "Built chain with " << fEntries << " entries"
00258 << endl;
00259 }
|
|
|
Definition at line 262 of file PlotMan.cxx. 00262 {
00263 MSG("PlotMan",Msg::kSynopsis) << "Chain has NTrees = " << fChain->GetNtrees()
00264 << endl;
00265 }
|
|
|
Definition at line 834 of file PlotMan.cxx. References MSG. 00834 {
00835 if (fSpinning) {
00836 MSG("PlotMan",Msg::kInfo) << "Can't close window while spinning Chain" << endl;
00837 return;
00838 }
00839 if(gApplication) gApplication->Terminate();
00840 }
|
|
||||||||||||||||
|
Definition at line 732 of file PlotMan.cxx. References cgMain, cgRun, cgSleep, cgSnarl, cgSubRun, and fProgress. Referenced by PlotMan(). 00733 {
00734 TGLayoutHints *cgLayout =
00735 new TGLayoutHints(kLHintsExpandX | kLHintsExpandY);
00736
00737 TGCompositeFrame *cgH1 = 0;
00738 TGLabel *cgLabel = 0;
00739
00740 cgMain = new TGMainFrame(p, w, h);
00741 cgMain->SetCleanup(kDeepCleanup);
00742 cgMain->Connect("CloseWindow()","PlotMan",this,"CloseWindow()");
00743
00744 TGTextButton *cgStart = new TGTextButton(cgMain, "Start", 1);
00745 cgStart->Connect("Clicked()","PlotMan",this,"SpinChain()");
00746 cgMain->AddFrame(cgStart, cgLayout);
00747
00748 TGTextButton *cgStop = new TGTextButton(cgMain, "&Stop", 2);
00749 cgStop->Connect("Clicked()","PlotMan",this,"StopSpinning()");
00750 cgMain->AddFrame(cgStop, cgLayout);
00751
00752 cgH1 = new TGHorizontalFrame(cgMain);
00753
00754 cgLabel = new TGLabel(cgH1,"Sleep(ms):");
00755 cgH1->AddFrame(cgLabel, new TGLayoutHints(kLHintsLeft | kLHintsExpandY));
00756
00757 cgSleep = new TGNumberEntry(cgH1, 0, 5, -1);
00758 cgSleep->Connect("ValueSet(Long_t)", "PlotMan", this, "ManUpdateSleep()");
00759 cgH1->AddFrame(cgSleep, cgLayout);
00760
00761 cgMain->AddFrame(cgH1, cgLayout);
00762
00763 TGTextButton *cgNextPass = new TGTextButton(cgMain, "&NextPass", 3);
00764 cgNextPass->Connect("Clicked()","PlotMan",this,"StepPassEvent(=1)");
00765 cgMain->AddFrame(cgNextPass, cgLayout);
00766
00767 TGTextButton *cgPrevPass = new TGTextButton(cgMain, "&PrevPass", 3);
00768 cgPrevPass->Connect("Clicked()","PlotMan",this,"StepPassEvent(=-1)");
00769 cgMain->AddFrame(cgPrevPass, cgLayout);
00770
00771 TGTextButton *cgNext = new TGTextButton(cgMain, "&Next", 3);
00772 cgNext->Connect("Clicked()","PlotMan",this,"Next()");
00773 cgMain->AddFrame(cgNext, cgLayout);
00774
00775 TGTextButton *cgPrev = new TGTextButton(cgMain, "&Prev", 4);
00776 cgPrev->Connect("Clicked()","PlotMan",this,"Prev()");
00777 cgMain->AddFrame(cgPrev, cgLayout);
00778
00779 //Run Number Entry
00780 cgH1 = new TGHorizontalFrame(cgMain);
00781 cgLabel = new TGLabel(cgH1, "Run:");
00782 cgH1->AddFrame(cgLabel, new TGLayoutHints(kLHintsLeft | kLHintsExpandY));
00783 cgRun = new TGNumberEntry(cgH1, 0, 5, -1);
00784 cgRun->Connect("ValueSet(Long_t)", "PlotMan", this, "ManRunJump()");
00785 cgH1->AddFrame(cgRun, cgLayout);
00786 cgMain->AddFrame(cgH1, cgLayout);
00787
00788 //SubRun Number Entry
00789 cgH1 = new TGHorizontalFrame(cgMain);
00790 cgLabel = new TGLabel(cgH1, "SubRun:");
00791 cgH1->AddFrame(cgLabel, new TGLayoutHints(kLHintsLeft | kLHintsExpandY));
00792 cgSubRun = new TGNumberEntry(cgH1, 0, 5, -1);
00793 cgSubRun->Connect("ValueSet(Long_t)", "PlotMan", this, "ManRunJump()");
00794 cgH1->AddFrame(cgSubRun, cgLayout);
00795 cgMain->AddFrame(cgH1, cgLayout);
00796
00797 //Snarl Number Entry
00798 cgH1 = new TGHorizontalFrame(cgMain);
00799 cgLabel = new TGLabel(cgH1, "Snarl:");
00800 cgH1->AddFrame(cgLabel, new TGLayoutHints(kLHintsLeft | kLHintsExpandY));
00801 cgSnarl = new TGNumberEntry(cgH1, 0, 5, -1);
00802 cgSnarl->Connect("ValueSet(Long_t)", "PlotMan", this, "ManSnarlJump()");
00803 cgH1->AddFrame(cgSnarl, cgLayout);
00804 cgMain->AddFrame(cgH1, cgLayout);
00805
00806 TGTextButton *tgReDraw = new TGTextButton(cgMain, "&ReDraw", 4);
00807 tgReDraw->Connect("Clicked()","PlotMan",this,"ReDraw()");
00808 cgMain->AddFrame(tgReDraw, cgLayout);
00809
00810 TGTextButton *cgReset = new TGTextButton(cgMain, "&Reset", 5);
00811 cgReset->Connect("Clicked()","PlotMan",this,"Reset()");
00812 cgMain->AddFrame(cgReset, cgLayout);
00813
00814 TGTextButton *cgQuit = new TGTextButton(cgMain, "&Quit", 6);
00815 cgQuit->Connect("Clicked()","PlotMan",this,"CloseWindow()" );
00816 cgMain->AddFrame(cgQuit, cgLayout);
00817
00818 fProgress = new TGHProgressBar(cgMain,100);
00819 fProgress->SetBarColor("lightgreen");
00820 fProgress->ShowPosition();
00821 cgMain->AddFrame(fProgress, cgLayout);
00822
00823 cgMain->MapSubwindows();
00824 cgMain->Resize();
00825
00826 cgMain->Layout();
00827
00828 cgMain->SetWindowName("Ntp Control Window");
00829 cgMain->SetIconName("Ntp Control Window");
00830
00831 cgMain->MapWindow();
00832 }
|
|
|
Definition at line 67 of file PlotMan.h. 00067 {fDoFinish=dofinish;}
|
|
|
Definition at line 55 of file PlotMan.h. 00055 {return fRootFilesSuf;}
|
|
|
Definition at line 54 of file PlotMan.h. 00054 {fRootFilesSuf = fsuf;}
|
|
|
Definition at line 593 of file PlotMan.cxx. References fCamAnas, fEventsPassed, fEventsRun, fFilterOn, fFilterRev, CamAna::FillEvent(), and MSG. Referenced by JumpToEvent(), JumpToRun(), JumpToSnarl(), SpinChain(), StepEvent(), and StepPassEvent(). 00593 {
00594 if (!event) {
00595 MSG("PlotMan",Msg::kWarning) << "FillCamEvent has empty AtmosEvent" << endl;
00596 return false;
00597 }
00598
00599 bool RetStatus = true;
00600 bool FillStatus = true;
00601 for (unsigned int i=0;i<fCamAnas.size();i++) {
00602 RetStatus = false;
00603 fEventsRun[i]++;
00604 FillStatus = fCamAnas[i]->FillEvent(event);
00605 if(!(FillStatus^fFilterRev[i]) && fFilterOn[i]) break;
00606 fEventsPassed[i]++;
00607 RetStatus = true;
00608 }
00609 return RetStatus;
00610 }
|
|
||||||||||||
|
Definition at line 133 of file PlotMan.cxx. References fCamAnas, fFilterOn, and MSG. 00133 {
00134 if (canum<fFilterOn.size()) {
00135 fFilterOn[canum] = filt;
00136 MSG("PlotMan",Msg::kSynopsis) << "Turning the filter for " << fCamAnas[canum]->GetName();
00137 if(filt) MSG("PlotMan",Msg::kSynopsis) << " on" << endl;
00138 else MSG("PlotMan",Msg::kSynopsis) << " off" << endl;
00139 }
00140 }
|
|
||||||||||||
|
Definition at line 122 of file PlotMan.cxx. References fCamAnas, fFilterOn, and MSG. 00122 {
00123 for (unsigned int i=0;i<fCamAnas.size();i++) {
00124 if (caname == fCamAnas[i]->GetName()) {
00125 fFilterOn[i] = filt;
00126 MSG("PlotMan",Msg::kSynopsis) << "Turning the filter for " << caname;
00127 if(filt) MSG("PlotMan",Msg::kSynopsis) << " on" << endl;
00128 else MSG("PlotMan",Msg::kSynopsis) << " off" << endl;
00129 }
00130 }
00131 }
|
|
||||||||||||
|
Definition at line 157 of file PlotMan.cxx. References fCamAnas, fFilterRev, and MSG. 00157 {
00158 if(canum<fFilterRev.size()) {
00159 fFilterRev[canum] = filt;
00160 MSG("PlotMan",Msg::kSynopsis) << "Turning the filter for "
00161 << fCamAnas[canum]->GetName();
00162 if(filt) MSG("PlotMan",Msg::kSynopsis) << " on" << endl;
00163 else MSG("PlotMan",Msg::kSynopsis) << " off" << endl;
00164 }
00165 }
|
|
||||||||||||
|
Definition at line 146 of file PlotMan.cxx. References fCamAnas, fFilterRev, and MSG. 00146 {
00147 for (unsigned int i=0;i<fCamAnas.size();i++) {
00148 if(caname == fCamAnas[i]->GetName()) {
00149 fFilterRev[i] = filt;
00150 MSG("PlotMan",Msg::kSynopsis) << "Reverse the filter for " << caname;
00151 if(filt) MSG("PlotMan",Msg::kSynopsis) << " on" << endl;
00152 else MSG("PlotMan",Msg::kSynopsis) << " off" << endl;
00153 }
00154 }
00155 }
|
|
|
Definition at line 612 of file PlotMan.cxx. References fCamAnas, and CamAna::Finish(). Referenced by SpinChain().
|
|
|
Definition at line 43 of file PlotMan.h. 00043 {FilterOn(false, canum);}
|
|
||||||||||||
|
Definition at line 42 of file PlotMan.h. 00042 {FilterOn(on, caname);}
|
|
||||||||||||
|
Definition at line 41 of file PlotMan.h. 00041 {FilterOn(on, canum);}
|
|
|
Definition at line 113 of file PlotMan.cxx. References fCamAnas.
|
|
|
Definition at line 106 of file PlotMan.cxx. References fCamAnas. 00106 {
00107 for (unsigned int i=0;i<fCamAnas.size();i++) {
00108 if(caname == fCamAnas[i]->GetName()) return fCamAnas[i];
00109 }
00110 return 0;
00111 }
|
|
|
Definition at line 717 of file PlotMan.cxx. References MsgStream::GetLogLevel(), MsgService::GetStream(), MsgService::Instance(), and s(). 00718 {
00719 MsgStream *s = MsgService::Instance()->GetStream(lstream.c_str());
00720
00721 Msg::LogLevel_t loglevel = s->GetLogLevel();
00722 if(loglevel==Msg::kVerbose) return 4;;
00723 if(loglevel==Msg::kDebug) return 3;
00724 if(loglevel==Msg::kSynopsis) return 2;
00725 if(loglevel==Msg::kInfo) return 1;
00726 if(loglevel==Msg::kWarning) return 0;
00727 if(loglevel==Msg::kError) return -1;
00728 if(loglevel==Msg::kFatal) return -2;
00729 return 0;
00730 }
|
|
|
Definition at line 455 of file PlotMan.cxx. References BuildChain(), cgRun, cgSnarl, cgSubRun, fChain, fEntries, fEvent, FillCamEvent(), fProgress, fSpinning, fStopSpinning, MSG, AtmosEvent::Run, AtmosEvent::Snarl, AtmosEvent::SubRun, and UpdateCanvases(). 00455 {
00456 if (fSpinning) {
00457 MSG("PlotMan",Msg::kInfo) << "Can't step while spinning Chain" << endl;
00458 return;
00459 }
00460 if(!fChainBuilt) BuildChain();
00461
00462 fSpinning = true;
00463 MSG("PlotMan",Msg::kInfo) << "Jumping to event " << ievent << endl;
00464 const AtmosEvent* event = 0;
00465 fChain->SetBranchAddress("evt", &event);
00466
00467 int i = ievent;
00468
00469 if(i<0) i = 0;
00470 if(i>=fEntries) i = fEntries - 1;
00471
00472 if (fChain->GetEntry(i) != 0) {
00473 this->FillCamEvent(event);
00474 this->UpdateCanvases();
00475 if(fProgress) fProgress->SetPosition(i);
00476 if(cgSnarl) cgSnarl->SetNumber(event->Snarl);
00477 if(cgRun) cgRun->SetNumber(event->Run);
00478 if(cgSubRun) cgSubRun->SetNumber(event->SubRun);
00479 }
00480
00481 fEvent = i;
00482 fSpinning = false;
00483 fStopSpinning = false;
00484 MSG("PlotMan",Msg::kInfo) << "Done stepping Chain" << endl;
00485 }
|
|
|
Definition at line 552 of file PlotMan.cxx. References BuildChain(), cgRun, cgSubRun, fChain, fEvent, FillCamEvent(), fProgress, fSpinning, fStopSpinning, gSystem(), MSG, AtmosEvent::Run, AtmosEvent::SubRun, and UpdateCanvases(). Referenced by ManRunJump(). 00552 {
00553 if (fSpinning) {
00554 MSG("PlotMan",Msg::kInfo) << "Can't jump while spinning Chain" << endl;
00555 return;
00556 }
00557 if(!fChainBuilt) BuildChain();
00558
00559 int ToRun = run;
00560
00561 MSG("PlotMan",Msg::kInfo) << "Jumping to run " << ToRun << endl;
00562 fSpinning = true;
00563 const AtmosEvent* event = 0;
00564 fChain->SetBranchAddress("evt", &event);
00565
00566 int i = fEvent+1;
00567
00568 if(i<0) i = 0;
00569 //if(i>=fEntries) i = fEntries-1;
00570
00571 MSG("PlotMan",Msg::kSynopsis) << " Starting at i = " << i << endl;
00572 MSG("PlotMan",Msg::kSynopsis) << " Chain has nentries = "
00573 << fChain->GetEntries() << endl;
00574 for (; fChain->GetEntry(i)>0; i++) {
00575 if(((event->Run*100)+event->SubRun) >= ToRun) break;
00576 gSystem->ProcessEvents();
00577 if(fStopSpinning) break;
00578 }
00579 MSG("PlotMan",Msg::kSynopsis) << " Ending at i = " << i << endl;
00580
00581 FillCamEvent(event);
00582 UpdateCanvases();
00583 if(fProgress) fProgress->SetPosition(i);
00584 if(cgRun) cgRun->SetNumber(event->Run);
00585 if(cgSubRun) cgSubRun->SetNumber(event->SubRun);
00586
00587 fEvent = i;
00588 fSpinning = false;
00589 fStopSpinning = false;
00590 MSG("PlotMan",Msg::kInfo) << "Done jumping through chain" << endl;
00591 }
|
|
|
Definition at line 512 of file PlotMan.cxx. References BuildChain(), cgSnarl, fChain, fEvent, FillCamEvent(), fProgress, fSpinning, fStopSpinning, gSystem(), MSG, AtmosEvent::Snarl, and UpdateCanvases(). Referenced by ManSnarlJump(). 00512 {
00513 if (fSpinning) {
00514 MSG("PlotMan",Msg::kInfo) << "Can't jump while spinning Chain" << endl;
00515 return;
00516 }
00517 if(!fChainBuilt) BuildChain();
00518
00519 int ToSnarl = snarl;
00520
00521 MSG("PlotMan",Msg::kInfo) << "Jumping to snarl " << ToSnarl << endl;
00522 fSpinning = true;
00523 const AtmosEvent* event = 0;
00524 fChain->SetBranchAddress("evt", &event);
00525
00526 int i = fEvent+1;
00527
00528 if(i<0) i = 0;
00529 //if(i>=fEntries) i = fEntries-1;
00530
00531 MSG("PlotMan",Msg::kSynopsis) << " Starting at i = " << i << endl;
00532 MSG("PlotMan",Msg::kSynopsis) << " Chain has nentries = "
00533 << fChain->GetEntries() << endl;
00534 for (; fChain->GetEntry(i)>0; i++) {
00535 if(event->Snarl >= ToSnarl) break;
00536 gSystem->ProcessEvents();
00537 if(fStopSpinning) break;
00538 }
00539 MSG("PlotMan",Msg::kSynopsis) << " Ending at i = " << i << endl;
00540
00541 FillCamEvent(event);
00542 UpdateCanvases();
00543 if(fProgress) fProgress->SetPosition(i);
00544 if(cgSnarl) cgSnarl->SetNumber(event->Snarl);
00545
00546 fEvent = i;
00547 fSpinning = false;
00548 fStopSpinning = false;
00549 MSG("PlotMan",Msg::kInfo) << "Done jumping through chain" << endl;
00550 }
|
|
|
Definition at line 492 of file PlotMan.cxx. References cgRun, cgSubRun, and JumpToRun(). 00492 {
00493 if(!cgRun || !cgSubRun) return;
00494 JumpToRun((int)cgRun->GetNumber()*100 + (int)cgSubRun->GetNumber());
00495 }
|
|
|
Definition at line 487 of file PlotMan.cxx. References cgSnarl, and JumpToSnarl(). 00487 {
00488 if(!cgSnarl) return;
00489 JumpToSnarl((int)cgSnarl->GetNumber());
00490 }
|
|
|
Definition at line 505 of file PlotMan.cxx. References cgSleep, fUpdateSleep, and MSG. 00505 {
00506 if(!cgSleep) return;
00507 fUpdateSleep = (int)cgSleep->GetNumber();
00508 MSG("PlotMan",Msg::kSynopsis) << "Setting Update Sleep to " << fUpdateSleep
00509 << "ms" << endl;
00510 }
|
|
|
Definition at line 76 of file PlotMan.h. 00076 {StepEvent(1);}
|
|
|
Definition at line 77 of file PlotMan.h. 00077 {StepEvent(-1);}
|
|
|
Definition at line 125 of file PlotMan.h. 00125 {return fReadNEntries;}
|
|
|
Definition at line 124 of file PlotMan.h. References fReadNEntries. 00124 {fReadNEntries = b;}
|
|
|
Definition at line 78 of file PlotMan.h. 00078 {StepEvent(0);}
|
|
|
Definition at line 687 of file PlotMan.cxx. References fCamAnas, fChain, fEntries, fEvent, fProgress, and MSG. 00688 {
00689 if (fSpinning) {
00690 MSG("PlotMan",Msg::kInfo) << "Can't reset while spinning Chain" << endl;
00691 return;
00692 }
00693
00694 fChain->Reset();
00695 fEntries = 0;
00696
00697 MSG("PlotMan",Msg::kInfo) << "Resetting PlotMan" << endl;
00698 fEvent=0;
00699 if(fProgress) fProgress->Reset();
00700 for(unsigned int i=0;i<fCamAnas.size();i++) fCamAnas[i]->Reset();
00701 }
|
|
||||||||||||
|
Definition at line 267 of file PlotMan.cxx. References fChain. 00267 {
00268 fChain->SetBranchStatus(branch, status);
00269 }
|
|
|
Definition at line 681 of file PlotMan.cxx. References fEntries, and fProgress. Referenced by BuildChain().
|
|
||||||||||||
|
Definition at line 703 of file PlotMan.cxx. References MsgService::GetStream(), MsgService::Instance(), loud, s(), and MsgStream::SetLogLevel(). 00704 {
00705 if(loud<=0) gErrorIgnoreLevel = kFatal;
00706 MsgStream *s = MsgService::Instance()->GetStream(lstream.c_str());
00707
00708 if(loud>= 4) s->SetLogLevel(Msg::kVerbose);
00709 if(loud== 3) s->SetLogLevel(Msg::kDebug);
00710 if(loud== 2) s->SetLogLevel(Msg::kSynopsis);
00711 if(loud== 1) s->SetLogLevel(Msg::kInfo);
00712 if(loud== 0) s->SetLogLevel(Msg::kWarning);
00713 if(loud==-1) s->SetLogLevel(Msg::kError);
00714 if(loud<=-2) s->SetLogLevel(Msg::kFatal);
00715 }
|
|
|
Definition at line 71 of file PlotMan.h. 00071 {fUpdateFraction=frac;}
|
|
|
Definition at line 70 of file PlotMan.h. 00070 {fUpdateInterval=interval;}
|
|
|
Definition at line 497 of file PlotMan.cxx. References cgSleep, fUpdateSleep, and MSG. 00497 {
00498 if(sleep < 0) return;
00499 fUpdateSleep = sleep;
00500 MSG("PlotMan",Msg::kSynopsis) << "Setting Update Sleep to " << fUpdateSleep
00501 << "ms" << endl;
00502 if(cgSleep) cgSleep->SetNumber(sleep);
00503 }
|
|
|
Definition at line 271 of file PlotMan.cxx. References BuildChain(), cgRun, cgSnarl, cgSubRun, fCamAnas, fChain, fEntries, fEvent, fEventsPassed, fEventsRun, FillCamEvent(), FinishSpin(), fProgress, fSpinning, fStopSpinning, fUpdateFraction, fUpdateInterval, fUpdateSleep, gSystem(), MSG, AtmosEvent::Run, AtmosEvent::Snarl, AtmosEvent::SubRun, and UpdateCanvases(). 00271 {
00272 Emit("SpinChain()");
00273 if (fSpinning) {
00274 MSG("PlotMan",Msg::kSynopsis) << "Already Spinning Chain" << endl;
00275 return;
00276 }
00277
00278 if(!fChainBuilt) BuildChain();
00279
00280 fSpinning = true;
00281 MSG("PlotMan",Msg::kSynopsis) << "Spinning Chain";
00282 if(fUpdateInterval>0)
00283 MSG("PlotMan",Msg::kSynopsis) << " (update interval=" << fUpdateInterval << ")";
00284 if(fUpdateFraction>0)
00285 MSG("PlotMan",Msg::kSynopsis) << " (update fraction=" << fUpdateFraction << ")";
00286 MSG("PlotMan",Msg::kSynopsis) << endl;
00287 const AtmosEvent* event = 0;
00288 fChain->SetBranchAddress("evt",&event);
00289
00290 int ThisTreeNumber = -1;
00291 int irun = 0;
00292 int i = fEvent+1;//Start at fEvent+1 to not double count events
00293 MSG("PlotMan",Msg::kSynopsis) << "\r on entry " << i;
00294 if(fEntries>0) MSG("PlotMan",Msg::kSynopsis) << " of " << fEntries;
00295 MSG("PlotMan",Msg::kSynopsis) << flush;
00296 for (; fChain->GetEntry(i)>0; i++) {
00297 bool ThisRetStatus = this->FillCamEvent(event);
00298 if(fProgress) fProgress->Increment(1);
00299
00300 if(fUpdateInterval>0) if (i%fUpdateInterval == 0) {
00301 MSG("PlotMan",Msg::kSynopsis) << "\r on entry " << i;
00302 if(fEntries>0) MSG("PlotMan",Msg::kSynopsis) << " of " << fEntries;
00303 MSG("PlotMan",Msg::kSynopsis) << flush;
00304 if (ThisRetStatus) {
00305 this->UpdateCanvases();
00306 if(fUpdateSleep>0) gSystem->Sleep(fUpdateSleep);
00307 }
00308
00309 if(cgSnarl) cgSnarl->SetNumber(event->Snarl);
00310 if(cgRun) cgRun->SetNumber(event->Run);
00311 if(cgSubRun) cgSubRun->SetNumber(event->SubRun);
00312 }
00313
00314 if (fUpdateFraction>0 && fEntries>0) {
00315 double upinter = (double)fEntries / (double)fUpdateFraction;
00316 int iinter = (int)(i/upinter);
00317 if (((double)i - iinter*upinter) < 1.) {
00318 MSG("PlotMan",Msg::kSynopsis) << "\r on entry " << i;
00319 if(fEntries>0) MSG("PlotMan",Msg::kSynopsis) << " of " << fEntries;
00320 MSG("PlotMan",Msg::kSynopsis) << flush;
00321 if (ThisRetStatus) {
00322 this->UpdateCanvases();
00323 if(fUpdateSleep>0) gSystem->Sleep(fUpdateSleep);
00324 }
00325 }
00326
00327 if(cgSnarl) cgSnarl->SetNumber(event->Snarl);
00328 if(cgRun) cgRun->SetNumber(event->Run);
00329 if(cgSubRun) cgSubRun->SetNumber(event->SubRun);
00330 }
00331
00332 if (fChain->GetTreeNumber() != ThisTreeNumber) {
00333 MSG("PlotMan",Msg::kSynopsis) << "\r on tree " << fChain->GetTreeNumber() + 1
00334 << " of " << fChain->GetNtrees() << flush;
00335 ThisTreeNumber = fChain->GetTreeNumber();
00336 }
00337
00338 gSystem->ProcessEvents();
00339
00340 irun++;
00341 if(nevents>0 && irun>=nevents) break;
00342
00343 if(fStopSpinning) break;
00344 }
00345 MSG("PlotMan",Msg::kSynopsis) << endl;
00346 MSG("PlotMan",Msg::kSynopsis) << "Ran " << irun << " events in this spin" << endl;
00347 fEvent = i;
00348
00349 for (unsigned int i=0;i<fCamAnas.size();i++) {
00350 MSG("PlotMan",Msg::kSynopsis) << "Ana " << fCamAnas[i]->GetName() << "\t\t"
00351 << "Passed " << fEventsPassed[i]
00352 << " of " << fEventsRun[i] << " Events" << endl;
00353 }
00354
00355 fSpinning = false;
00356 fStopSpinning = false;
00357 if(fDoFinish) this->FinishSpin();
00358 MSG("PlotMan",Msg::kSynopsis) << "Done Spinning Chain" << endl;
00359 }
|
|
|
Definition at line 361 of file PlotMan.cxx. References BuildChain(), cgRun, cgSnarl, cgSubRun, fChain, fEntries, fEvent, FillCamEvent(), fProgress, fSpinning, fStopSpinning, MSG, AtmosEvent::Run, AtmosEvent::Snarl, AtmosEvent::SubRun, and UpdateCanvases(). 00362 {
00363 if (fSpinning) {
00364 MSG("PlotMan",Msg::kWarning)<< "Can't step while spinning Chain" << endl;
00365 return;
00366 }
00367 if(!fChainBuilt) BuildChain();
00368
00369 fSpinning = true;
00370 MSG("PlotMan",Msg::kSynopsis) << "Stepping chain by " << nevents << " events" << endl;
00371 const AtmosEvent* event = 0;
00372 fChain->SetBranchAddress("evt",&event);
00373
00374 int i = fEvent+nevents;
00375
00376 if(i<0) i = 0;
00377 if(i>=fEntries) i = fEntries-1;
00378
00379 if (fChain->GetEntry(i)) {
00380 this->FillCamEvent(event);
00381 this->UpdateCanvases();
00382 if(fProgress) fProgress->Increment(nevents);
00383 if(cgSnarl) cgSnarl->SetNumber(event->Snarl);
00384 if(cgRun) cgRun->SetNumber(event->Run);
00385 if(cgSubRun) cgSubRun->SetNumber(event->SubRun);
00386 }
00387 else {
00388 MSG("PlotMan",Msg::kWarning)<< "Chain could not get entry " << i << endl;
00389 }
00390
00391 fEvent = i;
00392 fSpinning = false;
00393 fStopSpinning = false;
00394 MSG("PlotMan",Msg::kInfo) << "Done stepping Chain" << endl;
00395 }
|
|
|
Definition at line 397 of file PlotMan.cxx. References BuildChain(), cgRun, cgSnarl, cgSubRun, fChain, fEntries, fEvent, FillCamEvent(), fProgress, fSpinning, fStopSpinning, gSystem(), MSG, AtmosEvent::Run, AtmosEvent::Snarl, AtmosEvent::SubRun, and UpdateCanvases(). 00398 {
00399 if (fSpinning) {
00400 MSG("PlotMan",Msg::kInfo) << "Can't step while spinning Chain" << endl;
00401 return;
00402 }
00403 if(!fChainBuilt) BuildChain();
00404
00405 fSpinning = true;
00406 MSG("PlotMan",Msg::kInfo) << "Stepping chain by " << nevents << " events"
00407 << endl;
00408 const AtmosEvent* event = 0;
00409 fChain->SetBranchAddress("evt",&event);
00410
00411 int i = fEvent+1;
00412 if(nevents<0) i = fEvent-1;
00413
00414 if(i<0) i = 0;
00415 if(i>=fEntries) i = fEntries-1;
00416
00417 if(fChain->GetEntry(i) == 0) return;
00418 int npassed = 0;
00419
00420 while (nevents > 0 && npassed < nevents) {
00421 while (!this->FillCamEvent(event)) {
00422 i++;
00423 if(fChain->GetEntry(i) == 0) fStopSpinning = true;
00424 if(fProgress) fProgress->Increment(1);
00425 gSystem->ProcessEvents();
00426 if(fStopSpinning) break;
00427 }
00428 if(fStopSpinning) break;
00429 npassed++;
00430 }
00431
00432 while (nevents < 0 && npassed < -nevents) {
00433 while (!this->FillCamEvent(event)) {
00434 i--;
00435 if(fChain->GetEntry(i) == 0) fStopSpinning = true;
00436 if(fProgress) fProgress->Increment(1);
00437 gSystem->ProcessEvents();
00438 if(fStopSpinning) break;
00439 }
00440 if(fStopSpinning) break;
00441 npassed++;
00442 }
00443
00444 if(cgSnarl && event) cgSnarl->SetNumber(event->Snarl);
00445 if(cgRun && event) cgRun->SetNumber(event->Run);
00446 if(cgSubRun && event) cgSubRun->SetNumber(event->SubRun);
00447 this->UpdateCanvases();
00448
00449 fEvent = i;
00450 fSpinning = false;
00451 fStopSpinning = false;
00452 MSG("PlotMan",Msg::kInfo) << "Done stepping Chain" << endl;
00453 }
|
|
|
Definition at line 66 of file PlotMan.h. 00066 {fStopSpinning=true;}
|
|
|
Definition at line 617 of file PlotMan.cxx. References HistMan::BaseFolder(), and tc. Referenced by JumpToEvent(), JumpToRun(), JumpToSnarl(), SpinChain(), StepEvent(), and StepPassEvent(). 00618 {
00619 if(gROOT->IsBatch()) return;
00620 //For empty parameter, start at the top
00621 TFolder *tf = tfol;
00622 if (!tf) {
00623 HistMan hm("");
00624 tf = &(hm.BaseFolder());
00625 }
00626
00627 TCollection *flist = tf->GetListOfFolders();
00628 TIter itr(flist->MakeIterator());
00629 TObject *fobj = 0;
00630 while ( (fobj=itr()) ) {
00631 if (fobj->InheritsFrom("TFolder")) {
00632 this->UpdateCanvases(dynamic_cast<TFolder*>(fobj));
00633 continue;
00634 }
00635 if (fobj->InheritsFrom("TCanvas")) {
00636 TCanvas *tc = dynamic_cast<TCanvas*>(fobj);
00637 tc->Modified();
00638 TList *tl = tc->GetListOfPrimitives();
00639 for (int j=0;j<tl->GetSize();j++) {
00640 if(! tl->At(j)->InheritsFrom("TPad")) continue;
00641 TPad *tp = dynamic_cast<TPad*>(tl->At(j));
00642 tp->Modified();
00643 }
00644 tc->Update();
00645 }
00646 }
00647
00648 /*
00649 for (unsigned int i=0;i<fCanvases.size();i++) {
00650 fCanvases[i]->Modified();
00651 TList *tl = fCanvases[i]->GetListOfPrimitives();
00652 for (int j=0;j<tl->GetSize();j++) {
00653 if(! tl->At(j)->InheritsFrom("TPad")) continue;
00654 TPad *thispad = dynamic_cast<TPad*>(tl->At(j));
00655 thispad->Modified();
00656 }
00657 fCanvases[i]->Update();
00658 }
00659 */
00660 return;
00661 }
|
|
|
Definition at line 675 of file PlotMan.cxx. References HistMan::WriteOut(). 00676 {
00677 HistMan hm("");
00678 hm.WriteOut(fn.c_str());
00679 }
|
|
|
Definition at line 110 of file PlotMan.h. Referenced by AddCamAna(), ControlWindow(), and PlotMan(). |
|
|
Definition at line 112 of file PlotMan.h. Referenced by ControlWindow(), JumpToEvent(), JumpToRun(), ManRunJump(), SpinChain(), StepEvent(), and StepPassEvent(). |
|
|
Definition at line 115 of file PlotMan.h. Referenced by ControlWindow(), ManUpdateSleep(), PlotMan(), and SetUpdateSleep(). |
|
|
Definition at line 114 of file PlotMan.h. Referenced by ControlWindow(), JumpToEvent(), JumpToSnarl(), ManSnarlJump(), SpinChain(), StepEvent(), and StepPassEvent(). |
|
|
Definition at line 113 of file PlotMan.h. Referenced by ControlWindow(), JumpToEvent(), JumpToRun(), ManRunJump(), SpinChain(), StepEvent(), and StepPassEvent(). |
|
|
Definition at line 95 of file PlotMan.h. Referenced by AddCamAna(), FillCamEvent(), FilterOn(), FilterRev(), FinishSpin(), GetCamAna(), Reset(), and SpinChain(). |
|
|
Definition at line 93 of file PlotMan.h. Referenced by BuildChain(), and PlotMan(). |
|
|
Definition at line 93 of file PlotMan.h. Referenced by AddDirectory(), AddFile(), AddList(), and PlotMan(). |
|
|
Definition at line 107 of file PlotMan.h. Referenced by PlotMan(). |
|
|
Definition at line 101 of file PlotMan.h. Referenced by AddFileChecked(), BuildChain(), JumpToEvent(), PlotMan(), Reset(), SetEntries(), SpinChain(), StepEvent(), and StepPassEvent(). |
|
|
Definition at line 101 of file PlotMan.h. Referenced by JumpToEvent(), JumpToRun(), JumpToSnarl(), PlotMan(), Reset(), SpinChain(), StepEvent(), and StepPassEvent(). |
|
|
Definition at line 97 of file PlotMan.h. Referenced by AddCamAna(), FillCamEvent(), and SpinChain(). |
|
|
Definition at line 96 of file PlotMan.h. Referenced by AddCamAna(), FillCamEvent(), and SpinChain(). |
|
|
Definition at line 98 of file PlotMan.h. Referenced by AddCamAna(), AllFiltersOn(), FillCamEvent(), and FilterOn(). |
|
|
Definition at line 99 of file PlotMan.h. Referenced by AddCamAna(), AllFiltersRev(), FillCamEvent(), and FilterRev(). |
|
|
Definition at line 111 of file PlotMan.h. Referenced by AddFileChecked(), ControlWindow(), JumpToEvent(), JumpToRun(), JumpToSnarl(), PlotMan(), Reset(), SetEntries(), SpinChain(), StepEvent(), and StepPassEvent(). |
|
|
Definition at line 103 of file PlotMan.h. Referenced by PlotMan(), and ReadNEntries(). |
|
|
Definition at line 91 of file PlotMan.h. Referenced by AddDirectory(), AddFile(), AddList(), and BuildChain(). |
|
|
Definition at line 92 of file PlotMan.h. Referenced by AddDirectory(), AddList(), and PlotMan(). |
|
|
Definition at line 105 of file PlotMan.h. Referenced by JumpToEvent(), JumpToRun(), JumpToSnarl(), PlotMan(), SpinChain(), StepEvent(), and StepPassEvent(). |
|
|
Definition at line 105 of file PlotMan.h. Referenced by JumpToEvent(), JumpToRun(), JumpToSnarl(), PlotMan(), SpinChain(), StepEvent(), and StepPassEvent(). |
|
|
Definition at line 106 of file PlotMan.h. Referenced by PlotMan(), and SpinChain(). |
|
|
Definition at line 106 of file PlotMan.h. Referenced by PlotMan(), and SpinChain(). |
|
|
Definition at line 106 of file PlotMan.h. Referenced by ManUpdateSleep(), PlotMan(), SetUpdateSleep(), and SpinChain(). |
1.3.9.1