CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PFAnalysis Class Reference
Inheritance diagram for PFAnalysis:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef ROOT::Math::Transform3D::Point Point
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void beginRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
void endRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
 PFAnalysis ()
 
 PFAnalysis (const edm::ParameterSet &)
 
 ~PFAnalysis () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void associateClusterToSimCluster (const vector< ElementWithIndex > &all_elements)
 
void beginJob () override
 
void clearVariables ()
 
void endJob () override
 
GlobalPoint getHitPosition (const DetId &id)
 
pair< vector< ElementWithIndex >, vector< tuple< int, int, float > > > processBlocks (const std::vector< reco::PFBlock > &pfBlocks)
 
void processTrackingParticles (const edm::View< TrackingParticle > &trackingParticles, edm::Handle< edm::View< TrackingParticle >> &trackingParticlesHandle)
 

Private Attributes

MagneticField const * aField_
 
edm::EDGetTokenT< edm::View< CaloParticle > > caloParticles_
 
vector< int > element_charge_
 
vector< float > element_cluster_flags_
 
vector< float > element_corr_energy_
 
vector< float > element_deltap_
 
vector< float > element_depth_
 
vector< float > element_distance_d_
 
vector< int > element_distance_i_
 
vector< int > element_distance_j_
 
vector< float > element_energy_
 
vector< float > element_eta_
 
vector< float > element_eta_ecal_
 
vector< float > element_eta_hcal_
 
vector< float > element_gsf_electronseed_trkorecal_
 
vector< int > element_layer_
 
vector< float > element_muon_csc_hits_
 
vector< float > element_muon_dt_hits_
 
vector< float > element_muon_type_
 
vector< float > element_num_hits_
 
vector< float > element_phi_
 
vector< float > element_phi_ecal_
 
vector< float > element_phi_hcal_
 
vector< float > element_pt_
 
vector< float > element_px_
 
vector< float > element_py_
 
vector< float > element_pz_
 
vector< float > element_sigmadeltap_
 
vector< pair< int, int > > element_to_candidate
 
vector< float > element_trajpoint_
 
vector< int > element_type_
 
edm::EventNumber_t ev_event_
 
edm::LuminosityBlockNumber_t ev_lumi_
 
edm::RunNumber_t ev_run_
 
vector< int > gen_charge_
 
vector< vector< int > > gen_daughters_
 
vector< float > gen_energy_
 
vector< float > gen_eta_
 
vector< int > gen_pdgid_
 
vector< float > gen_phi_
 
vector< float > gen_pt_
 
vector< float > gen_px_
 
vector< float > gen_py_
 
vector< float > gen_pz_
 
vector< int > gen_status_
 
edm::EDGetTokenT< std::vector< reco::GenParticle > > genParticles_
 
CaloGeometrygeom
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeometryToken_
 
HcalTopologyhcal_topo
 
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecordhcalDDDrecToken_
 
const HcalDDDRecConstantshcons
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagFieldToken_
 
edm::EDGetTokenT< std::vector< reco::PFBlock > > pfBlocks_
 
vector< float > pfcandidate_energy_
 
vector< float > pfcandidate_eta_
 
vector< int > pfcandidate_pdgid_
 
vector< float > pfcandidate_phi_
 
vector< float > pfcandidate_pt_
 
vector< float > pfcandidate_px_
 
vector< float > pfcandidate_py_
 
vector< float > pfcandidate_pz_
 
edm::EDGetTokenT< std::vector< reco::PFCandidate > > pfCandidates_
 
vector< float > rechit_det_
 
vector< uint64_t > rechit_detid_
 
vector< float > rechit_e_
 
vector< float > rechit_eta_
 
vector< int > rechit_idx_element_
 
vector< float > rechit_phi_
 
vector< float > rechit_subdet_
 
vector< float > rechit_x_
 
vector< float > rechit_y_
 
vector< float > rechit_z_
 
bool saveHits
 
vector< int > simcluster_bx_
 
vector< std::map< uint64_t, double > > simcluster_detids_
 
vector< float > simcluster_energy_
 
vector< float > simcluster_eta_
 
vector< int > simcluster_ev_
 
vector< int > simcluster_idx_trackingparticle_
 
vector< int > simcluster_nhits_
 
vector< float > simcluster_phi_
 
vector< int > simcluster_pid_
 
vector< float > simcluster_pt_
 
vector< float > simcluster_px_
 
vector< float > simcluster_py_
 
vector< float > simcluster_pz_
 
vector< pair< int, int > > simcluster_to_element
 
vector< float > simcluster_to_element_cmp
 
vector< int > simhit_det_
 
vector< uint64_t > simhit_detid_
 
vector< float > simhit_eta_
 
vector< float > simhit_frac_
 
vector< int > simhit_idx_simcluster_
 
vector< float > simhit_phi_
 
vector< int > simhit_subdet_
 
vector< float > simhit_x_
 
vector< float > simhit_y_
 
vector< float > simhit_z_
 
vector< int > simtrack_idx_simcluster_
 
vector< int > simtrack_pid_
 
vector< float > simtrack_x_
 
vector< float > simtrack_y_
 
vector< float > simtrack_z_
 
TTree * t_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtopologyToken_
 
vector< int > trackingparticle_bx_
 
vector< float > trackingparticle_dvx_
 
vector< float > trackingparticle_dvy_
 
vector< float > trackingparticle_dvz_
 
vector< float > trackingparticle_energy_
 
vector< float > trackingparticle_eta_
 
vector< int > trackingparticle_ev_
 
vector< float > trackingparticle_exx_
 
vector< float > trackingparticle_exy_
 
vector< int > trackingparticle_mother_
 
vector< float > trackingparticle_ovx_
 
vector< float > trackingparticle_ovy_
 
vector< float > trackingparticle_ovz_
 
vector< float > trackingparticle_phi_
 
vector< int > trackingparticle_pid_
 
vector< float > trackingparticle_pt_
 
vector< float > trackingparticle_px_
 
vector< float > trackingparticle_py_
 
vector< float > trackingparticle_pz_
 
vector< pair< int, int > > trackingparticle_to_element
 
edm::EDGetTokenT< edm::View< TrackingParticle > > trackingParticles_
 
edm::EDGetTokenT< edm::View< reco::Track > > tracks_
 
edm::EDGetTokenT< reco::RecoToSimCollectiontracks_recotosim_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 124 of file PFAnalysisNtuplizer.cc.

Member Typedef Documentation

◆ Point

typedef ROOT::Math::Transform3D::Point PFAnalysis::Point

Definition at line 126 of file PFAnalysisNtuplizer.cc.

Constructor & Destructor Documentation

◆ PFAnalysis() [1/2]

PFAnalysis::PFAnalysis ( )

Definition at line 301 of file PFAnalysisNtuplizer.cc.

301 { ; }

◆ PFAnalysis() [2/2]

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

Definition at line 303 of file PFAnalysisNtuplizer.cc.

References compareTotals::fs, edm::ParameterSet::getUntrackedParameter(), ProducerED_cfi::InputTag, and TFileService::kSharedResource.

303  {
304  tracks_recotosim_ = consumes<reco::RecoToSimCollection>(edm::InputTag("trackingParticleRecoTrackAsssociation"));
305  trackingParticles_ = consumes<edm::View<TrackingParticle>>(edm::InputTag("mix", "MergedTrackTruth"));
306  caloParticles_ = consumes<edm::View<CaloParticle>>(edm::InputTag("mix", "MergedCaloTruth"));
307  genParticles_ = consumes<std::vector<reco::GenParticle>>(edm::InputTag("genParticles"));
308  pfBlocks_ = consumes<std::vector<reco::PFBlock>>(edm::InputTag("particleFlowBlock"));
309  pfCandidates_ = consumes<std::vector<reco::PFCandidate>>(edm::InputTag("particleFlow"));
310  tracks_ = consumes<edm::View<reco::Track>>(edm::InputTag("generalTracks"));
311  saveHits = iConfig.getUntrackedParameter<bool>("saveHits", false);
312 
313  geometryToken_ = esConsumes<CaloGeometry, CaloGeometryRecord>(edm::ESInputTag{});
314  topologyToken_ = esConsumes<HcalTopology, HcalRecNumberingRecord>(edm::ESInputTag{});
315  magFieldToken_ = esConsumes<edm::Transition::BeginRun>();
316  hcalDDDrecToken_ = esConsumes<edm::Transition::BeginRun>();
317 
318  usesResource(TFileService::kSharedResource);
320  fs->make<TH1F>("total", "total", 100, 0, 5.);
321 
322  t_ = fs->make<TTree>("pftree", "pftree");
323 
324  // event info
325  t_->Branch("event", &ev_event_);
326  t_->Branch("lumi", &ev_lumi_);
327  t_->Branch("run", &ev_run_);
328 
329  t_->Branch("trackingparticle_eta", &trackingparticle_eta_);
330  t_->Branch("trackingparticle_phi", &trackingparticle_phi_);
331  t_->Branch("trackingparticle_pt", &trackingparticle_pt_);
332  t_->Branch("trackingparticle_px", &trackingparticle_px_);
333  t_->Branch("trackingparticle_py", &trackingparticle_py_);
334  t_->Branch("trackingparticle_pz", &trackingparticle_pz_);
335  t_->Branch("trackingparticle_energy", &trackingparticle_energy_);
336  t_->Branch("trackingparticle_dvx", &trackingparticle_dvx_);
337  t_->Branch("trackingparticle_dvy", &trackingparticle_dvy_);
338  t_->Branch("trackingparticle_dvz", &trackingparticle_dvz_);
339  t_->Branch("trackingparticle_bx", &trackingparticle_bx_);
340  t_->Branch("trackingparticle_ev", &trackingparticle_ev_);
341  t_->Branch("trackingparticle_pid", &trackingparticle_pid_);
342 
343  t_->Branch("simcluster_eta", &simcluster_eta_);
344  t_->Branch("simcluster_phi", &simcluster_phi_);
345  t_->Branch("simcluster_pt", &simcluster_pt_);
346  t_->Branch("simcluster_px", &simcluster_px_);
347  t_->Branch("simcluster_py", &simcluster_py_);
348  t_->Branch("simcluster_pz", &simcluster_pz_);
349  t_->Branch("simcluster_energy", &simcluster_energy_);
350  t_->Branch("simcluster_bx", &simcluster_bx_);
351  t_->Branch("simcluster_ev", &simcluster_ev_);
352  t_->Branch("simcluster_pid", &simcluster_pid_);
353  t_->Branch("simcluster_idx_trackingparticle", &simcluster_idx_trackingparticle_);
354  t_->Branch("simcluster_nhits", &simcluster_nhits_);
355 
356  if (saveHits) {
357  t_->Branch("simhit_frac", &simhit_frac_);
358  t_->Branch("simhit_x", &simhit_x_);
359  t_->Branch("simhit_y", &simhit_y_);
360  t_->Branch("simhit_z", &simhit_z_);
361  t_->Branch("simhit_det", &simhit_det_);
362  t_->Branch("simhit_subdet", &simhit_subdet_);
363  t_->Branch("simhit_eta", &simhit_eta_);
364  t_->Branch("simhit_phi", &simhit_phi_);
365  t_->Branch("simhit_idx_simcluster", &simhit_idx_simcluster_);
366  t_->Branch("simhit_detid", &simhit_detid_);
367 
368  t_->Branch("rechit_e", &rechit_e_);
369  t_->Branch("rechit_x", &rechit_x_);
370  t_->Branch("rechit_y", &rechit_y_);
371  t_->Branch("rechit_z", &rechit_z_);
372  t_->Branch("rechit_det", &rechit_det_);
373  t_->Branch("rechit_subdet", &rechit_subdet_);
374  t_->Branch("rechit_eta", &rechit_eta_);
375  t_->Branch("rechit_phi", &rechit_phi_);
376  t_->Branch("rechit_idx_element", &rechit_idx_element_);
377  t_->Branch("rechit_detid", &rechit_detid_);
378  }
379 
380  t_->Branch("simtrack_x", &simtrack_x_);
381  t_->Branch("simtrack_y", &simtrack_y_);
382  t_->Branch("simtrack_z", &simtrack_z_);
383  t_->Branch("simtrack_idx_simcluster_", &simtrack_idx_simcluster_);
384  t_->Branch("simtrack_pid", &simtrack_pid_);
385 
386  t_->Branch("gen_eta", &gen_eta_);
387  t_->Branch("gen_phi", &gen_phi_);
388  t_->Branch("gen_pt", &gen_pt_);
389  t_->Branch("gen_px", &gen_px_);
390  t_->Branch("gen_py", &gen_py_);
391  t_->Branch("gen_pz", &gen_pz_);
392  t_->Branch("gen_energy", &gen_energy_);
393  t_->Branch("gen_charge", &gen_charge_);
394  t_->Branch("gen_pdgid", &gen_pdgid_);
395  t_->Branch("gen_status", &gen_status_);
396  t_->Branch("gen_daughters", &gen_daughters_);
397 
398  //PF Elements
399  t_->Branch("element_pt", &element_pt_);
400  t_->Branch("element_px", &element_px_);
401  t_->Branch("element_py", &element_py_);
402  t_->Branch("element_pz", &element_pz_);
403  t_->Branch("element_deltap", &element_deltap_);
404  t_->Branch("element_sigmadeltap", &element_sigmadeltap_);
405  t_->Branch("element_eta", &element_eta_);
406  t_->Branch("element_phi", &element_phi_);
407  t_->Branch("element_energy", &element_energy_);
408  t_->Branch("element_corr_energy", &element_corr_energy_);
409  t_->Branch("element_eta_ecal", &element_eta_ecal_);
410  t_->Branch("element_phi_ecal", &element_phi_ecal_);
411  t_->Branch("element_eta_hcal", &element_eta_hcal_);
412  t_->Branch("element_phi_hcal", &element_phi_hcal_);
413  t_->Branch("element_charge", &element_charge_);
414  t_->Branch("element_type", &element_type_);
415  t_->Branch("element_layer", &element_layer_);
416  t_->Branch("element_depth", &element_depth_);
417  t_->Branch("element_trajpoint", &element_trajpoint_);
418  t_->Branch("element_muon_dt_hits", &element_muon_dt_hits_);
419  t_->Branch("element_muon_csc_hits", &element_muon_csc_hits_);
420  t_->Branch("element_muon_type", &element_muon_type_);
421  t_->Branch("element_cluster_flags", &element_cluster_flags_);
422  t_->Branch("element_gsf_electronseed_trkorecal", &element_gsf_electronseed_trkorecal_);
423  t_->Branch("element_num_hits", &element_num_hits_);
424 
425  //Distance matrix between PF elements
426  t_->Branch("element_distance_i", &element_distance_i_);
427  t_->Branch("element_distance_j", &element_distance_j_);
428  t_->Branch("element_distance_d", &element_distance_d_);
429 
430  t_->Branch("pfcandidate_eta", &pfcandidate_eta_);
431  t_->Branch("pfcandidate_phi", &pfcandidate_phi_);
432  t_->Branch("pfcandidate_pt", &pfcandidate_pt_);
433  t_->Branch("pfcandidate_px", &pfcandidate_px_);
434  t_->Branch("pfcandidate_py", &pfcandidate_py_);
435  t_->Branch("pfcandidate_pz", &pfcandidate_pz_);
436  t_->Branch("pfcandidate_energy", &pfcandidate_energy_);
437  t_->Branch("pfcandidate_pdgid", &pfcandidate_pdgid_);
438 
439  //Links between reco, gen and PFCandidate objects
440  t_->Branch("trackingparticle_to_element", &trackingparticle_to_element);
441  t_->Branch("simcluster_to_element", &simcluster_to_element);
442  t_->Branch("simcluster_to_element_cmp", &simcluster_to_element_cmp);
443  t_->Branch("element_to_candidate", &element_to_candidate);
444 } // constructor
vector< int > element_charge_
static const std::string kSharedResource
Definition: TFileService.h:76
vector< uint64_t > rechit_detid_
vector< float > pfcandidate_pz_
vector< float > pfcandidate_px_
vector< float > gen_phi_
vector< int > simtrack_pid_
vector< int > element_distance_j_
vector< float > element_pz_
vector< int > simcluster_ev_
vector< float > element_phi_
vector< float > gen_energy_
vector< float > gen_py_
vector< float > element_corr_energy_
vector< int > simcluster_bx_
vector< float > simhit_phi_
vector< float > element_trajpoint_
vector< float > rechit_subdet_
vector< float > simcluster_px_
vector< float > element_gsf_electronseed_trkorecal_
vector< float > rechit_e_
vector< float > trackingparticle_phi_
vector< float > simcluster_eta_
vector< float > element_py_
vector< float > element_eta_
vector< int > gen_charge_
vector< int > simhit_idx_simcluster_
vector< int > simtrack_idx_simcluster_
vector< float > trackingparticle_eta_
vector< int > element_layer_
vector< float > gen_pz_
vector< float > rechit_det_
vector< float > element_sigmadeltap_
vector< float > simcluster_py_
vector< float > rechit_y_
T getUntrackedParameter(std::string const &, T const &) const
vector< int > trackingparticle_bx_
vector< float > element_pt_
vector< float > element_eta_ecal_
vector< float > simhit_z_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
edm::EDGetTokenT< std::vector< reco::GenParticle > > genParticles_
vector< float > simtrack_x_
vector< float > trackingparticle_pt_
vector< float > simhit_y_
vector< float > trackingparticle_dvx_
vector< float > gen_pt_
vector< float > element_depth_
vector< float > simcluster_energy_
vector< float > pfcandidate_phi_
edm::EDGetTokenT< edm::View< reco::Track > > tracks_
edm::EDGetTokenT< std::vector< reco::PFBlock > > pfBlocks_
vector< vector< int > > gen_daughters_
vector< pair< int, int > > element_to_candidate
vector< float > pfcandidate_eta_
vector< float > trackingparticle_energy_
vector< float > gen_px_
vector< float > trackingparticle_py_
vector< float > simcluster_phi_
vector< float > pfcandidate_pt_
edm::RunNumber_t ev_run_
vector< float > pfcandidate_py_
vector< float > gen_eta_
vector< int > element_distance_i_
vector< float > element_muon_csc_hits_
vector< float > element_muon_type_
vector< float > rechit_phi_
vector< float > simhit_x_
vector< int > trackingparticle_pid_
edm::EDGetTokenT< std::vector< reco::PFCandidate > > pfCandidates_
vector< int > simcluster_pid_
vector< int > simhit_det_
vector< int > simhit_subdet_
vector< float > element_energy_
edm::EventNumber_t ev_event_
edm::LuminosityBlockNumber_t ev_lumi_
vector< float > element_px_
vector< float > element_deltap_
edm::EDGetTokenT< edm::View< TrackingParticle > > trackingParticles_
vector< int > gen_status_
vector< float > element_cluster_flags_
edm::EDGetTokenT< edm::View< CaloParticle > > caloParticles_
vector< int > gen_pdgid_
vector< float > element_phi_hcal_
vector< float > trackingparticle_dvz_
vector< int > trackingparticle_ev_
vector< int > element_type_
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > hcalDDDrecToken_
vector< float > simhit_frac_
vector< pair< int, int > > simcluster_to_element
vector< float > rechit_z_
vector< float > simcluster_pt_
vector< float > simcluster_pz_
vector< float > simtrack_y_
vector< int > pfcandidate_pdgid_
vector< float > pfcandidate_energy_
vector< float > rechit_x_
vector< float > trackingparticle_dvy_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
edm::EDGetTokenT< reco::RecoToSimCollection > tracks_recotosim_
vector< float > trackingparticle_px_
vector< float > simhit_eta_
vector< float > element_muon_dt_hits_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topologyToken_
vector< pair< int, int > > trackingparticle_to_element
vector< float > element_phi_ecal_
vector< float > simtrack_z_
vector< float > simcluster_to_element_cmp
vector< float > rechit_eta_
vector< float > trackingparticle_pz_
vector< float > element_num_hits_
vector< int > simcluster_idx_trackingparticle_
vector< int > simcluster_nhits_
vector< int > rechit_idx_element_
vector< float > element_eta_hcal_
vector< uint64_t > simhit_detid_
vector< float > element_distance_d_

◆ ~PFAnalysis()

PFAnalysis::~PFAnalysis ( )
override

Definition at line 446 of file PFAnalysisNtuplizer.cc.

446 {}

Member Function Documentation

◆ analyze()

void PFAnalysis::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 593 of file PFAnalysisNtuplizer.cc.

References cms::cuda::assert(), reco::PFBlockElement::BREM, caloTruthCellsProducer_cfi::caloParticles, ALCARECOTkAlJpsiMuMu_cff::charge, ztail::d, BPhysicsValidation_cfi::daughters, hcalRecHitTable_cff::depth, DetId::Ecal, reco::PFBlockElement::ECAL, reco::PFTrajectoryPoint::ECALShowerMax, hcalRecHitTable_cff::energy, PVValHelper::eta, find_element_ref(), relativeConstraints::geom, edm::EventSetup::getData(), reco::PFBlockElement::GSF, DetId::Hcal, reco::PFBlockElement::HCAL, reco::PFTrajectoryPoint::HCALEntrance, photonIsolationHIProducer_cfi::hf, reco::PFBlockElement::HFEM, reco::PFBlockElement::HFHAD, reco::PFBlockElement::HO, l1ctLayer2EG_cff::id, iEvent, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), dqmiolumiharvest::j, edm::Ref< C, T, F >::key(), nhits, ntrack, zmumugammaAnalyzer_cfi::pfCandidates, reco::PFBlockElement::PS1, reco::PFBlockElement::PS2, DiDispStaMuonMonitor_cfi::pt, pv::pT, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, nano_mu_digi_cff::rawId, reco::PFBlockElement::SC, submitPVValidationJobs::t, cmsswSequenceInfo::tp, reco::PFBlockElement::TRACK, muonClassificationByHits_cfi::trackingParticles, DiMuonV_cfg::tracks, and x.

593  {
594  clearVariables();
595 
596  auto& pG = iSetup.getData(geometryToken_);
597  geom = (CaloGeometry*)&pG;
598  auto& pT = iSetup.getData(topologyToken_);
600 
601  //Simulated tracks, cleaned up by TrackingTruthAccumulator
602  edm::Handle<edm::View<TrackingParticle>> trackingParticlesHandle;
603  iEvent.getByToken(trackingParticles_, trackingParticlesHandle);
604  const edm::View<TrackingParticle>& trackingParticles = *trackingParticlesHandle;
605 
606  edm::Handle<edm::View<CaloParticle>> caloParticlesHandle;
607  iEvent.getByToken(caloParticles_, caloParticlesHandle);
608  const edm::View<CaloParticle>& caloParticles = *caloParticlesHandle;
609 
610  //Matches reco tracks to sim tracks (TrackingParticle)
611  edm::Handle<reco::RecoToSimCollection> recotosimCollection;
612  iEvent.getByToken(tracks_recotosim_, recotosimCollection);
613  const auto recotosim = *recotosimCollection;
614 
616  iEvent.getByToken(tracks_, trackHandle);
617  const edm::View<reco::Track>& tracks = *trackHandle;
618 
619  edm::Handle<std::vector<reco::GenParticle>> genParticlesHandle;
620  iEvent.getByToken(genParticles_, genParticlesHandle);
621  for (std::vector<reco::GenParticle>::const_iterator it_p = genParticlesHandle->begin();
622  it_p != genParticlesHandle->end();
623  ++it_p) {
624  gen_eta_.push_back(it_p->eta());
625  gen_phi_.push_back(it_p->phi());
626  gen_pt_.push_back(it_p->pt());
627  gen_px_.push_back(it_p->px());
628  gen_py_.push_back(it_p->py());
629  gen_pz_.push_back(it_p->pz());
630  gen_energy_.push_back(it_p->energy());
631  gen_charge_.push_back(it_p->charge());
632  gen_pdgid_.push_back(it_p->pdgId());
633  gen_status_.push_back(it_p->status());
634  std::vector<int> daughters(it_p->daughterRefVector().size(), 0);
635  for (unsigned j = 0; j < it_p->daughterRefVector().size(); ++j) {
636  daughters[j] = static_cast<int>(it_p->daughterRefVector().at(j).key());
637  }
638  gen_daughters_.push_back(daughters);
639  }
640 
641  edm::Handle<std::vector<reco::PFCandidate>> pfCandidatesHandle;
642  iEvent.getByToken(pfCandidates_, pfCandidatesHandle);
643  std::vector<reco::PFCandidate> pfCandidates = *pfCandidatesHandle;
644 
646  iEvent.getByToken(pfBlocks_, pfBlocksHandle);
647  std::vector<reco::PFBlock> pfBlocks = *pfBlocksHandle;
648 
649  //Collect all clusters, tracks and superclusters
650  const auto& all_elements_distances = processBlocks(pfBlocks);
651  const auto& all_elements = all_elements_distances.first;
652  const auto& all_distances = all_elements_distances.second;
653  assert(!all_elements.empty());
654  //assert(all_distances.size() > 0);
655  for (const auto& d : all_distances) {
656  element_distance_i_.push_back(get<0>(d));
657  element_distance_j_.push_back(get<1>(d));
658  element_distance_d_.push_back(get<2>(d));
659  }
660 
661  //We need to use the original reco::Track collection for track association
662  for (unsigned long ntrack = 0; ntrack < tracks.size(); ntrack++) {
663  edm::RefToBase<reco::Track> trackref(trackHandle, ntrack);
664  const auto vec_idx_in_all_elements = find_element_ref(all_elements, trackref);
665 
666  //track was not used by PF, we skip as well
667  if (vec_idx_in_all_elements.empty()) {
668  continue;
669  }
670 
671  if (recotosim.find(trackref) != recotosim.end()) {
672  const auto& tps = recotosim[trackref];
673  for (const auto& tp : tps) {
675  for (auto idx_in_all_elements : vec_idx_in_all_elements) {
676  trackingparticle_to_element.emplace_back(tpr.key(), idx_in_all_elements);
677  }
678  }
679  }
680  }
681 
682  processTrackingParticles(trackingParticles, trackingParticlesHandle);
683 
684  int idx_simcluster = 0;
685  //Fill genparticles from calorimeter hits
686  for (unsigned long ncaloparticle = 0; ncaloparticle < caloParticles.size(); ncaloparticle++) {
687  const auto& cp = caloParticles.at(ncaloparticle);
688  edm::RefToBase<CaloParticle> cpref(caloParticlesHandle, ncaloparticle);
689 
690  int nhits = 0;
691  for (const auto& simcluster : cp.simClusters()) {
692  //create a map of detId->energy of all the rechits in all the clusters of this SimCluster
693  map<uint64_t, double> detid_energy;
694 
695  simcluster_nhits_.push_back(nhits);
696  simcluster_eta_.push_back(simcluster->p4().eta());
697  simcluster_phi_.push_back(simcluster->p4().phi());
698  simcluster_pt_.push_back(simcluster->p4().pt());
699  simcluster_energy_.push_back(simcluster->energy());
700  simcluster_pid_.push_back(simcluster->pdgId());
701  simcluster_bx_.push_back(simcluster->eventId().bunchCrossing());
702  simcluster_ev_.push_back(simcluster->eventId().event());
703 
704  simcluster_px_.push_back(simcluster->p4().x());
705  simcluster_py_.push_back(simcluster->p4().y());
706  simcluster_pz_.push_back(simcluster->p4().z());
707 
708  for (const auto& hf : simcluster->hits_and_fractions()) {
709  DetId id(hf.first);
710 
711  if (id.det() == DetId::Hcal || id.det() == DetId::Ecal) {
712  const auto& pos = getHitPosition(id);
713  nhits += 1;
714 
715  const float x = pos.x();
716  const float y = pos.y();
717  const float z = pos.z();
718  const float eta = pos.eta();
719  const float phi = pos.phi();
720 
721  simhit_frac_.push_back(hf.second);
722  simhit_x_.push_back(x);
723  simhit_y_.push_back(y);
724  simhit_z_.push_back(z);
725  simhit_det_.push_back(id.det());
726  simhit_subdet_.push_back(id.subdetId());
727  simhit_eta_.push_back(eta);
728  simhit_phi_.push_back(phi);
729  simhit_idx_simcluster_.push_back(idx_simcluster);
730  simhit_detid_.push_back(id.rawId());
731  detid_energy[id.rawId()] += hf.second;
732  }
733  }
734 
735  int simcluster_to_trackingparticle = -1;
736  for (const auto& simtrack : simcluster->g4Tracks()) {
737  simtrack_x_.push_back(simtrack.trackerSurfacePosition().x());
738  simtrack_y_.push_back(simtrack.trackerSurfacePosition().y());
739  simtrack_z_.push_back(simtrack.trackerSurfacePosition().z());
740  simtrack_idx_simcluster_.push_back(idx_simcluster);
741  simtrack_pid_.push_back(simtrack.type());
742 
743  for (unsigned int itp = 0; itp < trackingParticles.size(); itp++) {
744  const auto& simtrack2 = trackingParticles.at(itp).g4Tracks().at(0);
745  //compare the two tracks, taking into account that both eventId and trackId need to be compared due to pileup
746  if (simtrack.eventId() == simtrack2.eventId() && simtrack.trackId() == simtrack2.trackId()) {
747  simcluster_to_trackingparticle = itp;
748  //we are satisfied with the first match, in practice there should not be more
749  break;
750  }
751  } //trackingParticles
752  } //simcluster tracks
753 
754  simcluster_detids_.push_back(detid_energy);
755  simcluster_idx_trackingparticle_.push_back(simcluster_to_trackingparticle);
756 
757  idx_simcluster += 1;
758  } //simclusters
759  } //caloParticles
760 
761  associateClusterToSimCluster(all_elements);
762 
763  //fill elements
764  for (unsigned int ielem = 0; ielem < all_elements.size(); ielem++) {
765  const auto& elem = all_elements.at(ielem);
766  const auto& orig = elem.orig;
767  reco::PFBlockElement::Type type = orig.type();
768 
769  float pt = 0.0;
770  float deltap = 0.0;
771  float sigmadeltap = 0.0;
772  float px = 0.0;
773  float py = 0.0;
774  float pz = 0.0;
775  float eta = 0.0;
776  float phi = 0.0;
777  float energy = 0.0;
778  float corr_energy = 0.0;
779  float trajpoint = 0.0;
780  float eta_ecal = 0.0;
781  float phi_ecal = 0.0;
782  float eta_hcal = 0.0;
783  float phi_hcal = 0.0;
784  int charge = 0;
785  int layer = 0;
786  float depth = 0;
787  float muon_dt_hits = 0.0;
788  float muon_csc_hits = 0.0;
789  float muon_type = 0.0;
790  float cluster_flags = 0.0;
791  float gsf_electronseed_trkorecal = 0.0;
792  float num_hits = 0.0;
793 
795  const auto& matched_pftrack = orig.trackRefPF();
796  if (matched_pftrack.isNonnull()) {
797  const auto& atECAL = matched_pftrack->extrapolatedPoint(reco::PFTrajectoryPoint::ECALShowerMax);
798  const auto& atHCAL = matched_pftrack->extrapolatedPoint(reco::PFTrajectoryPoint::HCALEntrance);
799  if (atHCAL.isValid()) {
800  eta_hcal = atHCAL.positionREP().eta();
801  phi_hcal = atHCAL.positionREP().phi();
802  }
803  if (atECAL.isValid()) {
804  eta_ecal = atECAL.positionREP().eta();
805  phi_ecal = atECAL.positionREP().phi();
806  }
807  }
808  const auto& ref = ((const reco::PFBlockElementTrack*)&orig)->trackRef();
809  pt = ref->pt();
810  px = ref->px();
811  py = ref->py();
812  pz = ref->pz();
813  eta = ref->eta();
814  phi = ref->phi();
815  energy = ref->p();
816  charge = ref->charge();
817  num_hits = ref->recHitsSize();
818 
819  reco::MuonRef muonRef = orig.muonRef();
820  if (muonRef.isNonnull()) {
821  reco::TrackRef standAloneMu = muonRef->standAloneMuon();
822  if (standAloneMu.isNonnull()) {
823  muon_dt_hits = standAloneMu->hitPattern().numberOfValidMuonDTHits();
824  muon_csc_hits = standAloneMu->hitPattern().numberOfValidMuonCSCHits();
825  }
826  muon_type = muonRef->type();
827  }
828 
829  } else if (type == reco::PFBlockElement::BREM) {
830  const auto* orig2 = (const reco::PFBlockElementBrem*)&orig;
831  const auto& ref = orig2->GsftrackRef();
832  trajpoint = orig2->indTrajPoint();
833  if (ref.isNonnull()) {
834  deltap = orig2->DeltaP();
835  sigmadeltap = orig2->SigmaDeltaP();
836  pt = ref->pt();
837  px = ref->px();
838  py = ref->py();
839  pz = ref->pz();
840  eta = ref->eta();
841  phi = ref->phi();
842  energy = ref->p();
843  charge = ref->charge();
844  }
845 
846  const auto& gsfextraref = ref->extra();
847  if (gsfextraref.isAvailable() && gsfextraref->seedRef().isAvailable()) {
848  reco::ElectronSeedRef seedref = gsfextraref->seedRef().castTo<reco::ElectronSeedRef>();
849  if (seedref.isAvailable()) {
850  if (seedref->isEcalDriven()) {
851  gsf_electronseed_trkorecal = 1.0;
852  } else if (seedref->isTrackerDriven()) {
853  gsf_electronseed_trkorecal = 2.0;
854  }
855  }
856  }
857 
858  } else if (type == reco::PFBlockElement::GSF) {
859  //requires to keep GsfPFRecTracks
860  const auto* orig2 = (const reco::PFBlockElementGsfTrack*)&orig;
861  const auto& vec = orig2->Pin();
862  pt = vec.pt();
863  px = vec.px();
864  py = vec.py();
865  pz = vec.pz();
866  eta = vec.eta();
867  phi = vec.phi();
868  energy = vec.energy();
869 
870  const auto& vec2 = orig2->Pout();
871  eta_ecal = vec2.eta();
872  phi_ecal = vec2.phi();
873 
874  if (!orig2->GsftrackRefPF().isNull()) {
875  charge = orig2->GsftrackRefPF()->charge();
876  num_hits = orig2->GsftrackRefPF()->PFRecBrem().size();
877  }
878 
879  const auto& ref = orig2->GsftrackRef();
880 
881  const auto& gsfextraref = ref->extra();
882  if (gsfextraref.isAvailable() && gsfextraref->seedRef().isAvailable()) {
883  reco::ElectronSeedRef seedref = gsfextraref->seedRef().castTo<reco::ElectronSeedRef>();
884  if (seedref.isAvailable()) {
885  if (seedref->isEcalDriven()) {
886  gsf_electronseed_trkorecal = 1.0;
887  } else if (seedref->isTrackerDriven()) {
888  gsf_electronseed_trkorecal = 2.0;
889  }
890  }
891  };
892 
897  const auto& ref = ((const reco::PFBlockElementCluster*)&orig)->clusterRef();
898  if (ref.isNonnull()) {
899  cluster_flags = ref->flags();
900  eta = ref->eta();
901  phi = ref->phi();
902  pt = ref->pt();
903  px = ref->position().x();
904  py = ref->position().y();
905  pz = ref->position().z();
906  energy = ref->energy();
907  corr_energy = ref->correctedEnergy();
908  layer = ref->layer();
909  depth = ref->depth();
910  num_hits = ref->recHitFractions().size();
911  }
912  } else if (type == reco::PFBlockElement::SC) {
913  const auto& clref = ((const reco::PFBlockElementSuperCluster*)&orig)->superClusterRef();
914  if (clref.isNonnull()) {
915  cluster_flags = clref->flags();
916  eta = clref->eta();
917  phi = clref->phi();
918  px = clref->position().x();
919  py = clref->position().y();
920  pz = clref->position().z();
921  energy = clref->energy();
922  num_hits = clref->clustersSize();
923  }
924  }
925  vector<int> tps;
926  for (const auto& t : trackingparticle_to_element) {
927  if (t.second == (int)ielem) {
928  tps.push_back(t.first);
929  }
930  }
931  vector<int> scs;
932  for (const auto& t : simcluster_to_element) {
933  if (t.second == (int)ielem) {
934  scs.push_back(t.first);
935  }
936  }
937 
938  element_pt_.push_back(pt);
939  element_px_.push_back(px);
940  element_py_.push_back(py);
941  element_pz_.push_back(pz);
942  element_deltap_.push_back(deltap);
943  element_sigmadeltap_.push_back(sigmadeltap);
944  element_eta_.push_back(eta);
945  element_phi_.push_back(phi);
946  element_energy_.push_back(energy);
947  element_corr_energy_.push_back(corr_energy);
948  element_eta_ecal_.push_back(eta_ecal);
949  element_phi_ecal_.push_back(phi_ecal);
950  element_eta_hcal_.push_back(eta_hcal);
951  element_phi_hcal_.push_back(phi_hcal);
952  element_charge_.push_back(charge);
953  element_type_.push_back(type);
954  element_layer_.push_back(layer);
955  element_depth_.push_back(depth);
956  element_trajpoint_.push_back(trajpoint);
957  element_muon_dt_hits_.push_back(muon_dt_hits);
958  element_muon_csc_hits_.push_back(muon_csc_hits);
959  element_muon_type_.push_back(muon_type);
960  element_cluster_flags_.push_back(cluster_flags);
961  element_gsf_electronseed_trkorecal_.push_back(gsf_electronseed_trkorecal);
962  element_num_hits_.push_back(num_hits);
963  }
964 
965  //associate candidates to elements
966  int icandidate = 0;
967  for (const auto& cand : pfCandidates) {
968  pfcandidate_eta_.push_back(cand.eta());
969  pfcandidate_phi_.push_back(cand.phi());
970  pfcandidate_pt_.push_back(cand.pt());
971  pfcandidate_px_.push_back(cand.px());
972  pfcandidate_py_.push_back(cand.py());
973  pfcandidate_pz_.push_back(cand.pz());
974  pfcandidate_energy_.push_back(cand.energy());
975  pfcandidate_pdgid_.push_back(cand.pdgId());
976 
977  for (const auto& el : cand.elementsInBlocks()) {
978  const auto idx_block = el.first.index();
979  unsigned idx_element_in_block = el.second;
980 
981  int ielem = -1;
982  for (const auto& elem_with_index : all_elements) {
983  ielem += 1;
984  if (elem_with_index.idx_block == idx_block && elem_with_index.idx_elem == idx_element_in_block) {
985  break;
986  }
987  }
988  assert(ielem != -1);
989  element_to_candidate.push_back(make_pair(ielem, icandidate));
990  } //elements
991 
992  icandidate += 1;
993  } //pfCandidates
994 
995  ev_event_ = iEvent.id().event();
996  ev_lumi_ = iEvent.id().luminosityBlock();
997  ev_run_ = iEvent.id().run();
998 
999  t_->Fill();
1000 } //analyze
vector< int > element_charge_
vector< float > pfcandidate_pz_
vector< float > pfcandidate_px_
vector< float > gen_phi_
vector< int > simtrack_pid_
vector< int > element_distance_j_
vector< float > element_pz_
vector< int > simcluster_ev_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
vector< float > element_phi_
vector< float > gen_energy_
vector< float > gen_py_
vector< float > element_corr_energy_
vector< int > simcluster_bx_
vector< float > simhit_phi_
vector< float > element_trajpoint_
vector< float > simcluster_px_
vector< float > element_gsf_electronseed_trkorecal_
vector< float > simcluster_eta_
vector< float > element_py_
HcalTopology * hcal_topo
vector< float > element_eta_
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
vector< int > gen_charge_
vector< int > simhit_idx_simcluster_
vector< int > simtrack_idx_simcluster_
vector< int > element_layer_
assert(be >=bs)
vector< float > gen_pz_
vector< float > element_sigmadeltap_
key_type key() const
Accessor for product key.
Definition: Ref.h:250
vector< float > simcluster_py_
vector< float > element_pt_
vector< float > element_eta_ecal_
int iEvent
Definition: GenABIO.cc:224
CaloGeometry * geom
vector< float > simhit_z_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
edm::EDGetTokenT< std::vector< reco::GenParticle > > genParticles_
vector< float > simtrack_x_
bool isAvailable() const
Definition: Ref.h:541
vector< float > simhit_y_
vector< float > gen_pt_
vector< float > element_depth_
vector< float > simcluster_energy_
vector< int > find_element_ref(const vector< ElementWithIndex > &vec, const edm::RefToBase< reco::Track > &r)
vector< float > pfcandidate_phi_
edm::EDGetTokenT< edm::View< reco::Track > > tracks_
edm::EDGetTokenT< std::vector< reco::PFBlock > > pfBlocks_
vector< vector< int > > gen_daughters_
vector< pair< int, int > > element_to_candidate
vector< float > pfcandidate_eta_
vector< float > gen_px_
vector< float > simcluster_phi_
vector< float > pfcandidate_pt_
edm::RunNumber_t ev_run_
d
Definition: ztail.py:151
vector< float > pfcandidate_py_
GlobalPoint getHitPosition(const DetId &id)
vector< float > gen_eta_
vector< int > element_distance_i_
vector< float > element_muon_csc_hits_
vector< float > element_muon_type_
vector< float > simhit_x_
Definition: DetId.h:17
edm::EDGetTokenT< std::vector< reco::PFCandidate > > pfCandidates_
vector< int > simcluster_pid_
vector< int > simhit_det_
vector< int > simhit_subdet_
vector< float > element_energy_
edm::EventNumber_t ev_event_
edm::LuminosityBlockNumber_t ev_lumi_
vector< float > element_px_
vector< float > element_deltap_
void processTrackingParticles(const edm::View< TrackingParticle > &trackingParticles, edm::Handle< edm::View< TrackingParticle >> &trackingParticlesHandle)
edm::EDGetTokenT< edm::View< TrackingParticle > > trackingParticles_
vector< int > gen_status_
vector< float > element_cluster_flags_
edm::EDGetTokenT< edm::View< CaloParticle > > caloParticles_
vector< int > gen_pdgid_
vector< float > element_phi_hcal_
vector< int > element_type_
vector< std::map< uint64_t, double > > simcluster_detids_
vector< float > simhit_frac_
vector< pair< int, int > > simcluster_to_element
vector< float > simcluster_pt_
vector< float > simcluster_pz_
vector< float > simtrack_y_
vector< int > pfcandidate_pdgid_
vector< float > pfcandidate_energy_
edm::EDGetTokenT< reco::RecoToSimCollection > tracks_recotosim_
#define ntrack
vector< float > simhit_eta_
vector< float > element_muon_dt_hits_
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topologyToken_
vector< pair< int, int > > trackingparticle_to_element
vector< float > element_phi_ecal_
pair< vector< ElementWithIndex >, vector< tuple< int, int, float > > > processBlocks(const std::vector< reco::PFBlock > &pfBlocks)
vector< float > simtrack_z_
vector< float > element_num_hits_
vector< int > simcluster_idx_trackingparticle_
vector< int > simcluster_nhits_
void associateClusterToSimCluster(const vector< ElementWithIndex > &all_elements)
vector< float > element_eta_hcal_
vector< uint64_t > simhit_detid_
vector< float > element_distance_d_

◆ associateClusterToSimCluster()

void PFAnalysis::associateClusterToSimCluster ( const vector< ElementWithIndex > &  all_elements)
private

Definition at line 1081 of file PFAnalysisNtuplizer.cc.

References cms::cuda::assert(), fileCollector::cmp, reco::PFRecHit::detId(), detid_compare(), reco::PFBlockElement::ECAL, reco::PFRecHit::energy(), PVValHelper::eta, reco::PFBlockElement::HCAL, reco::PFBlockElement::HFEM, reco::PFBlockElement::HFHAD, reco::PFBlockElement::HO, reco::PFBlockElement::PS1, reco::PFBlockElement::PS2, nano_mu_digi_cff::rawId, reco::PFBlockElement::SC, and x.

1081  {
1082  vector<map<uint64_t, double>> detids_elements;
1083  map<uint64_t, double> rechits_energy_all;
1084 
1085  int idx_element = 0;
1086  for (const auto& elem : all_elements) {
1087  map<uint64_t, double> detids;
1088  const auto& type = elem.orig.type();
1089 
1093  const auto& clref = elem.orig.clusterRef();
1094  assert(clref.isNonnull());
1095  const auto& cluster = *clref;
1096 
1097  //all rechits and the energy fractions in this cluster
1098  const vector<reco::PFRecHitFraction>& rechit_fracs = cluster.recHitFractions();
1099  for (const auto& rh : rechit_fracs) {
1100  const reco::PFRecHit pfrh = *rh.recHitRef();
1101  if (detids.find(pfrh.detId()) != detids.end()) {
1102  continue;
1103  }
1104  detids[pfrh.detId()] += pfrh.energy() * rh.fraction();
1105  const auto id = DetId(pfrh.detId());
1106  float x = 0;
1107  float y = 0;
1108  float z = 0;
1109  float eta = 0;
1110  float phi = 0;
1111 
1112  const auto& pos = getHitPosition(id);
1113  x = pos.x();
1114  y = pos.y();
1115  z = pos.z();
1116  eta = pos.eta();
1117  phi = pos.phi();
1118 
1119  rechit_x_.push_back(x);
1120  rechit_y_.push_back(y);
1121  rechit_z_.push_back(z);
1122  rechit_det_.push_back(id.det());
1123  rechit_subdet_.push_back(id.subdetId());
1124  rechit_eta_.push_back(eta);
1125  rechit_phi_.push_back(phi);
1126  rechit_e_.push_back(pfrh.energy() * rh.fraction());
1127  rechit_idx_element_.push_back(idx_element);
1128  rechit_detid_.push_back(id.rawId());
1129  rechits_energy_all[id.rawId()] += pfrh.energy() * rh.fraction();
1130  } //rechit_fracs
1131  } else if (type == reco::PFBlockElement::SC) {
1132  const auto& clref = ((const reco::PFBlockElementSuperCluster*)&(elem.orig))->superClusterRef();
1133  assert(clref.isNonnull());
1134  const auto& cluster = *clref;
1135 
1136  //all rechits and the energy fractions in this cluster
1137  const auto& rechit_fracs = cluster.hitsAndFractions();
1138  for (const auto& rh : rechit_fracs) {
1139  if (detids.find(rh.first.rawId()) != detids.end()) {
1140  continue;
1141  }
1142  detids[rh.first.rawId()] += cluster.energy() * rh.second;
1143  const auto id = rh.first;
1144  float x = 0;
1145  float y = 0;
1146  float z = 0;
1147  float eta = 0;
1148  float phi = 0;
1149 
1150  const auto& pos = getHitPosition(id);
1151  x = pos.x();
1152  y = pos.y();
1153  z = pos.z();
1154  eta = pos.eta();
1155  phi = pos.phi();
1156 
1157  rechit_x_.push_back(x);
1158  rechit_y_.push_back(y);
1159  rechit_z_.push_back(z);
1160  rechit_det_.push_back(id.det());
1161  rechit_subdet_.push_back(id.subdetId());
1162  rechit_eta_.push_back(eta);
1163  rechit_phi_.push_back(phi);
1164  rechit_e_.push_back(rh.second);
1165  rechit_idx_element_.push_back(idx_element);
1166  rechit_detid_.push_back(id.rawId());
1167  rechits_energy_all[id.rawId()] += cluster.energy() * rh.second;
1168  } //rechit_fracs
1169  }
1170  detids_elements.push_back(detids);
1171  idx_element += 1;
1172  } //all_elements
1173 
1174  //associate elements (reco clusters) to simclusters
1175  int ielement = 0;
1176  for (const auto& detids : detids_elements) {
1177  int isimcluster = 0;
1178  if (!detids.empty()) {
1179  for (const auto& simcluster_detids : simcluster_detids_) {
1180  //get the energy of the simcluster hits that matches detids of the rechits
1181  double cmp = detid_compare(detids, simcluster_detids);
1182  if (cmp > 0) {
1183  simcluster_to_element.push_back(make_pair(isimcluster, ielement));
1184  simcluster_to_element_cmp.push_back((float)cmp);
1185  }
1186  isimcluster += 1;
1187  }
1188  } //element had rechits
1189  ielement += 1;
1190  } //rechit clusters
1191 }
vector< uint64_t > rechit_detid_
vector< float > rechit_subdet_
vector< float > rechit_e_
assert(be >=bs)
vector< float > rechit_det_
vector< float > rechit_y_
unsigned detId() const
rechit detId
Definition: PFRecHit.h:93
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
GlobalPoint getHitPosition(const DetId &id)
vector< float > rechit_phi_
Definition: DetId.h:17
double detid_compare(const map< uint64_t, double > &rechits, const map< uint64_t, double > &simhits)
float energy() const
rechit energy
Definition: PFRecHit.h:99
vector< std::map< uint64_t, double > > simcluster_detids_
vector< pair< int, int > > simcluster_to_element
vector< float > rechit_z_
vector< float > rechit_x_
vector< float > simcluster_to_element_cmp
vector< float > rechit_eta_
vector< int > rechit_idx_element_

◆ beginJob()

void PFAnalysis::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 1200 of file PFAnalysisNtuplizer.cc.

1200 { ; }

◆ beginRun()

void PFAnalysis::beginRun ( edm::Run const &  iEvent,
edm::EventSetup const &  es 
)
override

Definition at line 1193 of file PFAnalysisNtuplizer.cc.

References edm::EventSetup::getData().

1193  {
1194  hcons = &es.getData(hcalDDDrecToken_);
1195  aField_ = &es.getData(magFieldToken_);
1196 }
MagneticField const * aField_
const HcalDDDRecConstants * hcons
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > hcalDDDrecToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_

◆ clearVariables()

void PFAnalysis::clearVariables ( )
private

Definition at line 448 of file PFAnalysisNtuplizer.cc.

448  {
449  ev_run_ = 0;
450  ev_lumi_ = 0;
451  ev_event_ = 0;
452 
454  simcluster_to_element.clear();
456  element_to_candidate.clear();
457 
458  trackingparticle_eta_.clear();
459  trackingparticle_phi_.clear();
460  trackingparticle_pt_.clear();
461  trackingparticle_px_.clear();
462  trackingparticle_py_.clear();
463  trackingparticle_pz_.clear();
464  trackingparticle_energy_.clear();
465  trackingparticle_dvx_.clear();
466  trackingparticle_dvy_.clear();
467  trackingparticle_dvz_.clear();
468  trackingparticle_bx_.clear();
469  trackingparticle_ev_.clear();
470  trackingparticle_ovx_.clear();
471  trackingparticle_ovy_.clear();
472  trackingparticle_ovz_.clear();
473  trackingparticle_exx_.clear();
474  trackingparticle_exy_.clear();
475  trackingparticle_mother_.clear();
476  trackingparticle_pid_.clear();
477 
478  simcluster_eta_.clear();
479  simcluster_phi_.clear();
480  simcluster_pt_.clear();
481  simcluster_energy_.clear();
482  simcluster_pid_.clear();
483  simcluster_detids_.clear();
484  simcluster_bx_.clear();
485  simcluster_ev_.clear();
486  simcluster_px_.clear();
487  simcluster_py_.clear();
488  simcluster_pz_.clear();
490  simcluster_nhits_.clear();
491 
492  if (saveHits) {
493  simhit_frac_.clear();
494  simhit_x_.clear();
495  simhit_y_.clear();
496  simhit_z_.clear();
497  simhit_det_.clear();
498  simhit_subdet_.clear();
499  simhit_eta_.clear();
500  simhit_phi_.clear();
501  simhit_idx_simcluster_.clear();
502  simhit_detid_.clear();
503 
504  rechit_e_.clear();
505  rechit_x_.clear();
506  rechit_y_.clear();
507  rechit_z_.clear();
508  rechit_det_.clear();
509  rechit_subdet_.clear();
510  rechit_eta_.clear();
511  rechit_phi_.clear();
512  rechit_idx_element_.clear();
513  rechit_detid_.clear();
514  }
515 
516  simtrack_x_.clear();
517  simtrack_y_.clear();
518  simtrack_z_.clear();
519  simtrack_idx_simcluster_.clear();
520  simtrack_pid_.clear();
521 
522  gen_eta_.clear();
523  gen_phi_.clear();
524  gen_pt_.clear();
525  gen_px_.clear();
526  gen_py_.clear();
527  gen_pz_.clear();
528  gen_energy_.clear();
529  gen_charge_.clear();
530  gen_pdgid_.clear();
531  gen_status_.clear();
532  gen_daughters_.clear();
533 
534  element_pt_.clear();
535  element_px_.clear();
536  element_py_.clear();
537  element_pz_.clear();
538  element_deltap_.clear();
539  element_sigmadeltap_.clear();
540  element_eta_.clear();
541  element_phi_.clear();
542  element_energy_.clear();
543  element_corr_energy_.clear();
544  element_eta_ecal_.clear();
545  element_phi_ecal_.clear();
546  element_eta_hcal_.clear();
547  element_phi_hcal_.clear();
548  element_charge_.clear();
549  element_type_.clear();
550  element_layer_.clear();
551  element_depth_.clear();
552  element_trajpoint_.clear();
553  element_muon_dt_hits_.clear();
554  element_muon_csc_hits_.clear();
555  element_muon_type_.clear();
556  element_cluster_flags_.clear();
558  element_num_hits_.clear();
559 
560  element_distance_i_.clear();
561  element_distance_j_.clear();
562  element_distance_d_.clear();
563 
564  pfcandidate_eta_.clear();
565  pfcandidate_phi_.clear();
566  pfcandidate_pt_.clear();
567  pfcandidate_px_.clear();
568  pfcandidate_py_.clear();
569  pfcandidate_pz_.clear();
570  pfcandidate_energy_.clear();
571  pfcandidate_pdgid_.clear();
572 
573 } //clearVariables
vector< int > element_charge_
vector< uint64_t > rechit_detid_
vector< float > pfcandidate_pz_
vector< float > pfcandidate_px_
vector< float > gen_phi_
vector< int > simtrack_pid_
vector< int > element_distance_j_
vector< float > element_pz_
vector< int > simcluster_ev_
vector< float > element_phi_
vector< float > gen_energy_
vector< float > gen_py_
vector< float > element_corr_energy_
vector< int > simcluster_bx_
vector< float > simhit_phi_
vector< float > element_trajpoint_
vector< float > rechit_subdet_
vector< float > simcluster_px_
vector< float > element_gsf_electronseed_trkorecal_
vector< float > rechit_e_
vector< float > trackingparticle_phi_
vector< float > simcluster_eta_
vector< float > element_py_
vector< float > element_eta_
vector< int > gen_charge_
vector< int > simhit_idx_simcluster_
vector< int > simtrack_idx_simcluster_
vector< float > trackingparticle_eta_
vector< int > element_layer_
vector< float > gen_pz_
vector< float > rechit_det_
vector< float > element_sigmadeltap_
vector< float > simcluster_py_
vector< float > trackingparticle_ovz_
vector< float > rechit_y_
vector< int > trackingparticle_bx_
vector< float > element_pt_
vector< float > element_eta_ecal_
vector< float > simhit_z_
vector< int > trackingparticle_mother_
vector< float > trackingparticle_exy_
vector< float > simtrack_x_
vector< float > trackingparticle_pt_
vector< float > simhit_y_
vector< float > trackingparticle_dvx_
vector< float > gen_pt_
vector< float > element_depth_
vector< float > simcluster_energy_
vector< float > pfcandidate_phi_
vector< float > trackingparticle_ovy_
vector< vector< int > > gen_daughters_
vector< pair< int, int > > element_to_candidate
vector< float > pfcandidate_eta_
vector< float > trackingparticle_energy_
vector< float > gen_px_
vector< float > trackingparticle_py_
vector< float > simcluster_phi_
vector< float > pfcandidate_pt_
edm::RunNumber_t ev_run_
vector< float > pfcandidate_py_
vector< float > gen_eta_
vector< int > element_distance_i_
vector< float > trackingparticle_exx_
vector< float > element_muon_csc_hits_
vector< float > element_muon_type_
vector< float > rechit_phi_
vector< float > simhit_x_
vector< int > trackingparticle_pid_
vector< int > simcluster_pid_
vector< int > simhit_det_
vector< int > simhit_subdet_
vector< float > element_energy_
edm::EventNumber_t ev_event_
edm::LuminosityBlockNumber_t ev_lumi_
vector< float > element_px_
vector< float > element_deltap_
vector< int > gen_status_
vector< float > element_cluster_flags_
vector< int > gen_pdgid_
vector< float > element_phi_hcal_
vector< float > trackingparticle_dvz_
vector< int > trackingparticle_ev_
vector< int > element_type_
vector< std::map< uint64_t, double > > simcluster_detids_
vector< float > simhit_frac_
vector< pair< int, int > > simcluster_to_element
vector< float > rechit_z_
vector< float > simcluster_pt_
vector< float > simcluster_pz_
vector< float > simtrack_y_
vector< int > pfcandidate_pdgid_
vector< float > pfcandidate_energy_
vector< float > rechit_x_
vector< float > trackingparticle_dvy_
vector< float > trackingparticle_px_
vector< float > simhit_eta_
vector< float > element_muon_dt_hits_
vector< pair< int, int > > trackingparticle_to_element
vector< float > element_phi_ecal_
vector< float > trackingparticle_ovx_
vector< float > simtrack_z_
vector< float > simcluster_to_element_cmp
vector< float > rechit_eta_
vector< float > trackingparticle_pz_
vector< float > element_num_hits_
vector< int > simcluster_idx_trackingparticle_
vector< int > simcluster_nhits_
vector< int > rechit_idx_element_
vector< float > element_eta_hcal_
vector< uint64_t > simhit_detid_
vector< float > element_distance_d_

◆ endJob()

void PFAnalysis::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 1202 of file PFAnalysisNtuplizer.cc.

1202 {}

◆ endRun()

void PFAnalysis::endRun ( edm::Run const &  iEvent,
edm::EventSetup const &   
)
override

Definition at line 1198 of file PFAnalysisNtuplizer.cc.

1198 {}

◆ fillDescriptions()

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

Definition at line 1204 of file PFAnalysisNtuplizer.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

1204  {
1206  desc.setUnknown();
1207  descriptions.addDefault(desc);
1208 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ getHitPosition()

GlobalPoint PFAnalysis::getHitPosition ( const DetId id)
private

Definition at line 575 of file PFAnalysisNtuplizer.cc.

References DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, relativeConstraints::geom, CaloSubdetectorGeometry::getGeometry(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, CaloSubdetectorGeometry::present(), and runTheMatrix::ret.

575  {
577 
578  bool present = false;
579  if (((id.det() == DetId::Ecal &&
580  (id.subdetId() == EcalBarrel || id.subdetId() == EcalEndcap || id.subdetId() == EcalPreshower)) ||
581  (id.det() == DetId::Hcal && (id.subdetId() == HcalBarrel || id.subdetId() == HcalEndcap ||
582  id.subdetId() == HcalForward || id.subdetId() == HcalOuter)))) {
583  const CaloSubdetectorGeometry* geom_sd(geom->getSubdetectorGeometry(id.det(), id.subdetId()));
584  present = geom_sd->present(id);
585  if (present) {
586  const auto& cell = geom_sd->getGeometry(id);
587  ret = GlobalPoint(cell->getPosition());
588  }
589  }
590  return ret;
591 }
ret
prodAgent to be discontinued
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CaloGeometry * geom
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ processBlocks()

pair< vector< ElementWithIndex >, vector< tuple< int, int, float > > > PFAnalysis::processBlocks ( const std::vector< reco::PFBlock > &  pfBlocks)
private

Definition at line 1049 of file PFAnalysisNtuplizer.cc.

References groupFilesInBlocks::block, get_triu_vector_index(), and runTheMatrix::ret.

1050  {
1051  vector<ElementWithIndex> ret;
1052  vector<tuple<int, int, float>> distances;
1053 
1054  //Collect all the elements
1055  int iblock = 0;
1056  for (const auto& block : pfBlocks) {
1057  int ielem = 0;
1058  const auto& linkdata = block.linkData();
1059 
1060  //create a list of global element indices with distances
1061  for (const auto& link : linkdata) {
1062  const auto vecidx = link.first;
1063  const auto dist = link.second.distance;
1064  const auto& ij = get_triu_vector_index(vecidx, block.elements().size());
1065  auto globalindex_i = ij.first + ret.size();
1066  auto globalindex_j = ij.second + ret.size();
1067  distances.push_back(make_tuple(globalindex_i, globalindex_j, dist));
1068  }
1069 
1070  for (const auto& elem : block.elements()) {
1071  ElementWithIndex elem_index(elem, iblock, ielem);
1072  ret.push_back(elem_index);
1073  ielem += 1;
1074  } //elements
1075  iblock += 1;
1076  } //blocks
1077  return make_pair(ret, distances);
1078 
1079 } //processBlocks
ret
prodAgent to be discontinued
pair< int, int > get_triu_vector_index(int k, int n)

◆ processTrackingParticles()

void PFAnalysis::processTrackingParticles ( const edm::View< TrackingParticle > &  trackingParticles,
edm::Handle< edm::View< TrackingParticle >> &  trackingParticlesHandle 
)
private

Definition at line 1002 of file PFAnalysisNtuplizer.cc.

References cmsswSequenceInfo::tp, muonClassificationByHits_cfi::trackingParticles, and L1BJetProducer_cff::vtx.

1003  {
1004  for (unsigned long ntrackingparticle = 0; ntrackingparticle < trackingParticles.size(); ntrackingparticle++) {
1005  const auto& tp = trackingParticles.at(ntrackingparticle);
1006  edm::RefToBase<TrackingParticle> tpref(trackingParticlesHandle, ntrackingparticle);
1007 
1008  math::XYZTLorentzVectorD vtx(0, 0, 0, 0);
1009 
1010  if (!tp.decayVertices().empty()) {
1011  vtx = tp.decayVertices().at(0)->position();
1012  }
1013  auto orig_vtx = tp.vertex();
1014 
1015  // fill branches
1016  trackingparticle_eta_.push_back(tp.p4().eta());
1017  trackingparticle_phi_.push_back(tp.p4().phi());
1018  trackingparticle_pt_.push_back(tp.p4().pt());
1019  trackingparticle_px_.push_back(tp.p4().px());
1020  trackingparticle_py_.push_back(tp.p4().py());
1021  trackingparticle_pz_.push_back(tp.p4().pz());
1022  trackingparticle_energy_.push_back(tp.p4().energy());
1023  trackingparticle_dvx_.push_back(vtx.x());
1024  trackingparticle_dvy_.push_back(vtx.y());
1025  trackingparticle_dvz_.push_back(vtx.z());
1026  trackingparticle_bx_.push_back(tp.eventId().bunchCrossing());
1027  trackingparticle_ev_.push_back(tp.eventId().event());
1028 
1029  trackingparticle_ovx_.push_back(orig_vtx.x());
1030  trackingparticle_ovy_.push_back(orig_vtx.y());
1031  trackingparticle_ovz_.push_back(orig_vtx.z());
1032 
1033  trackingparticle_pid_.push_back(tp.pdgId());
1034  }
1035 }
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
vector< float > trackingparticle_phi_
vector< float > trackingparticle_eta_
vector< float > trackingparticle_ovz_
vector< int > trackingparticle_bx_
vector< float > trackingparticle_pt_
vector< float > trackingparticle_dvx_
vector< float > trackingparticle_ovy_
vector< float > trackingparticle_energy_
vector< float > trackingparticle_py_
vector< int > trackingparticle_pid_
vector< float > trackingparticle_dvz_
vector< int > trackingparticle_ev_
vector< float > trackingparticle_dvy_
vector< float > trackingparticle_px_
vector< float > trackingparticle_ovx_
vector< float > trackingparticle_pz_

Member Data Documentation

◆ aField_

MagneticField const* PFAnalysis::aField_
private

Definition at line 287 of file PFAnalysisNtuplizer.cc.

◆ caloParticles_

edm::EDGetTokenT<edm::View<CaloParticle> > PFAnalysis::caloParticles_
private

Definition at line 156 of file PFAnalysisNtuplizer.cc.

◆ element_charge_

vector<int> PFAnalysis::element_charge_
private

Definition at line 256 of file PFAnalysisNtuplizer.cc.

◆ element_cluster_flags_

vector<float> PFAnalysis::element_cluster_flags_
private

Definition at line 264 of file PFAnalysisNtuplizer.cc.

◆ element_corr_energy_

vector<float> PFAnalysis::element_corr_energy_
private

Definition at line 251 of file PFAnalysisNtuplizer.cc.

◆ element_deltap_

vector<float> PFAnalysis::element_deltap_
private

Definition at line 246 of file PFAnalysisNtuplizer.cc.

◆ element_depth_

vector<float> PFAnalysis::element_depth_
private

Definition at line 259 of file PFAnalysisNtuplizer.cc.

◆ element_distance_d_

vector<float> PFAnalysis::element_distance_d_
private

Definition at line 270 of file PFAnalysisNtuplizer.cc.

◆ element_distance_i_

vector<int> PFAnalysis::element_distance_i_
private

Definition at line 268 of file PFAnalysisNtuplizer.cc.

◆ element_distance_j_

vector<int> PFAnalysis::element_distance_j_
private

Definition at line 269 of file PFAnalysisNtuplizer.cc.

◆ element_energy_

vector<float> PFAnalysis::element_energy_
private

Definition at line 250 of file PFAnalysisNtuplizer.cc.

◆ element_eta_

vector<float> PFAnalysis::element_eta_
private

Definition at line 248 of file PFAnalysisNtuplizer.cc.

◆ element_eta_ecal_

vector<float> PFAnalysis::element_eta_ecal_
private

Definition at line 252 of file PFAnalysisNtuplizer.cc.

◆ element_eta_hcal_

vector<float> PFAnalysis::element_eta_hcal_
private

Definition at line 254 of file PFAnalysisNtuplizer.cc.

◆ element_gsf_electronseed_trkorecal_

vector<float> PFAnalysis::element_gsf_electronseed_trkorecal_
private

Definition at line 265 of file PFAnalysisNtuplizer.cc.

◆ element_layer_

vector<int> PFAnalysis::element_layer_
private

Definition at line 258 of file PFAnalysisNtuplizer.cc.

◆ element_muon_csc_hits_

vector<float> PFAnalysis::element_muon_csc_hits_
private

Definition at line 262 of file PFAnalysisNtuplizer.cc.

◆ element_muon_dt_hits_

vector<float> PFAnalysis::element_muon_dt_hits_
private

Definition at line 261 of file PFAnalysisNtuplizer.cc.

◆ element_muon_type_

vector<float> PFAnalysis::element_muon_type_
private

Definition at line 263 of file PFAnalysisNtuplizer.cc.

◆ element_num_hits_

vector<float> PFAnalysis::element_num_hits_
private

Definition at line 266 of file PFAnalysisNtuplizer.cc.

◆ element_phi_

vector<float> PFAnalysis::element_phi_
private

Definition at line 249 of file PFAnalysisNtuplizer.cc.

◆ element_phi_ecal_

vector<float> PFAnalysis::element_phi_ecal_
private

Definition at line 253 of file PFAnalysisNtuplizer.cc.

◆ element_phi_hcal_

vector<float> PFAnalysis::element_phi_hcal_
private

Definition at line 255 of file PFAnalysisNtuplizer.cc.

◆ element_pt_

vector<float> PFAnalysis::element_pt_
private

Definition at line 242 of file PFAnalysisNtuplizer.cc.

◆ element_px_

vector<float> PFAnalysis::element_px_
private

Definition at line 243 of file PFAnalysisNtuplizer.cc.

◆ element_py_

vector<float> PFAnalysis::element_py_
private

Definition at line 244 of file PFAnalysisNtuplizer.cc.

◆ element_pz_

vector<float> PFAnalysis::element_pz_
private

Definition at line 245 of file PFAnalysisNtuplizer.cc.

◆ element_sigmadeltap_

vector<float> PFAnalysis::element_sigmadeltap_
private

Definition at line 247 of file PFAnalysisNtuplizer.cc.

◆ element_to_candidate

vector<pair<int, int> > PFAnalysis::element_to_candidate
private

Definition at line 284 of file PFAnalysisNtuplizer.cc.

◆ element_trajpoint_

vector<float> PFAnalysis::element_trajpoint_
private

Definition at line 260 of file PFAnalysisNtuplizer.cc.

◆ element_type_

vector<int> PFAnalysis::element_type_
private

Definition at line 257 of file PFAnalysisNtuplizer.cc.

◆ ev_event_

edm::EventNumber_t PFAnalysis::ev_event_
private

Definition at line 166 of file PFAnalysisNtuplizer.cc.

◆ ev_lumi_

edm::LuminosityBlockNumber_t PFAnalysis::ev_lumi_
private

Definition at line 165 of file PFAnalysisNtuplizer.cc.

◆ ev_run_

edm::RunNumber_t PFAnalysis::ev_run_
private

Definition at line 164 of file PFAnalysisNtuplizer.cc.

◆ gen_charge_

vector<int> PFAnalysis::gen_charge_
private

Definition at line 237 of file PFAnalysisNtuplizer.cc.

◆ gen_daughters_

vector<vector<int> > PFAnalysis::gen_daughters_
private

Definition at line 240 of file PFAnalysisNtuplizer.cc.

◆ gen_energy_

vector<float> PFAnalysis::gen_energy_
private

Definition at line 236 of file PFAnalysisNtuplizer.cc.

◆ gen_eta_

vector<float> PFAnalysis::gen_eta_
private

Definition at line 230 of file PFAnalysisNtuplizer.cc.

◆ gen_pdgid_

vector<int> PFAnalysis::gen_pdgid_
private

Definition at line 238 of file PFAnalysisNtuplizer.cc.

◆ gen_phi_

vector<float> PFAnalysis::gen_phi_
private

Definition at line 231 of file PFAnalysisNtuplizer.cc.

◆ gen_pt_

vector<float> PFAnalysis::gen_pt_
private

Definition at line 232 of file PFAnalysisNtuplizer.cc.

◆ gen_px_

vector<float> PFAnalysis::gen_px_
private

Definition at line 233 of file PFAnalysisNtuplizer.cc.

◆ gen_py_

vector<float> PFAnalysis::gen_py_
private

Definition at line 234 of file PFAnalysisNtuplizer.cc.

◆ gen_pz_

vector<float> PFAnalysis::gen_pz_
private

Definition at line 235 of file PFAnalysisNtuplizer.cc.

◆ gen_status_

vector<int> PFAnalysis::gen_status_
private

Definition at line 239 of file PFAnalysisNtuplizer.cc.

◆ genParticles_

edm::EDGetTokenT<std::vector<reco::GenParticle> > PFAnalysis::genParticles_
private

Definition at line 154 of file PFAnalysisNtuplizer.cc.

◆ geom

CaloGeometry* PFAnalysis::geom
private

Definition at line 294 of file PFAnalysisNtuplizer.cc.

◆ geometryToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> PFAnalysis::geometryToken_
private

Definition at line 289 of file PFAnalysisNtuplizer.cc.

◆ hcal_topo

HcalTopology* PFAnalysis::hcal_topo
private

Definition at line 295 of file PFAnalysisNtuplizer.cc.

◆ hcalDDDrecToken_

edm::ESGetToken<HcalDDDRecConstants, HcalRecNumberingRecord> PFAnalysis::hcalDDDrecToken_
private

Definition at line 292 of file PFAnalysisNtuplizer.cc.

◆ hcons

const HcalDDDRecConstants* PFAnalysis::hcons
private

Definition at line 296 of file PFAnalysisNtuplizer.cc.

◆ magFieldToken_

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> PFAnalysis::magFieldToken_
private

Definition at line 291 of file PFAnalysisNtuplizer.cc.

◆ pfBlocks_

edm::EDGetTokenT<std::vector<reco::PFBlock> > PFAnalysis::pfBlocks_
private

Definition at line 158 of file PFAnalysisNtuplizer.cc.

◆ pfcandidate_energy_

vector<float> PFAnalysis::pfcandidate_energy_
private

Definition at line 278 of file PFAnalysisNtuplizer.cc.

◆ pfcandidate_eta_

vector<float> PFAnalysis::pfcandidate_eta_
private

Definition at line 272 of file PFAnalysisNtuplizer.cc.

◆ pfcandidate_pdgid_

vector<int> PFAnalysis::pfcandidate_pdgid_
private

Definition at line 279 of file PFAnalysisNtuplizer.cc.

◆ pfcandidate_phi_

vector<float> PFAnalysis::pfcandidate_phi_
private

Definition at line 273 of file PFAnalysisNtuplizer.cc.

◆ pfcandidate_pt_

vector<float> PFAnalysis::pfcandidate_pt_
private

Definition at line 274 of file PFAnalysisNtuplizer.cc.

◆ pfcandidate_px_

vector<float> PFAnalysis::pfcandidate_px_
private

Definition at line 275 of file PFAnalysisNtuplizer.cc.

◆ pfcandidate_py_

vector<float> PFAnalysis::pfcandidate_py_
private

Definition at line 276 of file PFAnalysisNtuplizer.cc.

◆ pfcandidate_pz_

vector<float> PFAnalysis::pfcandidate_pz_
private

Definition at line 277 of file PFAnalysisNtuplizer.cc.

◆ pfCandidates_

edm::EDGetTokenT<std::vector<reco::PFCandidate> > PFAnalysis::pfCandidates_
private

Definition at line 159 of file PFAnalysisNtuplizer.cc.

◆ rechit_det_

vector<float> PFAnalysis::rechit_det_
private

Definition at line 217 of file PFAnalysisNtuplizer.cc.

◆ rechit_detid_

vector<uint64_t> PFAnalysis::rechit_detid_
private

Definition at line 222 of file PFAnalysisNtuplizer.cc.

◆ rechit_e_

vector<float> PFAnalysis::rechit_e_
private

Definition at line 213 of file PFAnalysisNtuplizer.cc.

◆ rechit_eta_

vector<float> PFAnalysis::rechit_eta_
private

Definition at line 219 of file PFAnalysisNtuplizer.cc.

◆ rechit_idx_element_

vector<int> PFAnalysis::rechit_idx_element_
private

Definition at line 221 of file PFAnalysisNtuplizer.cc.

◆ rechit_phi_

vector<float> PFAnalysis::rechit_phi_
private

Definition at line 220 of file PFAnalysisNtuplizer.cc.

◆ rechit_subdet_

vector<float> PFAnalysis::rechit_subdet_
private

Definition at line 218 of file PFAnalysisNtuplizer.cc.

◆ rechit_x_

vector<float> PFAnalysis::rechit_x_
private

Definition at line 214 of file PFAnalysisNtuplizer.cc.

◆ rechit_y_

vector<float> PFAnalysis::rechit_y_
private

Definition at line 215 of file PFAnalysisNtuplizer.cc.

◆ rechit_z_

vector<float> PFAnalysis::rechit_z_
private

Definition at line 216 of file PFAnalysisNtuplizer.cc.

◆ saveHits

bool PFAnalysis::saveHits
private

Definition at line 298 of file PFAnalysisNtuplizer.cc.

◆ simcluster_bx_

vector<int> PFAnalysis::simcluster_bx_
private

Definition at line 195 of file PFAnalysisNtuplizer.cc.

◆ simcluster_detids_

vector<std::map<uint64_t, double> > PFAnalysis::simcluster_detids_
private

Definition at line 200 of file PFAnalysisNtuplizer.cc.

◆ simcluster_energy_

vector<float> PFAnalysis::simcluster_energy_
private

Definition at line 191 of file PFAnalysisNtuplizer.cc.

◆ simcluster_eta_

vector<float> PFAnalysis::simcluster_eta_
private

Definition at line 188 of file PFAnalysisNtuplizer.cc.

◆ simcluster_ev_

vector<int> PFAnalysis::simcluster_ev_
private

Definition at line 196 of file PFAnalysisNtuplizer.cc.

◆ simcluster_idx_trackingparticle_

vector<int> PFAnalysis::simcluster_idx_trackingparticle_
private

Definition at line 198 of file PFAnalysisNtuplizer.cc.

◆ simcluster_nhits_

vector<int> PFAnalysis::simcluster_nhits_
private

Definition at line 199 of file PFAnalysisNtuplizer.cc.

◆ simcluster_phi_

vector<float> PFAnalysis::simcluster_phi_
private

Definition at line 189 of file PFAnalysisNtuplizer.cc.

◆ simcluster_pid_

vector<int> PFAnalysis::simcluster_pid_
private

Definition at line 197 of file PFAnalysisNtuplizer.cc.

◆ simcluster_pt_

vector<float> PFAnalysis::simcluster_pt_
private

Definition at line 190 of file PFAnalysisNtuplizer.cc.

◆ simcluster_px_

vector<float> PFAnalysis::simcluster_px_
private

Definition at line 192 of file PFAnalysisNtuplizer.cc.

◆ simcluster_py_

vector<float> PFAnalysis::simcluster_py_
private

Definition at line 193 of file PFAnalysisNtuplizer.cc.

◆ simcluster_pz_

vector<float> PFAnalysis::simcluster_pz_
private

Definition at line 194 of file PFAnalysisNtuplizer.cc.

◆ simcluster_to_element

vector<pair<int, int> > PFAnalysis::simcluster_to_element
private

Definition at line 282 of file PFAnalysisNtuplizer.cc.

◆ simcluster_to_element_cmp

vector<float> PFAnalysis::simcluster_to_element_cmp
private

Definition at line 283 of file PFAnalysisNtuplizer.cc.

◆ simhit_det_

vector<int> PFAnalysis::simhit_det_
private

Definition at line 208 of file PFAnalysisNtuplizer.cc.

◆ simhit_detid_

vector<uint64_t> PFAnalysis::simhit_detid_
private

Definition at line 211 of file PFAnalysisNtuplizer.cc.

◆ simhit_eta_

vector<float> PFAnalysis::simhit_eta_
private

Definition at line 206 of file PFAnalysisNtuplizer.cc.

◆ simhit_frac_

vector<float> PFAnalysis::simhit_frac_
private

Definition at line 202 of file PFAnalysisNtuplizer.cc.

◆ simhit_idx_simcluster_

vector<int> PFAnalysis::simhit_idx_simcluster_
private

Definition at line 210 of file PFAnalysisNtuplizer.cc.

◆ simhit_phi_

vector<float> PFAnalysis::simhit_phi_
private

Definition at line 207 of file PFAnalysisNtuplizer.cc.

◆ simhit_subdet_

vector<int> PFAnalysis::simhit_subdet_
private

Definition at line 209 of file PFAnalysisNtuplizer.cc.

◆ simhit_x_

vector<float> PFAnalysis::simhit_x_
private

Definition at line 203 of file PFAnalysisNtuplizer.cc.

◆ simhit_y_

vector<float> PFAnalysis::simhit_y_
private

Definition at line 204 of file PFAnalysisNtuplizer.cc.

◆ simhit_z_

vector<float> PFAnalysis::simhit_z_
private

Definition at line 205 of file PFAnalysisNtuplizer.cc.

◆ simtrack_idx_simcluster_

vector<int> PFAnalysis::simtrack_idx_simcluster_
private

Definition at line 227 of file PFAnalysisNtuplizer.cc.

◆ simtrack_pid_

vector<int> PFAnalysis::simtrack_pid_
private

Definition at line 228 of file PFAnalysisNtuplizer.cc.

◆ simtrack_x_

vector<float> PFAnalysis::simtrack_x_
private

Definition at line 224 of file PFAnalysisNtuplizer.cc.

◆ simtrack_y_

vector<float> PFAnalysis::simtrack_y_
private

Definition at line 225 of file PFAnalysisNtuplizer.cc.

◆ simtrack_z_

vector<float> PFAnalysis::simtrack_z_
private

Definition at line 226 of file PFAnalysisNtuplizer.cc.

◆ t_

TTree* PFAnalysis::t_
private

Definition at line 162 of file PFAnalysisNtuplizer.cc.

◆ topologyToken_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> PFAnalysis::topologyToken_
private

Definition at line 290 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_bx_

vector<int> PFAnalysis::trackingparticle_bx_
private

Definition at line 178 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_dvx_

vector<float> PFAnalysis::trackingparticle_dvx_
private

Definition at line 175 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_dvy_

vector<float> PFAnalysis::trackingparticle_dvy_
private

Definition at line 176 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_dvz_

vector<float> PFAnalysis::trackingparticle_dvz_
private

Definition at line 177 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_energy_

vector<float> PFAnalysis::trackingparticle_energy_
private

Definition at line 174 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_eta_

vector<float> PFAnalysis::trackingparticle_eta_
private

Definition at line 168 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_ev_

vector<int> PFAnalysis::trackingparticle_ev_
private

Definition at line 179 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_exx_

vector<float> PFAnalysis::trackingparticle_exx_
private

Definition at line 183 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_exy_

vector<float> PFAnalysis::trackingparticle_exy_
private

Definition at line 184 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_mother_

vector<int> PFAnalysis::trackingparticle_mother_
private

Definition at line 185 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_ovx_

vector<float> PFAnalysis::trackingparticle_ovx_
private

Definition at line 180 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_ovy_

vector<float> PFAnalysis::trackingparticle_ovy_
private

Definition at line 181 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_ovz_

vector<float> PFAnalysis::trackingparticle_ovz_
private

Definition at line 182 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_phi_

vector<float> PFAnalysis::trackingparticle_phi_
private

Definition at line 169 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_pid_

vector<int> PFAnalysis::trackingparticle_pid_
private

Definition at line 186 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_pt_

vector<float> PFAnalysis::trackingparticle_pt_
private

Definition at line 170 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_px_

vector<float> PFAnalysis::trackingparticle_px_
private

Definition at line 171 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_py_

vector<float> PFAnalysis::trackingparticle_py_
private

Definition at line 172 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_pz_

vector<float> PFAnalysis::trackingparticle_pz_
private

Definition at line 173 of file PFAnalysisNtuplizer.cc.

◆ trackingparticle_to_element

vector<pair<int, int> > PFAnalysis::trackingparticle_to_element
private

Definition at line 281 of file PFAnalysisNtuplizer.cc.

◆ trackingParticles_

edm::EDGetTokenT<edm::View<TrackingParticle> > PFAnalysis::trackingParticles_
private

Definition at line 155 of file PFAnalysisNtuplizer.cc.

◆ tracks_

edm::EDGetTokenT<edm::View<reco::Track> > PFAnalysis::tracks_
private

Definition at line 157 of file PFAnalysisNtuplizer.cc.

◆ tracks_recotosim_

edm::EDGetTokenT<reco::RecoToSimCollection> PFAnalysis::tracks_recotosim_
private

Definition at line 160 of file PFAnalysisNtuplizer.cc.