diff --git a/src/THcDC.cxx b/src/THcDC.cxx index a06669bc0b6b23fecadd3a393849511e48ae477d..09ab985c4182268819df4a25fd4d64ad092aa154 100644 --- a/src/THcDC.cxx +++ b/src/THcDC.cxx @@ -122,7 +122,7 @@ void THcDC::Setup(const char* name, const char* description) // Should quit. Is there an official way to quit? } fPlaneNames = new char* [fNPlanes]; - for(UInt_t i=0;i<fNPlanes;i++) { + for(Int_t i=0;i<fNPlanes;i++) { fPlaneNames[i] = new char[plane_names[i].length()+1]; strcpy(fPlaneNames[i], plane_names[i].c_str()); } @@ -131,7 +131,7 @@ void THcDC::Setup(const char* name, const char* description) char *desc1= new char[strlen(description)+100]; fPlanes.clear(); - for(UInt_t i=0;i<fNPlanes;i++) { + for(Int_t i=0;i<fNPlanes;i++) { strcpy(desc, description); strcat(desc, " Plane "); strcat(desc, fPlaneNames[i]); @@ -185,7 +185,7 @@ THaAnalysisObject::EStatus THcDC::Init( const TDatime& date ) return fStatus=status; // Initialize planes and add them to chambers - for(UInt_t ip=0;ip<fNPlanes;ip++) { + for(Int_t ip=0;ip<fNPlanes;ip++) { if((status = fPlanes[ip]->Init( date ))) { return fStatus=status; } else { @@ -201,7 +201,7 @@ THaAnalysisObject::EStatus THcDC::Init( const TDatime& date ) } // Retrieve the fiting coefficients fPlaneCoeffs = new Double_t* [fNPlanes]; - for(UInt_t ip=0; ip<fNPlanes;ip++) { + for(Int_t ip=0; ip<fNPlanes;ip++) { fPlaneCoeffs[ip] = fPlanes[ip]->GetPlaneCoef(); } @@ -288,22 +288,22 @@ Int_t THcDC::ReadDatabase( const TDatime& date ) {"min_combos", fMinCombos, kInt, fNChambers}, {"space_point_criterion", fSpace_Point_Criterion, kDouble, fNChambers}, - {"dc_tdc_min_win", fTdcWinMin, kInt, fNPlanes}, - {"dc_tdc_max_win", fTdcWinMax, kInt, fNPlanes}, - {"dc_central_time", fCentralTime, kDouble, fNPlanes}, - {"dc_nrwire", fNWires, kInt, fNPlanes}, - {"dc_chamber_planes", fNChamber, kInt, fNPlanes}, - {"dc_wire_counting", fWireOrder, kInt, fNPlanes}, - {"dc_drifttime_sign", fDriftTimeSign, kInt, fNPlanes}, - - {"dc_zpos", fZPos, kDouble, fNPlanes}, - {"dc_alpha_angle", fAlphaAngle, kDouble, fNPlanes}, - {"dc_beta_angle", fBetaAngle, kDouble, fNPlanes}, - {"dc_gamma_angle", fGammaAngle, kDouble, fNPlanes}, - {"dc_pitch", fPitch, kDouble, fNPlanes}, - {"dc_central_wire", fCentralWire, kDouble, fNPlanes}, - {"dc_plane_time_zero", fPlaneTimeZero, kDouble, fNPlanes}, - {"dc_sigma", fSigma, kDouble, fNPlanes}, + {"dc_tdc_min_win", fTdcWinMin, kInt, (UInt_t)fNPlanes}, + {"dc_tdc_max_win", fTdcWinMax, kInt, (UInt_t)fNPlanes}, + {"dc_central_time", fCentralTime, kDouble, (UInt_t)fNPlanes}, + {"dc_nrwire", fNWires, kInt, (UInt_t)fNPlanes}, + {"dc_chamber_planes", fNChamber, kInt, (UInt_t)fNPlanes}, + {"dc_wire_counting", fWireOrder, kInt, (UInt_t)fNPlanes}, + {"dc_drifttime_sign", fDriftTimeSign, kInt, (UInt_t)fNPlanes}, + + {"dc_zpos", fZPos, kDouble, (UInt_t)fNPlanes}, + {"dc_alpha_angle", fAlphaAngle, kDouble, (UInt_t)fNPlanes}, + {"dc_beta_angle", fBetaAngle, kDouble, (UInt_t)fNPlanes}, + {"dc_gamma_angle", fGammaAngle, kDouble, (UInt_t)fNPlanes}, + {"dc_pitch", fPitch, kDouble, (UInt_t)fNPlanes}, + {"dc_central_wire", fCentralWire, kDouble, (UInt_t)fNPlanes}, + {"dc_plane_time_zero", fPlaneTimeZero, kDouble, (UInt_t)fNPlanes}, + {"dc_sigma", fSigma, kDouble, (UInt_t)fNPlanes}, {"single_stub",&fSingleStub, kInt}, {"ntracks_max_fp", &fNTracksMaxFP, kInt}, {"xt_track_criterion", &fXtTrCriterion, kDouble}, @@ -324,7 +324,7 @@ Int_t THcDC::ReadDatabase( const TDatime& date ) if(fNTracksMaxFP <= 0) fNTracksMaxFP = 10; // if(fNTracksMaxFP > HNRACKS_MAX) fNTracksMaxFP = NHTRACKS_MAX; cout << "Plane counts:"; - for(UInt_t i=0;i<fNPlanes;i++) { + for(Int_t i=0;i<fNPlanes;i++) { cout << " " << fNWires[i]; } cout << endl; @@ -429,7 +429,7 @@ void THcDC::ClearEvent() fChambers[i]->Clear(); } - for(UInt_t i=0;i<fNPlanes;i++) { + for(Int_t i=0;i<fNPlanes;i++) { fResiduals[i] = 1000.0; } @@ -449,7 +449,7 @@ Int_t THcDC::Decode( const THaEvData& evdata ) if(!gHaCuts->Result("Pedestal_event")) { // Let each plane get its hits Int_t nexthit = 0; - for(UInt_t ip=0;ip<fNPlanes;ip++) { + for(Int_t ip=0;ip<fNPlanes;ip++) { nexthit = fPlanes[ip]->ProcessHits(fRawHitList, nexthit); fN_True_RawHits += fPlanes[ip]->GetNRawhits(); @@ -895,7 +895,7 @@ void THcDC::TrackFit() // calculations // Make sure fCoords, fResiduals, and fDoubleResiduals are clear - for(UInt_t iplane=0;iplane < fNPlanes; iplane++) { + for(Int_t iplane=0;iplane < fNPlanes; iplane++) { Double_t coord=0.0; for(Int_t ir=0;ir<NUM_FPRAY;ir++) { coord += fPlaneCoeffs[iplane][raycoeffmap[ir]]*dray[ir]; @@ -996,7 +996,7 @@ void THcDC::TrackFit() } } if(fNDCTracks>0) { - for(UInt_t ip=0;ip<fNPlanes;ip++) { + for(Int_t ip=0;ip<fNPlanes;ip++) { THcDCTrack *theDCTrack = static_cast<THcDCTrack*>( fDCTracks->At(0)); fResiduals[ip] = theDCTrack->GetResidual(ip); } @@ -1101,7 +1101,7 @@ void THcDC::EffInit() for(UInt_t i=0;i<fNChambers;i++) { fNChamHits[i] = 0; } - for(UInt_t i=0;i<fNPlanes;i++) { + for(Int_t i=0;i<fNPlanes;i++) { fPlaneEvents[i] = 0; } gHcParms->Define(Form("%sdc_tot_events",fPrefix),"Total DC Events",fTotEvents); @@ -1118,7 +1118,7 @@ void THcDC::Eff() for(UInt_t i=0;i<fNChambers;i++) { if(fChambers[i]->GetNHits()>0) fNChamHits[i]++; } - for(UInt_t i=0;i<fNPlanes;i++) { + for(Int_t i=0;i<fNPlanes;i++) { if(fPlanes[i]->GetNHits() > 0) fPlaneEvents[i]++; } return; diff --git a/src/THcDC.h b/src/THcDC.h index 00af88ffe18af0bc66346ed226c7f381b63e09ed..71bd4963ff9de5849de4081579ed0d7bb79ff54b 100644 --- a/src/THcDC.h +++ b/src/THcDC.h @@ -89,7 +89,7 @@ protected: // Hall C Parameters char fPrefix[2]; - UInt_t fNPlanes; // Total number of DC planes + Int_t fNPlanes; // Total number of DC planes char** fPlaneNames; UInt_t fNChambers; Int_t fFixLR; // If 1, allow a given hit to have different LR diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx index eb8a9727e476e40ccb5f41aa129963f89c9d57b5..b612feb984f5a91a9667581ca9afcf8111f86934 100644 --- a/src/THcHodoscope.cxx +++ b/src/THcHodoscope.cxx @@ -107,7 +107,7 @@ void THcHodoscope::Setup(const char* name, const char* description) // Should quit. Is there an official way to quit? } fPlaneNames = new char* [fNPlanes]; - for(UInt_t i=0;i<fNPlanes;i++) { + for(Int_t i=0;i<fNPlanes;i++) { fPlaneNames[i] = new char[plane_names[i].length()+1]; strcpy(fPlaneNames[i], plane_names[i].c_str()); } @@ -126,7 +126,7 @@ void THcHodoscope::Setup(const char* name, const char* description) // Probably shouldn't assume that description is defined char* desc = new char[strlen(description)+100]; fPlanes = new THcScintillatorPlane* [fNPlanes]; - for(UInt_t i=0;i < fNPlanes;i++) { + for(Int_t i=0;i < fNPlanes;i++) { strcpy(desc, description); strcat(desc, " Plane "); strcat(desc, fPlaneNames[i]); @@ -171,7 +171,7 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date ) if( (status = THaNonTrackingDetector::Init( date )) ) return fStatus=status; - for(UInt_t ip=0;ip<fNPlanes;ip++) { + for(Int_t ip=0;ip<fNPlanes;ip++) { if((status = fPlanes[ip]->Init( date ))) { return fStatus=status; } @@ -201,7 +201,7 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date ) // Double_t fHitCnt4 = 0., fHitCnt3 = 0.; fScinHit = new Double_t*[fNPlanes]; - for (UInt_t m = 0; m < fNPlanes; m++ ){ + for (Int_t m = 0; m < fNPlanes; m++ ){ fScinHit[m] = new Double_t[fNPaddle[0]]; } @@ -364,7 +364,7 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) // prefix[1]='\0'; - for(UInt_t i=0;i<fNPlanes;i++) { + for(Int_t i=0;i<fNPlanes;i++) { DBRequest list[]={ {Form("scin_%s_nr",fPlaneNames[i]), &fNPaddle[i], kInt}, @@ -376,7 +376,7 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) // GN added // reading variables from *hodo.param fMaxScinPerPlane=fNPaddle[0]; - for (UInt_t i=1;i<fNPlanes;i++) { + for (Int_t i=1;i<fNPlanes;i++) { fMaxScinPerPlane=(fMaxScinPerPlane > fNPaddle[i])? fMaxScinPerPlane : fNPaddle[i]; } // need this for "padded arrays" i.e. 4x16 lists of parameters (GN) @@ -451,7 +451,7 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) cout <<"TdcMin = "<<fScinTdcMin<<" TdcMax = "<<fScinTdcMax<<endl; cout <<"TofTolerance = "<<fTofTolerance<<endl; cout <<"*** VelLight ***\n"; - for (UInt_t i1=0;i1<fNPlanes;i1++) { + for (Int_t i1=0;i1<fNPlanes;i1++) { cout<<"Plane "<<i1<<endl; for (UInt_t i2=0;i2<fMaxScinPerPlane;i2++) { cout<<fHodoVelLight[GetScinIndex(i1,i2)]<<" "; @@ -555,7 +555,7 @@ THcHodoscope::~THcHodoscope() void THcHodoscope::DeleteArrays() { // Delete member arrays. Used by destructor. - for(UInt_t k = 0; k < fNPlanes; k++){ + for(Int_t k = 0; k < fNPlanes; k++){ delete [] fScinHit[k]; } delete [] fScinHit; @@ -625,7 +625,7 @@ void THcHodoscope::ClearEvent() // fBetaChisq[imaxhit] = 0.; // } - for(UInt_t ip=0;ip<fNPlanes;ip++) { + for(Int_t ip=0;ip<fNPlanes;ip++) { fPlanes[ip]->Clear(); fFPTime[ip]=0.; fPlaneCenter[ip]=0.; @@ -650,7 +650,7 @@ Int_t THcHodoscope::Decode( const THaEvData& evdata ) if(gHaCuts->Result("Pedestal_event")) { Int_t nexthit = 0; - for(UInt_t ip=0;ip<fNPlanes;ip++) { + for(Int_t ip=0;ip<fNPlanes;ip++) { nexthit = fPlanes[ip]->AccumulatePedestals(fRawHitList, nexthit); } @@ -658,7 +658,7 @@ Int_t THcHodoscope::Decode( const THaEvData& evdata ) return(0); } if(fAnalyzePedestals) { - for(UInt_t ip=0;ip<fNPlanes;ip++) { + for(Int_t ip=0;ip<fNPlanes;ip++) { fPlanes[ip]->CalculatePedestals(); } @@ -670,7 +670,7 @@ Int_t THcHodoscope::Decode( const THaEvData& evdata ) fStartTime=0; fNfptimes=0; - for(UInt_t ip=0;ip<fNPlanes;ip++) { + for(Int_t ip=0;ip<fNPlanes;ip++) { fPlaneCenter[ip] = fPlanes[ip]->GetPosCenter(0) + fPlanes[ip]->GetPosOffset(); fPlaneSpacing[ip] = fPlanes[ip]->GetSpacing(); @@ -759,7 +759,7 @@ Int_t THcHodoscope::FineProcess( TClonesArray& tracks ) THaTrack* theTrack = dynamic_cast<THaTrack*>( tracks.At(itrack) ); if (!theTrack) return -1; - for ( UInt_t ip = 0; ip < fNPlanes; ip++ ){ + for ( Int_t ip = 0; ip < fNPlanes; ip++ ){ fGoodPlaneTime[ip] = kFALSE; fNScinHits[ip] = 0; fNPlaneTime[ip] = 0; @@ -797,7 +797,7 @@ Int_t THcHodoscope::FineProcess( TClonesArray& tracks ) fTOFCalc.clear(); Int_t ihhit = 0; // Hit # overall - for( UInt_t ip = 0; ip < fNPlanes; ip++ ) { + for( Int_t ip = 0; ip < fNPlanes; ip++ ) { fNScinHits[ip] = fPlanes[ip]->GetNScinHits(); @@ -1159,7 +1159,7 @@ Int_t THcHodoscope::FineProcess( TClonesArray& tracks ) sumw = 0.; sumt = 0.; sumz = 0.; sumzz = 0.; sumtz = 0.; ihhit = 0; - for ( UInt_t ip = 0; ip < fNPlanes; ip++ ){ + for ( Int_t ip = 0; ip < fNPlanes; ip++ ){ if (!fPlanes[ip]) return -1; @@ -1194,7 +1194,7 @@ Int_t THcHodoscope::FineProcess( TClonesArray& tracks ) betaChisq = 0.; ihhit = 0; - for ( UInt_t ip = 0; ip < fNPlanes; ip++ ){ // Loop over planes + for ( Int_t ip = 0; ip < fNPlanes; ip++ ){ // Loop over planes if (!fPlanes[ip]) return -1; @@ -1259,7 +1259,7 @@ Int_t THcHodoscope::FineProcess( TClonesArray& tracks ) Double_t fptimesum=0.0; Int_t n_fptimesum=0; - for ( UInt_t ip = 0; ip < fNPlanes; ip++ ){ + for ( Int_t ip = 0; ip < fNPlanes; ip++ ){ if ( fNPlaneTime[ip] != 0 ){ fFPTime[ip] = ( fSumPlaneTime[ip] / fNPlaneTime[ip] ); fptimesum += fSumPlaneTime[ip]; diff --git a/src/THcHodoscope.h b/src/THcHodoscope.h index ab94cab1df7ea2977a52e5dcc480a1b83f3cb94f..5d8e707d950db8d37acb5f6d5fcfd0aa887a3bd6 100644 --- a/src/THcHodoscope.h +++ b/src/THcHodoscope.h @@ -105,7 +105,8 @@ protected: // Potential Hall C parameters. Mostly here for demonstration - UInt_t fNPlanes,fMaxScinPerPlane,fMaxHodoScin; // number of planes; max number of scin/plane; product of the first two + Int_t fNPlanes; + UInt_t fMaxScinPerPlane,fMaxHodoScin; // number of planes; max number of scin/plane; product of the first two Double_t fStartTimeCenter, fStartTimeSlop, fScinTdcToTime; Double_t fTofTolerance; Double_t fPathLengthCentral;