CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DataMixingSiPixelMCDigiWorker.h
Go to the documentation of this file.
1 #ifndef DataMixingSiPixelMCDigiWorker_h
2 #define DataMixingSiPixelMCDigiWorker_h
3 
25 
26 //Data Formats
31 
38 
39 
40 #include <map>
41 #include <vector>
42 #include <string>
43 
44 
45 namespace CLHEP {
46  class HepRandomEngine;
47 }
48 
49 namespace edm
50 {
51  class ModuleCallingContext;
52 
54  {
55  public:
56 
58 
61 
64 
65  virtual void initializeEvent(edm::Event const& e, edm::EventSetup const& c); // override?
66 
67  void putSiPixel(edm::Event &e, edm::EventSetup const& iSetup, std::vector<PileupSummaryInfo> &ps, int &bs) ;
68  void addSiPixelSignals(const edm::Event &e);
69  void addSiPixelPileups(const int bcr, const edm::EventPrincipal*,unsigned int EventId, ModuleCallingContext const*);
70 
71  void setPileupInfo(const std::vector<PileupSummaryInfo> &ps, const int &bs); //this sets pu_scale
72 
73  void init_DynIneffDB(const edm::EventSetup&, const unsigned int&);
74 
75  private:
76 
77  //
78  // PixelEfficiencies struct
79  //
85  bool FromConfig; // If true read from Config, otherwise use Database
86 
88  std::vector<double> pu_scale; // in config: 0-3 BPix, 4-5 FPix (inner, outer)
89  std::vector<std::vector<double> > thePUEfficiency; // Instlumi dependent efficiency
90  double thePixelEfficiency[20]; // Single pixel effciency
91  double thePixelColEfficiency[20]; // Column effciency
92  double thePixelChipEfficiency[20]; // ROC efficiency
93  std::vector<double> theLadderEfficiency_BPix[20]; // Ladder efficiency
94  std::vector<double> theModuleEfficiency_BPix[20]; // Module efficiency
95  //std::vector<double> thePUEfficiency[20]; // Instlumi dependent efficiency
96  double theInnerEfficiency_FPix[20]; // Fpix inner module efficiency
97  double theOuterEfficiency_FPix[20]; // Fpix outer module efficiency
98  unsigned int FPixIndex; // The Efficiency index for FPix Disks
99  // Read factors from DB and fill containers
100  std::map<uint32_t, double> PixelGeomFactors;
101  std::map<uint32_t, double> ColGeomFactors;
102  std::map<uint32_t, double> ChipGeomFactors;
103  std::map<uint32_t, size_t > iPU;
104 
106  bool matches(const DetId&, const DetId&, const std::vector<uint32_t >&);
107 
108  };
109 
110  // Needed by dynamic inefficiency
111  // 0-3 BPix, 4-5 FPix (inner, outer)
112  //double _pu_scale[20];
113 
114  // data specifiers
115 
116  edm::InputTag pixeldigi_collectionSig_ ; // secondary name given to collection of SiPixel digis
117  edm::InputTag pixeldigi_collectionPile_ ; // secondary name given to collection of SiPixel digis
118  std::string PixelDigiCollectionDM_ ; // secondary name to be given to new SiPixel digis
119 
122 
124 
125  // Get Dynamic Inefficiency scale factors from DB
127 
128 
129  //
130  // Internal typedefs
131 
132  typedef int Amplitude;
133  typedef std::map<int, Amplitude, std::less<int> > signal_map_type; // from Digi.Skel.
134  typedef signal_map_type::iterator signal_map_iterator; // from Digi.Skel.
135  typedef signal_map_type::const_iterator signal_map_const_iterator; // from Digi.Skel.
136  typedef std::map<uint32_t, signal_map_type> signalMaps;
137 
138  // Contains the accumulated hit info.
140 
141  typedef std::multimap<int, PixelDigi> OneDetectorMap; // maps by pixel ID for later combination - can have duplicate pixels
142  typedef std::map<uint32_t, OneDetectorMap> SiGlobalIndex; // map to all data for each detector ID
143 
145 
146 
147  // unsigned int eventId_; //=0 for signal, from 1-n for pileup events
148 
151 
152  //-- Allow for upgrades
153  const int NumberOfBarrelLayers; // Default = 3
154  const int NumberOfEndcapDisks; // Default = 2
155 
156  //const double theInstLumiScaleFactor;
157  //const double bunchScaleAt25;
158 
159  const bool AddPixelInefficiency; // bool to read in inefficiencies
160 
162 
164 
165  };
166 }//edm
167 
168 #endif
void init_DynIneffDB(const edm::EventSetup &, const unsigned int &)
std::multimap< int, PixelDigi > OneDetectorMap
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > PixelDigiToken_
virtual void initializeEvent(edm::Event const &e, edm::EventSetup const &c)
signal_map_type::const_iterator signal_map_const_iterator
bool matches(const DetId &, const DetId &, const std::vector< uint32_t > &)
edm::ESHandle< SiPixelDynamicInefficiency > SiPixelDynamicInefficiency_
std::map< int, Amplitude, std::less< int > > signal_map_type
tuple conf
Definition: dbtoconf.py:185
void init_from_db(const edm::ESHandle< TrackerGeometry > &, const edm::ESHandle< SiPixelDynamicInefficiency > &)
Definition: DetId.h:18
std::map< uint32_t, signal_map_type > signalMaps
void setPileupInfo(const std::vector< PileupSummaryInfo > &ps, const int &bs)
std::map< uint32_t, OneDetectorMap > SiGlobalIndex
void addSiPixelPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *)
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > PixelDigiPToken_
PixelEfficiencies(const edm::ParameterSet &conf, bool AddPixelInefficiency, int NumberOfBarrelLayers, int NumberOfEndcapDisks)
void putSiPixel(edm::Event &e, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > &ps, int &bs)