31 #include <G4_Magnet.C>
45 #include <caloreco/RawClusterBuilderTopo.h>
46 #include <particleflowreco/ParticleFlowReco.h>
48 #include "/sphenix/user/danderson/install/include/scorrelatorjettree/SCorrelatorJetTree.h"
51 R__LOAD_LIBRARY(libg4eval.so)
52 R__LOAD_LIBRARY(libfun4all.so)
53 R__LOAD_LIBRARY(libcalo_reco.so)
54 R__LOAD_LIBRARY(libparticleflow.so)
55 R__LOAD_LIBRARY(/sphenix/user/danderson/install/lib/libscorrelatorjettree.so)
58 using namespace SColdQcdCorrelatorAnalysis;
75 const bool doTruthTableReco(
false);
77 const double nSigma(1.5);
80 const double showerR(0.025);
81 const double noiseLevels[
NTopoPar] = {0.0025, 0.006, 0.03};
82 const double significance[
NTopoPar] = {4.0, 2.0, 0.0};
83 const double localMinE[
NTopoPar] = {1.0, 2.0, 0.5};
86 const bool doSplit(
true);
87 const bool allowCorners(
true);
90 const bool isMC(
true);
91 const bool isEmbed(
false);
92 const bool doDebug(
false);
93 const bool saveDst(
true);
94 const bool doVtxCut(
false);
95 const bool doQuality(
true);
96 const bool requireSiSeeds(
true);
97 const bool useOnlyPrimVtx(
true);
98 const bool doDcaSigmaCut(
false);
99 const bool checkWeirdTrks(
false);
100 const bool maskTpcSectors(
false);
101 const bool addTracks(
true);
102 const bool addECal(
false);
103 const bool addHCal(
false);
104 const bool addParticleFlow(
false);
107 const double jetRes = 0.4;
108 const unsigned int jetType = 0;
109 const auto jetAlgo = SCorrelatorJetTree::ALGO::ANTIKT;
110 const auto jetReco = SCorrelatorJetTree::RECOMB::PT_SCHEME;
113 const pair<double, double> vzEvtRange = {-10., 10.};
114 const pair<double, double> vrEvtRange = {0.0, 0.418};
117 const pair<double, double> ptParRange = {0., 9999.};
118 const pair<double, double> etaParRange = {-1.1, 1.1};
121 const pair<double, double> ptTrackRange = {0.2, 100.};
122 const pair<double, double> etaTrackRange = {-1.1, 1.1};
123 const pair<double, double> qualTrackRange = {0., 10.};
124 const pair<double, double> nMvtxTrackRange = {2., 100.};
125 const pair<double, double> nInttTrackRange = {1., 100.};
126 const pair<double, double> nTpcTrackRange = {33., 100.};
127 const pair<double, double> dcaTrackRangeXY = {-0.06, 0.06};
128 const pair<double, double> dcaTrackRangeZ = {-0.20, 0.20};
129 const pair<double, double> deltaPtTrackRange = {0., 0.04};
132 const pair<double, double> dcaPtFitMax = {15., 15.};
133 const pair<double, double> nDcaSigmaTrack = {3., 3.};
134 const vector<double> dcaSigmaParamsXY = {-0.0095, 0.091, -0.029};
135 const vector<double> dcaSigmaParamsZ = {1.73, 26.1, -9.45};
138 const pair<double, double> ptFlowRange = {0.2, 9999.};
139 const pair<double, double> etaFlowRange = {-1.1, 1.1};
142 const pair<double, double> ptECalRange = {0.3, 9999.};
143 const pair<double, double> etaECalRange = {-1.1, 1.1};
144 const pair<double, double> ptHCalRange = {0.3, 9999.};
145 const pair<double, double> etaHCalRange = {-1.1, 1.1};
148 gSystem ->
Load(
"libg4dst.so");
149 gSystem ->
Load(
"libFROG.so");
157 if (outDir.substr(outDir.size() - 1, 1) !=
"/") {
160 outDir += recoName +
"/";
162 string fileNumber = sInputLists[0];
163 size_t findLastDash = fileNumber.find_last_of(
"-");
164 if (findLastDash != string::npos) {
165 fileNumber.erase(0, findLastDash + 1);
167 string remove_this =
".list";
169 size_t pos = fileNumber.find(remove_this);
170 if (pos != string::npos) {
171 fileNumber.erase(pos, remove_this.length());
175 string outputFileName =
"outputData_" + recoName +
"_" + fileNumber +
".root";
176 string outputRecoDir = outDir +
"/inReconstruction/";
177 string makeDirectory =
"mkdir -p " + outputRecoDir;
179 system(makeDirectory.c_str());
183 for (
unsigned int iMan = 0; iMan < sInputLists.size(); ++iMan) {
185 inFileMan -> AddListFile(sInputLists[iMan]);
186 ffaServer -> registerInputManager(inFileMan);
218 if (doTruthTableReco) {
222 ffaServer -> registerSubsystem(tables);
227 if (addParticleFlow) {
232 ecalClusterBuilder -> set_nodename(
"TOPOCLUSTER_EMCAL");
233 ecalClusterBuilder -> set_enable_HCal(enableHCal[0]);
234 ecalClusterBuilder -> set_enable_EMCal(enableECal[0]);
235 ecalClusterBuilder -> set_noise(noiseLevels[0], noiseLevels[1], noiseLevels[2]);
236 ecalClusterBuilder -> set_significance(significance[0], significance[1], significance[2]);
237 ecalClusterBuilder -> allow_corner_neighbor(allowCorners);
238 ecalClusterBuilder -> set_do_split(doSplit);
239 ecalClusterBuilder -> set_minE_local_max(localMinE[0], localMinE[1], localMinE[2]);
240 ecalClusterBuilder -> set_R_shower(showerR);
241 ffaServer -> registerSubsystem(ecalClusterBuilder);
245 hcalClusterBuilder -> set_nodename(
"TOPOCLUSTER_HCAL");
246 hcalClusterBuilder -> set_enable_HCal(enableHCal[1]);
247 hcalClusterBuilder -> set_enable_EMCal(enableECal[1]);
248 hcalClusterBuilder -> set_noise(noiseLevels[0], noiseLevels[1], noiseLevels[2]);
249 hcalClusterBuilder -> set_significance(significance[0], significance[1], significance[1]);
250 hcalClusterBuilder -> allow_corner_neighbor(allowCorners);
251 hcalClusterBuilder -> set_do_split(doSplit);
252 hcalClusterBuilder -> set_minE_local_max(localMinE[0], localMinE[1], localMinE[2]);
253 hcalClusterBuilder -> set_R_shower(showerR);
254 ffaServer -> registerSubsystem(hcalClusterBuilder);
258 parFlowReco -> set_energy_match_Nsigma(nSigma);
260 ffaServer -> registerSubsystem(parFlowReco);
266 correlatorJetTree -> SetDoVertexCut(doVtxCut);
267 correlatorJetTree -> SetDoQualityPlots(doQuality);
268 correlatorJetTree -> SetAddTracks(addTracks);
269 correlatorJetTree -> SetAddFlow(addParticleFlow);
270 correlatorJetTree -> SetAddECal(addECal);
271 correlatorJetTree -> SetAddHCal(addHCal);
272 correlatorJetTree -> SetEvtVzRange(vzEvtRange);
273 correlatorJetTree -> SetEvtVrRange(vrEvtRange);
275 correlatorJetTree -> SetParPtRange(ptParRange);
276 correlatorJetTree -> SetParEtaRange(etaParRange);
279 correlatorJetTree -> SetRequireSiSeeds(requireSiSeeds);
280 correlatorJetTree -> SetUseOnlyPrimVtx(useOnlyPrimVtx);
281 correlatorJetTree -> SetMaskTpcSectors(maskTpcSectors);
282 correlatorJetTree -> SetCheckWeirdTrks(checkWeirdTrks);
283 correlatorJetTree -> SetTrackPtRange(ptTrackRange);
284 correlatorJetTree -> SetTrackEtaRange(etaTrackRange);
285 correlatorJetTree -> SetTrackQualityRange(qualTrackRange);
286 correlatorJetTree -> SetTrackNMvtxRange(nMvtxTrackRange);
287 correlatorJetTree -> SetTrackNInttRange(nInttTrackRange);
288 correlatorJetTree -> SetTrackNTpcRange(nTpcTrackRange);
289 correlatorJetTree -> SetTrackDcaRangeXY(dcaTrackRangeXY);
290 correlatorJetTree -> SetTrackDcaRangeZ(dcaTrackRangeZ);
291 correlatorJetTree -> SetTrackDeltaPtRange(deltaPtTrackRange);
293 correlatorJetTree -> SetTrackDcaSigmaParameters(doDcaSigmaCut, dcaPtFitMax, nDcaSigmaTrack, dcaSigmaParamsXY, dcaSigmaParamsZ);
296 if (addParticleFlow) {
297 correlatorJetTree -> SetFlowPtRange(ptFlowRange);
298 correlatorJetTree -> SetFlowEtaRange(etaFlowRange);
301 correlatorJetTree -> SetECalPtRange(ptECalRange);
302 correlatorJetTree -> SetECalEtaRange(etaECalRange);
305 correlatorJetTree -> SetHCalPtRange(ptHCalRange);
306 correlatorJetTree -> SetHCalEtaRange(etaHCalRange);
308 correlatorJetTree -> SetJetParameters(jetRes, jetType, jetAlgo, jetReco);
309 correlatorJetTree -> SetSaveDST(saveDst);
310 ffaServer -> registerSubsystem(correlatorJetTree);
313 ifstream
file(outputRecoFile.c_str());
315 string moveOutput =
"mv " + outputRecoFile +
" " + outDir;
316 system(moveOutput.c_str());
318 string rmOutput =
"rm " + outDir +
"CorrelatorJetTree_" + fileNumber +
".root";
319 string rmLog =
"rm /sphenix/user/danderson/eec/submit/logs/" + fileNumber +
".*";
320 system(rmOutput.c_str());
321 system(rmLog.c_str());