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;
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") {
149 if (nameProd_ ==
"ALCARECOMuAlZMuMu") {
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_);
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();
193 for (
const auto& hite : *(
ecal.product())) {
194 const GlobalPoint& posE = geo->getPosition(hite.detid());
196 edm::LogVerbatim(
"HcalAlCa") <<
" Energy ECAL " << hite.energy() <<
" eta " << posE.
eta() <<
" phi "
199 energyECAL = energyECAL + hite.energy();
202 auto const& hbhe = iEvent.
getHandle(tok_hbheProd_);
206 for (
const auto& hith : *(hbhe.product())) {
208 (
static_cast<const HcalGeometry*
>(geo->getSubdetectorGeometry(hith.detid())))->getPosition(hith.detid());
210 edm::LogVerbatim(
"HcalAlCa") <<
" Energy HCAL " << hith.energy() <<
" eta " << posH.
eta() <<
" phi "
213 energyHCAL = energyHCAL + hith.energy();
219 if (nameProd_ ==
"GammaJetProd" || nameProd_ ==
"DiJProd") {
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();
254 descriptions.
add(
"alcaHcalProducerAnalyzer", desc);
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
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)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::TrackCollection > tok_tracks_
Geom::Phi< T > phi() const
edm::EDGetTokenT< reco::MuonCollection > tok_muons_
auto const & tracks
cannot be loose
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_
ProducerAnalyzer(const edm::ParameterSet &)
bool getData(T &iHolder) const
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
edm::EDGetTokenT< HORecHitCollection > tok_horeco_
edm::EDGetTokenT< HOCalibVariableCollection > tok_hovar_
edm::EDGetTokenT< EcalRecHitCollection > tok_ecal_
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_
tuple size
Write out results.
tok_geom_(esConsumes< CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun >())
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const