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)
 
 EcalUncalibRecHitWorkerRatio ()
 
edm::ParameterSetDescription getAlgoDescription ()
 
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 &)
 
 EcalUncalibRecHitWorkerBaseClass ()
 
virtual void set (const edm::Event &evt)
 
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 25 of file EcalUncalibRecHitWorkerRatio.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file EcalUncalibRecHitWorkerRatio.cc.

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

15  :
17 {
18  EBtimeFitParameters_ = ps.getParameter<std::vector<double> >("EBtimeFitParameters");
19  EEtimeFitParameters_ = ps.getParameter<std::vector<double> >("EEtimeFitParameters");
20 
21  EBamplitudeFitParameters_ = ps.getParameter<std::vector<double> >("EBamplitudeFitParameters");
22  EEamplitudeFitParameters_ = ps.getParameter<std::vector<double> >("EEamplitudeFitParameters");
23 
24  EBtimeFitLimits_.first = ps.getParameter<double>("EBtimeFitLimits_Lower");
25  EBtimeFitLimits_.second = ps.getParameter<double>("EBtimeFitLimits_Upper");
26 
27  EEtimeFitLimits_.first = ps.getParameter<double>("EEtimeFitLimits_Lower");
28  EEtimeFitLimits_.second = ps.getParameter<double>("EEtimeFitLimits_Upper");
29 
30  EBtimeConstantTerm_ = ps.getParameter<double>("EBtimeConstantTerm");
31  EEtimeConstantTerm_ = ps.getParameter<double>("EEtimeConstantTerm");
32 }
T getParameter(std::string const &) const
std::vector< double > EEamplitudeFitParameters_
std::pair< double, double > EEtimeFitLimits_
std::pair< double, double > EBtimeFitLimits_
std::vector< double > EBamplitudeFitParameters_
EcalUncalibRecHitWorkerRatio::EcalUncalibRecHitWorkerRatio ( )
inline

Definition at line 29 of file EcalUncalibRecHitWorkerRatio.h.

29 {};
virtual EcalUncalibRecHitWorkerRatio::~EcalUncalibRecHitWorkerRatio ( )
inlinevirtual

Definition at line 30 of file EcalUncalibRecHitWorkerRatio.h.

30 {};

Member Function Documentation

edm::ParameterSetDescription EcalUncalibRecHitWorkerRatio::getAlgoDescription ( )
virtual

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 131 of file EcalUncalibRecHitWorkerRatio.cc.

References edm::ParameterSetDescription::addNode().

131  {
132 
134  std::vector<double> dSet1 = {-2.390548,3.553628,-17.62341,67.67538,-133.213,140.7432,-75.41106,16.20277};
135  std::vector<double> dSet2 = {-2.015452, 3.130702, -12.3473, 41.88921, -82.83944, 91.01147, -50.35761, 11.05621};
136 
137  psd.addNode(edm::ParameterDescription<double>("EEtimeFitLimits_Upper", 1.4, true) and
138  edm::ParameterDescription<double>("EEtimeConstantTerm", 0.18, true) and
139  edm::ParameterDescription<double>("EBtimeFitLimits_Lower", 0.2, true) and
140  edm::ParameterDescription<double>("EBtimeConstantTerm", 0.26, true) and
141  edm::ParameterDescription<double>("EEtimeFitLimits_Lower", 0.2, true) and
142  edm::ParameterDescription<std::vector<double> >("EEtimeFitParameters", dSet1, true) and
143  edm::ParameterDescription<std::vector<double>>("EEamplitudeFitParameters", {1.89, 1.4}, true) and
144  edm::ParameterDescription<double>("EBtimeFitLimits_Upper", 1.4, true) and
145  edm::ParameterDescription<std::vector<double>>("EBamplitudeFitParameters", {1.138,1.652}, true) and
146  edm::ParameterDescription<std::vector<double>>("EBtimeFitParameters", dSet2, true) );
147 
148  return psd;
149 }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
bool EcalUncalibRecHitWorkerRatio::run ( const edm::Event evt,
const EcalDigiCollection::const_iterator digi,
EcalUncalibratedRecHitCollection result 
)
virtual

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 48 of file EcalUncalibRecHitWorkerRatio.cc.

References 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_.

51 {
52  DetId detid(itdg->id());
53 
54  const EcalSampleMask *sampleMask_ = sampleMaskHand_.product();
55 
56  const EcalPedestals::Item * aped = 0;
57  const EcalMGPAGainRatio * aGain = 0;
58 
59  if (detid.subdetId()==EcalEndcap) {
60  unsigned int hashedIndex = EEDetId(detid).hashedIndex();
61  aped = &peds->endcap(hashedIndex);
62  aGain = &gains->endcap(hashedIndex);
63  } else {
64  unsigned int hashedIndex = EBDetId(detid).hashedIndex();
65  aped = &peds->barrel(hashedIndex);
66  aGain = &gains->barrel(hashedIndex);
67  }
68 
69  pedVec[0] = aped->mean_x12;
70  pedVec[1] = aped->mean_x6;
71  pedVec[2] = aped->mean_x1;
72  pedRMSVec[0] = aped->rms_x12;
73  pedRMSVec[1] = aped->rms_x6;
74  pedRMSVec[2] = aped->rms_x1;
75  gainRatios[0] = 1.;
76  gainRatios[1] = aGain->gain12Over6();
77  gainRatios[2] = aGain->gain6Over1()*aGain->gain12Over6();
78 
79  float clockToNsConstant = 25.;
80  EcalUncalibratedRecHit uncalibRecHit;
81 
82  if (detid.subdetId()==EcalEndcap) {
83 
84  uncalibRecHit =
88  EEtimeFitLimits_);//GF pass mask here
89 
92  uncalibRecHit.setAmplitude( crh.amplitudeMax );
93  uncalibRecHit.setJitter( crh.timeMax - 5 );
94  uncalibRecHit.setJitterError( std::sqrt(pow(crh.timeError,2) +
96  std::pow(clockToNsConstant,2)) );
97 
98  } else {
99 
100 
101  bool gainSwitch = uncalibMaker_barrel_.fixMGPAslew(*itdg);
102 
103  uncalibRecHit=
104  uncalibMaker_barrel_.makeRecHit(*itdg,*sampleMask_,pedVec,pedRMSVec,
107  EBtimeFitLimits_);//GF pass mask here
108 
109 
112 
113  uncalibRecHit.setAmplitude( crh.amplitudeMax );
114  if(gainSwitch){
115  // introduce additional 1ns shift
116  uncalibRecHit.setJitter( crh.timeMax - 5 - 0.04 );
117  }else{
118  uncalibRecHit.setJitter( crh.timeMax - 5);
119  }
120  uncalibRecHit.setJitterError( std::sqrt(pow(crh.timeError,2) +
122  std::pow(clockToNsConstant,2)) );
123 
124  }
125  result.push_back(uncalibRecHit);
126 
127  return true;
128 }
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:18
float gain6Over1() const
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:86
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 35 of file EcalUncalibRecHitWorkerRatio.cc.

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

36 {
37 
38  // which of the samples need be used
40 
41  es.get<EcalGainRatiosRcd>().get(gains);
42  es.get<EcalPedestalsRcd>().get(peds);
43 
44 }
edm::ESHandle< EcalPedestals > peds
edm::ESHandle< EcalGainRatios > gains
edm::ESHandle< EcalSampleMask > sampleMaskHand_
const T & get() const
Definition: EventSetup.h:56

Member Data Documentation

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

Definition at line 52 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

double EcalUncalibRecHitWorkerRatio::EBtimeConstantTerm_
protected

Definition at line 58 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

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

Definition at line 55 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

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

Definition at line 49 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

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

Definition at line 53 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

double EcalUncalibRecHitWorkerRatio::EEtimeConstantTerm_
protected

Definition at line 59 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

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

Definition at line 56 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

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

Definition at line 50 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by EcalUncalibRecHitWorkerRatio(), and run().

double EcalUncalibRecHitWorkerRatio::gainRatios[3]
protected

Definition at line 47 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

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

Definition at line 43 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run(), and set().

double EcalUncalibRecHitWorkerRatio::pedRMSVec[3]
protected

Definition at line 46 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

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

Definition at line 42 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run(), and set().

double EcalUncalibRecHitWorkerRatio::pedVec[3]
protected

Definition at line 45 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

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

Definition at line 40 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run(), and set().

EcalUncalibRecHitRatioMethodAlgo<EBDataFrame> EcalUncalibRecHitWorkerRatio::uncalibMaker_barrel_
protected

Definition at line 61 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().

EcalUncalibRecHitRatioMethodAlgo<EEDataFrame> EcalUncalibRecHitWorkerRatio::uncalibMaker_endcap_
protected

Definition at line 62 of file EcalUncalibRecHitWorkerRatio.h.

Referenced by run().