26 #include "THaApparatus.h"
28 #include "THaTrackProj.h"
40 const char* name,
const char* description,
41 const Int_t chambernum, THaDetectorBase* parent ) :
42 THaSubDetector(name,description,parent)
99 if( (status = THaSubDetector::Init( date )) )
100 return fStatus=status;
102 return fStatus = kOK;
148 prefix[0]=tolower(GetApparatus()->
GetName()[0]);
208 for(
Int_t ipm1=0;ipm1<fNPlanes+1;ipm1++) {
209 for(
Int_t ipm2=ipm1;ipm2<fNPlanes+1;ipm2++) {
210 if(ipm1==ipm2 && ipm1<fNPlanes)
continue;
212 for(
Int_t i=0;i<3;i++) {
213 for(
Int_t j=i;j<3;j++) {
216 if(ipm1 != ip && ipm2 != ip) {
220 AA3[j][i] = AA3[i][j];
223 Int_t bitpat = allplanes & ~(1<<ipm1) & ~(1<<ipm2);
241 if( mode == kDefine && fIsSetup )
return kOK;
242 fIsSetup = ( mode == kDefine );
246 {
"maxhits",
"Maximum hits allowed",
"fMaxHits" },
247 {
"spacepoints",
"Space points of DC",
"fNSpacePoints" },
248 {
"nhit",
"Number of DC hits",
"fNhits" },
249 {
"trawhit",
"Number of True Raw hits",
"fN_True_RawHits" },
250 {
"sp_nhits",
"",
"fSpacePoints.THcSpacePoint.GetNHits()" },
251 {
"stub_x",
"",
"fSpacePoints.THcSpacePoint.GetStubX()" },
252 {
"stub_xp",
"",
"fSpacePoints.THcSpacePoint.GetStubXP()" },
253 {
"stub_y",
"",
"fSpacePoints.THcSpacePoint.GetStubY()" },
254 {
"stub_yp",
"",
"fSpacePoints.THcSpacePoint.GetStubYP()" },
255 {
"ncombos",
"",
"fSpacePoints.THcSpacePoint.GetCombos()" },
256 {
"U_pos",
"",
"fUPlaneClusters.THcDCPlaneCluster.GetX()" },
257 {
"X_pos",
"",
"fXPlaneClusters.THcDCPlaneCluster.GetX()" },
258 {
"V_pos",
"",
"fVPlaneClusters.THcDCPlaneCluster.GetX()" },
259 {
"UX_posx",
"",
"fUXPlaneClusters.THcDCPlaneCluster.GetX()" },
260 {
"UX_posy",
"",
"fUXPlaneClusters.THcDCPlaneCluster.GetY()" },
261 {
"VX_posx",
"",
"fVXPlaneClusters.THcDCPlaneCluster.GetX()" },
262 {
"VX_posy",
"",
"fVXPlaneClusters.THcDCPlaneCluster.GetY()" },
265 DefineVarsFromList( vars, mode );
267 std::vector<RVarDef> ve;
268 ve.push_back( {
"sphit",
"",
"fSpHit.SpNHits" });
269 ve.push_back( {
"sphit_index",
"",
"fSpHit.SpHitIndex" });
271 return DefineVarsFromList( ve.data(), mode );
286 fHits.push_back(static_cast<THcDCHit*>(hitsarray->
At(ihit)));
296 cout <<
" Num of nits = " <<
fNhits << endl;
297 cout <<
" Num " <<
" Plane " <<
" Wire " <<
" Wire-Center " <<
" RAW TDC " <<
" Drift time" << endl;
316 if (
fhdebugflagpr) cout <<
" in newfindspacepoints " << endl;
359 cout <<
" nc = " << nc <<
" nhits = " << clus->
GetNHits() << endl;
364 cout <<
" nc = " << nc <<
" nhits = " << clus->
GetNHits()<< endl;
369 cout <<
" nc = " << nc <<
" nhits = " << clus->
GetNHits()<< endl;
441 cout <<
" nc = " << nc <<
" nhits = " << clus->
GetNHits() << endl;
446 cout <<
" nc = " << nc <<
" nhits = " << clus->
GetNHits()<< endl;
450 vector <THcDCHit*> UX_uHits;
451 vector <THcDCHit*> UX_xHits;
452 vector <THcDCHit*> VX_vHits;
453 vector <THcDCHit*> VX_xHits;
478 if (
fhdebugflagpr) cout <<
" vx_xhits = " << VX_xHits.size() <<
" ux_xhits = "<< UX_xHits.size() << endl;
479 if (VX_xHits.size() == UX_xHits.size() && UX_xHits.size()==1) {
480 if (VX_xHits[0] == UX_xHits[0]) Xhits_match =
kTRUE;
481 }
else if (VX_xHits.size() == UX_xHits.size() && UX_xHits.size()==2) {
482 if (VX_xHits[0] == UX_xHits[0] && VX_xHits[1] == UX_xHits[1]) Xhits_match =
kTRUE;
483 if (VX_xHits[0] == UX_xHits[1] && VX_xHits[1] == UX_xHits[0]) Xhits_match =
kTRUE;
485 if (
fhdebugflagpr) cout <<
" Xhits_match = " << Xhits_match <<
" dist2 = " << dist2 <<
" spcrit = " <<
fSpacePointCriterion <<
" VX_x " << vx_posx<<
" UX_x " << ux_posx<<
" VX_y " << vx_posy<<
" UX_y " << ux_posy << endl;
486 Int_t TotHits = UX_uHits.size()+UX_xHits.size()+VX_vHits.size();
487 if (dist2 <= fSpacePointCriterion && Xhits_match && TotHits>=
fMinHits) {
491 Double_t xt = (ux_posx + vx_posx)/2.;
492 Double_t yt = (ux_posy + vx_posy)/2.;
495 for (
UInt_t ih=0;ih<UX_uHits.size();ih++) { sp->
AddHit(UX_uHits[ih]);}
496 for (
UInt_t ih=0;ih<UX_xHits.size();ih++) { sp->
AddHit(UX_xHits[ih]);}
497 for (
UInt_t ih=0;ih<VX_vHits.size();ih++) { sp->
AddHit(VX_vHits[ih]);}
561 if (
fhdebugflagpr) cout <<
" In old findspacepoint " << endl;
564 Int_t plane_hitind=0;
565 Int_t planep_hitind=0;
579 Int_t PlaneInd=0,PlanePInd=0;
588 &&
pow( (
fHits[plane_hitind]->GetPos() -
fHits[planep_hitind]->GetPos()),2)
608 if (nadded)
if (
fhdebugflagpr) cout << nadded <<
" Space Points added with SpacePointMultiWire()" << endl;
630 return(fNSpacePoints);
646 Int_t easy_space_point=0;
654 if(ihit!=yplane_hitind && ihit!=yplanep_hitind) {
656 x_pos[ihit] = (thishit->
GetPos()
665 xt = (num_xhits>0?xt/num_xhits:0.0);
666 easy_space_point = 1;
669 if(ihit!=yplane_hitind && ihit!=yplanep_hitind) {
671 { easy_space_point=0;
break;}
674 if(easy_space_point) {
683 return(easy_space_point);
697 Int_t easy_space_point=0;
705 if(ihit!=xplane_hitind && ihit!=xplanep_hitind) {
707 y_pos[ihit] = (thishit->
GetPos()
716 yt = (num_yhits>0?yt/num_yhits:0.0);
717 easy_space_point = 1;
720 if(ihit!=xplane_hitind && ihit!=xplanep_hitind) {
722 { easy_space_point=0;
break;}
725 if(easy_space_point) {
734 return(easy_space_point);
741 Int_t MAX_NUMBER_PAIRS=1000;
747 Pair pairs[MAX_NUMBER_PAIRS];
749 Int_t ntest_points=0;
754 if(ntest_points < MAX_NUMBER_PAIRS) {
760 pairs[ntest_points].hit1 = hit1;
761 pairs[ntest_points].hit2 = hit2;
762 pairs[ntest_points].x = (hit1->
GetPos()*plane2->
GetYsp()
765 pairs[ntest_points].y = (hit2->
GetPos()*plane1->
GetXsp()
778 Combo combos[10*MAX_NUMBER_PAIRS];
779 for(
Int_t ipair1=0;ipair1<ntest_points-1;ipair1++) {
780 for(
Int_t ipair2=ipair1+1;ipair2<ntest_points;ipair2++) {
781 if(ncombos < 10*MAX_NUMBER_PAIRS) {
783 +
pow(pairs[ipair1].
y - pairs[ipair2].
y,2);
785 combos[ncombos].pair1 = &pairs[ipair1];
786 combos[ncombos].pair2 = &pairs[ipair2];
794 for(
Int_t icombo=0;icombo<ncombos;icombo++) {
796 hits[0]=combos[icombo].pair1->hit1;
797 hits[1]=combos[icombo].pair1->hit2;
798 hits[2]=combos[icombo].pair2->hit1;
799 hits[3]=combos[icombo].pair2->hit2;
801 Double_t xt = (combos[icombo].pair1->x + combos[icombo].pair2->x)/2.0;
802 Double_t yt = (combos[icombo].pair1->y + combos[icombo].pair2->y)/2.0;
820 iflag[0]=0;iflag[1]=0;iflag[2]=0;iflag[3]=0;
825 for(
Int_t icm_hit=0;icm_hit<4;icm_hit++) {
826 if(sp->
GetHit(isp_hit)==hits[icm_hit]) {
833 for(
Int_t icm1=0;icm1<3;icm1++) {
834 for(
Int_t icm2=icm1+1;icm2<4;icm2++) {
835 if(hits[icm1]==hits[icm2]) {
841 for(
Int_t icm=0;icm<4;icm++) {
863 if(hits[0] != hits[2] && hits[1] != hits[2]) {
866 if(hits[0] != hits[3] && hits[1] != hits[3]) {
880 if(hits[0] != hits[2] && hits[1] != hits[2]) {
883 if(hits[0] != hits[3] && hits[1] != hits[3]) {
903 spacepointsgood[i] = 0;
906 Int_t nplanes_hit = 0;
908 nhitsperplane[ip] = 0;
920 if(nhitsperplane[ip] > 0) {
926 spacepointsgood[ngood++] = isp;
933 Int_t nremoved=fNSpacePoints-ngood;
934 fNSpacePoints = ngood;
936 Int_t osp=spacepointsgood[isp];
983 for(
Int_t isp=0;isp<nsp_totl;isp++) {
984 Int_t nplanes_hit = 0;
985 Int_t nplanes_mult = 0;
991 nhitsperplane[ip] = 0;
993 hits_plane[ip][ih] = 0;
1003 hits_plane[ip][nhitsperplane[ip]++] = hit;
1007 if(nhitsperplane[ip] > 0) {
1009 nsp_new *= nhitsperplane[ip];
1010 if(nhitsperplane[ip] > 1) nplanes_mult++;
1015 nsp_check=nsp_tot + nsp_new;
1020 if(nplanes_hit >= 4 && nplanes_mult < 4 && nplanes_mult >0
1021 && nsp_check < 20) {
1030 for(
Int_t ip1=0;ip1<fNPlanes-1;ip1++) {
1032 if(nhitsperplane[maxplane[ip2]] > nhitsperplane[maxplane[ip1]]) {
1033 Int_t temp = maxplane[ip1];
1034 maxplane[ip1] = maxplane[ip2];
1035 maxplane[ip2] = temp;
1040 for(
Int_t n1=0;n1<nhitsperplane[maxplane[0]];n1++) {
1041 for(
Int_t n2=0;n2<nhitsperplane[maxplane[1]];n2++) {
1042 for(
Int_t n3=0;n3<nhitsperplane[maxplane[2]];n3++) {
1047 if(n1==0 && n2==0 && n3==0) {
1057 newsp->
AddHit(hits_plane[maxplane[0]][n1]);
1058 newsp->
AddHit(hits_plane[maxplane[1]][n2]);
1059 newsp->
AddHit(hits_plane[maxplane[2]][n3]);
1060 newsp->
AddHit(hits_plane[maxplane[3]][0]);
1061 if(nhitsperplane[maxplane[4]] == 1) {
1062 newsp->
AddHit(hits_plane[maxplane[4]][0]);
1063 if(nhitsperplane[maxplane[5]] == 1)
1064 newsp->
AddHit(hits_plane[maxplane[5]][0]);
1074 newsp->
AddHit(hits_plane[maxplane[0]][n1]);
1075 newsp->
AddHit(hits_plane[maxplane[1]][n2]);
1076 newsp->
AddHit(hits_plane[maxplane[2]][n3]);
1077 newsp->
AddHit(hits_plane[maxplane[3]][0]);
1078 if(nhitsperplane[maxplane[4]] == 1) {
1079 newsp->
AddHit(hits_plane[maxplane[4]][0]);
1080 if(nhitsperplane[maxplane[5]] == 1)
1081 newsp->
AddHit(hits_plane[maxplane[5]][0]);
1090 nsp_tot += (ntot-1);
1095 assert (nsp_tot > 0);
1118 Int_t goodhit[startnum];
1119 for(
Int_t ihit=0;ihit<startnum;ihit++) {
1123 for(
Int_t ihit1=0;ihit1<startnum-1;ihit1++) {
1127 for(
Int_t ihit2=ihit1+1;ihit2<startnum;ihit2++) {
1131 if(plane1 == plane2) {
1132 if(tdrift1 > tdrift2) {
1142 for(
Int_t ihit=0;ihit<startnum;ihit++) {
1143 if(goodhit[ihit] > 0) {
1144 if (ihit > finalnum) {
1173 if(isp > sp_count) {
1191 fNSpacePoints = sp_count;
1244 double alpha =
static_cast<THcDC*
>(
fParent)->GetAlphaAngle(pln);
1253 switch (readoutSide){
1255 if (x>xc){wireDistance = -readvert*wireDistance;}
1256 else{wireDistance = readvert*wireDistance;}
1260 if (y>yc){wireDistance = -readhoriz*wireDistance;}
1261 else{wireDistance = readhoriz*wireDistance;}
1265 if (xc>x){wireDistance= -readvert*wireDistance;}
1266 else{wireDistance = readvert*wireDistance;}
1270 if(yc>y){wireDistance = -readhoriz*wireDistance;}
1271 else{wireDistance = readhoriz*wireDistance;}
1282 hit->
SetTime(time - timeCorrection);
1288 hit->
SetTime(time - timeCorrection);
1336 x = x - ((x >> 1) & 0x55555555);
1337 x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
1338 return (((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
1361 Int_t plusminusknown[nhits];
1362 Int_t plusminusbest[nhits];
1363 Int_t plusminus[nhits];
1364 Int_t tmp_plusminus[nhits];
1365 Int_t plane_list[nhits];
1371 if (
fhdebugflagpr) cout <<
"THcDriftChamber::LeftRight() nhits < 0" << endl;
1372 }
else if (nhits==0) {
1373 if (
fhdebugflagpr) cout <<
"THcDriftChamber::LeftRight() nhits = 0" << endl;
1375 for(
Int_t ihit=0;ihit < nhits;ihit++) {
1378 plane_list[ihit] = pindex;
1380 bitpat |= 1<<pindex;
1382 plusminusknown[ihit] = 0;
1387 nplusminus = 1<<nhits;
1389 Int_t smallAngOK = (hasy1>=0) && (hasy2>=0);
1394 plusminusknown[hasy1] = -1;
1395 plusminusknown[hasy2] = 1;
1397 plusminusknown[hasy1] = 1;
1398 plusminusknown[hasy2] = -1;
1400 nplusminus = 1<<(nhits-2);
1409 for(
Int_t ihit1=0;ihit1 < nhits;ihit1++) {
1412 if((pindex1%2)==0) {
1413 for(
Int_t ihit2=0;ihit2<nhits;ihit2++) {
1417 plusminusknown[ihit1] = -1;
1418 plusminusknown[ihit2] = 1;
1420 plusminusknown[ihit1] = 1;
1421 plusminusknown[ihit2] = -1;
1428 nplusminus = 1 << (nhits-npaired);
1432 if (
fdebugstubchisq) cout <<
"THcDriftChamber::LeftRight: numhits-2 < 0" << endl;
1433 }
else if (nhits == 2) {
1434 if (
fdebugstubchisq) cout <<
"THcDriftChamber::LeftRight: numhits-2 = 0" << endl;
1437 if (
fhdebugflagpr) cout <<
" num of pm = " << nplusminus <<
" num of hits =" << nhits << endl;
1440 for(
Int_t pmloop=0;pmloop<nplusminus;pmloop++) {
1442 for(
Int_t ihit=0;ihit<nhits;ihit++) {
1443 if(plusminusknown[ihit]!=0) {
1444 plusminus[ihit] = plusminusknown[ihit];
1447 if(pmloop & iswhit) {
1448 plusminus[ihit] = 1;
1450 plusminus[ihit] = -1;
1457 chi2 =
FindStub(nhits, sp,plane_list, bitpat, plusminus, stub);
1458 if (
fdebugstubchisq) cout <<
" pmloop = " << pmloop <<
" chi2 = " << chi2 << endl;
1459 if(chi2 < minchi2) {
1466 if(stub[2]*
fTanBeta[plane_list[0]]==-1.0) {
1467 if (
fhdebugflagpr) cout <<
"THcDriftChamber::LeftRight() Error 3" << endl;
1470 /(1+stub[2]*
fTanBeta[plane_list[0]]);
1474 for(
Int_t ihit=0;ihit<nhits;ihit++) {
1475 plusminusbest[ihit] = plusminus[ihit];
1479 if (chi2 < tmp_minchi2) {
1481 for(
Int_t ihit=0;ihit<nhits;ihit++) {
1482 tmp_plusminus[ihit] = plusminus[ihit];
1484 for(
Int_t i=0;i<4;i++) {
1485 tmp_stub[i] = stub[i];
1491 for(
Int_t ihit=0;ihit<nhits;ihit++) {
1492 plusminusbest[ihit] = plusminus[ihit];
1501 if (
fhdebugflagpr) cout <<
"pmloop=" << pmloop <<
" Chi2=" << chi2 << endl;
1503 if(stub[2]*
fTanBeta[plane_list[0]] == -1.0) {
1504 if (
fhdebugflagpr) cout <<
"THcDriftChamber::LeftRight() Error 3" << endl;
1507 /(1+stub[2]*
fTanBeta[plane_list[0]]);
1511 for(
Int_t ihit=0;ihit<nhits;ihit++) {
1512 plusminusbest[ihit] = plusminus[ihit];
1517 if (
fhdebugflagpr) cout <<
"Insufficient planes hit in THcDriftChamber::LeftRight()" << bitpat <<endl;
1521 if (minchi2 == maxchi2 && tmp_minchi2 == maxchi2) {
1524 if(minchi2 == maxchi2 ) {
1525 minchi2 = tmp_minchi2;
1526 for(
Int_t ihit=0;ihit<nhits;ihit++) {
1527 plusminusbest[ihit] = tmp_plusminus[ihit];
1535 for(
Int_t ihit=0; ihit<nhits; ihit++) {
1539 sp->
SetHitLR(ihit, plusminusbest[ihit]);
1544 Int_t pindex=plane_list[0];
1545 if(spstub[2] -
fTanBeta[pindex] == -1.0) {
1546 if (
fhdebugflagpr) cout <<
"THcDriftChamber::LeftRight(): stub3 error" << endl;
1548 stub[2] = (spstub[2] -
fTanBeta[pindex])
1549 / (1.0 + spstub[2]*
fTanBeta[pindex]);
1551 if (
fhdebugflagpr) cout <<
"THcDriftChamber::LeftRight(): stub4 error" << endl;
1555 stub[0] = spstub[0]*
fCosBeta[pindex]
1556 - spstub[0]*stub[2]*
fSinBeta[pindex];
1558 - spstub[1]*stub[3]*fSinBeta[pindex];
1560 if (
fhdebugflagpr) cout <<
" Left/Right space pt " << isp+1 <<
" " << stub[0]<<
" " << stub[1] <<
" " << stub[2]<<
" " << stub[3] << endl;
1579 for(
Int_t ihit=0;ihit<nhits; ihit++) {
1582 -
fPsi0[plane_list[ihit]];
1583 for(
Int_t index=0;index<3;index++) {
1584 TT[index]+= dpos[ihit]*
fStubCoefs[plane_list[ihit]][index]
1585 /
fSigma[plane_list[ihit]];
1601 for(
Int_t ihit=0;ihit<nhits; ihit++) {
1602 chi2 +=
pow( dpos[ihit]/
fSigma[plane_list[ihit]]
Drift chamber wire hit info.
void SetPlaneIndex(Int_t index)
std::string GetName(const std::string &scope_name)
Int_t GetPlaneIndex() const
double dist(Rotation3D const &r1, Rotation3D const &r2)
virtual Int_t NewFindSpacePoints(void)
Int_t DestroyPoorSpacePoints(void)
virtual Int_t DefineVariables(EMode mode=kDefine)
Int_t SpacePointMultiWire(void)
void SelectSpacePoints(void)
SpacePointHitOutputData fSpHit
TClonesArray * fSpacePoints
std::vector< THcDriftChamberPlane * > fPlanes
void SetStub(Double_t stub[4])
THcDriftChamberPlane * GetWirePlane() const
Class for a a single Hall C horizontal drift chamber plane.
virtual void AddPlane(THcDriftChamberPlane *plane)
virtual ~THcDriftChamber()
Double_t fRatio_xpfp_to_xfp
Analyze a package of horizontal drift chambers.
void AddHit(THcDCHit *hit)
virtual void PrintDecode(void)
Int_t FindEasySpacePoint_SOS(Int_t xplane_hitind, Int_t xplanep_hitind)
virtual Int_t Decode(const THaEvData &)
TVectorT< Double_t > & Use(Int_t lwb, Int_t upb, Double_t *data)
Double_t GetCentralTime()
TObject * ConstructedAt(Int_t idx)
Class for clusters in the same orientation planes (V,X or U)
TClonesArray * fVPlaneClusters
double pow(double, double)
virtual void LeftRight(void)
std::map< int, TMatrixD > fAA3Inv
void SetXY(Double_t x, Double_t y)
virtual Int_t FindSpacePoints(void)
void Clear(Option_t *opt="")
void AddHit(THcDCHit *hit)
void SetHitLR(Int_t ihit, Int_t lr)
virtual Int_t ReadDatabase(const TDatime &date)
Int_t GetPlaneNum() const
Int_t fRemove_Sppt_If_One_YPlane
Double_t GetHitDist(Int_t ihit)
TMatrixT< Double_t > & Invert(Double_t *det=0)
void SetNHits(Int_t nhits)
Double_t fSpacePointCriterion
Class representing a single hit DC.
virtual void Clear(Option_t *option="")
TClonesArray * fUXPlaneClusters
virtual void Clear(Option_t *opt="")
#define MAX_HITS_PER_POINT
void SetTime(Double_t time)
Int_t FindEasySpacePoint_HMS(Int_t yplane_hitind, Int_t yplanep_hitind)
virtual void ProcessHits(void)
void ChooseSingleHit(void)
Int_t GetReadoutTB() const
virtual void Delete(Option_t *option="")
TClonesArray * fTrackProj
TClonesArray * fXPlaneClusters
Int_t fFixPropagationCorrection
char * Form(const char *fmt,...)
void SetLeftRight(Int_t lr)
void SetXY(Double_t x, Double_t y)
THcDCHit * GetHit(Int_t ihit)
Int_t GetPlaneNum() const
std::vector< THcDCHit * > fHits
virtual void CorrectHitTimes(void)
UInt_t Count1Bits(UInt_t x)
THcDCHit * GetHit(Int_t ihit)
void Setup(const char *name, const char *description)
std::vector< Int_t > SpHitIndex
Int_t FindHardSpacePoints(void)
Int_t GetReadoutLR() const
Int_t LoadParmValues(const DBRequest *list, const char *prefix="")
Retrieve parameter values from the parameter cache.
void SetHitDist(Int_t ihit, Double_t dist)
virtual EStatus Init(const TDatime &run_time)
TClonesArray * fVXPlaneClusters
ClassImp(THcDCLookupTTDConv) THcDCLookupTTDConv
Int_t GetNPlaneClust() const
virtual Double_t ConvertTimeToDist()
void ReplaceHit(Int_t ihit, THcDCHit *hit)
Double_t GetReadoutCorr()
virtual Int_t ApplyCorrections(void)
Subdetector class for a single drift chamber with several planes.
void SetCombos(Int_t ncombos)
R__EXTERN class THcParmList * gHcParms
Double_t Sqrt(Double_t x)
TObject * At(Int_t idx) const
TClonesArray * fUPlaneClusters
std::vector< Int_t > SpNHits
Double_t FindStub(Int_t nhits, THcSpacePoint *sp, Int_t *plane_list, UInt_t bitpat, Int_t *plusminus, Double_t *stub)
THaDetectorBase * fParent
void SetDist(Double_t dist)