#include <RecoLocalCalo/CaloTowersCreator/src/CaloTowersCreator.h>
Public Member Functions | |
CaloTowersCreator (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
virtual | ~CaloTowersCreator () |
Public Attributes | |
double | EBEScale |
double | EEEScale |
double | HBEScale |
double | HEDEScale |
double | HESEScale |
double | HF1EScale |
double | HF2EScale |
double | HOEScale |
Static Private Member Functions | |
static const std::vector < double > & | getGridValues () |
Private Attributes | |
CaloTowersCreationAlgo | algo_ |
bool | allowMissingInputs_ |
std::vector< edm::InputTag > | ecalLabels_ |
edm::InputTag | hbheLabel_ |
edm::InputTag | hfLabel_ |
edm::InputTag | hoLabel_ |
Definition at line 22 of file CaloTowersCreator.h.
CaloTowersCreator::CaloTowersCreator | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 29 of file CaloTowersCreator.cc.
References EBEScale, EEEScale, HBEScale, HEDEScale, HESEScale, HF1EScale, HF2EScale, and HOEScale.
00029 : 00030 algo_(conf.getParameter<double>("EBThreshold"), 00031 conf.getParameter<double>("EEThreshold"), 00032 conf.getParameter<double>("HcalThreshold"), 00033 conf.getParameter<double>("HBThreshold"), 00034 conf.getParameter<double>("HESThreshold"), 00035 conf.getParameter<double>("HEDThreshold"), 00036 conf.getParameter<double>("HOThreshold"), 00037 conf.getParameter<double>("HF1Threshold"), 00038 conf.getParameter<double>("HF2Threshold"), 00039 conf.getUntrackedParameter<std::vector<double> >("EBGrid",getGridValues() ), 00040 conf.getUntrackedParameter<std::vector<double> >("EBWeights",std::vector<double>(getGridValues().size(),1.) ), 00041 conf.getUntrackedParameter<std::vector<double> >("EEGrid",getGridValues() ), 00042 conf.getUntrackedParameter<std::vector<double> >("EEWeights",std::vector<double>(getGridValues().size(),1.) ), 00043 conf.getUntrackedParameter<std::vector<double> >("HBGrid",getGridValues() ), 00044 conf.getUntrackedParameter<std::vector<double> >("HBWeights",std::vector<double>(getGridValues().size(),1.) ), 00045 conf.getUntrackedParameter<std::vector<double> >("HESGrid",getGridValues() ), 00046 conf.getUntrackedParameter<std::vector<double> >("HESWeights",std::vector<double>(getGridValues().size(),1.) ), 00047 conf.getUntrackedParameter<std::vector<double> >("HEDGrid",getGridValues() ), 00048 conf.getUntrackedParameter<std::vector<double> >("HEDWeights",std::vector<double>(getGridValues().size(),1.) ), 00049 conf.getUntrackedParameter<std::vector<double> >("HOGrid",getGridValues() ), 00050 conf.getUntrackedParameter<std::vector<double> >("HOWeights",std::vector<double>(getGridValues().size(),1.) ), 00051 conf.getUntrackedParameter<std::vector<double> >("HF1Grid",getGridValues() ), 00052 conf.getUntrackedParameter<std::vector<double> >("HF1Weights",std::vector<double>(getGridValues().size(),1.) ), 00053 conf.getUntrackedParameter<std::vector<double> >("HF2Grid",getGridValues() ), 00054 conf.getUntrackedParameter<std::vector<double> >("HF2Weights",std::vector<double>(getGridValues().size(),1.) ), 00055 conf.getParameter<double>("EBWeight"), 00056 conf.getParameter<double>("EEWeight"), 00057 conf.getParameter<double>("HBWeight"), 00058 conf.getParameter<double>("HESWeight"), 00059 conf.getParameter<double>("HEDWeight"), 00060 conf.getParameter<double>("HOWeight"), 00061 conf.getParameter<double>("HF1Weight"), 00062 conf.getParameter<double>("HF2Weight"), 00063 conf.getParameter<double>("EcutTower"), 00064 conf.getParameter<double>("EBSumThreshold"), 00065 conf.getParameter<double>("EESumThreshold"), 00066 conf.getParameter<bool>("UseHO"), 00067 // (for momentum reconstruction algorithm) 00068 conf.getParameter<int>("MomConstrMethod"), 00069 conf.getParameter<double>("MomEmDepth"), 00070 conf.getParameter<double>("MomHadDepth"), 00071 conf.getParameter<double>("MomTotDepth") 00072 ), 00073 00074 hbheLabel_(conf.getParameter<edm::InputTag>("hbheInput")), 00075 hoLabel_(conf.getParameter<edm::InputTag>("hoInput")), 00076 hfLabel_(conf.getParameter<edm::InputTag>("hfInput")), 00077 ecalLabels_(conf.getParameter<std::vector<edm::InputTag> >("ecalInputs")), 00078 allowMissingInputs_(conf.getUntrackedParameter<bool>("AllowMissingInputs",false)) 00079 { 00080 EBEScale=EScales.EBScale; 00081 EEEScale=EScales.EEScale; 00082 HBEScale=EScales.HBScale; 00083 HESEScale=EScales.HESScale; 00084 HEDEScale=EScales.HEDScale; 00085 HOEScale=EScales.HOScale; 00086 HF1EScale=EScales.HF1Scale; 00087 HF2EScale=EScales.HF2Scale; 00088 if (EScales.instanceLabel=="") produces<CaloTowerCollection>(); 00089 else produces<CaloTowerCollection>(EScales.instanceLabel); 00090 }
virtual CaloTowersCreator::~CaloTowersCreator | ( | ) | [inline, virtual] |
const std::vector< double > & CaloTowersCreator::getGridValues | ( | ) | [static, private] |
Definition at line 9 of file CaloTowersCreator.cc.
00010 { 00011 static std::vector<double> retval; 00012 00013 if (retval.size() == 0) 00014 { 00015 retval.push_back(0.); 00016 retval.push_back(10.); 00017 retval.push_back(20.); 00018 retval.push_back(30.); 00019 retval.push_back(40.); 00020 retval.push_back(50.); 00021 retval.push_back(100.); 00022 retval.push_back(1000.); 00023 } 00024 00025 return retval; 00026 }
void CaloTowersCreator::produce | ( | edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 92 of file CaloTowersCreator.cc.
References algo_, allowMissingInputs_, CaloTowersCreationAlgo::begin(), EBEScale, ecalLabels_, EEEScale, CaloTowersCreationAlgo::finish(), edm::EventSetup::get(), edm::Event::getByLabel(), HBEScale, hbheLabel_, HEDEScale, HESEScale, HF1EScale, HF2EScale, hfLabel_, HOEScale, hoLabel_, i, edm::productstatus::present(), CaloTowersCreationAlgo::process(), edm::ESHandle< T >::product(), edm::Event::put(), CaloTowersCreationAlgo::setEBEScale(), CaloTowersCreationAlgo::setEEEScale(), CaloTowersCreationAlgo::setGeometry(), CaloTowersCreationAlgo::setHBEScale(), CaloTowersCreationAlgo::setHEDEScale(), CaloTowersCreationAlgo::setHESEScale(), CaloTowersCreationAlgo::setHF1EScale(), CaloTowersCreationAlgo::setHF2EScale(), and CaloTowersCreationAlgo::setHOEScale().
00092 { 00093 // get the necessary event setup objects... 00094 edm::ESHandle<CaloGeometry> pG; 00095 edm::ESHandle<HcalTopology> htopo; 00096 edm::ESHandle<CaloTowerConstituentsMap> cttopo; 00097 c.get<CaloGeometryRecord>().get(pG); 00098 c.get<IdealGeometryRecord>().get(htopo); 00099 c.get<IdealGeometryRecord>().get(cttopo); 00100 00101 algo_.setEBEScale(EBEScale); 00102 algo_.setEEEScale(EEEScale); 00103 algo_.setHBEScale(HBEScale); 00104 algo_.setHESEScale(HESEScale); 00105 algo_.setHEDEScale(HEDEScale); 00106 algo_.setHOEScale(HOEScale); 00107 algo_.setHF1EScale(HF1EScale); 00108 algo_.setHF2EScale(HF2EScale); 00109 algo_.setGeometry(cttopo.product(),htopo.product(),pG.product()); 00110 00111 algo_.begin(); // clear the internal buffer 00112 00113 bool present; 00114 00115 // Step A/C: Get Inputs and process (repeatedly) 00116 edm::Handle<HBHERecHitCollection> hbhe; 00117 present=e.getByLabel(hbheLabel_,hbhe); 00118 if (present || !allowMissingInputs_) algo_.process(*hbhe); 00119 00120 edm::Handle<HORecHitCollection> ho; 00121 present=e.getByLabel(hoLabel_,ho); 00122 if (present || !allowMissingInputs_) algo_.process(*ho); 00123 00124 edm::Handle<HFRecHitCollection> hf; 00125 present=e.getByLabel(hfLabel_,hf); 00126 if (present || !allowMissingInputs_) algo_.process(*hf); 00127 00128 std::vector<edm::InputTag>::const_iterator i; 00129 for (i=ecalLabels_.begin(); i!=ecalLabels_.end(); i++) { 00130 edm::Handle<EcalRecHitCollection> ec; 00131 present=e.getByLabel(*i,ec); 00132 if (present || !allowMissingInputs_) algo_.process(*ec); 00133 } 00134 00135 // Step B: Create empty output 00136 std::auto_ptr<CaloTowerCollection> prod(new CaloTowerCollection()); 00137 00138 // Step C: Process 00139 algo_.finish(*prod); 00140 00141 // Step D: Put into the event 00142 if (EScales.instanceLabel=="") e.put(prod); 00143 else e.put(prod,EScales.instanceLabel); 00144 }
bool CaloTowersCreator::allowMissingInputs_ [private] |
double CaloTowersCreator::EBEScale |
Definition at line 27 of file CaloTowersCreator.h.
Referenced by CaloTowersCreator(), and produce().
std::vector<edm::InputTag> CaloTowersCreator::ecalLabels_ [private] |
double CaloTowersCreator::EEEScale |
Definition at line 27 of file CaloTowersCreator.h.
Referenced by CaloTowersCreator(), and produce().
double CaloTowersCreator::HBEScale |
Definition at line 27 of file CaloTowersCreator.h.
Referenced by CaloTowersCreator(), and produce().
edm::InputTag CaloTowersCreator::hbheLabel_ [private] |
double CaloTowersCreator::HEDEScale |
Definition at line 28 of file CaloTowersCreator.h.
Referenced by CaloTowersCreator(), and produce().
double CaloTowersCreator::HESEScale |
Definition at line 27 of file CaloTowersCreator.h.
Referenced by CaloTowersCreator(), and produce().
double CaloTowersCreator::HF1EScale |
Definition at line 28 of file CaloTowersCreator.h.
Referenced by CaloTowersCreator(), and produce().
double CaloTowersCreator::HF2EScale |
Definition at line 28 of file CaloTowersCreator.h.
Referenced by CaloTowersCreator(), and produce().
edm::InputTag CaloTowersCreator::hfLabel_ [private] |
double CaloTowersCreator::HOEScale |
Definition at line 28 of file CaloTowersCreator.h.
Referenced by CaloTowersCreator(), and produce().
edm::InputTag CaloTowersCreator::hoLabel_ [private] |