About 50degF, Sunny for the past few days. Still lots of snow in the Wasatch; great skiing. I flew the Cessna to Arizona and back across the Grand Canyon this week.
As Ron pointed out, the red trace V(out) is the output of the comparator, the decaying signal is the output of the detector, V(det).
Think of the circuit as three independent blocks; the gain stage, the detector, and the Schmit Trigger (comparator with hysteresis). Note that for proper operation of the detector, the amplitude at the output of the gain block V(a) needs to be a minimum of a couple of volts, so adjust the gain of first stage as needed. To invert the output, flip both diodes in the detector so that it puts out a negative voltage, and set up the trip point pot as needed.
Do you have split supplies? Do you want to invert the output?