--- DarthVader/CalorimeterLevel2/src/CaloLevel2.cpp 2006/07/21 10:56:22 1.4 +++ DarthVader/CalorimeterLevel2/src/CaloLevel2.cpp 2006/11/09 17:05:44 1.7 @@ -12,6 +12,13 @@ * CaloTrkVar constructor **/ CaloTrkVar::CaloTrkVar() { + this->Clear(); +}; + +/** + * Clear variables +**/ +void CaloTrkVar::Clear() { trkseqno = 0; noint = 0; ncore = 0; @@ -36,12 +43,8 @@ qlow = 0.; nlow = 0; dX0l = 0.; - for (Int_t i = 0; i<2 ; i++){ - for ( Int_t j = 0; j<22; j++){ - tibar[j][i] = 0; - tbar[j][i] = 0.; - }; - }; + memset(tbar, 0, 2*22*sizeof(Float_t)); + memset(tibar, 0, 2*22*sizeof(Int_t)); } /** @@ -82,36 +85,10 @@ CaloLevel2::CaloLevel2() { // CaloTrk = new TClonesArray("CaloTrkVar",1); - // - nstrip = 0; - qtot = 0.; - impx = 0.; - impy = 0.; - tanx = 0.; - tany = 0.; - qmax = 0.; - nx22 = 0; - qx22 = 0.; - elen = 0.; - selen = 0.; - for (Int_t i = 0; i<4 ; i++){ - qq[i] = 0.; - perr[i] = 0; - swerr[i] = 0; - crc[i] = 0; - if ( i < 2 ){ - planemax[i] = 0; - varcfit[i] = 0.; - npcfit[i] = 0; - for ( Int_t j = 0; j<22; j++){ - cibar[j][i] = 0; - cbar[j][i] = 0.; - }; - }; - }; - good = 0; - selftrigger = 0; estrip = TArrayF(0,NULL); + // + this->Clear(); + // }; void CaloLevel2::Clear() { @@ -129,24 +106,17 @@ qx22 = 0.; elen = 0.; selen = 0.; - for (Int_t i = 0; i<4 ; i++){ - qq[i] = 0.; - perr[i] = 0; - swerr[i] = 0; - crc[i] = 0; - if ( i < 2 ){ - planemax[i] = 0; - varcfit[i] = 0.; - npcfit[i] = 0; - for ( Int_t j = 0; j<22; j++){ - cibar[j][i] = 0; - cbar[j][i] = 0.; - }; - }; - }; + memset(perr, 0, 4*sizeof(Int_t)); + memset(swerr, 0, 4*sizeof(Int_t)); + memset(crc, 0, 4*sizeof(Int_t)); + memset(qq, 0, 4*sizeof(Int_t)); + memset(varcfit, 0, 2*sizeof(Float_t)); + memset(npcfit, 0, 2*sizeof(Int_t)); + memset(planemax, 0, 2*sizeof(Int_t)); + memset(cibar, 0, 2*22*sizeof(Int_t)); + memset(cbar, 0, 2*22*sizeof(Float_t)); good = 0; selftrigger = 0; - // estrip = TArrayF(0,NULL); estrip.Reset(); }; @@ -209,6 +179,11 @@ l2->qmean[i] = ((CaloTrkVar *)CaloTrk->At(i))->qmean; l2->qlow[i] = ((CaloTrkVar *)CaloTrk->At(i))->qlow; l2->dX0l[i] = ((CaloTrkVar *)CaloTrk->At(i))->dX0l; + for (Int_t j=0; j<2; j++){ + for (Int_t k=0; k<22; k++){ + l2->tbar[i][k][j] = ((CaloTrkVar *)CaloTrk->At(i))->tbar[k][j]; + }; + }; } }