CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EcalUncalibRecHitWorkerAnalFit Class Reference
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
 
- 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 35 of file EcalUncalibRecHitWorkerAnalFit.cc.

Constructor & Destructor Documentation

◆ EcalUncalibRecHitWorkerAnalFit() [1/2]

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

◆ EcalUncalibRecHitWorkerAnalFit() [2/2]

EcalUncalibRecHitWorkerAnalFit::EcalUncalibRecHitWorkerAnalFit ( )
inline

Definition at line 38 of file EcalUncalibRecHitWorkerAnalFit.cc.

38 {}

Member Function Documentation

◆ getAlgoDescription()

edm::ParameterSetDescription EcalUncalibRecHitWorkerAnalFit::getAlgoDescription ( )
overridevirtual

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 150 of file EcalUncalibRecHitWorkerAnalFit.cc.

150  {
152  //psd.addNode(edm::ParameterSet<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis","ebDigis")) and
153  // edm::ParameterSet<std::string>("EEhitCollection", "EcalUncalibRecHitsEE") and
154  // edm::ParameterSet<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis","eeDigis")) and
155  // edm::ParameterSet<std::string>("algo", "EcalUncalibRecHitWorkerAnalFit") and
156  // edm::ParameterSet<std::string>("EBhitCollection", "EcalUncalibRecHitsEB"));
157  //
158  return psd;
159 }

◆ run()

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

Implements EcalUncalibRecHitWorkerRunOneDigiBase.

Definition at line 74 of file EcalUncalibRecHitWorkerAnalFit.cc.

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

76  {
77  using namespace edm;
78 
79  const EcalGainRatioMap& gainMap = pRatio.product()->getMap(); // map of gain ratios
80  const EcalPedestalsMap& pedMap = pedHandle.product()->getMap(); // map of pedestals
81 
82  EcalPedestalsMapIterator pedIter; // pedestal iterator
83  EcalPedestals::Item aped; // pedestal object for a single xtal
84 
85  EcalGainRatioMap::const_iterator gainIter; // gain iterator
86  EcalMGPAGainRatio aGain; // gain object for a single xtal
87 
88  DetId detid(itdg->id());
89 
90  // find pedestals for this channel
91  //LogDebug("EcalUncalibRecHitDebug") << "looking up pedestal for crystal: " << itdg->id(); // FIXME
92  pedIter = pedMap.find(detid);
93  if (pedIter != pedMap.end()) {
94  aped = (*pedIter);
95  } else {
96  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "error!! could not find pedestals for channel: ";
97  if (detid.subdetId() == EcalBarrel) {
98  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EBDetId(detid);
99  } else {
100  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EEDetId(detid);
101  }
102  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "\n no uncalib rechit will be made for this digi!";
103  return false;
104  }
105  double pedVec[3];
106  pedVec[0] = aped.mean_x12;
107  pedVec[1] = aped.mean_x6;
108  pedVec[2] = aped.mean_x1;
109 
110  // find gain ratios
111  //LogDebug("EcalUncalibRecHitDebug") << "looking up gainRatios for crystal: " << itdg->id(); // FIXME
112  gainIter = gainMap.find(detid);
113  if (gainIter != gainMap.end()) {
114  aGain = (*gainIter);
115  } else {
116  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "error!! could not find gain ratios for channel: ";
117  if (detid.subdetId() == EcalBarrel) {
118  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EBDetId(detid);
119  } else {
120  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EEDetId(detid);
121  }
122  edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "\n no uncalib rechit will be made for this digi!";
123  return false;
124  }
125  double gainRatios[3];
126  gainRatios[0] = 1.;
127  gainRatios[1] = aGain.gain12Over6();
128  gainRatios[2] = aGain.gain6Over1() * aGain.gain12Over6();
129 
130  if (detid.subdetId() == EcalBarrel) {
131  EcalUncalibratedRecHit aHit = algoEB_.makeRecHit(*itdg, pedVec, gainRatios, nullptr, nullptr);
132  result.push_back(aHit);
133  if (aHit.amplitude() > 0.) {
134  LogDebug("EcalUncalibRecHitInfo") << "EcalUncalibRecHitWorkerAnalFit: processed EBDataFrame with id: "
135  << EBDetId(detid) << "\n"
136  << "uncalib rechit amplitude: " << aHit.amplitude();
137  }
138  } else {
139  EcalUncalibratedRecHit aHit = algoEE_.makeRecHit(*itdg, pedVec, gainRatios, nullptr, nullptr);
140  result.push_back(aHit);
141  if (aHit.amplitude() > 0.) {
142  LogDebug("EcalUncalibRecHitInfo") << "EcalUncalibRecHitWorkerAnalFit: processed EEDataFrame with id: "
143  << EEDetId(detid) << "\n"
144  << "uncalib rechit amplitude: " << aHit.amplitude();
145  }
146  }
147  return true;
148 }
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 62 of file EcalUncalibRecHitWorkerAnalFit.cc.

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

62  {
63  // Gain Ratios
64  LogDebug("EcalUncalibRecHitDebug") << "fetching gainRatios....";
66  LogDebug("EcalUncalibRecHitDebug") << "done.";
67 
68  // fetch the pedestals from the cond DB via EventSetup
69  LogDebug("EcalUncalibRecHitDebug") << "fetching pedestals....";
71  LogDebug("EcalUncalibRecHitDebug") << "done.";
72 }
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:130
edm::ESHandle< EcalGainRatios > pRatio
#define LogDebug(id)

Member Data Documentation

◆ algoEB_

EcalUncalibRecHitRecAnalFitAlgo<EBDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEB_
private

Definition at line 48 of file EcalUncalibRecHitWorkerAnalFit.cc.

Referenced by run().

◆ algoEE_

EcalUncalibRecHitRecAnalFitAlgo<EEDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEE_
private

Definition at line 49 of file EcalUncalibRecHitWorkerAnalFit.cc.

Referenced by run().

◆ pedestalsToken_

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

Definition at line 54 of file EcalUncalibRecHitWorkerAnalFit.cc.

Referenced by set().

◆ pedHandle

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

Definition at line 52 of file EcalUncalibRecHitWorkerAnalFit.cc.

Referenced by run(), and set().

◆ pRatio

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

Definition at line 51 of file EcalUncalibRecHitWorkerAnalFit.cc.

Referenced by run(), and set().

◆ ratiosToken_

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

Definition at line 53 of file EcalUncalibRecHitWorkerAnalFit.cc.

Referenced by set().