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