58 GetHistoRMS(
const char* histoNameBase, Int_t histoNumber, Double_t& retVal) {
61 sprintf(dir_name,
"configuration.%s",
"omega");
63 sprintf(name,
"%s/%s_%d.root", dir_name, histoNameBase, histoNumber);
64 TFile* curFile = TFile::CurrentFile();
65 TFile*
f =
new TFile(name);
68 sprintf(name,
"%s_%d", histoNameBase, histoNumber);
69 TH1F*
h =
static_cast<TH1F*
>(
f->Get(name));
75 TFile::CurrentFile() = curFile;
80 : owner(o), stationsInAlgo(
LXSTATIONS), useBgr(false) {}
95 sprintf(name,
"muchInStationXDispLeft_%d",
i);
97 title,
"X dispersion from central to left layer inside station: %d",
i);
101 sprintf(name,
"muchInStationXDispRight_%d",
i);
103 title,
"X dispersion from central to right layer inside station: %d",
i);
107 sprintf(name,
"muchInStationYDispLeft_%d",
i);
109 title,
"Y dispersion from central to left layer inside station: %d",
i);
113 sprintf(name,
"muchInStationYDispRight_%d",
i);
115 title,
"Y dispersion from central to right layer inside station: %d",
i);
119 sprintf(name,
"muchInStationXDispRL_%d",
i);
121 title,
"X dispersion on left layer predicted by right station: %d",
i);
125 sprintf(name,
"muchInStationYDispRL_%d",
i);
127 title,
"Y dispersion on left layer predicted by right station: %d",
i);
131 sprintf(name,
"muchInStationTxBreak_%d",
i);
132 sprintf(title,
"Tx break inside station: %d",
i);
136 sprintf(name,
"muchInStationTyBreak_%d",
i);
137 sprintf(title,
"Ty break inside station: %d",
i);
142 sprintf(name,
"muchLongSegmentTxHisto_%d",
i);
145 "Tx tangents distribution for segments between stations: %d and %d",
151 sprintf(name,
"muchLongSegmentTyHisto_%d",
i);
154 "Ty tangents distribution for segments between stations: %d and %d",
160 sprintf(name,
"muchClusterXDispHisto_%d",
i);
162 "X coordinate dispersion for cluster segments between stations: "
169 sprintf(name,
"muchClusterYDispHisto_%d",
i);
171 "Y coordinate dispersion for cluster segments between stations: "
178 sprintf(name,
"muchClusterTxDispHisto_%d",
i);
180 "Tx tangent dispersion for cluster segments between stations: %d "
187 sprintf(name,
"muchClusterTyDispHisto_%d",
i);
189 "Ty tangent dispersion for cluster segments between stations: %d "
196 sprintf(name,
"muchOutStationTxBreakLeft_%d",
i);
198 "Tx break between right segment of station and left tip of the "
199 "interstation segment: %d",
202 new TH1F(name, title, 100, -0.15, 0.15);
205 sprintf(name,
"muchOutStationTxBreakRight_%d",
i);
207 "Tx break between left segment of station and right tip of the "
208 "interstation segment: %d",
211 new TH1F(name, title, 100, -0.15, 0.15);
214 sprintf(name,
"muchOutStationTyBreakLeft_%d",
i);
216 "Ty break between right segment of station and left tip of the "
217 "interstation segment: %d",
220 new TH1F(name, title, 100, -0.15, 0.15);
223 sprintf(name,
"muchOutStationTyBreakRight_%d",
i);
225 "Ty break between left segment of station and right tip of the "
226 "interstation segment: %d",
229 new TH1F(name, title, 100, -0.15, 0.15);
232 sprintf(name,
"muchOutStationXDispByTriplet_%d",
i);
234 "X dispersion of prediction by triplet angle for station: %d",
237 new TH1F(name, title, 100, -10.0, 10.0);
240 sprintf(name,
"muchOutStationYDispByTriplet_%d",
i);
242 "Y dispersion of prediction by triplet angle for station: %d",
245 new TH1F(name, title, 100, -10.0, 10.0);
248 sprintf(name,
"muchOutStationXDispByVertex_%d",
i);
251 "X dispersion of prediction by an angle to vertex for station: %d",
254 new TH1F(name, title, 100, -10.0, 10.0);
257 sprintf(name,
"muchOutStationYDispByVertex_%d",
i);
260 "Y dispersion of prediction by an angle to vertex for station: %d",
263 new TH1F(name, title, 100, -10.0, 10.0);
266 sprintf(name,
"muchTripletTxBreak_%d",
i);
268 title,
"Tx break between triplets on stations %d and %d",
i - 1,
i);
272 sprintf(name,
"muchTripletTyBreak_%d",
i);
274 title,
"Ty break between triplets on stations %d and %d",
i - 1,
i);
279 sprintf(name,
"muchSegmentTxBreakHisto_%d",
i);
281 "Tx tangents breaks distribution for adjacent segments on "
287 sprintf(name,
"muchSegmentTyBreakHisto_%d",
i);
289 "Ty tangents breaks distribution for adjacent segments on "
296 sprintf(name,
"muchStationTxDispHisto_%d",
i);
298 "Tx tangents dispersion for segments between stations: %d and %d",
304 sprintf(name,
"muchStationTyDispHisto_%d",
i);
306 "Ty tangents dispersion for segments between stations: %d and %d",
314 sprintf(name,
"muchXTxCovHisto_%d",
i);
315 sprintf(title,
"muchXTxCovHisto on %d",
i);
317 new TH2F(name, title, 100, -5.0, 5.0, 100, -0.15, 0.15);
320 sprintf(name,
"muchYTyCovHisto_%d",
i);
321 sprintf(title,
"muchYTyCovHisto on %d",
i);
323 new TH2F(name, title, 100, -5.0, 5.0, 100, -0.15, 0.15);
333 sprintf(dir_name,
"configuration.%s",
particleType.Data());
334 DIR* dir = opendir(dir_name);
339 mkdir(dir_name, 0700);
342 sprintf(name,
"%s/%s.root", dir_name, histo->GetName());
343 TFile fh(name,
"RECREATE");
402 for (;
i >= 0; --
i) {
403 for (; j >= 0; --j) {
424 for (;
i >= 0; --
i) {
425 for (; j >= 0; --j) {
446 bool readHistoResult =
true;
455 readHistoResult &=
GetHistoRMS(
"muchInStationXDispLeft",
i, xDispLeft[
i]);
456 readHistoResult &=
GetHistoRMS(
"muchInStationYDispLeft",
i, yDispLeft[
i]);
457 readHistoResult &=
GetHistoRMS(
"muchInStationXDispRight",
i, xDispRight[
i]);
458 readHistoResult &=
GetHistoRMS(
"muchInStationYDispRight",
i, yDispRight[
i]);
459 readHistoResult &=
GetHistoRMS(
"muchInStationXDispRL",
i, xDispRL[
i]);
460 readHistoResult &=
GetHistoRMS(
"muchInStationYDispRL",
i, yDispRL[
i]);
463 if (!readHistoResult)
return;
467 static Int_t triggerEvents = 0;
468 bool hasPositive =
false;
469 bool hasNegative =
false;
471 for (vector<LxSimpleTrack*>::iterator
i =
tracks.begin();
i !=
tracks.end();
484 bool checkSign =
true;
485 bool aOkS[6] = {
false,
false,
false,
false,
false,
false};
488 bool angleOk =
false;
490 for (list<LxSimplePoint>::iterator k =
points[j][1].begin();
494 Double_t txEst = p1.
x / p1.
z;
495 Double_t tyEst = p1.
y / p1.
z;
497 for (list<LxSimplePoint>::iterator l =
points[j][2].begin();
501 Double_t deltaZ = p2.
z - p1.
z;
502 Double_t rX = p1.
x + txEst * deltaZ;
503 Double_t rY = p1.
y + tyEst * deltaZ;
505 if (abs(rX - p2.
x) <=
cutCoeff * xDispRight[j]
506 && abs(rY - p2.
y) <=
cutCoeff * yDispRight[j]) {
515 if (angleOk) aOkS[j] =
true;
520 for (
int j = 0; j < 6; ++j) {
521 if (aOkS[j]) ++okSts;
526 if (!checkSign)
continue;
528 for (list<LxSimplePoint>::iterator j =
points[0][1].begin();
532 Double_t txEst = p01.
x / p01.
z;
534 for (list<LxSimplePoint>::iterator k =
points[1][1].begin();
538 Double_t tx2 = (p11.
x - p01.
x) / (p11.
z - p01.
z);
539 Double_t sign2 = tx2 - txEst;
541 for (list<LxSimplePoint>::iterator l =
points[0][0].begin();
546 for (list<LxSimplePoint>::iterator
m =
points[0][2].begin();
550 Double_t tx1 = (p02.
x - p00.
x) / (p02.
z - p00.
z);
551 Double_t sign1 = tx1 - txEst;
553 if (sign1 > 0 && sign2 > 0)
555 else if (sign1 < 0 && sign2 < 0)
563 if (hasPositive && hasNegative) ++triggerEvents;
565 cout <<
"LxTrackAnaSegments::BuildStatistics(): triggered: " << triggerEvents
579 ,
tx((e.
x - s.
x) / (e.z - s.z))
580 ,
ty((e.
y - s.
y) / (e.z - s.z)) {}
585 for (Int_t j = 0; j <
LXLAYERS; ++j) {
610 Double_t txEst = p1.
x / p1.
z;
611 Double_t tyEst = p1.
y / p1.
z;
614 deltaZ = p2.
z - p1.
z;
615 Double_t xEst = p1.
x + txEst * deltaZ;
616 Double_t yEst = p1.
y + tyEst * deltaZ;
619 tx = (p2.
x - p1.
x) / deltaZ;
620 ty = (p2.
y - p1.
y) / deltaZ;
623 deltaZ = p2.
z - p1.
z;
624 xEst = p1.
x + txEst * deltaZ;
625 yEst = p1.
y + tyEst * deltaZ;
629 tx2 = (p2.
x - p1.
x) / deltaZ;
630 ty2 = (p2.
y - p1.
y) / deltaZ;
638 deltaZ = p2.
z - p1.
z;
639 stTx = (p2.
x - p1.
x) / deltaZ;
640 stTy = (p2.
y - p1.
y) / deltaZ;
647 deltaZ = p2.
z - p1.
z;
648 tx = (p2.
x - p1.
x) / deltaZ;
650 ty = (p2.
y - p1.
y) / deltaZ;
662 Double_t txVertex = p2.
x / p2.
z;
663 Double_t tyVertex = p2.
y / p2.
z;
667 p1.
x - p2.
x + txVertex * deltaZ );
669 p1.
y - p2.
y + tyVertex * deltaZ );
675 Double_t maxXdisp = 0;
676 Double_t maxYdisp = 0;
677 Double_t maxTxdisp = 0;
678 Double_t maxTydisp = 0;
680 for (list<LxSimplePoint>::iterator l0 =
684 for (list<LxSimplePoint>::iterator l1 =
688 for (list<LxSimplePoint>::iterator l2 =
692 for (list<LxSimplePoint>::iterator r0 =
696 for (list<LxSimplePoint>::iterator r1 =
700 for (list<LxSimplePoint>::iterator r2 =
708 for (Int_t j = 0; j <
LXLAYERS; ++j) {
709 for (Int_t k = 0; k <
LXLAYERS; ++k)
720 Double_t dtx = abs(s2.
tx - s1.
tx);
721 Double_t dty = abs(s2.
ty - s1.
ty);
727 if (maxXdisp < dx) maxXdisp = dx;
729 if (maxYdisp < dy) maxYdisp = dy;
731 if (maxTxdisp < dtx) maxTxdisp = dtx;
733 if (maxTydisp < dty) maxTydisp = dty;
751 deltaZ = p2.
z - p1.
z;
752 tx = (p2.
x - p1.
x) / deltaZ;
753 ty = (p2.
y - p1.
y) / deltaZ;
755 deltaZ2 = p3.
z - p2.
z;
756 tx2 = (p3.
x - p2.
x) / deltaZ2;
757 Double_t slopeCoeff =
sqrt(1 + tx2 * tx2 + ty2 * ty2);
759 ty2 = (p3.
y - p2.
y) / deltaZ2;
766 deltaZ = p2.
z - p1.
z;
767 tx = (p2.
x - p1.
x) / deltaZ;
768 ty = (p2.
y - p1.
y) / deltaZ;
773 deltaZ = p2.
z - p1.
z;
774 tx2 = (p2.
x - p1.
x) / deltaZ;
776 ty2 = (p2.
y - p1.
y) / deltaZ;
785 deltaZ = p2.
z - p1.
z;
786 Double_t deltaX = p2.
x - p1.
x - p1.
tx * deltaZ;
787 Double_t deltaY = p2.
y - p1.
y - p1.
ty * deltaZ;
788 Double_t deltaTx = p2.
tx - p1.
tx;
789 Double_t deltaTy = p2.
ty - p1.
ty;