CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
FastPrimaryVertexWithWeightsProducer Class Reference

#include <RecoBTag/FastPrimaryVertexWithWeightsProducer/src/FastPrimaryVertexWithWeightsProducer.cc>

Inheritance diagram for FastPrimaryVertexWithWeightsProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 FastPrimaryVertexWithWeightsProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamSpotToken
 
edm::EDGetTokenT
< SiPixelClusterCollectionNew
clustersToken
 
edm::EDGetTokenT< edm::View
< reco::Jet > > 
jetsToken
 
bool m_barrel
 
edm::InputTag m_beamSpot
 
edm::InputTag m_clusters
 
double m_EC_weight
 
bool m_endCap
 
edm::InputTag m_jets
 
double m_maxDeltaPhi
 
double m_maxDeltaPhi_EC
 
double m_maxJetEta
 
double m_maxJetEta_EC
 
double m_maxSizeX
 
double m_maxSizeY_q
 
double m_maxZ
 
double m_minJetEta_EC
 
double m_minJetPt
 
double m_minSizeY_q
 
int m_njets
 
double m_peakSizeY_q
 
double m_PixelCellHeightOverWidth
 
std::string m_pixelCPE
 
double m_weight_charge_down
 
double m_weight_charge_peak
 
double m_weight_charge_up
 
double m_weight_dPhi
 
double m_weight_dPhi_EC
 
double m_weight_rho_up
 
double m_weight_SizeX1
 
double m_weightCut_step2
 
double m_weightCut_step3
 
double m_zClusterSearchArea_step2
 
double m_zClusterSearchArea_step3
 
double m_zClusterWidth_step1
 
double m_zClusterWidth_step2
 
double m_zClusterWidth_step3
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: The FastPrimaryVertex is an algorithm used to find the primary vertex of an event . It takes the pixel clusters compabible with a jet and project it to the beamSpot with the eta-angle of the jet. The peak on the z-projected clusters distribution is our FastPrimaryVertex.

Implementation: [Notes on implementation]

Definition at line 56 of file FastPrimaryVertexWithWeightsProducer.cc.

Constructor & Destructor Documentation

FastPrimaryVertexWithWeightsProducer::FastPrimaryVertexWithWeightsProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 123 of file FastPrimaryVertexWithWeightsProducer.cc.

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

124 {
125  m_maxZ = iConfig.getParameter<double>("maxZ");
126  m_clusters = iConfig.getParameter<edm::InputTag>("clusters");
127  clustersToken = consumes<SiPixelClusterCollectionNew>(m_clusters);
128  m_pixelCPE = iConfig.getParameter<std::string>("pixelCPE");
129  m_beamSpot = iConfig.getParameter<edm::InputTag>("beamSpot");
130  beamSpotToken = consumes<reco::BeamSpot>(m_beamSpot);
131  m_jets = iConfig.getParameter<edm::InputTag>("jets");
132  jetsToken = consumes<edm::View<reco::Jet> >(m_jets);
133 
134  m_njets = iConfig.getParameter<int>("njets");
135  m_maxJetEta = iConfig.getParameter<double>("maxJetEta");
136  m_minJetPt = iConfig.getParameter<double>("minJetPt");
137 
138  m_barrel = iConfig.getParameter<bool>("barrel");
139  m_maxSizeX = iConfig.getParameter<double>("maxSizeX");
140  m_maxDeltaPhi = iConfig.getParameter<double>("maxDeltaPhi");
141  m_PixelCellHeightOverWidth = iConfig.getParameter<double>("PixelCellHeightOverWidth");
142  m_weight_charge_down = iConfig.getParameter<double>("weight_charge_down");
143  m_weight_charge_up = iConfig.getParameter<double>("weight_charge_up");
144  m_minSizeY_q = iConfig.getParameter<double>("minSizeY_q");
145  m_maxSizeY_q = iConfig.getParameter<double>("maxSizeY_q");
146 
147  m_weight_dPhi = iConfig.getParameter<double>("weight_dPhi");
148  m_weight_SizeX1 = iConfig.getParameter<double>("weight_SizeX1");
149  m_weight_rho_up = iConfig.getParameter<double>("weight_rho_up");
150  m_weight_charge_peak = iConfig.getParameter<double>("weight_charge_peak");
151  m_peakSizeY_q = iConfig.getParameter<double>("peakSizeY_q");
152 
153  m_endCap = iConfig.getParameter<bool>("endCap");
154  m_minJetEta_EC = iConfig.getParameter<double>("minJetEta_EC");
155  m_maxJetEta_EC = iConfig.getParameter<double>("maxJetEta_EC");
156  m_maxDeltaPhi_EC = iConfig.getParameter<double>("maxDeltaPhi_EC");
157  m_EC_weight = iConfig.getParameter<double>("EC_weight");
158  m_weight_dPhi_EC = iConfig.getParameter<double>("weight_dPhi_EC");
159 
160  m_zClusterWidth_step1 = iConfig.getParameter<double>("zClusterWidth_step1");
161 
162  m_zClusterWidth_step2 = iConfig.getParameter<double>("zClusterWidth_step2");
163  m_zClusterSearchArea_step2 = iConfig.getParameter<double>("zClusterSearchArea_step2");
164  m_weightCut_step2 = iConfig.getParameter<double>("weightCut_step2");
165 
166  m_zClusterWidth_step3 = iConfig.getParameter<double>("zClusterWidth_step3");
167  m_zClusterSearchArea_step3 = iConfig.getParameter<double>("zClusterSearchArea_step3");
168  m_weightCut_step3 = iConfig.getParameter<double>("weightCut_step3");
169 
170  produces<reco::VertexCollection>();
171  produces<float>();
172 
173 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken
edm::EDGetTokenT< SiPixelClusterCollectionNew > clustersToken

Member Function Documentation

void FastPrimaryVertexWithWeightsProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 176 of file FastPrimaryVertexWithWeightsProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

177 {
179  desc.add<edm::InputTag> ("clusters",edm::InputTag("hltSiPixelClusters"));
180  desc.add<edm::InputTag> ("beamSpot",edm::InputTag("hltOnlineBeamSpot"));
181  desc.add<edm::InputTag> ("jets",edm::InputTag("hltCaloJetL1FastJetCorrected"));
182  desc.add<std::string>("pixelCPE","hltESPPixelCPEGeneric");
183  desc.add<double>("maxZ",19.0);
184  desc.add<int>("njets",999);
185  desc.add<double>("maxJetEta",2.6);
186  desc.add<double>("minJetPt",40.);
187  desc.add<bool>("barrel",true);
188  desc.add<double>("maxSizeX",2.1);
189  desc.add<double>("maxDeltaPhi",0.21);
190  desc.add<double>("PixelCellHeightOverWidth",1.8);
191  desc.add<double>("weight_charge_down",11.*1000.);
192  desc.add<double>("weight_charge_up",190.*1000.);
193  desc.add<double>("maxSizeY_q",2.0);
194  desc.add<double>("minSizeY_q",-0.6);
195  desc.add<double>("weight_dPhi",0.13888888);
196  desc.add<double>("weight_SizeX1",0.88);
197  desc.add<double>("weight_rho_up",22.);
198  desc.add<double>("weight_charge_peak",22.*1000.);
199  desc.add<double>("peakSizeY_q",1.0);
200  desc.add<bool>("endCap",true);
201  desc.add<double>("minJetEta_EC",1.3);
202  desc.add<double>("maxJetEta_EC",2.6);
203  desc.add<double>("maxDeltaPhi_EC",0.14);
204  desc.add<double>("EC_weight",0.008);
205  desc.add<double>("weight_dPhi_EC",0.064516129);
206  desc.add<double>("zClusterWidth_step1",2.0);
207  desc.add<double>("zClusterWidth_step2",0.65);
208  desc.add<double>("zClusterSearchArea_step2",3.0);
209  desc.add<double>("weightCut_step2",0.05);
210  desc.add<double>("zClusterWidth_step3",0.3);
211  desc.add<double>("zClusterSearchArea_step3",0.55);
212  desc.add<double>("weightCut_step3",0.1);
213  descriptions.add("fastPrimaryVertexWithWeightsProducer",desc);
214 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void FastPrimaryVertexWithWeightsProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

if it is a cluster to project

Implements edm::EDProducer.

Definition at line 217 of file FastPrimaryVertexWithWeightsProducer.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, DeDxDiscriminatorTools::charge(), SiPixelCluster::charge(), SiPixelRawToDigiRegional_cfi::deltaPhi, alignCSCRings::e, eta(), create_public_lumi_plots::exp, FindPeakFastPV(), edm::EventSetup::get(), edm::Event::getByToken(), i, j, fwrapper::jets, AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::phi(), clustersummaryproducer_cfg::pixelClusters, createTree::pp, RecoTauCleanerPlugins::pt, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, rho, edmNew::DetSet< T >::size(), SiPixelCluster::sizeX(), SiPixelCluster::sizeY(), mathSSE::sqrt(), patCandidatesForDimuonsSequences_cff::tracker, findQualityFiles::v, histoStyle::weight, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

218 {
219 
220  using namespace edm;
221  using namespace reco;
222  using namespace std;
223 
224  const float barrel_lenght=30; //half lenght of the pixel barrel 30 cm
225 
226  //get pixel cluster
228  iEvent.getByToken(clustersToken,cH);
229  const SiPixelClusterCollectionNew & pixelClusters = *cH.product();
230 
231  //get jets
233  iEvent.getByToken(jetsToken,jH);
234  const edm::View<reco::Jet> & jets = *jH.product();
235 
236  vector<const reco::Jet*> selectedJets;
237  int countjet=0;
238  for(edm::View<reco::Jet>::const_iterator it = jets.begin() ; it != jets.end() && countjet<m_njets ; it++)
239  {
240  if( //select jets used in barrel or endcap pixel cluster projections
241  ((it->pt() >= m_minJetPt) && fabs(it->eta()) <= m_maxJetEta) || //barrel
242  ((it->pt() >= m_minJetPt) && fabs(it->eta()) <= m_maxJetEta_EC && fabs(it->eta()) >= m_minJetEta_EC) //endcap
243  )
244  {
245  selectedJets.push_back(&(*it));
246  countjet++;
247  }
248  }
249 
250  //get PixelClusterParameterEstimator
253  iSetup.get<TkPixelCPERecord>().get(m_pixelCPE , pe );
254  pp = pe.product();
255 
256  //get beamSpot
259 
260  //get TrackerGeometry
262  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
263  const TrackerGeometry * trackerGeometry = tracker.product();
264 
265 // PART I: get z-projections with z-weights
266  std::vector<float> zProjections;
267  std::vector<float> zWeights;
268  int jet_count=0;
269  for(vector<const reco::Jet*>::iterator jit = selectedJets.begin() ; jit != selectedJets.end() ; jit++)
270  {//loop on selected jets
271  float px=(*jit)->px();
272  float py=(*jit)->py();
273  float pz=(*jit)->pz();
274  float pt=(*jit)->pt();
275  float eta=(*jit)->eta();
276  float jetZOverRho = (*jit)->momentum().Z()/(*jit)->momentum().Rho();
277  for(SiPixelClusterCollectionNew::const_iterator it = pixelClusters.begin() ; it != pixelClusters.end() ; it++) //Loop on pixel modules with clusters
278  {//loop on pixel modules
279  DetId id = it->detId();
280  const edmNew::DetSet<SiPixelCluster> & detset = (*it);
281  Point3DBase<float, GlobalTag> modulepos=trackerGeometry->idToDet(id)->position();
282  float zmodule = modulepos.z() - ((modulepos.x()-beamSpot->x0())*px+(modulepos.y()-beamSpot->y0())*py)/pt * pz/pt;
283  if ((fabs(deltaPhi((*jit)->momentum().Phi(),modulepos.phi()))< m_maxDeltaPhi*2)&&(fabs(zmodule)<(m_maxZ+barrel_lenght))){//if it is a compatible module
284  for(size_t j = 0 ; j < detset.size() ; j ++)
285  {//loop on pixel clusters on this module
286  const SiPixelCluster & aCluster = detset[j];
287  if(//it is a cluster to project
288  (// barrel
289  m_barrel &&
290  fabs(modulepos.z())<barrel_lenght &&
291  pt>=m_minJetPt &&
292  jet_count<m_njets &&
293  fabs(eta)<=m_maxJetEta &&
294  aCluster.sizeX() <= m_maxSizeX &&
295  aCluster.sizeY() >= m_PixelCellHeightOverWidth*fabs(jetZOverRho)+m_minSizeY_q &&
296  aCluster.sizeY() <= m_PixelCellHeightOverWidth*fabs(jetZOverRho)+m_maxSizeY_q
297  )
298  ||
299  (// EC
300  m_endCap &&
301  fabs(modulepos.z())>barrel_lenght &&
302  pt > m_minJetPt &&
303  jet_count<m_njets &&
304  fabs(eta) <= m_maxJetEta_EC &&
305  fabs(eta) >= m_minJetEta_EC &&
306  aCluster.sizeX() <= m_maxSizeX
307  )
308  ){
309  Point3DBase<float, GlobalTag> v = trackerGeometry->idToDet(id)->surface().toGlobal(pp->localParametersV( aCluster,( *trackerGeometry->idToDetUnit(id)))[0].first) ;
310  GlobalPoint v_bs(v.x()-beamSpot->x0(),v.y()-beamSpot->y0(),v.z());
311  if(//it pass DeltaPhi(Jet,Cluster) requirements
312  (m_barrel && fabs(modulepos.z())<barrel_lenght && fabs(deltaPhi((*jit)->momentum().Phi(),v_bs.phi())) <= m_maxDeltaPhi ) || //barrel
313  (m_endCap && fabs(modulepos.z())>barrel_lenght && fabs(deltaPhi((*jit)->momentum().Phi(),v_bs.phi())) <= m_maxDeltaPhi_EC ) //EC
314  )
315  {
316  float z = v.z() - ((v.x()-beamSpot->x0())*px+(v.y()-beamSpot->y0())*py)/pt * pz/pt; //calculate z-projection
317  if(fabs(z) < m_maxZ)
318  {
319  zProjections.push_back(z); //add z-projection in zProjections
320  float weight=0;
321  //calculate zWeight
322  if(fabs(modulepos.z())<barrel_lenght)
323  { //barrel
324  //calculate weight_sizeY
325  float sizeY=aCluster.sizeY();
326  float sizeY_up = m_PixelCellHeightOverWidth*fabs(jetZOverRho)+m_maxSizeY_q;
327  float sizeY_peak = m_PixelCellHeightOverWidth*fabs(jetZOverRho)+m_peakSizeY_q;
328  float sizeY_down = m_PixelCellHeightOverWidth*fabs(jetZOverRho)+m_minSizeY_q;
329  float weight_sizeY_up = (sizeY_up-sizeY)/(sizeY_up-sizeY_peak);
330  float weight_sizeY_down = (sizeY-sizeY_down)/(sizeY_peak-sizeY_down);
331  weight_sizeY_down = weight_sizeY_down *(weight_sizeY_down>0)*(weight_sizeY_down<1);
332  weight_sizeY_up = weight_sizeY_up *(weight_sizeY_up>0)*(weight_sizeY_up<1);
333  float weight_sizeY = weight_sizeY_up + weight_sizeY_down;
334 
335  //calculate weight_rho
336  float rho = sqrt(v_bs.x()*v_bs.x() + v_bs.y()*v_bs.y());
337  float weight_rho = ((m_weight_rho_up - rho)/m_weight_rho_up);
338 
339  //calculate weight_dPhi
340  float weight_dPhi = exp(- fabs(deltaPhi((*jit)->momentum().Phi(),v_bs.phi()))/m_weight_dPhi );
341 
342  //calculate weight_sizeX1
343  float weight_sizeX1= (aCluster.sizeX()==2) + (aCluster.sizeX()==1)*m_weight_SizeX1;
344 
345  //calculate weight_charge
346  float charge=aCluster.charge();
348  float weightCluster_down = (charge-m_weight_charge_down)/(m_weight_charge_peak-m_weight_charge_down);
349  weightCluster_down = weightCluster_down *(weightCluster_down>0)*(weightCluster_down<1);
350  weightCluster_up = weightCluster_up *(weightCluster_up>0)*(weightCluster_up<1);
351  float weight_charge = weightCluster_up + weightCluster_down;
352 
353  //calculate the final weight
354  weight = weight_dPhi * weight_sizeY * weight_rho * weight_sizeX1 * weight_charge ;
355  }
356  else if(fabs(modulepos.z())>barrel_lenght) // EC
357  {// EC
358  //calculate weight_dPhi
359  float weight_dPhi = exp(- fabs(deltaPhi((*jit)->momentum().Phi(),v_bs.phi())) /m_weight_dPhi_EC );
360  //calculate the final weight
361  weight= m_EC_weight*(weight_dPhi) ;
362  }
363  zWeights.push_back(weight); //add the weight to zWeights
364  }
365  }//if it pass DeltaPhi(Jet,Cluster) requirements
366  }
367  }//loop on pixel clusters on this module
368  }//if it is a compatible module
369  }//loop on pixel modules
370  jet_count++;
371  }//loop on selected jets
372 
373  //order zProjections and zWeights by z
374  std::multimap<float,float> zWithW;
375  size_t i=0;
376  for(i=0;i<zProjections.size();i++) zWithW.insert(std::pair<float,float>(zProjections[i],zWeights[i]));
377  i=0;
378  for(std::multimap<float,float>::iterator it=zWithW.begin(); it!=zWithW.end(); it++,i++) { zProjections[i]=it->first; zWeights[i]=it->second; } //order zProjections and zWeights by z
379 
380 
381  //calculate zWeightsSquared
382  std::vector<float> zWeightsSquared;
383  for(std::vector<float>::iterator it=zWeights.begin();it!=zWeights.end();it++) {zWeightsSquared.push_back((*it)*(*it));}
384 
385  //do multi-step peak searching
386  float res_step1 = FindPeakFastPV( zProjections, zWeights, 0.0, m_zClusterWidth_step1, 999.0, -1.0);
387  float res_step2 = FindPeakFastPV( zProjections, zWeights, res_step1, m_zClusterWidth_step2, m_zClusterSearchArea_step2, m_weightCut_step2);
388  float res_step3 = FindPeakFastPV( zProjections, zWeightsSquared, res_step2, m_zClusterWidth_step3, m_zClusterSearchArea_step3, m_weightCut_step3*m_weightCut_step3);
389 
390  float centerWMax=res_step3;
391  //End of PART II
392 
393  //Make the output
394  float res=0;
395  if(zProjections.size() > 2)
396  {
397  res=centerWMax;
398  Vertex::Error e;
399  e(0, 0) = 0.0015 * 0.0015;
400  e(1, 1) = 0.0015 * 0.0015;
401  e(2, 2) = 1.5 * 1.5;
402  Vertex::Point p(beamSpot->x(res), beamSpot->y(res), res);
403  Vertex thePV(p, e, 1, 1, 0);
404  std::auto_ptr<reco::VertexCollection> pOut(new reco::VertexCollection());
405  pOut->push_back(thePV);
406  iEvent.put(pOut);
407  } else
408  {
410  e(0, 0) = 0.0015 * 0.0015;
411  e(1, 1) = 0.0015 * 0.0015;
412  e(2, 2) = 1.5 * 1.5;
413  Vertex::Point p(beamSpot->x(res), beamSpot->y(res), res);
414  Vertex thePV(p, e, 0, 0, 0);
415  std::auto_ptr<reco::VertexCollection> pOut(new reco::VertexCollection());
416  pOut->push_back(thePV);
417  iEvent.put(pOut);
418  }
419 
420 //Finally, calculate the zClusterQuality as Sum(weights near the fastPV)/sqrt(Sum(total weights)) [a kind of zCluster significance]
421 
422 
423 
424  const float half_width_peak=1;
425  float nWeightedTot=0;
426  float nWeightedTotPeak=0;
427  for(std::vector<float>::iterator it = zProjections.begin();it!=zProjections.end(); it++)
428  {
429  nWeightedTot+=zWeights[it-zProjections.begin()];
430  if((res-half_width_peak)<=(*it) && (*it)<=(res+half_width_peak))
431  {
432  nWeightedTotPeak+=zWeights[it-zProjections.begin()];
433  }
434  }
435 
436 std::auto_ptr<float > zClusterQuality(new float());
437 *zClusterQuality=-1;
438 if(nWeightedTot!=0)
439 {
440  *zClusterQuality=nWeightedTotPeak / sqrt(nWeightedTot/(2*half_width_peak)); // where 30 is the beam spot lenght
441  iEvent.put(zClusterQuality);
442 }
443 else
444  iEvent.put(zClusterQuality);
445 
446 }
int i
Definition: DBlmapReader.cc:9
float charge() const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
tuple pp
Definition: createTree.py:15
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
Definition: DDAxes.h:10
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
T eta() const
double charge(const std::vector< uint8_t > &Ampls)
float float float z
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
T sqrt(T t)
Definition: SSEVec.h:48
vector< PseudoJet > jets
T z() const
Definition: PV3DBase.h:64
int j
Definition: DBlmapReader.cc:9
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken
Definition: DetId.h:18
const T & get() const
Definition: EventSetup.h:55
int sizeY() const
Pixel cluster – collection of neighboring pixels above threshold.
float FindPeakFastPV(const std::vector< float > &zProjections, const std::vector< float > &zWeights, const float oldVertex, const float m_zClusterWidth, const float m_zClusterSearchArea, const float m_weightCut)
int weight
Definition: histoStyle.py:50
size_type size() const
Definition: DetSetNew.h:86
int sizeX() const
edm::EDGetTokenT< SiPixelClusterCollectionNew > clustersToken
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> FastPrimaryVertexWithWeightsProducer::beamSpotToken
private

Definition at line 72 of file FastPrimaryVertexWithWeightsProducer.cc.

edm::EDGetTokenT<SiPixelClusterCollectionNew> FastPrimaryVertexWithWeightsProducer::clustersToken
private

Definition at line 71 of file FastPrimaryVertexWithWeightsProducer.cc.

edm::EDGetTokenT<edm::View<reco::Jet> > FastPrimaryVertexWithWeightsProducer::jetsToken
private

Definition at line 73 of file FastPrimaryVertexWithWeightsProducer.cc.

bool FastPrimaryVertexWithWeightsProducer::m_barrel
private

Definition at line 79 of file FastPrimaryVertexWithWeightsProducer.cc.

edm::InputTag FastPrimaryVertexWithWeightsProducer::m_beamSpot
private

Definition at line 69 of file FastPrimaryVertexWithWeightsProducer.cc.

edm::InputTag FastPrimaryVertexWithWeightsProducer::m_clusters
private

Definition at line 67 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_EC_weight
private

Definition at line 104 of file FastPrimaryVertexWithWeightsProducer.cc.

bool FastPrimaryVertexWithWeightsProducer::m_endCap
private

Definition at line 98 of file FastPrimaryVertexWithWeightsProducer.cc.

edm::InputTag FastPrimaryVertexWithWeightsProducer::m_jets
private

Definition at line 70 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_maxDeltaPhi
private

Definition at line 81 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_maxDeltaPhi_EC
private

Definition at line 101 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_maxJetEta
private

Definition at line 77 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_maxJetEta_EC
private

Definition at line 100 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_maxSizeX
private

Definition at line 80 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_maxSizeY_q
private

Definition at line 86 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_maxZ
private

Definition at line 66 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_minJetEta_EC
private

Definition at line 99 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_minJetPt
private

Definition at line 78 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_minSizeY_q
private

Definition at line 85 of file FastPrimaryVertexWithWeightsProducer.cc.

int FastPrimaryVertexWithWeightsProducer::m_njets
private

Definition at line 76 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_peakSizeY_q
private

Definition at line 95 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_PixelCellHeightOverWidth
private

Definition at line 84 of file FastPrimaryVertexWithWeightsProducer.cc.

std::string FastPrimaryVertexWithWeightsProducer::m_pixelCPE
private

Definition at line 68 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_weight_charge_down
private

Definition at line 82 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_weight_charge_peak
private

Definition at line 94 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_weight_charge_up
private

Definition at line 83 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_weight_dPhi
private

Definition at line 91 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_weight_dPhi_EC
private

Definition at line 105 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_weight_rho_up
private

Definition at line 93 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_weight_SizeX1
private

Definition at line 92 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_weightCut_step2
private

Definition at line 114 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_weightCut_step3
private

Definition at line 119 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_zClusterSearchArea_step2
private

Definition at line 113 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_zClusterSearchArea_step3
private

Definition at line 118 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_zClusterWidth_step1
private

Definition at line 109 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_zClusterWidth_step2
private

Definition at line 112 of file FastPrimaryVertexWithWeightsProducer.cc.

double FastPrimaryVertexWithWeightsProducer::m_zClusterWidth_step3
private

Definition at line 117 of file FastPrimaryVertexWithWeightsProducer.cc.