showBananas2.cxx 17.6 KB
Newer Older
1 2 3 4 5 6 7 8
#include "TSystem.h"
#include "TFile.h"
#include "TTree.h"
#include "TChain.h"
#include "TCanvas.h"
#include "TBox.h"
#include "TCut.h"
#include "TCutG.h"
9
#include "TStopwatch.h"
10 11 12 13

using std::cout;
using std::endl;

14 15 16
void showBananas2() {

	Long64_t drawEntries = 10000000;
17 18 19

//	TFile *fr = new TFile("~/data/exp1804/h5_11_00.root");
	TChain *tr = new TChain("AnalysisxTree");
20
//	tr->Add("~/data/exp1804/h5_14_0?.root");
21
	tr->Add("~/data/exp1804/be10_0?_?0.root");
22 23 24 25


	TChain *trCal = new TChain("cal");
//	trCal->Add("~/data/exp1804/h5_11_0?_calib.root");
26
//	trCal->Add("~/data/exp1804/h5_14_0?_calib.root");
27
	trCal->Add("~/data/exp1804/be10_0?_?0_calib.root");
28 29 30

	tr->AddFriend(trCal);

31 32 33 34 35 36
	TFile *fcal = new TFile("~/data/exp1804/calib/si_20_03_calib.root");
	TTree *tAlphaCal = (TTree*)fcal->Get("cal");
	tAlphaCal->SetMarkerColor(kRed);
	tAlphaCal->SetMarkerStyle(20);
	tAlphaCal->SetMarkerSize(.6);

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
	TFile *fc = new TFile("cutsIdentification.root", "READ");
	TCutG *cUS = (TCutG*)fc->Get("c7UpperShadow");
	TCutG *cLS = (TCutG*)fc->Get("c7LowerShadow");
	cLS->SetLineColor(kMagenta);
	TCutG *cMA = (TCutG*)fc->Get("c7MainAlpha");
	TCutG *cA = (TCutG*)fc->Get("c7All");
	TCutG *cBL = (TCutG*)fc->Get("cBeamLeft");
	TCutG *cBR = (TCutG*)fc->Get("cBeamRight");


//	const Int_t drawEntries = 6000000;
//	const Int_t drawEntries = tr->GetEntries();

	tr->GetListOfFiles()->Print();
	trCal->GetListOfFiles()->Print();

	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;

	TString varName;
	TString condition;

59 60 61 62 63 64 65 66 67
//	cout << drawEntries << " entries in input chain will be processed." << endl;

	TString timeSiLeftCondition;
	timeSiLeftCondition.Form("(SQLXtime[0]>0");
	for (Int_t j = 1; j<32; j++) {
		condition.Form("|| SQLXtime[%d]>0", j);
		timeSiLeftCondition.Append(condition);
	}
	timeSiLeftCondition.Append(")");
68

69 70 71 72 73
	Int_t firstThinStrip = 5;


	TStopwatch stopwatch;
	stopwatch.Start();
74 75 76 77 78

/////////////////////////////////////////////////////////////////////
//	c1


79 80
	/*TCanvas *c1 = new TCanvas("c1", "time in thin detector", 1600, 1200);
	c1->Divide(4,4);
81

82
	firstThinStrip = 0;
83

84 85 86 87 88 89 90
	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 10000000;
	cout << drawEntries << " entries in input chain will be processed." << endl;

	for (Int_t i = 0; i < 16; i++) {
		c1->cd(i+1);
91

92 93
		varName.Form("SQ20E[%d]:tSQ20[%d]*0.3", i+firstThinStrip, i+firstThinStrip);
		condition.Form("tSQ20[%d]>0 && SQ20E[%d]>1.2", i+firstThinStrip, i+firstThinStrip);
94 95 96 97

		tr->SetMarkerColor(kBlack);
		tr->SetMarkerStyle(20);
		tr->SetMarkerSize(0.1);
98
		tr->Draw(varName, condition, "col", drawEntries);
99
		c1->Update();
100 101 102
	}//*/

//	return;
103 104 105 106

/////////////////////////////////////////////////////////////////////
//	c2

107 108
	/*TCanvas *c2 = new TCanvas("c2", "time issues in 32 X-strips: 0-15", 1600, 1200);
	c2->Divide(4,4);
109

110 111 112 113 114 115 116 117 118
	firstThinStrip = 0;
	Int_t conTimeMult = 1;

	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 1000000;
	cout << drawEntries << " entries in input chain will be processed." << endl;

	for (Int_t i = 0; i < 16; i++) {
119
		c2->cd(i+1);
120 121 122 123 124 125 126

		varName.Form("SQLXE[%d]:0.3*tSQX_L[%d]", i+firstThinStrip, i+firstThinStrip);
		condition.Form("0.3*tSQX_L[%d]>200 && 0.3*tSQX_L[%d]<500 && SQLXE[%d]>0", i+firstThinStrip, i+firstThinStrip, i+firstThinStrip);

		tr->SetMarkerColor(kRed);
		tr->SetMarkerStyle(20);
		tr->SetMarkerSize(.4);
127 128
		tr->Draw(varName, condition, "col", drawEntries);

129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
		varName.Form("SQLXE[%d]:SQLXtime[%d]", i+firstThinStrip, i+firstThinStrip);
		condition.Form("SQLXtime[%d]>0 && SQLXE[%d]>0 && SQLXtimeMult==%d",
				i+firstThinStrip, i+firstThinStrip, conTimeMult);

		varName.Form("SQLXEtimeFiltered[%d]:0.3*tSQX_L[%d]", i+firstThinStrip, i+firstThinStrip);
		condition.Form("0.3*tSQX_L[%d]>200 && 0.3*tSQX_L[%d]<500 && SQLXEtimeFilteredSum>0 && SQLXtimeMult==%d",
				i+firstThinStrip, i+firstThinStrip, conTimeMult);
//		condition.Form("SQLXtimeSum>0 && SQLXtimeSum<470 && SQLXtimeMult==%d && %s",
//						conTimeMult, timeSiLeftCondition.Data());

		cout << condition << endl;

		tr->Draw(varName, condition, "same", drawEntries);

//		tAlphaCal->Draw(varName, "", "same");
144

145 146 147 148 149 150 151 152
		c2->Update();
	}//for */



//	return;


153 154
/////////////////////////////////////////////////////////////////////
//	c2_1
155

156 157
	/*TCanvas *c2_1 = new TCanvas("c2_1", "time issues in 32 X-strips: 16-31", 1600, 1200);
	c2_1->Divide(4,4);
158

159
	firstThinStrip = 16;
160

161 162 163 164
	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 1000000;
	cout << drawEntries << " entries in input chain will be processed." << endl;
165

166 167
	for (Int_t i = 0; i < 16; i++) {
		c2_1->cd(i+1);
168

169 170
		varName.Form("SQLXE[%d]:0.3*tSQX_L[%d]", i+firstThinStrip, i+firstThinStrip);
		condition.Form("0.3*tSQX_L[%d]>300 && 0.3*tSQX_L[%d]<600 && SQLXE[%d]>0", i+firstThinStrip, i+firstThinStrip, i+firstThinStrip);
171

172
//		tr->SetMarkerColor(kBlack);
173 174
		tr->Draw(varName, condition, "col", drawEntries);
//		tr->Draw(varName, condition, "", drawEntries);
175

176 177 178
		varName.Form("SQLXE[%d]:SQLXtime[%d]", i+firstThinStrip, i+firstThinStrip);
		condition.Form("SQLXtime[%d]>0 && SQLXE[%d]>0 && SQLXtimeMult==%d", i+firstThinStrip, i+firstThinStrip, conTimeMult);
		tr->Draw(varName, condition, "same", drawEntries);
179

180 181
		c2_1->Update();
	}//for */
182

183
//	return;
184 185

/////////////////////////////////////////////////////////////////////
186 187 188 189
//	c3

	/*TCanvas *c3 = new TCanvas("c3", "Multiplicity", 1600, 1200);
	c3->Divide(2,2);
190

191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 10000000;
	cout << drawEntries << " entries in input chain will be processed." << endl;


	c3->cd(1);
	varName.Form("SQ20timeMult");
	condition.Form("trigger==3 && SQ20timeMult>0");
	tr->Draw(varName, condition, "", drawEntries);
	c3->Update();

	c3->cd(2);
	varName.Form("SQLXtimeMult");
	condition.Form("trigger==3 && SQLXtimeMult>0 && SQLXtimeMult<8");
	tr->Draw(varName, condition, "", drawEntries);
	c3->Update();

	c3->cd(3);
	varName.Form("SQ20EcorrMult");
	condition.Form("trigger==3 && SQ20EcorrMult>0");
	tr->Draw(varName, condition, "", drawEntries);
	c3->Update();

	c3->cd(4);
	varName.Form("SQLXmult");
	condition.Form("trigger==3 && SQLXmult>0");
	tr->Draw(varName, condition, "", drawEntries);
	c3->Update();
	//*/
221

222 223 224 225 226 227
//	return;

/////////////////////////////////////////////////////////////////////
//	c4

	/*TCanvas *c4 = new TCanvas("c4", "time issues in 16 Y-strips", 1600, 1200);
228 229
	c4->Divide(4,4);

230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
	firstThinStrip = 0;
	Int_t conTimeMult = 1;

	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 1000000;
	cout << drawEntries << " entries in input chain will be processed." << endl;

	Float_t timeCorr[16] = {0, -2, 0, 2,
							-2.5, 5, -6, 4,
							7, 3, 3, 4,
							6, 4, -4, 13
	};


245 246
	for (Int_t i = 0; i < 16; i++) {
		c4->cd(i+1);
247 248 249 250 251 252 253 254


		varName.Form("SQLYE[%d]:0.3*tSQY_L[%d]+%f", i+firstThinStrip, i+firstThinStrip, timeCorr[i]);
		condition.Form("0.3*tSQY_L[%d]>300 && 0.3*tSQY_L[%d]<360 && SQLYE[%d]>0", i+firstThinStrip, i+firstThinStrip, i+firstThinStrip);

		tr->SetMarkerColor(kRed);
		tr->SetMarkerStyle(20);
		tr->SetMarkerSize(.4);
255
		tr->Draw(varName, condition, "col", drawEntries);
256
//		tr->Draw(varName, condition, "", drawEntries);
257

258 259 260
		varName.Form("SQLYEtimeFiltered[%d]:SQLYtime[%d]", i+firstThinStrip, i+firstThinStrip);
//		condition.Form("SQLYtime[%d]>0 && SQLYE[%d]>0 && SQLYtimeMult==%d",
//				i+firstThinStrip, i+firstThinStrip, conTimeMult);
261

262 263 264
//		varName.Form("SQLYEtimeFiltered[%d]:0.3*tSQY_L[%d]", i+firstThinStrip, i+firstThinStrip);
		condition.Form("0.3*tSQY_L[%d]>200 && 0.3*tSQY_L[%d]<500 && SQLYEtimeFilteredSum>0 && SQLYtimeMult==%d",
				i+firstThinStrip, i+firstThinStrip, conTimeMult);
265

266
		cout << condition << endl;
267

268
		tr->Draw(varName, condition, "same", drawEntries);
269 270 271 272 273 274






275 276 277 278 279 280 281 282 283 284 285 286 287 288
//		varName.Form("SQLXE[%d]:SQLXtime[%d]", i+firstThinStrip, i+firstThinStrip);
		condition.Form("0.3*tSQY_L[%d]+%f>325 && 0.3*tSQY_L[%d]+%f<333 && SQLYE[%d]>0",
				i+firstThinStrip, timeCorr[i], i+firstThinStrip, timeCorr[i], i+firstThinStrip);
//
//		varName.Form("SQLXEtimeFiltered[%d]:0.3*tSQX_L[%d]", i+firstThinStrip, i+firstThinStrip);
//		condition.Form("0.3*tSQX_L[%d]>200 && 0.3*tSQX_L[%d]<500 && SQLXEtimeFilteredSum>0 && SQLXtimeMult==%d",
//				i+firstThinStrip, i+firstThinStrip, conTimeMult);
//		//		condition.Form("SQLXtimeSum>0 && SQLXtimeSum<470 && SQLXtimeMult==%d && %s",
//		//						conTimeMult, timeSiLeftCondition.Data());
//
//		cout << condition << endl;
//
		tr->SetMarkerColor(kRed);
//		tr->Draw(varName, condition, "same", drawEntries);
289

290
		//		tAlphaCal->Draw(varName, "", "same");
291

292 293
		c4->Update();
	}//for */
294

295
//	return;
296 297 298 299

/////////////////////////////////////////////////////////////////////
//	c5

300 301 302 303 304 305 306
	TCanvas *c5 = new TCanvas("c5", "Multiplicity", 1400, 900);
	c5->Divide(3,3);

	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 10000000;
	cout << drawEntries << " entries in input chain will be processed." << endl;
307 308 309


	c5->cd(1);
310 311 312
//	varName.Form("SQ20timeMult");
//	condition.Form("trigger==3 && SQ20timeMult>0");
	tr->Draw("angleLeft", "angleLeft<3", "", drawEntries);
313 314 315
	c5->Update();

	c5->cd(2);
316 317 318
	varName.Form("SQLYtimeMult");
	condition.Form("trigger==3 && SQLYtimeMult>0 && SQLYtimeMult<8");
	tr->Draw(varName, condition, "", drawEntries);
319 320 321
	c5->Update();

	c5->cd(3);
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
	varName.Form("y1mm:x1mm>>h(32, -30., 30, 16, -30., 30)");
	condition.Form("trigger==3 && y1mm>-80. && x1mm>-80.");
	tr->Draw(varName, condition, "col", drawEntries);
	c5->Update();

	c5->cd(4);
	varName.Form("mapXbin");
	condition.Form("trigger==3 && mapXbin>-1");
	tr->Draw(varName, condition, "col", drawEntries);
	c5->Update();

	c5->cd(5);
	varName.Form("mapYbin");
	condition.Form("trigger==3 && mapYbin>-1");
	tr->Draw(varName, condition, "col", drawEntries);
	c5->Update();

	c5->cd(6);
	varName.Form("yThin:xThin");
	condition.Form("trigger==3 && yThin>-80. && xThin>-80.");
//	condition.Form("yThin>-80. && xThin>-80.");
	tr->Draw(varName, condition, "col", drawEntries);

	TBox *boxThinDet = new TBox(25., -25., -25., 25.);
	boxThinDet->SetLineColor(kRed);
	boxThinDet->SetLineWidth(3);
	boxThinDet->SetFillStyle(0);
	boxThinDet->Draw("same");
	c5->Update();

	c5->cd(7);
//	varName.Form("nx1");
//	condition.Form("nx1>0 && nx1<10");
////	condition.Form("yThin>-80. && xThin>-80.");
//	tr->Draw(varName, condition, "col", drawEntries);

	tr->Draw("dEbeam:TOF>>IDplot(200,,,200,,)", "TOF<400 && TOF>0 && dEbeam < 4000 && trigger==1", "col", 1000000);
//	tr->Draw("dEbeam:TOF>>IDplot(200,,,200,,)", " trigger==1", "col", 1000000);
	TBox *beamBox = new TBox(156, 2300, 165, 1800);
361 362 363 364 365 366
	beamBox->SetFillStyle(0);
	beamBox->SetLineWidth(3);
	beamBox->SetLineColor(kRed);
	beamBox->Draw();
	c5->Update();

367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388
	c5->cd(8);
	varName.Form("ny1");
	condition.Form("ny1>0 && ny1<10");
	tr->Draw(varName, condition, "", drawEntries);
	c5->Update();

	condition.Form("ny1>0 && ny1<10 && TOF>156 && TOF<165 && dEbeam > 1800 && dEbeam<2300 && trigger==1");
//	condition.Form("yThin>-80. && xThin>-80.");
	tr->Draw(varName, condition, "same", drawEntries);
	c5->Update();

	c5->cd(9);
	varName.Form("yt:xt");
	condition.Form("trigger==3");
//	condition.Form("yThin>-80. && xThin>-80.");
	tr->Draw(varName, condition, "col", drawEntries);


	//*/

	return;

389
/////////////////////////////////////////////////////////////////////
390 391 392 393
//	c9

	/*TCanvas *c9 = new TCanvas("c9", "dE-E uncorrected", 1600, 800);
	c9->Divide(4,2);
394

395
	firstThinStrip = 5;
396

397 398 399 400 401 402 403
	Int_t drawnEvents1[8];

	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 10000000;
	Long64_t drawEntriesCorrected = 20000000;
	cout << drawEntries << " entries in input chain will be processed." << endl;
404 405

	for (Int_t i = 0; i < 8; i++) {
406 407 408 409 410 411
		c9->cd(i+1);
		varName.Form("SQ20E[%d]:SQ20E[%d]+SQLXEsum", i+firstThinStrip, i+firstThinStrip);
		condition.Form("SQ20E[%d]>1.2 && SQ20E[%d]<5 "
				"&& SQLXEsum>1.1 && SQLXEsum<30 "
//				"&& SQLXtimeMult==1"
				"&& trigger==3",
412
				i+firstThinStrip, i+firstThinStrip);
413 414 415
		tr->SetMarkerColor(kRed);
		tr->SetMarkerStyle(20);
		tr->SetMarkerSize(.4);
416 417
		tr->Draw(varName, condition, "col", drawEntries);

418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465
		varName.Form("SQ20E[%d]:SQ20E[%d]+SQLXEtimeFilteredSum", i+firstThinStrip, i+firstThinStrip);
		condition.Form("SQ20E[%d]>1.2 && SQ20E[%d]<5 "
				"&& SQLXEsum>1.1 && SQLXEsum<30 "
				"&& SQLXtimeMult==1"
//				"&& %s"
				"&& SQLXEtimeFilteredSum>0"
				"&& trigger==3",
				i+firstThinStrip, i+firstThinStrip);

		drawnEvents1[i] = tr->Draw(varName, condition, "same", drawEntriesCorrected);
//		cout << "noevents in strip " << i << ": " << drawnEvents << endl;



		c9->Update();
	}//*/

//	return;

/////////////////////////////////////////////////////////////////////
//	c10

	/*TCanvas *c10 = new TCanvas("c10", "dE-E corrected", 1600, 800);
	c10->Divide(4,2);

	Int_t drawnEvents2[8];

	firstThinStrip = 5;

	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 10000000;
//	drawEntriesCorrected = 100000000;
	drawEntriesCorrected = drawEntriesCorrected/0.4;
	cout << drawEntries << " entries in input chain will be processed." << endl;

	for (Int_t i = 0; i < 8; i++) {
		c10->cd(i+1);

		varName.Form("SQ20Ecorr[%d]:SQ20Ecorr[%d]+SQLXEsum", i+firstThinStrip, i+firstThinStrip);
		condition.Form("SQ20Ecorr[%d]>1.2 && SQ20Ecorr[%d]<5 "
				"&& SQLXEsum>1.1 && SQLXEsum<30 "
//				"&& SQLXtimeMult==1"
				"&& trigger==3",
				i+firstThinStrip, i+firstThinStrip);
		tr->Draw(varName, condition, "col", drawEntries);
		c10->Update();

466
		tr->SetMarkerStyle(20);
467 468 469 470 471 472 473 474 475 476
		tr->SetMarkerSize(.4);
		tr->SetMarkerColor(kRed);

		varName.Form("SQ20Ecorr[%d]:SQ20Ecorr[%d]+SQLXEsum", i+firstThinStrip, i+firstThinStrip);
		condition.Form("SQ20Ecorr[%d]>1.2 && SQ20Ecorr[%d]<5 "
					"&& SQLXEsum>1.1 && SQLXEsum<30 "
//					"&& SQLXtimeMult==1"
//					"&& SQLXEtimeFilteredSum>0"
					"&& trigger==3",
					i+firstThinStrip, i+firstThinStrip);
477
		tr->Draw(varName, condition, "same", drawEntries);
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494
		c10->Update();

		tr->SetMarkerColor(kGreen);
//		tr->SetMarkerColor(kRed);
		varName.Form("SQ20EcorrHit[%d]:SQ20EcorrHit[%d]+SQLXEtimeFilteredSum", i+firstThinStrip, i+firstThinStrip);
		condition.Form("SQ20EcorrHit[%d]>1.2 && SQ20EcorrHit[%d]<5 "
				"&& SQLXEsum>1.1 && SQLXEsum<30 "
				"&& SQLXtimeMult==1"
				"&& SQLXEtimeFilteredSum>0.5"
				"&& trigger==3",
				i+firstThinStrip, i+firstThinStrip);
		drawnEvents2[i] = tr->Draw(varName, condition, "same", drawEntriesCorrected);


//		tAlphaCal->Draw(varName, "", "same");

		c10->Update();
495 496
	}

497 498 499 500 501 502 503 504 505 506
	for (Int_t i = 0; i < 8; i++) {
		cout << "noevents in strip " << i+firstThinStrip << ": " << drawnEvents1[i] << " (first choice)" << endl;
		cout << "noevents in strip " << i+firstThinStrip << ": " << drawnEvents2[i] << " (second choice)" << endl;
	}//*/


//	return;



507
/////////////////////////////////////////////////////////////////////
508 509 510 511 512 513
//	c11

	TCanvas *c11 = new TCanvas("c11", "dE-E uncorrected", 1600, 800);
	c11->Divide(4,2);

	firstThinStrip = 5;
514

515 516 517 518 519 520
	Int_t drawnEvents1[8];

	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 1000000000;
	cout << drawEntries << " entries in input chain will be processed." << endl;
521 522

	for (Int_t i = 0; i < 8; i++) {
523
		c11->cd(i+1);
524
		varName.Form("SQ20E[%d]:SQ20E[%d]+SQLXEsum", i+firstThinStrip, i+firstThinStrip);
525
		condition.Form("SQ20E[%d]>1.2 && SQ20E[%d]<5 "
526
				"&& SQLXEsum>1.1 && SQLXEsum<30 "
527 528 529 530 531 532
				//				"&& SQLXtimeMult==1"
				"&& trigger==3",
				i+firstThinStrip, i+firstThinStrip);
		tr->SetMarkerColor(kRed);
		tr->SetMarkerStyle(20);
		tr->SetMarkerSize(.4);
533
		tr->Draw(varName, condition, "col", drawEntries);
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600
		c11->Update();
	}//*/

	//	return;

/////////////////////////////////////////////////////////////////////
//	c12

	TCanvas *c12 = new TCanvas("c12", "dE-E corrected (first approximation)", 1600, 800);
	c12->Divide(4,2);

	Int_t drawnEvents2[8];

	firstThinStrip = 5;

	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 1000000000;
	cout << drawEntries << " entries in input chain will be processed." << endl;

	for (Int_t i = 0; i < 8; i++) {
		c12->cd(i+1);

		varName.Form("SQ20Ecorr[%d]:SQ20Ecorr[%d]+SQLXEsum", i+firstThinStrip, i+firstThinStrip);
		condition.Form("SQ20Ecorr[%d]>1.2 && SQ20Ecorr[%d]<5 "
				"&& SQLXEsum>1.1 && SQLXEsum<30 "
				//				"&& SQLXtimeMult==1"
				"&& trigger==3",
				i+firstThinStrip, i+firstThinStrip);

		tr->Draw(varName, condition, "col", drawEntries);
	}//*/

//	return;

/////////////////////////////////////////////////////////////////////
//	c13

	TCanvas *c13 = new TCanvas("c13", "dE-E corrected (second approximation)", 1600, 800);
	c13->Divide(4,2);

	firstThinStrip = 5;

	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;
	drawEntries = 1000000000;
	cout << drawEntries << " entries in input chain will be processed." << endl;

	for (Int_t i = 0; i < 8; i++) {
		c13->cd(i+1);

		varName.Form("SQ20EcorrHit[%d]:SQ20EcorrHit[%d]+SQLXEtimeFilteredSum", i+firstThinStrip, i+firstThinStrip);
		condition.Form("SQ20EcorrHit[%d]>1.2 && SQ20EcorrHit[%d]<5 "
				"&& SQLXEsum>1.1 && SQLXEsum<30 "
				"&& SQLXtimeMult==1"
				"&& SQLXEtimeFilteredSum>0.5"
				"&& trigger==3",
				i+firstThinStrip, i+firstThinStrip);


		tr->Draw(varName, condition, "col", drawEntries);
		c13->Update();

	}//*/

	cout << "Finished in "<< stopwatch.RealTime() << " seconds" << endl;
	cout << "Finished in "<< stopwatch.RealTime()/60. << " minutes" << endl;
601 602 603 604

	return;

}