--- calo/flight/CaloNuclei/src/CaloNuclei.cpp 2007/05/31 10:10:52 1.7 +++ calo/flight/CaloNuclei/src/CaloNuclei.cpp 2008/03/14 09:24:35 1.13 @@ -29,11 +29,14 @@ void CaloNuclei::Clear(){ // + UN = 0; tr = 0; sntr = 0; interplane = 0; preq = 0.; postq = 0.; + stdedx1 = 0.; + ethr = 0.; dedx1 = 0.; dedx3 = 0.; qpremean = 0.; @@ -106,6 +109,7 @@ if ( debug ) printf(" Processing event at OBT %u PKT %u time %u \n",OBT,PKT,atime); // Clear(); + // if ( debug ) printf(" Always calculate stdedx1 \n"); // // Always calculate stdedx1 @@ -138,11 +142,13 @@ // find energy released along the strip of maximum on the first plane and on the two neighbour strips // if ( indx > 0 ){ - Int_t mindx = (Int_t)TMath::LocMax(indx,stfpl); + Int_t mindx = (Int_t)TMath::LocMax(indx,vfpl); for (Int_t ii=0; ii=0 && stfpl[ii] == stfpl[mindx-1] ) stdedx1 += vfpl[ii]; - if ( (mindx+1)<96 && stfpl[ii] == stfpl[mindx+1] ) stdedx1 += vfpl[ii]; + if ( (mindx-1)>=0 && stfpl[ii] == (stfpl[mindx]-1) ) stdedx1 += vfpl[ii]; + if ( (mindx+1)<96 && stfpl[ii] == (stfpl[mindx]+1) ) stdedx1 += vfpl[ii]; + // if ( (mindx-1)>=0 && stfpl[ii] == stfpl[mindx-1] ) stdedx1 += vfpl[ii]; + // if ( (mindx+1)<96 && stfpl[ii] == stfpl[mindx+1] ) stdedx1 += vfpl[ii]; }; } else { stdedx1 = 0.; @@ -151,21 +157,30 @@ if ( debug ) printf(" if ( !usetrack ) return: usetrack %i ntr %i \n",usetrack,ntr); // // - if ( !usetrack ) return; + // if ( !usetrack ) return; // PamTrack *ptrack = 0; CaloTrkVar *track = 0; - if ( ntr >= 0 ){ - ptrack = L2->GetTrack(ntr); - if ( ptrack ) track = ptrack->GetCaloTrack(); - } else { - track = L2->GetCaloStoredTrack(ntr); - }; // - if ( !track && ntr >= 0 ){ - printf(" ERROR: cannot find any track!\n"); - printf(" ERROR: CaloNuclei variables not completely filled \n"); - return; + if ( usetrack ){ + if ( ntr >= 0 ){ + ptrack = L2->GetTrack(ntr); + if ( ptrack ) track = ptrack->GetCaloTrack(); + } else { + track = L2->GetCaloStoredTrack(ntr); + }; + // + if ( !track && ntr >= 0 ){ + printf(" ERROR: cannot find any track!\n"); + printf(" ERROR: CaloNuclei variables not completely filled \n"); + return; + }; + } else { + if ( ntr >= 0 ){ + if ( debug ) printf(" ERROR: you asked not to use a track but you are looking for track number %i !\n",ntr); + if ( debug ) printf(" ERROR: CaloNuclei variables not completely filled \n"); + return; + }; }; // // Float_t defethr = 6. * 0.90; @@ -491,6 +506,7 @@ }; // qpremeanN /= (Float_t)RN; + UN = RN; // if ( debug ) printf(" charge is %f \n",sqrt(qpremean)); //