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;
54  {
55  public:
56 
58 
63 
64  void putSiStrip(edm::Event &e, edm::EventSetup const& iSetup) ;
65  void addSiStripSignals(const edm::Event &e);
66  void addSiStripPileups(const int bcr, const edm::EventPrincipal*,unsigned int EventId,
67  ModuleCallingContext const*);
68 
69 
70  virtual void initializeEvent(const edm::Event &e, edm::EventSetup const& iSetup);
71 
72  void DMinitializeDetUnit(StripGeomDetUnit const * det, const edm::EventSetup& iSetup );
73 
74  private:
75  // data specifiers
76 
77  edm::InputTag SistripLabelSig_ ; // name given to collection of SiStrip digis
78  edm::InputTag SiStripPileInputTag_ ; // InputTag for pileup strips
79  std::string SiStripDigiCollectionDM_ ; // secondary name to be given to new SiStrip digis
80 
81  //
82 
83  typedef std::vector<SiStripDigi> OneDetectorMap; // maps by strip ID for later combination - can have duplicate strips
84  typedef std::map<uint32_t, OneDetectorMap> SiGlobalIndex; // map to all data for each detector ID
86 
88 
89 
90  // unsigned int eventId_; //=0 for signal, from 1-n for pileup events
91 
92  // variables for temporary storage of mixed hits:
93 
94  typedef float Amplitude;
95  typedef std::map<int, Amplitude> SignalMapType;
96  typedef std::map<uint32_t, SignalMapType> signalMaps;
97 
98  const SignalMapType* getSignal(uint32_t detID) const {
99  auto where = signals_.find(detID);
100  if(where == signals_.end()) {
101  return 0;
102  }
103  return &where->second;
104  }
105 
107 
108  // for noise adding:
109 
111 
113  bool peakMode;
114  double theThreshold;
118 
119  std::unique_ptr<SiGaussianTailNoiseAdder> theSiNoiseAdder;
120  std::unique_ptr<SiStripFedZeroSuppression> theSiZeroSuppress;
121  std::unique_ptr<SiTrivialDigitalConverter> theSiDigitalConverter;
122 
124 
125  // bad channels for each detector ID
126  std::map<unsigned int, std::vector<bool> > allBadChannels;
127  // first and last channel wit signal for each detector ID
128  std::map<unsigned int, size_t> firstChannelsWithSignal;
129  std::map<unsigned int, size_t> lastChannelsWithSignal;
130 
131  //----------------------------
132 
134  public:
135  bool operator() (SiStripDigi i,SiStripDigi j) const {return i.strip() < j.strip();}
136  };
137 
138 
139  };
140 }//edm
141 
142 #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