62 #include <strstream.h>
63 #include "/afs/rhic.bnl.gov/star/packages/SL02i/StRoot/StEventUtilities/BetheBlochFunction.hh"
66 void BetheBlochCalibrator(){
72 gSystem->Load(
"St_base");
73 gSystem->Load(
"St_Tables");
74 gSystem->Load(
"StUtilities");
75 gSystem->Load(
"StarClassLibrary");
76 gSystem->Load(
"StEvent");
77 gSystem->Load(
"StEventUtilities");
80 bool monitorFitting=
true;
84 char* dedxMean=
"mDedx";
85 char* NTpcHitsOnTrack=
"mNdedxPts";
86 char* momentum=
"(mPt/sqrt(1-(tanh(mEta)*tanh(mEta))))";
98 const int NParameters=7;
99 const double pars[NParameters]={1.09344, 0.0199, -4.46121e-08, 1., 1., 4.12976e-07, 0.0005};
101 double theCalib=pars[5];
104 double minimumIonizingPionStart=0.475;
105 double minimumIonizingPionEnd =0.525;
107 double mimimumIonizingPionPosition
108 =(minimumIonizingPionEnd+minimumIonizingPionStart)/2.;
111 double protonTestStart = 0.525;
112 double protonTestEnd = 0.575;
113 double protonTestPosition
114 =(protonTestStart+protonTestEnd)/2.;
117 TF1* pionPlusBandCenter
118 =
new TF1(
"pionPlusBandCenter",BetheBlochFunction, 0.02,5, NParameters);
119 pionPlusBandCenter->SetParameters(&pars[0]);
120 pionPlusBandCenter->SetParameter(4,0.13957);
123 TF1* protonBandCenter
124 =
new TF1(
"protonBandCenter",BetheBlochFunction, 0.02,5, NParameters);
125 protonBandCenter->SetParameters(&pars[0]);
126 protonBandCenter->SetParameter(4, 0.93827);
129 double delta(
double calib,
double pionPosition,
double protonPosition){
131 pionPlusBandCenter->SetParameter(5,calib);
132 protonBandCenter->SetParameter(5,calib);
134 return (protonBandCenter->Eval(protonPosition,0,0)-
135 pionPlusBandCenter->Eval(pionPosition,0,0));
139 double minimumIonizingdEdx(
double calib,
double pionPosition){
140 pionPlusBandCenter->SetParameter(5,calib);
142 return pionPlusBandCenter->Eval(pionPosition,0,0);
145 double look4MinDeltaDiff(
double calibStart,
double calibEnd,
int calibSteps,
double pionPosition,
double protonPosition,
double DeltaRef){
147 double calibSeg=(calibEnd-calibStart)/
double(calibSteps);
148 double thisCalib=calibStart;
149 double minDeltaDiffCalib=5000;
150 double minDeltaDiff=5000;
154 double myDelta=delta(thisCalib,pionPosition,protonPosition);
155 double diff=TMath::Abs(myDelta-DeltaRef);
156 if (diff<minDeltaDiff) {
158 minDeltaDiffCalib=thisCalib;
161 thisCalib=thisCalib+calibSeg;
162 }
while(thisCalib<calibEnd);
164 return minDeltaDiffCalib;
179 TChain chain(
"FlowTree");
186 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010010.flowpicoevent.root");
187 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010020.flowpicoevent.root");
188 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010030.flowpicoevent.root");
189 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010040.flowpicoevent.root");
190 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010050.flowpicoevent.root");
191 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010060.flowpicoevent.root");
192 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010070.flowpicoevent.root");
193 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010080.flowpicoevent.root");
194 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010090.flowpicoevent.root");
195 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010100.flowpicoevent.root");
196 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010110.flowpicoevent.root");
197 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010120.flowpicoevent.root");
198 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010130.flowpicoevent.root");
202 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010140.flowpicoevent.root");
203 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0010150.flowpicoevent.root");
204 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020010.flowpicoevent.root");
205 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020020.flowpicoevent.root");
206 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020030.flowpicoevent.root");
207 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020040.flowpicoevent.root");
208 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020050.flowpicoevent.root");
209 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020060.flowpicoevent.root");
210 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020070.flowpicoevent.root");
211 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020080.flowpicoevent.root");
212 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020090.flowpicoevent.root");
213 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020100.flowpicoevent.root");
214 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020110.flowpicoevent.root");
215 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020120.flowpicoevent.root");
216 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020130.flowpicoevent.root");
217 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020140.flowpicoevent.root");
218 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020150.flowpicoevent.root");
219 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0020160.flowpicoevent.root");
220 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030010.flowpicoevent.root");
221 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030020.flowpicoevent.root");
222 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030030.flowpicoevent.root");
223 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030040.flowpicoevent.root");
224 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030050.flowpicoevent.root");
225 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030070.flowpicoevent.root");
226 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030080.flowpicoevent.root");
227 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030090.flowpicoevent.root");
228 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030100.flowpicoevent.root");
229 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030110.flowpicoevent.root");
230 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030120.flowpicoevent.root");
231 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030130.flowpicoevent.root");
232 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030140.flowpicoevent.root");
233 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0030150.flowpicoevent.root");
234 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040010.flowpicoevent.root");
235 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040020.flowpicoevent.root");
236 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040030.flowpicoevent.root");
237 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040040.flowpicoevent.root");
238 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040050.flowpicoevent.root");
239 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040060.flowpicoevent.root");
240 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040070.flowpicoevent.root");
241 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040080.flowpicoevent.root");
242 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040090.flowpicoevent.root");
243 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040100.flowpicoevent.root");
244 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040110.flowpicoevent.root");
245 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040120.flowpicoevent.root");
246 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040130.flowpicoevent.root");
247 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040140.flowpicoevent.root");
248 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034002_raw_0040150.flowpicoevent.root");
249 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034004_raw_0020010.flowpicoevent.root");
250 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034004_raw_0030010.flowpicoevent.root");
251 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034004_raw_0040010.flowpicoevent.root");
252 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0010010.flowpicoevent.root");
253 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0010020.flowpicoevent.root");
254 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0010030.flowpicoevent.root");
255 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0010040.flowpicoevent.root");
256 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0010050.flowpicoevent.root");
257 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0010060.flowpicoevent.root");
258 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0010070.flowpicoevent.root");
259 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0010080.flowpicoevent.root");
260 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0020010.flowpicoevent.root");
261 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0020020.flowpicoevent.root");
262 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0020030.flowpicoevent.root");
263 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0020040.flowpicoevent.root");
264 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0020050.flowpicoevent.root");
265 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0020060.flowpicoevent.root");
266 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0020070.flowpicoevent.root");
267 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0020080.flowpicoevent.root");
268 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0030010.flowpicoevent.root");
269 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0030020.flowpicoevent.root");
270 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0030030.flowpicoevent.root");
271 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0030040.flowpicoevent.root");
272 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0030050.flowpicoevent.root");
273 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0030060.flowpicoevent.root");
274 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0030070.flowpicoevent.root");
275 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0030080.flowpicoevent.root");
276 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0040010.flowpicoevent.root");
277 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0040020.flowpicoevent.root");
278 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0040030.flowpicoevent.root");
279 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0040040.flowpicoevent.root");
280 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0040050.flowpicoevent.root");
281 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0040060.flowpicoevent.root");
282 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0040070.flowpicoevent.root");
283 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034005_raw_0040080.flowpicoevent.root");
284 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010010.flowpicoevent.root");
285 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010020.flowpicoevent.root");
286 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010030.flowpicoevent.root");
287 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010040.flowpicoevent.root");
288 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010050.flowpicoevent.root");
289 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010060.flowpicoevent.root");
290 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010070.flowpicoevent.root");
291 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010080.flowpicoevent.root");
292 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010090.flowpicoevent.root");
293 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010100.flowpicoevent.root");
294 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010110.flowpicoevent.root");
295 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010120.flowpicoevent.root");
296 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010130.flowpicoevent.root");
297 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010140.flowpicoevent.root");
298 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0010150.flowpicoevent.root");
299 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020010.flowpicoevent.root");
300 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020020.flowpicoevent.root");
301 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020030.flowpicoevent.root");
302 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020040.flowpicoevent.root");
303 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020050.flowpicoevent.root");
304 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020060.flowpicoevent.root");
305 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020070.flowpicoevent.root");
306 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020080.flowpicoevent.root");
307 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020090.flowpicoevent.root");
308 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020100.flowpicoevent.root");
309 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020110.flowpicoevent.root");
310 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020120.flowpicoevent.root");
311 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020130.flowpicoevent.root");
312 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020140.flowpicoevent.root");
313 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0020150.flowpicoevent.root");
314 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030010.flowpicoevent.root");
315 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030020.flowpicoevent.root");
316 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030030.flowpicoevent.root");
317 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030040.flowpicoevent.root");
318 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030050.flowpicoevent.root");
319 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030060.flowpicoevent.root");
320 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030070.flowpicoevent.root");
321 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030080.flowpicoevent.root");
322 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030090.flowpicoevent.root");
323 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030100.flowpicoevent.root");
324 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030110.flowpicoevent.root");
325 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030120.flowpicoevent.root");
326 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030130.flowpicoevent.root");
327 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0030140.flowpicoevent.root");
328 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040010.flowpicoevent.root");
329 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040020.flowpicoevent.root");
330 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040030.flowpicoevent.root");
331 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040040.flowpicoevent.root");
332 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040050.flowpicoevent.root");
333 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040060.flowpicoevent.root");
334 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040070.flowpicoevent.root");
335 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040080.flowpicoevent.root");
336 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040090.flowpicoevent.root");
337 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040100.flowpicoevent.root");
338 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040110.flowpicoevent.root");
339 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040120.flowpicoevent.root");
340 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040130.flowpicoevent.root");
341 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034028_raw_0040140.flowpicoevent.root");
342 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034033_raw_0010010.flowpicoevent.root");
343 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034033_raw_0020010.flowpicoevent.root");
344 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034033_raw_0020020.flowpicoevent.root");
345 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034033_raw_0020030.flowpicoevent.root");
346 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034033_raw_0020040.flowpicoevent.root");
347 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034033_raw_0030010.flowpicoevent.root");
348 chain->Add(
"/afs/rhic.bnl.gov/star/users/aihong/ebye/Pico_P03iadAuTest/st_physics_4034033_raw_0040010.flowpicoevent.root");
364 TH1D* pionHisto=
new TH1D(
"pionHisto",
"dE/dx histo. for minimum ionizing pions",100,0.022e-4,0.03e-4);
366 double protonHistoCenter=protonBandCenter->Eval(protonTestPosition,0,0);
367 double protonHistoHalfRange=0.24e-5;
370 TH1D* protonHisto=
new TH1D(
"protonHisto",
"dE/dx histo. for proton",100,(protonHistoCenter-protonHistoHalfRange),(protonHistoCenter+protonHistoHalfRange));
376 strstream pionMtmCutStr;
378 pionMtmCutStr<<momentum<<
"<"<<minimumIonizingPionEnd<<
" && "<<momentum<<
">"<<minimumIonizingPionStart;
381 TCut pionMtmCut=pionMtmCutStr.str();
383 strstream pionMeanCutStr;
384 pionMeanCutStr<<dedxMean<<
"<5.0e-5";
386 TCut pionMeanCut=pionMeanCutStr.str();
388 strstream tpcpointsCutStr;
389 tpcpointsCutStr<<NTpcHitsOnTrack<<
">15";
392 TCut tpcpointsCut=tpcpointsCutStr.str();
395 TCut totalPionCut=pionMtmCut+pionMeanCut+tpcpointsCut;
397 strstream pionHistoDump;
398 pionHistoDump<<dedxMean<<
">>pionHisto";
400 chain->Draw(pionHistoDump.str(),totalPionCut.GetTitle());
404 strstream protonMtmCutStr;
406 protonMtmCutStr<<momentum<<
"<"<<protonTestEnd<<
" && "<<momentum<<
">"<<protonTestStart;
408 TCut protonMtmCut=protonMtmCutStr.str();
410 strstream protonMeanCutStr;
411 protonMeanCutStr<<dedxMean<<
"<5.0e-5";
413 TCut protonMeanCut=protonMeanCutStr.str();
415 TCut totalProtonCut=protonMtmCut+protonMeanCut+tpcpointsCut;
416 strstream protonHistoDump;
417 protonHistoDump<<dedxMean<<
">>protonHisto";
419 chain->Draw(protonHistoDump.str(),totalProtonCut.GetTitle());
423 TF1* protonGaus=
new TF1(
"protonGaus",
"gaus",(protonHistoCenter-protonHistoHalfRange*0.7),(protonHistoCenter+protonHistoHalfRange*0.8));
424 protonGaus->SetParLimits(1,protonHistoCenter*0.7,protonHistoCenter*1.3);
425 protonHisto->Fit(
"protonGaus",
"R");
426 double protonReference=protonGaus->GetParameter(1);
429 double pionPeakPosition
430 =pionHisto->GetBinCenter(pionHisto->GetMaximumBin());
431 double pionFitHalfRange=0.025e-5;
432 TF1* pionGaus=
new TF1(
"pionGaus",
"gaus",(pionPeakPosition-pionFitHalfRange),(pionPeakPosition+pionFitHalfRange));
433 pionHisto->Fit(
"pionGaus",
"R");
434 double pionReference=pionGaus->GetParameter(1);
438 TCanvas* pionCanvas=
new TCanvas(
"pion");
441 TCanvas* protonCanvas=
new TCanvas(
"proton");
447 double deltaReference=protonReference-pionReference;
452 double calibResult=look4MinDeltaDiff(theCalib*0.7, theCalib*1.3, 100,mimimumIonizingPionPosition ,protonTestPosition , deltaReference);
456 double pars[2] = pars[2]+minimumIonizingdEdx(calibResult,mimimumIonizingPionPosition )-pionReference;
458 double pars[5]=calibResult;
461 cout<<
" *************************************"<<endl;
462 cout<<
" * the calibrated parameters are: *"<<endl;
463 cout<<
" *************************************"<<endl;
467 for (
int j=0; j<3; j++)
469 cout<<
"charge, mass, ";
470 cout<<pars[5]<<
", "<<pars[6]<<
" }"<<endl<<endl;