Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:21:00

0001 #pragma once
0002 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
0003 #include <fun4all/SubsysReco.h>
0004 #include <fun4all/Fun4AllServer.h>
0005 #include <fun4all/Fun4AllInputManager.h>
0006 #include <fun4allraw/Fun4AllPrdfInputManager.h>
0007 #include <fun4all/Fun4AllDstInputManager.h>
0008 //#include <rawwaveformtowerbuilder/RawWaveformTowerBuilder.h>
0009 #include <fun4all/Fun4AllDstOutputManager.h>
0010 
0011 #include <litecaloeval/LiteCaloEval.h>
0012 #include <caloreco/CaloTowerCalib.h>
0013 #include <caloreco/RawClusterBuilderTemplate.h>
0014 //#include <calib_emc_pi0/CaloCalibEmc_Pi0.h>
0015 
0016 #include <phool/recoConsts.h>
0017 
0018 
0019 R__LOAD_LIBRARY(libfun4all.so)
0020 R__LOAD_LIBRARY(libfun4allraw.so)
0021 R__LOAD_LIBRARY(libcalo_reco.so)
0022 R__LOAD_LIBRARY(libLiteCaloEvalTowSlope.so)
0023 //R__LOAD_LIBRARY(libcalibCaloEmc_pi0.so)
0024 
0025 
0026 
0027 #endif
0028 
0029 // to get files from my local area
0030 void towerslope_dst_runner(int nevents = 1e5, const char *fname = "/sphenix/user/sregmi/FINAL_VERSION/tower_slope_old_tower_method/3_RawWaveformTowerBuilder/macro/testoutput_400.root", const char * outfile =  "defout.root")
0031 //,const int runNumber)
0032 {
0033 
0034   Fun4AllServer *se = Fun4AllServer::instance();
0035 
0036 
0037   Fun4AllInputManager *in = new Fun4AllDstInputManager("in");
0038 
0039   TString infiletstr(fname);
0040   if (infiletstr.Contains(".list"))
0041     in->AddListFile(fname);
0042   else
0043     in->fileopen(fname);
0044 
0045 
0046   se->registerInputManager(in);
0047 
0048   //JF to Blair Nov 23 -- leaving these next blocks, similar code
0049   //  would be needed if we run a second iteration of towerslope
0050   // which is fairly possible.
0051 
0052   //CaloTowerBuilder *ca = new CaloTowerBuilder();
0053 
0054   // // recoConsts *rc = recoConsts::instance();
0055   // // rc->set_StringFlag("CDB_GLOBALTAG","ProdA_2023"); // this points to the global  tag in the CDB
0056   // // The calibrations have a validity range set by the beam clock which is not read out of the prdfs as of now
0057   //rc->set_uint64Flag("TIMESTAMP",runNumber);
0058   
0059   
0060   // CaloTowerCalib *calib = new CaloTowerCalib("CEMCCALIB");
0061   // //  calib->setCalibName("cemc_abscalib_cosmic");// these two lines are needed to choose your own calibration
0062   // //  calib->setFieldName("cemc_abscalib_cosmic");
0063   // calib->set_detector_type(CaloTowerCalib::CEMC);
0064   // se->registerSubsystem(calib);
0065   
0066   std::cout << "in tow dst " << std::endl;
0067 
0068 
0069   LiteCaloEval *eval7e = new LiteCaloEval("CEMCEVALUATOR2", "CEMC",outfile);
0070   //  LiteCaloEval *eval = new LiteCaloEval("HOCEMCEVALUATOR2", "HCALOUT", outputfile.c_str());
0071   //  eval->Verbosity(verbosity);
0072   eval7e->CaloType(LiteCaloEval::CEMC);
0073   eval7e->setInputTowerNodeName("TOWERINFO_CALIB_CEMC");
0074   //eval->CaloType(LiteCaloEval::HCALOUT);
0075   se->registerSubsystem(eval7e);
0076 
0077 
0078   se->run(nevents);
0079 
0080   se->End();
0081   se->PrintTimer();
0082   gSystem->Exit(0);
0083 }