CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Attributes
PFClusterTimeSelector Class Reference
Inheritance diagram for PFClusterTimeSelector:
edm::stream::EDProducer<>

Classes

struct  CutInfo
 

Public Member Functions

void beginRun (const edm::Run &run, const edm::EventSetup &es) override
 
 PFClusterTimeSelector (const edm::ParameterSet &)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~PFClusterTimeSelector () 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
 

Protected Attributes

edm::EDGetTokenT< reco::PFClusterCollectionclusters_
 
std::vector< CutInfocutInfo_
 

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

Definition at line 15 of file PFClusterTimeSelector.cc.

Constructor & Destructor Documentation

◆ PFClusterTimeSelector()

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

Definition at line 45 of file PFClusterTimeSelector.cc.

46  : clusters_(consumes<reco::PFClusterCollection>(iConfig.getParameter<edm::InputTag>("src"))) {
47  std::vector<edm::ParameterSet> cuts = iConfig.getParameter<std::vector<edm::ParameterSet> >("cuts");
48  for (const auto& cut : cuts) {
49  CutInfo info;
50  info.depth = cut.getParameter<double>("depth");
51  info.minE = cut.getParameter<double>("minEnergy");
52  info.maxE = cut.getParameter<double>("maxEnergy");
53  info.minTime = cut.getParameter<double>("minTime");
54  info.maxTime = cut.getParameter<double>("maxTime");
55  info.endcap = cut.getParameter<bool>("endcap");
56  cutInfo_.push_back(info);
57  }
58 
59  produces<reco::PFClusterCollection>();
60  produces<reco::PFClusterCollection>("OOT");
61 }

References PA_MinBiasSkim_cff::cut, cutInfo_, cuts, edm::ParameterSet::getParameter(), and info().

◆ ~PFClusterTimeSelector()

PFClusterTimeSelector::~PFClusterTimeSelector ( )
overridedefault

Member Function Documentation

◆ beginRun()

void PFClusterTimeSelector::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
override

Definition at line 100 of file PFClusterTimeSelector.cc.

100 {}

◆ produce()

void PFClusterTimeSelector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 63 of file PFClusterTimeSelector.cc.

63  {
65  iEvent.getByToken(clusters_, clusters);
66  auto out = std::make_unique<reco::PFClusterCollection>();
67  auto outOOT = std::make_unique<reco::PFClusterCollection>();
68 
69  for (const auto& cluster : *clusters) {
70  const double energy = cluster.energy();
71  const double time = cluster.time();
72  const double depth = cluster.depth();
73  const PFLayer::Layer layer = cluster.layer();
74  for (const auto& info : cutInfo_) {
75  if (energy < info.minE || energy > info.maxE)
76  continue;
77  if (depth < 0.9 * info.depth || depth > 1.1 * info.depth)
78  continue;
79  if ((info.endcap &&
81  (((!info.endcap) && (layer == PFLayer::ECAL_ENDCAP || layer == PFLayer::HCAL_ENDCAP))))
82  continue;
83 
84  if (time > info.minTime && time < info.maxTime)
85  out->push_back(cluster);
86  else
87  outOOT->push_back(cluster);
88 
89  break;
90  }
91  }
92 
93  iEvent.put(std::move(out));
94  iEvent.put(std::move(outOOT), "OOT");
95 }

References bsc_activity_cfg::clusters, clusters_, cutInfo_, LEDCalibrationChannels::depth, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, HCALHighEnergyHPDFilter_cfi::energy, PFLayer::HCAL_BARREL1, PFLayer::HCAL_BARREL2, PFLayer::HCAL_ENDCAP, iEvent, info(), phase1PixelTopology::layer, eostools::move(), MillePedeFileConverter_cfg::out, and protons_cff::time.

Member Data Documentation

◆ clusters_

edm::EDGetTokenT<reco::PFClusterCollection> PFClusterTimeSelector::clusters_
protected

Definition at line 35 of file PFClusterTimeSelector.cc.

Referenced by produce().

◆ cutInfo_

std::vector<CutInfo> PFClusterTimeSelector::cutInfo_
protected

Definition at line 36 of file PFClusterTimeSelector.cc.

Referenced by PFClusterTimeSelector(), and produce().

cuts
const TkSoA *__restrict__ CAHitNtupletGeneratorKernelsGPU::QualityCuts cuts
Definition: CAHitNtupletGeneratorKernelsImpl.h:416
PFLayer::HCAL_ENDCAP
Definition: PFLayer.h:37
protons_cff.time
time
Definition: protons_cff.py:35
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
edm::Handle
Definition: AssociativeIterator.h:50
PFLayer::ECAL_BARREL
Definition: PFLayer.h:33
PFLayer::HCAL_BARREL2
Definition: PFLayer.h:36
PFLayer::HCAL_BARREL1
Definition: PFLayer.h:35
PFClusterTimeSelector::cutInfo_
std::vector< CutInfo > cutInfo_
Definition: PFClusterTimeSelector.cc:36
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
PFLayer::Layer
Layer
layer definition
Definition: PFLayer.h:29
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
PFClusterTimeSelector::clusters_
edm::EDGetTokenT< reco::PFClusterCollection > clusters_
Definition: PFClusterTimeSelector.cc:35
iEvent
int iEvent
Definition: GenABIO.cc:224
eostools.move
def move(src, dest)
Definition: eostools.py:511
PA_MinBiasSkim_cff.cut
cut
Definition: PA_MinBiasSkim_cff.py:13
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
PFLayer::ECAL_ENDCAP
Definition: PFLayer.h:32
edm::InputTag
Definition: InputTag.h:15