Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:12

0001 #ifndef RecoLocalMuon_GEMRecHit_GEMRecHitProducer_h
0002 #define RecoLocalMuon_GEMRecHit_GEMRecHitProducer_h
0003 
0004 /** \class GEMRecHitProducer
0005  *  Module for GEMRecHit production. 
0006  *  
0007  *  \author M. Maggim -- INFN Bari
0008  */
0009 
0010 #include "FWCore/Framework/interface/stream/EDProducer.h"
0011 #include "FWCore/Framework/interface/Event.h"
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0016 #include "FWCore/Utilities/interface/InputTag.h"
0017 #include "FWCore/Utilities/interface/ESGetToken.h"
0018 #include "Geometry/GEMGeometry/interface/GEMGeometry.h"
0019 #include "DataFormats/GEMDigi/interface/GEMDigiCollection.h"
0020 #include "CondFormats/GEMObjects/interface/GEMMaskedStrips.h"
0021 #include "CondFormats/GEMObjects/interface/GEMDeadStrips.h"
0022 #include "CondFormats/DataRecord/interface/GEMMaskedStripsRcd.h"
0023 #include "CondFormats/DataRecord/interface/GEMDeadStripsRcd.h"
0024 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0025 #include "RecoLocalMuon/GEMRecHit/interface/GEMRecHitBaseAlgo.h"
0026 
0027 class GEMRecHitProducer : public edm::stream::EDProducer<> {
0028 public:
0029   /// Constructor
0030   GEMRecHitProducer(const edm::ParameterSet& config);
0031 
0032   /// Destructor
0033   ~GEMRecHitProducer() override;
0034 
0035   // Method that access the EventSetup for each run
0036   void beginRun(const edm::Run&, const edm::EventSetup&) override;
0037 
0038   /// The method which produces the rechits
0039   void produce(edm::Event& event, const edm::EventSetup& setup) override;
0040 
0041   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0042 
0043 private:
0044   // The token to be used to retrieve GEM digis from the event
0045   edm::EDGetTokenT<GEMDigiCollection> theGEMDigiToken;
0046 
0047   // The reconstruction algorithm
0048   std::unique_ptr<GEMRecHitBaseAlgo> theAlgo;
0049 
0050   // Object with mask-strips-vector for all the GEM Detectors
0051   std::unique_ptr<GEMMaskedStrips> theGEMMaskedStripsObj;
0052 
0053   // Object with dead-strips-vector for all the GEM Detectors
0054   std::unique_ptr<GEMDeadStrips> theGEMDeadStripsObj;
0055 
0056   enum class MaskSource { File, EventSetup } maskSource_, deadSource_;
0057 
0058   edm::ESHandle<GEMGeometry> gemGeom_;
0059 
0060   edm::ESGetToken<GEMGeometry, MuonGeometryRecord> gemGeomToken_;
0061   edm::ESGetToken<GEMMaskedStrips, GEMMaskedStripsRcd> maskedStripsToken_;
0062   edm::ESGetToken<GEMDeadStrips, GEMDeadStripsRcd> deadStripsToken_;
0063 
0064   // map of mask and dead strips
0065   std::map<GEMDetId, EtaPartitionMask> gemMask_;
0066 
0067   bool applyMasking_;
0068   bool ge21Off_;
0069 };
0070 #endif