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  edm::InputTag SistripAPVLabelSig_; // where to find vector of dead APVs
84 
85 
86  //
87 
88  typedef float Amplitude;
89  typedef std::pair<uint16_t, Amplitude> RawDigi; // Replacement for SiStripDigi with pulse height instead of integer ADC
90  typedef std::vector<SiStripDigi> OneDetectorMap; // maps by strip ID for later combination - can have duplicate strips
91  typedef std::vector<RawDigi> OneDetectorRawMap; // maps by strip ID for later combination - can have duplicate strips
92  typedef std::map<uint32_t, OneDetectorMap> SiGlobalIndex; // map to all data for each detector ID
93  typedef std::map<uint32_t, OneDetectorRawMap> SiGlobalRawIndex; // map to all data for each detector ID
94 
96 
99 
100  // unsigned int eventId_; //=0 for signal, from 1-n for pileup events
101 
102  // variables for temporary storage of mixed hits:
103 
104 
105  typedef std::map<int, Amplitude> SignalMapType;
106  typedef std::map<uint32_t, SignalMapType> signalMaps;
107 
108  const SignalMapType* getSignal(uint32_t detID) const {
109  auto where = signals_.find(detID);
110  if(where == signals_.end()) {
111  return 0;
112  }
113  return &where->second;
114  }
115 
117 
118  // to keep track of dead APVs from HIP interactions
119  typedef std::multimap< uint32_t, std::bitset<6> > APVMap;
120 
122 
123  // for noise adding:
124 
126 
129  bool peakMode;
130  double theThreshold;
135 
136  std::unique_ptr<SiGaussianTailNoiseAdder> theSiNoiseAdder;
137  std::unique_ptr<SiStripFedZeroSuppression> theSiZeroSuppress;
138  std::unique_ptr<SiTrivialDigitalConverter> theSiDigitalConverter;
139 
141 
142  // bad channels for each detector ID
143  std::map<unsigned int, std::vector<bool> > allBadChannels;
144  // channels killed by HIP interactions for each detector ID
145  std::map<unsigned int, std::vector<bool> > allHIPChannels;
146  // first and last channel wit signal for each detector ID
147  std::map<unsigned int, size_t> firstChannelsWithSignal;
148  std::map<unsigned int, size_t> lastChannelsWithSignal;
149 
150  //----------------------------
151 
153  public:
154  bool operator() (SiStripDigi i,SiStripDigi j) const {return i.strip() < j.strip();}
155  };
156 
158  public:
159  bool operator() (RawDigi i,RawDigi j) const {return i.first < j.first;}
160  };
161 
162  };
163 }//edm
164 
165 #endif
std::vector< SiStripDigi > DigitalVecType
int i
Definition: DBlmapReader.cc:9
std::map< unsigned int, size_t > firstChannelsWithSignal
std::map< unsigned int, std::vector< bool > > allHIPChannels
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::multimap< uint32_t, std::bitset< 6 > > APVMap
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