CMS 3D CMS Logo

SelectedElectronFEDListProducer.h
Go to the documentation of this file.
1 #ifndef SelectedElectronFEDListProducer_h
2 #define SelectedElectronFEDListProducer_h
3 
5 // egamma objects
7 
8 // Math
10 
12 // #include "FWCore/Framework/interface/EDProducer.h"
15 // Message logger
17 
18 class InputTag;
19 
21 
24 class SiStripFedCabling;
26 
27 class CaloGeometry;
30 class HcalElectronicsMap;
31 
32 // Hcal rec hit: this is a Fwd file defining typedefs
34 
35 // Pixel region class
36 class PixelRegion {
37 public:
38  PixelRegion(math::XYZVector& momentum, float dphi = 0.5, float deta = 0.5, float maxz = 24.0) {
39  vector = momentum;
40  dPhi = dphi;
41  dEta = deta;
42  maxZ = maxz;
43  cosphi = vector.x() / vector.rho();
44  sinphi = vector.y() / vector.rho();
45  atantheta = vector.z() / vector.rho();
46  }
47 
49  float dPhi, dEta, maxZ;
51 };
52 
53 // Pixel module class
54 class PixelModule {
55 public:
57  PixelModule(float phi, float eta) : Phi(phi), Eta(eta), x(0.), y(0.), z(0.), DetId(0), Fed(0) {}
58  bool operator<(const PixelModule& m) const {
59  if (Phi < m.Phi)
60  return true;
61  if (Phi == m.Phi && Eta < m.Eta)
62  return true;
63  if (Phi == m.Phi && Eta == m.Eta && DetId < m.DetId)
64  return true;
65  return false;
66  }
67 
68  float Phi, Eta;
69  float x, y, z;
70  unsigned int DetId;
71  unsigned int Fed;
72 };
73 
74 // main class
75 template <typename TEle, typename TCand>
77 public:
80 
81  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
82 
83 protected:
84  virtual void beginJob();
85  virtual void endJob();
86  void produce(edm::Event&, const edm::EventSetup&) override;
87 
88 private:
89  typedef std::vector<TEle> TEleColl;
90  typedef std::vector<TCand> TCandColl;
91 
92 public:
93  void pixelFedDump(std::vector<PixelModule>::const_iterator& itDn,
94  std::vector<PixelModule>::const_iterator& itUp,
95  const PixelRegion& region);
96 
97 private:
98  // input parameter of the producer
99  std::vector<edm::InputTag> recoEcalCandidateTags_;
100  std::vector<edm::InputTag> electronTags_;
103 
105 
106  std::vector<int> isGsfElectronCollection_;
107  std::vector<int> addThisSelectedFEDs_;
108 
110 
118 
124 
126 
127  // Token for the input collection
131  std::vector<edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> > recoEcalCandidateToken_;
132  std::vector<edm::EDGetTokenT<TEleColl> > electronToken_;
133 
134  // used inside the producer
136 
137  // internal info for ES geometry
138  int ES_fedId_[2][2][40][40];
139 
140  // fed list and output raw data
141  std::vector<uint32_t> fedList_;
142 
143  // get calo geomentry and electronic map
149 
150  // get pixel geometry and electronic map
151  std::unique_ptr<SiPixelFedCablingTree> PixelCabling_;
152  std::vector<PixelModule> pixelModuleVector_;
153 
154  // get strip geometry and electronic map
155  std::pair<double, double> regionDimension_;
156 };
157 
158 #endif // SelectedElectronFEDListProducer_h
std::vector< edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > > recoEcalCandidateToken_
bool operator<(const PixelModule &m) const
const CaloSubdetectorGeometry * GeometryES_
PixelModule(float phi, float eta)
void beginJob()
Definition: Breakpoints.cc:14
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHitToken_
std::unique_ptr< SiPixelFedCablingTree > PixelCabling_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
Definition: DetId.h:17
std::vector< edm::InputTag > recoEcalCandidateTags_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
const EcalElectronicsMapping * EcalMapping_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
const SiStripRegionCabling * StripRegionCabling_
std::vector< edm::EDGetTokenT< TEleColl > > electronToken_
PixelRegion(math::XYZVector &momentum, float dphi=0.5, float deta=0.5, float maxz=24.0)