CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EvtPlaneProducer Class Reference

#include <RecoHI/EvtPlaneProducer/src/EvtPlaneProducer.cc>

Inheritance diagram for EvtPlaneProducer:
edm::stream::EDProducer<>

Public Member Functions

 EvtPlaneProducer (const edm::ParameterSet &)
 
 ~EvtPlaneProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void fillCastor (const TrackStructure &track, double vz, int bin)
 
void fillHF (const TrackStructure &track, double vz, int bin)
 
void fillTracker (const TrackStructure &track, double vz, int bin)
 
bool passEta (float eta, int i)
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

bool bScalo_particleFlow_
 
bool bStrack_packedPFCandidates_
 
double caloCentRef_
 
double caloCentRefWidth_
 
edm::Handle< CaloTowerCollectioncaloCollection_
 
edm::InputTag caloTag_
 
edm::EDGetTokenT< CaloTowerCollectioncaloToken_
 
edm::EDGetTokenT< reco::PFCandidateCollectioncaloTokenPF_
 
edm::Handle< std::vector< reco::CastorTower > > castorCollection_
 
edm::InputTag castorTag_
 
edm::EDGetTokenT< std::vector< reco::CastorTower > > castorToken_
 
int CentBinCompression_
 
edm::InputTag centralityBinTag_
 
edm::EDGetTokenT< int > centralityBinToken_
 
std::string centralityMC_
 
edm::ESGetToken< CentralityTable, HeavyIonRcdcentralityToken_
 
std::string centralityVariable_
 
double chi2_
 
edm::InputTag chi2MapLostTag_
 
edm::EDGetTokenT< edm::ValueMap< float > > chi2MapLostToken_
 
edm::InputTag chi2MapTag_
 
edm::EDGetTokenT< edm::ValueMap< float > > chi2MapToken_
 
double chi2perlayer_
 
int cutEra_
 
EPCuts cuts_
 
double d0d0error_
 
double dzdzerror_
 
double dzdzerror_pix_
 
double dzerr_
 
HiEvtPlaneFlattenflat [NumEPNames]
 
double flatdelvtx_
 
double flatminvtx_
 
int flatnvtxbins_
 
int FlatOrder_
 
edm::ESGetToken< RPFlatParams, HeavyIonRPRcdflatparmsToken_
 
edm::ESWatcher< HeavyIonRPRcdhirpWatcher_
 
edm::ESWatcher< HeavyIonRcdhiWatcher_
 
bool loadDB_
 
edm::EDGetTokenT< pat::PackedCandidateCollectionlostToken_
 
edm::InputTag losttrackTag_
 
double maxet_
 
double maxpt_
 
double minet_
 
double minpt_
 
double nCentBins_
 
int nhitsValid_
 
int NumFlatBins_
 
edm::EDGetTokenT< pat::PackedCandidateCollectionpackedToken_
 
double pterror_
 
GenPlanerp [NumEPNames]
 
TrackStructure track_
 
edm::Handle< reco::TrackCollectiontrackCollection_
 
edm::InputTag trackTag_
 
edm::EDGetTokenT< reco::TrackCollectiontrackToken_
 
edm::Handle< std::vector< reco::Vertex > > vertex_
 
edm::InputTag vertexTag_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > vertexToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 167 of file EvtPlaneProducer.cc.

Constructor & Destructor Documentation

◆ EvtPlaneProducer()

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

Definition at line 345 of file EvtPlaneProducer.cc.

References bScalo_particleFlow_, bStrack_packedPFCandidates_, caloTag_, caloToken_, caloTokenPF_, castorTag_, castorToken_, centralityBinTag_, centralityBinToken_, centralityMC_, centralityToken_, centralityVariable_, chi2_, chi2MapLostTag_, chi2MapLostToken_, chi2MapTag_, chi2MapToken_, chi2perlayer_, edm::errors::Configuration, cutEra_, cuts_, d0d0error_, dzdzerror_, dzdzerror_pix_, hi::EPEtaMax1, hi::EPEtaMax2, hi::EPEtaMin1, hi::EPEtaMin2, hi::EPNames, hi::EPOrder, deDxTools::esConsumes(), Exception, edm::ParameterSet::exists(), flat, flatdelvtx_, flatminvtx_, flatnvtxbins_, FlatOrder_, flatparmsToken_, edm::ParameterSet::getParameter(), mps_fire::i, HiEvtPlaneFlatten::init(), edm::InputTag::label(), loadDB_, lostToken_, losttrackTag_, nCentBins_, nhitsValid_, hi::NumEPNames, NumFlatBins_, packedToken_, pterror_, rp, AlCaHLTBitMon_QueryRunRegistry::string, trackTag_, trackToken_, vertexTag_, and vertexToken_.

346  : centralityVariable_(iConfig.getParameter<std::string>("centralityVariable")),
347  centralityBinTag_(iConfig.getParameter<edm::InputTag>("centralityBinTag")),
348  vertexTag_(iConfig.getParameter<edm::InputTag>("vertexTag")),
349  caloTag_(iConfig.getParameter<edm::InputTag>("caloTag")),
350  castorTag_(iConfig.getParameter<edm::InputTag>("castorTag")),
351  trackTag_(iConfig.getParameter<edm::InputTag>("trackTag")),
352  losttrackTag_(iConfig.getParameter<edm::InputTag>("lostTag")),
353  chi2MapTag_(iConfig.getParameter<edm::InputTag>("chi2MapTag")),
354  chi2MapLostTag_(iConfig.getParameter<edm::InputTag>("chi2MapLostTag")),
355  loadDB_(iConfig.getParameter<bool>("loadDB")),
356  minet_(iConfig.getParameter<double>("minet")),
357  maxet_(iConfig.getParameter<double>("maxet")),
358  minpt_(iConfig.getParameter<double>("minpt")),
359  maxpt_(iConfig.getParameter<double>("maxpt")),
360  flatnvtxbins_(iConfig.getParameter<int>("flatnvtxbins")),
361  flatminvtx_(iConfig.getParameter<double>("flatminvtx")),
362  flatdelvtx_(iConfig.getParameter<double>("flatdelvtx")),
363  dzdzerror_(iConfig.getParameter<double>("dzdzerror")),
364  d0d0error_(iConfig.getParameter<double>("d0d0error")),
365  pterror_(iConfig.getParameter<double>("pterror")),
366  chi2perlayer_(iConfig.getParameter<double>("chi2perlayer")),
367  dzdzerror_pix_(iConfig.getParameter<double>("dzdzerror_pix")),
368  chi2_(iConfig.getParameter<double>("chi2")),
369  nhitsValid_(iConfig.getParameter<int>("nhitsValid")),
370  FlatOrder_(iConfig.getParameter<int>("FlatOrder")),
371  NumFlatBins_(iConfig.getParameter<int>("NumFlatBins")),
372  caloCentRef_(iConfig.getParameter<double>("caloCentRef")),
373  caloCentRefWidth_(iConfig.getParameter<double>("caloCentRefWidth")),
374  CentBinCompression_(iConfig.getParameter<int>("CentBinCompression")),
375  cutEra_(iConfig.getParameter<int>("cutEra"))
376 
377 {
378  if (cutEra_ > 3)
379  throw edm::Exception(edm::errors::Configuration) << "wrong range in cutEra parameter";
380  cuts_ = EPCuts(
382  nCentBins_ = 200.;
383 
384  if (iConfig.exists("nonDefaultGlauberModel")) {
385  centralityMC_ = iConfig.getParameter<std::string>("nonDefaultGlauberModel");
386  }
388  if (loadDB_) {
390  }
391 
392  centralityBinToken_ = consumes<int>(centralityBinTag_);
393 
394  vertexToken_ = consumes<std::vector<reco::Vertex>>(vertexTag_);
395 
396  bStrack_packedPFCandidates_ = (trackTag_.label().find("packedPFCandidates") != std::string::npos);
397  bScalo_particleFlow_ = (caloTag_.label().find("particleFlow") != std::string::npos);
399  packedToken_ = consumes<pat::PackedCandidateCollection>(trackTag_);
400  lostToken_ = consumes<pat::PackedCandidateCollection>(losttrackTag_);
401  chi2MapToken_ = consumes<edm::ValueMap<float>>(chi2MapTag_);
402  chi2MapLostToken_ = consumes<edm::ValueMap<float>>(chi2MapLostTag_);
403 
404  } else {
405  if (bScalo_particleFlow_) {
406  caloTokenPF_ = consumes<reco::PFCandidateCollection>(caloTag_);
407  } else {
408  caloToken_ = consumes<CaloTowerCollection>(caloTag_);
409  }
410  castorToken_ = consumes<std::vector<reco::CastorTower>>(castorTag_);
411  trackToken_ = consumes<reco::TrackCollection>(trackTag_);
412  }
413 
414  produces<reco::EvtPlaneCollection>();
415  for (int i = 0; i < NumEPNames; i++) {
417  }
418  for (int i = 0; i < NumEPNames; i++) {
419  flat[i] = new HiEvtPlaneFlatten();
421  }
422 }
edm::InputTag centralityBinTag_
edm::EDGetTokenT< reco::TrackCollection > trackToken_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::InputTag caloTag_
std::string centralityMC_
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::ESGetToken< CentralityTable, HeavyIonRcd > centralityToken_
const std::array< double, NumEPNames > EPEtaMin2
std::string const & label() const
Definition: InputTag.h:36
const std::array< double, NumEPNames > EPEtaMax1
edm::EDGetTokenT< pat::PackedCandidateCollection > packedToken_
edm::EDGetTokenT< pat::PackedCandidateCollection > lostToken_
GenPlane * rp[NumEPNames]
edm::EDGetTokenT< std::vector< reco::Vertex > > vertexToken_
HiEvtPlaneFlatten * flat[NumEPNames]
edm::EDGetTokenT< int > centralityBinToken_
edm::InputTag vertexTag_
edm::InputTag chi2MapLostTag_
edm::ESGetToken< RPFlatParams, HeavyIonRPRcd > flatparmsToken_
edm::InputTag chi2MapTag_
const std::array< double, NumEPNames > EPEtaMin1
void init(int order, int nbins, int nvtxbins=10, double minvtx=-25, double delvtx=5, std::string tag="", int vord=2)
std::string centralityVariable_
const std::array< double, NumEPNames > EPEtaMax2
edm::EDGetTokenT< reco::PFCandidateCollection > caloTokenPF_
const std::array< int, NumEPNames > EPOrder
const std::array< std::string, NumEPNames > EPNames
edm::EDGetTokenT< edm::ValueMap< float > > chi2MapLostToken_
edm::EDGetTokenT< CaloTowerCollection > caloToken_
static const int NumEPNames
edm::EDGetTokenT< std::vector< reco::CastorTower > > castorToken_
edm::InputTag castorTag_
edm::EDGetTokenT< edm::ValueMap< float > > chi2MapToken_
edm::InputTag trackTag_
edm::InputTag losttrackTag_

◆ ~EvtPlaneProducer()

EvtPlaneProducer::~EvtPlaneProducer ( )
override

Definition at line 424 of file EvtPlaneProducer.cc.

References flat, mps_fire::i, and hi::NumEPNames.

424  {
425  // do anything here that needs to be done at desctruction time
426  // (e.g. close files, deallocate resources etc.)
427  for (int i = 0; i < NumEPNames; i++) {
428  delete flat[i];
429  }
430 }
HiEvtPlaneFlatten * flat[NumEPNames]
static const int NumEPNames

Member Function Documentation

◆ fillCastor()

void EvtPlaneProducer::fillCastor ( const TrackStructure track,
double  vz,
int  bin 
)
inlineprivate

Definition at line 273 of file EvtPlaneProducer.cc.

References hi::GenPlane::addParticle(), newFWLiteAna::bin, funct::cos(), hi::EPDet, hi::EPOrder, HiEvtPlaneFlatten::getW(), mps_fire::i, HiEvtPlane_cfi::maxet, hi::maxTransverse, HiEvtPlane_cfi::minet, hi::minTransverse, hi::MomConsWeight, hi::NumEPNames, funct::sin(), HLT_2024v14_cff::track, btvMC_cff::vz, and w().

Referenced by produce().

273  {
274  double minet = minet_;
275  double maxet = maxet_;
276  for (int i = 0; i < NumEPNames; i++) {
277  if (EPDet[i] == Castor) {
278  if (minet_ < 0)
279  minet = minTransverse[i];
280  if (maxet_ < 0)
281  maxet = maxTransverse[i];
282  if (track.et < minet)
283  continue;
284  if (track.et > maxet)
285  continue;
286  if (not passEta(track.eta, i))
287  continue;
288  double w = track.et;
289  if (EPOrder[i] == 1) {
290  if (MomConsWeight[i][0] == 'y' && loadDB_) {
291  w = flat[i]->getW(track.et, vz, bin);
292  }
293  }
294  rp[i]->addParticle(w, track.et, sin(EPOrder[i] * track.phi), cos(EPOrder[i] * track.phi), track.eta);
295  }
296  }
297  }
T w() const
const std::array< std::string, NumEPNames > MomConsWeight
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool passEta(float eta, int i)
double getW(double pt, double vtx, int centbin) const
const std::array< double, NumEPNames > maxTransverse
GenPlane * rp[NumEPNames]
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
HiEvtPlaneFlatten * flat[NumEPNames]
void addParticle(double w, double PtOrEt, double s, double c, double eta)
const std::array< int, NumEPNames > EPDet
const std::array< double, NumEPNames > minTransverse
const std::array< int, NumEPNames > EPOrder
static const int NumEPNames

◆ fillHF()

void EvtPlaneProducer::fillHF ( const TrackStructure track,
double  vz,
int  bin 
)
inlineprivate

Definition at line 245 of file EvtPlaneProducer.cc.

References hi::GenPlane::addParticle(), newFWLiteAna::bin, funct::cos(), hi::EPDet, hi::EPOrder, HiEvtPlaneFlatten::etScale(), HiEvtPlaneFlatten::getW(), tpScales_cff::HF, mps_fire::i, HiEvtPlane_cfi::maxet, hi::maxTransverse, HiEvtPlane_cfi::minet, hi::minTransverse, hi::MomConsWeight, hi::NumEPNames, funct::sin(), HLT_2024v14_cff::track, btvMC_cff::vz, and w().

Referenced by produce().

245  {
246  double minet = minet_;
247  double maxet = maxet_;
248  for (int i = 0; i < NumEPNames; i++) {
249  if (EPDet[i] != HF)
250  continue;
251  if (minet_ < 0)
252  minet = minTransverse[i];
253  if (maxet_ < 0)
254  maxet = maxTransverse[i];
255  if (track.et < minet)
256  continue;
257  if (track.et > maxet)
258  continue;
259  if (not passEta(track.eta, i))
260  continue;
261  double w = track.et;
262  if (loadDB_)
263  w = track.et * flat[i]->etScale(vz, bin);
264  if (EPOrder[i] == 1) {
265  if (MomConsWeight[i][0] == 'y' && loadDB_) {
266  w = flat[i]->getW(track.et, vz, bin);
267  }
268  }
269  rp[i]->addParticle(w, track.et, sin(EPOrder[i] * track.phi), cos(EPOrder[i] * track.phi), track.eta);
270  }
271  };
T w() const
const std::array< std::string, NumEPNames > MomConsWeight
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool passEta(float eta, int i)
double getW(double pt, double vtx, int centbin) const
const std::array< double, NumEPNames > maxTransverse
GenPlane * rp[NumEPNames]
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
HiEvtPlaneFlatten * flat[NumEPNames]
void addParticle(double w, double PtOrEt, double s, double c, double eta)
const std::array< int, NumEPNames > EPDet
const std::array< double, NumEPNames > minTransverse
double etScale(double vtx, int centbin) const
const std::array< int, NumEPNames > EPOrder
static const int NumEPNames

◆ fillTracker()

void EvtPlaneProducer::fillTracker ( const TrackStructure track,
double  vz,
int  bin 
)
inlineprivate

Definition at line 316 of file EvtPlaneProducer.cc.

References hi::GenPlane::addParticle(), newFWLiteAna::bin, funct::cos(), hi::EPDet, hi::EPOrder, HiEvtPlaneFlatten::getW(), mps_fire::i, HiEvtPlane_cfi::maxpt, hi::maxTransverse, HiEvtPlane_cfi::minpt, hi::minTransverse, hi::MomConsWeight, hi::NumEPNames, funct::sin(), HLT_2024v14_cff::track, align::Tracker, btvMC_cff::vz, and w().

Referenced by produce().

316  {
317  double minpt = minpt_;
318  double maxpt = maxpt_;
319  for (int i = 0; i < NumEPNames; i++) {
320  if (EPDet[i] == Tracker) {
321  if (minpt_ < 0)
322  minpt = minTransverse[i];
323  if (maxpt_ < 0)
324  maxpt = maxTransverse[i];
325  if (track.pt < minpt)
326  continue;
327  if (track.pt > maxpt)
328  continue;
329  if (not passEta(track.eta, i))
330  continue;
331  double w = track.pt;
332  if (w > 2.5)
333  w = 2.0; //v2 starts decreasing above ~2.5 GeV/c
334  if (EPOrder[i] == 1) {
335  if (MomConsWeight[i][0] == 'y' && loadDB_) {
336  w = flat[i]->getW(track.pt, vz, bin);
337  }
338  }
339  rp[i]->addParticle(w, track.pt, sin(EPOrder[i] * track.phi), cos(EPOrder[i] * track.phi), track.eta);
340  }
341  }
342  };
T w() const
const std::array< std::string, NumEPNames > MomConsWeight
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool passEta(float eta, int i)
double getW(double pt, double vtx, int centbin) const
const std::array< double, NumEPNames > maxTransverse
GenPlane * rp[NumEPNames]
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
HiEvtPlaneFlatten * flat[NumEPNames]
void addParticle(double w, double PtOrEt, double s, double c, double eta)
const std::array< int, NumEPNames > EPDet
const std::array< double, NumEPNames > minTransverse
const std::array< int, NumEPNames > EPOrder
static const int NumEPNames

◆ passEta()

bool EvtPlaneProducer::passEta ( float  eta,
int  i 
)
inlineprivate

Definition at line 299 of file EvtPlaneProducer.cc.

References hi::EPEtaMax1, hi::EPEtaMax2, hi::EPEtaMin1, hi::EPEtaMin2, PVValHelper::eta, and mps_fire::i.

299  {
300  if (EPEtaMin2[i] == EPEtaMax2[i]) {
301  if (eta < EPEtaMin1[i])
302  return false;
303  if (eta > EPEtaMax1[i])
304  return false;
305  } else {
306  if (eta < EPEtaMin1[i])
307  return false;
308  if (eta > EPEtaMax2[i])
309  return false;
310  if (eta > EPEtaMax1[i] && eta < EPEtaMin2[i])
311  return false;
312  }
313  return true;
314  }
const std::array< double, NumEPNames > EPEtaMin2
const std::array< double, NumEPNames > EPEtaMax1
const std::array< double, NumEPNames > EPEtaMin1
const std::array< double, NumEPNames > EPEtaMax2

◆ produce()

void EvtPlaneProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 437 of file EvtPlaneProducer.cc.

References funct::abs(), reco::TrackBase::algo(), hi::TrackStructure::algos, newFWLiteAna::bin, bScalo_particleFlow_, bStrack_packedPFCandidates_, caloCentRef_, caloCentRefWidth_, caloCollection_, caloToken_, caloTokenPF_, HLT_2024v14_cff::cands, castorCollection_, castorToken_, hi::TrackStructure::centbin, CentBinCompression_, centralityBinToken_, centralityToken_, hi::TrackStructure::charge, reco::TrackBase::charge(), edm::ESWatcher< T >::check(), hi::TrackStructure::chi2layer, chi2MapLostToken_, chi2MapToken_, hi::TrackStructure::collection, cuts_, cuy::cv, dqmiodatasetharvest::db, hi::TrackStructure::dxy, reco::TrackBase::dxy(), hi::TrackStructure::dxyError, reco::TrackBase::dxyError(), hi::TrackStructure::dxySig, hi::TrackStructure::dz, reco::TrackBase::dz(), hi::TrackStructure::dzError, reco::TrackBase::dzError(), hi::TrackStructure::dzSig, hi::EPDet, hi::TrackStructure::et, hi::TrackStructure::eta, reco::TrackBase::eta(), fillCastor(), fillHF(), fillTracker(), flat, flatparmsToken_, hi::GenPlane::getAngle(), edm::EventSetup::getData(), tpScales_cff::HF, hi::TrackStructure::highPurity, reco::TrackBase::highPurity, hirpWatcher_, reco::TrackBase::hitPattern(), hiWatcher_, Matriplex::hypot(), mps_fire::i, heavyIonCSV_trainingSettings::idx, iEvent, hi::EPCuts::isGoodCastor(), hi::EPCuts::isGoodHF(), hi::EPCuts::isGoodTrack(), loadDB_, lostToken_, eostools::move(), dqmiodumpmetadata::n, nCentBins_, hi::TrackStructure::normalizedChi2, hi::TrackStructure::numberOfValidHits, reco::TrackBase::numberOfValidHits(), hi::NumEPNames, packedToken_, hi::TrackStructure::pdgid, packedPFCandidateRefMixer_cfi::pf, hi::TrackStructure::phi, reco::TrackBase::phi(), hi::TrackStructure::pt, reco::TrackBase::pt(), hi::TrackStructure::ptError, reco::TrackBase::ptError(), reset(), rp, HiEvtPlaneFlatten::setCaloCentRefBins(), pfDeepBoostedJetPreprocessParams_cfi::sv, l1tHGCalTowerProducer_cfi::tower, track_, trackCollection_, reco::HitPattern::trackerLayersWithMeasurement(), trackToken_, parallelization::uint, vertexToken_, L1BJetProducer_cff::vtx, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::wv.

437  {
438  using namespace edm;
439  using namespace std;
440  using namespace reco;
441  if (hiWatcher_.check(iSetup)) {
442  //
443  //Get Size of Centrality Table
444  //
445  auto const &centDB = iSetup.getData(centralityToken_);
446  nCentBins_ = centDB.m_table.size();
447  for (int i = 0; i < NumEPNames; i++) {
448  if (caloCentRef_ > 0) {
449  int minbin = (caloCentRef_ - caloCentRefWidth_ / 2.) * nCentBins_ / 100.;
450  int maxbin = (caloCentRef_ + caloCentRefWidth_ / 2.) * nCentBins_ / 100.;
451  minbin /= CentBinCompression_;
452  maxbin /= CentBinCompression_;
453  if (minbin > 0 && maxbin >= minbin) {
454  if (EPDet[i] == HF || EPDet[i] == Castor)
455  flat[i]->setCaloCentRefBins(minbin, maxbin);
456  }
457  }
458  }
459  }
460  //
461  //Get flattening parameter file.
462  //
463  if (loadDB_ && hirpWatcher_.check(iSetup)) {
465  if (!db.IsSuccess()) {
466  loadDB_ = kFALSE;
467  }
468  }
469  //
470  //Get Centrality
471  //
472  int bin = 0;
473  int cbin = 0;
474  if (loadDB_) {
475  cbin = iEvent.get(centralityBinToken_);
476  bin = cbin / CentBinCompression_;
477  }
478  //
479  //Get Vertex
480  //
481  //best vertex
482  const reco::Vertex &vtx = iEvent.get(vertexToken_)[0];
483  double bestvz = vtx.z();
484  double bestvx = vtx.x();
485  double bestvy = vtx.y();
486  double bestvzError = vtx.zError();
487  math::XYZPoint bestvtx(bestvx, bestvy, bestvz);
488  math::Error<3>::type vtx_cov = vtx.covariance();
489 
490  for (int i = 0; i < NumEPNames; i++)
491  rp[i]->reset();
496  for (int idx = 1; idx < 3; idx++) {
497  if (idx == 1) {
498  iEvent.getByToken(packedToken_, cands);
499  iEvent.getByToken(chi2MapToken_, chi2Map);
500  }
501  if (idx == 2) {
502  iEvent.getByToken(lostToken_, cands);
503  iEvent.getByToken(chi2MapLostToken_, chi2Map);
504  }
505  for (unsigned int i = 0, n = cands->size(); i < n; ++i) {
506  track_ = {};
507  track_.centbin = cbin;
508  const pat::PackedCandidate &pf = (*cands)[i];
509  track_.et = pf.et();
510  track_.eta = pf.eta();
511  track_.phi = pf.phi();
512  track_.pdgid = pf.pdgId();
513  if ((idx == 1) and cuts_.isGoodHF(track_)) {
514  fillHF(track_, bestvz, bin);
515  }
516  if (!pf.hasTrackDetails())
517  continue;
518  const reco::Track &trk = pf.pseudoTrack();
519  track_.highPurity = pf.trackHighPurity();
520  track_.charge = trk.charge();
521  if (!track_.highPurity || track_.charge == 0)
522  continue;
524  track_.eta = trk.eta();
525  track_.phi = trk.phi();
526  track_.pt = trk.pt();
527  track_.ptError = trk.ptError();
529  track_.algos = trk.algo();
530  track_.dz = std::abs(trk.dz(bestvtx));
531  track_.dxy = std::abs(trk.dxy(bestvtx));
532  track_.dzError = std::hypot(trk.dzError(), bestvzError);
533  track_.dxyError = trk.dxyError(bestvtx, vtx_cov);
536  const reco::HitPattern &hit_pattern = trk.hitPattern();
539  if (cuts_.isGoodTrack(track_)) {
540  fillTracker(track_, bestvz, bin);
541  }
542  }
543  }
544  } else {
545  //calorimetry part
546  if (bScalo_particleFlow_) {
547  iEvent.getByToken(caloTokenPF_, calocands);
548  for (unsigned int i = 0, n = calocands->size(); i < n; ++i) {
549  track_ = {};
550  track_.centbin = cbin;
551  const reco::PFCandidate &pf = (*calocands)[i];
552  track_.et = pf.et();
553  track_.eta = pf.eta();
554  track_.phi = pf.phi();
555  track_.pdgid = pf.pdgId();
556  if (cuts_.isGoodHF(track_)) {
557  fillHF(track_, bestvz, bin);
558  }
559  }
560  } else {
561  iEvent.getByToken(caloToken_, caloCollection_);
562  for (const auto &tower : *caloCollection_) {
563  track_.eta = tower.eta();
564  track_.phi = tower.phi();
565  track_.et = tower.emEt() + tower.hadEt();
566  track_.pdgid = 1;
567  if (cuts_.isGoodHF(track_))
568  fillHF(track_, bestvz, bin);
569  }
570  }
571 
572  //Castor part
574  for (const auto &tower : *castorCollection_) {
575  track_.eta = tower.eta();
576  track_.phi = tower.phi();
577  track_.et = tower.et();
578  track_.pdgid = 1;
580  fillCastor(track_, bestvz, bin);
581  }
582  //Tracking part
583  iEvent.getByToken(trackToken_, trackCollection_);
584  for (const auto &trk : *trackCollection_) {
586  track_.charge = trk.charge();
587  if (!track_.highPurity || track_.charge == 0)
588  continue;
589  track_.centbin = cbin;
590  track_.collection = 0;
591  track_.eta = trk.eta();
592  track_.phi = trk.phi();
593  track_.pt = trk.pt();
594  track_.ptError = trk.ptError();
596  track_.algos = trk.algo();
597  track_.dz = std::abs(trk.dz(bestvtx));
598  track_.dxy = std::abs(trk.dxy(bestvtx));
599  track_.dzError = std::hypot(trk.dzError(), bestvzError);
600  track_.dxyError = trk.dxyError(bestvtx, vtx_cov);
605  if (cuts_.isGoodTrack(track_))
606  fillTracker(track_, bestvz, bin);
607  }
608  }
609 
610  auto evtplaneOutput = std::make_unique<EvtPlaneCollection>();
611 
612  double ang = -10;
613  double sv = 0;
614  double cv = 0;
615  double svNoWgt = 0;
616  double cvNoWgt = 0;
617 
618  double wv = 0;
619  double wv2 = 0;
620  double pe = 0;
621  double pe2 = 0;
622  uint epmult = 0;
623 
624  for (int i = 0; i < NumEPNames; i++) {
625  rp[i]->getAngle(ang, sv, cv, svNoWgt, cvNoWgt, wv, wv2, pe, pe2, epmult);
626  evtplaneOutput->push_back(EvtPlane(i, 0, ang, sv, cv, wv, wv2, pe, pe2, epmult));
627  evtplaneOutput->back().addLevel(3, 0., svNoWgt, cvNoWgt);
628  }
629 
630  iEvent.put(std::move(evtplaneOutput));
631 }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
edm::EDGetTokenT< reco::TrackCollection > trackToken_
edm::Handle< CaloTowerCollection > caloCollection_
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::Handle< reco::TrackCollection > trackCollection_
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:754
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:534
void setCaloCentRefBins(const int caloCentRefMinBin, const int caloCentRefMaxBin)
ErrorD< N >::type type
Definition: Error.h:32
edm::ESGetToken< CentralityTable, HeavyIonRcd > centralityToken_
cv
Definition: cuy.py:363
edm::EDGetTokenT< pat::PackedCandidateCollection > packedToken_
edm::ESWatcher< HeavyIonRcd > hiWatcher_
void fillHF(const TrackStructure &track, double vz, int bin)
float chi2layer
Definition: EPCuts.h:29
edm::EDGetTokenT< pat::PackedCandidateCollection > lostToken_
double pt() const
track transverse momentum
Definition: TrackBase.h:637
TrackStructure track_
int charge() const
track electric charge
Definition: TrackBase.h:596
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:622
int iEvent
Definition: GenABIO.cc:224
bool isGoodTrack(const TrackStructure &track) const
Definition: EPCuts.h:64
float dxyError
Definition: EPCuts.h:22
double dxyError() const
error on dxy
Definition: TrackBase.h:769
GenPlane * rp[NumEPNames]
double dzError() const
error on dz
Definition: TrackBase.h:778
edm::EDGetTokenT< std::vector< reco::Vertex > > vertexToken_
void fillTracker(const TrackStructure &track, double vz, int bin)
HiEvtPlaneFlatten * flat[NumEPNames]
edm::Ref< pat::PackedCandidateCollection > PackedCandidateRef
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
const std::array< int, NumEPNames > EPDet
edm::EDGetTokenT< int > centralityBinToken_
bool isGoodHF(const TrackStructure &track) const
Definition: EPCuts.h:54
int numberOfValidHits
Definition: EPCuts.h:30
edm::ESGetToken< RPFlatParams, HeavyIonRPRcd > flatparmsToken_
edm::Handle< std::vector< reco::CastorTower > > castorCollection_
void fillCastor(const TrackStructure &track, double vz, int bin)
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
TrackAlgorithm algo() const
Definition: TrackBase.h:547
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
float normalizedChi2
Definition: EPCuts.h:27
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:593
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
fixed size matrix
HLT enums.
edm::EDGetTokenT< reco::PFCandidateCollection > caloTokenPF_
edm::ESWatcher< HeavyIonRPRcd > hirpWatcher_
edm::EDGetTokenT< edm::ValueMap< float > > chi2MapLostToken_
edm::EDGetTokenT< CaloTowerCollection > caloToken_
static const int NumEPNames
edm::EDGetTokenT< std::vector< reco::CastorTower > > castorToken_
bool isGoodCastor(const TrackStructure &track) const
Definition: EPCuts.h:62
double getAngle(double &ang, double &sv, double &cv, double &svNoWgt, double &cvNoWgt, double &w, double &w2, double &PtOrEt, double &PtOrEt2, uint &epmult)
void reset(double vett[256])
Definition: TPedValues.cc:11
def move(src, dest)
Definition: eostools.py:511
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608
edm::EDGetTokenT< edm::ValueMap< float > > chi2MapToken_

Member Data Documentation

◆ bScalo_particleFlow_

bool EvtPlaneProducer::bScalo_particleFlow_
private

Definition at line 204 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ bStrack_packedPFCandidates_

bool EvtPlaneProducer::bStrack_packedPFCandidates_
private

Definition at line 203 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ caloCentRef_

double EvtPlaneProducer::caloCentRef_
private

Definition at line 235 of file EvtPlaneProducer.cc.

Referenced by produce().

◆ caloCentRefWidth_

double EvtPlaneProducer::caloCentRefWidth_
private

Definition at line 236 of file EvtPlaneProducer.cc.

Referenced by produce().

◆ caloCollection_

edm::Handle<CaloTowerCollection> EvtPlaneProducer::caloCollection_
private

Definition at line 192 of file EvtPlaneProducer.cc.

Referenced by produce().

◆ caloTag_

edm::InputTag EvtPlaneProducer::caloTag_
private

Definition at line 190 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ caloToken_

edm::EDGetTokenT<CaloTowerCollection> EvtPlaneProducer::caloToken_
private

Definition at line 191 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ caloTokenPF_

edm::EDGetTokenT<reco::PFCandidateCollection> EvtPlaneProducer::caloTokenPF_
private

Definition at line 193 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ castorCollection_

edm::Handle<std::vector<reco::CastorTower> > EvtPlaneProducer::castorCollection_
private

Definition at line 197 of file EvtPlaneProducer.cc.

Referenced by produce().

◆ castorTag_

edm::InputTag EvtPlaneProducer::castorTag_
private

Definition at line 195 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ castorToken_

edm::EDGetTokenT<std::vector<reco::CastorTower> > EvtPlaneProducer::castorToken_
private

Definition at line 196 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ CentBinCompression_

int EvtPlaneProducer::CentBinCompression_
private

Definition at line 237 of file EvtPlaneProducer.cc.

Referenced by produce().

◆ centralityBinTag_

edm::InputTag EvtPlaneProducer::centralityBinTag_
private

Definition at line 183 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ centralityBinToken_

edm::EDGetTokenT<int> EvtPlaneProducer::centralityBinToken_
private

Definition at line 184 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ centralityMC_

std::string EvtPlaneProducer::centralityMC_
private

Definition at line 181 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ centralityToken_

edm::ESGetToken<CentralityTable, HeavyIonRcd> EvtPlaneProducer::centralityToken_
private

Definition at line 213 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ centralityVariable_

std::string EvtPlaneProducer::centralityVariable_
private

Definition at line 180 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ chi2_

double EvtPlaneProducer::chi2_
private

Definition at line 230 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ chi2MapLostTag_

edm::InputTag EvtPlaneProducer::chi2MapLostTag_
private

Definition at line 210 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ chi2MapLostToken_

edm::EDGetTokenT<edm::ValueMap<float> > EvtPlaneProducer::chi2MapLostToken_
private

Definition at line 211 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ chi2MapTag_

edm::InputTag EvtPlaneProducer::chi2MapTag_
private

Definition at line 208 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ chi2MapToken_

edm::EDGetTokenT<edm::ValueMap<float> > EvtPlaneProducer::chi2MapToken_
private

Definition at line 209 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ chi2perlayer_

double EvtPlaneProducer::chi2perlayer_
private

Definition at line 227 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ cutEra_

int EvtPlaneProducer::cutEra_
private

Definition at line 238 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ cuts_

EPCuts EvtPlaneProducer::cuts_
private

Definition at line 178 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ d0d0error_

double EvtPlaneProducer::d0d0error_
private

Definition at line 225 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ dzdzerror_

double EvtPlaneProducer::dzdzerror_
private

Definition at line 224 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ dzdzerror_pix_

double EvtPlaneProducer::dzdzerror_pix_
private

Definition at line 229 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ dzerr_

double EvtPlaneProducer::dzerr_
private

Definition at line 228 of file EvtPlaneProducer.cc.

◆ flat

HiEvtPlaneFlatten* EvtPlaneProducer::flat[NumEPNames]
private

Definition at line 239 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), produce(), and ~EvtPlaneProducer().

◆ flatdelvtx_

double EvtPlaneProducer::flatdelvtx_
private

Definition at line 223 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ flatminvtx_

double EvtPlaneProducer::flatminvtx_
private

Definition at line 222 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ flatnvtxbins_

int EvtPlaneProducer::flatnvtxbins_
private

Definition at line 221 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ FlatOrder_

int EvtPlaneProducer::FlatOrder_
private

Definition at line 232 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ flatparmsToken_

edm::ESGetToken<RPFlatParams, HeavyIonRPRcd> EvtPlaneProducer::flatparmsToken_
private

Definition at line 214 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ hirpWatcher_

edm::ESWatcher<HeavyIonRPRcd> EvtPlaneProducer::hirpWatcher_
private

Definition at line 243 of file EvtPlaneProducer.cc.

Referenced by produce().

◆ hiWatcher_

edm::ESWatcher<HeavyIonRcd> EvtPlaneProducer::hiWatcher_
private

Definition at line 242 of file EvtPlaneProducer.cc.

Referenced by produce().

◆ loadDB_

bool EvtPlaneProducer::loadDB_
private

Definition at line 216 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ lostToken_

edm::EDGetTokenT<pat::PackedCandidateCollection> EvtPlaneProducer::lostToken_
private

Definition at line 206 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ losttrackTag_

edm::InputTag EvtPlaneProducer::losttrackTag_
private

Definition at line 201 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ maxet_

double EvtPlaneProducer::maxet_
private

Definition at line 218 of file EvtPlaneProducer.cc.

◆ maxpt_

double EvtPlaneProducer::maxpt_
private

Definition at line 220 of file EvtPlaneProducer.cc.

◆ minet_

double EvtPlaneProducer::minet_
private

Definition at line 217 of file EvtPlaneProducer.cc.

◆ minpt_

double EvtPlaneProducer::minpt_
private

Definition at line 219 of file EvtPlaneProducer.cc.

◆ nCentBins_

double EvtPlaneProducer::nCentBins_
private

Definition at line 234 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ nhitsValid_

int EvtPlaneProducer::nhitsValid_
private

Definition at line 231 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ NumFlatBins_

int EvtPlaneProducer::NumFlatBins_
private

Definition at line 233 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ packedToken_

edm::EDGetTokenT<pat::PackedCandidateCollection> EvtPlaneProducer::packedToken_
private

Definition at line 205 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ pterror_

double EvtPlaneProducer::pterror_
private

Definition at line 226 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ rp

GenPlane* EvtPlaneProducer::rp[NumEPNames]
private

Definition at line 173 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ track_

TrackStructure EvtPlaneProducer::track_
private

Definition at line 240 of file EvtPlaneProducer.cc.

Referenced by produce().

◆ trackCollection_

edm::Handle<reco::TrackCollection> EvtPlaneProducer::trackCollection_
private

Definition at line 202 of file EvtPlaneProducer.cc.

Referenced by produce().

◆ trackTag_

edm::InputTag EvtPlaneProducer::trackTag_
private

Definition at line 199 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ trackToken_

edm::EDGetTokenT<reco::TrackCollection> EvtPlaneProducer::trackToken_
private

Definition at line 200 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().

◆ vertex_

edm::Handle<std::vector<reco::Vertex> > EvtPlaneProducer::vertex_
private

Definition at line 188 of file EvtPlaneProducer.cc.

◆ vertexTag_

edm::InputTag EvtPlaneProducer::vertexTag_
private

Definition at line 186 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer().

◆ vertexToken_

edm::EDGetTokenT<std::vector<reco::Vertex> > EvtPlaneProducer::vertexToken_
private

Definition at line 187 of file EvtPlaneProducer.cc.

Referenced by EvtPlaneProducer(), and produce().