CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/HLTrigger/special/src/HLTDummyCollections.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    HLTDummyCollections
00004 // Class:      HLTDummyCollections
00005 // 
00013 //
00014 // Original Author:  Emmanuelle Perez
00015 //         Created:  Tue May 19 09:54:19 CEST 2009
00016 // $Id: HLTDummyCollections.cc,v 1.4 2010/07/30 04:55:49 wmtan Exp $
00017 //
00018 //
00019 
00020 
00021 // system include files
00022 #include <memory>
00023 
00024 // user include files
00025 #include "FWCore/Framework/interface/Frameworkfwd.h"
00026 #include "FWCore/Framework/interface/EDProducer.h"
00027 
00028 #include "FWCore/Framework/interface/Event.h"
00029 #include "FWCore/Framework/interface/MakerMacros.h"
00030 
00031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00032 
00033 // -- Ecal
00034 #include "EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitFacility.h"
00035 // -- Hcal
00036 #include "EventFilter/HcalRawToDigi/plugins/HcalRawToDigi.h"
00037 // -- Ecal Preshower
00038 #include "EventFilter/ESRawToDigi/interface/ESRawToDigi.h"
00039 // -- Muons DT
00040 #include <DataFormats/DTDigi/interface/DTDigiCollection.h>
00041 #include <DataFormats/DTDigi/interface/DTLocalTriggerCollection.h>
00042 // -- Muons CSC
00043 #include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h"
00044 #include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
00045 #include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h"
00046 #include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h"
00047 #include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h"
00048 #include "DataFormats/CSCDigi/interface/CSCRPCDigiCollection.h"
00049 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
00050 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00051 // -- SiPixels
00052 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
00053 #include "DataFormats/Common/interface/DetSetVector.h"
00054 // -- SiStrips
00055 #include "DataFormats/Common/interface/LazyGetter.h"
00056 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
00057 // --- GCT
00058 #include "EventFilter/GctRawToDigi/plugins/GctRawToDigi.h"
00059 
00060 // -- ObjectMap
00061 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h"
00062 
00063 
00064 //
00065 // class decleration
00066 //
00067 
00068 class HLTDummyCollections : public edm::EDProducer {
00069   public:
00070     explicit HLTDummyCollections(const edm::ParameterSet&);
00071     ~HLTDummyCollections();
00072 
00073   private:
00074     virtual void produce(edm::Event&, const edm::EventSetup&);
00075 
00076     // ----------member data ---------------------------
00077 
00078     std::string action_;
00079     bool doEcal_ ;
00080     bool doHcal_; 
00081     bool unpackZDC_ ;
00082     bool doEcalPreshower_ ;
00083     std::string ESdigiCollection_;
00084     bool doMuonDTDigis_ ;
00085     bool doMuonCSCDigis_ ;
00086     bool doSiPixelDigis_;
00087     bool doSiStrip_ ;
00088     bool doGCT_ ;
00089     bool doObjectMap_ ;
00090 
00091 };
00092 
00093 //
00094 // constants, enums and typedefs
00095 //
00096 
00097 
00098 //
00099 // static data member definitions
00100 //
00101 
00102 //
00103 // constructors and destructor
00104 //
00105 HLTDummyCollections::HLTDummyCollections(const edm::ParameterSet& iConfig)
00106 {
00107   action_           = iConfig.getParameter<std::string>("action");
00108   unpackZDC_        = iConfig.getParameter<bool>("UnpackZDC");
00109   ESdigiCollection_ = iConfig.getParameter<std::string>("ESdigiCollection");
00110 
00111   doEcal_           = ( action_ == "doEcal");
00112   doHcal_           = ( action_ == "doHcal");
00113   doEcalPreshower_  = ( action_ == "doEcalPreshower");
00114   doMuonDTDigis_    = ( action_ == "doMuonDT");
00115   doMuonCSCDigis_   = ( action_ == "doMuonCSC");
00116   doSiPixelDigis_   = ( action_ == "doSiPixel");
00117   doSiStrip_        = ( action_ == "doSiStrip");
00118   doObjectMap_      = ( action_ == "doObjectMap");
00119   doGCT_            = ( action_ == "doGCT");
00120 
00121   if (doEcal_) {
00122     // ECAL unpacking :
00123     produces< edm::LazyGetter<EcalRecHit> >();
00124   }
00125 
00126   if (doHcal_) {
00127     // HCAL unpacking
00128     produces<HBHEDigiCollection>();
00129     produces<HFDigiCollection>();
00130     produces<HODigiCollection>();
00131     produces<HcalTrigPrimDigiCollection>();
00132     produces<HOTrigPrimDigiCollection>();
00133     if (unpackZDC_) {
00134       produces<ZDCDigiCollection>();
00135     }
00136   }
00137 
00138   if (doEcalPreshower_) {
00139     produces<ESDigiCollection>();
00140   }
00141 
00142   if (doMuonDTDigis_) {
00143     produces<DTDigiCollection>();
00144     produces<DTLocalTriggerCollection>();
00145   }
00146 
00147   if (doMuonCSCDigis_) {
00148     produces<CSCWireDigiCollection>("MuonCSCWireDigi");
00149     produces<CSCStripDigiCollection>("MuonCSCStripDigi");
00150     produces<CSCALCTDigiCollection>("MuonCSCALCTDigi");
00151     produces<CSCCLCTDigiCollection>("MuonCSCCLCTDigi");
00152     produces<CSCComparatorDigiCollection>("MuonCSCComparatorDigi");
00153     produces<CSCRPCDigiCollection>("MuonCSCRPCDigi");
00154     produces<CSCCorrelatedLCTDigiCollection>("MuonCSCCorrelatedLCTDigi");
00155   }
00156 
00157 
00158   if (doSiPixelDigis_) {
00159     produces< edm::DetSetVector<PixelDigi> >();
00160   }
00161 
00162   if (doSiStrip_) {
00163     produces< edm::LazyGetter<SiStripCluster> >();
00164   }
00165 
00166   if (doGCT_) {
00167     // GCT output collections
00168     produces<L1GctEmCandCollection>("isoEm");
00169     produces<L1GctEmCandCollection>("nonIsoEm");
00170     produces<L1GctJetCandCollection>("cenJets");
00171     produces<L1GctJetCandCollection>("forJets");
00172     produces<L1GctJetCandCollection>("tauJets");
00173     produces<L1GctHFBitCountsCollection>();
00174     produces<L1GctHFRingEtSumsCollection>();
00175     produces<L1GctEtTotalCollection>();
00176     produces<L1GctEtHadCollection>();
00177     produces<L1GctEtMissCollection>();
00178     produces<L1GctHtMissCollection>();
00179     produces<L1GctJetCountsCollection>();  // Deprecated (empty collection still needed by GT)
00180   }
00181 
00182   if (doObjectMap_) {
00183     produces<L1GlobalTriggerObjectMapRecord>();
00184   }
00185 }
00186 
00187 HLTDummyCollections::~HLTDummyCollections()
00188 {
00189   // do anything here that needs to be done at desctruction time
00190   // (e.g. close files, deallocate resources etc.)
00191 }
00192 
00193 
00194 //
00195 // member functions
00196 //
00197 
00198 // ------------ method called to produce the data  ------------
00199 void
00200 HLTDummyCollections::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
00201 {
00202   using namespace edm;
00203 
00204   if (doEcal_) {
00205     std::auto_ptr< edm::LazyGetter<EcalRecHit> > Ecalcollection( new edm::LazyGetter<EcalRecHit> );
00206     iEvent.put(Ecalcollection);
00207   }
00208 
00209   if (doHcal_) {
00210     std::auto_ptr<HBHEDigiCollection> hbhe_prod(new HBHEDigiCollection()); 
00211     std::auto_ptr<HFDigiCollection> hf_prod(new HFDigiCollection());
00212     std::auto_ptr<HODigiCollection> ho_prod(new HODigiCollection());
00213     std::auto_ptr<HcalTrigPrimDigiCollection> htp_prod(new HcalTrigPrimDigiCollection());  
00214     std::auto_ptr<HOTrigPrimDigiCollection> hotp_prod(new HOTrigPrimDigiCollection());  
00215     iEvent.put(hbhe_prod);
00216     iEvent.put(hf_prod);
00217     iEvent.put(ho_prod);
00218     iEvent.put(htp_prod);
00219     iEvent.put(hotp_prod);
00220     if (unpackZDC_) {
00221       std::auto_ptr<ZDCDigiCollection> zdcprod(new ZDCDigiCollection());
00222       iEvent.put(zdcprod);
00223     }
00224   }
00225 
00226   if (doEcalPreshower_) {
00227     std::auto_ptr<ESDigiCollection> productDigis(new ESDigiCollection);  
00228     iEvent.put(productDigis, ESdigiCollection_);
00229   }
00230 
00231   if (doMuonDTDigis_) {
00232     std::auto_ptr<DTDigiCollection> detectorProduct(new DTDigiCollection);
00233     std::auto_ptr<DTLocalTriggerCollection> triggerProduct(new DTLocalTriggerCollection);
00234     iEvent.put(detectorProduct);
00235     iEvent.put(triggerProduct);
00236   }
00237 
00238   if (doMuonCSCDigis_) {
00239     std::auto_ptr<CSCWireDigiCollection> wireProduct(new CSCWireDigiCollection);
00240     std::auto_ptr<CSCStripDigiCollection> stripProduct(new CSCStripDigiCollection);
00241     std::auto_ptr<CSCALCTDigiCollection> alctProduct(new CSCALCTDigiCollection);
00242     std::auto_ptr<CSCCLCTDigiCollection> clctProduct(new CSCCLCTDigiCollection);
00243     std::auto_ptr<CSCComparatorDigiCollection> comparatorProduct(new CSCComparatorDigiCollection);
00244     std::auto_ptr<CSCRPCDigiCollection> rpcProduct(new CSCRPCDigiCollection);
00245     std::auto_ptr<CSCCorrelatedLCTDigiCollection> corrlctProduct(new CSCCorrelatedLCTDigiCollection);
00246 
00247     iEvent.put(wireProduct,"MuonCSCWireDigi");
00248     iEvent.put(stripProduct,"MuonCSCStripDigi");
00249     iEvent.put(alctProduct,"MuonCSCALCTDigi");
00250     iEvent.put(clctProduct,"MuonCSCCLCTDigi");
00251     iEvent.put(comparatorProduct,"MuonCSCComparatorDigi");
00252     iEvent.put(rpcProduct,"MuonCSCRPCDigi");
00253     iEvent.put(corrlctProduct,"MuonCSCCorrelatedLCTDigi");
00254   }
00255 
00256   if (doSiPixelDigis_) {
00257     std::auto_ptr< edm::DetSetVector<PixelDigi> > SiPicollection( new edm::DetSetVector<PixelDigi> );
00258     iEvent.put(SiPicollection);
00259   }
00260 
00261   if (doSiStrip_) {
00262     std::auto_ptr< edm::LazyGetter<SiStripCluster> > SiStripcollection( new edm::LazyGetter<SiStripCluster> );
00263     iEvent.put(SiStripcollection);
00264   }
00265 
00266   if (doGCT_) {
00267     std::auto_ptr<L1GctEmCandCollection> m_gctIsoEm( new L1GctEmCandCollection) ;
00268     std::auto_ptr<L1GctEmCandCollection> m_gctNonIsoEm(new L1GctEmCandCollection);
00269     std::auto_ptr<L1GctJetCandCollection> m_gctCenJets(new L1GctJetCandCollection);
00270     std::auto_ptr<L1GctJetCandCollection> m_gctForJets(new L1GctJetCandCollection);
00271     std::auto_ptr<L1GctJetCandCollection> m_gctTauJets(new L1GctJetCandCollection);
00272     std::auto_ptr<L1GctHFBitCountsCollection> m_gctHfBitCounts(new L1GctHFBitCountsCollection);
00273     std::auto_ptr<L1GctHFRingEtSumsCollection> m_gctHfRingEtSums(new L1GctHFRingEtSumsCollection);
00274     std::auto_ptr<L1GctEtTotalCollection> m_gctEtTot(new L1GctEtTotalCollection);
00275     std::auto_ptr<L1GctEtHadCollection> m_gctEtHad(new L1GctEtHadCollection);
00276     std::auto_ptr<L1GctEtMissCollection> m_gctEtMiss(new L1GctEtMissCollection);
00277     std::auto_ptr<L1GctHtMissCollection> m_gctHtMiss(new L1GctHtMissCollection);
00278     std::auto_ptr<L1GctJetCountsCollection> m_gctJetCounts(new L1GctJetCountsCollection);  // DEPRECATED
00279 
00280     iEvent.put(m_gctIsoEm, "isoEm");
00281     iEvent.put(m_gctNonIsoEm, "nonIsoEm");
00282     iEvent.put(m_gctCenJets,"cenJets");
00283     iEvent.put(m_gctForJets,"forJets");
00284     iEvent.put(m_gctTauJets,"tauJets");
00285     iEvent.put(m_gctHfBitCounts);
00286     iEvent.put(m_gctHfRingEtSums);
00287     iEvent.put(m_gctEtTot);
00288     iEvent.put(m_gctEtHad);
00289     iEvent.put(m_gctEtMiss);
00290     iEvent.put(m_gctHtMiss);
00291     iEvent.put(m_gctJetCounts);  // Deprecated (empty collection still needed by GT)
00292   }
00293 
00294   if (doObjectMap_) {
00295     std::auto_ptr<L1GlobalTriggerObjectMapRecord> gtObjectMapRecord(
00296         new L1GlobalTriggerObjectMapRecord() );
00297     iEvent.put(gtObjectMapRecord);
00298   }
00299 
00300 }
00301 
00302 //define this as a plug-in
00303 DEFINE_FWK_MODULE(HLTDummyCollections);