@@ -435,8 +435,6 @@ void R3BTofDCal2Hit::Exec(Option_t* option)
435435 }
436436
437437 bool s_was_trig_missing = false ;
438- // Find coincident PMT hits.
439- // std::cout << "Print:\n";
440438
441439 if (fTofdHistoCal )
442440 {
@@ -804,8 +802,6 @@ void R3BTofDCal2Hit::Exec(Option_t* option)
804802 top_ns - (wedge_left_ns + wedge_right_ns) / 2 .);
805803 }
806804 }
807- // fhQvsTHit[iPlane - 1][iBar - 1]->Fill(qb, THit);
808- // fhTvsTHit[iPlane - 1][iBar - 1]->Fill(dt_mod, THit);
809805 }
810806 if (fTofdHistoCal )
811807 {
@@ -940,20 +936,6 @@ void R3BTofDCal2Hit::Exec(Option_t* option)
940936 time0 = event[ihit].time ; // time of first hit in coincidence window
941937 Double_t charge0 = event[ihit].charge ; // charge of first hit in coincidence window
942938 Int_t plane0 = event[ihit].plane ; // plane of first hit in coincidence window
943- std::vector<Double_t> goodcharge;
944- std::vector<Double_t> goodplane;
945- std::vector<Double_t> goodbar;
946- struct goodhit
947- {
948- Double_t goodq;
949- Double_t goodp;
950- Double_t goodb;
951- };
952- struct by_charge
953- {
954- bool operator ()(goodhit const & a, goodhit const & b) const noexcept { return a.goodq < b.goodq ; }
955- };
956- std::vector<goodhit> goodevents;
957939
958940 while (event[ihit].time < time0 + hit_coinc)
959941 { // check if in coincidence window
@@ -965,108 +947,13 @@ void R3BTofDCal2Hit::Exec(Option_t* option)
965947 }
966948 }
967949
968- if ((event[ihit].charge > 5.5 && event[ihit].charge < 6.5 ) ||
969- (event[ihit].charge > 1.5 && event[ihit].charge < 2.5 ))
970- {
971- goodcharge.push_back (event[ihit].charge );
972- goodplane.push_back (event[ihit].plane );
973- goodbar.push_back (event[ihit].bar );
974- }
975-
976950 LOG (debug) << " Hit in coincidence window: " << event[ihit].plane << " " << event[ihit].bar << " "
977951 << event[ihit].time << " " << event[ihit].charge ;
978952
979953 ihit++;
980954 if (ihit >= event.size ())
981955 break ;
982956 }
983- if (goodcharge.size () > 3 )
984- {
985- if (goodcharge.size () == 4 )
986- {
987- if (std::accumulate (goodcharge.begin (), goodcharge.end (), 0.0 ) > 14 . &&
988- std::accumulate (goodcharge.begin (), goodcharge.end (), 0.0 ) < 18 .)
989- {
990- if (std::accumulate (goodplane.begin (), goodplane.end (), 0 ) == 6 .)
991- {
992- LOG (debug) << " Found good pair 2 times in all planes" ;
993- for (Int_t g = 0 ; g < goodcharge.size (); g++)
994- {
995- LOG (debug) << goodcharge.at (g);
996- LOG (debug) << goodplane.at (g);
997- LOG (debug) << goodbar.at (g);
998- goodevents.push_back ({ goodcharge.at (g), goodplane.at (g), goodbar.at (g) });
999- }
1000- goodpair++;
1001- goodpair4++;
1002- }
1003- else
1004- {
1005- goodpair3++;
1006- }
1007- }
1008- }
1009- else if (std::accumulate (goodcharge.begin (), goodcharge.end (), 0.0 ) > 14 .)
1010- goodpair6++;
1011- }
1012- if (goodcharge.size () == 3 )
1013- {
1014- if (std::accumulate (goodcharge.begin (), goodcharge.end (), 0.0 ) > 8.5 &&
1015- std::accumulate (goodcharge.begin (), goodcharge.end (), 0.0 ) < 15.5 )
1016- {
1017- if (std::accumulate (goodplane.begin (), goodplane.end (), 0 ) == 4 ||
1018- std::accumulate (goodplane.begin (), goodplane.end (), 0 ) == 5 )
1019- {
1020- LOG (debug) << " Found good pair at least once in all planes" ;
1021- for (Int_t g = 0 ; g < goodcharge.size (); g++)
1022- {
1023- LOG (debug) << goodcharge.at (g);
1024- }
1025- goodpair++;
1026- goodpair5++;
1027- }
1028- else
1029- {
1030- goodpair7++;
1031- }
1032- }
1033- }
1034- if (goodcharge.size () == 2 )
1035- {
1036- if (std::accumulate (goodcharge.begin (), goodcharge.end (), 0.0 ) > 7 . &&
1037- std::accumulate (goodcharge.begin (), goodcharge.end (), 0.0 ) < 9 .)
1038- {
1039- if (std::accumulate (goodplane.begin (), goodplane.end (), 0 ) == 2 . ||
1040- std::accumulate (goodplane.begin (), goodplane.end (), 0 ) == 4 .)
1041- {
1042- LOG (debug) << " Found good pair in one plane" ;
1043- for (Int_t g = 0 ; g < goodcharge.size (); g++)
1044- {
1045- LOG (debug) << goodcharge.at (g);
1046- }
1047- goodpair++;
1048- goodpair1++;
1049- }
1050- if (std::accumulate (goodplane.begin (), goodplane.end (), 0 ) == 3 .)
1051- {
1052- LOG (debug) << " Found good pair in different planes" ;
1053- for (Int_t g = 0 ; g < goodcharge.size (); g++)
1054- {
1055- LOG (debug) << goodcharge.at (g);
1056- }
1057- goodpair++;
1058- goodpair2++;
1059- }
1060- }
1061- }
1062- std::sort (
1063- goodevents.begin (), goodevents.end (), [](goodhit const & a, goodhit const & b) { return a.goodq < b.goodq ; });
1064- for (Int_t g = 0 ; g < goodevents.size (); g++)
1065- {
1066- LOG (debug) << goodevents[g].goodq ;
1067- LOG (debug) << goodevents[g].goodp ;
1068- LOG (debug) << goodevents[g].goodb ;
1069- }
1070957 }
1071958
1072959 if (fTofdHisto )
@@ -1181,6 +1068,7 @@ void R3BTofDCal2Hit::CreateHistograms(Int_t iPlane, Int_t iBar)
11811068 fhWalkBot[iPlane - 1 ][iBar - 1 ]->GetYaxis ()->SetTitle (" dt in ns" );
11821069 fhWalkBot[iPlane - 1 ][iBar - 1 ]->GetXaxis ()->SetTitle (" ToT in ns" );
11831070 }
1071+
11841072 if (NULL == fhWalkTop[iPlane - 1 ][iBar - 1 ])
11851073 {
11861074 char strName[255 ];
@@ -1190,26 +1078,6 @@ void R3BTofDCal2Hit::CreateHistograms(Int_t iPlane, Int_t iBar)
11901078 fhWalkTop[iPlane - 1 ][iBar - 1 ]->GetXaxis ()->SetTitle (" ToT in ns" );
11911079 }
11921080
1193- /*
1194- if (NULL == fhQvsTHit[iPlane - 1][iBar - 1])
1195- {
1196- char strName[255];
1197- sprintf(strName, "Q_vs_THit_Plane_%d_Bar_%d", iPlane, iBar);
1198- fhQvsTHit[iPlane - 1][iBar - 1] = new TH2F(strName, "", 1000, 0., max_charge, 1000, -10, 40);
1199- fhQvsTHit[iPlane - 1][iBar - 1]->GetYaxis()->SetTitle("THit in ns");
1200- fhQvsTHit[iPlane - 1][iBar - 1]->GetXaxis()->SetTitle("Charge");
1201- }
1202- */
1203- /*
1204- if (NULL == fhTvsTHit[iPlane - 1][iBar - 1])
1205- {
1206- char strName[255];
1207- sprintf(strName, "T_vs_ToF_Plane_%d_Bar_%d", iPlane, iBar);
1208- fhTvsTHit[iPlane - 1][iBar - 1] = new TH2F(strName, "", 625, -25, 25, 1000, -10, 40);
1209- fhTvsTHit[iPlane - 1][iBar - 1]->GetYaxis()->SetTitle("THit in ns");
1210- fhTvsTHit[iPlane - 1][iBar - 1]->GetXaxis()->SetTitle("T1-T2 in ns");
1211- }
1212- */
12131081 if (NULL == fhQ[iPlane - 1 ])
12141082 {
12151083 char strName1[255 ];
@@ -1220,18 +1088,7 @@ void R3BTofDCal2Hit::CreateHistograms(Int_t iPlane, Int_t iBar)
12201088 fhQ[iPlane - 1 ]->GetYaxis ()->SetTitle (" Charge" );
12211089 fhQ[iPlane - 1 ]->GetXaxis ()->SetTitle (" Bar #" );
12221090 }
1223- /*
1224- if (NULL == fhxy[iPlane - 1])
1225- {
1226- char strName1[255];
1227- sprintf(strName1, "xy_Plane_%d", iPlane);
1228- char strName2[255];
1229- sprintf(strName2, "xy of Plane %d ", iPlane);
1230- fhxy[iPlane - 1] = new TH2F(strName1, strName2, 320, -80, 80, 400, -100., 100.);
1231- fhxy[iPlane - 1]->GetYaxis()->SetTitle("y-position in cm");
1232- fhxy[iPlane - 1]->GetXaxis()->SetTitle("x-position in cm");
1233- }
1234- */
1091+
12351092 if (NULL == fhxy[iPlane - 1 ])
12361093 {
12371094 char strName1[255 ];
@@ -1498,14 +1355,6 @@ void R3BTofDCal2Hit::FinishTask()
14981355 fhWalkBot[i][j]->Write ();
14991356 if (fhWalkTop[i][j])
15001357 fhWalkTop[i][j]->Write ();
1501- /*
1502- if (fhQvsTHit[i][j])
1503- fhQvsTHit[i][j]->Write();
1504- */
1505- /*
1506- if (fhTvsTHit[i][j])
1507- fhTvsTHit[i][j]->Write();
1508- */
15091358 }
15101359 }
15111360 }
@@ -1575,15 +1424,6 @@ void R3BTofDCal2Hit::FinishTask()
15751424 sprint << " (Events in bar coincidence)\n " ;
15761425 sprint << " Events in single planes " << singlehit;
15771426 sprint << " \n " ;
1578- // << "Good events in total " << eventstore << " <-> " << singlehit << " = singlehit \n";
1579- sprint << " Really good events " << goodpair4 << " 2 particles 2 times in 2 planes \n " ;
1580- sprint << " Good events " << goodpair1 << " 2 particles in 1 plane \n " ;
1581- sprint << " Good events " << goodpair2 << " 2 particles in different planes \n " ;
1582- sprint << " Good events " << goodpair5 << " 2 particles at least once in 2 planes\n " ;
1583- sprint << " Good events " << goodpair7 << " 3 in 2 planes\n " ;
1584- sprint << " Good events " << goodpair3 << " 2 particles in 2 planes odd\n " ;
1585- sprint << " Good events " << goodpair6 << " more than 2 particles in 2 planes\n " ;
1586- sprint << " Good events in total " << goodpair << " \n " ;
15871427
15881428 sprint << " n1=" << n1 << " n2=" << n2;
15891429
@@ -1594,7 +1434,6 @@ Double_t R3BTofDCal2Hit::walk(Double_t Q, Double_t par1, Double_t par2,
15941434 Double_t par3) // new method
15951435{
15961436 Double_t y = 0 ;
1597- // y = -30.2 + par1 * TMath::Power(Q, par2) + par3 / Q + par4 * Q + par5 * Q * Q;
15981437 y = par1 + par2 * TMath::Power (Q, par3);
15991438 return y;
16001439}
0 commit comments