#include <RecoLocalCalo/CaloRecCandCreator/src/CaloRecHitCandidateProducer.h>
Public Member Functions | |
CaloRecHitCandidateProducer (const edm::ParameterSet &) | |
double | cellTresholdAndWeight (const CaloRecHit &, const HcalTopology &) const |
void | produce (edm::Event &, const edm::EventSetup &) |
~CaloRecHitCandidateProducer () | |
Private Attributes | |
bool | mAllowMissingInputs |
double | mEBthreshold |
double | mEBweight |
std::vector< edm::InputTag > | mEcalLabels |
double | mEEthreshold |
double | mEEweight |
edm::InputTag | mHBHELabel |
source collection tag | |
double | mHBthreshold |
double | mHBweight |
double | mHEDthreshold |
double | mHEDweight |
double | mHESthreshold |
double | mHESweight |
double | mHF1threshold |
double | mHF1weight |
double | mHF2threshold |
double | mHF2weight |
edm::InputTag | mHFLabel |
edm::InputTag | mHOLabel |
double | mHOthreshold |
double | mHOweight |
bool | mUseHO |
Definition at line 13 of file CaloRecHitCandidateProducer.h.
CaloRecHitCandidateProducer::CaloRecHitCandidateProducer | ( | const edm::ParameterSet & | fConfig | ) |
Definition at line 67 of file CaloRecHitCandidateProducer.cc.
00068 : mHBHELabel (fConfig.getParameter<edm::InputTag>("hbheInput")), 00069 mHOLabel (fConfig.getParameter<edm::InputTag>("hoInput")), 00070 mHFLabel (fConfig.getParameter<edm::InputTag>("hfInput")), 00071 mEcalLabels (fConfig.getParameter<std::vector<edm::InputTag> >("ecalInputs")), 00072 mAllowMissingInputs (fConfig.getUntrackedParameter<bool>("AllowMissingInputs",false)), 00073 mUseHO (fConfig.getParameter<bool>("UseHO")), 00074 00075 mEBthreshold (fConfig.getParameter<double>("EBThreshold")), 00076 mEEthreshold (fConfig.getParameter<double>("EEThreshold")), 00077 mHBthreshold (fConfig.getParameter<double>("HBThreshold")), 00078 mHESthreshold (fConfig.getParameter<double>("HESThreshold")), 00079 mHEDthreshold (fConfig.getParameter<double>("HEDThreshold")), 00080 mHOthreshold (fConfig.getParameter<double>("HOThreshold")), 00081 mHF1threshold (fConfig.getParameter<double>("HF1Threshold")), 00082 mHF2threshold (fConfig.getParameter<double>("HF2Threshold")), 00083 mEBweight (fConfig.getParameter<double>("EBWeight")), 00084 mEEweight (fConfig.getParameter<double>("EEWeight")), 00085 mHBweight (fConfig.getParameter<double>("HBWeight")), 00086 mHESweight (fConfig.getParameter<double>("HESWeight")), 00087 mHEDweight (fConfig.getParameter<double>("HEDWeight")), 00088 mHOweight (fConfig.getParameter<double>("HOWeight")), 00089 mHF1weight (fConfig.getParameter<double>("HF1Weight")), 00090 mHF2weight (fConfig.getParameter<double>("HF2Weight")) 00091 { 00092 produces<CandidateCollection>(); 00093 }
CaloRecHitCandidateProducer::~CaloRecHitCandidateProducer | ( | ) | [inline] |
double CaloRecHitCandidateProducer::cellTresholdAndWeight | ( | const CaloRecHit & | fHit, | |
const HcalTopology & | fTopology | |||
) | const |
Definition at line 158 of file CaloRecHitCandidateProducer.cc.
References HcalDetId::depth(), DetId::det(), detId, CaloRecHit::detid(), DetId::Ecal, EcalBarrel, EcalEndcap, CaloRecHit::energy(), HcalTopology::firstHEDoublePhiRing(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalDetId::ietaAbs(), mEBthreshold, mEBweight, mEEthreshold, mEEweight, mHBthreshold, mHBweight, mHEDthreshold, mHEDweight, mHESthreshold, mHESweight, mHF1threshold, mHF1weight, mHF2threshold, mHF2weight, mHOthreshold, mHOweight, HcalDetId::subdet(), DetId::subdetId(), dimuonsSequences_cff::threshold, and weight.
Referenced by processHits().
00158 { 00159 double weight = 0; 00160 double threshold = 0; 00161 DetId detId = fHit.detid (); 00162 DetId::Detector det = detId.det (); 00163 if(det == DetId::Ecal) { 00164 // may or may not be EB. We'll find out. 00165 00166 EcalSubdetector subdet = (EcalSubdetector)(detId.subdetId()); 00167 if(subdet == EcalBarrel) { 00168 threshold = mEBthreshold; 00169 weight = mEBweight; 00170 } 00171 else if(subdet == EcalEndcap) { 00172 threshold = mEEthreshold; 00173 weight = mEEweight; 00174 } 00175 } 00176 else if(det == DetId::Hcal) { 00177 HcalDetId hcalDetId(detId); 00178 HcalSubdetector subdet = hcalDetId.subdet(); 00179 00180 if(subdet == HcalBarrel) { 00181 threshold = mHBthreshold; 00182 weight = mHBweight; 00183 } 00184 00185 else if(subdet == HcalEndcap) { 00186 // check if it's single or double tower 00187 if(hcalDetId.ietaAbs() < fTopology.firstHEDoublePhiRing()) { 00188 threshold = mHESthreshold; 00189 weight = mHESweight; 00190 } 00191 else { 00192 threshold = mHEDthreshold; 00193 weight = mHEDweight; 00194 } 00195 } else if(subdet == HcalOuter) { 00196 threshold = mHOthreshold; 00197 weight = mHOweight; 00198 } else if(subdet == HcalForward) { 00199 if(hcalDetId.depth() == 1) { 00200 threshold = mHF1threshold; 00201 weight = mHF1weight; 00202 } else { 00203 threshold = mHF2threshold; 00204 weight = mHF2weight; 00205 } 00206 } 00207 } 00208 return fHit.energy () >= threshold ? weight : 0; 00209 }
void CaloRecHitCandidateProducer::produce | ( | edm::Event & | fEvent, | |
const edm::EventSetup & | fSetup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 95 of file CaloRecHitCandidateProducer.cc.
References edm::eventsetup::EventSetupRecordImplementation< T >::get(), edm::EventSetup::get(), edm::Event::getByLabel(), i, edm::Handle< T >::isValid(), mAllowMissingInputs, mEcalLabels, mHBHELabel, mHFLabel, mHOLabel, mUseHO, output(), processHits(), edm::Event::put(), and ecalRecalibSequence_cff::record.
00095 { 00096 // get geometry 00097 // const IdealGeometryRecord& record = fSetup.template get<IdealGeometryRecord>(); 00098 const CaloGeometryRecord& caloRecord = fSetup.get<CaloGeometryRecord>(); 00099 ESHandle<CaloGeometry> geometry; 00100 caloRecord.get (geometry); 00101 const IdealGeometryRecord& record = fSetup.get<IdealGeometryRecord>(); 00102 ESHandle<HcalTopology> topology; 00103 record.get (topology); 00104 // set Output 00105 auto_ptr<CandidateCollection> output ( new CandidateCollection ); 00106 // get and process Inputs 00107 edm::Handle<HBHERecHitCollection> hbhe; 00108 fEvent.getByLabel(mHBHELabel,hbhe); 00109 if (!hbhe.isValid()) { 00110 // can't find it! 00111 if (!mAllowMissingInputs) { 00112 *hbhe; // will throw the proper exception 00113 } 00114 } else { 00115 processHits (hbhe, *this, *geometry, *topology, &*output); 00116 } 00117 00118 if (mUseHO) { 00119 edm::Handle<HORecHitCollection> ho; 00120 fEvent.getByLabel(mHOLabel,ho); 00121 if (!ho.isValid()) { 00122 // can't find it! 00123 if (!mAllowMissingInputs) { 00124 *ho; // will throw the proper exception 00125 } 00126 } else { 00127 processHits (ho, *this, *geometry, *topology, &*output); 00128 } 00129 } 00130 00131 edm::Handle<HFRecHitCollection> hf; 00132 fEvent.getByLabel(mHFLabel,hf); 00133 if (!hf.isValid()) { 00134 // can't find it! 00135 if (!mAllowMissingInputs) { 00136 *hf; // will throw the proper exception 00137 } 00138 } else { 00139 processHits (hf, *this, *geometry, *topology, &*output); 00140 } 00141 00142 std::vector<edm::InputTag>::const_iterator i; 00143 for (i=mEcalLabels.begin(); i!=mEcalLabels.end(); i++) { 00144 edm::Handle<EcalRecHitCollection> ec; 00145 fEvent.getByLabel(*i,ec); 00146 if (!ec.isValid()) { 00147 // can't find it! 00148 if (!mAllowMissingInputs) { 00149 *ec; // will throw the proper exception 00150 } 00151 } else { 00152 processHits (ec, *this, *geometry, *topology, &*output); 00153 } 00154 } 00155 fEvent.put(output); 00156 }
double CaloRecHitCandidateProducer::mEBthreshold [private] |
double CaloRecHitCandidateProducer::mEBweight [private] |
std::vector<edm::InputTag> CaloRecHitCandidateProducer::mEcalLabels [private] |
double CaloRecHitCandidateProducer::mEEthreshold [private] |
double CaloRecHitCandidateProducer::mEEweight [private] |
source collection tag
Definition at line 22 of file CaloRecHitCandidateProducer.h.
Referenced by produce().
double CaloRecHitCandidateProducer::mHBthreshold [private] |
double CaloRecHitCandidateProducer::mHBweight [private] |
double CaloRecHitCandidateProducer::mHEDthreshold [private] |
double CaloRecHitCandidateProducer::mHEDweight [private] |
double CaloRecHitCandidateProducer::mHESthreshold [private] |
double CaloRecHitCandidateProducer::mHESweight [private] |
double CaloRecHitCandidateProducer::mHF1threshold [private] |
double CaloRecHitCandidateProducer::mHF1weight [private] |
double CaloRecHitCandidateProducer::mHF2threshold [private] |
double CaloRecHitCandidateProducer::mHF2weight [private] |
double CaloRecHitCandidateProducer::mHOthreshold [private] |
double CaloRecHitCandidateProducer::mHOweight [private] |
bool CaloRecHitCandidateProducer::mUseHO [private] |