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::ESHandle< EcalPedestalspedHandle
 
edm::ESHandle< EcalGainRatiospRatio
 

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 27 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 30 of file EcalUncalibRecHitWorkerAnalFit.h.

30 {};

◆ ~EcalUncalibRecHitWorkerAnalFit()

EcalUncalibRecHitWorkerAnalFit::~EcalUncalibRecHitWorkerAnalFit ( )
inlineoverride

Definition at line 31 of file EcalUncalibRecHitWorkerAnalFit.h.

31 {};

Member Function Documentation

◆ getAlgoDescription()

edm::ParameterSetDescription EcalUncalibRecHitWorkerAnalFit::getAlgoDescription ( )
overridevirtual

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 131 of file EcalUncalibRecHitWorkerAnalFit.cc.

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

◆ run()

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

Implements EcalUncalibRecHitWorkerRunOneDigiBase.

Definition at line 55 of file EcalUncalibRecHitWorkerAnalFit.cc.

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

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

◆ set()

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

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 43 of file EcalUncalibRecHitWorkerAnalFit.cc.

43  {
44  // Gain Ratios
45  LogDebug("EcalUncalibRecHitDebug") << "fetching gainRatios....";
47  LogDebug("EcalUncalibRecHitDebug") << "done.";
48 
49  // fetch the pedestals from the cond DB via EventSetup
50  LogDebug("EcalUncalibRecHitDebug") << "fetching pedestals....";
52  LogDebug("EcalUncalibRecHitDebug") << "done.";
53 }

References edm::EventSetup::get(), get, LogDebug, pedHandle, and pRatio.

Member Data Documentation

◆ algoEB_

EcalUncalibRecHitRecAnalFitAlgo<EBDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEB_
private

Definition at line 41 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

◆ algoEE_

EcalUncalibRecHitRecAnalFitAlgo<EEDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEE_
private

Definition at line 42 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

◆ pedHandle

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

Definition at line 45 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().

◆ pRatio

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

Definition at line 44 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().

EcalCondObjectContainer::end
const_iterator end() const
Definition: EcalCondObjectContainer.h:76
EcalPedestal::mean_x6
float mean_x6
Definition: EcalPedestals.h:21
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< EcalMGPAGainRatio >
EcalBarrel
Definition: EcalSubdetector.h:10
EcalPedestal::mean_x1
float mean_x1
Definition: EcalPedestals.h:23
DetId
Definition: DetId.h:17
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
EcalPedestal::mean_x12
float mean_x12
Definition: EcalPedestals.h:19
EcalUncalibRecHitWorkerAnalFit::pedHandle
edm::ESHandle< EcalPedestals > pedHandle
Definition: EcalUncalibRecHitWorkerAnalFit.h:45
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:670
edm::LogError
Definition: MessageLogger.h:183
EcalUncalibRecHitWorkerAnalFit::pRatio
edm::ESHandle< EcalGainRatios > pRatio
Definition: EcalUncalibRecHitWorkerAnalFit.h:44
EcalPedestalsMapIterator
EcalPedestalsMap::const_iterator EcalPedestalsMapIterator
Definition: EcalPedestals.h:49
EcalUncalibRecHitWorkerRunOneDigiBase::EcalUncalibRecHitWorkerRunOneDigiBase
EcalUncalibRecHitWorkerRunOneDigiBase()
Definition: EcalUncalibRecHitWorkerRunOneDigiBase.h:15
EcalUncalibRecHitWorkerAnalFit::algoEE_
EcalUncalibRecHitRecAnalFitAlgo< EEDataFrame > algoEE_
Definition: EcalUncalibRecHitWorkerAnalFit.h:42
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
EcalUncalibratedRecHit
Definition: EcalUncalibratedRecHit.h:8
EcalMGPAGainRatio::gain6Over1
float gain6Over1() const
Definition: EcalMGPAGainRatio.h:20
EcalPedestal
Definition: EcalPedestals.h:8
EcalCondObjectContainer< EcalMGPAGainRatio >::const_iterator
std::vector< Item >::const_iterator const_iterator
Definition: EcalCondObjectContainer.h:19
mps_fire.result
result
Definition: mps_fire.py:303
EcalPedestalsRcd
Definition: EcalPedestalsRcd.h:5
EcalUncalibRecHitWorkerAnalFit::algoEB_
EcalUncalibRecHitRecAnalFitAlgo< EBDataFrame > algoEB_
Definition: EcalUncalibRecHitWorkerAnalFit.h:41
EcalMGPAGainRatio
Definition: EcalMGPAGainRatio.h:13