CMS 3D CMS Logo

SelectedElectronFEDListProducer.h
Go to the documentation of this file.
1 #ifndef Calibration_EcalAlCaRecoProducers_SelectedElectronFEDListProducer_h
2 #define Calibration_EcalAlCaRecoProducers_SelectedElectronFEDListProducer_h
3 
5 // egamma objects
7 
9 // Geometry
15 // strip geometry
19 // Strip and pixel
22 // Hcal objects
25 
26 // Math
28 
31 // Message logger
33 
34 class InputTag;
35 
37 
39 class SiStripFedCabling;
40 
42 class HcalElectronicsMap;
43 
44 // Hcal rec hit: this is a Fwd file defining typedefs
46 
47 // Pixel region class
48 class PixelRegion {
49 public:
50  PixelRegion(math::XYZVector& momentum, float dphi = 0.5, float deta = 0.5, float maxz = 24.0) {
51  vector = momentum;
52  dPhi = dphi;
53  dEta = deta;
54  maxZ = maxz;
55  cosphi = vector.x() / vector.rho();
56  sinphi = vector.y() / vector.rho();
57  atantheta = vector.z() / vector.rho();
58  }
59 
61  float dPhi, dEta, maxZ;
63 };
64 
65 // Pixel module class
66 class PixelModule {
67 public:
69  PixelModule(float phi, float eta) : Phi(phi), Eta(eta), x(0.), y(0.), z(0.), DetId(0), Fed(0) {}
70  bool operator<(const PixelModule& m) const {
71  if (Phi < m.Phi)
72  return true;
73  if (Phi == m.Phi && Eta < m.Eta)
74  return true;
75  if (Phi == m.Phi && Eta == m.Eta && DetId < m.DetId)
76  return true;
77  return false;
78  }
79 
80  float Phi, Eta;
81  float x, y, z;
82  unsigned int DetId;
83  unsigned int Fed;
84 };
85 
86 // main class
87 template <typename TEle, typename TCand>
89 public:
92 
93  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
94 
95 protected:
96  virtual void beginJob();
97  virtual void endJob();
98  void produce(edm::Event&, const edm::EventSetup&) override;
99 
100 private:
101  typedef std::vector<TEle> TEleColl;
102  typedef std::vector<TCand> TCandColl;
103 
104 public:
105  void pixelFedDump(std::vector<PixelModule>::const_iterator& itDn,
106  std::vector<PixelModule>::const_iterator& itUp,
107  const PixelRegion& region);
108 
109 private:
110  // input parameter of the producer
111  std::vector<edm::InputTag> recoEcalCandidateTags_;
112  std::vector<edm::InputTag> electronTags_;
115 
117 
118  std::vector<int> isGsfElectronCollection_;
119  std::vector<int> addThisSelectedFEDs_;
120 
122 
130 
136 
138 
139  // Token for the input collection
143  std::vector<edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> > recoEcalCandidateToken_;
144  std::vector<edm::EDGetTokenT<TEleColl> > electronToken_;
145 
146  // Token for the input collection
153 
154  // used inside the producer
156 
157  // internal info for ES geometry
158  int ES_fedId_[2][2][40][40];
159 
160  // fed list and output raw data
161  std::vector<uint32_t> fedList_;
162 
163  // get calo geomentry and electronic map
169 
170  // get pixel geometry and electronic map
171  std::unique_ptr<SiPixelFedCablingTree> PixelCabling_;
172  std::vector<PixelModule> pixelModuleVector_;
173 
174  // get strip geometry and electronic map
175  std::pair<double, double> regionDimension_;
176 };
177 
178 #endif // SelectedElectronFEDListProducer_h
std::vector< edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > > recoEcalCandidateToken_
bool operator<(const PixelModule &m) const
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
const edm::ESGetToken< HcalDbService, HcalDbRecord > hcalDbToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
SelectedElectronFEDListProducer(const edm::ParameterSet &)
Producer constructor.
const CaloSubdetectorGeometry * GeometryES_
PixelModule(float phi, float eta)
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > siPixelFedCablingMapToken_
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHitToken_
std::unique_ptr< SiPixelFedCablingTree > PixelCabling_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > ecalMappingToken_
const edm::ESGetToken< SiStripRegionCabling, SiStripRegionCablingRcd > siStripRegionCablingToken_
Definition: DetId.h:17
std::vector< edm::InputTag > recoEcalCandidateTags_
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...
void produce(edm::Event &, const edm::EventSetup &) override
const SiStripRegionCabling * StripRegionCabling_
constexpr float maxz[nPairs]
void pixelFedDump(std::vector< PixelModule >::const_iterator &itDn, std::vector< PixelModule >::const_iterator &itUp, const PixelRegion &region)
std::vector< edm::EDGetTokenT< TEleColl > > electronToken_
PixelRegion(math::XYZVector &momentum, float dphi=0.5, float deta=0.5, float maxz=24.0)