21 #include "THaSubDetector.h"
25 #include "THaDetMap.h"
27 #include "THaGlobals.h"
28 #include "THaCutList.h"
37 #include "THaTrackProj.h"
53 THaApparatus* apparatus ) :
54 THaNonTrackingDetector(name,description,apparatus)
67 THaNonTrackingDetector()
84 if( IsZombie())
return;
90 prefix[0]=tolower(GetApparatus()->
GetName()[0]);
96 TString histname=temp+
"_timehist";
100 DBRequest listextra[]={
101 {
"hodo_num_planes", &
fNPlanes, kInt},
102 {
"hodo_plane_names",&planenamelist, kString},
112 cout <<
"Plane Name List : " << planenamelist << endl;
114 vector<string> plane_names = Podd::vsplit(planenamelist);
117 cout <<
"ERROR: Number of planes " <<
fNPlanes <<
" doesn't agree with number of plane names " << plane_names.size() << endl;
122 fPlaneNames[i] =
new char[plane_names[i].length()+1];
127 char* desc =
new char[strlen(description)+100];
130 strcpy(desc, description);
131 strcat(desc,
" Plane ");
134 cout <<
"Created Scintillator Plane " <<
fPlaneNames[i] <<
", " << desc << endl;
159 char EngineDID[] =
"xSCIN";
160 EngineDID[0] = toupper(GetApparatus()->
GetName()[0]);
162 static const char*
const here =
"Init()";
163 Error( Here(here),
"Error filling detectormap for %s.", EngineDID );
173 InitHitList(fDetMap,
"THcRawHodoHit", fDetMap->GetTotNumChan()+1,
178 if( (status = THaNonTrackingDetector::Init( date )) )
179 return fStatus=status;
183 return fStatus=status;
205 THaVar* vpresent = gHaVars->Find(
Form(
"%s.present",GetApparatus()->
GetName()));
210 return fStatus = kOK;
228 prefix[0]=tolower(GetApparatus()->
GetName()[0]);
231 strcpy(parname,prefix);
232 strcat(parname,
"scin_");
247 prefix[0]=tolower(GetApparatus()->
GetName()[0]);
344 {
"cer_npe", &
fNCerNPE, kDouble, 0, 1},
345 {
"normalized_energy_tot", &
fNormETot, kDouble, 0, 1},
398 if (
fCosmicFlag==1) cout <<
"Setup for cosmics in TOF"<< endl;
406 cout <<
"WARNING: Unable to open TOF Dump file " <<
fTOFDumpFile << endl;
407 cout <<
"Data for TOF calibration not being written." << endl;
470 {
"TDC_threshold", &
fTdc_Thrs, kDouble, 0, 1},
500 cout <<
"******* Testing Hodoscope Parameter Reading ***\n";
506 cout <<
"*** VelLight ***\n";
508 cout<<
"Plane "<<i1<<endl;
526 cout <<
"USING "<<
fTofTolerance<<
" NSEC WINDOW FOR FP NO_TRACK CALCULATIONS.\n";
530 cout <<
"*** USING DEFAULT 3 NSEC WINDOW FOR FP NO_TRACK CALCULATIONS!! ***\n";
552 if( mode == kDefine && fIsSetup )
return kOK;
553 fIsSetup = ( mode == kDefine );
559 {
"beta",
"Beta including track info",
"fBeta"},
560 {
"betanotrack",
"Beta from scintillator hits",
"fBetaNoTrk"},
561 {
"betachisqnotrack",
"Chi square of beta from scintillator hits",
"fBetaNoTrkChiSq"},
562 {
"fpHitsTime",
"Time at focal plane from all hits",
"fFPTimeAll"},
563 {
"starttime",
"Hodoscope Start Time",
"fStartTime"},
564 {
"goodstarttime",
"Hodoscope Good Start Time (logical flag)",
"fGoodStartTime"},
565 {
"goodscinhit",
"Hit in fid area",
"fGoodScinHits"},
566 {
"adctdc_offset",
" ",
"fOffsetTime"},
567 {
"TimeHist_StartTime_Sigma",
"",
"fTimeHist_StartTime_Sigma"},
568 {
"TimeHist_StartTime_Peak",
"",
"fTimeHist_StartTime_Peak"},
569 {
"TimeHist_StartTime_NumPeaks",
"",
"fTimeHist_StartTime_NumPeaks"},
570 {
"TimeHist_StartTime_Hits",
"",
"fTimeHist_StartTime_Hits"},
571 {
"TimeHist_FpTime_Sigma",
"",
"fTimeHist_FpTime_Sigma"},
572 {
"TimeHist_FpTime_Peak",
"",
"fTimeHist_FpTime_Peak"},
573 {
"TimeHist_FpTime_NumPeaks",
"",
"fTimeHist_FpTime_NumPeaks"},
574 {
"TimeHist_FpTime_Hits",
"",
"fTimeHist_FpTime_Hits"},
577 return DefineVarsFromList( vars, mode );
595 for(
int i = 0; i <
fNPlanes; ++i ) {
741 if(gHaCuts->Result(
"Pedestal_event")) {
798 Int_t hTimeScanRange = 10.;
799 vector<Double_t> hpeakCent;
800 vector<Double_t> hpeakNum;
801 vector<Double_t> hpeakRMS;
802 vector<Double_t> hpeakFlag;
803 vector<Int_t> hpeakBin;
807 Double_t save_mean=0,save_rms=0,save_num=0;
812 Int_t best_peak_num=-1;
815 for (
Int_t nb=1;nb<NBinsX-hTimeScanRange;nb++) {
818 if (scanning_for_local_peak) {
819 if ( test_int <= test_peakmax) {
820 Int_t ps=hpeakCent.size();
823 if (ps==0) new_peak=
kTRUE;
824 if (ps!=0 && nb==hpeakBin[ps]+1 && save_mean!=hpeakCent[ps-1]) new_peak=
kFALSE;
825 if (ps!=0 && save_num > hpeakNum[ps-1] && abs(save_mean-hpeakCent[ps-1])<5) replace_peak=
kTRUE;
826 if (ps!=0 && nb!=hpeakBin[ps]+1 && save_num > MinimumNum && abs(save_mean-hpeakCent[ps-1])>=5) new_peak=
kTRUE;
828 hpeakCent.push_back(save_mean);
829 hpeakRMS.push_back(save_rms);
830 hpeakNum.push_back(save_num);
831 hpeakBin.push_back(save_bin);
832 hpeakFlag.push_back(1);
835 hpeakCent[ps-1]=save_mean;
836 hpeakRMS[ps-1]=save_rms;
837 hpeakNum[ps-1]=save_num;
838 hpeakBin[ps-1]=save_bin;
841 scanning_for_local_peak =
kFALSE;
846 for (
UInt_t np=0;np<hpeakNum.size();np++) {
848 if ( hpeakNum[np] > 5 && (hpeakNum[np]>= best_peak_num || abs(hpeakNum[np] - best_peak_num)<= 4) ) {
849 if (nfound==0 || (hpeakNum[np]== best_peak_num || abs(hpeakNum[np] - best_peak_num)<= 4) ) {
851 if (nfound==0 ) best_peak_num =hpeakNum[np] ;
852 if (nfound==0 ) best_peak_index= np;
855 for (
UInt_t nt=0;nt<np;nt++) {hpeakFlag[nt]=-1;}
857 best_peak_num =hpeakNum[np] ;
864 for (
UInt_t np=0;np<hpeakNum.size();np++) {
865 if (hpeakFlag[np]==1 && abs(hpeakCent[np]-
fStartTimeCenter)<best_peak_diff) {
872 for (
UInt_t np=0;np<hpeakNum.size();np++) {
880 test_peakmax = test_int;
887 if ( test_int > MinimumNum) {
888 test_peakmax = test_int;
889 scanning_for_local_peak =
kTRUE;
898 if (hpeakNum.size() >0 && best_peak_index<hpeakNum.size() ) {
899 time_peak= hpeakCent[best_peak_index];
938 for(
Int_t i=0;i<nphits;i++) {
959 for(
Int_t i=0;i<nphits;i++) {
962 NAdcTdcDiffTimeSum++;
964 NAdcTdcDiffTimeSum++;
973 if (NAdcTdcDiffTimeSum>0) AdcTdcDiffTimeSum=AdcTdcDiffTimeSum/NAdcTdcDiffTimeSum;
982 Int_t Ngood_hits_plane=0;
983 Int_t Ngood_adchits_plane=0;
987 Bool_t twogoodtimes[nscinhits];
988 Int_t NumPlanesGoodHit=0;
989 Int_t NumPlanesGoodAdcHit=0;
992 goodplanetime[ip] =
kFALSE;
996 Plane_fptime_sum=0.0;
997 for(
Int_t i=0;i<nphits;i++) {
999 twogoodtimes[ihit] =
kFALSE;
1008 twogoodtimes[ihit] =
kTRUE;
1021 Plane_fptime_sum+=fptime;
1022 fpTimeSum += fptime;
1024 goodplanetime[ip] =
kTRUE;
1042 Ngood_adchits_plane++;
1043 Plane_adcfptime_sum+=fptime;
1044 adcfpTimeSum += fptime;
1051 if (Ngood_hits_plane>0) NumPlanesGoodHit++;
1052 if (Ngood_adchits_plane>0) NumPlanesGoodAdcHit++;
1053 if (Ngood_hits_plane>0)
fPlanes[ip]->
SetFpTime(Plane_fptime_sum/
float(Ngood_hits_plane));
1058 if(NumPlanesGoodHit>=3) {
1063 if(NumPlanesGoodAdcHit>=3) {
1078 if(
fGoodStartTime && (goodplanetime[0]||goodplanetime[1]) &&(goodplanetime[2]||goodplanetime[3])) {
1091 for(
Int_t i=0;i<nphits;i++) {
1094 if(twogoodtimes[ihhit]){
1112 sumT += scinWeight * ((
THcHodoHit*)hodoHits->
At(i))->GetScinCorrectedTime();
1113 sumZ += scinWeight * zPosition;
1114 sumZZ += scinWeight * ( zPosition * zPosition );
1115 sumTZ += scinWeight * zPosition * ((
THcHodoHit*)hodoHits->
At(i))->GetScinCorrectedTime();
1122 Double_t tmp = sumW * sumZZ - sumZ * sumZ ;
1123 Double_t t0 = ( sumT * sumZZ - sumZ * sumTZ ) / tmp ;
1124 Double_t tmpDenom = sumW * sumTZ - sumZ * sumT;
1126 if (
TMath::Abs( tmpDenom ) > ( 1 / 10000000000.0 ) ) {
1136 for(
Int_t i=0;i<nphits;i++) {
1139 if(twogoodtimes[ihhit]) {
1155 ( zPosition /
fBetaNoTrk - timeDif ) ) / ( sigma * sigma );
1210 vector<Double_t> nPmtHit(ntracks);
1211 vector<Double_t> timeAtFP(ntracks);
1212 fdEdX.reserve(ntracks);
1214 for (
Int_t itrack = 0; itrack < ntracks; itrack++ ) {
1218 THaTrack* theTrack =
dynamic_cast<THaTrack*
>( tracks.
At(itrack) );
1219 if (!theTrack)
return -1;
1227 std::vector<Double_t> dedx_temp;
1228 std::vector<std::vector<GoodFlags> > goodflagstmp1;
1229 goodflagstmp1.reserve(fNumPlanesBetaCalc);
1230 #if __cplusplus >= 201103L
1231 fdEdX.push_back(std::move(dedx_temp));
1232 fGoodFlags.push_back(std::move(goodflagstmp1));
1234 fdEdX.push_back(dedx_temp);
1253 std::vector<GoodFlags> goodflagstmp2;
1255 #if __cplusplus >= 201103L
1256 fGoodFlags[itrack].push_back(std::move(goodflagstmp2));
1285 Double_t zposition = zPos + (paddle%2)*dzPos;
1287 Double_t xHitCoord = theTrack->GetX() + theTrack->GetTheta() *
1290 Double_t yHitCoord = theTrack->GetY() + theTrack->GetPhi() *
1293 Double_t scinTrnsCoord, scinLongCoord;
1294 if ( ( ip == 0 ) || ( ip == 2 ) ){
1295 scinTrnsCoord = xHitCoord;
1296 scinLongCoord = yHitCoord;
1297 }
else if ( ( ip == 1 ) || ( ip == 3 ) ){
1298 scinTrnsCoord = yHitCoord;
1299 scinLongCoord = xHitCoord;
1300 }
else {
return -1; }
1302 fTOFPInfo[ihhit].scinTrnsCoord = scinTrnsCoord;
1303 fTOFPInfo[ihhit].scinLongCoord = scinLongCoord;
1311 if (
TMath::Abs( scinCenter - scinTrnsCoord ) <
1315 Double_t zcor = zposition/(29.979*betatrack)*
1316 TMath::Sqrt(1. + theTrack->GetTheta()*theTrack->GetTheta()
1317 + theTrack->GetPhi()*theTrack->GetPhi());
1320 Double_t zcor = -zposition/(29.979*1.0)*
1321 TMath::Sqrt(1. + theTrack->GetTheta()*theTrack->GetTheta()
1322 + theTrack->GetPhi()*theTrack->GetPhi());
1355 pathp=scinLongCoord;
1377 pathn=scinLongCoord ;
1403 for(
Int_t ih = 0; ih < nhits; ih++) {
1417 fdEdX[itrack].reserve(nhits);
1419 for(
Int_t ih=0; ih < nhits; ih++) {
1427 assert( iphit >= 0 && (
size_t)iphit <
fGoodFlags[itrack][ip].size() );
1435 assert( ih >= 0 && (
size_t)ih <
fTOFCalc.size() );
1444 fTOFCalc[ih].good_raw_pad = paddle;
1512 if (
fTOFCalc[ih].good_scin_time ){
1520 sumFPTime = sumFPTime + scin_time_fp;
1528 nPmtHit[itrack] = nPmtHit[itrack] + 2;
1530 nPmtHit[itrack] = nPmtHit[itrack] + 1;
1533 fdEdX[itrack].push_back(0.0);
1560 if (
fTOFCalc[ih].good_scin_time ){
1569 if (fNumPlanesBetaCalc==4) theTrack->SetGoodPlane4(
fGoodPlaneTime[3] ? 1 : 0 );
1591 for(
Int_t ih=0; ih < nhits; ih++) {
1594 if (
fTOFCalc[ih].good_scin_time ) {
1602 sumT += scinWeight *
fTOFCalc[ih].scin_time;
1603 sumZ += scinWeight * zPosition;
1604 sumZZ += scinWeight * ( zPosition * zPosition );
1605 sumTZ += scinWeight * zPosition *
fTOFCalc[ih].scin_time;
1610 Double_t tmp = sumW * sumZZ - sumZ * sumZ ;
1611 Double_t t0 = ( sumT * sumZZ - sumZ * sumTZ ) / tmp ;
1612 Double_t tmpDenom = sumW * sumTZ - sumZ * sumT;
1614 if (
TMath::Abs( tmpDenom ) > ( 1 / 10000000000.0 ) ) {
1616 beta = tmp / tmpDenom;
1619 for(
Int_t ih=0; ih < nhits; ih++) {
1622 if (
fTOFCalc[ih].good_scin_time ){
1627 betaChiSq += ( ( zPosition / beta - timeDif ) *
1628 ( zPosition / beta - timeDif ) ) /
1635 theTrack->GetPhi() * theTrack->GetPhi() );
1637 beta = beta / pathNorm;
1638 beta = beta / 29.979;
1650 if ( nFPTime != 0 ){
1651 timeAtFP[itrack] = ( sumFPTime / nFPTime );
1658 Int_t nGoodPlanesHit=0;
1666 fFPTime[ip] = 1000. * ( ip + 1 );
1671 if (nGoodPlanesHit>=3) fptime = FPTimeSum/nFPTimeSum;
1680 theTrack->SetDedx(dedx);
1681 theTrack->SetFPTime(fptime);
1682 theTrack->SetBeta(beta);
1683 theTrack->SetBetaChi2( betaChiSq );
1684 theTrack->SetNPMT(nPmtHit[itrack]);
1705 const Int_t MaxNCluster=5;
1706 std::vector<Int_t > iw(MaxNCluster,0);
1707 std::vector<Double_t > dw(MaxNCluster,0);
1718 Int_t num_good_pad=0;
1721 Int_t prev_padnum=-100;
1726 Int_t padnum = padind+1;
1728 if (ip==0 || ip==2) pl_y = ((
THcHodoHit*)hodoHits->
At(iphit))->GetCalcPosition();
1730 if (ip==1 || ip==3) pl_x = ((
THcHodoHit*)hodoHits->
At(iphit))->GetCalcPosition();
1732 pl_calcpos=((
THcHodoHit*)hodoHits->
At(iphit))->GetCalcPosition();
1741 if (fNCluster[ip]<MaxNCluster) fNCluster[ip]++;
1757 if (num_good_pad !=0 ) {
1758 pl_xypos=pl_xypos/num_good_pad;
1759 pl_calcpos=pl_calcpos/num_good_pad;
1760 pl_zpos=pl_zpos/num_good_pad;
1771 Int_t best_cluster[4]={-1,-1,-1,-1};
1777 for (
Int_t nch = 0; nch < 2; nch++ ){
1785 for (
Int_t ic2 = 0; ic2 < fNCluster[pl2]; ic2++ ){
1788 if ( (ic1==0 && ic2==0) || (diffx <=diffx_test && diffy <=diffy_test)) {
1791 best_cluster[pl1]=ic1;
1792 best_cluster[pl2]=ic2;
1796 if (
fNCluster[pl1]==1) best_cluster[pl1]=0;
1797 if (
fNCluster[pl2]==1) best_cluster[pl2]=0;
1801 Int_t pl_test1[4]={0,1,2,3};
1802 Int_t pl_test2[4]={2,3,0,1};
1803 for (
Int_t npl = 0; npl < 4; npl++ ){
1806 if (
fNCluster[pl1]>0 && best_cluster[pl1]==-1 &&
fNCluster[pl2]>0 && best_cluster[pl2]>-1) {
1812 if ( (diffx <=diffx_test && diffy <=diffy_test)) {
1815 best_cluster[pl1]=ic1;
1824 for (
Int_t npl = 0; npl < 4; npl++ ){
1853 if (efftest_debug) cout <<
" spec = " << GetApparatus()->GetName()[0] << endl;
1859 if (lowtemp < hitemp) {
1860 PadPosLo[ip]=lowtemp;
1861 PadPosHi[ip]=hitemp;
1863 PadPosLo[ip]=hitemp;
1864 PadPosHi[ip]=lowtemp;
1868 const Int_t MaxNClus=5;
1869 std::vector<Int_t > iw(MaxNClus,0);
1870 std::vector<Double_t > dw(MaxNClus,0);
1878 Int_t prev_padnum=-100;
1883 if ( padnum==prev_padnum+1 ) {
1886 if (efftest_debug) cout <<
"Add to cluster pl = " << ip+1 <<
" hit = " << iphit <<
" pad = " << padnum <<
" clus = " << fNClust[ip] <<
" cl size = " <<
fClustSize[ip][fNClust[ip]-1] <<
" pos " <<
fPlanes[ip]->
GetPosCenter(padnum-1)+
fPlanes[ip]->
GetPosOffset() << endl;
1891 if (efftest_debug) cout <<
" New clus pl = " << ip+1 <<
" hit = " << iphit <<
" pad = " << padnum <<
" clus = " << fNClust[ip] <<
" cl size = " <<
fClustSize[ip][fNClust[ip]-1] <<
" pos " <<
fPlanes[ip]->
GetPosCenter(padnum-1)+
fPlanes[ip]->
GetPosOffset() << endl;
1895 if (!(hit->
GetTwoGoodTimes()) && efftest_debug) cout <<
"no two good times plane = " << ip+1 <<
" hit = " << iphit << endl;
1899 Bool_t inside_bound[4][MaxNClus];
1906 inside_bound[ip][ic] =
fClustPos[ip][ic]>=PadPosLo[ip] &&
fClustPos[ip][ic]<=PadPosHi[ip];
1907 if (efftest_debug) cout <<
"plane = " << ip+1 <<
" Cluster = " << ic+1 <<
" size = " <<
fClustSize[ip][ic]<<
" pos = " << fClustPos[ip][ic] <<
" inside = " << inside_bound[ip][ic] <<
" lo = " << PadPosLo[ip]<<
" hi = " << PadPosHi[ip]<< endl;
1911 Int_t MaxClusterSize=3;
1912 Int_t good_for_track_test[4][MaxNClus];
1913 Int_t sum_good_track_test[4]={0,0,0,0};
1914 Int_t num_good_plane_hit=0;
1917 if (inside_bound[ip][ic] &&
fClustSize[ip][ic]<=MaxClusterSize) {
1919 good_for_track_test[ip][ic]=1;
1920 sum_good_track_test[ip]++;
1921 if (sum_good_track_test[ip]==1) num_good_plane_hit++;
1923 good_for_track_test[ip][ic]=0;
1925 if (efftest_debug) cout <<
" ip " << ip+1 <<
" clus = " << ic <<
" good for track = " << good_for_track_test[ip][ic] << endl;
1927 if (efftest_debug) cout <<
" ip = " << ip+1 <<
" sum_good_track_test = " << sum_good_track_test[ip] << endl;
1929 if (efftest_debug) cout <<
" number of planes hits = " << num_good_plane_hit << endl;
1939 for(
Int_t ic2 = 0; ic2 <fNClust[2] ; ic2++ ) {
1940 if (good_for_track_test[0][ic0] && good_for_track_test[2][ic2]) {
1949 for(
Int_t ic1 = 0; ic1 <fNClust[1] ; ic1++ ) {
1950 for(
Int_t ic3 = 0; ic3 <fNClust[3] ; ic3++ ) {
1951 if (good_for_track_test[1][ic1] && good_for_track_test[3][ic3]) {
1959 if (efftest_debug) cout <<
" 4 good planes xdiff = " << xdiffTest <<
" ydiff = " << ydiffTest << endl;
1966 if (sum_good_track_test[0]>0&&sum_good_track_test[2]>0) {
1968 for(
Int_t ic2 = 0; ic2 <fNClust[2] ; ic2++ ) {
1969 if (good_for_track_test[0][ic0] && good_for_track_test[2][ic2]) {
1977 if ((sum_good_track_test[1]>0||sum_good_track_test[3]>0)) {
1979 for(
Int_t ic3 = 0; ic3 <fNClust[3] ; ic3++ ) {
1980 if (good_for_track_test[1][ic1] && good_for_track_test[3][ic3]) {
1988 if (efftest_debug) cout <<
" 3 good planes xdiff = " << xdiffTest <<
" ydiff = " << ydiffTest << endl;
1990 if (efftest_debug) cout <<
" ************" << endl;
2007 cout <<
" loop over planes " << ip+1 << endl;
2014 cout <<
" hits = " <<
fNScinHits[ip] << endl;
2019 cout <<
" hit = " << iphit+1 <<
" " << paddle+1 << endl;
2037 cout <<
" looking for cluster in x planes" << endl;
2039 for (
Int_t ip = 0; ip < 3; ip +=2 ) {
2042 cout <<
"plane =" << ip <<
"check if paddle 1 hit " << icount << endl;
2049 cout <<
" paddle = " << ipaddle+1 <<
" " << icount << endl;
2052 cout <<
"Two cluster in plane = " << ip+1 <<
" " << icount << endl;
2064 cout <<
"Three clusters in plane = " << ip+1 <<
" " << icount << endl;
2073 cout <<
" looking for cluster in y planes" << endl;
2081 cout <<
"plane =" << ip <<
"check if paddle 1 hit " << icount << endl;
2089 cout <<
" paddle = " << ipaddle+1 <<
" " << icount << endl;
2092 cout <<
"Two cluster in plane = " << ip+1 <<
" " << icount << endl;
2106 cout <<
"Three clusters in plane = " << ip+1 <<
" " << icount << endl;
2144 for (
Int_t ifidx = fxLoScin[1]-1; ifidx < fxHiScin[1]; ifidx ++ ){
2151 for (
Int_t ifidx = 0; ifidx < fxLoScin[1]-1; ifidx ++ ){
2174 for (
Int_t ifidx = fyLoScin[1]-1; ifidx < fyHiScin[1]; ifidx ++ ){
2182 for (
Int_t ifidx = 0; ifidx < fyLoScin[1]-1; ifidx ++ ){
2195 for (
Int_t ifidx = fxLoScin[0]; ifidx < fxHiScin[0]; ifidx ++ ){
2217 for (
Int_t itrk=0; itrk<Ntracks; itrk++) {
2218 THaTrack* theTrack =
static_cast<THaTrack*
>( tracks[itrk] );
2219 if (theTrack->GetIndex()==0) {
2220 fBeta=theTrack->GetBeta();
2222 Double_t shower_track_enorm = theTrack->GetEnergy()/theTrack->GetP();
2226 Int_t num_good_pad=0;
2236 fDumpOut << fixed << setprecision(2);
2249 if (num_good_pad !=0 ) {
2250 pl_xypos=pl_xypos/num_good_pad;
2251 pl_zpos=pl_zpos/num_good_pad;
2252 hitPos = theTrack->GetY() + theTrack->GetPhi()*pl_zpos ;
2253 if (ip%2 == 0) hitPos = theTrack->GetX() + theTrack->GetTheta()*pl_zpos ;
2254 hitDistance = hitPos - pl_xypos;
2275 return fNPlanes*nPaddle+nPlane;
Double_t GetPosCorrectedTime() const
std::string GetName(const std::string &scope_name)
A single plane of scintillators.
virtual Int_t Fill(Double_t x)
virtual Int_t FillMap(THaDetMap *detmap, const char *detectorname)
Double_t * fHodoNegAdcTimeWindowMin
Double_t * fHodoPosInvAdcOffset
void EstimateFocalPlaneTime(void)
void OriginalTrackEffTest(void)
std::vector< Int_t > fThreeScin
Double_t GetPosADCtime() const
Double_t fTOFCalib_cer_lo
void Setup(const char *name, const char *description)
Bool_t fGoodEventTOFCalib
Int_t GetScinIndex(Int_t nPlane, Int_t nPaddle)
std::vector< std::vector< Int_t > > fClustSize
Int_t fTrackBetaIncludeSinglePmtHits
Int_t fTrackEffTestNScinPlanes
Class for gas Cherenkov detectors.
Double_t fTOFCalib_beta_hi
Class representing a single hit for the Hodoscopes.
virtual Int_t End(THaRunBase *run=0)
void SetClusterUsedFlag(Int_t ic, Double_t flag)
Double_t GetPosTOFCorrectedTime() const
void MissReport(const char *name)
void SetScinYPos(Double_t f)
std::vector< std::vector< std::vector< GoodFlags > > > fGoodFlags
Double_t GetPathLengthCentral()
std::vector< Int_t > fGoodScinHitsX
void SetFpTime(Double_t f)
Double_t * fHodoPosPhcCoeff
Double_t GetPosADC() const
std::vector< std::vector< Double_t > > fdEdX
std::vector< TOFPInfo > fTOFPInfo
Double_t fStartTimeCenter
virtual Int_t GetNbinsX() const
virtual Double_t TimeWalkCorrection(const Int_t &paddle, const ESide side)
TClonesArray * fRawHitList
std::vector< Int_t > fNScinHit
virtual void CalculatePedestals()
THcScintillatorPlane ** fPlanes
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
double beta(double x, double y)
virtual void Reset(Option_t *option="")
Double_t fTimeHist_StartTime_Hits
std::vector< Int_t > fNCluster
virtual Int_t DefineVariables(EMode mode=kDefine)
void SetTwoGoodTimes(Bool_t flag)
Double_t fTOFCalib_shtrk_lo
virtual EStatus Init(const TDatime &run_time)
std::vector< std::vector< Int_t > > fScinHitPaddle
Double_t GetNegADCCorrtime() const
Double_t GetPosADCpeak() const
Bool_t GetTwoGoodTimes() const
Int_t GetPaddleNumber() const
Double_t fPathLengthCentral
std::vector< TOFCalc > fTOFCalc
double pow(double, double)
virtual Int_t CoarseProcess(TClonesArray &tracks)
virtual void Clear(Option_t *opt="")
Double_t DetermineTimePeak(Int_t FillFlag)
Double_t * fHodoNegAdcTimeWindowMax
Double_t fTimeHist_StartTime_Peak
std::vector< std::vector< Double_t > > fClusterXPos
void Error(const char *location, const char *msgfmt,...)
virtual Int_t AccumulatePedestals(TClonesArray *rawhits, Int_t nexthit)
Double_t * fHodoPosAdcTimeWindowMax
void InitHitList(THaDetMap *detmap, const char *hitclass, Int_t maxhits, Int_t tdcref_cut=0, Int_t adcref_cut=0)
Save the electronics module to detector mapping and initialize a hit array of hits of class hitclass...
Double_t fTimeHist_FpTime_Sigma
void SetClusterFlag(Int_t ic, Double_t flag)
virtual void SetRange(Int_t first=0, Int_t last=0)
Double_t trackeff_scint_xdiff_max
virtual Double_t GetMean(Int_t axis=1) const
Double_t GetNegCorrectedTime() const
virtual Double_t Integral(Option_t *option="") const
Double_t fTimeHist_FpTime_Peak
void SetClusterSize(Int_t ic, Double_t size)
Double_t GetParticleMass() const
void SetNGoodHits(Int_t ng)
std::vector< std::vector< Double_t > > fClustPos
char * Form(const char *fmt,...)
void CreateMissReportParms(const char *prefix)
Double_t GetNegADCpeak() const
Double_t * fHodoPosInvAdcLinear
Double_t GetRMS(Int_t axis=1) const
Double_t trackeff_scint_ydiff_max
virtual void Clear(Option_t *opt="")
std::vector< std::vector< Int_t > > fClusterSize
void SetNumberClusters(Int_t nclus)
virtual Int_t ReadDatabase(const TDatime &date)
R__EXTERN class THcDetectorMap * gHcDetectorMap
Double_t fTOFCalib_beta_lo
Double_t fTimeHist_StartTime_Sigma
virtual Int_t Decode(const THaEvData &)
Double_t fTimeHist_StartTime_NumPeaks
Double_t * fHodoPosAdcTimeWindowMin
Int_t LoadParmValues(const DBRequest *list, const char *prefix="")
Retrieve parameter values from the parameter cache.
Double_t GetPosADCCorrtime() const
virtual Int_t ProcessHits(TClonesArray *rawhits, Int_t nexthit)
Double_t * fHodoPosInvAdcAdc
void SetTrackXPosition(Double_t f)
Double_t * fHodoNegInvAdcLinear
Double_t GetBetaAtPcentral() const
Double_t * fHodoNegPhcCoeff
Bool_t GetHasCorrectedTimes() const
ClassImp(THcDCLookupTTDConv) THcDCLookupTTDConv
void SetCluster(Int_t ic, Double_t pos)
virtual Int_t ApplyCorrections(void)
Double_t GetNegADCtime() const
Double_t GetNegADC() const
void SetScinXPos(Double_t f)
std::vector< Int_t > fNClust
Double_t * fHodoPosTimeOffset
Short_t Max(Short_t a, Short_t b)
Double_t * fHodoNegInvAdcAdc
Double_t GetScinCorrectedTime() const
void SetHitDistance(Double_t f)
void SetTrackYPosition(Double_t f)
virtual Int_t FineProcess(TClonesArray &tracks)
Double_t fTimeHist_FpTime_NumPeaks
Double_t fTimeHist_FpTime_Hits
Double_t fTOFCalib_shtrk_hi
Double_t fRatio_xpfp_to_xfp
R__EXTERN class THcParmList * gHcParms
Double_t Sqrt(Double_t x)
TObject * At(Int_t idx) const
Double_t * fHodoNegTimeOffset
Generic hodoscope consisting of multiple planes with multiple paddles with phototubes on both ends...
Double_t GetPosCenter(Int_t PaddleNo)
Double_t GetNegTOFCorrectedTime() const
Double_t * fHodoNegInvAdcOffset
virtual Int_t DecodeToHitList(const THaEvData &evdata, Bool_t suppress=kFALSE)
Populate the hitlist from the raw event data.
THcCherenkov * fCherenkov
std::vector< std::vector< Double_t > > fClusterYPos
A standard Hall C spectrometer apparatus.