#include <cassert>#include "TROOT.h"#include "TRint.h"#include "TString.h"#include "TSystem.h"#include "TStyle.h"#include "sigc++/sigc++.h"#include "sigc++/class_slot.h"#include "sigc++/slot.h"#include "Calibrator/Calibrator.h"#include "MessageService/MsgService.h"#include "JobControl/JobC.h"#include "JobControl/JobCModule.h"#include "JobControl/JobCModuleRegistry.h"#include "Algorithm/AlgFactory.h"#include "Algorithm/AlgConfig.h"#include "Midad/Base/Mint.h"#include "Midad/Base/PageDisplay.h"#include "TriD/TridControl.h"#include "TriD/TridPageDisplay.h"#include "TriD/TridSetup.h"#include "TriD/stat/ReadDispatcherModule.h"#include "Plex/PlexLoanPool.h"#include "DatabaseInterface/DbiTableProxyRegistry.h"Go to the source code of this file.
Classes | |
| class | AutoEventTimer |
Typedefs | |
| typedef enum EInputMode | InputMode_t |
Enumerations | |
| enum | EInputMode { kFromFile = 0, kFromDispatcher = 1 } |
Functions | |
| void | InitGui () |
| CVSID ("$Id: trid.cxx,v 1.16 2007/03/01 16:59:43 rhatcher Exp $") | |
| TROOT | root ("trid","TriD Static Viewer Program", initfuncs) |
| int | SetupInput () |
| int | SetupAuto () |
| int | SetupAnimation () |
| void | setup_paths (void) |
| int | main (int argc, char **argv) |
| void | DoNext (void) |
| void | DoPrev (void) |
Variables | |
| VoidFuncPtr_t | initfuncs [] = { InitGui, 0 } |
| InputMode_t | gInputMode = kFromFile |
| JobC * | jc |
| SigC::Ptr< TridControl > | tc |
| string | hostname = "localhost" |
| int | port = 9090 |
| float | timeout = 1 |
| bool | autoNext = false |
| float | autoNextDelay = 30.0 |
| vector< string > | filenames |
| bool | animate = false |
| float | animateSpeed = 0.1 |
| int | nhitThresh = 30 |
| int | nhitMax = 2000 |
| string | plexfile = "~/cache/plex_cache.dat" |
|
|
|
|
|
Definition at line 48 of file stat/trid.cxx. 00048 {
00049 kFromFile = 0,
00050 kFromDispatcher = 1
00051 } InputMode_t;
|
|
||||||||||||
|
|
|
|
Definition at line 157 of file stat/trid.cxx. References gInputMode, gMint, ReadDispatcherModule::IsNewEventReady(), jc, MSG, Mint::Next(), and JobC::Path. 00158 {
00159 // Called when the user hits the 'next' button.
00160 cout << "DoNext()" << endl;
00161
00162
00163 if(gInputMode==kFromDispatcher) {
00164 // Get the module.
00165 ReadDispatcherModule* rdm = dynamic_cast<ReadDispatcherModule*>
00166 (&(jc->Path("default").Mod("ReadDispatcherModule")));
00167
00168 assert(rdm);
00169
00170 if(rdm->IsNewEventReady()) gMint->Next();
00171 else {
00172 MSG("TriD",Msg::kInfo) << "No event ready from dispatcher." << endl;
00173 }
00174 } else
00175
00176 {
00177 // Regualar old file
00178 gMint->Next();
00179 }
00180 }
|
|
|
Definition at line 182 of file stat/trid.cxx. References gInputMode, gMint, and Mint::Prev(). 00183 {
00184 cout << "DoPrev()" << endl;
00185 if(gInputMode==kFromDispatcher) {
00186 } else {
00187 gMint->Prev();
00188 }
00189 }
|
|
|
|
|
||||||||||||
|
COMMAND LINE CALIB CONSTANTS BEAM RUN KEY Cerenkov ADC cuts: ATTENUATION PARAMS FILE + TREE Definition at line 41 of file BfldBenchmark.cc. References BenchmarkAccuracy(), BenchmarkPerformance(), MsgService::GetStream(), MsgService::Instance(), kDefaultAccTestOutFileName, kDefaultConfigFileName, kDefaultPerfTestOutFileName, kProgramOptions, MsgStream::SetFormat(), and MsgStream::SetLogLevel(). 00041 {
00042 bool isPerf = true;
00043 bool isAcc = true;
00044
00045 bool isConfigFileArg = false;
00046 char configFileName[255];
00047
00048 bool isDebug = false;
00049
00050 char opt = getopt(argc,argv,kProgramOptions);
00051 if(opt == EOF) {
00052 isDebug = false;
00053 isConfigFileArg = false;
00054 isPerf = true;
00055 isAcc = true;
00056 cout << "Running both performance and accuracy tests..." << endl;
00057 }
00058 else {
00059 isPerf = false;
00060 isAcc = false;
00061
00062 while(opt != EOF) {
00063 switch(opt) {
00064 case EOF:
00065 break;
00066 case '?':
00067 cout << "Invalid option. Use BfldBenchmark -h for help." << endl;
00068 exit(1);
00069 break;
00070 case 'h':
00071 cout << "usage: BfldBenchmark [-pahd] [-f configfile] [[file1] file2]"
00072 << endl
00073 << "Benchmarks the BField package." << endl;
00074 cout << "By default, does both performance and accuracy tests."
00075 << endl;
00076 cout << "-p: Do performance tests. Output to file1 or to the" << endl
00077 << " default, " << kDefaultPerfTestOutFileName << endl;
00078 cout << "-a: Do accuracy tests. Can be used together with -p or alone."
00079 << endl
00080 << " If alone, file1 specifies where to write results; "
00081 << endl << " otherwise, file2 does. If the appropriate file "
00082 << endl << " is not specified, the default, "
00083 << kDefaultAccTestOutFileName << ", is used." << endl;
00084 cout << "-f configfile: Use the configuration file given instead of"
00085 << endl
00086 << " the default file " << kDefaultConfigFileName
00087 << endl;
00088 cout << "-d: Print out lots of debugging information." << endl;
00089 cout << "-h: Display this help." << endl << endl;
00090 cout << "Config file format:" << endl
00091 << "perfTestPtsFileName" << endl
00092 << "rectAccTestPtsName" << endl
00093 << "vorAccTestPtsName" << endl
00094 << "rectMapName (currently ignored)" << endl
00095 << "vorMapName (currently ignored)" << endl
00096 << "vorMeshName (currently ignored)" << endl
00097 << "vorBFldName (currently ignored)" << endl;
00098 exit(0);
00099 break;
00100 case 'p':
00101 isPerf = true;
00102 break;
00103 case 'a':
00104 isAcc = true;
00105 break;
00106 case 'f':
00107 isConfigFileArg = true;
00108 if(optarg == 0) {
00109 cout << "You must specify a configuration file name with" << endl
00110 << "the -f option. Use the -h option for help." << endl;
00111 cout << "This run will use the default configuration file." << endl;
00112 isConfigFileArg = false;
00113 }
00114 else
00115 strcpy(configFileName,optarg);
00116 break;
00117 case 'd':
00118 isDebug = true;
00119 break;
00120 default:
00121 cout << "Error processing arguments. Bail." << endl;
00122 exit(1);
00123 }
00124
00125 opt = getopt(argc,argv,kProgramOptions);
00126 }
00127 }
00128
00129 if(isDebug) {
00130 MsgService::Instance()->GetStream("Bfldtest")->SetLogLevel(Msg::kDebug);
00131 //We'll also hear from the package itself, but without lots of extra
00132 //information appended by the MessageService.
00133 MsgService::Instance()->GetStream("Bfld")->SetFormat(Msg::kInfo,
00134 Msg::kName);
00135 MsgService::Instance()->GetStream("Bfld")->SetFormat(Msg::kWarning,
00136 Msg::kName
00137 & Msg::kPriority);
00138 MsgService::Instance()->GetStream("BFL")->SetFormat(Msg::kInfo,
00139 Msg::kName);
00140 MsgService::Instance()->GetStream("BFL")->SetFormat(Msg::kWarning,
00141 Msg::kName
00142 & Msg::kPriority);
00143 }
00144 else {
00145 //We leave Bfldtest at kInfo level. In addition, we want to quiet
00146 //chatter from the BField package itself.
00147 MsgService::Instance()->GetStream("BFL")->SetLogLevel(Msg::kFatal);
00148 MsgService::Instance()->GetStream("Bfld")->SetLogLevel(Msg::kFatal);
00149 }
00150 //We don't want all the information Msg normally prints out.
00151 MsgService::Instance()->GetStream("Bfldtest")->SetFormat(Msg::kDebug,0);
00152 MsgService::Instance()->GetStream("Bfldtest")->SetFormat(Msg::kWarning,0);
00153
00154 if(!isConfigFileArg) { //Use default config file
00155 strcpy(configFileName,kDefaultConfigFileName);
00156 }
00157
00158 ifstream configFile(configFileName,ios::in);
00159 if(!configFile.good()) {
00160 cout << "Couldn't open configuration file " << configFileName << endl;
00161 exit(1);
00162 }
00163
00164 char *rectMapName,*vorMapName,*vorMeshName,*vorBFldName,
00165 *perfTestPtsName,*rectAccTestPtsName,*vorAccTestPtsName;
00166
00167 configFile.gets(&perfTestPtsName);
00168 configFile.gets(&rectAccTestPtsName);
00169 configFile.gets(&vorAccTestPtsName);
00170
00171 configFile.gets(&rectMapName);
00172 configFile.gets(&vorMapName);
00173 configFile.gets(&vorMeshName);
00174 configFile.gets(&vorBFldName);
00175
00176 if(isPerf) {
00177 cout << endl << "Running performance tests with test point file "
00178 << perfTestPtsName << endl;
00179
00180 if(argc - optind == 0)
00181 BenchmarkPerformance(kDefaultPerfTestOutFileName,rectMapName,vorMapName,
00182 vorMeshName,vorBFldName,perfTestPtsName);
00183 else
00184 BenchmarkPerformance(argv[optind],rectMapName,vorMapName,
00185 vorMeshName,vorBFldName,perfTestPtsName);
00186
00187 }
00188
00189 if(isAcc) {
00190 cout << endl << "Running accuracy tests with test point files:" << endl
00191 << "rect2d: " << rectAccTestPtsName << endl
00192 << "Voronoi: " << vorAccTestPtsName << endl;
00193
00194 int reqArgCount = (isPerf) ? 1 : 0;
00195
00196 if(argc - optind == reqArgCount)
00197 BenchmarkAccuracy(kDefaultAccTestOutFileName,rectMapName,vorMapName,
00198 vorMeshName,vorBFldName,rectAccTestPtsName,
00199 vorAccTestPtsName);
00200 else
00201 BenchmarkAccuracy(argv[optind + reqArgCount],rectMapName,vorMapName,
00202 vorMeshName,vorBFldName,rectAccTestPtsName,
00203 vorAccTestPtsName);
00204 }
00205 }
|
|
||||||||||||||||
|
Referenced by JobCRootEnv::JobCRootEnv(), and main(). |
|
|
Definition at line 191 of file stat/trid.cxx. References gSystem(), and MSG. 00192 {
00193 // Only need this for interactive jobs.
00194 MSG("TriD",Msg::kDebug) << "Setting up macro paths.\n"; cout.flush();
00195
00196 TString mp = gROOT->GetMacroPath();
00197 TString ip;
00198 const char* p = gSystem->Getenv("SRT_PRIVATE_CONTEXT");
00199 if (p) {
00200 mp += ":";
00201 mp += p;
00202 mp += ":";
00203 mp += p;
00204 mp += "/macros";
00205 ip += " -I";
00206 ip += p;
00207 }
00208
00209 const char* p2 = gSystem->Getenv("SRT_PUBLIC_CONTEXT");
00210 if (p2) {
00211 mp += ":";
00212 mp += p2;
00213 mp += ":";
00214 mp += p2;
00215 mp += "/macros";
00216 ip += " -I";
00217 ip += p2;
00218 }
00219
00220 gROOT->SetMacroPath(mp.Data());
00221 gSystem->SetIncludePath(ip);
00222
00223 MSG("TriD",Msg::kDebug) << "Setting up include paths.\n"; cout.flush();
00224
00225 if(p) {
00226 TString dip = ".include ";
00227 dip += p;
00228 gROOT->ProcessLine(dip.Data());
00229 }
00230
00231 if(p2) {
00232 TString dip = ".include ";
00233 dip += p2;
00234 gROOT->ProcessLine(dip.Data());
00235 }
00236 }
|
|
|
Definition at line 146 of file stat/trid.cxx. References animateSpeed, and tc. 00147 {
00148 assert(tc);
00149 tc->GetAnimator().SetAnimateViews(true);
00150 tc->GetAnimator().SetAnimateModels(false);
00151 tc->GetAnimator().SetViewAnimSpeed( animateSpeed );
00152 tc->GetAnimator().StartAnimation();
00153 return 0;
00154 }
|
|
|
Definition at line 137 of file stat/trid.cxx. References autoNextDelay, and timer(). 00138 {
00139 AutoEventTimer* timer = new AutoEventTimer();
00140 timer->Start((Long_t)(autoNextDelay*1000.),true);
00141 timer->TurnOn();
00142 return 0;
00143 }
|
|
|
Definition at line 71 of file stat/trid.cxx. References JobCPathModule::Add(), JobCInput::AddFile(), filenames, Form(), gInputMode, hostname, JobC::Input, jc, MSG, nhitMax, nhitThresh, JobC::Path, port, JobCModule::Set(), timeout, and JobCInput::Use(). 00072 {
00073 assert(jc);
00074
00075 if(gInputMode==kFromDispatcher) {
00076 cout << "Setting up dispatcher client connected to "
00077 << hostname << " :" << port << endl;
00078
00079 /*
00080 jc->Input.Set("Format=DDS");
00081 jc->Input.Set(Form("DDSServer=%s",hostname.c_str())); // dispatcher server host
00082 jc->Input.Set(Form("DDSPort=%d",port)); // default dispatcher server port is 9090
00083 jc->Input.Set("Streams=DaqSnarl"); //default is DS,DM,LightInjection
00084 jc->Input.Set("DDSKeepUpMode=RecordKeepUp"); // default is FileKeepUp
00085 jc->Input.Set("DDSDataSource=Daq"); // default is Daq
00086 jc->Input.Set(Form("DDSTimeOut=%d",(int)timeout)); // (seconds) default is 120
00087 jc->Input.Set("DDSMaxSyncDelay=1"); // (seconds) default is 15
00088 jc->Input.Select("DaqSnarl",
00089 Form("(((RawDaqSnarlHeader*)fHeader)->GetNumRawDigits()>%d)"
00090 "&&(((RawDaqSnarlHeader*)fHeader)->GetNumRawDigits()<%d)",
00091 nhitThresh,nhitMax));
00092
00093 */
00094 // Add a dummy input method to save on warnings.
00095 jc->Input.Use("DummyInput");
00096
00097 // Add my own input
00098 jc->Path.Add("default","ReadDispatcherModule::Get ");
00099 JobCModule& mod = jc->Path("default").Mod("ReadDispatcherModule");
00100 mod.Set(Form("DDSServer=%s",hostname.c_str())); // dispatcher server host
00101 mod.Set(Form("DDSPort=%d",port)); // default dispatcher server port is 9090
00102 mod.Set("Streams=DaqSnarl"); //default is DS,DM,LightInjection
00103 mod.Set("DDSKeepUpMode=RecordKeepUp"); // default is FileKeepUp
00104 mod.Set("DDSDataSource=Daq"); // default is Daq
00105 mod.Set(Form("DDSTimeOut=%d",(int)timeout)); // (seconds) default is 120
00106 mod.Set("DDSMaxSyncDelay=1"); // (seconds) default is 15
00107 mod.Set(Form("SelectRule=(((RawDaqSnarlHeader*)fHeader)->GetNumRawDigits()>%d)"
00108 "&&(((RawDaqSnarlHeader*)fHeader)->GetNumRawDigits()<%d)",
00109 nhitThresh,nhitMax));
00110
00111
00112 } else {
00113 jc->Input.Set("Streams=DaqSnarl,Cand");
00114
00115 MSG("TriD",Msg::kDebug) << "Adding files..\n";
00116 for(UInt_t i=0;i<filenames.size();i++) {
00117 jc->Input.AddFile(filenames[i].c_str());
00118 MSG("TriD",Msg::kDebug) << " Adding file " << filenames[i] << endl;
00119 }
00120
00121 }
00122
00123 return 1;
00124 }
|
|
|
Definition at line 65 of file stat/trid.cxx. |
|
|
Definition at line 66 of file stat/trid.cxx. Referenced by SetupAnimation(). |
|
|
Definition at line 62 of file stat/trid.cxx. |
|
|
Definition at line 63 of file stat/trid.cxx. Referenced by AutoEventTimer::Notify(), and SetupAuto(). |
|
|
Definition at line 64 of file stat/trid.cxx. Referenced by Bmnt::ProcessFiles(), and SetupInput(). |
|
|
Definition at line 55 of file stat/trid.cxx. Referenced by DoNext(), DoPrev(), and SetupInput(). |
|
|
|
Definition at line 33 of file stat/trid.cxx. |
|
|
|
Definition at line 68 of file stat/trid.cxx. Referenced by SetupInput(). |
|
|
Definition at line 67 of file stat/trid.cxx. Referenced by SetupInput(). |
|
|
Definition at line 69 of file stat/trid.cxx. |
|
|
|
|
Definition at line 61 of file stat/trid.cxx. Referenced by SetupInput(). |
1.3.9.1