CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EcalUncalibRecHitWorkerAnalFit Class Reference

#include <EcalUncalibRecHitWorkerAnalFit.h>

Inheritance diagram for EcalUncalibRecHitWorkerAnalFit:
EcalUncalibRecHitWorkerBaseClass

Public Member Functions

 EcalUncalibRecHitWorkerAnalFit (const edm::ParameterSet &ps)
 
bool run (const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result)
 
void set (const edm::EventSetup &es)
 
 ~EcalUncalibRecHitWorkerAnalFit ()
 
- Public Member Functions inherited from EcalUncalibRecHitWorkerBaseClass
 EcalUncalibRecHitWorkerBaseClass (const edm::ParameterSet &)
 
virtual ~EcalUncalibRecHitWorkerBaseClass ()
 

Private Attributes

EcalUncalibRecHitRecAnalFitAlgo
< EBDataFrame
algoEB_
 
EcalUncalibRecHitRecAnalFitAlgo
< EEDataFrame
algoEE_
 
edm::ESHandle< EcalPedestalspedHandle
 
edm::ESHandle< EcalGainRatiospRatio
 

Detailed Description

produce ECAL uncalibrated rechits from dataframes with the analytical fit method

Id:
EcalUncalibRecHitWorkerAnalFit.cc,v 1.1 2008/12/10 01:52:42 ferriff Exp
Date:
2008/12/10 01:52:42
Revision:
1.1
Author
Shahram Rahatlou, University of Rome & INFN, Sept 2005

Definition at line 26 of file EcalUncalibRecHitWorkerAnalFit.h.

Constructor & Destructor Documentation

EcalUncalibRecHitWorkerAnalFit::EcalUncalibRecHitWorkerAnalFit ( const edm::ParameterSet ps)

Definition at line 40 of file EcalUncalibRecHitWorkerAnalFit.cc.

40  :
42 {
43 }
EcalUncalibRecHitWorkerBaseClass(const edm::ParameterSet &)
EcalUncalibRecHitWorkerAnalFit::~EcalUncalibRecHitWorkerAnalFit ( )
inline

Definition at line 30 of file EcalUncalibRecHitWorkerAnalFit.h.

30 {};

Member Function Documentation

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

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 61 of file EcalUncalibRecHitWorkerAnalFit.cc.

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

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

Implements EcalUncalibRecHitWorkerBaseClass.

Definition at line 47 of file EcalUncalibRecHitWorkerAnalFit.cc.

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

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

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

Member Data Documentation

EcalUncalibRecHitRecAnalFitAlgo<EBDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEB_
private

Definition at line 36 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

EcalUncalibRecHitRecAnalFitAlgo<EEDataFrame> EcalUncalibRecHitWorkerAnalFit::algoEE_
private

Definition at line 37 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run().

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

Definition at line 41 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().

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

Definition at line 40 of file EcalUncalibRecHitWorkerAnalFit.h.

Referenced by run(), and set().