73 template <
typename T1>
85 :
minEt_(para.getParameter<double>(
"minEt")),
86 maxEt_(para.getParameter<double>(
"maxEt")),
87 maxDeltaR_(para.getParameter<double>(
"maxDeltaR")),
88 maxDEta_(para.getParameter<double>(
"maxDEta")),
89 maxDPhi_(para.getParameter<double>(
"maxDPhi")),
90 token_(consumesColl.consumes<T1>(para.getParameter<
edm::
InputTag>(
"inputColl"))) {}
95 template <
typename CaloObjType,
typename CaloObjCollType = edm::SortedCollection<CaloObjType>>
110 const std::vector<EtaPhiRegion>&
regions);
118 template <
typename CaloObjType,
typename CaloObjCollType>
120 const std::vector<edm::ParameterSet> etaPhiRegions =
121 para.
getParameter<std::vector<edm::ParameterSet>>(
"etaPhiRegions");
122 for (
auto&
pset : etaPhiRegions) {
124 etaPhiRegionData_.emplace_back(createEtaPhiRegionData(
127 consumesCollector()));
130 outputProductNames_ = para.
getParameter<std::vector<std::string>>(
"outputProductNames");
131 inputCollTags_ = para.
getParameter<std::vector<edm::InputTag>>(
"inputCollTags");
132 if (outputProductNames_.size() != inputCollTags_.size()) {
134 <<
" error outputProductNames and inputCollTags must be the same size, they are " << outputProductNames_.size()
135 <<
" vs " << inputCollTags_.size();
137 for (
unsigned int collNr = 0; collNr < inputCollTags_.size(); collNr++) {
138 inputTokens_.push_back(consumes<CaloObjCollType>(inputCollTags_[collNr]));
139 produces<CaloObjCollType>(outputProductNames_[collNr]);
143 template <
typename CaloObjType,
typename CaloObjCollType>
147 std::vector<std::string> outputProductNames;
148 outputProductNames.push_back(
"EcalRegionalRecHitsEB");
149 desc.
add<std::vector<std::string>>(
"outputProductNames", outputProductNames);
150 std::vector<edm::InputTag> inputColls;
152 desc.
add<std::vector<edm::InputTag>>(
"inputCollTags", inputColls);
153 std::vector<edm::ParameterSet> etaPhiRegions;
163 etaPhiRegions.push_back(ecalCandPSet);
167 etaPhiRegionDesc.
add<
double>(
"minEt");
168 etaPhiRegionDesc.
add<
double>(
"maxEt");
169 etaPhiRegionDesc.
add<
double>(
"maxDeltaR");
170 etaPhiRegionDesc.
add<
double>(
"maxDEta");
171 etaPhiRegionDesc.
add<
double>(
"maxDPhi");
173 desc.
addVPSet(
"etaPhiRegions", etaPhiRegionDesc, etaPhiRegions);
178 template <
typename CaloObjType,
typename CaloObjCollType>
185 std::vector<EtaPhiRegion>
regions;
186 std::for_each(etaPhiRegionData_.begin(),
187 etaPhiRegionData_.end(),
192 for (
size_t inputCollNr = 0; inputCollNr < inputTokens_.size(); inputCollNr++) {
194 event.getByToken(inputTokens_[inputCollNr],
inputColl);
197 edm::LogError(
"ProductNotFound") <<
"could not get a handle on the " <<
typeid(CaloObjCollType).
name()
198 <<
" named " << inputCollTags_[inputCollNr].encode() << std::endl;
206 template <
typename CaloObjType,
typename CaloObjCollType>
210 const std::vector<EtaPhiRegion>&
regions) {
211 auto outputColl = std::make_unique<CaloObjCollType>();
217 if (objGeom ==
nullptr) {
223 if (validIDForGeom(
obj.id())) {
225 <<
"for an object of type " <<
typeid(CaloObjType).
name() <<
" the geometry returned null for id "
227 <<
" in HLTCaloObjsInRegion, this shouldnt be possible and something has gone wrong, auto accepting "
233 float eta = objGeom->getPosition().eta();
234 float phi = objGeom->getPosition().phi();
252 template <
typename CaloObjType,
typename CaloObjCollType>
262 template <
typename CaloObjType,
typename CaloObjCollType>
265 if (
type ==
"L1EGamma") {
267 }
else if (
type ==
"L1Jet") {
269 }
else if (
type ==
"L1Muon") {
271 }
else if (
type ==
"L1Tau") {
273 }
else if (
type ==
"RecoEcalCandidate") {
275 }
else if (
type ==
"RecoChargedCandidate") {
277 }
else if (
type ==
"Electron") {
283 <<
" is not recognised, this means the rec-hit you think you are keeping may not be and you should fix this "
284 "error as it can lead to hard to find efficiency loses"
289 template <
typename CandCollType>
291 std::vector<EtaPhiRegion>&
regions)
const {
293 event.getByToken(token_,
cands);
296 if (
cand.et() >= minEt_ && (maxEt_ < 0 ||
cand.et() < maxEt_)) {