Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:11:06

0001 //
0002 // Runs module for MBD Laser
0003 //
0004 #include <TSystem.h>
0005 #include <Fun4AllServer.h>
0006 #include <Fun4AllDstInputManager.h>
0007 #include <recoConsts.h>
0008 #include "MbdLaser.h"
0009 
0010 #if defined(__CLING__)
0011 R__LOAD_LIBRARY(libmbd_io.so)
0012 R__LOAD_LIBRARY(libcalo_io.so)
0013 R__LOAD_LIBRARY(libcalotrigger_io.so)
0014 R__LOAD_LIBRARY(libglobalvertex_io.so)
0015 R__LOAD_LIBRARY(libcentrality_io.so)
0016 R__LOAD_LIBRARY(libfun4allraw.so)
0017 R__LOAD_LIBRARY(libMBDStudy.so)
0018 #endif
0019 
0020 void Run_MbdLaser(const char *dst_mbd_file = "DST_UNCALMBD-00040000-0000.root", const char *outFile = "LASER-00040000-0000.root", int nEvents = 0)
0021 {
0022   ///////////////////////////////////////////
0023   //
0024   //- recoConsts setup
0025   //
0026   ///////////////////////////////////////////
0027   recoConsts *rc = recoConsts::instance();
0028 
0029   ///////////////////////////////////////////
0030   //
0031   //- Make the Server
0032   //
0033   //////////////////////////////////////////
0034   Fun4AllServer *se = Fun4AllServer::instance();
0035   se->Verbosity(0);
0036 
0037   MbdLaser *ana = new MbdLaser();
0038   ana->set_savefile( outFile );
0039   se->registerSubsystem( ana );
0040 
0041   ///////////////////////////////////////////
0042   //
0043   //- Analyze the Data.
0044   //
0045   //////////////////////////////////////////
0046 
0047   Fun4AllInputManager *dst_mbd_in = new Fun4AllDstInputManager( "MBDLASER", "DST", "TOP");
0048   se->registerInputManager( dst_mbd_in );
0049 
0050   TString dst_mbd_fname = dst_mbd_file;
0051   if ( dst_mbd_fname.EndsWith(".root") )
0052   {
0053     dst_mbd_in->AddFile( dst_mbd_file );
0054   }
0055   else if ( dst_mbd_fname.EndsWith(".list") )
0056   {
0057     //you can put a list of files as well 
0058     cout << "Using list file " << dst_mbd_file << endl;
0059     dst_mbd_in->AddListFile( dst_mbd_file );
0060   }
0061 
0062   se->run(nEvents);
0063   se->End();
0064   delete se;
0065 }