--- calo/flight/CaloNuclei/src/CaloNuclei.cpp 2007/04/04 11:31:27 1.3 +++ calo/flight/CaloNuclei/src/CaloNuclei.cpp 2007/04/05 13:38:32 1.4 @@ -22,6 +22,8 @@ N = 5; R = 3; // + debug = false; + // }; void CaloNuclei::Clear(){ @@ -97,7 +99,7 @@ // tr = ntr; // - // printf(" Processing event at OBT %u PKT %u time %u \n",OBT,PKT,atime); + if ( debug ) printf(" Processing event at OBT %u PKT %u time %u \n",OBT,PKT,atime); // Clear(); // @@ -144,7 +146,7 @@ // retry: // - // printf("retry\n"); + if ( debug ) printf("retry\n"); // interplane = 0; // @@ -168,21 +170,23 @@ if ( strip != -1 && mip > ethr && !wmulthit[view] && !wgap[view] && ( strip == (track->GetCaloTrack()->tibar[plane][view]-1) || strip == (track->GetCaloTrack()->tibar[plane][view]-2) || strip == (track->GetCaloTrack()->tibar[plane][view]) ) && true ){ - // printf(" inside loop: ii %i mip %f view %i plane %i strip %i tibar %i nhit %i splane %i sview %i \n",ii,mip,view,plane,strip,track->GetCaloTrack()->tibar[plane][view]-1,nhit[view],splane[view],sview[view]); + if ( debug ) printf(" inside loop: ii %i mip %f view %i plane %i strip %i tibar %i nhit %i splane %i sview %i \n",ii,mip,view,plane,strip,track->GetCaloTrack()->tibar[plane][view]-1,nhit[view],splane[view],sview[view]); interpl[view] = plane; interv[view] = view; if ( splane[view] != plane || sview[view] != view ){ if ( nhit[view] > 1 ){ wmulthit[view] = true; + // if ( splane[view] == -1 ) splane[view] = 0; // + // if ( sview[view] == -1 ) sview[view] = view; // interpl[view] = splane[view]; - interv[view] = sview[view]; - // ii = L2->GetCaloLevel1()->istrip; + interv[view] = sview[view]; }; if ( plane > splane[view]+gapth ){ wgap[view] = true; + // if ( splane[view] == -1 ) splane[view] = 0;// + // if ( sview[view] == -1 ) sview[view] = view; // interpl[view] = splane[view]; interv[view] = sview[view]; - // ii = L2->GetCaloLevel1()->istrip; }; splane[view] = plane; sview[view] = view; @@ -196,7 +200,7 @@ // }; // - // printf("conversion interpl %i interv %i multhit %i interplane %i \n",interpl[0],interv[0],multhit,interplane); + if (debug ) printf("conversion interpl %i interv %i multhit %i interplane %i \n",interpl[0],interv[0],multhit,interplane); Int_t winterplane[2] = {-1,-1}; // for ( Int_t view = 0; view < 2; view++){ @@ -235,8 +239,8 @@ }; }; // - // printf("2conversion interpl %i interv %i multhit %i interplane %i \n",interpl[1],interv[1],multhit,interplane); - // printf("3conversion winterpl0 %i winterpl1 %i \n",winterplane[0],winterplane[1]); + if ( debug ) printf("2conversion interpl %i interv %i multhit %i interplane %i \n",interpl[1],interv[1],multhit,interplane); + if ( debug ) printf("3conversion winterpl0 %i winterpl1 %i \n",winterplane[0],winterplane[1]); // Int_t ipl = 0; if ( interplane > 0 ){ @@ -274,7 +278,7 @@ qsplane = plane; qsview = view; ind++; - if ( ind > 199 ) printf(" AAAGH!! \n"); + if ( debug && ind > 199 ) printf(" AAAGH!! \n"); qme[ind] = 0.; }; qme[ind] += mip; @@ -286,7 +290,7 @@ qsplane2 = plane; qsview2 = view; ind2++; - if ( ind2 > 2112 ) printf(" AAAGH!! \n"); + if ( debug && ind2 > 2112 ) printf(" AAAGH!! \n"); qme2[ind2] = 0.; }; qme2[ind2] += mip; @@ -302,10 +306,12 @@ // // here we must calculate qpremean, order vector qme, select 3 lowest measurements and caculate the mean... // -// for (Int_t l=0; l < interplane; l++){ -// printf(" qme[%i] = %f \n",l,qme[l]); -// // // if ( qme[ind] < 6.25 ) qme[ind] = 10000.; -// }; + if ( debug ){ + for (Int_t l=0; l < interplane; l++){ + printf(" qme[%i] = %f \n",l,qme[l]); + }; + }; + // Long64_t work[200]; ind = 0; Int_t l = 0; @@ -321,11 +327,13 @@ if ( qm >= qmt ){ if ( l < 3 ) qpremean += qm; l++; - // printf(" value no %i qm %f qmt %f \n",l,qm,qmt); + if ( debug ) printf(" value no %i qm %f qmt %f \n",l,qm,qmt); }; ind++; }; // + qpremean /= l; + // ind = 0; l = 0; while ( l < uplim && ind < interplane ){ @@ -333,17 +341,14 @@ if ( qm2 >= qmt ){ if ( l < N ) qpremeanN += qm2; l++; - // printf(" value no %i qm %f qmt %f \n",l,qm,qmt); + if ( debug ) printf(" qm2 value no %i qm %f qmt %f \n",l,qm2,qmt); }; ind++; }; // - qpremean /= l; - qpremeanN /= N; - // - // printf(" charge is %f \n",sqrt(qpremean)); + qpremeanN /= l; // - // printf("preq postq\n"); + if ( debug ) printf(" charge is %f \n",sqrt(qpremean)); // if ( mesethr != ethr && interplane >= 3 && !aldone ){ Float_t mesethr2 = (sqrt(qpremean) - 0.50)*(sqrt(qpremean) - 0.50); @@ -357,6 +362,6 @@ }; }; // - // printf(" esci \n"); + if ( debug ) printf(" esci \n"); // };