Re: [BLAST_ANAWARE] Root C++ Question; segfault cvs BlastLib2

From: Chris Crawford (chris2@lns.mit.edu)
Date: Wed Dec 29 2004 - 02:54:52 EST


hi eugene,
  just scanning the code i couldn't find anything wrong with it. it
probably wouldn't let you debug it because it was having an error
reading the code before executing anything. i suggest you compile it
with gcc, (or .x file.C+ using ACLiC), because gcc has more useful
diagnostics, and then you can also use gdb.
  as far as blastlib2, what version of gcc do you use? it works fine
for me. try deleting lines out of ReconLinkDef.h until it works, and
then go into that file and comment out functions until you find the culprit.
--chris

Eugene J. Geis wrote:

>I'm at wits end... I'm looping through some events and doing some calculations,
>Root won't allow me to spit out debug lines... it quits in my function and
>without processing any 'cout' or 'printf' lines.
>
>The Root message is :
>Error: ! Illegal operator for real number
>FILE:/home/egeis/analysis/my_macros/kc_t.C LINE:366
>*** Interpreter error recovered ***
>
>Has anyone gotten this error? I can't find any problem.
>
>The function's code is attached at the bottom... It is not very long.
>
>I'm also having a problem making the BlastLib2 directory here in AZ...
>ReconDict.cc segfaults.
>
>make: *** [ReconDict.cc] Segmentation fault
>make: *** Deleting file `ReconDict.cc'
>
>Any help is appreciated,
>Eugene
>
>
>
>//*********************************************************
>
>
>//Global variables declared -> nX2Bins, mE, mD, mP, mN, dPeleft, dPeright,
>//dPpleft, dPpright, dthetae, dthetap, eBeam
>
>Float_t kc_t::FindLowestQ2(Float_t Q2pe,Float_t Q2pp,Float_t Q2te,Float_t
>Q2tp,Float_t Q2center,Int_t sector)
>{
> Float_t newPe , newPp , newTe , newTp , Test1 , Test2 , dPp;
>
> dPp = (sector) ? dPpright : dPpleft; //different resolution v. sector
>
> Float_t dPe = dPeleft; //same resolution
> Float_t dTe = dthetae;
> Float_t dTp = dthetap;
> Float_t goodX2,delQ2,bestQ2;
> Float_t bestX2 = 50.0;
> Float_t deltaQ2 = 0.07/nX2Bins; //increment size
>
>// Loop over varied Q2 input
> for (Int_t i=0;i<nX2Bins;i++) {
>
> delQ2 = deltaQ2*(i-nX2Bins/2.0); // deviation from center Q2
>
> Test1 = mP/(eBeam*(1.0-2*eBeam*mP/(Q2center+delQ2)))+1.0; //input Q2
>
> if (fabs(Test1)<1.0) {
>
> newTe = rad2deg*acos(Test1); // arccosine of Test1 if abs(x)<1
> newPe = (eBeam*mP+mE**2)/(mP+eBeam-eBeam*cos(newTe*deg2rad));
> newPp = sqrt((mP+eBeam-newPe)**2-mP**2);
> Test2 = (eBeam+mP)*(sqrt(newPp**2+mP**2)-mP)/(eBeam*newPp);
>
> if (fabs(Test2)<1.0) {
> newTp = rad2deg*acos(Test2); // arccosine for thetaProton
>
> goodX2 = ((Q2pe-newPe)/dPe)**2 +
> ((Q2pp-newPp)/dPp)**2 +
> ((Q2te-newTe)/dTe)**2 +
> ((Q2tp-newTp)/dTp)**2; // calculate X2
>
> if (goodX2<bestX2) {
> bestX2 = goodX2;
> bestQ2 = Q2center+delQ2;
>
> }
> }
> }
> }
> return bestQ2;
>}
>
>
>
>



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:32 EST