test
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 float Amplitude;
84  typedef std::pair<uint16_t, Amplitude> RawDigi; // Replacement for SiStripDigi with pulse height instead of integer ADC
85  typedef std::vector<SiStripDigi> OneDetectorMap; // maps by strip ID for later combination - can have duplicate strips
86  typedef std::vector<RawDigi> OneDetectorRawMap; // maps by strip ID for later combination - can have duplicate strips
87  typedef std::map<uint32_t, OneDetectorMap> SiGlobalIndex; // map to all data for each detector ID
88  typedef std::map<uint32_t, OneDetectorRawMap> SiGlobalRawIndex; // map to all data for each detector ID
89 
91 
94 
95  // unsigned int eventId_; //=0 for signal, from 1-n for pileup events
96 
97  // variables for temporary storage of mixed hits:
98 
99 
100  typedef std::map<int, Amplitude> SignalMapType;
101  typedef std::map<uint32_t, SignalMapType> signalMaps;
102 
103  const SignalMapType* getSignal(uint32_t detID) const {
104  auto where = signals_.find(detID);
105  if(where == signals_.end()) {
106  return 0;
107  }
108  return &where->second;
109  }
110 
112 
113  // for noise adding:
114 
116 
118  bool peakMode;
119  double theThreshold;
123 
124  std::unique_ptr<SiGaussianTailNoiseAdder> theSiNoiseAdder;
125  std::unique_ptr<SiStripFedZeroSuppression> theSiZeroSuppress;
126  std::unique_ptr<SiTrivialDigitalConverter> theSiDigitalConverter;
127 
129 
130  // bad channels for each detector ID
131  std::map<unsigned int, std::vector<bool> > allBadChannels;
132  // first and last channel wit signal for each detector ID
133  std::map<unsigned int, size_t> firstChannelsWithSignal;
134  std::map<unsigned int, size_t> lastChannelsWithSignal;
135 
136  //----------------------------
137 
139  public:
140  bool operator() (SiStripDigi i,SiStripDigi j) const {return i.strip() < j.strip();}
141  };
142 
144  public:
145  bool operator() (RawDigi i,RawDigi j) const {return i.first < j.first;}
146  };
147 
148  };
149 }//edm
150 
151 #endif
std::vector< SiStripDigi > DigitalVecType
int i
Definition: DBlmapReader.cc:9
std::map< unsigned int, size_t > firstChannelsWithSignal
std::pair< uint16_t, Amplitude > RawDigi
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, OneDetectorRawMap > SiGlobalRawIndex
std::map< uint32_t, SignalMapType > signalMaps