CMS 3D CMS Logo

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

#include <EcalRecHitWorkerSimpleOld.h>

Inheritance diagram for EcalRecHitWorkerSimpleOld:
EcalRecHitWorkerBaseClass

Public Member Functions

 EcalRecHitWorkerSimpleOld (const edm::ParameterSet &, edm::ConsumesCollector &c)
 
 EcalRecHitWorkerSimpleOld (const edm::ParameterSet &)
 
bool run (const edm::Event &evt, const EcalUncalibratedRecHit &uncalibRH, EcalRecHitCollection &result)
 
void set (const edm::EventSetup &es)
 
virtual ~EcalRecHitWorkerSimpleOld ()
 
- Public Member Functions inherited from EcalRecHitWorkerBaseClass
 EcalRecHitWorkerBaseClass (const edm::ParameterSet &, edm::ConsumesCollector &c)
 
 EcalRecHitWorkerBaseClass (const edm::ParameterSet &)
 
virtual ~EcalRecHitWorkerBaseClass ()
 

Protected Attributes

edm::ESHandle
< EcalADCToGeVConstant
agc
 
edm::ESHandle< EcalChannelStatuschStatus
 
double EBLaserMAX_
 
double EBLaserMIN_
 
double EELaserMAX_
 
double EELaserMIN_
 
edm::ESHandle
< EcalIntercalibConstants
ical
 
edm::ESHandle
< EcalTimeCalibConstants
itime
 
bool killDeadChannels_
 
edm::ESHandle< EcalLaserDbServicelaser
 
bool laserCorrection_
 
edm::ESHandle
< EcalTimeOffsetConstant
offtime
 
EcalRecHitSimpleAlgorechitMaker_
 
std::vector< int > v_chstatus_
 
std::vector< int > v_DB_reco_flags_
 

Additional Inherited Members

- Public Types inherited from EcalRecHitWorkerBaseClass
enum  RecoveryFlags {
  EB_single, EE_single, EB_VFE, EE_VFE,
  EB_FE, EE_FE
}
 

Detailed Description

Definition at line 23 of file EcalRecHitWorkerSimpleOld.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file EcalRecHitWorkerSimpleOld.cc.

References EBLaserMAX_, EBLaserMIN_, EELaserMAX_, EELaserMIN_, edm::ParameterSet::getParameter(), killDeadChannels_, laserCorrection_, rechitMaker_, v_chstatus_, and v_DB_reco_flags_.

17  :
19 {
21  v_chstatus_ = ps.getParameter<std::vector<int> >("ChannelStatusToBeExcluded");
22  v_DB_reco_flags_ = ps.getParameter<std::vector<int> >("flagsMapDBReco");
23  killDeadChannels_ = ps.getParameter<bool>("killDeadChannels");
24  laserCorrection_ = ps.getParameter<bool>("laserCorrection");
25  EBLaserMIN_ = ps.getParameter<double>("EBLaserMIN");
26  EELaserMIN_ = ps.getParameter<double>("EELaserMIN");
27  EBLaserMAX_ = ps.getParameter<double>("EBLaserMAX");
28  EELaserMAX_ = ps.getParameter<double>("EELaserMAX");
29 
30 }
T getParameter(std::string const &) const
EcalRecHitSimpleAlgo * rechitMaker_
EcalRecHitWorkerBaseClass(const edm::ParameterSet &, edm::ConsumesCollector &c)
EcalRecHitWorkerSimpleOld::~EcalRecHitWorkerSimpleOld ( )
virtual

Definition at line 131 of file EcalRecHitWorkerSimpleOld.cc.

References rechitMaker_.

131  {
132 
133  delete rechitMaker_;
134 }
EcalRecHitSimpleAlgo * rechitMaker_

Member Function Documentation

bool EcalRecHitWorkerSimpleOld::run ( const edm::Event evt,
const EcalUncalibratedRecHit uncalibRH,
EcalRecHitCollection result 
)
virtual

Implements EcalRecHitWorkerBaseClass.

Definition at line 45 of file EcalRecHitWorkerSimpleOld.cc.

References agc, chStatus, cond::rpcobgas::detid, EBLaserMAX_, EcalBarrel, EcalEndcap, EELaserMAX_, EcalCondObjectContainer< T >::end(), spr::find(), EcalCondObjectContainer< T >::find(), EcalChannelStatusCode::getStatusCode(), ical, EcalUncalibratedRecHit::id(), itime, killDeadChannels_, EcalRecHit::kLeadingEdgeRecovered, EcalRecHit::kPoorCalib, laser, laserCorrection_, EcalRecHitSimpleAlgo::makeRecHit(), offtime, edm::SortedCollection< T, SORT >::push_back(), DetId::rawId(), rechitMaker_, EcalRecHitSimpleAlgo::setADCToGeVConstant(), EcalRecHit::setFlag(), DetId::subdetId(), edm::EventBase::time(), v_chstatus_, and v_DB_reco_flags_.

48 {
49  DetId detid=uncalibRH.id();
50 
52  EcalChannelStatusCode chStatusCode = 1;
53  if ( chit != chStatus->end() ) {
54  chStatusCode = *chit;
55  } else {
56  edm::LogError("EcalRecHitError") << "No channel status found for xtal "
57  << detid.rawId()
58  << "! something wrong with EcalChannelStatus in your DB? ";
59  }
60  if ( v_chstatus_.size() > 0) {
61  uint16_t code = chStatusCode.getStatusCode() & 0x001F;
62  std::vector<int>::const_iterator res = std::find( v_chstatus_.begin(), v_chstatus_.end(), code );
63  if ( res != v_chstatus_.end() ) {
64  return false;
65  }
66  }
67 
68  // find the proper flag for the recHit
69  // from a configurable vector
70  // (see cfg file for the association)
71  uint32_t recoFlag = 0;
72  uint16_t statusCode = chStatusCode.getStatusCode() & 0x001F;
73  if ( statusCode < v_DB_reco_flags_.size() ) {
74  // not very nice...
75  recoFlag = v_DB_reco_flags_[ statusCode ];
76  } else {
77  edm::LogError("EcalRecHitError") << "Flag " << statusCode
78  << " in DB exceed the allowed range of " << v_DB_reco_flags_.size();
79  }
80 
81  float offsetTime = 0; // the global time phase
82  const EcalIntercalibConstantMap& icalMap = ical->getMap();
83  if ( detid.subdetId() == EcalEndcap ) {
84  rechitMaker_->setADCToGeVConstant( float(agc->getEEValue()) );
85  offsetTime = offtime->getEEValue();
86  } else {
87  rechitMaker_->setADCToGeVConstant( float(agc->getEBValue()) );
88  offsetTime = offtime->getEBValue();
89  }
90 
91  // first intercalibration constants
92  EcalIntercalibConstantMap::const_iterator icalit = icalMap.find(detid);
93  EcalIntercalibConstant icalconst = 1;
94  if( icalit!=icalMap.end() ) {
95  icalconst = (*icalit);
96  } else {
97  edm::LogError("EcalRecHitError") << "No intercalib const found for xtal "
98  << detid.rawId()
99  << "! something wrong with EcalIntercalibConstants in your DB? ";
100  }
101 
102  // get laser coefficient
103  float lasercalib = 1.;
104  if ( laserCorrection_ ) lasercalib = laser->getLaserCorrection( detid, evt.time());
105 
106 
107  // get time calibration coefficient
108  const EcalTimeCalibConstantMap & itimeMap = itime->getMap();
110  EcalTimeCalibConstant itimeconst = 0;
111  if( itime!=itimeMap.end() ) {
112  itimeconst = (*itime);
113  } else {
114  edm::LogError("EcalRecHitError") << "No time calib const found for xtal "
115  << detid.rawId()
116  << "! something wrong with EcalTimeCalibConstants in your DB? ";
117  }
118 
119 
120  // make the rechit and put in the output collection
122  EcalRecHit myrechit( rechitMaker_->makeRecHit(uncalibRH, icalconst * lasercalib, (itimeconst + offsetTime), /*recoflags_*/ 0) );
123  if (detid.subdetId() == EcalBarrel && (lasercalib < EBLaserMIN_ || lasercalib > EBLaserMAX_)) myrechit.setFlag(EcalRecHit::kPoorCalib);
124  if (detid.subdetId() == EcalEndcap && (lasercalib < EELaserMIN_ || lasercalib > EELaserMAX_)) myrechit.setFlag(EcalRecHit::kPoorCalib);
125  result.push_back(myrechit);
126  }
127 
128  return true;
129 }
edm::ESHandle< EcalTimeCalibConstants > itime
virtual EcalRecHit makeRecHit(const EcalUncalibratedRecHit &uncalibRH, const float &intercalibConstant, const float &timeIntercalib=0, const uint32_t &flags=0) const
Compute parameters.
void push_back(T const &t)
void setFlag(int flag)
set the flags (from Flags or ESFlags)
Definition: EcalRecHit.h:102
virtual void setADCToGeVConstant(const float &value)
make rechits from dataframes
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
EcalRecHitSimpleAlgo * rechitMaker_
edm::ESHandle< EcalLaserDbService > laser
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
uint16_t getStatusCode() const
edm::ESHandle< EcalADCToGeVConstant > agc
edm::ESHandle< EcalChannelStatus > chStatus
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
std::vector< Item >::const_iterator const_iterator
edm::ESHandle< EcalTimeOffsetConstant > offtime
float EcalTimeCalibConstant
const_iterator find(uint32_t rawId) const
const_iterator end() const
edm::ESHandle< EcalIntercalibConstants > ical
edm::Timestamp time() const
Definition: EventBase.h:57
float EcalIntercalibConstant
void EcalRecHitWorkerSimpleOld::set ( const edm::EventSetup es)
virtual

Implements EcalRecHitWorkerBaseClass.

Definition at line 33 of file EcalRecHitWorkerSimpleOld.cc.

References agc, chStatus, edm::EventSetup::get(), ical, itime, laser, laserCorrection_, and offtime.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

34 {
38  es.get<EcalADCToGeVConstantRcd>().get(agc);
40  if ( laserCorrection_ ) es.get<EcalLaserDbRecord>().get(laser);
41 }
edm::ESHandle< EcalTimeCalibConstants > itime
edm::ESHandle< EcalLaserDbService > laser
edm::ESHandle< EcalADCToGeVConstant > agc
edm::ESHandle< EcalChannelStatus > chStatus
const T & get() const
Definition: EventSetup.h:55
edm::ESHandle< EcalTimeOffsetConstant > offtime
edm::ESHandle< EcalIntercalibConstants > ical

Member Data Documentation

edm::ESHandle<EcalADCToGeVConstant> EcalRecHitWorkerSimpleOld::agc
protected

Definition at line 45 of file EcalRecHitWorkerSimpleOld.h.

Referenced by run(), and set().

edm::ESHandle<EcalChannelStatus> EcalRecHitWorkerSimpleOld::chStatus
protected

Definition at line 46 of file EcalRecHitWorkerSimpleOld.h.

Referenced by run(), and set().

double EcalRecHitWorkerSimpleOld::EBLaserMAX_
protected

Definition at line 38 of file EcalRecHitWorkerSimpleOld.h.

Referenced by EcalRecHitWorkerSimpleOld(), and run().

double EcalRecHitWorkerSimpleOld::EBLaserMIN_
protected

Definition at line 36 of file EcalRecHitWorkerSimpleOld.h.

Referenced by EcalRecHitWorkerSimpleOld().

double EcalRecHitWorkerSimpleOld::EELaserMAX_
protected

Definition at line 39 of file EcalRecHitWorkerSimpleOld.h.

Referenced by EcalRecHitWorkerSimpleOld(), and run().

double EcalRecHitWorkerSimpleOld::EELaserMIN_
protected

Definition at line 37 of file EcalRecHitWorkerSimpleOld.h.

Referenced by EcalRecHitWorkerSimpleOld().

edm::ESHandle<EcalIntercalibConstants> EcalRecHitWorkerSimpleOld::ical
protected

Definition at line 42 of file EcalRecHitWorkerSimpleOld.h.

Referenced by run(), and set().

edm::ESHandle<EcalTimeCalibConstants> EcalRecHitWorkerSimpleOld::itime
protected

Definition at line 43 of file EcalRecHitWorkerSimpleOld.h.

Referenced by run(), and set().

bool EcalRecHitWorkerSimpleOld::killDeadChannels_
protected

Definition at line 52 of file EcalRecHitWorkerSimpleOld.h.

Referenced by EcalRecHitWorkerSimpleOld(), and run().

edm::ESHandle<EcalLaserDbService> EcalRecHitWorkerSimpleOld::laser
protected

Definition at line 48 of file EcalRecHitWorkerSimpleOld.h.

Referenced by run(), and set().

bool EcalRecHitWorkerSimpleOld::laserCorrection_
protected

Definition at line 53 of file EcalRecHitWorkerSimpleOld.h.

Referenced by EcalRecHitWorkerSimpleOld(), run(), and set().

edm::ESHandle<EcalTimeOffsetConstant> EcalRecHitWorkerSimpleOld::offtime
protected

Definition at line 44 of file EcalRecHitWorkerSimpleOld.h.

Referenced by run(), and set().

EcalRecHitSimpleAlgo* EcalRecHitWorkerSimpleOld::rechitMaker_
protected
std::vector<int> EcalRecHitWorkerSimpleOld::v_chstatus_
protected

Definition at line 47 of file EcalRecHitWorkerSimpleOld.h.

Referenced by EcalRecHitWorkerSimpleOld(), and run().

std::vector<int> EcalRecHitWorkerSimpleOld::v_DB_reco_flags_
protected

Definition at line 50 of file EcalRecHitWorkerSimpleOld.h.

Referenced by EcalRecHitWorkerSimpleOld(), and run().