File indexing completed on 2025-08-06 08:21:01
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
0009 #include <fun4all/Fun4AllDstOutputManager.h>
0010 #include <litecaloeval/LiteCaloEval.h>
0011
0012 #include <calib_emc_pi0/CaloCalibEmc_Pi0.h>
0013
0014 #include <caloreco/RawClusterBuilderGraph.h>
0015 #include <caloreco/RawClusterBuilderTemplate.h>
0016 #include <caloreco/RawClusterPositionCorrection.h>
0017 #include <caloreco/RawTowerCalibration.h>
0018
0019
0020 R__LOAD_LIBRARY(libfun4all.so)
0021
0022 R__LOAD_LIBRARY(libcalo_reco.so)
0023 R__LOAD_LIBRARY(libcalibCaloEmc_pi0.so)
0024 R__LOAD_LIBRARY(libLiteCaloEvalTowSlope.so)
0025
0026
0027 #endif
0028
0029
0030 void srundst_mdc2_clustest(
0031 const int nEvents = 5,
0032 const string &outputFile = "secoutput4_raw",
0033 const string &inputFile0 = "ongoing/dstnewoutput5_calo5.root"
0034
0035
0036 )
0037 {
0038
0039
0040
0041 Fun4AllServer *se = Fun4AllServer::instance();
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070 Fun4AllInputManager *in = new Fun4AllDstInputManager("in");
0071
0072
0073
0074 in->AddFile(inputFile0.c_str());
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092 se->registerInputManager(in);
0093
0094
0095 RawClusterBuilderTemplate *ClusterBuilder = new RawClusterBuilderTemplate("EmcRawClusterBuilderTemplate");
0096 ClusterBuilder->Detector("CEMC");
0097
0098 ClusterBuilder->set_threshold_energy(0.030);
0099 std::string emc_prof = getenv("CALIBRATIONROOT");
0100 emc_prof += "/EmcProfile/CEMCprof_Thresh30MeV.root";
0101 ClusterBuilder->LoadProfile(emc_prof);
0102 se->registerSubsystem(ClusterBuilder);
0103
0104
0105 RawClusterPositionCorrection *clusterCorrection = new RawClusterPositionCorrection("CEMC");
0106
0107 clusterCorrection->Get_eclus_CalibrationParameters().ReadFromFile("CEMC_RECALIB", "xml", 0, 0,
0108
0109 string(getenv("CALIBRATIONROOT")) + string("/CEMC/PositionRecalibration_EMCal_9deg_tilt/"));
0110 clusterCorrection->Get_ecore_CalibrationParameters().ReadFromFile("CEMC_ECORE_RECALIB", "xml", 0, 0,
0111
0112 string(getenv("CALIBRATIONROOT")) + string("/CEMC/PositionRecalibration_EMCal_9deg_tilt/"));
0113
0114
0115
0116 se->registerSubsystem(clusterCorrection);
0117
0118
0119
0120 RawClusterBuilderTemplate *ClusterBuilder2 = new RawClusterBuilderTemplate("EmcRawClusterBuilderTemplate2");
0121 ClusterBuilder2->Detector("CEMC");
0122
0123 ClusterBuilder2->set_threshold_energy(0.030);
0124 std::string emc_prof2 = getenv("CALIBRATIONROOT");
0125 emc_prof2 += "/EmcProfile/CEMCprof_Thresh30MeV.root";
0126 ClusterBuilder2->LoadProfile(emc_prof2);
0127 ClusterBuilder2->set_UseTowerInfo(1);
0128 se->registerSubsystem(ClusterBuilder2);
0129
0130 RawClusterPositionCorrection *clusterCorrection2 = new RawClusterPositionCorrection("CEMC");
0131
0132 clusterCorrection2->set_UseTowerInfo(1);
0133 if (false)
0134 {
0135 clusterCorrection2->Get_eclus_CalibrationParameters().ReadFromCDB("CEMCRECALIB");
0136 clusterCorrection2->Get_ecore_CalibrationParameters().ReadFromCDB("CEMC_ECORE_RECALIB");
0137 }
0138 else
0139 {
0140 clusterCorrection2->Get_eclus_CalibrationParameters().ReadFromFile("CEMC_RECALIB", "xml", 0, 0,
0141
0142 string(getenv("CALIBRATIONROOT")) + string("/CEMC/PositionRecalibration_EMCal_9deg_tilt/"));
0143 clusterCorrection2->Get_ecore_CalibrationParameters().ReadFromFile("CEMC_ECORE_RECALIB", "xml", 0, 0,
0144
0145 string(getenv("CALIBRATIONROOT")) + string("/CEMC/PositionRecalibration_EMCal_9deg_tilt/"));
0146 }
0147
0148
0149 se->registerSubsystem(clusterCorrection2);
0150
0151
0152
0153 string outputFile2 = outputFile.c_str();
0154 outputFile2 = outputFile2 + ".root";
0155 string outputfile5 = outputFile2 + "_cemc_eval5.root";
0156 string outputFile3 = outputFile2 + "_cemc_eval3.root";
0157
0158
0159
0160 LiteCaloEval *eval5 = new LiteCaloEval("CEMCEVALUATOR2", "CEMC", outputfile5.c_str());
0161
0162 eval5->CaloType(LiteCaloEval::CEMC);
0163 se->registerSubsystem(eval5);
0164
0165
0166 CaloCalibEmc_Pi0 *eval_pi1 = new CaloCalibEmc_Pi0("CEMC_CALIB_PI0", outputFile2);
0167
0168
0169 se->registerSubsystem(eval_pi1);
0170
0171
0172 CaloCalibEmc_Pi0 *eval_pi2 = new CaloCalibEmc_Pi0("CEMC_CALIB_PI02", outputFile3);
0173
0174
0175 eval_pi2->set_UseTowerInfo(1);
0176 se->registerSubsystem(eval_pi2);
0177 cout << "successful registration of pi0 2" << endl;
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189 se->run(nEvents);
0190 se->End();
0191 se->PrintTimer();
0192
0193 }