170 std::unique_ptr<const CaloSubdetectorTopology> topology;
181 std::vector<RectangularEtaPhiRegion>
regions;
191 auto uhits = std::make_unique<EcalUncalibratedRecHitCollection>();
195 edm::LogError(
"ProductNotFound") <<
"could not get a handle on the EcalRecHitCollection! ("
201 if (!uncalibRecHits->
empty()) {
202 if ((*uncalibRecHits)[0].id().subdetId() ==
EcalBarrel) {
204 topology = std::make_unique<EcalBarrelTopology>(
geometry);
205 }
else if ((*uncalibRecHits)[0].id().subdetId() ==
EcalEndcap) {
207 topology = std::make_unique<EcalEndcapTopology>(
geometry);
208 }
else if ((*uncalibRecHits)[0].id().subdetId() ==
EcalPreshower) {
210 topology = std::make_unique<EcalPreshowerTopology>();
212 throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
214 if (!regions.empty()) {
217 for (it = uncalibRecHits->
begin(); it != uncalibRecHits->
end(); it++) {
218 auto this_cell = geometry_p->
getGeometry(it->id());
220 std::vector<RectangularEtaPhiRegion>::const_iterator
region;
221 for (region = regions.begin(); region != regions.end(); region++) {
222 if (region->inRegion(this_cell->etaPos(), this_cell->phiPos())) {
223 uhits->push_back(*it);
235 for (
unsigned int i = 0; i <
hitLabels.size(); i++) {
236 auto hits = std::make_unique<EcalRecHitCollection>();
240 edm::LogError(
"ProductNotFound") <<
"could not get a handle on the EcalRecHitCollection! ("
246 if (!recHits->
empty()) {
247 if ((*recHits)[0].id().subdetId() ==
EcalBarrel) {
249 topology = std::make_unique<EcalBarrelTopology>(
geometry);
250 }
else if ((*recHits)[0].id().subdetId() ==
EcalEndcap) {
252 topology = std::make_unique<EcalEndcapTopology>(
geometry);
255 topology = std::make_unique<EcalPreshowerTopology>();
257 throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
259 if (!regions.empty()) {
261 for (it = recHits->
begin(); it != recHits->
end(); it++) {
262 auto this_cell = geometry_p->
getGeometry(it->id());
264 std::vector<RectangularEtaPhiRegion>::const_iterator
region;
265 for (region = regions.begin(); region != regions.end(); region++) {
266 if (region->inRegion(this_cell->etaPos(), this_cell->phiPos())) {
267 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
const std::vector< std::string > productLabels
std::vector< T >::const_iterator const_iterator
const edm::EDGetTokenT< T1Collection > l1TokenIsolated_
Log< level::Error, false > LogError
bool getData(T &iHolder) const
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > hitTokens
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
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::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > l1CaloGeometryToken_
void getEtaPhiRegions(std::vector< RectangularEtaPhiRegion > *, T1Collection, const L1CaloGeometry &, bool)
const edm::EDGetTokenT< T1Collection > l1TokenNonIsolated_
const double l1LowerThrIgnoreIsolation_
const_iterator begin() const
std::vector< edm::EDGetTokenT< EcalUncalibratedRecHitCollection > > uncalibHitTokens