10#include "FairRootManager.h"
12#include "TClonesArray.h"
31#include "FairTrackParam.h"
32#include "FairVolume.h"
34#include "TGeoManager.h"
47#include "TGeoSphere.h"
48#include "TVirtualMC.h"
58 , fRichProjections(NULL)
59 , fRichMirrorPoints(NULL)
62 , fRichRingMatches(NULL)
63 , fRichRefPlanePoints(NULL)
74 , fDrawAlignment(kTRUE)
75 , fDrawMapping(kFALSE)
76 , fDrawProjection(kTRUE)
77 , fIsMeanCenter(kFALSE)
78 , fIsReconstruction(kFALSE)
86 for (
int i = 0; i < 3; i++) {
95 FairRootManager* manager = FairRootManager::Instance();
97 fRichHits = (TClonesArray*) manager->GetObject(
"RichHit");
99 Fatal(
"CbmRichCorrectionVector::Init",
"No RichHit array !");
102 fRichRings = (TClonesArray*) manager->GetObject(
"RichRing");
104 Fatal(
"CbmRichCorrectionVector::Init",
"No RichRing array !");
109 Fatal(
"CbmRichCorrectionVector::Init",
"No RichProjection array !");
114 Fatal(
"CbmRichCorrectionVector::Init",
"No RichMirrorPoints array !");
117 fRichMCPoints = (TClonesArray*) manager->GetObject(
"RichPoint");
119 Fatal(
"CbmRichCorrectionVector::Init",
"No RichMCPoints array !");
122 fMCTracks = (TClonesArray*) manager->GetObject(
"MCTrack");
124 Fatal(
"CbmRichCorrectionVector::Init",
"No MCTracks array !");
129 Fatal(
"CbmRichCorrectionVector::Init",
"No RichRingMatches array !");
134 Fatal(
"CbmRichCorrectionVector::Init",
"No RichRefPlanePoint array !");
137 fRichPoints = (TClonesArray*) manager->GetObject(
"RichPoint");
139 Fatal(
"CbmRichCorrectionVector::Init",
"No RichPoint array !");
142 fGlobalTracks = (TClonesArray*) manager->GetObject(
"GlobalTrack");
144 Fatal(
"CbmAnaDielectronTask::Init",
"No GlobalTrack array!");
147 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
148 "RICH_mirror_and_support_belt_strip3_126/RICH_mirror_2_53"] =
"2_53";
149 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
150 "RICH_mirror_and_support_belt_strip3_126/RICH_mirror_2_52"] =
"2_52";
151 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
152 "RICH_mirror_and_support_belt_strip3_126/RICH_mirror_1_51"] =
"1_51";
153 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
154 "RICH_mirror_and_support_belt_strip5_128/RICH_mirror_2_77"] =
"2_77";
155 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
156 "RICH_mirror_and_support_belt_strip5_128/RICH_mirror_2_76"] =
"2_76";
157 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
158 "RICH_mirror_and_support_belt_strip5_128/RICH_mirror_1_75"] =
"1_75";
159 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
160 "RICH_mirror_and_support_belt_strip1_124/RICH_mirror_2_29"] =
"2_29";
161 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
162 "RICH_mirror_and_support_belt_strip1_124/RICH_mirror_2_28"] =
"2_28";
163 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
164 "RICH_mirror_and_support_belt_strip1_124/RICH_mirror_1_27"] =
"1_27";
165 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
166 "RICH_mirror_and_support_belt_strip_cut_123/RICH_mirror_3_15"] =
"3_15";
167 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
168 "RICH_mirror_and_support_belt_strip_cut_123/RICH_mirror_2_16"] =
"2_16";
169 fPathsMap[
"/cave_1/rich1_0/RICH_gas_221/RICH_mirror_half_total_208/"
170 "RICH_mirror_and_support_belt_strip_cut_123/RICH_mirror_2_17"] =
"2_17";
173 "RICH_mirror_and_support_belt_strip3_126/RICH_mirror_2_53"] =
"2_53";
175 "RICH_mirror_and_support_belt_strip3_126/RICH_mirror_2_52"] =
"2_52";
177 "RICH_mirror_and_support_belt_strip3_126/RICH_mirror_1_51"] =
"1_51";
179 "RICH_mirror_and_support_belt_strip5_128/RICH_mirror_2_77"] =
"2_77";
181 "RICH_mirror_and_support_belt_strip5_128/RICH_mirror_2_76"] =
"2_76";
183 "RICH_mirror_and_support_belt_strip5_128/RICH_mirror_1_75"] =
"1_75";
185 "RICH_mirror_and_support_belt_strip1_124/RICH_mirror_2_29"] =
"2_29";
187 "RICH_mirror_and_support_belt_strip1_124/RICH_mirror_2_28"] =
"2_28";
189 "RICH_mirror_and_support_belt_strip1_124/RICH_mirror_1_27"] =
"1_27";
191 "RICH_mirror_and_support_belt_strip_cut_123/RICH_mirror_3_15"] =
"3_15";
193 "RICH_mirror_and_support_belt_strip_cut_123/RICH_mirror_2_16"] =
"2_16";
195 "RICH_mirror_and_support_belt_strip_cut_123/RICH_mirror_2_17"] =
"2_17";
210 for (std::map<string, string>::iterator it =
fPathsMap.begin(); it !=
fPathsMap.end();
212 string name =
"fHMCPoints_" + it->second;
213 fHM->
Create2<TH2D>(name, name +
";X_Axis [];Y_Axis [];Entries", 2001, -100., 100., 2001, 60., 210.);
217 string name =
"fHPoints_Ellipse_" + it->second;
218 fHM->
Create2<TH2D>(name, name +
";X_Axis [];Y_Axis [];Entries", 2001, -100., 100., 2001, 60., 210.);
221 fHM->
Create1<TH1D>(
"fhDistanceCenterToExtrapolatedTrack",
222 "fhDistanceCenterToExtrapolatedTrack;Distance fitted "
223 "center to extrapolated track;Number of entries",
225 fHM->
Create1<TH1D>(
"fhDistanceCenterToExtrapolatedTrackInPlane",
226 "fhDistanceCenterToExtrapolatedTrackInPlane;Distance fitted center to "
227 "extrapolated track in plane;Number of entries",
230 "fhDifferenceX;Difference in X (fitted center - "
231 "extrapolated track);Number of entries",
234 "fhDifferenceY;Difference in Y (fitted center - "
235 "extrapolated track);Number of entries",
238 fHM->
Create1<TH1D>(
"fhDistanceCenterToExtrapolatedTrackInPlaneUncorrected",
239 "fhDistanceCenterToExtrapolatedTrackInPlaneUncorrected;Distance fitted "
240 "center to extrapolated track in plane;Number of entries",
242 fHM->
Create1<TH1D>(
"fhDifferenceXUncorrected",
243 "fhDifferenceXUncorrected;Difference in X (fitted center "
244 "- extrapolated track);Number of entries",
246 fHM->
Create1<TH1D>(
"fhDifferenceYUncorrected",
247 "fhDifferenceYUncorrected;Difference in Y (fitted center "
248 "- extrapolated track);Number of entries",
256 fHM2->
Create1<TH1D>(
"fHCenterDistance",
"fHCenterDistance;Distance C-C';Nb of entries", 100, -0.1, 5.);
257 fHM2->
Create1<TH1D>(
"fHPhi",
"fHPhi;Phi_Ch [rad];Nb of entries", 200, -3.4, 3.4);
258 fHM2->
Create1<TH1D>(
"fHThetaDiff",
"fHThetaDiff;Th_Ch-Th_0 [cm];Nb of entries", 252, -5., 5.);
259 fHM2->
Create2<TH2D>(
"fHCherenkovHitsDistribTheta0",
"fHCherenkovHitsDistribTheta0;Phi_0 [rad];Theta_0 [cm];Entries",
260 200, -2., 2., 600, 2., 8.);
261 fHM2->
Create2<TH2D>(
"fHCherenkovHitsDistribThetaCh",
262 "fHCherenkovHitsDistribThetaCh;Phi_Ch [rad];Theta_Ch [cm];Entries", 200, -3.4, 3.4, 600, 0., 20);
263 fHM2->
Create2<TH2D>(
"fHCherenkovHitsDistribReduced",
264 "fHCherenkovHitsDistribReduced;Phi_Ch [rad];Th_Ch-Th_0 [cm];Entries", 200, -3.4, 3.4, 500, -5.,
272 "--------------------------------------------------------------------"
273 "------------------------------------------//"
275 cout <<
"//---------------------------------------- EXEC Function - Defining "
276 "the entries ----------------------------------------//"
279 "--------------------------------------------------------------------"
280 "--------------------------------------------------//"
284 cout <<
"CbmRichCorrectionVector : Event #" <<
fEventNum << endl;
286 Int_t nofRingsInEvent =
fRichRings->GetEntriesFast();
288 Int_t nofHitsInEvent =
fRichHits->GetEntriesFast();
290 Int_t NofMCTracks =
fMCTracks->GetEntriesFast();
291 cout <<
"Nb of rings in evt = " << nofRingsInEvent <<
", nb of mirror points = " << nofMirrorPoints
292 <<
", nb of hits in evt = " << nofHitsInEvent <<
", nb of Monte-Carlo points = " << NofMCPoints
293 <<
" and nb of Monte-Carlo tracks = " << NofMCTracks << endl
297 "--------------------------------------------------------------------"
298 "--------------------------------------//"
300 cout <<
"//-------------------------------- EXEC Function - Correction "
301 "Vector class ------------------------------------------//"
304 "--------------------------------------------------------------------"
305 "--------------------------------------//"
309 TClonesArray* projectedPoint;
311 if (nofRingsInEvent == 0) {
312 cout <<
"Error no rings registered in event." << endl << endl;
325 Double_t trackX = 0., trackY = 0.;
328 Int_t nofRingsInEvent =
fRichRings->GetEntriesFast();
329 Float_t DistCenters, Theta_Ch, Theta_0, Angles_0;
330 Float_t Pi = 3.14159265;
331 Float_t TwoPi = 2. * 3.14159265;
335 if (nofRingsInEvent >= 1) {
336 cout <<
"Number of Rings in event: " << nofRingsInEvent << endl;
338 for (Int_t iR = 0; iR < nofRingsInEvent; iR++) {
346 fHM2->
H1(
"fHCenterDistance")->Fill(DistCenters);
352 for (Int_t iH = 0; iH < NofHits; iH++) {
354 Int_t HitIndex = ring->
GetHit(iH);
356 Float_t xHit = hit->
GetX();
357 Float_t yHit = hit->
GetY();
362 if (xRing - xHit == 0 || yRing - yHit == 0)
continue;
363 fPhi[iH] = TMath::ATan2(yHit - yRing, xHit - xRing);
367 Theta_Ch =
sqrt(TMath::Power(trackX - hit->
GetX(), 2) + TMath::Power(trackY - hit->
GetY(), 2));
371 fHM2->
H1(
"fHThetaDiff")->Fill(Theta_Ch - Theta_0);
374 fHM2->
H2(
"fHCherenkovHitsDistribTheta0")->Fill(Angles_0, Theta_0);
375 fHM2->
H2(
"fHCherenkovHitsDistribThetaCh")->Fill(
fPhi[iH], Theta_Ch);
376 fHM2->
H2(
"fHCherenkovHitsDistribReduced")->Fill(
fPhi[iH], (Theta_Ch - Theta_0));
387 for (Int_t iP = 0; iP < NofProjections; iP++) {
392 cout <<
"Error: CbmRichCorrectionVector::GetTrackPosition. No fair track "
404 cout <<
"//---------------------------------------- MATCH_FINDER Function "
405 "----------------------------------------//"
408 Int_t NofRingsInEvent =
fRichRings->GetEntriesFast();
410 Int_t NofMCTracks =
fMCTracks->GetEntriesFast();
413 Double_t x_Mirr = 0, y_Mirr = 0, z_Mirr = 0, x_PMT = 0, y_PMT = 0, z_PMT = 0;
414 Double_t CenterX = 0, CenterY = 0;
416 const Char_t* mirr_path;
419 for (Int_t iMirr = 0; iMirr < NofMirrorPoints; iMirr++) {
421 Int_t trackID = MirrPoint->GetTrackID();
424 for (Int_t iMCPoint = 0; iMCPoint < NofMCPoints; iMCPoint++) {
426 if (NULL == pPoint)
continue;
428 if (NULL == pTrack)
continue;
431 if (motherID == -1)
continue;
433 if (trackID == motherID) {
437 x_Mirr = MirrPoint->GetX();
438 y_Mirr = MirrPoint->GetY();
439 z_Mirr = MirrPoint->GetZ();
441 mirr_node = gGeoManager->FindNode(x_Mirr, y_Mirr, z_Mirr);
442 mirr_path = gGeoManager->GetPath();
449 for (Int_t iRing = 0; iRing < NofRingsInEvent; iRing++) {
451 if (NULL == ring)
continue;
462 if (richMCID == -1)
continue;
464 if (trackID == richMCID) {
466 cout <<
"MATCH BETWEEN TRACK_ID AND RICH_MC_ID FOUND !" << endl;
467 cout <<
"Center X = " << CenterX <<
" and center Y = " << CenterY << endl;
468 x_Mirr = MirrPoint->GetX();
469 y_Mirr = MirrPoint->GetY();
470 z_Mirr = MirrPoint->GetZ();
471 cout <<
"x_Mirr: " << x_Mirr <<
", y_Mirr: " << y_Mirr <<
" and z_Mirr: " << z_Mirr << endl;
472 mirr_node = gGeoManager->FindNode(x_Mirr, y_Mirr, z_Mirr);
473 mirr_path = gGeoManager->GetPath();
474 cout <<
"Mirror path: " << mirr_path << endl;
486 string name = string(mirr_path);
487 for (std::map<string, string>::iterator it =
fPathsMap.begin(); it !=
fPathsMap.end(); ++it) {
488 if (name.compare(it->first) == 0) {
491 Double_t x_PMT = pPoint->GetX();
492 Double_t y_PMT = pPoint->GetY();
493 Double_t z_PMT = pPoint->GetZ();
496 fHM->
H2(
"fHMCPoints_" + it->second)->Fill(-x_PMT, y_PMT);
504 cout <<
"//---------------------------------------- FILL_PMT_MAP_ELLIPSE "
505 "Function ----------------------------------------//"
507 string name = string(mirr_path);
508 for (std::map<string, string>::iterator it =
fPathsMap.begin(); it !=
fPathsMap.end(); ++it) {
509 if (name.compare(it->first) == 0) {
510 cout <<
"IDENTICAL PATHS FOUND !" << endl;
512 cout <<
"Mirror ID: " << it->second << endl;
514 fHM->
H2(
"fHPoints_Ellipse_" + it->second)->Fill(-CenterX, CenterY);
522 cout <<
"//------------------------------ CbmRichCorrectionVector: "
523 "Projection Producer ------------------------------//"
528 Int_t NofRingsInEvent =
fRichRings->GetEntriesFast();
531 Int_t NofPMTPoints =
fRichPoints->GetEntriesFast();
534 projectedPoint->Delete();
536 TMatrixFSym covMat(5);
537 for (Int_t iMatrix = 0; iMatrix < 5; iMatrix++) {
538 for (Int_t jMatrix = 0; jMatrix <= iMatrix; jMatrix++) {
539 covMat(iMatrix, jMatrix) = 0;
542 covMat(0, 0) = covMat(1, 1) = covMat(2, 2) = covMat(3, 3) = covMat(4, 4) = 1.e-4;
545 Double_t sphereRadius = 300., constantePMT = 0.;
546 vector<Double_t> ptM(3), ptC(3), ptR1(3), momR1(3), normalPMT(3), ptR2Mirr(3), ptR2Center(3), ptPMirr(3), ptPR2(3);
547 vector<Double_t> ptMUnCorr(3), ptCUnCorr(3), ptR2CenterUnCorr(3), ptR2MirrUnCorr(3), ptPMirrUnCorr(3), ptPR2UnCorr(3);
548 Double_t reflectedPtCooVectSphereUnity[] = {0., 0., 0.};
549 TVector3 outPos, outPosUnCorr;
551 Double_t ringCenter[] = {0., 0., 0.}, distToExtrapTrackHit = 0., distToExtrapTrackHitInPlane = 0.;
553 Int_t mirrTrackID = -1, pmtTrackID = -1, refPlaneTrackID = -1, motherID = -100, pmtMotherID = -100;
557 TGeoMatrix *mirrMatrix, *pmtMatrix, *richMatrix;
567 cout <<
"Calculated normal vector to PMT plane = {" << normalPMT.at(0) <<
", " << normalPMT.at(1) <<
", "
568 << normalPMT.at(2) <<
"} and constante d = " << constantePMT << endl
571 for (Int_t iMirr = 0; iMirr < NofMirrorPoints; iMirr++) {
574 mirrTrackID = mirrPoint->GetTrackID();
576 if (mirrTrackID <= -1) {
577 cout <<
"Mirror track ID <= 1 !!!" << endl;
578 cout <<
"----------------------------------- End of loop N°" << iMirr + 1
579 <<
" on the mirror points. -----------------------------------" << endl
585 if (motherID == -1) {
587 ptM.at(0) = mirrPoint->GetX(), ptM.at(1) = mirrPoint->GetY(), ptM.at(2) = mirrPoint->GetZ();
588 ptMUnCorr.at(0) = -70.6622238, ptMUnCorr.at(1) = 55.1816025, ptMUnCorr.at(2) = 335.3621216;
590 mirrNode = gGeoManager->FindNode(ptM.at(0), ptM.at(1), ptM.at(2));
592 cout <<
"Mirror node found! Mirror node name = " << mirrNode->GetName() << endl;
593 navi = gGeoManager->GetCurrentNavigator();
594 cout <<
"Navigator path: " << navi->GetPath() << endl;
595 cout <<
"Coordinates of sphere center: " << endl;
596 navi->GetCurrentMatrix()->Print();
601 ptC.at(0) = navi->GetCurrentMatrix()->GetTranslation()[0];
602 ptC.at(1) = navi->GetCurrentMatrix()->GetTranslation()[1];
603 ptC.at(2) = navi->GetCurrentMatrix()->GetTranslation()[2];
605 ptCUnCorr.at(0) = 0., ptCUnCorr.at(1) = 132.594000, ptCUnCorr.at(2) = 54.267226;
606 cout <<
"Coordinates of tile center: " << endl;
607 navi->GetMotherMatrix()->Print();
609 <<
"Sphere center coordinates of the rotated mirror tile = {" << ptC.at(0) <<
", " << ptC.at(1) <<
", "
610 << ptC.at(2) <<
"} and sphere inner radius = " << sphereRadius << endl;
612 for (Int_t iRefl = 0; iRefl < NofRefPlanePoints; iRefl++) {
615 refPlaneTrackID = refPlanePoint->GetTrackID();
617 if (mirrTrackID == refPlaneTrackID) {
619 ptR1.at(0) = refPlanePoint->GetX(), ptR1.at(1) = refPlanePoint->GetY(), ptR1.at(2) = refPlanePoint->GetZ();
620 momR1.at(0) = refPlanePoint->GetPx(), momR1.at(1) = refPlanePoint->GetPy(),
621 momR1.at(2) = refPlanePoint->GetPz();
622 cout <<
"Reflective Plane Point coordinates = {" << ptR1.at(0) <<
", " << ptR1.at(1) <<
", " << ptR1.at(2)
624 cout <<
"And reflective Plane Point momenta = {" << momR1.at(0) <<
", " << momR1.at(1) <<
", "
625 << momR1.at(2) <<
"}" << endl;
626 cout <<
"Mirror Point coordinates = {" << ptM.at(0) <<
", " << ptM.at(1) <<
", " << ptM.at(2) <<
"}" << endl
628 cout <<
"Mirror Point coordinates (Uncorrected) = {" << ptMUnCorr.at(0) <<
", " << ptMUnCorr.at(1) <<
", "
629 << ptMUnCorr.at(2) <<
"}" << endl
638 ComputeR2(ptR2Center, ptR2Mirr, ptC, ptM, ptR1);
639 ComputeR2(ptR2CenterUnCorr, ptR2MirrUnCorr, ptCUnCorr, ptM, ptR1);
641 ComputeP(ptPMirr, ptPR2, normalPMT, ptM, ptR2Mirr, constantePMT);
642 ComputeP(ptPMirrUnCorr, ptPR2UnCorr, normalPMT, ptM, ptR2MirrUnCorr, constantePMT);
644 TVector3 inPos(ptPMirr.at(0), ptPMirr.at(1), ptPMirr.at(2));
646 cout <<
"New mirror points coordinates = {" << outPos.x() <<
", " << outPos.y() <<
", " << outPos.z() <<
"}"
649 TVector3 inPosUnCorr(ptPMirrUnCorr.at(0), ptPMirrUnCorr.at(1), ptPMirrUnCorr.at(2));
651 cout <<
"New mirror points coordinates = {" << outPosUnCorr.x() <<
", " << outPosUnCorr.y() <<
", "
652 << outPosUnCorr.z() <<
"}" << endl
685 cout <<
"Not a mother particle ..." << endl;
687 cout <<
"----------------------------------- "
688 <<
"End of loop N°" << iMirr + 1 <<
" on the mirror points."
689 <<
" -----------------------------------" << endl
699 Int_t pmtTrackID, pmtMotherID;
700 Double_t buffNormX = 0., buffNormY = 0., buffNormZ = 0., k = 0., scalarProd = 0.;
701 Double_t pmtPt[] = {0., 0., 0.};
702 Double_t a[] = {0., 0., 0.}, b[] = {0., 0., 0.}, c[] = {0., 0., 0.};
710 for (Int_t iPmt = 0; iPmt < NofPMTPoints; iPmt++) {
712 pmtTrackID = pmtPoint->GetTrackID();
715 a[0] = pmtPoint->GetX(), a[1] = pmtPoint->GetY(), a[2] = pmtPoint->GetZ();
719 for (Int_t iPmt = 0; iPmt < NofPMTPoints; iPmt++) {
721 pmtTrackID = pmtPoint->GetTrackID();
725 if (TMath::Sqrt(TMath::Power(a[0] - pmtPoint->GetX(), 2) + TMath::Power(a[1] - pmtPoint->GetY(), 2)
726 + TMath::Power(a[2] - pmtPoint->GetZ(), 2))
728 b[0] = pmtPoint->GetX(), b[1] = pmtPoint->GetY(), b[2] = pmtPoint->GetZ();
733 for (Int_t iPmt = 0; iPmt < NofPMTPoints; iPmt++) {
735 pmtTrackID = pmtPoint->GetTrackID();
739 if (TMath::Sqrt(TMath::Power(a[0] - pmtPoint->GetX(), 2) + TMath::Power(a[1] - pmtPoint->GetY(), 2)
740 + TMath::Power(a[2] - pmtPoint->GetZ(), 2))
742 && TMath::Sqrt(TMath::Power(b[0] - pmtPoint->GetX(), 2) + TMath::Power(b[1] - pmtPoint->GetY(), 2)
743 + TMath::Power(b[2] - pmtPoint->GetZ(), 2))
745 c[0] = pmtPoint->GetX(), c[1] = pmtPoint->GetY(), c[2] = pmtPoint->GetZ();
751 k = (b[0] - a[0]) / (c[0] - a[0]);
752 if ((b[1] - a[1]) - (k * (c[1] - a[1])) == 0 || (b[2] - a[2]) - (k * (c[2] - a[2])) == 0) {
753 cout <<
"Error in normal calculation, vect_AB and vect_AC are collinear." << endl;
756 buffNormX = (b[1] - a[1]) * (c[2] - a[2]) - (b[2] - a[2]) * (c[1] - a[1]);
757 buffNormY = (b[2] - a[2]) * (c[0] - a[0]) - (b[0] - a[0]) * (c[2] - a[2]);
758 buffNormZ = (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
760 buffNormX / TMath::Sqrt(TMath::Power(buffNormX, 2) + TMath::Power(buffNormY, 2) + TMath::Power(buffNormZ, 2));
762 buffNormY / TMath::Sqrt(TMath::Power(buffNormX, 2) + TMath::Power(buffNormY, 2) + TMath::Power(buffNormZ, 2));
764 buffNormZ / TMath::Sqrt(TMath::Power(buffNormX, 2) + TMath::Power(buffNormY, 2) + TMath::Power(buffNormZ, 2));
768 scalarProd = normalPMT.at(0) * (pmtPoint1->GetX() - a[0]) + normalPMT.at(1) * (pmtPoint1->GetY() - a[1])
769 + normalPMT.at(2) * (pmtPoint1->GetZ() - a[2]);
774 * (normalPMT.at(0) * pmtPoint1->GetX() + normalPMT.at(1) * pmtPoint1->GetY() + normalPMT.at(2) * pmtPoint1->GetZ());
776 scalarProd = normalPMT.at(0) * (pmtPoint2->GetX() - a[0]) + normalPMT.at(1) * (pmtPoint2->GetY() - a[1])
777 + normalPMT.at(2) * (pmtPoint2->GetZ() - a[2]);
780 scalarProd = normalPMT.at(0) * (pmtPoint3->GetX() - a[0]) + normalPMT.at(1) * (pmtPoint3->GetY() - a[1])
781 + normalPMT.at(2) * (pmtPoint3->GetZ() - a[2]);
787 const Char_t* topNodePath;
788 topNodePath = gGeoManager->GetTopNode()->GetName();
789 cout <<
"Top node path: " << topNodePath << endl;
791 rootTop = gGeoManager->GetTopVolume();
794 TGeoIterator nextNode(rootTop);
796 const TGeoMatrix* curMatrix;
797 const Double_t* curNodeTranslation;
798 const Double_t* curNodeRotationM;
799 TString filterName0(
"mirror_tile_type0");
800 TString filterName1(
"mirror_tile_type1");
801 TString filterName2(
"mirror_tile_type2");
802 TString filterName3(
"mirror_tile_type3");
803 TString filterName4(
"mirror_tile_type4");
804 TString filterName5(
"mirror_tile_type5");
806 Double_t sphereXTot = 0., sphereYTot = 0., sphereZTot = 0.;
808 while ((curNode = nextNode())) {
809 TString nodeName(curNode->GetName());
814 if (curNode->GetVolume()->GetName() == filterName0 || curNode->GetVolume()->GetName() == filterName1
815 || curNode->GetVolume()->GetName() == filterName2 || curNode->GetVolume()->GetName() == filterName3
816 || curNode->GetVolume()->GetName() == filterName4 || curNode->GetVolume()->GetName() == filterName5) {
817 if (curNode->GetNdaughters() == 0) {
820 nextNode.GetPath(nodePath);
821 curMatrix = nextNode.GetCurrentMatrix();
822 curNodeTranslation = curMatrix->GetTranslation();
823 curNodeRotationM = curMatrix->GetRotationMatrix();
824 printf(
"%s tr:\t", nodePath.Data());
825 printf(
"%08f\t%08f\t%08f\t\n", curNodeTranslation[0], curNodeTranslation[1], curNodeTranslation[2]);
826 if (curNodeTranslation[1] > 0) {
827 sphereXTot += curNodeTranslation[0];
828 sphereYTot += curNodeTranslation[1];
829 sphereZTot += curNodeTranslation[2];
835 ptC.at(0) = sphereXTot /
counter;
836 ptC.at(1) = sphereYTot /
counter;
837 ptC.at(2) = sphereZTot /
counter;
844 vector<Double_t> momR1, vector<Double_t> ptC, Double_t sphereRadius)
846 Double_t a = 0., b = 0., c = 0., d = 0., k0 = 0., k1 = 0., k2 = 0.;
848 a = TMath::Power(momR1.at(0), 2) + TMath::Power(momR1.at(1), 2) + TMath::Power(momR1.at(2), 2);
850 * (momR1.at(0) * (ptR1.at(0) - ptC.at(0)) + momR1.at(1) * (ptR1.at(1) - ptC.at(1))
851 + momR1.at(2) * (ptR1.at(2) - ptC.at(2)));
852 c = TMath::Power(ptR1.at(0) - ptC.at(0), 2) + TMath::Power(ptR1.at(1) - ptC.at(1), 2)
853 + TMath::Power(ptR1.at(2) - ptC.at(2), 2) - TMath::Power(sphereRadius, 2);
854 d = b * b - 4 * a * c;
855 cout <<
"d = " << d << endl;
858 cout <<
"Error no solution to degree 2 equation found ; discriminant below 0." << endl;
859 ptM.at(0) = 0., ptM.at(1) = 0., ptM.at(2) = 0.;
862 cout <<
"One solution to degree 2 equation found." << endl;
864 ptM.at(0) = ptR1.at(0) + k0 * momR1.at(0);
865 ptM.at(1) = ptR1.at(1) + k0 * momR1.at(1);
866 ptM.at(2) = ptR1.at(2) + k0 * momR1.at(2);
869 cout <<
"Two solutions to degree 2 equation found." << endl;
870 k1 = ((-b - TMath::Sqrt(d)) / (2 * a));
871 k2 = ((-b + TMath::Sqrt(d)) / (2 * a));
873 if (ptR1.at(2) + k1 * momR1.at(2) > ptR1.at(2) + k2 * momR1.at(2)) {
874 ptM.at(0) = ptR1.at(0) + k1 * momR1.at(0);
875 ptM.at(1) = ptR1.at(1) + k1 * momR1.at(1);
876 ptM.at(2) = ptR1.at(2) + k1 * momR1.at(2);
878 else if (ptR1.at(2) + k1 * momR1.at(2) < ptR1.at(2) + k2 * momR1.at(2)) {
879 ptM.at(0) = ptR1.at(0) + k2 * momR1.at(0);
880 ptM.at(1) = ptR1.at(1) + k2 * momR1.at(1);
881 ptM.at(2) = ptR1.at(2) + k2 * momR1.at(2);
887 vector<Double_t> ptC, vector<Double_t> ptR1)
889 vector<Double_t> normalMirr(3);
890 Double_t t1 = 0., t2 = 0., t3 = 0.;
892 normalMirr.at(0) = (ptC.at(0) - ptM.at(0))
893 / TMath::Sqrt(TMath::Power(ptC.at(0) - ptM.at(0), 2) + TMath::Power(ptC.at(1) - ptM.at(1), 2)
894 + TMath::Power(ptC.at(2) - ptM.at(2), 2));
895 normalMirr.at(1) = (ptC.at(1) - ptM.at(1))
896 / TMath::Sqrt(TMath::Power(ptC.at(0) - ptM.at(0), 2) + TMath::Power(ptC.at(1) - ptM.at(1), 2)
897 + TMath::Power(ptC.at(2) - ptM.at(2), 2));
898 normalMirr.at(2) = (ptC.at(2) - ptM.at(2))
899 / TMath::Sqrt(TMath::Power(ptC.at(0) - ptM.at(0), 2) + TMath::Power(ptC.at(1) - ptM.at(1), 2)
900 + TMath::Power(ptC.at(2) - ptM.at(2), 2));
903 t1 = ((ptR1.at(0) - ptM.at(0)) * (ptC.at(0) - ptM.at(0)) + (ptR1.at(1) - ptM.at(1)) * (ptC.at(1) - ptM.at(1))
904 + (ptR1.at(2) - ptM.at(2)) * (ptC.at(2) - ptM.at(2)))
905 / (TMath::Power(ptC.at(0) - ptM.at(0), 2) + TMath::Power(ptC.at(1) - ptM.at(1), 2)
906 + TMath::Power(ptC.at(2) - ptM.at(2), 2));
907 ptR2Center.at(0) = 2 * (ptM.at(0) + t1 * (ptC.at(0) - ptM.at(0))) - ptR1.at(0);
908 ptR2Center.at(1) = 2 * (ptM.at(1) + t1 * (ptC.at(1) - ptM.at(1))) - ptR1.at(1);
909 ptR2Center.at(2) = 2 * (ptM.at(2) + t1 * (ptC.at(2) - ptM.at(2))) - ptR1.at(2);
910 t2 = ((ptR1.at(0) - ptC.at(0)) * (ptC.at(0) - ptM.at(0)) + (ptR1.at(1) - ptC.at(1)) * (ptC.at(1) - ptM.at(1))
911 + (ptR1.at(2) - ptC.at(2)) * (ptC.at(2) - ptM.at(2)))
912 / (TMath::Power(ptC.at(0) - ptM.at(0), 2) + TMath::Power(ptC.at(1) - ptM.at(1), 2)
913 + TMath::Power(ptC.at(2) - ptM.at(2), 2));
914 ptR2Mirr.at(0) = 2 * (ptC.at(0) + t2 * (ptC.at(0) - ptM.at(0))) - ptR1.at(0);
915 ptR2Mirr.at(1) = 2 * (ptC.at(1) + t2 * (ptC.at(1) - ptM.at(1))) - ptR1.at(1);
916 ptR2Mirr.at(2) = 2 * (ptC.at(2) + t2 * (ptC.at(2) - ptM.at(2))) - ptR1.at(2);
922 cout <<
"Coordinates of point R2 on reflective plane after reflection on the "
926 cout <<
"* using sphere center C to define \U00000394: {" << ptR2Mirr.at(0) <<
", " << ptR2Mirr.at(1) <<
", "
927 << ptR2Mirr.at(2) <<
"}" << endl
934 vector<Double_t> ptM, vector<Double_t> ptR2Mirr, Double_t constantePMT)
936 Double_t k1 = 0., k2 = 0., checkCalc1 = 0., checkCalc2 = 0.;
939 * ((normalPMT.at(0) * ptM.at(0) + normalPMT.at(1) * ptM.at(1) + normalPMT.at(2) * ptM.at(2) + constantePMT)
940 / (normalPMT.at(0) * (ptR2Mirr.at(0) - ptM.at(0)) + normalPMT.at(1) * (ptR2Mirr.at(1) - ptM.at(1))
941 + normalPMT.at(2) * (ptR2Mirr.at(2) - ptM.at(2))));
942 ptPMirr.at(0) = ptM.at(0) + k1 * (ptR2Mirr.at(0) - ptM.at(0));
943 ptPMirr.at(1) = ptM.at(1) + k1 * (ptR2Mirr.at(1) - ptM.at(1));
944 ptPMirr.at(2) = ptM.at(2) + k1 * (ptR2Mirr.at(2) - ptM.at(2));
946 * ((normalPMT.at(0) * ptR2Mirr.at(0) + normalPMT.at(1) * ptR2Mirr.at(1) + normalPMT.at(2) * ptR2Mirr.at(2)
948 / (normalPMT.at(0) * (ptR2Mirr.at(0) - ptM.at(0)) + normalPMT.at(1) * (ptR2Mirr.at(1) - ptM.at(1))
949 + normalPMT.at(2) * (ptR2Mirr.at(2) - ptM.at(2))));
950 ptPR2.at(0) = ptR2Mirr.at(0) + k2 * (ptR2Mirr.at(0) - ptM.at(0));
951 ptPR2.at(1) = ptR2Mirr.at(1) + k2 * (ptR2Mirr.at(1) - ptM.at(1));
952 ptPR2.at(2) = ptR2Mirr.at(2) + k2 * (ptR2Mirr.at(2) - ptM.at(2));
953 cout <<
"Coordinates of point P on PMT plane, after reflection on the mirror "
954 "tile and extrapolation to the PMT plane:"
956 cout <<
"* using mirror point M to define \U0001D49F ': {" << ptPMirr.at(0) <<
", " << ptPMirr.at(1) <<
", "
957 << ptPMirr.at(2) <<
"}" << endl;
960 ptPMirr.at(0) * normalPMT.at(0) + ptPMirr.at(1) * normalPMT.at(1) + ptPMirr.at(2) * normalPMT.at(2) + constantePMT;
961 cout <<
"Check whether extrapolated track point on PMT plane verifies its "
962 "equation (value should be 0.):"
964 cout <<
"* using mirror point M, checkCalc = " << checkCalc1 << endl;
966 ptPR2.at(0) * normalPMT.at(0) + ptPR2.at(1) * normalPMT.at(1) + ptPR2.at(2) * normalPMT.at(2) + constantePMT;
971 vector<Double_t> normalPMT, Double_t constantePMT)
974 Double_t ringCenter[] = {0, 0, 0}, distToExtrapTrackHit = 0, distToExtrapTrackHitInPlane = 0;
975 Double_t distToExtrapTrackHitInPlaneUnCorr = 0;
977 for (Int_t iGlobalTrack = 0; iGlobalTrack < NofGTracks; iGlobalTrack++) {
980 if (NULL == gTrack)
continue;
990 Int_t ringTrackID = ring->GetTrackID();
1002 -1 * ((normalPMT.at(0) * ringCenter[0] + normalPMT.at(1) * ringCenter[1] + constantePMT) / normalPMT.at(2));
1004 vector<Double_t> r(3),
1006 r.at(0) = TMath::Abs(ringCenter[0]), r.at(1) = TMath::Abs(ringCenter[1]), r.at(2) = TMath::Abs(ringCenter[2]);
1007 p.at(0) = TMath::Abs(outPos.x()), p.at(1) = TMath::Abs(outPos.y()), p.at(2) = TMath::Abs(outPos.z());
1008 cout <<
"Ring center coordinates = {" << ringCenter[0] <<
", " << ringCenter[1] <<
", " << ringCenter[2] <<
"}"
1010 cout <<
"Difference in X = " << TMath::Abs(r.at(0) - p.at(0)) <<
"\t ; \t"
1011 <<
"Difference in Y = " << TMath::Abs(r.at(1) - p.at(1)) <<
"\t ; \t"
1012 <<
"Difference in Z = " << TMath::Abs(r.at(2) - p.at(2)) << endl;
1013 fHM->
H1(
"fhDifferenceX")->Fill(TMath::Abs(r.at(0) - p.at(0)));
1014 fHM->
H1(
"fhDifferenceY")->Fill(TMath::Abs(r.at(1) - p.at(1)));
1015 distToExtrapTrackHit = TMath::Sqrt(TMath::Power(r.at(0) - p.at(0), 2) + TMath::Power(r.at(1) - p.at(1), 2)
1016 + TMath::Power(r.at(2) - p.at(2), 2));
1017 distToExtrapTrackHitInPlane = TMath::Sqrt(TMath::Power(r.at(0) - p.at(0), 2) + TMath::Power(r.at(1) - p.at(1), 2));
1018 fHM->
H1(
"fhDistanceCenterToExtrapolatedTrack")->Fill(distToExtrapTrackHit);
1019 fHM->
H1(
"fhDistanceCenterToExtrapolatedTrackInPlane")->Fill(distToExtrapTrackHitInPlane);
1020 cout <<
"Distance between fitted ring center and extrapolated track hit = " << distToExtrapTrackHit << endl;
1021 cout <<
"Distance between fitted ring center and extrapolated track hit in "
1023 << distToExtrapTrackHitInPlane << endl;
1025 vector<Double_t> pUnCorr(3);
1026 pUnCorr.at(0) = TMath::Abs(outPosUnCorr.x()), pUnCorr.at(1) = TMath::Abs(outPosUnCorr.y()),
1027 pUnCorr.at(2) = TMath::Abs(outPosUnCorr.z());
1029 cout <<
"Difference in X = " << TMath::Abs(r.at(0) - pUnCorr.at(0)) <<
"\t ; \t"
1030 <<
"Difference in Y = " << TMath::Abs(r.at(1) - pUnCorr.at(1)) <<
"\t ; \t"
1031 <<
"Difference in Z = " << TMath::Abs(r.at(2) - pUnCorr.at(2)) << endl;
1032 fHM->
H1(
"fhDifferenceXUncorrected")->Fill(TMath::Abs(r.at(0) - pUnCorr.at(0)));
1033 fHM->
H1(
"fhDifferenceYUncorrected")->Fill(TMath::Abs(r.at(1) - pUnCorr.at(1)));
1034 distToExtrapTrackHitInPlaneUnCorr =
1035 TMath::Sqrt(TMath::Power(r.at(0) - pUnCorr.at(0), 2) + TMath::Power(r.at(1) - pUnCorr.at(1), 2));
1036 fHM->
H1(
"fhDistanceCenterToExtrapolatedTrackInPlaneUncorrected")->Fill(distToExtrapTrackHitInPlaneUnCorr);
1037 cout <<
"Distance between fitted ring center and extrapolated track hit in "
1039 << distToExtrapTrackHitInPlaneUnCorr << endl
1044 cout <<
"End of loop on global tracks;" << endl;
1051 for (Int_t i = 0; i < nofHits; i++) {
1052 Int_t hitInd = ring1->
GetHit(i);
1054 if (NULL == hit)
continue;
1055 TVector3 inputHit(hit->
GetX(), hit->
GetY(), hit->
GetZ());
1056 TVector3 outputHit(0, 0, 0);
1100 c3->SetFillColor(42);
1102 gPad->SetTopMargin(0.1);
1103 gPad->SetFillColor(33);
1106 TH2D* CloneArr = (TH2D*)
fHM2->
H2(
"fHCherenkovHitsDistribReduced")->Clone();
1107 CloneArr->GetXaxis()->SetLabelSize(0.03);
1108 CloneArr->GetXaxis()->SetTitleSize(0.03);
1109 CloneArr->GetXaxis()->CenterTitle();
1110 CloneArr->GetXaxis()->SetNdivisions(612, kTRUE);
1111 CloneArr->GetYaxis()->SetLabelSize(0.03);
1112 CloneArr->GetYaxis()->SetTitleSize(0.03);
1113 CloneArr->GetYaxis()->SetNdivisions(612, kTRUE);
1114 CloneArr->GetYaxis()->CenterTitle();
1116 CloneArr->GetZaxis()->SetLabelSize(0.03);
1117 CloneArr->GetZaxis()->SetTitleSize(0.03);
1118 CloneArr->GetYaxis()->SetTitleOffset(1.0);
1119 CloneArr->Draw(
"colz");
1126 TH2D* CloneArr_2 = (TH2D*)
fHM2->
H2(
"fHCherenkovHitsDistribReduced")->Clone();
1127 for (Int_t y_bin = 1; y_bin <= 500; y_bin++) {
1128 for (Int_t x_bin = 1; x_bin <= 200; x_bin++) {
1134 if (CloneArr_2->GetBinContent(x_bin, y_bin) < thresh) {
1135 CloneArr_2->SetBinContent(x_bin, y_bin, 0);
1140 CloneArr_2->GetXaxis()->SetLabelSize(0.03);
1141 CloneArr_2->GetXaxis()->SetTitleSize(0.03);
1142 CloneArr_2->GetXaxis()->CenterTitle();
1143 CloneArr_2->GetXaxis()->SetNdivisions(612, kTRUE);
1144 CloneArr_2->GetYaxis()->SetLabelSize(0.03);
1145 CloneArr_2->GetYaxis()->SetTitleSize(0.03);
1146 CloneArr_2->GetYaxis()->SetNdivisions(612, kTRUE);
1147 CloneArr_2->GetYaxis()->CenterTitle();
1149 CloneArr_2->GetZaxis()->SetLabelSize(0.03);
1150 CloneArr_2->GetZaxis()->SetTitleSize(0.03);
1151 CloneArr_2->GetYaxis()->SetTitleOffset(1.0);
1152 CloneArr_2->Draw(
"colz");
1153 CloneArr_2->Write();
1156 CloneArr_2->FitSlicesY(0, 0, -1, 1);
1158 TH1D* histo_0 = gDirectory->Get<TH1D>(
"fHCherenkovHitsDistribReduced_0");
1161 TH1D* histo_1 = gDirectory->Get<TH1D>(
"fHCherenkovHitsDistribReduced_1");
1165 TH1D* histo_2 = gDirectory->Get<TH1D>(
"fHCherenkovHitsDistribReduced_2");
1168 TH1D* histo_chi2 = gDirectory->Get<TH1D>(
"fHCherenkovHitsDistribReduced_chi2");
1172 TF1* f1 =
new TF1(
"f1",
"[2]+[0]*cos(x)+[1]*sin(x)", -3.5, 3.5);
1173 f1->SetParameters(0, 0, 0);
1174 f1->SetParNames(
"Delta_phi",
"Delta_lambda",
"Offset");
1175 histo_1->Fit(
"f1",
"",
"");
1176 TF1* fit = histo_1->GetFunction(
"f1");
1177 Double_t p1 = fit->GetParameter(
"Delta_phi");
1178 Double_t p2 = fit->GetParameter(
"Delta_lambda");
1179 Double_t p3 = fit->GetParameter(
"Offset");
1180 Double_t chi2 = fit->GetChisquare();
1191 f1->SetParameters(fit->GetParameter(0), fit->GetParameter(1));
1193 f1->SetLineColor(2);
1198 Double_t Focal_length = 150., q = 0., A = 0., Alpha = 0., mis_x = 0., mis_y = 0.;
1199 q = TMath::ATan(fit->GetParameter(0) / fit->GetParameter(1));
1200 cout << endl <<
"fit_1 = " << fit->GetParameter(0) <<
" and fit_2 = " << fit->GetParameter(1) << endl;
1202 A = fit->GetParameter(1) / TMath::Cos(q);
1205 TMath::ATan(A / 1.5) * 0.5
1210 mis_x = TMath::ATan(fit->GetParameter(0) / Focal_length) * 0.5 * TMath::Power(10, 3);
1211 mis_y = TMath::ATan(fit->GetParameter(1) / Focal_length) * 0.5 * TMath::Power(10, 3);
1214 TLegend* LEG =
new TLegend(0.30, 0.7, 0.72, 0.85);
1215 LEG->SetBorderSize(1);
1216 LEG->SetFillColor(0);
1217 LEG->SetMargin(0.2);
1218 LEG->SetTextSize(0.03);
1219 sprintf(leg,
"Fitted sinusoid");
1220 LEG->AddEntry(f1, leg,
"l");
1221 sprintf(leg,
"Misalign in X = %f", mis_x);
1222 LEG->AddEntry(
"", leg,
"l");
1223 sprintf(leg,
"Misalign in Y = %f", mis_y);
1224 LEG->AddEntry(
"", leg,
"l");
1225 sprintf(leg,
"Offset = %f", fit->GetParameter(2));
1226 LEG->AddEntry(
"", leg,
"l");
1231 CloneArr_2->Draw(
"colz");
1233 TLegend* LEG1 =
new TLegend(0.30, 0.7, 0.72, 0.85);
1234 LEG1->SetBorderSize(1);
1235 LEG1->SetFillColor(0);
1236 LEG1->SetMargin(0.2);
1237 LEG1->SetTextSize(0.03);
1238 sprintf(leg,
"Fitted sinusoid");
1239 LEG1->AddEntry(f1, leg,
"l");
1240 sprintf(leg,
"Misalign in X = %f", mis_x);
1241 LEG1->AddEntry(
"", leg,
"l");
1242 sprintf(leg,
"Misalign in Y = %f", mis_y);
1243 LEG1->AddEntry(
"", leg,
"l");
1244 sprintf(leg,
"Offset = %f", fit->GetParameter(2));
1245 LEG1->AddEntry(
"", leg,
"l");
1285 outputFit.at(0) = mis_x;
1286 outputFit.at(1) = mis_y;
1291 TCanvas* can =
new TCanvas(
fRunTitle +
"_Separated_Hits",
fRunTitle +
"_Separated_Hits", 1500, 900);
1321 TCanvas* can2 =
new TCanvas(
fRunTitle +
"_Separated_Ellipse",
fRunTitle +
"_Separated_Ellipse", 1500, 900);
1364 DrawH1(
fHM->
H1(
"fhDistanceCenterToExtrapolatedTrackInPlane"));
1375 DrawH1(
fHM->
H1(
"fhDistanceCenterToExtrapolatedTrackInPlaneUncorrected"));
1376 can4->SaveAs(
"Uncorrected_Histograms_" +
fAxisRotTitle +
".png");
1382 TFile* oldFile = gFile;
1383 TDirectory* oldDir = gDirectory;
1386 TFile* file =
new TFile(fileName,
"READ");
1387 LOG_IF(fatal, !file) <<
"Could not open file " << fileName;
1394 gDirectory = oldDir;
1406 vector<Double_t> outputFit(2);
1408 cout << setprecision(6) << endl;
1409 cout <<
"Horizontal displacement = " << outputFit[0] <<
" [mrad] and vertical displacement = " << outputFit[1]
1410 <<
" [mrad]." << endl;
1423 fHM2->
Create2<TH2D>(
"fHCherenkovHitsDistribReduced",
1424 "fHCherenkovHitsDistribReduced;Phi_Ch [rad];Th_Ch-Th_0 [cm];Entries", 200, -3.4, 3.4, 500, -5.,
1434 fHM->
H1(
"fhDifferenceX")->Write();
1435 fHM->
H1(
"fhDifferenceY")->Write();
1436 fHM->
H1(
"fhDistanceCenterToExtrapolatedTrack")->Write();
1437 fHM->
H1(
"fhDistanceCenterToExtrapolatedTrackInPlane")->Write();
1438 fHM->
H1(
"fhDifferenceXUncorrected")->Write();
1439 fHM->
H1(
"fhDifferenceYUncorrected")->Write();
1440 fHM->
H1(
"fhDistanceCenterToExtrapolatedTrackInPlaneUncorrected")->Write();
ClassImp(CbmConverterManager)
void DrawH1(TH1 *hist, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
Helper functions for drawing 1D and 2D histograms and graphs.
Convert internal data classes to cbmroot common data classes.
Class for producing RICH hits directly from MCPoints.
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
friend fvec sqrt(const fvec &a)
int32_t GetRichRingIndex() const
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
void Create2(const std::string &name, const std::string &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY)
Helper function for creation of 2-dimensional histograms and profiles. Template argument is a real ob...
void ReadFromFile(TFile *file)
Read histograms from file.
void Create1(const std::string &name, const std::string &title, Int_t nofBins, Double_t minBin, Double_t maxBin)
Helper function for creation of 1-dimensional histograms and profiles. Template argument is a real ob...
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
int32_t GetMotherId() const
int32_t GetPdgCode() const
const CbmLink & GetMatchedLink() const
static void Init()
Initialize array of RICH hits.
static void CopyHitsToRingLight(const CbmRichRing *ring1, CbmRichRingLight *ring2)
Copy hits from CbmRichRing to CbmRichRingLight.
void ComputeP(vector< Double_t > &ptPMirr, vector< Double_t > &ptPR2, vector< Double_t > normalPMT, vector< Double_t > ptM, vector< Double_t > ptR2Mirr, Double_t normalCste)
TClonesArray * fRichMCPoints
std::map< string, string > fPathsMapEllipse
void CalculateAnglesAndDrawDistrib()
std::map< string, string > fPathsMap
void DrawHistFromFile(TString fileName)
void GetTrackPosition(Double_t &x, Double_t &y)
TClonesArray * fRichRings
virtual void Exec(Option_t *option)
Inherited from FairTask.
void FillPMTMapEllipse(const Char_t *mirr_path, Float_t CenterX, Float_t CenterY)
TClonesArray * fRichProjections
void FillHistProjection(TVector3 outPos, TVector3 outPosUnCorr, Int_t NofGlobalTracks, vector< Double_t > normalPMT, Double_t constantePMT)
CbmRichRingFitterCOP * fCopFit
CbmRichCorrectionVector()
virtual ~CbmRichCorrectionVector()
void GetMeanSphereCenter(TGeoNavigator *navi, vector< Double_t > &ptC)
TClonesArray * fRichPoints
virtual InitStatus Init()
Inherited from FairTask.
static const int kMAX_NOF_HITS
void InitHistProjection()
void ComputeR2(vector< Double_t > &ptR2Center, vector< Double_t > &ptR2Mirr, vector< Double_t > ptM, vector< Double_t > ptC, vector< Double_t > ptR1)
TClonesArray * fGlobalTracks
CbmRichRingFitterEllipseTau * fTauFit
virtual void Finish()
Inherited from FairTask.
void DrawHistProjection()
void GetMirrorIntersection(vector< Double_t > &ptM, vector< Double_t > ptR1, vector< Double_t > momR1, vector< Double_t > ptC, Double_t sphereRadius)
void DrawFit(vector< Double_t > &outputFit, Int_t thresh)
TClonesArray * fRichRefPlanePoints
void FillPMTMap(const Char_t *mirr_path, CbmRichPoint *pPoint)
TClonesArray * fRichRingMatches
void ProjectionProducer(TClonesArray *projectedPoint)
void GetPmtNormal(Int_t NofPMTPoints, vector< Double_t > &normalPMT, Double_t &normalCste)
TClonesArray * fRichMirrorPoints
void RotateAndCopyHitsToRingLight(const CbmRichRing *ring1, CbmRichRingLight *ring2)
void RotatePoint(TVector3 *inPos, TVector3 *outPos, Bool_t noTilting=false)
static CbmRichGeoManager & GetInstance()
PMT parameters for the RICH geometry.
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
virtual void DoFit(CbmRichRingLight *ring)
Inherited from CbmRichRingFitterBase.
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
virtual void DoFit(CbmRichRingLight *ring)
Inherited from CbmRichRingFitterBase.
int GetNofHits() const
Return number of hits in ring.
void AddHit(CbmRichHitLight hit)
Add new hit to the ring.
uint32_t GetHit(int32_t i) const
int32_t GetNofHits() const
void SaveCanvasAsImage(TCanvas *c, const string &dir, const string &option)