CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/SimMuon/CSCDigitizer/src/CSCAnalogSignal.cc

Go to the documentation of this file.
00001 #include "SimMuon/CSCDigitizer/src/CSCAnalogSignal.h"
00002 #include <iostream>
00003 #include <algorithm>
00004 
00005 // =================================
00006 float CSCAnalogSignal::peakTime() const {
00007   size_t imax = std::max_element(theBinValues.begin(), theBinValues.end()) - theBinValues.begin();
00008   return imax/invBinSize + theTimeOffset;
00009 }
00010 
00011 
00012 std::ostream & operator<<(std::ostream & stream, const CSCAnalogSignal & signal) {
00013   stream << "CSCAnalogSignal: Element " << signal.theElement
00014          << "   Total " << signal.theTotal << std::endl;
00015   for ( int i = 0; i < int( signal.theBinValues.size() ); ++i ) { 
00016 
00017     //@@ ptc 26-Feb-02 Don't both with very small amplitudes
00018 
00019     if ( signal.theBinValues[i] > 1.E-10 ) {
00020        stream << i*signal.getBinSize()+signal.getTimeOffset() << 
00021        "\t" << signal.theBinValues[i] << std::endl;
00022     }
00023   }
00024   return stream;
00025 }
00026