CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
EcalUncalibRecHitWorkerRatio Class Reference

#include <EcalUncalibRecHitWorkerRatio.h>

Inheritance diagram for EcalUncalibRecHitWorkerRatio:
EcalUncalibRecHitWorkerBaseClass

Public Member Functions

 EcalUncalibRecHitWorkerRatio (const edm::ParameterSet &, edm::ConsumesCollector &c)
 
bool run (const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result)
 
void set (const edm::EventSetup &es)
 
virtual ~EcalUncalibRecHitWorkerRatio ()
 
- Public Member Functions inherited from EcalUncalibRecHitWorkerBaseClass
 EcalUncalibRecHitWorkerBaseClass (const edm::ParameterSet &, edm::ConsumesCollector &c)
 
 EcalUncalibRecHitWorkerBaseClass (const edm::ParameterSet &)
 
virtual ~EcalUncalibRecHitWorkerBaseClass ()
 

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 24 of file EcalUncalibRecHitWorkerRatio.h.

Constructor & Destructor Documentation

EcalUncalibRecHitWorkerRatio::EcalUncalibRecHitWorkerRatio ( const edm::ParameterSet ps,
edm::ConsumesCollector c 
)

Definition at line 12 of file EcalUncalibRecHitWorkerRatio.cc.

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

12  :
14 {
15  EBtimeFitParameters_ = ps.getParameter<std::vector<double> >("EBtimeFitParameters");
16  EEtimeFitParameters_ = ps.getParameter<std::vector<double> >("EEtimeFitParameters");
17 
18  EBamplitudeFitParameters_ = ps.getParameter<std::vector<double> >("EBamplitudeFitParameters");
19  EEamplitudeFitParameters_ = ps.getParameter<std::vector<double> >("EEamplitudeFitParameters");
20 
21  EBtimeFitLimits_.first = ps.getParameter<double>("EBtimeFitLimits_Lower");
22  EBtimeFitLimits_.second = ps.getParameter<double>("EBtimeFitLimits_Upper");
23 
24  EEtimeFitLimits_.first = ps.getParameter<double>("EEtimeFitLimits_Lower");
25  EEtimeFitLimits_.second = ps.getParameter<double>("EEtimeFitLimits_Upper");
26 
27  EBtimeConstantTerm_ = ps.getParameter<double>("EBtimeConstantTerm");
28  EEtimeConstantTerm_ = ps.getParameter<double>("EEtimeConstantTerm");
29 }
T getParameter(std::string const &) const
std::vector< double > EEamplitudeFitParameters_
std::pair< double, double > EEtimeFitLimits_
EcalUncalibRecHitWorkerBaseClass(const edm::ParameterSet &, edm::ConsumesCollector &c)
std::pair< double, double > EBtimeFitLimits_
std::vector< double > EBamplitudeFitParameters_
virtual EcalUncalibRecHitWorkerRatio::~EcalUncalibRecHitWorkerRatio ( )
inlinevirtual

Definition at line 28 of file EcalUncalibRecHitWorkerRatio.h.

28 {};

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(), ecalpyutils::hashedIndex(), EBDetId::hashedIndex(), EEDetId::hashedIndex(), EcalUncalibRecHitRatioMethodAlgo< C >::makeRecHit(), EcalPedestal::mean_x1, EcalPedestal::mean_x12, EcalPedestal::mean_x6, pedRMSVec, peds, pedVec, funct::pow(), edm::ESHandle< class >::product(), edm::SortedCollection< T, SORT >::push_back(), EcalPedestal::rms_x1, EcalPedestal::rms_x12, EcalPedestal::rms_x6, sampleMaskHand_, EcalUncalibratedRecHit::setAmplitude(), EcalUncalibratedRecHit::setJitter(), EcalUncalibratedRecHit::setJitterError(), mathSSE::sqrt(), uncalibMaker_barrel_, and uncalibMaker_endcap_.

48 {
49  DetId detid(itdg->id());
50 
51  const EcalSampleMask *sampleMask_ = sampleMaskHand_.product();
52 
53  const EcalPedestals::Item * aped = 0;
54  const EcalMGPAGainRatio * aGain = 0;
55 
56  if (detid.subdetId()==EcalEndcap) {
57  unsigned int hashedIndex = EEDetId(detid).hashedIndex();
58  aped = &peds->endcap(hashedIndex);
59  aGain = &gains->endcap(hashedIndex);
60  } else {
61  unsigned int hashedIndex = EBDetId(detid).hashedIndex();
62  aped = &peds->barrel(hashedIndex);
63  aGain = &gains->barrel(hashedIndex);
64  }
65 
66  pedVec[0] = aped->mean_x12;
67  pedVec[1] = aped->mean_x6;
68  pedVec[2] = aped->mean_x1;
69  pedRMSVec[0] = aped->rms_x12;
70  pedRMSVec[1] = aped->rms_x6;
71  pedRMSVec[2] = aped->rms_x1;
72  gainRatios[0] = 1.;
73  gainRatios[1] = aGain->gain12Over6();
74  gainRatios[2] = aGain->gain6Over1()*aGain->gain12Over6();
75 
76  float clockToNsConstant = 25.;
77  EcalUncalibratedRecHit uncalibRecHit;
78 
79  if (detid.subdetId()==EcalEndcap) {
80 
81  uncalibRecHit =
85  EEtimeFitLimits_);//GF pass mask here
86 
89  uncalibRecHit.setAmplitude( crh.amplitudeMax );
90  uncalibRecHit.setJitter( crh.timeMax - 5 );
91  uncalibRecHit.setJitterError( std::sqrt(pow(crh.timeError,2) +
93  std::pow(clockToNsConstant,2)) );
94 
95  } else {
96 
97 
98  bool gainSwitch = uncalibMaker_barrel_.fixMGPAslew(*itdg);
99 
100  uncalibRecHit=
101  uncalibMaker_barrel_.makeRecHit(*itdg,*sampleMask_,pedVec,pedRMSVec,
104  EBtimeFitLimits_);//GF pass mask here
105 
106 
109 
110  uncalibRecHit.setAmplitude( crh.amplitudeMax );
111  if(gainSwitch){
112  // introduce additional 1ns shift
113  uncalibRecHit.setJitter( crh.timeMax - 5 - 0.04 );
114  }else{
115  uncalibRecHit.setJitter( crh.timeMax - 5);
116  }
117  uncalibRecHit.setJitterError( std::sqrt(pow(crh.timeError,2) +
119  std::pow(clockToNsConstant,2)) );
120 
121  }
122  result.push_back(uncalibRecHit);
123 
124  return true;
125 }
int hashedIndex() const
get a compact index for arrays
Definition: EBDetId.h:86
EcalUncalibRecHitRatioMethodAlgo< EBDataFrame > uncalibMaker_barrel_
void setJitter(float jitter)
edm::ESHandle< EcalPedestals > peds
std::vector< double > EEamplitudeFitParameters_
void push_back(T const &t)
std::pair< double, double > EEtimeFitLimits_
edm::ESHandle< EcalGainRatios > gains
void setJitterError(float jitterErr)
edm::ESHandle< EcalSampleMask > sampleMaskHand_
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:42
T sqrt(T t)
Definition: SSEVec.h:48
float gain6Over1() const
virtual EcalUncalibratedRecHit makeRecHit(const C &dataFrame, const EcalSampleMask &sampleMask, const double *pedestals, const double *pedestalRMSes, const double *gainRatios, std::vector< double > &timeFitParameters, std::vector< double > &amplitudeFitParameters, std::pair< double, double > &timeFitLimits)
Definition: DetId.h:18
int hashedIndex() const
Definition: EEDetId.h:182
T const * product() const
Definition: ESHandle.h:62
float gain12Over6() const
std::pair< double, double > EBtimeFitLimits_
EcalUncalibRecHitRatioMethodAlgo< EEDataFrame > uncalibMaker_endcap_
void setAmplitude(float amplitude)
std::vector< double > EBamplitudeFitParameters_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
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_.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

33 {
34 
35  // which of the samples need be used
37 
38  es.get<EcalGainRatiosRcd>().get(gains);
39  es.get<EcalPedestalsRcd>().get(peds);
40 
41 }
edm::ESHandle< EcalPedestals > peds
edm::ESHandle< EcalGainRatios > gains
edm::ESHandle< EcalSampleMask > sampleMaskHand_
const T & get() const
Definition: EventSetup.h:55

Member Data Documentation

std::vector<double> EcalUncalibRecHitWorkerRatio::EBamplitudeFitParameters_
protected

Definition at line 48 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

double EcalUncalibRecHitWorkerRatio::EBtimeConstantTerm_
protected

Definition at line 54 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

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

Definition at line 51 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

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

Definition at line 45 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

std::vector<double> EcalUncalibRecHitWorkerRatio::EEamplitudeFitParameters_
protected

Definition at line 49 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

double EcalUncalibRecHitWorkerRatio::EEtimeConstantTerm_
protected

Definition at line 55 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

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

Definition at line 52 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

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

Definition at line 46 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

double EcalUncalibRecHitWorkerRatio::gainRatios[3]
protected

Definition at line 43 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

edm::ESHandle<EcalGainRatios> EcalUncalibRecHitWorkerRatio::gains
protected

Definition at line 39 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run(), and set().

double EcalUncalibRecHitWorkerRatio::pedRMSVec[3]
protected

Definition at line 42 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

edm::ESHandle<EcalPedestals> EcalUncalibRecHitWorkerRatio::peds
protected

Definition at line 38 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run(), and set().

double EcalUncalibRecHitWorkerRatio::pedVec[3]
protected

Definition at line 41 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

edm::ESHandle<EcalSampleMask> EcalUncalibRecHitWorkerRatio::sampleMaskHand_
protected

Definition at line 36 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run(), and set().

EcalUncalibRecHitRatioMethodAlgo<EBDataFrame> EcalUncalibRecHitWorkerRatio::uncalibMaker_barrel_
protected

Definition at line 57 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

EcalUncalibRecHitRatioMethodAlgo<EEDataFrame> EcalUncalibRecHitWorkerRatio::uncalibMaker_endcap_
protected

Definition at line 58 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().