Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:52

0001 #ifndef HCALSIMPLERECONSTRUCTOR_H
0002 #define HCALSIMPLERECONSTRUCTOR_H 1
0003 
0004 #include <memory>
0005 
0006 #include "FWCore/Framework/interface/stream/EDProducer.h"
0007 #include "FWCore/Framework/interface/Event.h"
0008 #include "DataFormats/Common/interface/Handle.h"
0009 #include "CondFormats/HcalObjects/interface/HcalRecoParams.h"
0010 #include "CondFormats/HcalObjects/interface/HcalRecoParam.h"
0011 #include "FWCore/Framework/interface/EventSetup.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/Utilities/interface/ESGetToken.h"
0014 
0015 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSimpleRecAlgo.h"
0016 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0017 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0018 
0019 namespace edm {
0020   class ConfigurationDescriptions;
0021 }
0022 
0023 /** \class HcalSimpleReconstructor
0024     
0025     \author J. Mans - Minnesota
0026     */
0027 class HcalTopology;
0028 class HcalRecNumberingRecord;
0029 class HcalRecoParamsRcd;
0030 class HcalDbService;
0031 class HcalDbRecord;
0032 
0033 class HcalSimpleReconstructor : public edm::stream::EDProducer<> {
0034 public:
0035   explicit HcalSimpleReconstructor(const edm::ParameterSet& ps);
0036   ~HcalSimpleReconstructor() override;
0037   void produce(edm::Event& e, const edm::EventSetup& c) final;
0038   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0039   void beginRun(edm::Run const& r, edm::EventSetup const& es) final;
0040   void endRun(edm::Run const& r, edm::EventSetup const& es) final;
0041 
0042 private:
0043   template <class DIGICOLL, class RECHITCOLL>
0044   void process(edm::Event& e, const edm::EventSetup& c, const edm::EDGetTokenT<DIGICOLL>& tok);
0045   HcalSimpleRecAlgo reco_;
0046   DetId::Detector det_;
0047   int subdet_;
0048   HcalOtherSubdetector subdetOther_;
0049   edm::InputTag inputLabel_;
0050 
0051   edm::EDGetTokenT<HFDigiCollection> tok_hf_;
0052   edm::EDGetTokenT<HODigiCollection> tok_ho_;
0053   edm::EDGetTokenT<HcalCalibDigiCollection> tok_calib_;
0054 
0055   bool dropZSmarkedPassed_;  // turn on/off dropping of zero suppression marked and passed digis
0056 
0057   // legacy parameters for config-set values compatibility
0058   // to be removed after 4_2_0...
0059   int firstSample_;
0060   int samplesToAdd_;
0061   bool tsFromDB_;
0062 
0063   std::unique_ptr<HcalRecoParams> paramTS_;  // firstSample & sampleToAdd from DB
0064 
0065   // ES tokens
0066   edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> htopoToken_;
0067   edm::ESGetToken<HcalRecoParams, HcalRecoParamsRcd> paramsToken_;
0068   edm::ESGetToken<HcalDbService, HcalDbRecord> conditionsToken_;
0069 };
0070 
0071 #endif