diff --git a/src/THcHitList.cxx b/src/THcHitList.cxx index ae15f6fc2efb610963b430eab110412f4550e5a2..9a1303b7c9e7a314f3612548d487d78502367db3 100644 --- a/src/THcHitList.cxx +++ b/src/THcHitList.cxx @@ -43,7 +43,7 @@ void THcHitList::InitHitList(THaDetMap* detmap, Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) { THcRawHit* rawhit; - cout << " Clearing TClonesArray " << endl; + // cout << " Clearing TClonesArray " << endl; fRawHitList->Clear("C"); fNRawHits = 0; @@ -51,6 +51,7 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) { THaDetMap::Module* d = fdMap->GetModule(i); // Loop over all channels that have a hit. + // cout << "Crate/Slot: " << d->crate << "/" << d->slot << endl; for ( Int_t j=0; j < evdata.GetNumChan( d->crate, d->slot); j++) { Int_t chan = evdata.GetNextChan( d->crate, d->slot, j ); @@ -61,7 +62,8 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) { Int_t plane = d->plane; Int_t signal = d->signal; Int_t counter = d->reverse ? d->first + d->hi - chan : d->first + chan - d->lo; - + //cout << d->crate << " " << d->slot << " " << chan << " " << plane << " " + // << counter << " " << signal << endl; // Search hit list for plane and counter // We could do sorting Int_t thishit = 0; @@ -69,13 +71,15 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) { rawhit = (THcRawHit*) (*fRawHitList)[thishit]; if (plane == rawhit->fPlane && counter == rawhit->fCounter) { + // cout << "Found as " << thishit << "/" << fNRawHits << endl; break; } thishit++; } + if(thishit == fNRawHits) { - fNRawHits++; rawhit = (THcRawHit*) (*fRawHitList)[thishit]; + fNRawHits++; rawhit->fPlane = plane; rawhit->fCounter = counter; } @@ -85,6 +89,7 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) { Int_t nMHits = evdata.GetNumHits(d->crate, d->slot, chan); for (Int_t mhit = 0; mhit < nMHits; mhit++) { Int_t data = evdata.GetData( d->crate, d->slot, chan, mhit); + // cout << "Signal " << signal << "=" << data << endl; rawhit->SetData(signal,data); } } diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx index 336309ce49ef23f1420feb3b321be2aaed5630a1..ede928973ca182ae81a02979ab4a6037f0b33bd5 100644 --- a/src/THcHodoscope.cxx +++ b/src/THcHodoscope.cxx @@ -138,6 +138,7 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) iplane = 0; p = (Double_t *)gHcParms->Find("hscin_1x_center")->GetValuePointer(); fCenter[iplane] = new Double_t [fNPaddle[iplane]]; + // Print out some parameters just to demonstrate that it works cout << iplane; for(Int_t i=0;i<fNPaddle[iplane];i++) { fCenter[iplane][i] = p[i]; @@ -295,9 +296,11 @@ Int_t THcHodoscope::Decode( const THaEvData& evdata ) // fRawHitList is TClones array of THcHodoscopeHit objects for(Int_t ihit = 0; ihit < fNRawHits ; ihit++) { THcHodoscopeHit* hit = (THcHodoscopeHit *) fRawHitList->At(ihit); - cout << ihit << ": " << hit->fADC_pos << " " << hit->fADC_neg << " " - << hit->fTDC_pos << " " << hit->fTDC_pos << endl; + cout << ihit << " : " << hit->fPlane << ":" << hit->fCounter << " : " + << hit->fADC_pos << " " << hit->fADC_neg << " " << hit->fTDC_pos + << " " << hit->fTDC_neg << endl; } + cout << endl; return nhits; } diff --git a/src/THcHodoscopeHit.cxx b/src/THcHodoscopeHit.cxx index 7e75328cc24d8ff45d43e30ebae68dd734c7c1f9..1a34c8bc8081f7925fe3ae026400cd1069a4fbd1 100644 --- a/src/THcHodoscopeHit.cxx +++ b/src/THcHodoscopeHit.cxx @@ -14,26 +14,26 @@ using namespace std; void THcHodoscopeHit::SetData(Int_t signal, Int_t data) { - if(signal==1) { + if(signal==0) { fADC_pos = data; - } else if (signal==2) { - fADC_neg = data; - } else if(signal==3) { - fADC_pos = data; - } else if (signal==4) { + } else if (signal==1) { fADC_neg = data; + } else if(signal==2) { + fTDC_pos = data; + } else if (signal==3) { + fTDC_neg = data; } } Int_t THcHodoscopeHit::GetData(Int_t signal) { - if(signal==1) { - return(fADC_pos); - } else if (signal==2) { - return(fADC_neg); - } else if(signal==3) { + if(signal==0) { return(fADC_pos); - } else if (signal==4) { + } else if (signal==1) { return(fADC_neg); + } else if(signal==2) { + return(fTDC_pos); + } else if (signal==3) { + return(fTDC_neg); } return(-1); // Actually should throw exception } diff --git a/src/THcRawHit.h b/src/THcRawHit.h index baec88e8815dd5db3b03a19864e285d65b394cb7..921939e5732d52cb5fea3fbef481133cb037d342 100644 --- a/src/THcRawHit.h +++ b/src/THcRawHit.h @@ -37,7 +37,7 @@ public: private: - ClassDef(THcRawHit,2) // Track ID abstract base class + ClassDef(THcRawHit,0) // Track ID abstract base class }; #endif