CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SelectedElectronFEDListProducer.h
Go to the documentation of this file.
1 #ifndef SelectedElectronFEDListProducer_h
2 #define SelectedFEDListProducer_h
3 
4 #include <iostream>
5 #include <sstream>
6 #include <vector>
7 #include <algorithm>
8 #include <fstream>
9 #include "TLorentzVector.h"
10 #include "TVector3.h"
11 #include <ostream>
12 #include <memory>
13 #include <stdint.h>
14 
15 // common
17 // egamma objects
29 // raw data
33 // detector id
37 // Math
39 // Hcal rec hit
45 // Geometry
57 // strip geometry
62 // FW core
71 // Message logger
74 // Strip and pixel
87 
88 // Hcal objects
94 
95 using namespace std;
96 
97 // Pixel region class
98 class PixelRegion {
99  public:
100  PixelRegion(math::XYZVector & momentum, float dphi = 0.5, float deta = 0.5, float maxz = 24.0){
101  vector = momentum;
102  dPhi = dphi ;
103  dEta = deta ;
104  maxZ = maxz ;
105  cosphi = vector.x()/vector.rho();
106  sinphi = vector.y()/vector.rho();
107  atantheta = vector.z()/vector.rho();
108  }
109 
111  float dPhi,dEta,maxZ;
112  float cosphi, sinphi, atantheta;
113 };
114 
115 // Pixel module class
117  public:
118 
120  PixelModule(float phi, float eta) : Phi(phi), Eta(eta), x(0.), y(0.), z(0.), DetId(0), Fed(0) {}
121  bool operator < (const PixelModule& m) const {
122  if(Phi < m.Phi) return true;
123  if(Phi == m.Phi && Eta < m.Eta) return true;
124  if(Phi == m.Phi && Eta == m.Eta && DetId < m.DetId) return true;
125  return false;
126  }
127 
128  float Phi,Eta;
129  float x, y, z;
130  unsigned int DetId;
131  unsigned int Fed;
132 
133 };
134 
135 
136 // main class
137 template<typename TEle, typename TCand>
139 
140  public:
141 
144 
145  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
146 
147 
148  protected:
149 
150  virtual void beginJob() ;
151  virtual void endJob() ;
152  virtual void produce(edm::Event&, const edm::EventSetup&);
153 
154 
155  private:
156 
157  typedef std::vector<TEle> TEleColl ;
158  typedef std::vector<TCand> TCandColl ;
159 
160  public:
161 
162  void pixelFedDump( std::vector<PixelModule>::const_iterator & itDn,
163  std::vector<PixelModule>::const_iterator & itUp,
164  const PixelRegion & region);
165 
166  private:
167 
168  // input parameter of the producer
169  std::vector<edm::InputTag> recoEcalCandidateTags_ ;
170  std::vector<edm::InputTag> electronTags_ ;
173 
174  std::vector<int> isGsfElectronCollection_ ;
175  std::vector<int> addThisSelectedFEDs_ ;
176 
178 
180 
188 
189  double dRStripRegion_ ;
194 
196 
197  // Token for the input collection
201  std::vector<edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> > recoEcalCandidateToken_ ;
202  std::vector<edm::EDGetTokenT<TEleColl> > electronToken_;
203 
204  // used inside the producer
205  uint32_t eventCounter_ ;
207 
208  // internal info for ES geometry
209  int ES_fedId_[2][2][40][40];
210 
211  // fed list and output raw data
212  std::vector<uint32_t> fedList_ ;
213 
214  // get the raw data
216  // get calo geomentry and electronic map
220 
221  // get pixel geometry and electronic map
222  std::unique_ptr<SiPixelFedCablingTree> PixelCabling_;
223  std::vector<PixelModule> pixelModuleVector_ ;
224 
225  // get strip geometry and electronic map
228  std::pair<double,double> regionDimension_ ;
229 
230  // get hcal geometry and electronic map
232 
233 };
234 
235 #endif
std::vector< edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > > recoEcalCandidateToken_
const CaloSubdetectorGeometry * geometryES_
PixelModule(float phi, float eta)
T eta() const
float float float z
void beginJob()
Definition: Breakpoints.cc:15
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHitToken_
std::unique_ptr< SiPixelFedCablingTree > PixelCabling_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
Definition: DetId.h:18
std::vector< edm::InputTag > recoEcalCandidateTags_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
const EcalElectronicsMapping * TheMapping_
const SiStripRegionCabling * StripRegionCabling_
Definition: DDAxes.h:10
std::vector< edm::EDGetTokenT< TEleColl > > electronToken_
PixelRegion(math::XYZVector &momentum, float dphi=0.5, float deta=0.5, float maxz=24.0)
std::vector< RegionCabling > Cabling
Definition: DDAxes.h:10