178 std::unique_ptr<const CaloSubdetectorTopology> topology;
186 std::vector<RectangularEtaPhiRegion>
regions;
196 auto uhits = std::make_unique<EcalUncalibratedRecHitCollection>();
200 edm::LogError(
"ProductNotFound") <<
"could not get a handle on the EcalRecHitCollection! ("
206 if (!uncalibRecHits->
empty()) {
207 if ((*uncalibRecHits)[0].id().subdetId() ==
EcalBarrel) {
209 topology = std::make_unique<EcalBarrelTopology>(
geometry);
210 }
else if ((*uncalibRecHits)[0].id().subdetId() ==
EcalEndcap) {
212 topology = std::make_unique<EcalEndcapTopology>(
geometry);
213 }
else if ((*uncalibRecHits)[0].id().subdetId() ==
EcalPreshower) {
215 topology = std::make_unique<EcalPreshowerTopology>();
217 throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
219 if (!regions.empty()) {
222 for (it = uncalibRecHits->
begin(); it != uncalibRecHits->
end(); it++) {
223 auto this_cell = geometry_p->
getGeometry(it->id());
225 std::vector<RectangularEtaPhiRegion>::const_iterator
region;
226 for (region = regions.begin(); region != regions.end(); region++) {
227 if (region->inRegion(this_cell->etaPos(), this_cell->phiPos())) {
228 uhits->push_back(*it);
240 for (
unsigned int i = 0; i <
hitLabels.size(); i++) {
241 auto hits = std::make_unique<EcalRecHitCollection>();
245 edm::LogError(
"ProductNotFound") <<
"could not get a handle on the EcalRecHitCollection! ("
251 if (!recHits->
empty()) {
252 if ((*recHits)[0].id().subdetId() ==
EcalBarrel) {
254 topology = std::make_unique<EcalBarrelTopology>(
geometry);
255 }
else if ((*recHits)[0].id().subdetId() ==
EcalEndcap) {
257 topology = std::make_unique<EcalEndcapTopology>(
geometry);
260 topology = std::make_unique<EcalPreshowerTopology>();
262 throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
264 if (!regions.empty()) {
266 for (it = recHits->
begin(); it != recHits->
end(); it++) {
267 auto this_cell = geometry_p->
getGeometry(it->id());
269 std::vector<RectangularEtaPhiRegion>::const_iterator
region;
270 for (region = regions.begin(); region != regions.end(); region++) {
271 if (region->inRegion(this_cell->etaPos(), this_cell->phiPos())) {
272 hits->push_back(*it);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
const std::vector< edm::InputTag > hitLabels
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
const std::vector< std::string > productLabels
std::vector< T >::const_iterator const_iterator
const edm::EDGetTokenT< T1Collection > l1TokenIsolated_
Log< level::Error, false > LogError
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > hitTokens
bool get(ProductID const &oid, Handle< PROD > &result) const
const_iterator end() const
T const * product() const
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
const edm::EDGetTokenT< T1Collection > l1TokenNonIsolated_
const double l1LowerThrIgnoreIsolation_
const_iterator begin() const
std::vector< edm::EDGetTokenT< EcalUncalibratedRecHitCollection > > uncalibHitTokens
void getEtaPhiRegions(std::vector< RectangularEtaPhiRegion > *, T1Collection const &, edm::EventSetup const &, bool const)