File indexing completed on 2025-08-05 08:12:04
0001
0002 int Fun4All_EICAnalysis_Quarkonia(
0003 const int nEvents = 100000,
0004
0005
0006
0007
0008
0009
0010 const char * inputFile = "../data/phpythia6_e20p250_ccbar_jpsi2ee_1k_hepmc.root",
0011 const char * outputFile = "eicmcana_pythia6_e20p250_ccbar_jpsi2ee_1k.root"
0012 )
0013 {
0014
0015 bool readdst = true;
0016 bool readhepmc = false;
0017
0018
0019
0020
0021
0022 gSystem->Load("libfun4all.so");
0023 gSystem->Load("libphhepmc.so");
0024 gSystem->Load("libeicana.so");
0025
0026
0027
0028
0029
0030 Fun4AllServer *se = Fun4AllServer::instance();
0031 se->Verbosity(0);
0032
0033 recoConsts *rc = recoConsts::instance();
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 Quarkonia2LeptonsMC *mcana = new Quarkonia2LeptonsMC(outputFile);
0049 se->registerSubsystem( mcana );
0050
0051
0052
0053
0054
0055
0056 if ( readdst )
0057 {
0058 Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
0059 hitsin->fileopen(inputFile);
0060 se->registerInputManager(hitsin);
0061 }
0062
0063 else if ( readhepmc )
0064 {
0065 Fun4AllInputManager *in = new Fun4AllHepMCInputManager( "DSTIN");
0066 se->registerInputManager( in );
0067 se->fileopen( in->Name().c_str(), inputFile );
0068 }
0069
0070
0071
0072
0073
0074 if (nEvents < 0)
0075 {
0076 return;
0077 }
0078
0079 if (nEvents == 0 && !readhits && !readhepmc)
0080 {
0081 cout << "using 0 for number of events is a bad idea when using particle generators" << endl;
0082 cout << "it will run forever, so I just return without running anything" << endl;
0083 return;
0084 }
0085
0086 se->run(nEvents);
0087
0088
0089
0090
0091
0092 se->End();
0093 std::cout << "All done" << std::endl;
0094 delete se;
0095 gSystem->Exit(0);
0096 }