CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EcalUncalibRecHitWorkerAnalFit Class Reference

#include <EcalUncalibRecHitWorkerAnalFit.h>

Inheritance diagram for EcalUncalibRecHitWorkerAnalFit:
EcalUncalibRecHitWorkerRunOneDigiBase EcalUncalibRecHitWorkerBaseClass

Public Member Functions

 EcalUncalibRecHitWorkerAnalFit (const edm::ParameterSet &ps, edm::ConsumesCollector &c)
 
 EcalUncalibRecHitWorkerAnalFit ()
 
edm::ParameterSetDescription getAlgoDescription () override
 
bool run (const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result) override
 
void set (const edm::EventSetup &es) override
 
 ~EcalUncalibRecHitWorkerAnalFit () override
 
- Public Member Functions inherited from EcalUncalibRecHitWorkerRunOneDigiBase
 EcalUncalibRecHitWorkerRunOneDigiBase (const edm::ParameterSet &p, edm::ConsumesCollector &c)
 
 EcalUncalibRecHitWorkerRunOneDigiBase (const edm::ParameterSet &p)
 
 EcalUncalibRecHitWorkerRunOneDigiBase ()
 
void run (const edm::Event &evt, const EcalDigiCollection &digis, EcalUncalibratedRecHitCollection &result) override
 
 ~EcalUncalibRecHitWorkerRunOneDigiBase () override
 
- 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 ()
 

Private Attributes

EcalUncalibRecHitRecAnalFitAlgo< EBDataFramealgoEB_
 
EcalUncalibRecHitRecAnalFitAlgo< EEDataFramealgoEE_
 
edm::ESGetToken< EcalPedestals, EcalPedestalsRcdpedestalsToken_
 
edm::ESHandle< EcalPedestalspedHandle
 
edm::ESHandle< EcalGainRatiospRatio
 
edm::ESGetToken< EcalGainRatios, EcalGainRatiosRcdratiosToken_
 

Detailed Description

produce ECAL uncalibrated rechits from dataframes with the analytical fit method

Author
Shahram Rahatlou, University of Rome & INFN, Sept 2005

Definition at line 29 of file EcalUncalibRecHitWorkerAnalFit.h.

Constructor & Destructor Documentation

◆ EcalUncalibRecHitWorkerAnalFit() [1/2]

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

◆ EcalUncalibRecHitWorkerAnalFit() [2/2]

EcalUncalibRecHitWorkerAnalFit::EcalUncalibRecHitWorkerAnalFit ( )
inline

Definition at line 32 of file EcalUncalibRecHitWorkerAnalFit.h.

32 {};

◆ ~EcalUncalibRecHitWorkerAnalFit()

EcalUncalibRecHitWorkerAnalFit::~EcalUncalibRecHitWorkerAnalFit ( )
inlineoverride

Definition at line 33 of file EcalUncalibRecHitWorkerAnalFit.h.

33 {};

Member Function Documentation

◆ getAlgoDescription()

edm::ParameterSetDescription EcalUncalibRecHitWorkerAnalFit::getAlgoDescription ( )
overridevirtual

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 126 of file EcalUncalibRecHitWorkerAnalFit.cc.

126  {
128  //psd.addNode(edm::ParameterSet<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis","ebDigis")) and
129  // edm::ParameterSet<std::string>("EEhitCollection", "EcalUncalibRecHitsEE") and
130  // edm::ParameterSet<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis","eeDigis")) and
131  // edm::ParameterSet<std::string>("algo", "EcalUncalibRecHitWorkerAnalFit") and
132  // edm::ParameterSet<std::string>("EBhitCollection", "EcalUncalibRecHitsEB"));
133  //
134  return psd;
135 }

◆ run()

bool EcalUncalibRecHitWorkerAnalFit::run ( const edm::Event evt,
const EcalDigiCollection::const_iterator digi,
EcalUncalibratedRecHitCollection result 
)
overridevirtual

Implements EcalUncalibRecHitWorkerRunOneDigiBase.

Definition at line 50 of file EcalUncalibRecHitWorkerAnalFit.cc.

References algoEB_, algoEE_, EcalUncalibratedRecHit::amplitude(), EcalBarrel, EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), EcalMGPAGainRatio::gain12Over6(), EcalMGPAGainRatio::gain6Over1(), LogDebug, EcalUncalibRecHitRecAnalFitAlgo< C >::makeRecHit(), pedHandle, pRatio, and mps_fire::result.

52  {
53  using namespace edm;
54 
55  const EcalGainRatioMap& gainMap = pRatio.product()->getMap(); // map of gain ratios
56  const EcalPedestalsMap& pedMap = pedHandle.product()->getMap(); // map of pedestals
57 
58  EcalPedestalsMapIterator pedIter; // pedestal iterator
59  EcalPedestals::Item aped; // pedestal object for a single xtal
60 
61  EcalGainRatioMap::const_iterator gainIter; // gain iterator
62  EcalMGPAGainRatio aGain; // gain object for a single xtal
63 
64  DetId detid(itdg->id());
65 
66  // find pedestals for this channel
67  //LogDebug("EcalUncalibRecHitDebug") << "looking up pedestal for crystal: " << itdg->id(); // FIXME
68  pedIter = pedMap.find(detid);
69  if (pedIter != pedMap.end()) {
70  aped = (*pedIter);
71  } else {
72  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "error!! could not find pedestals for channel: ";
73  if (detid.subdetId() == EcalBarrel) {
74  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EBDetId(detid);
75  } else {
76  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EEDetId(detid);
77  }
78  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "\n no uncalib rechit will be made for this digi!";
79  return false;
80  }
81  double pedVec[3];
82  pedVec[0] = aped.mean_x12;
83  pedVec[1] = aped.mean_x6;
84  pedVec[2] = aped.mean_x1;
85 
86  // find gain ratios
87  //LogDebug("EcalUncalibRecHitDebug") << "looking up gainRatios for crystal: " << itdg->id(); // FIXME
88  gainIter = gainMap.find(detid);
89  if (gainIter != gainMap.end()) {
90  aGain = (*gainIter);
91  } else {
92  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "error!! could not find gain ratios for channel: ";
93  if (detid.subdetId() == EcalBarrel) {
94  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EBDetId(detid);
95  } else {
96  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EEDetId(detid);
97  }
98  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "\n no uncalib rechit will be made for this digi!";
99  return false;
100  }
101  double gainRatios[3];
102  gainRatios[0] = 1.;
103  gainRatios[1] = aGain.gain12Over6();
104  gainRatios[2] = aGain.gain6Over1() * aGain.gain12Over6();
105 
106  if (detid.subdetId() == EcalBarrel) {
107  EcalUncalibratedRecHit aHit = algoEB_.makeRecHit(*itdg, pedVec, gainRatios, nullptr, nullptr);
108  result.push_back(aHit);
109  if (aHit.amplitude() > 0.) {
110  LogDebug("EcalUncalibRecHitInfo") << "EcalUncalibRecHitWorkerAnalFit: processed EBDataFrame with id: "
111  << EBDetId(detid) << "\n"
112  << "uncalib rechit amplitude: " << aHit.amplitude();
113  }
114  } else {
115  EcalUncalibratedRecHit aHit = algoEE_.makeRecHit(*itdg, pedVec, gainRatios, nullptr, nullptr);
116  result.push_back(aHit);
117  if (aHit.amplitude() > 0.) {
118  LogDebug("EcalUncalibRecHitInfo") << "EcalUncalibRecHitWorkerAnalFit: processed EEDataFrame with id: "
119  << EEDetId(detid) << "\n"
120  << "uncalib rechit amplitude: " << aHit.amplitude();
121  }
122  }
123  return true;
124 }
Log< level::Error, false > LogError
edm::ESHandle< EcalPedestals > pedHandle
EcalPedestalsMap::const_iterator EcalPedestalsMapIterator
Definition: EcalPedestals.h:49
EcalUncalibRecHitRecAnalFitAlgo< EBDataFrame > algoEB_
EcalUncalibRecHitRecAnalFitAlgo< EEDataFrame > algoEE_
const_iterator find(uint32_t rawId) const
float gain12Over6() const
Definition: DetId.h:17
std::vector< Item >::const_iterator const_iterator
EcalUncalibratedRecHit makeRecHit(const C &dataFrame, const double *pedestals, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalWeightSet::EcalChi2WeightMatrix **chi2Matrix) override
Compute parameters.
float gain6Over1() const
edm::ESHandle< EcalGainRatios > pRatio
HLT enums.
const_iterator end() const
#define LogDebug(id)

◆ set()

void EcalUncalibRecHitWorkerAnalFit::set ( const edm::EventSetup es)
overridevirtual

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 38 of file EcalUncalibRecHitWorkerAnalFit.cc.

References edm::EventSetup::getHandle(), LogDebug, pedestalsToken_, pedHandle, pRatio, and ratiosToken_.

38  {
39  // Gain Ratios
40  LogDebug("EcalUncalibRecHitDebug") << "fetching gainRatios....";
42  LogDebug("EcalUncalibRecHitDebug") << "done.";
43 
44  // fetch the pedestals from the cond DB via EventSetup
45  LogDebug("EcalUncalibRecHitDebug") << "fetching pedestals....";
47  LogDebug("EcalUncalibRecHitDebug") << "done.";
48 }
edm::ESHandle< EcalPedestals > pedHandle
edm::ESGetToken< EcalGainRatios, EcalGainRatiosRcd > ratiosToken_
edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > pedestalsToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
edm::ESHandle< EcalGainRatios > pRatio
#define LogDebug(id)

Member Data Documentation

◆ algoEB_

EcalUncalibRecHitRecAnalFitAlgo<EBDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEB_
private

Definition at line 43 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

◆ algoEE_

EcalUncalibRecHitRecAnalFitAlgo<EEDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEE_
private

Definition at line 44 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

◆ pedestalsToken_

edm::ESGetToken<EcalPedestals, EcalPedestalsRcd> EcalUncalibRecHitWorkerAnalFit::pedestalsToken_
private

Definition at line 49 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by set().

◆ pedHandle

edm::ESHandle<EcalPedestals> EcalUncalibRecHitWorkerAnalFit::pedHandle
private

Definition at line 47 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().

◆ pRatio

edm::ESHandle<EcalGainRatios> EcalUncalibRecHitWorkerAnalFit::pRatio
private

Definition at line 46 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().

◆ ratiosToken_

edm::ESGetToken<EcalGainRatios, EcalGainRatiosRcd> EcalUncalibRecHitWorkerAnalFit::ratiosToken_
private

Definition at line 48 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by set().