38 if (phi > M_PI)
return phi - 2. * M_PI;
39 else if (phi <= -M_PI)
return phi + 2.* M_PI;
43 template<
class T>
inline constexpr
T square(
const T&
x ) {
return x*
x; }
50 out <<
"(" << v.x() <<
", " << v.y() <<
", " << v.z() <<
")";
58 for(
unsigned int i = 0;
i<2; ++
i )
62 for(
int ip = 0; ip < dcc->
m_hentries[
i]->GetNbinsX(); ++ip )
63 for(
int ir = 0; ir < dcc->
m_hentries[
i]->GetNbinsY(); ++ir )
66 const auto entries = dcc->
m_hentries[
i]->GetBinContent( ip+1, ir+1 );
67 if( entries <= 1 )
continue;
72 h->SetBinContent( ip+1, ir+1,
h->GetBinContent( ip+1, ir+1 )/entries );
73 h->SetBinError( ip+1, ir+1,
h->GetBinError( ip+1, ir+1 )/entries );
84 for(
unsigned int i = 0;
i<2; ++
i )
96 const auto rbins =
h->GetNbinsY();
97 for(
int ir = 0; ir < rbins; ++ir )
100 h->SetBinContent( 1, ir+1,
h->GetBinContent(
phibins-1, ir+1 ) );
101 h->SetBinError( 1, ir+1,
h->GetBinError(
phibins-1, ir+1 ) );
104 h->SetBinContent(
phibins, ir+1,
h->GetBinContent( 2, ir+1 ) );
105 h->SetBinError(
phibins, ir+1,
h->GetBinError( 2, ir+1 ) );
109 for(
int iphi = 0; iphi <
phibins; ++iphi )
112 h->SetBinContent( iphi+1, 1,
h->GetBinContent( iphi+1, 2 ) );
113 h->SetBinError( iphi+1, 1,
h->GetBinError( iphi+1, 2 ) );
116 h->SetBinContent( iphi+1, rbins,
h->GetBinContent( iphi+1, rbins-1 ) );
117 h->SetBinError( iphi+1, rbins,
h->GetBinError( iphi+1, rbins-1 ) );
177 TF1 *
f1 =
new TF1(
"f1",[&](
double *x,
double *
p){
return p[0] * hitHist->GetBinContent(hitHist->FindBin((x[0] - p[1])>M_PI?x[0] - p[1] - 2*M_PI: x[0] - p[1])); }, -M_PI, M_PI, 2);
178 f1->SetParNames(
"A",
"shift");
179 f1->SetParameters(1.0,0.0);
184 clustHist->Fit(
"f1",
"IQ");
189 return f1->GetParameter(1);
195 TH1D *
proj = r_phi->ProjectionY(
"R_proj");
197 std::vector<double> rPeaks;
199 for(
int i=2;
i<proj->GetNbinsX();
i++){
201 if(proj->GetBinContent(
i) > 0.15*proj->GetMaximum() && proj->GetBinContent(
i) >= proj->GetBinContent(
i-1) && proj->GetBinContent(
i) >= proj->GetBinContent(
i+1)) rPeaks.push_back(proj->GetBinCenter(
i));
205 for(
int i=0;
i<(int)rPeaks.size()-1;
i++){
206 if(rPeaks[
i+1]-rPeaks[
i] > 0.75)
continue;
207 if(proj->GetBinContent(proj->FindBin(rPeaks[
i])) > proj->GetBinContent(proj->FindBin(rPeaks[i+1]))) rPeaks.erase(rPeaks.begin()+i+1);
208 else rPeaks.erase(rPeaks.begin()+
i);
216 double closestDist = 100.;
217 int closestPeak = -1;
219 for(
int j=0;
j<(int)clusterPeaks.size();
j++){
220 if(std::abs(clusterR - clusterPeaks[
j]) < closestDist){
221 closestDist = std::abs(clusterR - clusterPeaks[j]);
227 if(closestPeak != -1)
return hitMatches[closestPeak];
238 static constexpr
float max_dr = 5.0;
239 static constexpr
float max_dphi = 0.05;
242 hxy_reco =
new TH2F(
"hxy_reco",
"reco cluster x:y",800,-100,100,800,-80,80);
243 hxy_truth =
new TH2F(
"hxy_truth",
"truth cluster x:y",800,-100,100,800,-80,80);
245 hdrdphi =
new TH2F(
"hdrdphi",
"dr vs dphi",800,-max_dr,max_dr,800,-max_dphi,max_dphi);
246 hdrdphi->GetXaxis()->SetTitle(
"dr");
247 hdrdphi->GetYaxis()->SetTitle(
"dphi");
249 hrdr =
new TH2F(
"hrdr",
"dr vs r",800,0.0,80.0,800,-max_dr, max_dr);
250 hrdr->GetXaxis()->SetTitle(
"r");
251 hrdr->GetYaxis()->SetTitle(
"dr");
253 hrdphi =
new TH2F(
"hrdphi",
"dphi vs r",800,0.0,80.0,800,-max_dphi,max_dphi);
254 hrdphi->GetXaxis()->SetTitle(
"r");
255 hrdphi->GetYaxis()->SetTitle(
"dphi");
257 hdphi =
new TH1F(
"hdphi",
"dph",800,-max_dphi,max_dphi);
258 hdphi->GetXaxis()->SetTitle(
"dphi");
260 hdr1_single =
new TH1F(
"hdr1_single",
"innner dr single", 200,-max_dr, max_dr);
261 hdr2_single =
new TH1F(
"hdr2_single",
"mid dr single", 200,-max_dr, max_dr);
262 hdr3_single =
new TH1F(
"hdr3_single",
"outer dr single", 200,-max_dr, max_dr);
263 hdr1_double =
new TH1F(
"hdr1_double",
"innner dr double", 200,-max_dr, max_dr);
264 hdr2_double =
new TH1F(
"hdr2_double",
"mid dr double", 200,-max_dr, max_dr);
265 hdr3_double =
new TH1F(
"hdr3_double",
"outer dr double", 200,-max_dr, max_dr);
266 hdrphi =
new TH1F(
"hdrphi",
"r * dphi", 200, -0.05, 0.05);
267 hnclus =
new TH1F(
"hnclus",
" nclusters ", 3, 0., 3.);
270 match_ntup =
new TNtuple(
"match_ntup",
"Match NTuple",
"event:truthR:truthPhi:recoR:recoPhi:recoZ:nclus:r1:phi1:e1:layer1:r2:phi2:e2:layer2");
273 hit_r_phi =
new TH2F(
"hit_r_phi",
"hit r vs #phi;#phi (rad); r (cm)",360,-M_PI,M_PI,500,0,100);
275 clust_r_phi_pos =
new TH2F(
"clust_r_phi_pos",
"clust R vs #phi Z>0;#phi (rad); r (cm)",360,-M_PI,M_PI,500,0,100);
276 clust_r_phi_neg =
new TH2F(
"clust_r_phi_neg",
"clust R vs #phi Z<0;#phi (rad); r (cm)",360,-M_PI,M_PI,500,0,100);
282 const double phi_petal = M_PI / 9.0;
291 auto save_truth_position = [&](TVector3
source)
307 for(
int k =0;
k<18; ++
k)
310 dummyPos.RotateZ(
k * phi_petal);
311 save_truth_position(dummyPos);
314 std::cout <<
" i " <<
i <<
" j " << j <<
" k " <<
k <<
" x1 " << dummyPos.X() <<
" y1 " << dummyPos.Y()
315 <<
" theta " << std::atan2(dummyPos.Y(), dummyPos.X())
316 <<
" radius " <<
get_r( dummyPos.X(), dummyPos.y()) << std::endl;
323 for(
int k =0;
k<18; ++
k)
325 TVector3 dummyPos(
cx1[
i][
j],
cy1[
i][j], 0.0);
326 dummyPos.RotateZ(
k * phi_petal);
327 save_truth_position(dummyPos);
330 std::cout <<
" i " <<
i <<
" j " << j <<
" k " <<
k <<
" x1 " << dummyPos.X() <<
" y1 " << dummyPos.Y()
331 <<
" theta " << std::atan2(dummyPos.Y(), dummyPos.X())
332 <<
" radius " <<
get_r( dummyPos.X(), dummyPos.y()) << std::endl;
338 for(
int k =0;
k<18; ++
k)
340 TVector3 dummyPos(
cx2[
i][
j],
cy2[
i][j], 0.0);
341 dummyPos.RotateZ(
k * phi_petal);
342 save_truth_position(dummyPos);
345 std::cout <<
" i " <<
i <<
" j " << j <<
" k " <<
k <<
" x1 " << dummyPos.X() <<
" y1 " << dummyPos.Y()
346 <<
" theta " << std::atan2(dummyPos.Y(), dummyPos.X())
347 <<
" radius " <<
get_r( dummyPos.X(), dummyPos.y()) << std::endl;
353 for(
int k =0;
k<18; ++
k)
355 TVector3 dummyPos(
cx3[
i][
j],
cy3[
i][j], 0.0);
356 dummyPos.RotateZ(
k * phi_petal);
357 save_truth_position(dummyPos);
360 std::cout <<
" i " <<
i <<
" j " << j <<
" k " <<
k <<
" x1 " << dummyPos.X() <<
" y1 " << dummyPos.Y()
361 <<
" theta " << std::atan2(dummyPos.Y(), dummyPos.X())
362 <<
" radius " <<
get_r( dummyPos.X(), dummyPos.y()) << std::endl;
373 std::vector<TVector3> reco_pos;
374 std::vector<TVector3> pos1;
375 std::vector<TVector3> pos2;
376 std::vector<unsigned int> reco_nclusters;
377 std::vector<unsigned int> reco_adc;
378 std::vector<unsigned int> adc1;
379 std::vector<unsigned int> adc2;
380 std::vector<unsigned int> layer1;
381 std::vector<unsigned int> layer2;
395 for(
const auto&
h:harray ) {
h->Reset(); } }
399 for (
auto cmitr = clusrange.first;
400 cmitr !=clusrange.second;
403 const auto& [cmkey, cmclus_orig] = *cmitr;
406 const unsigned int adc = cmclus->
getAdc();
430 TVector3 tmp_pos(
pos[0],
pos[1],
pos[2]);
431 TVector3 tmp_pos1(apos1[0], apos1[1], apos1[2]);
432 TVector3 tmp_pos2(apos2[0], apos2[1], apos2[2]);
435 if(nclus == 1 && isRGap)
continue;
437 reco_pos.push_back(tmp_pos);
438 pos1.push_back(tmp_pos1);
439 pos2.push_back(tmp_pos2);
440 reco_nclusters.push_back(nclus);
441 reco_adc.push_back(adc);
442 adc1.push_back(cmclus->
getAdc1());
443 adc2.push_back(cmclus->
getAdc2());
447 if(tmp_pos.Z() < 0)
clust_r_phi_neg->Fill(tmp_pos.Phi(),tmp_pos.Perp());
454 double raw_rad = sqrt( cmclus->
getX()*cmclus->
getX() + cmclus->
getY()*cmclus->
getY() );
455 double corr_rad = sqrt( tmp_pos.X()*tmp_pos.X() + tmp_pos.Y()*tmp_pos.Y() );
456 std::cout <<
"found raw cluster " << cmkey <<
" with x " << cmclus->
getX() <<
" y " << cmclus->
getY() <<
" z " << cmclus->
getZ() <<
" radius " << raw_rad << std::endl;
457 std::cout <<
" --- corrected positions: " << tmp_pos.X() <<
" " << tmp_pos.Y() <<
" " << tmp_pos.Z() <<
" radius " << corr_rad << std::endl;
462 hxy_reco->Fill(tmp_pos.X(), tmp_pos.Y());
483 std::vector<double> clust_RGaps_pos;
486 for(
int i=0;
i<(int)clust_RPeaks_pos.size()-1;
i++) clust_RGaps_pos.push_back(clust_RPeaks_pos[
i+1] - clust_RPeaks_pos[
i]);
487 int tmpGap_pos =
std::distance(clust_RGaps_pos.begin(),std::max_element(clust_RGaps_pos.begin(),clust_RGaps_pos.end()));
488 if(tmpGap_pos > (
int)clust_RGaps_pos.size()/2){
489 R23Gap_pos = tmpGap_pos;
490 R12Gap_pos =
std::distance(clust_RGaps_pos.begin(),std::max_element(clust_RGaps_pos.begin(),clust_RGaps_pos.begin()+R23Gap_pos));
492 R12Gap_pos = tmpGap_pos;
493 R23Gap_pos =
std::distance(clust_RGaps_pos.begin(),std::max_element(clust_RGaps_pos.begin()+R12Gap_pos+1,clust_RGaps_pos.end()));
496 std::vector<double> clust_RGaps_neg;
499 for(
int i=0; i<(int)clust_RPeaks_neg.size()-1; i++) clust_RGaps_neg.push_back(clust_RPeaks_neg[i+1] - clust_RPeaks_neg[i]);
500 int tmpGap_neg =
std::distance(clust_RGaps_neg.begin(),std::max_element(clust_RGaps_neg.begin(),clust_RGaps_neg.end()));
501 if(tmpGap_neg > (
int)clust_RGaps_neg.size()/2){
502 R23Gap_neg = tmpGap_neg;
503 R12Gap_neg =
std::distance(clust_RGaps_neg.begin(),std::max_element(clust_RGaps_neg.begin(),clust_RGaps_neg.begin()+R23Gap_neg));
505 R12Gap_neg = tmpGap_neg;
506 R23Gap_neg =
std::distance(clust_RGaps_neg.begin(),std::max_element(clust_RGaps_neg.begin()+R12Gap_neg+1,clust_RGaps_neg.end()));
509 std::vector<int> hitMatches_pos;
511 for(
int i=0; i<(int)clust_RPeaks_pos.size(); i++){
514 if(i < (R12Gap_pos+1)){
516 hitMatches_pos.push_back(15 + i - R12Gap_pos );
518 if(clust_RGaps_pos[R12Gap_pos] > 3.6) hitMatches_pos[
i] -= 1;
519 if(clust_RGaps_pos[R12Gap_pos] > 4.6) hitMatches_pos[
i] -= 1;
520 if(clust_RGaps_pos[R12Gap_pos] > 5.8) hitMatches_pos[
i] -= 1;
523 else if(i < (R23Gap_pos+1) && i >= (R12Gap_pos+1)) hitMatches_pos.push_back(15+1 + i - (R12Gap_pos+1));
525 else if(i >= R23Gap_pos+1) hitMatches_pos.push_back(23+1 + i - (R23Gap_pos+1));
528 std::vector<int> hitMatches_neg;
529 for(
int i=0; i<(int)clust_RPeaks_neg.size(); i++){
531 if(i < (R12Gap_neg+1)){
533 hitMatches_neg.push_back(15 + i - R12Gap_neg );
534 if(clust_RGaps_neg[R12Gap_neg] > 3.6) hitMatches_neg[
i] -= 1;
535 if(clust_RGaps_neg[R12Gap_neg] > 4.6) hitMatches_neg[
i] -= 1;
536 if(clust_RGaps_neg[R12Gap_neg] > 5.8) hitMatches_neg[
i] -= 1;
538 else if(i < (R23Gap_neg+1) && i >= (R12Gap_neg+1)) hitMatches_neg.push_back(15+1 + i - (R12Gap_neg+1));
539 else if(i >= R23Gap_neg+1) hitMatches_neg.push_back(23+1 + i - (R23Gap_neg+1));
545 std::vector<std::pair<unsigned int, unsigned int>> matched_pair;
546 std::vector<unsigned int> matched_nclus;
548 std::vector<bool> hits_matched(
m_truth_pos.size());
549 std::vector<bool> clusts_matched(reco_pos.size());
557 if(hits_matched[i])
continue;
563 int hitRadIndex = -1;
566 for(
int k=0;
k<(int)hit_RPeaks.size();
k++){
567 if(std::abs(rad1 - hit_RPeaks[
k]) < 0.5){
578 for(
unsigned int j = 0;
j < reco_pos.size(); ++
j)
580 if(clusts_matched[
j])
continue;
584 if(reco_pos[j].Perp() < 41) angleR = 0;
585 else if(reco_pos[j].Perp() >= 41 && reco_pos[
j].Perp() < 58) angleR = 1;
586 if(reco_pos[j].Perp() >= 58) angleR = 2;
590 double phi2 = reco_pos[
j].Phi();
591 const double z2 = reco_pos[
j].Z();
592 const double rad2=
get_r(reco_pos[j].
X(), reco_pos[j].
Y());
594 if(z2 > 0) phi2 -= m_clustRotation_pos[angleR];
595 else phi2 -= m_clustRotation_neg[angleR];
599 int clustRMatchIndex = -1;
600 if(z2 > 0) clustRMatchIndex =
getClusterRMatch(hitMatches_pos, clust_RPeaks_pos, rad2);
601 else clustRMatchIndex =
getClusterRMatch(hitMatches_neg, clust_RPeaks_neg, rad2);
604 if(clustRMatchIndex == -1)
continue;
609 const bool accepted_z = ((z1>0)==(z2>0));
610 if( !accepted_z )
continue;
614 const bool accepted_r = (hitRadIndex == clustRMatchIndex);
619 if(!accepted_r || !accepted_phi)
continue;
623 if(fabs(
dphi)<fabs(prev_dphi)){
626 hits_matched[
i] =
true;
631 clusts_matched[matchJ] =
true;
632 matched_pair.emplace_back(i,matchJ);
633 matched_nclus.push_back(reco_nclusters[matchJ]);
638 const auto& nclus = reco_nclusters[matchJ];
639 const double rad2=
get_r(reco_pos[matchJ].
X(), reco_pos[matchJ].
Y());
640 const double phi2 = reco_pos[matchJ].Phi();
642 const auto dr = rad1-rad2;
645 hnclus->Fill( (
float) nclus);
675 const auto n_reco_size1 = std::count_if( reco_nclusters.begin(), reco_nclusters.end(), [](
const unsigned int&
value ) {
return value==1; } );
676 const auto n_reco_size2 = std::count_if( reco_nclusters.begin(), reco_nclusters.end(), [](
const unsigned int&
value ) {
return value==2; } );
677 std::cout <<
"PHTpcCentralMembraneMatcher::process_event - m_truth_pos size: " <<
m_truth_pos.size() << std::endl;
678 std::cout <<
"PHTpcCentralMembraneMatcher::process_event - m_truth_pos size, r>30cm: " << n_valid_truth << std::endl;
679 std::cout <<
"PHTpcCentralMembraneMatcher::process_event - reco_pos size: " << reco_pos.size() << std::endl;
680 std::cout <<
"PHTpcCentralMembraneMatcher::process_event - reco_pos size (nclus==1): " << n_reco_size1 << std::endl;
681 std::cout <<
"PHTpcCentralMembraneMatcher::process_event - reco_pos size (nclus==2): " << n_reco_size2 << std::endl;
682 std::cout <<
"PHTpcCentralMembraneMatcher::process_event - matched_pair size: " << matched_pair.size() << std::endl;
685 for(
unsigned int ip = 0; ip < matched_pair.size(); ++ip)
687 const std::pair<unsigned int, unsigned int>&
p = matched_pair[ip];
688 const unsigned int& nclus = matched_nclus[ip];
691 unsigned int key = p.first;
697 cmdiff->setRecoPhi(reco_pos[p.second].Phi());
698 cmdiff->setRecoR(reco_pos[p.second].Perp());
699 cmdiff->setRecoZ(reco_pos[p.second].Z());
701 cmdiff->setNclusters(nclus);
705 if(
m_savehistograms)
match_ntup->Fill(
m_event_index,
m_truth_pos[p.first].Perp(),
m_truth_pos[p.first].Phi(),reco_pos[p.second].Perp(),reco_pos[p.second].Phi(),reco_pos[p.second].Z(),nclus,pos1[p.second].Perp(),pos1[p.second].Phi(),adc1[p.second],layer1[p.second],pos2[p.second].Perp(),pos2[p.second].Phi(),adc2[p.second],layer2[p.second]);
708 const double clus_r = reco_pos[p.second].Perp();
709 double clus_phi = reco_pos[p.second].Phi();
710 if ( clus_phi < 0 ) clus_phi += 2*M_PI;
712 const double clus_z = reco_pos[p.second].z();
713 const unsigned int side = (clus_z<0) ? 0:1;
716 const double dr = reco_pos[p.second].Perp() -
m_truth_pos[p.first].Perp();
718 const double rdphi = reco_pos[p.second].Perp() *
dphi;
719 const double dz = reco_pos[p.second].z() -
m_truth_pos[p.first].z();
729 static_cast<TH2*
>(dcc->
m_hDRint[side])->
Fill( clus_phi, clus_r, dr );
730 static_cast<TH2*
>(dcc->
m_hDPint[side])->
Fill( clus_phi, clus_r, rdphi );
731 static_cast<TH2*
>(dcc->
m_hDZint[side])->
Fill( clus_phi, clus_r, dz );
732 static_cast<TH2*
>(dcc->
m_hentries[side])->
Fill( clus_phi, clus_r );
740 std::cout <<
"PHTpcCentralMembraneMatcher::process_events - matched pairs: " << matched_pair.size() << std::endl;
741 std::cout <<
"PHTpcCentralMembraneMatcher::process_events - differences: " <<
m_cm_flash_diffs->
size() << std::endl;
753 for (
auto cmitr = diffrange.first;
754 cmitr !=diffrange.second;
757 auto key = cmitr->first;
758 auto cmreco = cmitr->second;
760 std::cout <<
" key " << key
761 <<
" nclus " << cmreco->getNclusters()
762 <<
" truth Phi " << cmreco->getTruthPhi() <<
" reco Phi " << cmreco->getRecoPhi()
763 <<
" truth R " << cmreco->getTruthR() <<
" reco R " << cmreco->getRecoR()
764 <<
" truth Z " << cmreco->getTruthZ() <<
" reco Z " << cmreco->getRecoZ()
787 std::unique_ptr<TFile> outputfile( TFile::Open(
m_outputfile.c_str(),
"RECREATE" ) );
791 for(
unsigned int i = 0;
i<2; ++
i )
794 {
if(
h )
h->Write(); }
845 std::cout <<
PHWHERE <<
"CORRECTED_CM_CLUSTER Node missing, abort." << std::endl;
850 m_dcc_in_static = findNode::getClass<TpcDistortionCorrectionContainer>(topNode,
"TpcDistortionCorrectionContainerStatic");
853 std::cout <<
"PHTpcCentralMembraneMatcher: found TPC distortion correction container static" << std::endl;
857 m_dcc_in_average = findNode::getClass<TpcDistortionCorrectionContainer>(topNode,
"TpcDistortionCorrectionContainerAverage");
860 std::cout <<
"PHTpcCentralMembraneMatcher: found TPC distortion correction container average" << std::endl;
864 std::cout <<
"Creating node CM_FLASH_DIFFERENCES" << std::endl;
871 std::cout <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
886 DetNode->
addNode(CMFlashDifferenceNode);
891 const std::string dcc_out_node_name =
"TpcDistortionCorrectionContainerFluctuation";
892 m_dcc_out = findNode::getClass<TpcDistortionCorrectionContainer>(topNode,dcc_out_node_name);
900 std::cout <<
"PHTpcCentralMembraneMatcher::InitRun - RUN Node missing, quitting" << std::endl;
904 std::cout <<
"PHTpcCentralMembraneMatcher::GetNodes - creating TpcDistortionCorrectionContainer in node " << dcc_out_node_name << std::endl;
907 runNode->addNode(
node);
957 const std::array<const std::string,2>
extension = {{
"_negz",
"_posz" }};
964 for(
int i =0;
i < 2; ++
i )
966 delete dcc->
m_hDPint[
i]; dcc->
m_hDPint[
i] =
new TH2F( Form(
"hIntDistortionP%s", extension[
i].c_str()), Form(
"hIntDistortionP%s", extension[
i].c_str()),
m_phibins+2, phiMin, phiMax,
m_rbins+2, rMin, rMax );
967 delete dcc->
m_hDRint[
i]; dcc->
m_hDRint[
i] =
new TH2F( Form(
"hIntDistortionR%s", extension[
i].c_str()), Form(
"hIntDistortionR%s", extension[
i].c_str()),
m_phibins+2, phiMin, phiMax,
m_rbins+2, rMin, rMax );
968 delete dcc->
m_hDZint[
i]; dcc->
m_hDZint[
i] =
new TH2F( Form(
"hIntDistortionZ%s", extension[
i].c_str()), Form(
"hIntDistortionZ%s", extension[
i].c_str()),
m_phibins+2, phiMin, phiMax,
m_rbins+2, rMin, rMax );
985 const std::array<double, nRadii>&
R,
986 std::array<int, nRadii>& nGoodStripes,
987 const std::array<int, nRadii>& keepUntil,
988 std::array<int, nRadii>& nStripesIn,
989 std::array<int, nRadii>& nStripesBefore,
990 double cx[][nRadii],
double cy[][nRadii])
992 const double phi_module = M_PI / 6.0;
993 const int pr_mult = 3;
994 const int dw_mult = 8;
995 const double diffwidth = 0.6 *
mm;
996 const double adjust = 0.015;
1003 std::array<double, nRadii> spacing;
1006 spacing[
i] = 2.0 * ((dw_mult * diffwidth / R[
i]) + (pr_mult * phi_module / nPads));
1017 theta =
i * spacing[
j] + (spacing[
j] / 2) - adjust;
1018 cx[i_out][
j] = R[
j] * cos(theta) /
cm;
1019 cy[i_out][
j] = R[
j] * sin(theta) /
cm;
1023 theta = (
i + 1) * spacing[
j] - adjust;
1024 cx[i_out][
j] = R[
j] * cos(theta) /
cm;
1025 cy[i_out][
j] = R[
j] * sin(theta) /
cm;
1029 std::cout <<
" j " <<
j <<
" i " <<
i <<
" i_out " << i_out <<
" theta " << theta <<
" cx " << cx[i_out][
j] <<
" cy " << cy[i_out][
j]
1030 <<
" radius " << sqrt(pow(cx[i_out][
j],2)+pow(cy[i_out][j],2)) << std::endl;
1039 nStripesBefore[
j] = 0;
1043 nStripesBefore[
j] = nStripesIn[j - 1] + nStripesBefore[j - 1];
1047 nGoodStripes[
j] = i_out;