Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-30 22:39:12

0001 
0002 /** \class EcalMaxSampleUncalibRecHitProducer
0003  *   produce ECAL uncalibrated rechits from dataframes 
0004  *
0005  *  \author G. Franzoni, E. Di Marco
0006  *
0007  */
0008 
0009 #include "DataFormats/Common/interface/Handle.h"
0010 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0011 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0012 #include "DataFormats/EcalRecHit/interface/EcalUncalibratedRecHit.h"
0013 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0014 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0015 #include "FWCore/ParameterSet/interface/EmptyGroupDescription.h"
0016 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0017 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitMaxSampleAlgo.h"
0018 #include "RecoLocalCalo/EcalRecProducers/interface/EcalUncalibRecHitWorkerRunOneDigiBase.h"
0019 
0020 #include <cmath>
0021 #include <iomanip>
0022 #include <iostream>
0023 #include <vector>
0024 
0025 class EcalUncalibRecHitWorkerMaxSample : public EcalUncalibRecHitWorkerRunOneDigiBase {
0026 public:
0027   EcalUncalibRecHitWorkerMaxSample(const edm::ParameterSet& ps, edm::ConsumesCollector& c);
0028   EcalUncalibRecHitWorkerMaxSample(){};
0029   ~EcalUncalibRecHitWorkerMaxSample() override{};
0030 
0031   void set(const edm::EventSetup& es) override;
0032   bool run(const edm::Event& evt,
0033            const EcalDigiCollection::const_iterator& digi,
0034            EcalUncalibratedRecHitCollection& result) override;
0035 
0036   edm::ParameterSetDescription getAlgoDescription() override;
0037 
0038 private:
0039   EcalUncalibRecHitMaxSampleAlgo<EBDataFrame> ebAlgo_;
0040   EcalUncalibRecHitMaxSampleAlgo<EEDataFrame> eeAlgo_;
0041 };
0042 
0043 EcalUncalibRecHitWorkerMaxSample::EcalUncalibRecHitWorkerMaxSample(const edm::ParameterSet& ps,
0044                                                                    edm::ConsumesCollector& c)
0045     : EcalUncalibRecHitWorkerRunOneDigiBase(ps, c) {}
0046 
0047 void EcalUncalibRecHitWorkerMaxSample::set(const edm::EventSetup& es) {}
0048 
0049 bool EcalUncalibRecHitWorkerMaxSample::run(const edm::Event& evt,
0050                                            const EcalDigiCollection::const_iterator& itdg,
0051                                            EcalUncalibratedRecHitCollection& result) {
0052   DetId detid(itdg->id());
0053 
0054   if (detid.subdetId() == EcalBarrel) {
0055     result.push_back(ebAlgo_.makeRecHit(*itdg, nullptr, nullptr, nullptr, nullptr));
0056   } else {
0057     result.push_back(eeAlgo_.makeRecHit(*itdg, nullptr, nullptr, nullptr, nullptr));
0058   }
0059 
0060   return true;
0061 }
0062 
0063 edm::ParameterSetDescription EcalUncalibRecHitWorkerMaxSample::getAlgoDescription() {
0064   edm::ParameterSetDescription psd;
0065   return psd;  //.addNode(std::unique_ptr<edm::ParameterDescriptionNode>(new edm::EmptyGroupDescription()));
0066 }
0067 
0068 #include "FWCore/Framework/interface/MakerMacros.h"
0069 #include "RecoLocalCalo/EcalRecProducers/interface/EcalUncalibRecHitWorkerFactory.h"
0070 DEFINE_EDM_PLUGIN(EcalUncalibRecHitWorkerFactory, EcalUncalibRecHitWorkerMaxSample, "EcalUncalibRecHitWorkerMaxSample");
0071 #include "RecoLocalCalo/EcalRecProducers/interface/EcalUncalibRecHitFillDescriptionWorkerFactory.h"
0072 DEFINE_EDM_PLUGIN(EcalUncalibRecHitFillDescriptionWorkerFactory,
0073                   EcalUncalibRecHitWorkerMaxSample,
0074                   "EcalUncalibRecHitWorkerMaxSample");