24 return ( p1->
E() > p2->
E() );
29 return ( c1->
E() > c2->
E() );
34 m_moliereRadius( 3.7*
k_cm ),
35 m_clust_hit_timecut ( 20.0*
k_nsec ),
64 vector<const DBCALGeometry *> BCALGeomVec;
65 loop->Get(BCALGeomVec);
66 if(BCALGeomVec.size() == 0)
67 throw JException(
"Could not load DBCALGeometry object!");
76 gPARMS->SetDefaultParameter(
"BCALCLUSTERVERBOSE",
BCALCLUSTERVERBOSE,
"VERBOSE level for BCAL Cluster overlap success and conditions");
80 vector<const DTrackFitter *> fitters;
84 _DBG_<<
"Unable to get a DTrackFinder object!"<<endl;
85 return RESOURCE_UNAVAILABLE;
96 vector< const DBCALPoint* > twoEndPoint;
97 vector< const DBCALPoint* > usedPoints;
98 loop->Get(twoEndPoint);
104 vector< const DBCALUnifiedHit* > hits;
107 vector< const DTrackWireBased* > tracks;
111 map< int, vector< const DBCALUnifiedHit* > > cellHitMap;
112 for( vector< const DBCALUnifiedHit* >::const_iterator hitPtr = hits.begin();
113 hitPtr != hits.end();
120 if( cellHitMap.find(
id ) == cellHitMap.end() ){
122 cellHitMap[id] = vector< const DBCALUnifiedHit* >();
125 cellHitMap[id].push_back( *hitPtr );
129 vector< const DBCALUnifiedHit* > single_ended_hits;
131 for( map<
int, vector< const DBCALUnifiedHit* > >::iterator mapItr = cellHitMap.begin();
132 mapItr != cellHitMap.end();
135 if( mapItr->second.size() == 1 ){
140 single_ended_hits.push_back(hit);
145 vector<DBCALCluster*> clusters =
clusterize( twoEndPoint, usedPoints, single_ended_hits, tracks );
148 for( vector<DBCALCluster*>::iterator clust = clusters.begin();
149 clust != clusters.end();
152 if( isnan((**clust).t()) == 1 || isnan((**clust).phi()) == 1 || isnan((**clust).theta()) == 1 )
continue;
154 if( (**clust).E() < 5*
k_MeV ) {
158 vector<const DBCALPoint*>points=(**clust).points();
159 for (
unsigned int i=0;i<points.size();i++){
160 (**clust).AddAssociatedObject(points[i]);
162 _data.push_back(*clust);
167 vector<DBCALCluster*>
168 DBCALCluster_factory::clusterize( vector< const DBCALPoint* > points , vector< const DBCALPoint* > usedPoints , vector< const DBCALUnifiedHit* > hits, vector< const DTrackWireBased* > tracks )
const {
171 sort( points.begin(), points.end(),
PointSort );
173 vector<DBCALCluster*> clusters(0);
177 float seedThresh = 1.*
k_GeV;
178 float minSeed = 10*
k_MeV;
191 float layer4_minSeed = 50*
k_MeV;
192 float tracked_phi = 0.;
193 float matched_dphi = .175;
194 float matched_dtheta = .087;
196 while( seedThresh > minSeed ) {
198 bool usedPoint =
false;
200 for( vector< const DBCALPoint* >::iterator pt = points.begin();
210 for( vector< const DTrackWireBased* >::iterator trk = tracks.begin();
214 double point_r = (**pt).r();
215 double point_z = (**pt).z();
216 vector<DTrackFitter::Extrapolation_t>extrapolations=(*trk)->extrapolations.at(
SYS_BCAL);
218 double dPhi=track_pos.Phi()-(**pt).phi();
219 if (dPhi<-M_PI) dPhi+=2.*M_PI;
220 if (dPhi>M_PI) dPhi-=2.*M_PI;
222 double dTheta = fabs(point_theta_global - track_pos.Theta());
223 matched_dphi=0.175+0.175*exp(-0.8*extrapolations[0].momentum.Mag());
224 if(fabs(dPhi) < matched_dphi && dTheta < matched_dtheta){
226 tracked_phi = extrapolations[0].position.Phi();
232 for( vector<DBCALCluster*>::iterator clust = clusters.begin();
233 clust != clusters.end();
236 if((**clust).Q()==1){
238 usedPoints.push_back( *pt );
240 (**clust).addPoint( *pt, point_q );
247 if (q==1 && (**pt).layer()!=1) q=0;
249 usedPoints.push_back( *pt );
250 (**clust).addPoint( *pt , q);
261 if( usedPoint )
break;
265 if( (**pt).E() > seedThresh && ((**pt).layer() != 4 || (**pt).E() > layer4_minSeed) ){
267 usedPoints.push_back( *pt );
279 double point_reatten_E = 0.;
280 merge( clusters, point_reatten_E );
284 if( !usedPoint ) seedThresh /= 2;
288 for( vector< const DBCALUnifiedHit* >::iterator ht = hits.begin();
291 bool usedHit =
false;
293 for( vector<DBCALCluster*>::iterator clust = clusters.begin();
294 clust != clusters.end();
299 int channel_calib = 16*((**ht).module-1)+4*((**ht).layer-1)+(**ht).sector-1;
307 double hit_E = (**ht).E;
308 double hit_E_unattenuated = hit_E/exp(-d/lambda);
310 (**clust).addHit( *ht, hit_E_unattenuated );
322 if ( clusters.size() <= 1 )
return;
326 sort( clusters.begin(), clusters.end(),
ClusterSort );
328 for( vector<const DBCALPoint*>::const_iterator usedpt = usedPoints.begin();
329 usedpt != usedPoints.end();
332 bool got_overlap=
false;
335 for( vector<DBCALCluster*>::iterator clust = clusters.begin();
336 clust != clusters.end();
339 if(
overlap( **clust, *usedpt ) ){
342 float deltaPhi = (**clust).phi() - (*usedpt)->phi();
343 if (deltaPhi<-M_PI) deltaPhi+=2.*M_PI;
344 if (deltaPhi>M_PI) deltaPhi-=2.*M_PI;
345 if (fabs(deltaPhi)<min_phi){
346 min_phi=fabs(deltaPhi);
351 if(got_overlap==
false)
break;
354 for( vector<DBCALCluster*>::iterator clust = clusters.begin();
355 clust != clusters.end();
357 bool best_clust =
false;
358 vector<const DBCALPoint*>associated_points=(**clust).points();
360 float deltaPhi = (**clust).phi() - (*usedpt)->phi();
361 if (deltaPhi<-M_PI) deltaPhi+=2.*M_PI;
362 if (deltaPhi>M_PI) deltaPhi-=2.*M_PI;
363 deltaPhi=fabs(deltaPhi);
365 for(
unsigned int j = 0 ; j < associated_points.size(); j++){
368 if (fabs((*usedpt)->E()-associated_points[j]->E())<1
e-4
369 && fabs(deltaPhi-min_phi)<1
e-4) best_clust=
true;
370 if(
BCALCLUSTERVERBOSE>1)cout <<
" clust E = " << (**clust).E() <<
" assoc point E = " << associated_points[j]->E() <<
" points E = " << (*usedpt)->E() <<
" clust match = " << best_clust << endl;
372 if(best_clust==
true)
break;
376 int removed_point = 0;
377 for(
unsigned int i = 0 ; i < associated_points.size(); i++){
378 bool point_match = (fabs((*usedpt)->E()-associated_points[i]->E())<1
e-4);
379 if( point_match==0 && added_point==0 && fabs(deltaPhi-min_phi)<1
e-4){
380 (**clust).addPoint( *usedpt , q );
385 if( point_match==1 && removed_point==0 && fabs(deltaPhi-min_phi)>1
e-4){
386 (**clust).removePoint( *usedpt );
401 if( clusters.size() <= 1 )
return;
403 sort( clusters.begin(), clusters.end(),
ClusterSort );
405 bool stillMerging =
true;
407 float low_z_lim = -100.;
408 float high_z_lim = 500.;
410 while( stillMerging ){
412 stillMerging =
false;
413 for( vector<DBCALCluster*>::iterator hClust = clusters.begin();
414 hClust != clusters.end() - 1;
417 vector<const DBCALPoint*>hClust_points=(**hClust).points();
419 for( vector<DBCALCluster*>::iterator lClust = hClust + 1;
420 lClust != clusters.end();
423 vector<const DBCALPoint*>lClust_points=(**lClust).points();
424 vector<const DBCALPoint*>hClust_points=(**hClust).points();
426 if(
overlap( **hClust, **lClust ) ){
428 point_reatten_E = 0.;
430 if (hClust_points.size() == 1) {
432 for(
unsigned int i = 0 ; i < hClust_points.size() ; i++){
434 if (hClust_points[i]->z() > low_z_lim && hClust_points[i]->z() < high_z_lim) point_reatten_E = 0.;
436 int channel_calib = 16*(hClust_points[i]->module()-1)+4*(hClust_points[i]->
layer()-1)+hClust_points[i]->sector()-1;
440 double point_z = hClust_points[i]->z();
443 double dUp = 0.5 * fibLen + zLocal;
444 double dDown = 0.5 * fibLen - zLocal;
445 if (dUp>fibLen) dUp=fibLen;
447 if (dDown>fibLen) dDown=fibLen;
448 if (dDown<0) dDown=0;
451 double attUp = exp( -dUp / lambda );
452 double attDown = exp( -dDown / lambda );
454 double US_unatten_E = hClust_points[i]->E_US()*attUp;
455 double DS_unatten_E = hClust_points[i]->E_DS()*attDown;
458 double dUp_clust = 0.5 * fibLen + zLocal_clust;
459 double dDown_clust = 0.5 * fibLen - zLocal_clust;
461 double attUp_clust = exp( -dUp_clust / lambda );
462 double attDown_clust = exp( -dDown_clust / lambda );
464 double US_reattn_E = US_unatten_E/attUp_clust;
465 double DS_reattn_E = DS_unatten_E/attDown_clust;
466 point_reatten_E = 0.5 * ( US_reattn_E + DS_reattn_E);
472 if (lClust_points.size() == 1) {
474 for(
unsigned int i = 0 ; i < lClust_points.size() ; i++){
476 if (lClust_points[i]->z() > low_z_lim && lClust_points[i]->z() < high_z_lim) point_reatten_E = 0.;
478 int channel_calib = 16*(lClust_points[i]->module()-1)+4*(lClust_points[i]->
layer()-1)+lClust_points[i]->sector()-1;
482 double point_z = lClust_points[i]->z();
485 double dUp = 0.5 * fibLen + zLocal;
486 double dDown = 0.5 * fibLen - zLocal;
487 if (dUp>fibLen) dUp=fibLen;
489 if (dDown>fibLen) dDown=fibLen;
490 if (dDown<0) dDown=0;
493 double attUp = exp( -dUp / lambda );
494 double attDown = exp( -dDown / lambda );
496 double US_unatten_E = lClust_points[i]->E_US()*attUp;
497 double DS_unatten_E = lClust_points[i]->E_DS()*attDown;
500 double dUp_clust = 0.5 * fibLen + zLocal_clust;
501 double dDown_clust = 0.5 * fibLen - zLocal_clust;
503 double attUp_clust = exp( -dUp_clust / lambda );
504 double attDown_clust = exp( -dDown_clust / lambda );
506 double US_reattn_E = US_unatten_E/attUp_clust;
507 double DS_reattn_E = DS_unatten_E/attDown_clust;
508 point_reatten_E = 0.5 * ( US_reattn_E + DS_reattn_E);
514 if( (**lClust).Q() == 1 && (**hClust).Q() == 0) {
515 (**lClust).mergeClust(**hClust, point_reatten_E);
517 clusters.erase( hClust );
521 (**hClust).mergeClust(**lClust, point_reatten_E);
523 clusters.erase( lClust );
531 if( stillMerging )
break;
540 float sigTheta = fabs( highEClust.
theta() - lowEClust.
theta() ) /
548 float deltaPhi = highEClust.
phi() - lowEClust.
phi();
549 float deltaPhiAlt = ( highEClust.
phi() > lowEClust.
phi() ?
550 highEClust.
phi() - lowEClust.
phi() - 2*TMath::Pi() :
551 lowEClust.
phi() - highEClust.
phi() - 2*TMath::Pi() );
553 deltaPhi =
min( fabs( deltaPhi ), fabs( deltaPhiAlt ) );
555 float sigPhi = deltaPhi /
570 const double deltaPhi_force_merge = 0.1;
571 const double delta_z_force_merge = 15.0*
k_cm;
577 const double delta_z_force_merge_low_E = 40.0*
k_cm;
578 const double low_E = .04*
k_GeV;
582 double delta_z = fabs(z1-z2);
584 bool theta_match = (sigTheta <
m_mergeSig) || (delta_z < delta_z_force_merge) || (delta_z < delta_z_force_merge_low_E && lowEClust.
E() < low_E);
586 bool phi_match = (sigPhi <
m_mergeSig) || (deltaPhi < deltaPhi_force_merge);
589 bool time_match = (highEClust.
t() - lowEClust.
t()) <
m_timeCut;
591 if(
BCALCLUSTERVERBOSE>1) cout <<
" clust merge: " <<
" theta match success = " << theta_match <<
" phi match = " << phi_match <<
" time match = " << time_match <<
" high E = " << highEClust.
E() <<
" low E = " << lowEClust.
E() <<
" highE z = " << z1 <<
" lowE z = " << z2 <<
" deltaTheta = " << fabs(highEClust.
theta()-lowEClust.
theta()) <<
" sigTheta = " << sigTheta <<
" highE sigTheta = " << highEClust.
sigTheta() <<
" lowE sigTheta = " << lowEClust.
sigTheta() << endl;
593 vector<const DBCALPoint*> highE_points;
594 highE_points = (highEClust).points();
596 vector<const DBCALPoint*> lowE_points;
597 lowE_points = (lowEClust).points();
599 double highE_summed_z = 0.;
600 double highE_summed_phi = 0.;
601 double highE_summed_zphi = 0.;
602 double highE_summed_z_sq = 0.;
603 double highE_slope = 0.;
604 double highE_y_intercept = 0.;
606 double lowE_summed_z = 0.;
607 double lowE_summed_phi = 0.;
608 double lowE_summed_zphi = 0.;
609 double lowE_summed_z_sq = 0.;
610 double lowE_slope = 0.;
611 double lowE_y_intercept = 0.;
615 double slope_match = 0.01;
616 double intercept_match = 1.8;
617 double deltaPhi_match = 0.2;
619 int lowE_global_sector = 0;
620 int highE_global_sector = 0;
621 int lowE_point_layer = 0;
623 for(
unsigned int i = 0 ; i < lowE_points.size() ; i ++){
625 if(lowEClust.
phi() > lowE_points[i]->phi() ){
626 if( fabs( lowEClust.
phi() - lowE_points[i]->phi() - 2*TMath::Pi() ) < TMath::Pi() ) lowE_points[i]->add2Pi();
629 if( fabs( lowE_points[i]->phi() - lowEClust.
phi() - 2*TMath::Pi() ) < TMath::Pi() ) lowE_points[i]->sub2Pi();
633 lowE_summed_z += lowE_points[i]->z();
634 lowE_summed_phi += lowE_points[i]->phi();;
635 lowE_summed_zphi += lowE_points[i]->z()*lowE_points[i]->phi();
636 lowE_summed_z_sq += lowE_points[i]->z()*lowE_points[i]->z();
637 if(lowE_points.size()==1) {
638 lowE_global_sector = 4*(lowE_points[i]->module()-1) + lowE_points[i]->sector();
639 lowE_point_layer = lowE_points[i]->layer();
643 for(
unsigned int i = 0 ; i < highE_points.size() ; i ++){
645 if(highEClust.
phi() > highE_points[i]->phi() ){
646 if( fabs( highEClust.
phi() - highE_points[i]->phi() - 2*TMath::Pi() ) < TMath::Pi() ) highE_points[i]->add2Pi();
649 if( fabs( highE_points[i]->phi() - highEClust.
phi() - 2*TMath::Pi() ) < TMath::Pi() ) highE_points[i]->sub2Pi();
652 highE_summed_z += highE_points[i]->z();
653 highE_summed_phi += highE_points[i]->phi();;
654 highE_summed_zphi += highE_points[i]->z()*highE_points[i]->phi();
655 highE_summed_z_sq += highE_points[i]->z()*highE_points[i]->z();
656 highE_global_sector = 4*(highE_points[i]->module()-1) + highE_points[i]->sector();
657 if(lowE_points.size()==1 && lowE_point_layer == highE_points[i]->layer() && ( lowE_global_sector+1 == highE_global_sector || lowE_global_sector-1 == highE_global_sector ) ) connected = 1;
664 highE_slope = (highE_summed_z*highE_summed_phi - highE_points.size()*highE_summed_zphi)/(highE_summed_z*highE_summed_z - highE_points.size()*highE_summed_z_sq);
665 highE_y_intercept = (highE_summed_zphi*highE_summed_z - highE_summed_phi*highE_summed_z_sq)/(highE_summed_z*highE_summed_z - highE_points.size()*highE_summed_z_sq);
667 lowE_slope = (lowE_summed_z*lowE_summed_phi - lowE_points.size()*lowE_summed_zphi)/(lowE_summed_z*lowE_summed_z - lowE_points.size()*lowE_summed_z_sq);
668 lowE_y_intercept = (lowE_summed_zphi*lowE_summed_z - lowE_summed_phi*lowE_summed_z_sq)/(lowE_summed_z*lowE_summed_z - lowE_points.size()*lowE_summed_z_sq);
670 double delta_slope = fabs(highE_slope - lowE_slope) ;
671 double delta_intercept = fabs(highE_y_intercept - lowE_y_intercept) ;
673 highE_points.clear();
680 if (highEClust.
Q() == 0 && lowEClust.
Q() == 0 )
return theta_match && phi_match && time_match;
682 else return ( ( delta_slope < slope_match && delta_intercept < intercept_match && deltaPhi < deltaPhi_match ) || connected == 1 ) ;
692 float deltaTheta = fabs( clust.
theta() - point->
theta() );
702 float deltaPhi = clust.
phi() - point->
phi();
703 float deltaPhiAlt = ( clust.
phi() > point->
phi() ?
704 clust.
phi() - point->
phi() - 2*TMath::Pi() :
705 point->
phi() - clust.
phi() - 2*TMath::Pi() );
707 deltaPhi =
min( fabs( deltaPhi ), fabs( deltaPhiAlt ) );
715 float rho = ( clust.
rho() + point->
rho() ) / 2;
716 float theta = ( clust.
theta() + point->
theta() ) / 2;
718 float sep =
sqrt( ( rho * deltaTheta ) * ( rho * deltaTheta ) +
719 ( rho *
sin( theta ) * deltaPhi ) * ( rho *
sin( theta ) * deltaPhi ) );
721 float sep_term1 = rho*deltaTheta;
722 float sep_term2 = rho*
sin(theta)*deltaPhi;
725 bool time_match = fabs(clust.
t() - point->
t()) <
m_timeCut;
727 double clust_z = clust.
rho()*cos(clust.
theta());
730 double c1=23.389+19.093*tanh(-0.0104*(clust_z-201.722));
733 double c2=0.151+0.149*tanh(-0.016*(clust_z-275.194));
739 double inclusion_val=exp(-sep/30.)-0.1;
742 double inclusion_val1=exp(-(sep_term1-0.1)/c1)-c2+.15;
745 double inclusion_val2=exp(-(sep_term2-2.)/2.5)-sep_term2*0.002+0.07;
752 if(
BCALCLUSTERVERBOSE>0) cout <<
"(m,l,s) = (" <<point->
module()<<
","<<point->
layer()<<
","<<point->
sector()<<
")" <<
" sep = " << sep <<
"sep1 = " << sep_term1 <<
" sep2 = " << sep_term2 <<
" inclusion value = " << inclusion_val <<
" inclusion val1= " << inclusion_val1 <<
" inclusion val2= " << inclusion_val2<<
" time match = " << time_match <<
" clust E = " << clust.
E() <<
" point E = " << point->
E() <<
" energy ratio = " << point->
E()/(point->
E()+clust.
E()) <<
" clust theta = " << clust.
theta()*180./3.14159 <<
" point theta = " << point->
theta()*180./3.14159 <<
" sep rho*deltaTheta = " << ( rho * deltaTheta ) << endl;
755 return ((point->
E()/(point->
E()+clust.
E())) < inclusion_val1 ) && ((point->
E()/(point->
E()+clust.
E())) < inclusion_val2 ) && time_match && deltaPhi*180./3.14159<10.;
767 const DBCALPoint* point,
float tracked_phi)
const {
774 float phiCut = 0.65417;
776 vector<const DBCALPoint*> assoc_points;
777 assoc_points = (clust).points();
779 double summed_r = 0.;
780 double summed_phi = 0.;
781 double summed_rphi = 0.;
782 double summed_r_sq = 0.;
784 double summed_z = 0.;
785 double summed_zphi = 0.;
786 double summed_z_sq = 0.;
789 double y_intercept = 0.;
791 int point_global_sector = 4*(point->
module()-1) + point->
sector();
792 int point_layer = point->
layer();
795 for(
unsigned int i = 0 ; i < assoc_points.size() ; i ++){
796 int assoc_point_global_sector = 4*(assoc_points[i]->module() - 1) + assoc_points[i]->sector();
797 if( point_layer == assoc_points[i]->
layer() && ( point_global_sector + 1 == assoc_point_global_sector || point_global_sector - 1 == assoc_point_global_sector) ) connected = 1;
798 summed_r += assoc_points[i]->r();
799 summed_z += assoc_points[i]->z();
800 if( tracked_phi > assoc_points[i]->phi() ){
801 if( fabs( tracked_phi - assoc_points[i]->phi() - 2*TMath::Pi() ) < TMath::Pi() ) assoc_points[i]->add2Pi();
804 if( fabs( assoc_points[i]->phi() - tracked_phi - 2*TMath::Pi() ) < TMath::Pi() ) assoc_points[i]->sub2Pi();
807 summed_phi += assoc_points[i]->phi();
808 summed_rphi += assoc_points[i]->r()*assoc_points[i]->phi();
809 summed_r_sq += assoc_points[i]->r()*assoc_points[i]->r();
810 summed_zphi += assoc_points[i]->z()*assoc_points[i]->phi();
811 summed_z_sq += assoc_points[i]->z()*assoc_points[i]->z();
815 if(assoc_points.size()<2){
821 slope = (summed_z*summed_phi - assoc_points.size()*summed_zphi)/(summed_z*summed_z - assoc_points.size()*summed_z_sq);
822 y_intercept = (summed_zphi*summed_z - summed_phi*summed_z_sq)/(summed_z*summed_z - assoc_points.size()*summed_z_sq);
827 if(assoc_points.size() < 2) fit_phi = slope*point->
r() + y_intercept;
828 else fit_phi = slope*point->
z() + y_intercept;
830 assoc_points.clear();
832 float deltaPhi = fit_phi-point->
phi();
833 float deltaPhiAlt = ( fit_phi > point->
phi() ?
834 fit_phi - point->
phi() - 2*TMath::Pi() :
835 point->
phi() - fit_phi - 2*TMath::Pi() );
837 deltaPhi =
min( fabs( deltaPhi ), fabs( deltaPhiAlt ) );
839 float rho = point->
rho();
840 float theta = point->
theta();
842 float deltaTheta = fabs( clust.
theta() - point->
theta() );
844 float sep =
sqrt( ( rho * deltaTheta ) * ( rho * deltaTheta ) +
845 ( rho *
sin( theta ) * deltaPhi ) * ( rho *
sin( theta ) * deltaPhi ) );
847 float sep_term1 = rho*deltaTheta;
848 float sep_term2 = rho*
sin(theta)*deltaPhi;
851 bool time_match = fabs(clust.
t() - point->
t()) <
m_timeCut;
853 bool phi_match = fabs( clust.
phi() - point->
phi() ) < phiCut;
855 double clust_z = clust.
rho()*cos(clust.
theta());
858 double c1=23.389+19.093*tanh(-0.0104*(clust_z-201.722));
861 double c2=0.151+0.149*tanh(-0.016*(clust_z-275.194));
867 double inclusion_val=exp(-sep/30.)-0.1;
870 double inclusion_val1=exp(-(sep_term1-0.1)/c1)-c2+.15;
872 double inclusion_val2 = exp(-(sep_term2-2.)/1.5) - sep_term2*.007 + .15;
879 if(
BCALCLUSTERVERBOSE>1) cout <<
"(m,l,s) = (" <<point->
module()<<
","<<point->
layer()<<
","<<point->
sector()<<
")" <<
" sep = " << sep <<
"sep1 = " << sep_term1 <<
" sep2 = " << sep_term2 <<
" inclusion value = " << inclusion_val <<
" inclusion val1= " << inclusion_val1 <<
" inclusion val2= " << inclusion_val2<<
" time match = " << time_match <<
" clust E = " << clust.
E() <<
" point E = " << point->
E() <<
" energy ratio = " << point->
E()/(point->
E()+clust.
E()) <<
" clust theta = " << clust.
theta()*180./3.14159 <<
" point theta = " << point->
theta()*180./3.14159 <<
" sep rho*deltaTheta = " << ( rho * deltaTheta ) << endl;
882 return ((point->
E()/(point->
E()+clust.
E())) < (inclusion_val1) ) && ((point->
E()/(point->
E()+clust.
E())) < (inclusion_val2) ) && time_match && phi_match;
889 return connected == 1;
905 float deltaPhi = clust.
phi() - cellPhi;
906 float deltaPhiAlt = ( clust.
phi() > cellPhi ?
907 clust.
phi() - cellPhi - 2*TMath::Pi() :
908 cellPhi - clust.
phi() - 2*TMath::Pi() );
909 deltaPhi =
min( fabs( deltaPhi ), fabs( deltaPhiAlt ) );
911 float sigPhi = deltaPhi /
920 double time_diff = TMath::Abs(clust.
t() - time_corr);
bool PointSort(const DBCALPoint *p1, const DBCALPoint *p2)
bool ExtrapolateToRadius(double R, const vector< Extrapolation_t > &extraps, DVector3 &pos, DVector3 &mom, double &t, double &s) const
jerror_t evnt(JEventLoop *loop, uint64_t eventnumber)
float m_clust_hit_timecut
vector< vector< double > > attenuation_parameters
vector< double > effective_velocities
float phi(int fADC_cellId) const
these functions are about the physical location and dimensions of a readout cell
float GetBCAL_length() const
vector< DBCALCluster * > clusterize(vector< const DBCALPoint * > points, vector< const DBCALPoint * > usedPoints, vector< const DBCALUnifiedHit * > hits, vector< const DTrackWireBased * > tracks) const
bool overlap(const DBCALCluster &highEClust, const DBCALCluster &lowEClust) const
DGeometry * GetDGeometry(unsigned int run_number)
float GetBCAL_inner_rad() const
float phiSize(int fADC_cellId) const
jerror_t brun(JEventLoop *loop, int32_t runnumber)
const DBCALGeometry * m_BCALGeom
void merge(vector< DBCALCluster * > &clusters, double point_reatten_E) const
float GetBCAL_center() const
void recycle_points(vector< const DBCALPoint * > usedPoints, vector< DBCALCluster * > &clusters) const
int cellId(int module, int layer, int sector) const
these functions are about encoding/decoding module/layer/sector info in a cellId
bool ClusterSort(const DBCALCluster *c1, const DBCALCluster *c2)
bool overlap_charged(const DBCALCluster &clust, const DBCALPoint *point, float tracked_phi) const
bool GetTargetZ(double &z_target) const
z-location of center of target
uint32_t BCALCLUSTERVERBOSE
const DTrackFitter * fitter
float t
Unified time, obtained from ADC and/or TDC and used for further analysis.