CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/CalibCalorimetry/EcalLaserAnalyzer/src/TMTQ.cc

Go to the documentation of this file.
00001 /* 
00002  *  \class TMTQ
00003  *
00004  *  $Date: 2012/02/09 10:08:10 $
00005  *  \author: Julie Malcles - CEA/Saclay
00006  */
00007 
00008 #include <CalibCalorimetry/EcalLaserAnalyzer/interface/TMom.h>
00009 #include <CalibCalorimetry/EcalLaserAnalyzer/interface/TMTQ.h>
00010 #include <CalibCalorimetry/EcalLaserAnalyzer/interface/TMarkov.h>
00011 #include <TMath.h>
00012 
00013 using namespace std;
00014 
00015 //ClassImp(TMTQ)
00016 
00017 
00018 // Default Constructor...
00019 TMTQ::TMTQ()
00020 {
00021   init();
00022 }
00023 
00024 
00025 // Destructor
00026 TMTQ::~TMTQ()
00027 {
00028 }
00029 
00030 void TMTQ::init()
00031 {
00032 
00033   for(int j=0;j<nOutVar;j++){
00034     cuts[0][j]=0.0;
00035     cuts[1][j]=10.0e9;
00036     mom[j]=new TMom();
00037   }
00038 }
00039 
00040 void TMTQ::addEntry(double peak, double sigma, double fit, double ampl, double trise, double fwhm, double fw20, double fw80, double ped, double pedsig, double sliding)
00041 {
00042   double val[nOutVar];
00043 
00044   val[iPeak]=peak;
00045   val[iSigma]=sigma;
00046   val[iFit]=fit;
00047   val[iAmpl]=ampl;
00048   val[iTrise]=trise;
00049   val[iFwhm]=fwhm;
00050   val[iFw20]=fw20;
00051   val[iFw80]=fw80;
00052   val[iPed]=ped;
00053   val[iPedsig]=pedsig;
00054   val[iSlide]=sliding;
00055 
00056   for(int ivar=0;ivar<nOutVar;ivar++){
00057     mom[ivar]->addEntry(val[ivar]);
00058   }
00059 
00060 }
00061   
00062 void TMTQ::setCut(int ivar, double mean, double sig){
00063 
00064   if(ivar<nOutVar){
00065     cuts[0][ivar]=mean-2.0*sig;
00066     cuts[1][ivar]=mean+2.0*sig;
00067     
00068     mom[ivar]->setCut(cuts[0][ivar],cuts[1][ivar]);
00069   }
00070 }
00071 
00072 std::vector<double> TMTQ::get(int ivar){ 
00073 
00074   std::vector<double> res;
00075   
00076   if(ivar<nOutVar){
00077 
00078     res.push_back(mom[ivar]->getMean());
00079     res.push_back(mom[ivar]->getRMS());
00080     res.push_back(mom[ivar]->getM3());
00081     res.push_back(mom[ivar]->getNevt());
00082     res.push_back(mom[ivar]->getMin());
00083     res.push_back(mom[ivar]->getMax());
00084 
00085   }
00086   return res;
00087 
00088 }
00089 
00090 std::vector<double>   TMTQ::getPeak(){std::vector<double> x=get(TMTQ::iPeak); return x;}
00091 std::vector<double>   TMTQ::getAmpl(){std::vector<double> x=get(TMTQ::iAmpl); return x;}
00092 std::vector<double>   TMTQ::getSigma(){std::vector<double> x=get(TMTQ::iSigma); return x;}
00093 std::vector<double>   TMTQ::getTrise(){std::vector<double> x=get(TMTQ::iTrise); return x;}
00094 std::vector<double>   TMTQ::getFit(){std::vector<double> x=get(TMTQ::iFit); return x;}
00095 std::vector<double>   TMTQ::getFwhm(){std::vector<double> x=get(TMTQ::iFwhm); return x;}
00096 std::vector<double>   TMTQ::getFw20(){std::vector<double> x=get(TMTQ::iFw20); return x;}
00097 std::vector<double>   TMTQ::getFw80(){std::vector<double> x=get(TMTQ::iFw80); return x;}
00098 std::vector<double>   TMTQ::getPed(){std::vector<double> x=get(TMTQ::iPed); return x;}
00099 std::vector<double>   TMTQ::getPedsig(){std::vector<double> x=get(TMTQ::iPedsig); return x;}
00100 std::vector<double>   TMTQ::getSliding(){std::vector<double> x=get(TMTQ::iSlide); return x;}
00101 
00102 
00103