CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< EBDataFrame
algoEB_
 
EcalUncalibRecHitRecAnalFitAlgo
< EEDataFrame
algoEE_
 
edm::ESGetToken< EcalPedestals,
EcalPedestalsRcd
pedestalsToken_
 
edm::ESHandle< EcalPedestalspedHandle
 
edm::ESHandle< EcalGainRatiospRatio
 
edm::ESGetToken
< EcalGainRatios,
EcalGainRatiosRcd
ratiosToken_
 

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::EcalUncalibRecHitWorkerAnalFit ( const edm::ParameterSet ps,
edm::ConsumesCollector c 
)
EcalUncalibRecHitWorkerAnalFit::EcalUncalibRecHitWorkerAnalFit ( )
inline

Definition at line 33 of file EcalUncalibRecHitWorkerAnalFit.h.

33 {};
EcalUncalibRecHitWorkerAnalFit::~EcalUncalibRecHitWorkerAnalFit ( )
inlineoverride

Definition at line 34 of file EcalUncalibRecHitWorkerAnalFit.h.

34 {};

Member Function Documentation

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 }
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.

References algoEB_, algoEE_, EcalUncalibratedRecHit::amplitude(), EcalBarrel, LogDebug, EcalUncalibRecHitRecAnalFitAlgo< C >::makeRecHit(), pedHandle, pRatio, and edm::SortedCollection< T, SORT >::push_back().

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 }
void push_back(T const &t)
Log< level::Error, false > LogError
edm::ESHandle< EcalPedestals > pedHandle
EcalPedestalsMap::const_iterator EcalPedestalsMapIterator
Definition: EcalPedestals.h:49
EcalUncalibRecHitRecAnalFitAlgo< EBDataFrame > algoEB_
EcalUncalibRecHitRecAnalFitAlgo< EEDataFrame > algoEE_
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.
edm::ESHandle< EcalGainRatios > pRatio
#define LogDebug(id)
void EcalUncalibRecHitWorkerAnalFit::set ( const edm::EventSetup es)
overridevirtual

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 40 of file EcalUncalibRecHitWorkerAnalFit.cc.

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

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 }
edm::ESHandle< EcalPedestals > pedHandle
edm::ESGetToken< EcalGainRatios, EcalGainRatiosRcd > ratiosToken_
edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > pedestalsToken_
edm::ESHandle< EcalGainRatios > pRatio
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
#define LogDebug(id)

Member Data Documentation

EcalUncalibRecHitRecAnalFitAlgo<EBDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEB_
private

Definition at line 44 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

EcalUncalibRecHitRecAnalFitAlgo<EEDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEE_
private

Definition at line 45 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

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

Definition at line 50 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by set().

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

Definition at line 48 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().

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

Definition at line 47 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().

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

Definition at line 49 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by set().