CMS 3D CMS Logo

Public Member Functions | Protected Attributes

EcalUncalibRecHitWorkerRatio Class Reference

#include <EcalUncalibRecHitWorkerRatio.h>

Inheritance diagram for EcalUncalibRecHitWorkerRatio:
EcalUncalibRecHitWorkerBaseClass

List of all members.

Public Member Functions

 EcalUncalibRecHitWorkerRatio (const edm::ParameterSet &)
bool run (const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result)
void set (const edm::EventSetup &es)
virtual ~EcalUncalibRecHitWorkerRatio ()

Protected Attributes

std::vector< double > EBamplitudeFitParameters_
double EBtimeConstantTerm_
std::pair< double, double > EBtimeFitLimits_
std::vector< double > EBtimeFitParameters_
std::vector< double > EEamplitudeFitParameters_
double EEtimeConstantTerm_
std::pair< double, double > EEtimeFitLimits_
std::vector< double > EEtimeFitParameters_
double gainRatios [3]
edm::ESHandle< EcalGainRatiosgains
double pedRMSVec [3]
edm::ESHandle< EcalPedestalspeds
double pedVec [3]
edm::ESHandle< EcalSampleMasksampleMaskHand_
EcalUncalibRecHitRatioMethodAlgo
< EBDataFrame
uncalibMaker_barrel_
EcalUncalibRecHitRatioMethodAlgo
< EEDataFrame
uncalibMaker_endcap_

Detailed Description

Definition at line 27 of file EcalUncalibRecHitWorkerRatio.h.


Constructor & Destructor Documentation

EcalUncalibRecHitWorkerRatio::EcalUncalibRecHitWorkerRatio ( const edm::ParameterSet ps)

Definition at line 12 of file EcalUncalibRecHitWorkerRatio.cc.

References EBamplitudeFitParameters_, EBtimeConstantTerm_, EBtimeFitLimits_, EBtimeFitParameters_, EEamplitudeFitParameters_, EEtimeConstantTerm_, EEtimeFitLimits_, EEtimeFitParameters_, and edm::ParameterSet::getParameter().

                                                                                   :
        EcalUncalibRecHitWorkerBaseClass(ps)
{
  EBtimeFitParameters_ = ps.getParameter<std::vector<double> >("EBtimeFitParameters"); 
  EEtimeFitParameters_ = ps.getParameter<std::vector<double> >("EEtimeFitParameters"); 
 
  EBamplitudeFitParameters_ = ps.getParameter<std::vector<double> >("EBamplitudeFitParameters"); 
  EEamplitudeFitParameters_ = ps.getParameter<std::vector<double> >("EEamplitudeFitParameters"); 
 
  EBtimeFitLimits_.first  = ps.getParameter<double>("EBtimeFitLimits_Lower"); 
  EBtimeFitLimits_.second = ps.getParameter<double>("EBtimeFitLimits_Upper"); 
 
  EEtimeFitLimits_.first  = ps.getParameter<double>("EEtimeFitLimits_Lower"); 
  EEtimeFitLimits_.second = ps.getParameter<double>("EEtimeFitLimits_Upper"); 

  EBtimeConstantTerm_ = ps.getParameter<double>("EBtimeConstantTerm");
  EEtimeConstantTerm_ = ps.getParameter<double>("EEtimeConstantTerm");
}
virtual EcalUncalibRecHitWorkerRatio::~EcalUncalibRecHitWorkerRatio ( ) [inline, virtual]

Definition at line 31 of file EcalUncalibRecHitWorkerRatio.h.

{};

Member Function Documentation

bool EcalUncalibRecHitWorkerRatio::run ( const edm::Event evt,
const EcalDigiCollection::const_iterator digi,
EcalUncalibratedRecHitCollection result 
) [virtual]

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 45 of file EcalUncalibRecHitWorkerRatio.cc.

References cond::rpcobgas::detid, EBamplitudeFitParameters_, EBtimeConstantTerm_, EBtimeFitLimits_, EBtimeFitParameters_, EcalEndcap, EEamplitudeFitParameters_, EEtimeConstantTerm_, EEtimeFitLimits_, EEtimeFitParameters_, EcalUncalibRecHitRatioMethodAlgo< C >::fixMGPAslew(), EcalMGPAGainRatio::gain12Over6(), EcalMGPAGainRatio::gain6Over1(), gainRatios, gains, EcalUncalibRecHitRatioMethodAlgo< C >::getCalculatedRecHit(), EEDetId::hashedIndex(), ecalpyutils::hashedIndex(), EBDetId::hashedIndex(), EcalUncalibRecHitRatioMethodAlgo< C >::makeRecHit(), pedRMSVec, peds, pedVec, funct::pow(), edm::ESHandle< T >::product(), edm::SortedCollection< T, SORT >::push_back(), sampleMaskHand_, EcalUncalibratedRecHit::setAmplitude(), EcalUncalibratedRecHit::setJitter(), EcalUncalibratedRecHit::setJitterError(), mathSSE::sqrt(), uncalibMaker_barrel_, and uncalibMaker_endcap_.

{
        DetId detid(itdg->id());

        const EcalSampleMask *sampleMask_ = sampleMaskHand_.product();

        const EcalPedestals::Item * aped = 0;
        const EcalMGPAGainRatio * aGain = 0;

        if (detid.subdetId()==EcalEndcap) {
                unsigned int hashedIndex = EEDetId(detid).hashedIndex();
                aped  = &peds->endcap(hashedIndex);
                aGain = &gains->endcap(hashedIndex);
        } else {
                unsigned int hashedIndex = EBDetId(detid).hashedIndex();
                aped  = &peds->barrel(hashedIndex);
                aGain = &gains->barrel(hashedIndex);
        }

        pedVec[0] = aped->mean_x12;
        pedVec[1] = aped->mean_x6;
        pedVec[2] = aped->mean_x1;
        pedRMSVec[0] = aped->rms_x12;
        pedRMSVec[1] = aped->rms_x6;
        pedRMSVec[2] = aped->rms_x1;
        gainRatios[0] = 1.;
        gainRatios[1] = aGain->gain12Over6();
        gainRatios[2] = aGain->gain6Over1()*aGain->gain12Over6();

        float clockToNsConstant = 25.;
        EcalUncalibratedRecHit uncalibRecHit;

        if (detid.subdetId()==EcalEndcap) {

          uncalibRecHit = 
            uncalibMaker_endcap_.makeRecHit(*itdg,*sampleMask_,pedVec,pedRMSVec,
                                            gainRatios,EEtimeFitParameters_,
                                            EEamplitudeFitParameters_,
                                            EEtimeFitLimits_);//GF pass mask here
          
          EcalUncalibRecHitRatioMethodAlgo<EEDataFrame>::CalculatedRecHit crh =
                                  uncalibMaker_endcap_.getCalculatedRecHit();
          uncalibRecHit.setAmplitude( crh.amplitudeMax );
          uncalibRecHit.setJitter( crh.timeMax - 5 );
          uncalibRecHit.setJitterError( std::sqrt(pow(crh.timeError,2) + 
                                        std::pow(EEtimeConstantTerm_,2)/
                                        std::pow(clockToNsConstant,2)) );

        } else {
 

          bool gainSwitch = uncalibMaker_barrel_.fixMGPAslew(*itdg);

          uncalibRecHit= 
            uncalibMaker_barrel_.makeRecHit(*itdg,*sampleMask_,pedVec,pedRMSVec,
                                            gainRatios,EBtimeFitParameters_,
                                            EBamplitudeFitParameters_,
                                            EBtimeFitLimits_);//GF pass mask here
          
          
          EcalUncalibRecHitRatioMethodAlgo<EBDataFrame>::CalculatedRecHit crh= 
            uncalibMaker_barrel_.getCalculatedRecHit();

          uncalibRecHit.setAmplitude( crh.amplitudeMax );
          if(gainSwitch){
            // introduce additional 1ns shift
            uncalibRecHit.setJitter( crh.timeMax - 5 - 0.04 );
          }else{
            uncalibRecHit.setJitter( crh.timeMax - 5);
          }
          uncalibRecHit.setJitterError( std::sqrt(pow(crh.timeError,2) + 
                                        std::pow(EBtimeConstantTerm_,2)/
                                        std::pow(clockToNsConstant,2)) );

        }
        result.push_back(uncalibRecHit);

        return true;
}
void EcalUncalibRecHitWorkerRatio::set ( const edm::EventSetup es) [virtual]

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 32 of file EcalUncalibRecHitWorkerRatio.cc.

References gains, edm::EventSetup::get(), peds, and sampleMaskHand_.

{
  
  // which of the samples need be used      
  es.get<EcalSampleMaskRcd>().get(sampleMaskHand_);
  
  es.get<EcalGainRatiosRcd>().get(gains);
  es.get<EcalPedestalsRcd>().get(peds);

}

Member Data Documentation

Definition at line 51 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

Definition at line 57 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

std::pair<double,double> EcalUncalibRecHitWorkerRatio::EBtimeFitLimits_ [protected]

Definition at line 54 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

std::vector<double> EcalUncalibRecHitWorkerRatio::EBtimeFitParameters_ [protected]

Definition at line 48 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

Definition at line 52 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

Definition at line 58 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

std::pair<double,double> EcalUncalibRecHitWorkerRatio::EEtimeFitLimits_ [protected]

Definition at line 55 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

std::vector<double> EcalUncalibRecHitWorkerRatio::EEtimeFitParameters_ [protected]

Definition at line 49 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

Definition at line 46 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

Definition at line 42 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run(), and set().

Definition at line 45 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

Definition at line 41 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run(), and set().

double EcalUncalibRecHitWorkerRatio::pedVec[3] [protected]

Definition at line 44 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

Definition at line 39 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run(), and set().

Definition at line 60 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

Definition at line 61 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().