-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunPicoD0AnaMaker.C.old
126 lines (101 loc) · 4.49 KB
/
runPicoD0AnaMaker.C.old
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
/* **************************************************
* A macro to run StPicoD0AnaMaker
*
* Authors: **Mustafa Mustafa ([email protected])
*
* **Code Maintainer
*
* **************************************************
*/
void runPicoD0AnaMaker(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 = "SL15c";
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("StPicoD0AnaMaker");
gSystem->Load("StPicoHFMaker");
gSystem->Load("StRefMultCorr");
gSystem->Load("StPicoMixedEventMaker");
chain = new StChain();
// create list of picoDst files
TString command = "sed 's/hft\\\/d0tree/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/kfProd2/physics2/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, "mixTest", "");
StPicoD0AnaMaker* picoD0AnaMaker = new StPicoD0AnaMaker("picoD0AnaMaker", d0list, outFileName.Data(), picoDstMaker, mixedEventMaker);
//Need to check the input here -- may need to change the constructor to not have the other inputs
StHFCuts* d0Cuts = new StHFCuts("d0Cuts");
picoD0AnaMaker->setHFCuts(d0Cuts);
// -------------- USER variables -------------------------
// -- File name of bad run list
d0Cuts->setBadRunListFileName(badRunListFileName);
// add your cuts here.
//
d0Cuts->setCutRequireHFT(true);
d0Cuts->setCutVzMax(6.0);
d0Cuts->setCutVzVpdVzMax(3.0);
d0Cuts->setCutPionPtRange(0.15, 10.0);
d0Cuts->setCutKaonPtRange(0.15, 10.0);
// tracking
d0Cuts->setCutNHitsFitMax(20);
d0Cuts->setCutNHitsFitnHitsMax(0.52);
// pions
d0Cuts->setCutTPCNSigmaPion(3.0);
// kaons
d0Cuts->setCutTPCNSigmaKaon(2.0);
// kaonPion pair cuts
float dcaDaughtersMax = 0.0065; // maximum
float decayLengthMin = 0.008; // minimum
float decayLengthMax = 999999; //std::numeric_limits<float>::max();
float cosThetaMin = 0.855555; // minimum
float minMass = 1.6;
float maxMass = 2.1;
d0Cuts->setCutSecondaryPair(dcaDaughtersMax, decayLengthMin, decayLengthMax, cosThetaMin, minMass, maxMass);
chain->Init();
int per = 0;
int nEntries = picoD0AnaMaker->getEntries();
for (int iEvent = 0; iEvent < nEntries; ++iEvent)
{
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());
}