-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunPicoHHCorrMaker.C
132 lines (99 loc) · 4.36 KB
/
runPicoHHCorrMaker.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/* **************************************************
* A macro to run StPicoHHCorrMaker
*
* Authors: Alex Jentsch
*
*
*
* **************************************************
*/
void runPicoHHCorrMaker(TString d0list, TString outFileName, TString badRunListFileName = "/global/homes/a/ajentsch/myAnalysis/picoList_bad_MB.list")
//void runPicoD0AnaMaker(TString d0list = "test200k.list", TString outFileName = "test.root", TString badRunListFileName = "/global/homes/a/ajentsch/myAnalysis
//picoList_bad_MB.list")
{
//Check STAR Library. Please set SL_version to the original star library used in the production from http://www.star.bnl.gov/devcgi/dbProdOptionRetrv.pl
string SL_version = "SL16d";
string env_SL = getenv("STAR");
if (env_SL.find(SL_version) == string::npos)
{
cout << "Environment Star Library does not match the requested library in runPicoD0EventMaker.C. Exiting..." << endl;
exit(1);
}
gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
loadSharedLibraries();
gSystem->Load("StBTofUtil");
gSystem->Load("StPicoDstMaker");
gSystem->Load("StPicoPrescales");
gSystem->Load("StPicoCutsBase");
gSystem->Load("StPicoCutsBase");
gSystem->Load("StPicoD0EventMaker");
gSystem->Load("StPicoHHCorrMaker");
gSystem->Load("StPicoHFMaker");
gSystem->Load("StRefMultCorr");
gSystem->Load("StMixedEventBuffer");
chain = new StChain();
// create list of picoDst files
TString command = "sed 's/hft/picodsts/g' " + d0list + " >correspondingPico.list";
gSystem->Exec(command.Data());
command = "sed -i 's/picoD0/picoDst/g' correspondingPico.list";
gSystem->Exec(command.Data());
command = "sed -i 's/Pico16a/physics2/g' correspondingPico.list";
gSystem->Exec(command.Data());
command = "sed -i 's/D0//g' correspondingPico.list";
gSystem->Exec(command.Data());
StPicoDstMaker* picoDstMaker = new StPicoDstMaker(0, "correspondingPico.list", "picoDstMaker");
//StPicoD0AnaMaker* picoD0AnaMaker = new StPicoD0AnaMaker("picoD0AnaMaker", d0list, outFileName.Data(), picoDstMaker);
StRefMultCorr* grefmultCorrUtil = CentralityMaker::instance()->getgRefMultCorr();
cout<<"here"<<endl;
grefmultCorrUtil->setVzForWeight(6, -6.0, 6.0);
grefmultCorrUtil->readScaleForWeight("StRoot/StRefMultCorr/macros/weight_grefmult_vpd30_vpd5_Run14.txt");
for(Int_t i=0;i<6;i++){
cout << i << " " << grefmultCorrUtil->get(i, 0) << endl;
}
//StPicoMixedEventMaker* mixedEventMaker = new StPicoMixedEventMaker("picoMixedEventMaker", picoDstMaker, grefmultCorrUtil, "Buffer Name");
StPicoHHCorrMaker* picoHHCorrMaker = new StPicoHHCorrMaker("picoHHCorrMaker", d0list, outFileName.Data(), picoDstMaker);
//Need to check the input here -- may need to change the constructor to not have the other inputs
StHFCuts* hadronCuts = new StHFCuts("hadronCuts");
picoHHCorrMaker->setHFCuts(hadronCuts);
// -------------- USER variables -------------------------
// -- File name of bad run list
hadronCuts->setBadRunListFileName(badRunListFileName);
// add your cuts here.
//
hadronCuts->setCutRequireHFT(true); //BE SURE TO CHANGE IN ANA MAKER IF YOU CHANGE HERE FOR CUT FILE!
hadronCuts->setCutVzMax(6.0);
hadronCuts->setCutVzVpdVzMax(3.0);
//hadronCuts->setCutPionPtRange(0.15, 20.0);
//hadronCuts->setCutKaonPtRange(0.15, 20.0);
// tracking
hadronCuts->setCutNHitsFitMin(20);
hadronCuts->setCutNHitsFitnHitsMax(0.52);
hadronCuts->setCutPrimaryDCAtoVtxMax(3.0);
// pions
hadronCuts->setCutTPCNSigmaPion(3.0);
// kaons
hadronCuts->setCutTPCNSigmaKaon(2.0);
chain->Init();
int per = 0;
int nEntries = picoHHCorrMaker->getEntries();
//int nEntries = 50000;
for (int iEvent = 0; iEvent < nEntries; ++iEvent)
{
if(nEntries>=1000){
per = iEvent/(nEntries/100);
if (iEvent%(nEntries/10)==0 && nEntries>99){cout<<"working on event: "<<iEvent<<" ("<<per<<"%)"<<endl;}
}
chain->Clear();
int iret = chain->Make();
if (iret)
{
cout << "Bad return code!" << iret << endl;
break;
}
}
chain->Finish();
delete chain;
// delete list of picos
command = "rm -f correspondingPico.list";
gSystem->Exec(command.Data());
}