33 iConfig.
getParameter<std::vector<edm::InputTag>>(
"interestingDetIdCollections"),
35 return consumes<DetIdCollection>(tag);
39 reducedHitsCollection_ = iConfig.getParameter<
std::string>(
"reducedHitsCollection");
42 produces< EcalRecHitCollection > (reducedHitsCollection_) ;
61 edm::LogError(
"ReducedRecHitCollectionProducer") <<
"VInputTag collections empty" ;
68 std::vector<DetId> xtalsToStore((*detIds).size());
69 std::copy( (*detIds).begin() , (*detIds).end() , xtalsToStore.begin() );
82 << labels.
process <<
")" << std::endl;
87 for (
unsigned int ii=0;
ii<(*detId).size();
ii++)
89 if (
std::find(xtalsToStore.begin(),xtalsToStore.end(),(*detId)[
ii]) == xtalsToStore.end())
90 xtalsToStore.push_back((*detId)[
ii]);
96 if( !recHitsHandle.isValid() )
98 edm::LogError(
"ReducedRecHitCollectionProducer") <<
"RecHit collection not found";
105 for (
unsigned int iCry=0;iCry<xtalsToStore.size();iCry++)
108 if ( (iRecHit != recHitsHandle->end()) && (miniRecHitCollection->find(xtalsToStore[iCry]) == miniRecHitCollection->end()) )
109 miniRecHitCollection->push_back(*iRecHit);
112 std::sort(xtalsToStore.begin(), xtalsToStore.end());
113 std::unique(xtalsToStore.begin(), xtalsToStore.end());
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< EcalRecHit >::const_iterator const_iterator
const char * productInstance
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
edm::EDGetTokenT< EcalRecHitCollection > recHitsToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ReducedRecHitCollectionProducer(const edm::ParameterSet &)
ctor
std::vector< edm::EDGetTokenT< DetIdCollection > > interestingDetIdCollections_
~ReducedRecHitCollectionProducer()
virtual void produce(edm::Event &, const edm::EventSetup &)
producer
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
std::string reducedHitsCollection_