CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
PFClusterSelector Class Reference

#include <PFClusterSelector.h>

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

Public Member Functions

virtual void beginRun (const edm::Run &run, const edm::EventSetup &es)
 
 PFClusterSelector (const edm::ParameterSet &)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 ~PFClusterSelector ()
 
- 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
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Attributes

edm::EDGetTokenT
< reco::PFClusterCollection
clusters_
 
std::vector< double > energyRanges_
 
std::vector< double > timingCutsHighBarrel_
 
std::vector< double > timingCutsHighEndcap_
 
std::vector< double > timingCutsLowBarrel_
 
std::vector< double > timingCutsLowEndcap_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 PFClusterSelector.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file PFClusterSelector.cc.

13  :
14  clusters_(consumes<reco::PFClusterCollection>(iConfig.getParameter<edm::InputTag>("src"))),
15  energyRanges_(iConfig.getParameter<std::vector<double> >("energyRanges")),
16  timingCutsLowBarrel_(iConfig.getParameter<std::vector<double> >("timingCutsLowBarrel")),
17  timingCutsHighBarrel_(iConfig.getParameter<std::vector<double> >("timingCutsHighBarrel")),
18  timingCutsLowEndcap_(iConfig.getParameter<std::vector<double> >("timingCutsLowEndcap")),
19  timingCutsHighEndcap_(iConfig.getParameter<std::vector<double> >("timingCutsHighEndcap"))
20 {
21  produces<reco::PFClusterCollection>();
22 }
T getParameter(std::string const &) const
std::vector< double > timingCutsHighBarrel_
std::vector< double > timingCutsLowBarrel_
edm::EDGetTokenT< reco::PFClusterCollection > clusters_
std::vector< double > timingCutsHighEndcap_
std::vector< double > energyRanges_
std::vector< double > timingCutsLowEndcap_
PFClusterSelector::~PFClusterSelector ( )

Definition at line 68 of file PFClusterSelector.cc.

68 {}

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 72 of file PFClusterSelector.cc.

73  {
74 
75 
76 }
void PFClusterSelector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 25 of file PFClusterSelector.cc.

References clusters_, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, relval_parameters_module::energy, energyRanges_, edm::Event::getByToken(), PFLayer::HCAL_BARREL1, PFLayer::HCAL_BARREL2, PFLayer::HCAL_ENDCAP, customizeTrackingMonitorSeedNumber::idx, NULL, dbtoconf::out, edm::Event::put(), cond::rpcobgas::time, timingCutsHighBarrel_, timingCutsHighEndcap_, timingCutsLowBarrel_, and timingCutsLowEndcap_.

26  {
27 
29  iEvent.getByToken(clusters_,clusters);
30  std::auto_ptr<reco::PFClusterCollection> out(new reco::PFClusterCollection);
31 
32  const std::vector<double>* timingCutsLow = NULL;
33  const std::vector<double>* timingCutsHigh = NULL;
34  for(const auto& cluster : *clusters ) {
35  const double energy = cluster.energy();
36  const double time = cluster.time();
37 
38  switch(cluster.layer()) {
42  timingCutsLow = &timingCutsLowBarrel_;
43  timingCutsHigh = &timingCutsHighBarrel_;
44  break;
47  timingCutsLow = &timingCutsLowEndcap_;
48  timingCutsHigh = &timingCutsHighEndcap_;
49  break;
50  default:
51  continue;
52  }
53  auto e_bin = std::lower_bound(energyRanges_.begin(),energyRanges_.end(),energy);
54  // Returns iterator to the first value that is *greater* than the value
55  // we are comparing to.
56  // The timing cuts are indexed by the bin high edge so we just need the
57  // distance between this bin timing cut vectors are padded to avoid
58  // overflows.
59  const unsigned idx = std::distance(energyRanges_.begin(),e_bin);
60  if( time > (*timingCutsLow)[idx] && time < (*timingCutsHigh)[idx] ) {
61  out->push_back(cluster);
62  }
63  }
64  iEvent.put( out);
65 
66 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< double > timingCutsHighBarrel_
#define NULL
Definition: scimark2.h:8
std::vector< double > timingCutsLowBarrel_
edm::EDGetTokenT< reco::PFClusterCollection > clusters_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
tuple out
Definition: dbtoconf.py:99
std::vector< double > timingCutsHighEndcap_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< double > energyRanges_
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
std::vector< double > timingCutsLowEndcap_

Member Data Documentation

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

Definition at line 32 of file PFClusterSelector.h.

Referenced by produce().

std::vector<double> PFClusterSelector::energyRanges_
protected

Definition at line 33 of file PFClusterSelector.h.

Referenced by produce().

std::vector<double> PFClusterSelector::timingCutsHighBarrel_
protected

Definition at line 35 of file PFClusterSelector.h.

Referenced by produce().

std::vector<double> PFClusterSelector::timingCutsHighEndcap_
protected

Definition at line 37 of file PFClusterSelector.h.

Referenced by produce().

std::vector<double> PFClusterSelector::timingCutsLowBarrel_
protected

Definition at line 34 of file PFClusterSelector.h.

Referenced by produce().

std::vector<double> PFClusterSelector::timingCutsLowEndcap_
protected

Definition at line 36 of file PFClusterSelector.h.

Referenced by produce().