Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SimDataMixingSiPixelWorker_h
0002 #define SimDataMixingSiPixelWorker_h
0003 
0004 /** \class DataMixingSiPixelWorker
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 Si Pixel 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/SiPixelDigi/interface/PixelDigi.h"
0028 
0029 #include <map>
0030 #include <string>
0031 #include <vector>
0032 
0033 namespace edm {
0034   class ModuleCallingContext;
0035 
0036   class DataMixingSiPixelWorker {
0037   public:
0038     DataMixingSiPixelWorker();
0039 
0040     /** standard constructor*/
0041     explicit DataMixingSiPixelWorker(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC);
0042 
0043     /**Default destructor*/
0044     virtual ~DataMixingSiPixelWorker();
0045 
0046     void putSiPixel(edm::Event &e);
0047     void addSiPixelSignals(const edm::Event &e);
0048     void addSiPixelPileups(const int bcr,
0049                            const edm::EventPrincipal *,
0050                            unsigned int EventId,
0051                            ModuleCallingContext const *);
0052 
0053   private:
0054     // data specifiers
0055 
0056     edm::InputTag pixeldigi_collectionSig_;   // secondary name given to collection
0057                                               // of SiPixel digis
0058     edm::InputTag pixeldigi_collectionPile_;  // secondary name given to collection
0059                                               // of SiPixel digis
0060     std::string PixelDigiCollectionDM_;       // secondary name to be given to new SiPixel digis
0061 
0062     edm::EDGetTokenT<edm::DetSetVector<PixelDigi>> PixelDigiToken_;   // Token to retrieve information
0063     edm::EDGetTokenT<edm::DetSetVector<PixelDigi>> PixelDigiPToken_;  // Token to retrieve information
0064 
0065     //
0066 
0067     typedef std::multimap<int, PixelDigi> OneDetectorMap;      // maps by pixel ID for later combination - can have
0068                                                                // duplicate pixels
0069     typedef std::map<uint32_t, OneDetectorMap> SiGlobalIndex;  // map to all data for each detector ID
0070 
0071     SiGlobalIndex SiHitStorage_;
0072 
0073     //      unsigned int eventId_; //=0 for signal, from 1-n for pileup events
0074 
0075     std::string label_;
0076   };
0077 }  // namespace edm
0078 
0079 #endif  // SimDataMixingSiPixelWorker_h