167 std::unique_ptr<const CaloSubdetectorTopology>
topology;
183 std::vector<RectangularEtaPhiRegion>
regions;
193 auto uhits = std::make_unique<EcalUncalibratedRecHitCollection>();
196 if (!(urhcH[i].isValid())) {
197 edm::LogError(
"ProductNotFound") <<
"could not get a handle on the EcalRecHitCollection! (" 203 if (!uncalibRecHits->
empty()) {
204 if ((*uncalibRecHits)[0].id().subdetId() ==
EcalBarrel) {
206 topology = std::make_unique<EcalBarrelTopology>(*geoHandle);
207 }
else if ((*uncalibRecHits)[0].
id().subdetId() ==
EcalEndcap) {
209 topology = std::make_unique<EcalEndcapTopology>(*geoHandle);
210 }
else if ((*uncalibRecHits)[0].
id().subdetId() ==
EcalPreshower) {
212 topology = std::make_unique<EcalPreshowerTopology>();
214 throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
216 if (!regions.empty()) {
219 for (it = uncalibRecHits->
begin(); it != uncalibRecHits->
end(); it++) {
220 auto this_cell = geometry_p->
getGeometry(it->id());
222 std::vector<RectangularEtaPhiRegion>::const_iterator
region;
223 for (region = regions.begin(); region != regions.end(); region++) {
224 if (region->inRegion(this_cell->etaPos(), this_cell->phiPos())) {
225 uhits->push_back(*it);
237 for (
unsigned int i = 0; i <
hitLabels.size(); i++) {
238 auto hits = std::make_unique<EcalRecHitCollection>();
241 if (!(rhcH[i].isValid())) {
242 edm::LogError(
"ProductNotFound") <<
"could not get a handle on the EcalRecHitCollection! (" 248 if (!recHits->
empty()) {
249 if ((*recHits)[0].id().subdetId() ==
EcalBarrel) {
251 topology = std::make_unique<EcalBarrelTopology>(*geoHandle);
252 }
else if ((*recHits)[0].
id().subdetId() ==
EcalEndcap) {
254 topology = std::make_unique<EcalEndcapTopology>(*geoHandle);
257 topology = std::make_unique<EcalPreshowerTopology>();
259 throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
261 if (!regions.empty()) {
263 for (it = recHits->
begin(); it != recHits->
end(); it++) {
264 auto this_cell = geometry_p->
getGeometry(it->id());
266 std::vector<RectangularEtaPhiRegion>::const_iterator
region;
267 for (region = regions.begin(); region != regions.end(); region++) {
268 if (region->inRegion(this_cell->etaPos(), this_cell->phiPos())) {
269 hits->push_back(*it);
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const std::vector< edm::InputTag > hitLabels
CaloTopology const * topology(0)
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_
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > hitTokens
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
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.
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