diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx index 0a397c9fe36a61552f6220bc948a531594832676..a92bb5fd0f7878eddd7d1a74d5e270d0029b7dda 100644 --- a/src/THcHodoscope.cxx +++ b/src/THcHodoscope.cxx @@ -219,6 +219,9 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date ) // fScinHit[m] = new Double_t[fNPaddle[0]]; // } + for (int ip=0; ip<fNPlanes; ++ip) { + fScinHitPaddle.push_back(std::vector<Int_t>(fNPaddle[ip], 0)); + } return fStatus = kOK; } @@ -558,9 +561,11 @@ void THcHodoscope::ClearEvent() fFPTime[ip]=0.; fPlaneCenter[ip]=0.; fPlaneSpacing[ip]=0.; + for(Int_t iPaddle=0;iPaddle<fNPaddle[ip]; ++iPaddle) { + fScinHitPaddle[ip][iPaddle]=0; + } } fdEdX.clear(); - fScinHitPaddle.clear(); fNScinHit.clear(); fNClust.clear(); fThreeScin.clear(); @@ -1352,17 +1357,6 @@ Int_t THcHodoscope::FineProcess( TClonesArray& tracks ) // *second, we move the scintillators. here we use scintillator cuts to see // *if a track should have been found. - for(Int_t ip = 0; ip < fNPlanes; ip++ ) { - - std::vector<Double_t> scin_temp; - fScinHitPaddle.push_back(scin_temp); // Create array of hits per plane - - for (UInt_t ipaddle = 0; ipaddle < fNPaddle[ip]; ipaddle++ ){ - fScinHitPaddle[ip].push_back(0.0); - fScinHitPaddle[ip][ipaddle] = 0.0; - } - } - for(Int_t ip = 0; ip < fNPlanes; ip++ ) { if (!fPlanes[ip]) return -1; diff --git a/src/THcHodoscope.h b/src/THcHodoscope.h index 24037be82c345b4d7a26b52088c0f76b10933a46..27a9d6b3111c1c2cd3d3b80276fdc700ae029616 100644 --- a/src/THcHodoscope.h +++ b/src/THcHodoscope.h @@ -319,7 +319,7 @@ scin_pos_time(0.0), scin_neg_time(0.0) {} // Start with a separate vector of vectors for now. std::vector<std::vector<Double_t> > fdEdX; // Vector over track # std::vector<Int_t > fNScinHit; // # scins hit for the track - std::vector<std::vector<Double_t> > fScinHitPaddle; // Vector over hits in a plane # + std::vector<std::vector<Int_t> > fScinHitPaddle; // Vector over hits in a plane # std::vector<Int_t > fNClust; // # scins clusters for the plane std::vector<Int_t > fThreeScin; // # scins three clusters for the plane std::vector<Int_t > fGoodScinHitsX; // # hits in fid x range