Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include <fun4all/SubsysReco.h>
0002 #include <fun4all/Fun4AllServer.h>
0003 #include <fun4all/Fun4AllInputManager.h>
0004 #include <fun4all/Fun4AllOutputManager.h>
0005 #include <fun4all/Fun4AllDstInputManager.h>
0006 #include <fun4all/Fun4AllDstOutputManager.h>
0007 
0008 //#include <inttread/InttSaveTree.h>
0009 
0010 #include <phool/recoConsts.h>
0011 
0012 #include <Trkr_Clustering.C>
0013 #include <Trkr_Reco.C>
0014 #include <Trkr_RecoInit.C>
0015 #include <G4Setup_sPHENIX.C>
0016 
0017 #include <inttzvertexfindertrapezoidal/InttZVertexFinderTrapezoidal.h>
0018 
0019 // #include <intt/InttCombinedRawDataDecoder.h>
0020 // #include <intt/InttMapping.h>
0021 
0022 //#include <inttread/InttRawData.h>
0023 //#include <inttread/InttSaveTree.h>
0024 
0025 // #include "functions.hh"
0026 // #include "constant_values.hh"
0027 
0028 // #include <dndetaintt/dNdEtaINTT.h>
0029 
0030 // #include <intt/InttClusterizer.h>
0031 
0032 // #include <mbd/MbdReco.h>
0033 
0034 // #include <evtidreporter/EvtIDReporter.h>
0035 
0036 // R__LOAD_LIBRARY(libfun4all.so)
0037 // R__LOAD_LIBRARY(libfun4allraw.so)
0038 // R__LOAD_LIBRARY(libffarawmodules.so)
0039 
0040 
0041 /////////////////////////////////////////////////////////////////
0042 // note : for clustering in Z axis
0043 // #include <GlobalVariables.C>
0044 
0045 // #include <G4_ActsGeom.C>
0046 // #include <G4_TrkrVariables.C>
0047 // #include <intt/InttClusterizer.h>
0048 /////////////////////////////////////////////////////////////////
0049 
0050 R__LOAD_LIBRARY(libfun4all.so)
0051 R__LOAD_LIBRARY(libInttZVertexFinderTrapezoidal.so)
0052 
0053 
0054 int F4AINTTzTrapezoidal()
0055 {
0056     int process_id = 0;
0057     int run_num = 54280;
0058     int nevents = 5000;
0059     string inputDST_directory = "/sphenix/tg/tg01/commissioning/INTT/work/cwshih/seflgendata/run_54280/From_official_INTTRAWHIT_DST_ColdHotChannelMask/completed";
0060     string inputDST_filename  = "DST_physics_intt-54280_HotChannel_BCOCut_CaloCombined_00000.root";
0061     string outputDST_directory = "/sphenix/user/ChengWei/sPH_analysis_repo/INTTvtxZTrapezoidal/macro";
0062     string outputDST_filename  = "DSTvtxZTrapezoidal.root";
0063     
0064     pair<double, double> vertexXYIncm = {-0.0215087, 0.223197};
0065     bool IsFieldOn = false;
0066     bool IsDCACutApplied = true;
0067     std::pair<std::pair<double,double>,std::pair<double,double>> DeltaPhiCutInDegree = {{-0.5, 0.5},{-1000.,1000.}}; // note : in degree
0068     std::pair<std::pair<double,double>,std::pair<double,double>> DCAcutIncm = {{-0.1,0.1},{-1000.,1000.}}; // note : in cm
0069     int ClusAdcCut = 35;
0070     int ClusPhiSizeCut = 5;
0071     bool PrintRecoDetails = true;
0072  
0073 
0074     TStopwatch* watch = new TStopwatch();
0075     watch->Start();
0076     
0077     ////////////////////////////////////////////////////////////////////////
0078     string run_type = "physics";
0079     int total_run_len = 5;
0080     string run_num_str = to_string( run_num );
0081     run_num_str.insert(0, total_run_len - run_num_str.size(), '0');
0082 
0083 
0084 
0085     Fun4AllServer* se = Fun4AllServer::instance();
0086     // se->Verbosity(10000000);
0087 
0088     // just if we set some flags somewhere in this macro
0089     recoConsts *rc = recoConsts::instance();
0090     
0091     Enable::CDB = true;
0092     rc->set_StringFlag("CDB_GLOBALTAG",CDB::global_tag);
0093     // 64 bit timestamp
0094     rc->set_uint64Flag("TIMESTAMP",CDB::timestamp);
0095     rc->set_IntFlag("RUNNUMBER", run_num );
0096 
0097 
0098     Fun4AllInputManager *in = new Fun4AllDstInputManager("DST_track");
0099     in->Verbosity(2);
0100     in->AddFile( inputDST_directory + "/" + inputDST_filename);
0101     // in->AddListFile( list_file_intt ); 
0102     // in->AddListFile( list_file_calo );
0103     in->Print("ALL");
0104     se->registerInputManager(in);
0105     // in->Print("ALL");  
0106 
0107     //Enable::BBC = true;
0108     Enable::MVTX = true;
0109     Enable::INTT = true;
0110     Enable::TPC = true;
0111     Enable::MICROMEGAS = true;
0112     G4Init();
0113     G4Setup();
0114 
0115     TrackingInit();
0116 
0117     // note : INTT vertex Z trapezoidal
0118     InttZVertexFinderTrapezoidal * inttz = new InttZVertexFinderTrapezoidal(
0119         "inttz",
0120         vertexXYIncm,
0121         IsFieldOn,
0122         IsDCACutApplied,
0123         DeltaPhiCutInDegree,
0124         DCAcutIncm,
0125         ClusAdcCut,
0126         ClusPhiSizeCut,
0127         PrintRecoDetails
0128     );
0129     se->registerSubsystem(inttz);
0130 
0131     Fun4AllOutputManager* out = new Fun4AllDstOutputManager("DST", outputDST_directory + "/" + outputDST_filename);
0132     se->registerOutputManager(out);
0133 
0134     se->run(nevents);
0135     se->End();
0136 
0137     return 0;
0138 }