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

Definition at line 31 of file EcalUncalibRecHitWorkerAnalFit.h.

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

Definition at line 32 of file EcalUncalibRecHitWorkerAnalFit.h.

References mps_fire::result, and findQualityFiles::run.

32 {};

Member Function Documentation

edm::ParameterSetDescription EcalUncalibRecHitWorkerAnalFit::getAlgoDescription ( )
overridevirtual

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 141 of file EcalUncalibRecHitWorkerAnalFit.cc.

References DEFINE_EDM_PLUGIN.

141  {
142 
144 //psd.addNode(edm::ParameterSet<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis","ebDigis")) and
145 // edm::ParameterSet<std::string>("EEhitCollection", "EcalUncalibRecHitsEE") and
146 // edm::ParameterSet<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis","eeDigis")) and
147 // edm::ParameterSet<std::string>("algo", "EcalUncalibRecHitWorkerAnalFit") and
148 // edm::ParameterSet<std::string>("EBhitCollection", "EcalUncalibRecHitsEB"));
149 //
150  return psd;
151 }
bool EcalUncalibRecHitWorkerAnalFit::run ( const edm::Event evt,
const EcalDigiCollection::const_iterator digi,
EcalUncalibratedRecHitCollection result 
)
overridevirtual

Implements EcalUncalibRecHitWorkerRunOneDigiBase.

Definition at line 62 of file EcalUncalibRecHitWorkerAnalFit.cc.

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 edm::SortedCollection< T, SORT >::push_back().

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

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 48 of file EcalUncalibRecHitWorkerAnalFit.cc.

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

49 {
50  // Gain Ratios
51  LogDebug("EcalUncalibRecHitDebug") << "fetching gainRatios....";
52  es.get<EcalGainRatiosRcd>().get(pRatio);
53  LogDebug("EcalUncalibRecHitDebug") << "done." ;
54 
55  // fetch the pedestals from the cond DB via EventSetup
56  LogDebug("EcalUncalibRecHitDebug") << "fetching pedestals....";
57  es.get<EcalPedestalsRcd>().get( pedHandle );
58  LogDebug("EcalUncalibRecHitDebug") << "done." ;
59 }
#define LogDebug(id)
edm::ESHandle< EcalPedestals > pedHandle
edm::ESHandle< EcalGainRatios > pRatio
T get() const
Definition: EventSetup.h:63

Member Data Documentation

EcalUncalibRecHitRecAnalFitAlgo<EBDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEB_
private

Definition at line 40 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

EcalUncalibRecHitRecAnalFitAlgo<EEDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEE_
private

Definition at line 41 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

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

Definition at line 45 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().

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

Definition at line 44 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().