Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:04:40

0001 #ifndef SimDataMixingSiStripWorker_h
0002 #define SimDataMixingSiStripWorker_h
0003 
0004 /** \class DataMixingSiStripWorker
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 
0029 #include <map>
0030 #include <string>
0031 #include <vector>
0032 
0033 namespace edm {
0034   class ModuleCallingContext;
0035 
0036   class DataMixingSiStripWorker {
0037   public:
0038     DataMixingSiStripWorker();
0039 
0040     /** standard constructor*/
0041     explicit DataMixingSiStripWorker(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC);
0042 
0043     /**Default destructor*/
0044     virtual ~DataMixingSiStripWorker();
0045 
0046     void putSiStrip(edm::Event &e);
0047     void addSiStripSignals(const edm::Event &e);
0048     void addSiStripPileups(const int bcr,
0049                            const edm::EventPrincipal *,
0050                            unsigned int EventId,
0051                            ModuleCallingContext const *);
0052 
0053   private:
0054     // data specifiers
0055 
0056     edm::InputTag SistripLabelSig_;        // name given to collection of SiStrip digis
0057     edm::InputTag SiStripPileInputTag_;    // InputTag for pileup strips
0058     std::string SiStripDigiCollectionDM_;  // secondary name to be given to new
0059                                            // SiStrip digis
0060 
0061     edm::EDGetTokenT<edm::DetSetVector<SiStripDigi>> SiStripDigiToken_;   // Token to retrieve information
0062     edm::EDGetTokenT<edm::DetSetVector<SiStripDigi>> SiStripDigiPToken_;  // Token to retrieve information
0063 
0064     //
0065 
0066     typedef std::vector<SiStripDigi> OneDetectorMap;           // maps by strip ID for later combination - can have
0067                                                                // duplicate strips
0068     typedef std::map<uint32_t, OneDetectorMap> SiGlobalIndex;  // map to all data for each detector ID
0069 
0070     SiGlobalIndex SiHitStorage_;
0071 
0072     //      unsigned int eventId_; //=0 for signal, from 1-n for pileup events
0073 
0074     std::string label_;
0075 
0076     class StrictWeakOrdering {
0077     public:
0078       bool operator()(SiStripDigi i, SiStripDigi j) const { return i.strip() < j.strip(); }
0079     };
0080   };
0081 }  // namespace edm
0082 
0083 #endif  // SimDataMixingSiStripWorker_h