Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-04 23:06:06

0001 // -*- C++ -*-
0002 //
0003 // Package:    HLTDummyCollections
0004 // Class:      HLTDummyCollections
0005 //
0006 /**\class HLTDummyCollections HLTDummyCollections.cc HLTrigger/HLTDummyCollections/src/HLTDummyCollections.cc
0007 
0008 Description: <one line class summary>
0009 
0010 Implementation:
0011 <Notes on implementation>
0012  */
0013 //
0014 // Original Author:  Emmanuelle Perez
0015 //         Created:  Tue May 19 09:54:19 CEST 2009
0016 //
0017 //
0018 
0019 // system include files
0020 #include <memory>
0021 
0022 // user include files
0023 #include "FWCore/Framework/interface/Frameworkfwd.h"
0024 #include "FWCore/Framework/interface/global/EDProducer.h"
0025 
0026 #include "FWCore/Framework/interface/Event.h"
0027 #include "FWCore/Framework/interface/MakerMacros.h"
0028 
0029 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0030 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0031 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0032 
0033 // -- Ecal
0034 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0035 #include "DataFormats/EcalRecHit/interface/EcalRecHitComparison.h"
0036 // -- Hcal
0037 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0038 
0039 // -- Ecal Preshower
0040 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0041 // -- Muons DT
0042 #include <DataFormats/DTDigi/interface/DTDigiCollection.h>
0043 #include <DataFormats/DTDigi/interface/DTLocalTriggerCollection.h>
0044 // -- Muons CSC
0045 #include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h"
0046 #include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
0047 #include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h"
0048 #include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h"
0049 #include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h"
0050 #include "DataFormats/CSCDigi/interface/CSCRPCDigiCollection.h"
0051 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
0052 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0053 // -- SiPixels
0054 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
0055 #include "DataFormats/Common/interface/DetSetVector.h"
0056 // -- SiStrips
0057 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0058 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
0059 // --- GCT
0060 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctCollections.h"
0061 
0062 // -- ObjectMap
0063 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h"
0064 
0065 //
0066 // class decleration
0067 //
0068 
0069 class HLTDummyCollections : public edm::global::EDProducer<> {
0070 public:
0071   explicit HLTDummyCollections(const edm::ParameterSet&);
0072   ~HLTDummyCollections() override;
0073   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0074 
0075 private:
0076   void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
0077 
0078   // ----------member data ---------------------------
0079 
0080   //bool doEcal_ ;
0081   bool doHcal_;
0082   bool unpackZDC_;
0083   bool doEcalPreshower_;
0084   std::string ESdigiCollection_;
0085   bool doMuonDTDigis_;
0086   bool doMuonCSCDigis_;
0087   bool doSiPixelDigis_;
0088   bool doSiStrip_;
0089   bool doGCT_;
0090   bool doObjectMap_;
0091 };
0092 
0093 //
0094 // constants, enums and typedefs
0095 //
0096 
0097 //
0098 // static data member definitions
0099 //
0100 
0101 //
0102 // constructors and destructor
0103 //
0104 HLTDummyCollections::HLTDummyCollections(const edm::ParameterSet& iConfig) {
0105   auto action = iConfig.getParameter<std::string>("action");
0106   unpackZDC_ = iConfig.getParameter<bool>("UnpackZDC");
0107   ESdigiCollection_ = iConfig.getParameter<std::string>("ESdigiCollection");
0108 
0109   //  doEcal_           = ( action == "doEcal");
0110   doHcal_ = (action == "doHcal");
0111   doEcalPreshower_ = (action == "doEcalPreshower");
0112   doMuonDTDigis_ = (action == "doMuonDT");
0113   doMuonCSCDigis_ = (action == "doMuonCSC");
0114   doSiPixelDigis_ = (action == "doSiPixel");
0115   doSiStrip_ = (action == "doSiStrip");
0116   doObjectMap_ = (action == "doObjectMap");
0117   doGCT_ = (action == "doGCT");
0118 
0119   /* This interface is out of data and I do not know what is the proper replacement
0120   if (doEcal_) {
0121     // ECAL unpacking :
0122     produces< edm::LazyGetter<EcalRecHit> >();
0123   } */
0124 
0125   if (doHcal_) {
0126     // HCAL unpacking
0127     produces<HBHEDigiCollection>();
0128     produces<HFDigiCollection>();
0129     produces<HODigiCollection>();
0130     produces<HcalTrigPrimDigiCollection>();
0131     produces<HOTrigPrimDigiCollection>();
0132     if (unpackZDC_) {
0133       produces<ZDCDigiCollection>();
0134     }
0135   }
0136 
0137   if (doEcalPreshower_) {
0138     produces<ESDigiCollection>();
0139   }
0140 
0141   if (doMuonDTDigis_) {
0142     produces<DTDigiCollection>();
0143     produces<DTLocalTriggerCollection>();
0144   }
0145 
0146   if (doMuonCSCDigis_) {
0147     produces<CSCWireDigiCollection>("MuonCSCWireDigi");
0148     produces<CSCStripDigiCollection>("MuonCSCStripDigi");
0149     produces<CSCALCTDigiCollection>("MuonCSCALCTDigi");
0150     produces<CSCCLCTDigiCollection>("MuonCSCCLCTDigi");
0151     produces<CSCComparatorDigiCollection>("MuonCSCComparatorDigi");
0152     produces<CSCRPCDigiCollection>("MuonCSCRPCDigi");
0153     produces<CSCCorrelatedLCTDigiCollection>("MuonCSCCorrelatedLCTDigi");
0154   }
0155 
0156   if (doSiPixelDigis_) {
0157     produces<edm::DetSetVector<PixelDigi> >();
0158   }
0159 
0160   if (doSiStrip_) {
0161     produces<edmNew::DetSetVector<SiStripCluster> >();
0162   }
0163 
0164   if (doGCT_) {
0165     // GCT output collections
0166     produces<L1GctEmCandCollection>("isoEm");
0167     produces<L1GctEmCandCollection>("nonIsoEm");
0168     produces<L1GctJetCandCollection>("cenJets");
0169     produces<L1GctJetCandCollection>("forJets");
0170     produces<L1GctJetCandCollection>("tauJets");
0171     produces<L1GctHFBitCountsCollection>();
0172     produces<L1GctHFRingEtSumsCollection>();
0173     produces<L1GctEtTotalCollection>();
0174     produces<L1GctEtHadCollection>();
0175     produces<L1GctEtMissCollection>();
0176     produces<L1GctHtMissCollection>();
0177     produces<L1GctJetCountsCollection>();  // Deprecated (empty collection still needed by GT)
0178   }
0179 
0180   if (doObjectMap_) {
0181     produces<L1GlobalTriggerObjectMapRecord>();
0182   }
0183 }
0184 
0185 HLTDummyCollections::~HLTDummyCollections() {
0186   // do anything here that needs to be done at desctruction time
0187   // (e.g. close files, deallocate resources etc.)
0188 }
0189 
0190 void HLTDummyCollections::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0191   edm::ParameterSetDescription desc;
0192   desc.add<std::string>("action", "");
0193   desc.add<bool>("UnpackZDC", false);
0194   desc.add<std::string>("ESdigiCollection", "");
0195   descriptions.add("HLTDummyCollections", desc);
0196 }
0197 
0198 //
0199 // member functions
0200 //
0201 
0202 // ------------ method called to produce the data  ------------
0203 void HLTDummyCollections::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const {
0204   using namespace edm;
0205 
0206   /*
0207   if (doEcal_) {
0208     std::unique_ptr< edm::LazyGetter<EcalRecHit> > Ecalcollection( new edm::LazyGetter<EcalRecHit> );
0209     iEvent.put(std::move(Ecalcollection));
0210     } */
0211 
0212   if (doHcal_) {
0213     std::unique_ptr<HBHEDigiCollection> hbhe_prod(new HBHEDigiCollection());
0214     std::unique_ptr<HFDigiCollection> hf_prod(new HFDigiCollection());
0215     std::unique_ptr<HODigiCollection> ho_prod(new HODigiCollection());
0216     std::unique_ptr<HcalTrigPrimDigiCollection> htp_prod(new HcalTrigPrimDigiCollection());
0217     std::unique_ptr<HOTrigPrimDigiCollection> hotp_prod(new HOTrigPrimDigiCollection());
0218     iEvent.put(std::move(hbhe_prod));
0219     iEvent.put(std::move(hf_prod));
0220     iEvent.put(std::move(ho_prod));
0221     iEvent.put(std::move(htp_prod));
0222     iEvent.put(std::move(hotp_prod));
0223     if (unpackZDC_) {
0224       std::unique_ptr<ZDCDigiCollection> zdcprod(new ZDCDigiCollection());
0225       iEvent.put(std::move(zdcprod));
0226     }
0227   }
0228 
0229   if (doEcalPreshower_) {
0230     std::unique_ptr<ESDigiCollection> productDigis(new ESDigiCollection);
0231     iEvent.put(std::move(productDigis), ESdigiCollection_);
0232   }
0233 
0234   if (doMuonDTDigis_) {
0235     std::unique_ptr<DTDigiCollection> detectorProduct(new DTDigiCollection);
0236     std::unique_ptr<DTLocalTriggerCollection> triggerProduct(new DTLocalTriggerCollection);
0237     iEvent.put(std::move(detectorProduct));
0238     iEvent.put(std::move(triggerProduct));
0239   }
0240 
0241   if (doMuonCSCDigis_) {
0242     std::unique_ptr<CSCWireDigiCollection> wireProduct(new CSCWireDigiCollection);
0243     std::unique_ptr<CSCStripDigiCollection> stripProduct(new CSCStripDigiCollection);
0244     std::unique_ptr<CSCALCTDigiCollection> alctProduct(new CSCALCTDigiCollection);
0245     std::unique_ptr<CSCCLCTDigiCollection> clctProduct(new CSCCLCTDigiCollection);
0246     std::unique_ptr<CSCComparatorDigiCollection> comparatorProduct(new CSCComparatorDigiCollection);
0247     std::unique_ptr<CSCRPCDigiCollection> rpcProduct(new CSCRPCDigiCollection);
0248     std::unique_ptr<CSCCorrelatedLCTDigiCollection> corrlctProduct(new CSCCorrelatedLCTDigiCollection);
0249 
0250     iEvent.put(std::move(wireProduct), "MuonCSCWireDigi");
0251     iEvent.put(std::move(stripProduct), "MuonCSCStripDigi");
0252     iEvent.put(std::move(alctProduct), "MuonCSCALCTDigi");
0253     iEvent.put(std::move(clctProduct), "MuonCSCCLCTDigi");
0254     iEvent.put(std::move(comparatorProduct), "MuonCSCComparatorDigi");
0255     iEvent.put(std::move(rpcProduct), "MuonCSCRPCDigi");
0256     iEvent.put(std::move(corrlctProduct), "MuonCSCCorrelatedLCTDigi");
0257   }
0258 
0259   if (doSiPixelDigis_) {
0260     std::unique_ptr<edm::DetSetVector<PixelDigi> > SiPicollection(new edm::DetSetVector<PixelDigi>);
0261     iEvent.put(std::move(SiPicollection));
0262   }
0263 
0264   if (doSiStrip_) {
0265     std::unique_ptr<edmNew::DetSetVector<SiStripCluster> > SiStripcollection(new edmNew::DetSetVector<SiStripCluster>);
0266     iEvent.put(std::move(SiStripcollection));
0267   }
0268 
0269   if (doGCT_) {
0270     std::unique_ptr<L1GctEmCandCollection> m_gctIsoEm(new L1GctEmCandCollection);
0271     std::unique_ptr<L1GctEmCandCollection> m_gctNonIsoEm(new L1GctEmCandCollection);
0272     std::unique_ptr<L1GctJetCandCollection> m_gctCenJets(new L1GctJetCandCollection);
0273     std::unique_ptr<L1GctJetCandCollection> m_gctForJets(new L1GctJetCandCollection);
0274     std::unique_ptr<L1GctJetCandCollection> m_gctTauJets(new L1GctJetCandCollection);
0275     std::unique_ptr<L1GctHFBitCountsCollection> m_gctHfBitCounts(new L1GctHFBitCountsCollection);
0276     std::unique_ptr<L1GctHFRingEtSumsCollection> m_gctHfRingEtSums(new L1GctHFRingEtSumsCollection);
0277     std::unique_ptr<L1GctEtTotalCollection> m_gctEtTot(new L1GctEtTotalCollection);
0278     std::unique_ptr<L1GctEtHadCollection> m_gctEtHad(new L1GctEtHadCollection);
0279     std::unique_ptr<L1GctEtMissCollection> m_gctEtMiss(new L1GctEtMissCollection);
0280     std::unique_ptr<L1GctHtMissCollection> m_gctHtMiss(new L1GctHtMissCollection);
0281     std::unique_ptr<L1GctJetCountsCollection> m_gctJetCounts(new L1GctJetCountsCollection);  // DEPRECATED
0282 
0283     iEvent.put(std::move(m_gctIsoEm), "isoEm");
0284     iEvent.put(std::move(m_gctNonIsoEm), "nonIsoEm");
0285     iEvent.put(std::move(m_gctCenJets), "cenJets");
0286     iEvent.put(std::move(m_gctForJets), "forJets");
0287     iEvent.put(std::move(m_gctTauJets), "tauJets");
0288     iEvent.put(std::move(m_gctHfBitCounts));
0289     iEvent.put(std::move(m_gctHfRingEtSums));
0290     iEvent.put(std::move(m_gctEtTot));
0291     iEvent.put(std::move(m_gctEtHad));
0292     iEvent.put(std::move(m_gctEtMiss));
0293     iEvent.put(std::move(m_gctHtMiss));
0294     iEvent.put(std::move(m_gctJetCounts));  // Deprecated (empty collection still needed by GT)
0295   }
0296 
0297   if (doObjectMap_) {
0298     std::unique_ptr<L1GlobalTriggerObjectMapRecord> gtObjectMapRecord(new L1GlobalTriggerObjectMapRecord());
0299     iEvent.put(std::move(gtObjectMapRecord));
0300   }
0301 }
0302 
0303 // declare this class as a framework plugin
0304 DEFINE_FWK_MODULE(HLTDummyCollections);