CMS 3D CMS Logo

Classes | Functions
PFAnalysis.cc File Reference
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
#include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
#include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
#include "DataFormats/HcalRecHit/interface/HFRecHit.h"
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
#include "Geometry/HcalCommonData/interface/HcalHitRelabeller.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
#include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
#include "DataFormats/ParticleFlowReco/interface/PFBlockElementSuperCluster.h"
#include "DataFormats/ParticleFlowReco/interface/PFBlockElementGsfTrack.h"
#include "DataFormats/ParticleFlowReco/interface/PFBlockElementTrack.h"
#include "DataFormats/ParticleFlowReco/interface/PFBlockElementBrem.h"
#include "DataFormats/ParticleFlowReco/interface/PFBlockElementCluster.h"
#include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h"
#include "SimDataFormats/CaloAnalysis/interface/CaloParticle.h"
#include "SimDataFormats/CaloAnalysis/interface/SimCluster.h"
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
#include "DataFormats/RecoCandidate/interface/TrackAssociation.h"
#include "DataFormats/ParticleFlowReco/interface/PFBlock.h"
#include "DataFormats/Math/interface/deltaPhi.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/GeometrySurface/interface/PlaneBuilder.h"
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "CommonTools/BaseParticlePropagator/interface/BaseParticlePropagator.h"
#include "FastSimulation/CaloGeometryTools/interface/Transform3DPJ.h"
#include "MagneticField/Engine/interface/MagneticField.h"
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
#include "MagneticField/VolumeGeometry/interface/MagVolumeOutsideValidity.h"
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "TH1F.h"
#include "TVector2.h"
#include "TTree.h"
#include <map>
#include <set>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

class  ElementWithIndex
 
class  PFAnalysis
 

Functions

double detid_compare (const map< uint64_t, double > &rechits, const map< uint64_t, double > &simhits, const map< uint64_t, double > &rechits_energy, bool print)
 
int find_element_ref (const vector< ElementWithIndex > &vec, const edm::RefToBase< reco::Track > &r)
 
int get_index_triu_vector (int i, int j, int n)
 
pair< int, int > get_triu_vector_index (int k, int n)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< PFAnalysis > > s_filler__LINE__ ("PFAnalysis")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< PFAnalysis > > s_maker__LINE__ ("PFAnalysis")
 

Function Documentation

◆ detid_compare()

double detid_compare ( const map< uint64_t, double > &  rechits,
const map< uint64_t, double > &  simhits,
const map< uint64_t, double > &  rechits_energy,
bool  print 
)

Definition at line 99 of file PFAnalysis.cc.

102  {
103  double ret = 0.0;
104 
105  for (const auto& rh : rechits) {
106  for (const auto& sh : simhits) {
107  if (rh.first == sh.first) {
108  //rechit energy times simhit fraction
109  ret += rechits_energy.at(rh.first) * sh.second;
110  break;
111  }
112  }
113  }
114  return ret;
115 }

References TrackInfoProducer_cfi::rechits, runTheMatrix::ret, and HLTBitAnalyser_cfi::simhits.

Referenced by PFAnalysis::associateClusterToSimCluster().

◆ find_element_ref()

int find_element_ref ( const vector< ElementWithIndex > &  vec,
const edm::RefToBase< reco::Track > &  r 
)

Definition at line 76 of file PFAnalysis.cc.

76  {
77  for (unsigned int i = 0; i < vec.size(); i++) {
78  const auto& elem = vec.at(i);
79  if (elem.orig.type() == reco::PFBlockElement::TRACK) {
80  const auto& ref = elem.orig.trackRef();
81  assert(ref.isNonnull());
82  if (ref.key() == r.key()) {
83  return i;
84  }
85  } else if (elem.orig.type() == reco::PFBlockElement::BREM) {
86  const auto& ref = elem.orig.trackRefPF();
87  if (ref.isNonnull()) {
88  const auto& ref2 = ref->trackRef();
89  assert(ref2.isNonnull());
90  if (ref2.key() == r.key()) {
91  return i;
92  }
93  }
94  }
95  }
96  return -1;
97 }

References cms::cuda::assert(), reco::PFBlockElement::BREM, mps_fire::i, alignCSCRings::r, and reco::PFBlockElement::TRACK.

Referenced by PFAnalysis::analyze().

◆ get_index_triu_vector()

int get_index_triu_vector ( int  i,
int  j,
int  n 
)

Definition at line 933 of file PFAnalysis.cc.

933  {
934  int k = (n * (n - 1) / 2) - (n - i) * ((n - i) - 1) / 2 + j - i - 1;
935  return k;
936 }

References mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, and dqmiodumpmetadata::n.

◆ get_triu_vector_index()

pair<int, int> get_triu_vector_index ( int  k,
int  n 
)

Definition at line 938 of file PFAnalysis.cc.

938  {
939  int i = n - 2 - floor(sqrt(-8 * k + 4 * n * (n - 1) - 7) / 2.0 - 0.5);
940  int j = k + i + 1 - n * (n - 1) / 2 + (n - i) * ((n - i) - 1) / 2;
941  return make_pair(i, j);
942 }

References mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, dqmiodumpmetadata::n, and mathSSE::sqrt().

Referenced by PFAnalysis::processBlocks().

◆ s_filler__LINE__()

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< PFAnalysis > > s_filler__LINE__ ( "PFAnalysis"  )
static

◆ s_maker__LINE__()

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< PFAnalysis > > s_maker__LINE__ ( "PFAnalysis"  )
static
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
cms::cuda::assert
assert(be >=bs)
reco::PFBlockElement::TRACK
Definition: PFBlockElement.h:32
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HLTBitAnalyser_cfi.simhits
simhits
SIM objects.
Definition: HLTBitAnalyser_cfi.py:21
TrackInfoProducer_cfi.rechits
rechits
Definition: TrackInfoProducer_cfi.py:9
reco::PFBlockElement::BREM
Definition: PFBlockElement.h:38
alignCSCRings.r
r
Definition: alignCSCRings.py:93
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66