Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:33

0001 #ifndef SimDataMixingSiStripRawWorker_h
0002 #define SimDataMixingSiStripRawWorker_h
0003 
0004 /** \class DataMixingSiStripRawWorker
0005  *
0006  * DataMixingModule is the EDProducer subclass
0007  * that overlays rawdata events on top of MC,
0008  * using real data for pileup simulation
0009  * This class takes care of the SiStrip information
0010  *
0011  * \author Mike Hildreth, University of Notre Dame
0012  *
0013  * \version   1st Version October 2007
0014  *
0015  ************************************************************/
0016 
0017 #include "FWCore/Framework/interface/ConsumesCollector.h"
0018 #include "FWCore/Framework/interface/Event.h"
0019 #include "FWCore/Framework/interface/EventPrincipal.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 
0022 #include "DataFormats/Common/interface/Handle.h"
0023 #include "DataFormats/Provenance/interface/ProductID.h"
0024 // Data Formats
0025 #include "DataFormats/Common/interface/DetSet.h"
0026 #include "DataFormats/Common/interface/DetSetVector.h"
0027 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
0028 #include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h"
0029 
0030 #include <map>
0031 #include <string>
0032 #include <vector>
0033 
0034 namespace edm {
0035   class ModuleCallingContext;
0036 
0037   class DataMixingSiStripRawWorker {
0038   public:
0039     DataMixingSiStripRawWorker();
0040 
0041     /** standard constructor*/
0042     explicit DataMixingSiStripRawWorker(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC);
0043 
0044     /**Default destructor*/
0045     virtual ~DataMixingSiStripRawWorker();
0046 
0047     void putSiStrip(edm::Event &e);
0048     void addSiStripSignals(const edm::Event &e);
0049     void addSiStripPileups(const int bcr,
0050                            const edm::EventPrincipal *,
0051                            unsigned int EventId,
0052                            ModuleCallingContext const *);
0053 
0054   private:
0055     // data specifiers
0056 
0057     edm::InputTag Sistripdigi_collectionSig_;  // primary name given to collection
0058                                                // of SiStrip digis
0059     edm::InputTag SistripLabelSig_;            // secondary name given to collection of SiStrip digis
0060     edm::InputTag SiStripPileInputTag_;        // InputTag for pileup strips
0061     edm::InputTag SiStripRawInputTag_;         // InputTag for strips with rawdigis
0062     edm::EDGetTokenT<edm::DetSetVector<SiStripDigi>> SiStripInputTok_;        // InputToken for strips with rawdigis
0063     edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi>> SiStripRawInputTok_;  // InputToken for strips with rawdigis
0064     std::string SiStripDigiCollectionDM_;                                     // secondary name to be given to new
0065                                                                               // SiStrip raw digis
0066     std::string SiStripRawDigiSource_;                                        // which collection is rawdigis: either
0067                                                                               // "SIGNAL" or "PILEUP"
0068 
0069     //
0070 
0071     typedef std::vector<SiStripDigi> OneDetectorMap;           // maps by strip ID for later combination - can have
0072                                                                // duplicate strips
0073     typedef std::map<uint32_t, OneDetectorMap> SiGlobalIndex;  // map to all data for each detector ID
0074 
0075     SiGlobalIndex SiHitStorage_;
0076 
0077     // SiStripDigi and SiStripRawDigi collections
0078     const edm::DetSetVector<SiStripDigi> *digicollection_;
0079     const edm::DetSetVector<SiStripRawDigi> *rawdigicollection_;
0080 
0081     std::string label_;
0082   };
0083 }  // namespace edm
0084 
0085 #endif  // SimDataMixingSiStripRawWorker_h