CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HighPtTrackEcalDetIdProducer Class Reference
Inheritance diagram for HighPtTrackEcalDetIdProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 HighPtTrackEcalDetIdProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HighPtTrackEcalDetIdProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) 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
 
ESProxyIndex const * esGetTokenIndices (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::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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const CaloTopologycaloTopology_
 
edm::EDGetTokenT< reco::TrackCollectioninputCollectionToken_
 
TrackAssociatorParameters parameters_
 
double ptcut_
 
TrackDetectorAssociator trackAssociator_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 57 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 85 of file Skim_HighPtTrackEcalDetIdProducer.cc.

References edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::getParameter(), inputCollectionToken_, TrackAssociatorParameters::loadParameters(), parameters_, ptcut_, trackAssociator_, and TrackDetectorAssociator::useDefaultPropagator().

86 {
87  inputCollectionToken_ = consumes<reco::TrackCollection>(iConfig.getParameter< edm::InputTag >("inputCollection"));
88  ptcut_= iConfig.getParameter< double >("TrackPt");
89 
90  produces< DetIdCollection >() ;
91  // TrackAssociator parameters
92  edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
96 
97 }
T getParameter(std::string const &) const
void useDefaultPropagator()
use the default propagator
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< reco::TrackCollection > inputCollectionToken_
HighPtTrackEcalDetIdProducer::~HighPtTrackEcalDetIdProducer ( )
override

Definition at line 100 of file Skim_HighPtTrackEcalDetIdProducer.cc.

101 {
102 
103  // do anything here that needs to be done at desctruction time
104  // (e.g. close files, deallocate resources etc.)
105 
106 }

Member Function Documentation

void HighPtTrackEcalDetIdProducer::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
override

Definition at line 114 of file Skim_HighPtTrackEcalDetIdProducer.cc.

References caloTopology_, and edm::EventSetup::get().

115 {
116  edm::ESHandle<CaloTopology> theCaloTopology;
117  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
118  caloTopology_ = &(*theCaloTopology);
119 }
T get() const
Definition: EventSetup.h:71
void HighPtTrackEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 123 of file Skim_HighPtTrackEcalDetIdProducer.cc.

References TrackDetectorAssociator::associate(), caloTopology_, TrackDetMatchInfo::crossedEcalIds, DEFINE_FWK_MODULE, DetId::Ecal, spr::find(), edm::Event::getByToken(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), triggerObjects_cff::id, info(), inputCollectionToken_, TrackDetectorAssociator::InsideOut, interestingDetIdCollectionProducer_cfi::interestingDetIdCollection, eostools::move(), parameters_, ptcut_, edm::Event::put(), DetId::subdetId(), ecaldqm::topology(), and trackAssociator_.

124 {
125  using namespace edm;
126  using reco::TrackCollection;
127 // if(!iSetup) continue;
128  Handle<TrackCollection> tkTracks;
129  iEvent.getByToken(inputCollectionToken_,tkTracks);
130  std::unique_ptr< DetIdCollection > interestingDetIdCollection( new DetIdCollection() ) ;
131  for(TrackCollection::const_iterator itTrack = tkTracks->begin();
132  itTrack != tkTracks->end();
133  ++itTrack) {
134  if(itTrack->pt()>ptcut_){
136  if(info.crossedEcalIds.empty()) break;
137 
138  if(!info.crossedEcalIds.empty()){
139  DetId centerId = info.crossedEcalIds.front();
140 
142  const std::vector<DetId>& ids = topology->getWindow(centerId, 5, 5);
143  for ( std::vector<DetId>::const_iterator id = ids.begin(); id != ids.end(); ++id )
145  == interestingDetIdCollection->end())
146  interestingDetIdCollection->push_back(*id);
147  }
148  }
149 
150  }
152 
153 }
static const TGPicture * info(bool iBackgroundIsBlack)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
CaloTopology const * topology(0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::vector< DetId > crossedEcalIds
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:15
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
Definition: DetId.h:18
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:20
HLT enums.
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
edm::EDCollection< DetId > DetIdCollection
edm::EDGetTokenT< reco::TrackCollection > inputCollectionToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

const CaloTopology* HighPtTrackEcalDetIdProducer::caloTopology_
private

Definition at line 66 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by beginRun(), and produce().

edm::EDGetTokenT<reco::TrackCollection> HighPtTrackEcalDetIdProducer::inputCollectionToken_
private

Definition at line 65 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().

TrackAssociatorParameters HighPtTrackEcalDetIdProducer::parameters_
private
double HighPtTrackEcalDetIdProducer::ptcut_
private

Definition at line 69 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().

TrackDetectorAssociator HighPtTrackEcalDetIdProducer::trackAssociator_
private

Definition at line 67 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().