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
EcalUncalibRecHitWorkerWeightsOld Class Reference

#include <EcalUncalibRecHitWorkerWeightsOld.h>

Inheritance diagram for EcalUncalibRecHitWorkerWeightsOld:
EcalUncalibRecHitWorkerBaseClass

Public Member Functions

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

Protected Attributes

const
EcalWeightSet::EcalChi2WeightMatrix
chi2mat [2]
 
double gainRatios [3]
 
edm::ESHandle< EcalGainRatiosgains
 
edm::ESHandle
< EcalWeightXtalGroups
grps
 
double pedRMSVec [3]
 
edm::ESHandle< EcalPedestalspeds
 
double pedVec [3]
 
const EBShape testbeamEBShape
 
const EEShape testbeamEEShape
 
EcalUncalibRecHitRecWeightsAlgo
< EBDataFrame
uncalibMaker_barrel_
 
EcalUncalibRecHitRecWeightsAlgo
< EEDataFrame
uncalibMaker_endcap_
 
const
EcalWeightSet::EcalWeightMatrix
weights [2]
 
edm::ESHandle< EcalTBWeightswgts
 

Detailed Description

Definition at line 36 of file EcalUncalibRecHitWorkerWeightsOld.h.

Constructor & Destructor Documentation

EcalUncalibRecHitWorkerWeightsOld::EcalUncalibRecHitWorkerWeightsOld ( const edm::ParameterSet ps)

Definition at line 12 of file EcalUncalibRecHitWorkerWeightsOld.cc.

12  :
14 {
15 }
EcalUncalibRecHitWorkerBaseClass(const edm::ParameterSet &, edm::ConsumesCollector &c)
virtual EcalUncalibRecHitWorkerWeightsOld::~EcalUncalibRecHitWorkerWeightsOld ( )
inlinevirtual

Definition at line 40 of file EcalUncalibRecHitWorkerWeightsOld.h.

40 {};

Member Function Documentation

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

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 28 of file EcalUncalibRecHitWorkerWeightsOld.cc.

References cond::rpcobgas::detid, EcalEndcap, EcalMGPAGainRatio::gain12Over6(), EcalMGPAGainRatio::gain6Over1(), gainRatios, gains, EcalWeightSet::getWeightsAfterGainSwitch(), EcalWeightSet::getWeightsBeforeGainSwitch(), grps, ecalpyutils::hashedIndex(), EBDetId::hashedIndex(), EEDetId::hashedIndex(), EcalXtalGroupId::id(), EcalUncalibRecHitRecWeightsAlgo< C >::makeRecHit(), pedRMSVec, peds, pedVec, edm::SortedCollection< T, SORT >::push_back(), testbeamEBShape, testbeamEEShape, uncalibMaker_barrel_, uncalibMaker_endcap_, weights, and wgts.

31 {
32  DetId detid(itdg->id());
33 
34  const EcalPedestals::Item * aped = 0;
35  const EcalMGPAGainRatio * aGain = 0;
36  const EcalXtalGroupId * gid = 0;
37  EcalTBWeights::EcalTDCId tdcid(1);
38 
39  if (detid.subdetId()==EcalEndcap) {
40  unsigned int hashedIndex = EEDetId(detid).hashedIndex();
41  aped = &peds->endcap(hashedIndex);
42  aGain = &gains->endcap(hashedIndex);
43  gid = &grps->endcap(hashedIndex);
44  } else {
45  unsigned int hashedIndex = EBDetId(detid).hashedIndex();
46  aped = &peds->barrel(hashedIndex);
47  aGain = &gains->barrel(hashedIndex);
48  gid = &grps->barrel(hashedIndex);
49  }
50 
51  pedVec[0] = aped->mean_x12;
52  pedVec[1] = aped->mean_x6;
53  pedVec[2] = aped->mean_x1;
54  pedRMSVec[0] = aped->rms_x12;
55  pedRMSVec[1] = aped->rms_x6;
56  pedRMSVec[2] = aped->rms_x1;
57  gainRatios[0] = 1.;
58  gainRatios[1] = aGain->gain12Over6();
59  gainRatios[2] = aGain->gain6Over1()*aGain->gain12Over6();
60 
61  // now lookup the correct weights in the map
62  EcalTBWeights::EcalTBWeightMap const & wgtsMap = wgts->getMap();
63  EcalTBWeights::EcalTBWeightMap::const_iterator wit;
64  wit = wgtsMap.find( std::make_pair(*gid,tdcid) );
65  if( wit == wgtsMap.end() ) {
66  edm::LogError("EcalUncalibRecHitError") << "No weights found for EcalGroupId: "
67  << gid->id() << " and EcalTDCId: " << tdcid
68  << "\n skipping digi with id: " << detid.rawId();
69 
70  return false;
71  }
72  const EcalWeightSet& wset = wit->second; // this is the EcalWeightSet
73 
76 // const EcalWeightSet::EcalChi2WeightMatrix& mat3 = wset.getChi2WeightsBeforeGainSwitch();
77 // const EcalWeightSet::EcalChi2WeightMatrix& mat4 = wset.getChi2WeightsAfterGainSwitch();
78 
79  weights[0] = &mat1;
80  weights[1] = &mat2;
81 
82 // chi2mat[0] = &mat3;
83 // chi2mat[1] = &mat4;
84 /*
85  if (detid.subdetId()==EcalEndcap) {
86  result.push_back(uncalibMaker_endcap_.makeRecHit(*itdg, pedVec, gainRatios, weights, chi2mat));
87  } else {
88  result.push_back(uncalibMaker_barrel_.makeRecHit(*itdg, pedVec, gainRatios, weights, chi2mat));
89  }
90 */
91  if (detid.subdetId()==EcalEndcap) {
93  } else {
95  }
96  return true;
97 }
std::map< std::pair< EcalXtalGroupId, EcalTDCId >, EcalWeightSet > EcalTBWeightMap
Definition: EcalTBWeights.h:19
int hashedIndex() const
get a compact index for arrays
Definition: EBDetId.h:86
edm::ESHandle< EcalWeightXtalGroups > grps
const EcalWeightSet::EcalWeightMatrix * weights[2]
void push_back(T const &t)
const unsigned int id() const
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:42
EcalUncalibRecHitRecWeightsAlgo< EEDataFrame > uncalibMaker_endcap_
virtual EcalUncalibratedRecHit makeRecHit(const C &dataFrame, const double *pedestals, const double *pedestalsRMS, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalShapeBase &testbeamPulseShape)
Compute parameters.
float gain6Over1() const
EcalWeightMatrix & getWeightsAfterGainSwitch()
Definition: EcalWeightSet.h:28
Definition: DetId.h:18
int hashedIndex() const
Definition: EEDetId.h:182
EcalWeightMatrix & getWeightsBeforeGainSwitch()
Definition: EcalWeightSet.h:27
float gain12Over6() const
EcalUncalibRecHitRecWeightsAlgo< EBDataFrame > uncalibMaker_barrel_
math::Matrix< 3, 10 >::type EcalWeightMatrix
Definition: EcalWeightSet.h:20
void EcalUncalibRecHitWorkerWeightsOld::set ( const edm::EventSetup es)
virtual

Member Data Documentation

const EcalWeightSet::EcalChi2WeightMatrix* EcalUncalibRecHitWorkerWeightsOld::chi2mat[2]
protected

Definition at line 57 of file EcalUncalibRecHitWorkerWeightsOld.h.

double EcalUncalibRecHitWorkerWeightsOld::gainRatios[3]
protected

Definition at line 54 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run().

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

Definition at line 48 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run(), and set().

edm::ESHandle<EcalWeightXtalGroups> EcalUncalibRecHitWorkerWeightsOld::grps
protected

Definition at line 49 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run(), and set().

double EcalUncalibRecHitWorkerWeightsOld::pedRMSVec[3]
protected

Definition at line 53 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run().

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

Definition at line 47 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run(), and set().

double EcalUncalibRecHitWorkerWeightsOld::pedVec[3]
protected

Definition at line 52 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run().

const EBShape EcalUncalibRecHitWorkerWeightsOld::testbeamEBShape
protected

Definition at line 63 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run().

const EEShape EcalUncalibRecHitWorkerWeightsOld::testbeamEEShape
protected

Definition at line 62 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run().

EcalUncalibRecHitRecWeightsAlgo<EBDataFrame> EcalUncalibRecHitWorkerWeightsOld::uncalibMaker_barrel_
protected

Definition at line 59 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run().

EcalUncalibRecHitRecWeightsAlgo<EEDataFrame> EcalUncalibRecHitWorkerWeightsOld::uncalibMaker_endcap_
protected

Definition at line 60 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run().

const EcalWeightSet::EcalWeightMatrix* EcalUncalibRecHitWorkerWeightsOld::weights[2]
protected

Definition at line 56 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run().

edm::ESHandle<EcalTBWeights> EcalUncalibRecHitWorkerWeightsOld::wgts
protected

Definition at line 50 of file EcalUncalibRecHitWorkerWeightsOld.h.

Referenced by run(), and set().