Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:13:28

0001 #include <string>
0002 
0003 using namespace std;
0004 
0005 void Fun4All_TestBeam(int nEvents = 250000,
0006                       const char *input_file = "./beamtest2018/beam/beam_00000088-0000.prdf",
0007                       const char *output_file = "beam_00000088.root"
0008                      )
0009 {
0010   gSystem->Load("libfun4all");
0011   // gSystem->Load("libPrototype4.so");
0012   gSystem->Load("libMvtxPrototype1.so");
0013   gSystem->Load("libAnaMvtxPrototype1.so");
0014 
0015   Fun4AllServer *se = Fun4AllServer::instance();
0016   se->Verbosity(0);
0017   // se->Verbosity(Fun4AllServer::VERBOSITY_SOME);
0018 
0019   char ifile[strlen(input_file) + 1]; // + 1 for the \0 which marks the end of string
0020   strcpy(ifile, input_file);
0021   strtok(ifile, "_");
0022   int runnumber = atoi(strtok(0, "-"));
0023   int segnumber = atoi(strtok(strtok(0, "-"), "."));
0024   cout << "runnumber: " << runnumber << " segment " << segnumber << endl;
0025 
0026   recoConsts *rc = recoConsts::instance();
0027   rc->set_IntFlag("RUNNUMBER", runnumber);
0028 
0029   MvtxUnpackPRDF *unpack = new MvtxUnpackPRDF();
0030   unpack->Verbosity(0);
0031   se->registerSubsystem(unpack);
0032 
0033   MvtxApplyHotDead *hotdead = new MvtxApplyHotDead("MvtxApplyHotDead",
0034       "hotmap/hotmap_testbeam_00000088.txt");
0035   hotdead->Verbosity(0);
0036   hotdead->PrintHotDeadMap();
0037   se->registerSubsystem(hotdead);
0038 
0039   MvtxClusterizer *clus = new MvtxClusterizer();
0040   clus->Verbosity(0);
0041   se->registerSubsystem(clus);
0042 
0043   MvtxDefUtil util;
0044   MvtxAlign *align = new MvtxAlign();
0045   align->Verbosity(0);
0046   // align->AddAlignmentPar(util.GenHitSetKey(0, 0, 0), +38, 0, +4);
0047   // align->AddAlignmentPar(util.GenHitSetKey(1, 0, 1), +26, 2.2 / 28e-4, +8);
0048   // align->AddAlignmentPar(util.GenHitSetKey(2, 0, 2), +12, 4.4 / 28e-4, +13);
0049   // align->AddAlignmentPar(util.GenHitSetKey(3, 0, 3), 0, 6.6 / 28e-4, 0);
0050   // align->PrintAlignmentPars();
0051   align->SetAlignmentParFileDir("beamcenter/");
0052   se->registerSubsystem(align);
0053 
0054   AnaMvtxPrototype1* ana = new AnaMvtxPrototype1();
0055   // ana->Verbosity(Fun4AllServer::VERBOSITY_SOME);
0056   ana->Verbosity(0);
0057   se->registerSubsystem(ana);
0058 
0059 
0060   Fun4AllDstOutputManager *out_Manager = new Fun4AllDstOutputManager("DSTOUT", output_file);
0061   se->registerOutputManager(out_Manager);
0062 
0063   Fun4AllInputManager *in = new Fun4AllPrdfInputManager("PRDFin");
0064   in->fileopen(input_file);
0065   se->registerInputManager(in);
0066 
0067   se->run(nEvents);
0068 
0069   se->End();
0070 }