CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DataMixingSiStripMCDigiWorker.h
Go to the documentation of this file.
1 #ifndef DataMixingSiStripMCDigiWorker_h
2 #define SimDataMixingSiStripMCDigiWorker_h
3 
20 
24 
25 //Data Formats
29 
37 
43 
44 
45 #include <map>
46 #include <vector>
47 #include <string>
48 
49 namespace edm
50 {
51  class ModuleCallingContext;
52  class ConsumesCollector;
53 
55  {
56  public:
57 
59 
62 
65 
66  void putSiStrip(edm::Event &e, edm::EventSetup const& iSetup) ;
67  void addSiStripSignals(const edm::Event &e);
68  void addSiStripPileups(const int bcr, const edm::EventPrincipal*,unsigned int EventId,
69  ModuleCallingContext const*);
70 
71 
72  virtual void initializeEvent(const edm::Event &e, edm::EventSetup const& iSetup);
73 
74  void DMinitializeDetUnit(StripGeomDetUnit const * det, const edm::EventSetup& iSetup );
75 
76  private:
77  // data specifiers
78 
79  edm::InputTag SistripLabelSig_ ; // name given to collection of SiStrip digis
80  edm::InputTag SiStripPileInputTag_ ; // InputTag for pileup strips
81  std::string SiStripDigiCollectionDM_ ; // secondary name to be given to new SiStrip digis
82 
83  //
84 
85  typedef std::vector<SiStripDigi> OneDetectorMap; // maps by strip ID for later combination - can have duplicate strips
86  typedef std::map<uint32_t, OneDetectorMap> SiGlobalIndex; // map to all data for each detector ID
88 
90 
91 
92  // unsigned int eventId_; //=0 for signal, from 1-n for pileup events
93 
94  // variables for temporary storage of mixed hits:
95 
96  typedef float Amplitude;
97  typedef std::map<int, Amplitude> SignalMapType;
98  typedef std::map<uint32_t, SignalMapType> signalMaps;
99 
100  const SignalMapType* getSignal(uint32_t detID) const {
101  auto where = signals_.find(detID);
102  if(where == signals_.end()) {
103  return 0;
104  }
105  return &where->second;
106  }
107 
109 
110  // for noise adding:
111 
113 
115  bool peakMode;
116  double theThreshold;
120 
121  std::unique_ptr<SiGaussianTailNoiseAdder> theSiNoiseAdder;
122  std::unique_ptr<SiStripFedZeroSuppression> theSiZeroSuppress;
123  std::unique_ptr<SiTrivialDigitalConverter> theSiDigitalConverter;
124 
125 
127 
128  // bad channels for each detector ID
129  std::map<unsigned int, std::vector<bool> > allBadChannels;
130  // first and last channel wit signal for each detector ID
131  std::map<unsigned int, size_t> firstChannelsWithSignal;
132  std::map<unsigned int, size_t> lastChannelsWithSignal;
133 
134  //----------------------------
135 
137  public:
138  bool operator() (SiStripDigi i,SiStripDigi j) const {return i.strip() < j.strip();}
139  };
140 
141 
142  };
143 }//edm
144 
145 #endif
std::vector< SiStripDigi > DigitalVecType
int i
Definition: DBlmapReader.cc:9
std::map< unsigned int, size_t > firstChannelsWithSignal
virtual void initializeEvent(const edm::Event &e, edm::EventSetup const &iSetup)
SiDigitalConverter::DigitalVecType DigitalVecType
const uint16_t & strip() const
Definition: SiStripDigi.h:40
void addSiStripPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *)
int j
Definition: DBlmapReader.cc:9
void DMinitializeDetUnit(StripGeomDetUnit const *det, const edm::EventSetup &iSetup)
std::map< uint32_t, OneDetectorMap > SiGlobalIndex
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
std::unique_ptr< SiGaussianTailNoiseAdder > theSiNoiseAdder
const SignalMapType * getSignal(uint32_t detID) const
std::map< unsigned int, std::vector< bool > > allBadChannels
std::unique_ptr< SiTrivialDigitalConverter > theSiDigitalConverter
std::unique_ptr< SiStripFedZeroSuppression > theSiZeroSuppress
std::map< unsigned int, size_t > lastChannelsWithSignal
void putSiStrip(edm::Event &e, edm::EventSetup const &iSetup)
std::map< uint32_t, SignalMapType > signalMaps