File indexing completed on 2025-08-05 08:13:34
0001
0002 int Fun4All_RICHReco(
0003 const int nEvents = 1,
0004 const char * inputFile = "G4EICDetector.root",
0005 const char * evalFile = "eval_RICH.root"
0006 )
0007 {
0008
0009 bool readdst = true;
0010
0011
0012
0013 bool do_fastpid = false;
0014
0015
0016
0017
0018
0019 gSystem->Load("librichana.so");
0020 gSystem->Load("libfun4all.so");
0021 gSystem->Load("libg4detectors.so");
0022
0023
0024
0025
0026
0027 Fun4AllServer *se = Fun4AllServer::instance();
0028 se->Verbosity(0);
0029
0030 recoConsts *rc = recoConsts::instance();
0031
0032
0033
0034
0035
0036
0037 if ( do_fastpid )
0038 {
0039 FastPid_RICH *fastpid_rich = new FastPid_RICH("SvtxTrackMap", "RICH");
0040 se->registerSubsystem(fastpid_rich);
0041 }
0042 else
0043 {
0044 RICHParticleID *richpid = new RICHParticleID("SvtxTrackMap", "RICH");
0045 richpid->set_refractive_index(1.000526);
0046 se->registerSubsystem(richpid);
0047
0048 RICHEvaluator *richeval = new RICHEvaluator("SvtxTrackMap", "RICH", evalFile);
0049 richeval->set_refractive_index(1.000526);
0050 se->registerSubsystem(richeval);
0051 }
0052
0053
0054
0055
0056
0057
0058 if ( readdst )
0059 {
0060 Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
0061 hitsin->fileopen(inputFile);
0062 se->registerInputManager(hitsin);
0063 }
0064
0065
0066
0067
0068 if (nEvents < 0)
0069 {
0070 return;
0071 }
0072
0073 if (nEvents == 0 && !readdst && !readhepmc)
0074 {
0075 cout << "using 0 for number of events is a bad idea when using particle generators" << endl;
0076 cout << "it will run forever, so I just return without running anything" << endl;
0077 return;
0078 }
0079
0080 se->run(nEvents);
0081
0082
0083
0084
0085
0086 se->End();
0087 std::cout << "All done" << std::endl;
0088 delete se;
0089 gSystem->Exit(0);
0090 }