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  protected:
146 
147  virtual void beginJob() ;
148  virtual void endJob() ;
149  virtual void produce(edm::Event&, const edm::EventSetup&);
150 
151  private:
152 
153  typedef std::vector<TEle> TEleColl ;
154  typedef std::vector<TCand> TCandColl ;
155 
156  public:
157 
158  void pixelFedDump( std::vector<PixelModule>::const_iterator & itDn,
159  std::vector<PixelModule>::const_iterator & itUp,
160  const PixelRegion & region);
161 
162  private:
163 
164  // input parameter of the producer
165  std::vector<edm::InputTag> recoEcalCandidateTags_ ;
166  std::vector<edm::InputTag> electronTags_ ;
169 
170  std::vector<int> isGsfElectronCollection_ ;
171  std::vector<int> addThisSelectedFEDs_ ;
172 
174 
176 
184 
185  double dRStripRegion_ ;
190 
192 
193  // Token for the input collection
197  std::vector<edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> > recoEcalCandidateToken_ ;
198  std::vector<edm::EDGetTokenT<TEleColl> > electronToken_;
199 
200  // used inside the producer
201  uint32_t eventCounter_ ;
203 
204  // internal info for ES geometry
205  int ES_fedId_[2][2][40][40];
206 
207  // fed list and output raw data
208  std::vector<uint32_t> fedList_ ;
209 
210  // get the raw data
212  // get calo geomentry and electronic map
216 
217  // get pixel geometry and electronic map
218  std::unique_ptr<SiPixelFedCablingTree> PixelCabling_;
219  std::vector<PixelModule> pixelModuleVector_ ;
220 
221  // get strip geometry and electronic map
224  std::pair<double,double> regionDimension_ ;
225 
226  // get hcal geometry and electronic map
228 
229 };
230 
231 #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