107 tok_hovar_ = consumes<HOCalibVariableCollection>(
edm::InputTag(nameProd_, hoInput_));
108 tok_horeco_ = consumes<HORecHitCollection>(
edm::InputTag(
"horeco"));
109 tok_ho_ = consumes<HORecHitCollection>(
edm::InputTag(hoInput_));
110 tok_hoProd_ = consumes<HORecHitCollection>(
edm::InputTag(nameProd_, hoInput_));
112 tok_hf_ = consumes<HFRecHitCollection>(
edm::InputTag(hfInput_));
114 tok_jets_ = consumes<reco::CaloJetCollection>(
edm::InputTag(nameProd_, jetCalo_));
115 tok_gamma_ = consumes<reco::SuperClusterCollection>(
edm::InputTag(nameProd_, gammaClus_));
116 tok_muons_ = consumes<reco::MuonCollection>(
edm::InputTag(nameProd_,
"SelectedMuons"));
117 tok_ecal_ = consumes<EcalRecHitCollection>(
edm::InputTag(nameProd_, ecalInput_));
118 tok_tracks_ = consumes<reco::TrackCollection>(
edm::InputTag(nameProd_, tracks_));
120 tok_hbheProd_ = consumes<HBHERecHitCollection>(
edm::InputTag(nameProd_, hbheInput_));
121 tok_hbhe_ = consumes<HBHERecHitCollection>(
edm::InputTag(hbheInput_));
123 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
136 std::vector<StableProvenance const*> theProvenance;
137 iEvent.getAllStableProvenance(theProvenance);
138 for (
auto const& provenance : theProvenance) {
139 edm::LogVerbatim(
"HcalAlCa") <<
" Print all module/label names " << provenance->moduleName() <<
" " 140 << provenance->moduleLabel() <<
" " << provenance->productInstanceName();
143 if (nameProd_ ==
"hoCalibProducer") {
144 auto const&
ho =
iEvent.getHandle(tok_hovar_);
149 if (nameProd_ ==
"ALCARECOMuAlZMuMu") {
150 auto const&
ho =
iEvent.getHandle(tok_horeco_);
153 auto const& mucand =
iEvent.getHandle(tok_muons_);
154 edm::LogVerbatim(
"HcalAlCa") <<
" Size of muon collection " << mucand->size();
155 for (
const auto& it : *(mucand.product())) {
161 if (nameProd_ !=
"IsoProd" && nameProd_ !=
"ALCARECOMuAlZMuMu" && nameProd_ !=
"hoCalibProducer") {
162 auto const&
hbhe =
iEvent.getHandle(tok_hbhe_);
166 auto const&
ho =
iEvent.getHandle(tok_ho_);
170 auto const&
hf =
iEvent.getHandle(tok_hf_);
174 if (nameProd_ ==
"IsoProd") {
181 <<
" Outer " <<
track.outerMomentum() <<
" " <<
track.outerPosition();
183 edm::LogVerbatim(
"HcalAlCa") <<
" Track extra " << myextra->outerMomentum() <<
" " << myextra->outerPosition();
186 auto const&
ecal =
iEvent.getHandle(tok_ecal_);
193 for (
const auto& hite : *(
ecal.product())) {
196 edm::LogVerbatim(
"HcalAlCa") <<
" Energy ECAL " << hite.energy() <<
" eta " << posE.
eta() <<
" phi " 202 auto const&
hbhe =
iEvent.getHandle(tok_hbheProd_);
206 for (
const auto& hith : *(
hbhe.product())) {
210 edm::LogVerbatim(
"HcalAlCa") <<
" Energy HCAL " << hith.energy() <<
" eta " << posH.
eta() <<
" phi " 219 if (nameProd_ ==
"GammaJetProd" || nameProd_ ==
"DiJProd") {
221 auto const&
ecal =
iEvent.getHandle(tok_ecal_);
224 auto const&
jets =
iEvent.getHandle(tok_jets_);
227 for (
const auto&
jet : *(
jets.product())) {
234 if (nameProd_ ==
"GammaJetProd") {
235 auto const& eclus =
iEvent.getHandle(tok_gamma_);
237 for (
const auto& iclus : *(eclus.product())) {
238 edm::LogVerbatim(
"HcalAlCa") <<
" Et gamma " << iclus.energy() / cosh(iclus.eta()) <<
" eta " << iclus.eta()
239 <<
" phi " << iclus.phi();
247 desc.addUntracked<
std::string>(
"jetCalo",
"GammaJetJetBackToBackCollection");
248 desc.addUntracked<
std::string>(
"gammaClus",
"GammaJetGammaBackToBackCollection");
249 desc.addUntracked<
std::string>(
"ecalInput",
"GammaJetEcalRecHitCollection");
254 descriptions.
add(
"alcaHcalProducerAnalyzer",
desc);
Log< level::Info, true > LogVerbatim
double energyECAL(std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
#define DEFINE_FWK_MODULE(type)
Geom::Phi< T > phi() const
edm::EDGetTokenT< reco::TrackCollection > tok_tracks_
edm::EDGetTokenT< reco::MuonCollection > tok_muons_
edm::EDGetTokenT< reco::SuperClusterCollection > tok_gamma_
edm::EDGetTokenT< HORecHitCollection > tok_hoProd_
edm::EDGetTokenT< HORecHitCollection > tok_ho_
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< HBHERecHitCollection > tok_hbheProd_
T getUntrackedParameter(std::string const &, T const &) const
ProducerAnalyzer(const edm::ParameterSet &)
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
edm::EDGetTokenT< HORecHitCollection > tok_horeco_
edm::EDGetTokenT< HOCalibVariableCollection > tok_hovar_
edm::EDGetTokenT< EcalRecHitCollection > tok_ecal_
bool getData(T &iHolder) const
Namespace of DDCMS conversion namespace.
auto const & tracks
cannot be loose
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
double energyHCAL(std::vector< DetId > &vdets, edm::Handle< T > &hits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, bool debug=false)
std::vector< HOCalibVariables > HOCalibVariableCollection
collection of HOcalibration variabale
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
~ProducerAnalyzer() override=default
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly