28 if (!(hitLabels.size() == 2))
throw cms::Exception(
"ConfigError",
"ecalhitLabels should contain 2 labels: one for RecHits in barrel, the other for RecHits in endcaps");
29 if (!(productLabels.size() == 2))
throw cms::Exception(
"ConfigError",
"productLabels should contain 2 labels: one for RecHits in barrel, the other for RecHits in endcaps");
32 for (
unsigned int i=0;
i<hitLabels.size();
i++) {
33 hitTokens.push_back(consumes<EcalRecHitCollection>(hitLabels[
i]));
34 produces<EcalRecHitCollection> (productLabels[
i]);
44 std::vector<std::string> productTags;
45 productTags.push_back(
"EcalTimeCleanedRecHitsEB");
46 productTags.push_back(
"EcalTimeCleanedRecHitsEE");
47 desc.
add<std::vector<std::string>>(
"productLabels", productTags);
48 std::vector<edm::InputTag> inputTags;
49 inputTags.push_back(
edm::InputTag(
"hltEcalRecHitAll:EcalRecHitsEB"));
50 inputTags.push_back(
edm::InputTag(
"hltEcalRecHitAll:EcalRecHitsEE"));
51 desc.
add<std::vector<edm::InputTag>>(
"ecalhitLabels", inputTags);
52 desc.
add<
double>(
"TimeMax", 10);
53 desc.
add<
double>(
"TimeMin", -10);
54 descriptions.
add((
"hltEgammaHLTTimeCleanedRechitProducer"), desc);
66 if (!(rhcH[i].isValid())) {
67 edm::LogError(
"ProductNotFound")<<
"could not get a handle on the EcalRecHitCollection! (" <<
hitLabels[
i].encode() <<
")" << std::endl;
73 for (it = recHits->
begin(); it != recHits->
end(); it++){
T getParameter(std::string const &) const
EgammaHLTTimeCleanedRechitProducer(const edm::ParameterSet &ps)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< EcalRecHit >::const_iterator const_iterator
virtual void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
~EgammaHLTTimeCleanedRechitProducer()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const_iterator end() const
T const * product() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > hitTokens
std::vector< std::string > productLabels
std::vector< edm::InputTag > hitLabels
const_iterator begin() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)