CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Attributes
PFClusterTimeSelector Class Reference

#include <PFClusterTimeSelector.h>

Inheritance diagram for PFClusterTimeSelector:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  CutInfo
 

Public Member Functions

virtual void beginRun (const edm::Run &run, const edm::EventSetup &es)
 
 PFClusterTimeSelector (const edm::ParameterSet &)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 ~PFClusterTimeSelector ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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::vector< ModuleDescription const * > &modules, 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
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 18 of file PFClusterTimeSelector.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file PFClusterTimeSelector.cc.

References TkAlMuonSelectors_cfi::cut, cutInfo_, particleFlowClusterECALTimeSelected_cfi::cuts, PFClusterTimeSelector::CutInfo::depth, PFClusterTimeSelector::CutInfo::endcap, edm::ParameterSet::getParameter(), info(), PFClusterTimeSelector::CutInfo::maxE, PFClusterTimeSelector::CutInfo::maxTime, PFClusterTimeSelector::CutInfo::minE, and PFClusterTimeSelector::CutInfo::minTime.

13  :
14  clusters_(consumes<reco::PFClusterCollection>(iConfig.getParameter<edm::InputTag>("src")))
15 {
16 
17  std::vector<edm::ParameterSet> cuts = iConfig.getParameter<std::vector<edm::ParameterSet> >("cuts");
18  for (const auto& cut :cuts ) {
19  CutInfo info;
20  info.depth = cut.getParameter<double>("depth");
21  info.minE = cut.getParameter<double>("minEnergy");
22  info.maxE = cut.getParameter<double>("maxEnergy");
23  info.minTime = cut.getParameter<double>("minTime");
24  info.maxTime = cut.getParameter<double>("maxTime");
25  info.endcap = cut.getParameter<bool>("endcap");
26  cutInfo_.push_back(info);
27  }
28 
29 
30  produces<reco::PFClusterCollection>();
31  produces<reco::PFClusterCollection>("OOT");
32 }
T getParameter(std::string const &) const
static const TGPicture * info(bool iBackgroundIsBlack)
std::vector< CutInfo > cutInfo_
edm::EDGetTokenT< reco::PFClusterCollection > clusters_
PFClusterTimeSelector::~PFClusterTimeSelector ( )

Definition at line 75 of file PFClusterTimeSelector.cc.

75 {}

Member Function Documentation

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

Definition at line 79 of file PFClusterTimeSelector.cc.

80  {
81 
82 
83 }
void PFClusterTimeSelector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 35 of file PFClusterTimeSelector.cc.

References fastPrimaryVertexProducer_cfi::clusters, clusters_, cutInfo_, particleFlowClusterECALTimeSelected_cfi::depth, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, edm::Event::getByToken(), PFLayer::HCAL_BARREL1, PFLayer::HCAL_BARREL2, PFLayer::HCAL_ENDCAP, info(), eostools::move(), MillePedeFileConverter_cfg::out, edm::Event::put(), and ntuplemaker::time.

36  {
37 
39  iEvent.getByToken(clusters_,clusters);
40  auto out = std::make_unique<reco::PFClusterCollection>();
41  auto outOOT = std::make_unique<reco::PFClusterCollection>();
42 
43  for(const auto& cluster : *clusters ) {
44  const double energy = cluster.energy();
45  const double time = cluster.time();
46  const double depth = cluster.depth();
47  const PFLayer::Layer layer = cluster.layer();
48  for (const auto& info : cutInfo_) {
49  if (energy<info.minE || energy>info.maxE)
50  continue;
51  if (depth<0.9*info.depth || depth>1.1*info.depth)
52  continue;
53  if ((info.endcap && (layer==PFLayer::ECAL_BARREL || layer==PFLayer::HCAL_BARREL1 || layer==PFLayer::HCAL_BARREL2))||
54  (((!info.endcap) && (layer==PFLayer::ECAL_ENDCAP || layer==PFLayer::HCAL_ENDCAP))))
55  continue;
56 
57  if (time>info.minTime && time<info.maxTime)
58  out->push_back(cluster);
59  else
60  outOOT->push_back(cluster);
61 
62  break;
63 
64  }
65 
66  }
67 
68 
69 
70  iEvent.put(std::move(out));
71  iEvent.put(std::move(outOOT),"OOT");
72 
73 }
static const TGPicture * info(bool iBackgroundIsBlack)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::vector< CutInfo > cutInfo_
Layer
layer definition
Definition: PFLayer.h:31
edm::EDGetTokenT< reco::PFClusterCollection > clusters_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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

Definition at line 42 of file PFClusterTimeSelector.h.

Referenced by produce().

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

Definition at line 43 of file PFClusterTimeSelector.h.

Referenced by PFClusterTimeSelector(), and produce().