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 ()
 
 EcalUncalibRecHitWorkerAnalFit (const edm::ParameterSet &ps, edm::ConsumesCollector &c)
 
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 ()
 
 EcalUncalibRecHitWorkerRunOneDigiBase (const edm::ParameterSet &p)
 
 EcalUncalibRecHitWorkerRunOneDigiBase (const edm::ParameterSet &p, edm::ConsumesCollector &c)
 
void run (const edm::Event &evt, const EcalDigiCollection &digis, EcalUncalibratedRecHitCollection &result) override
 
 ~EcalUncalibRecHitWorkerRunOneDigiBase () override
 
- Public Member Functions inherited from EcalUncalibRecHitWorkerBaseClass
 EcalUncalibRecHitWorkerBaseClass ()
 
 EcalUncalibRecHitWorkerBaseClass (const edm::ParameterSet &)
 
 EcalUncalibRecHitWorkerBaseClass (const edm::ParameterSet &, edm::ConsumesCollector &c)
 
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 30 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 33 of file EcalUncalibRecHitWorkerAnalFit.h.

33 {};

◆ ~EcalUncalibRecHitWorkerAnalFit()

EcalUncalibRecHitWorkerAnalFit::~EcalUncalibRecHitWorkerAnalFit ( )
inlineoverride

Definition at line 34 of file EcalUncalibRecHitWorkerAnalFit.h.

34 {};

Member Function Documentation

◆ getAlgoDescription()

edm::ParameterSetDescription EcalUncalibRecHitWorkerAnalFit::getAlgoDescription ( )
overridevirtual

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 128 of file EcalUncalibRecHitWorkerAnalFit.cc.

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

◆ run()

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

Implements EcalUncalibRecHitWorkerRunOneDigiBase.

Definition at line 52 of file EcalUncalibRecHitWorkerAnalFit.cc.

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

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.

◆ set()

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

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 40 of file EcalUncalibRecHitWorkerAnalFit.cc.

40  {
41  // Gain Ratios
42  LogDebug("EcalUncalibRecHitDebug") << "fetching gainRatios....";
44  LogDebug("EcalUncalibRecHitDebug") << "done.";
45 
46  // fetch the pedestals from the cond DB via EventSetup
47  LogDebug("EcalUncalibRecHitDebug") << "fetching pedestals....";
49  LogDebug("EcalUncalibRecHitDebug") << "done.";
50 }

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

Member Data Documentation

◆ algoEB_

EcalUncalibRecHitRecAnalFitAlgo<EBDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEB_
private

Definition at line 44 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

◆ algoEE_

EcalUncalibRecHitRecAnalFitAlgo<EEDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEE_
private

Definition at line 45 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

◆ pedestalsToken_

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

Definition at line 50 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by set().

◆ pedHandle

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

Definition at line 48 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().

◆ pRatio

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

Definition at line 47 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().

◆ ratiosToken_

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

Definition at line 49 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by set().

EcalCondObjectContainer::end
const_iterator end() const
Definition: EcalCondObjectContainer.h:74
EcalUncalibratedRecHit::amplitude
float amplitude() const
Definition: EcalUncalibratedRecHit.h:28
EBDetId
Definition: EBDetId.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EcalUncalibRecHitRecAnalFitAlgo::makeRecHit
EcalUncalibratedRecHit makeRecHit(const C &dataFrame, const double *pedestals, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalWeightSet::EcalChi2WeightMatrix **chi2Matrix) override
Compute parameters.
Definition: EcalUncalibRecHitRecAnalFitAlgo.h:46
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
EcalUncalibRecHitWorkerAnalFit::pedestalsToken_
edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > pedestalsToken_
Definition: EcalUncalibRecHitWorkerAnalFit.h:50
EcalBarrel
Definition: EcalSubdetector.h:10
DetId
Definition: DetId.h:17
EcalUncalibRecHitWorkerAnalFit::pedHandle
edm::ESHandle< EcalPedestals > pedHandle
Definition: EcalUncalibRecHitWorkerAnalFit.h:48
EcalCondObjectContainer::find
const_iterator find(uint32_t rawId) const
Definition: EcalCondObjectContainer.h:53
EcalMGPAGainRatio::gain12Over6
float gain12Over6() const
Definition: EcalMGPAGainRatio.h:19
EEDetId
Definition: EEDetId.h:14
EcalGainRatiosRcd
Definition: EcalGainRatiosRcd.h:5
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
EcalCondObjectContainer::Item
T Item
Definition: EcalCondObjectContainer.h:15
EcalUncalibRecHitWorkerAnalFit::pRatio
edm::ESHandle< EcalGainRatios > pRatio
Definition: EcalUncalibRecHitWorkerAnalFit.h:47
EcalPedestalsMapIterator
EcalPedestalsMap::const_iterator EcalPedestalsMapIterator
Definition: EcalPedestals.h:49
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
EcalUncalibRecHitWorkerRunOneDigiBase::EcalUncalibRecHitWorkerRunOneDigiBase
EcalUncalibRecHitWorkerRunOneDigiBase()
Definition: EcalUncalibRecHitWorkerRunOneDigiBase.h:15
EcalUncalibRecHitWorkerAnalFit::algoEE_
EcalUncalibRecHitRecAnalFitAlgo< EEDataFrame > algoEE_
Definition: EcalUncalibRecHitWorkerAnalFit.h:45
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
EcalUncalibratedRecHit
Definition: EcalUncalibratedRecHit.h:8
EcalMGPAGainRatio::gain6Over1
float gain6Over1() const
Definition: EcalMGPAGainRatio.h:20
EcalUncalibRecHitWorkerAnalFit::ratiosToken_
edm::ESGetToken< EcalGainRatios, EcalGainRatiosRcd > ratiosToken_
Definition: EcalUncalibRecHitWorkerAnalFit.h:49
EcalCondObjectContainer::const_iterator
std::vector< Item >::const_iterator const_iterator
Definition: EcalCondObjectContainer.h:19
mps_fire.result
result
Definition: mps_fire.py:311
EcalPedestalsRcd
Definition: EcalPedestalsRcd.h:5
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
EcalUncalibRecHitWorkerAnalFit::algoEB_
EcalUncalibRecHitRecAnalFitAlgo< EBDataFrame > algoEB_
Definition: EcalUncalibRecHitWorkerAnalFit.h:44
EcalMGPAGainRatio
Definition: EcalMGPAGainRatio.h:13