CMS 3D CMS Logo

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

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::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

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

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
 

Detailed Description

Definition at line 56 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Constructor & Destructor Documentation

◆ HighPtTrackEcalDetIdProducer()

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

Definition at line 83 of file Skim_HighPtTrackEcalDetIdProducer.cc.

83  {
84  inputCollectionToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("inputCollection"));
85  ptcut_ = iConfig.getParameter<double>("TrackPt");
86 
87  produces<DetIdCollection>();
88  // TrackAssociator parameters
89  edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
90  edm::ConsumesCollector iC = consumesCollector();
93 }

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

◆ ~HighPtTrackEcalDetIdProducer()

HighPtTrackEcalDetIdProducer::~HighPtTrackEcalDetIdProducer ( )
override

Definition at line 95 of file Skim_HighPtTrackEcalDetIdProducer.cc.

95  {
96  // do anything here that needs to be done at desctruction time
97  // (e.g. close files, deallocate resources etc.)
98 }

Member Function Documentation

◆ beginRun()

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

Definition at line 104 of file Skim_HighPtTrackEcalDetIdProducer.cc.

104  {
105  edm::ESHandle<CaloTopology> theCaloTopology;
106  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
107  caloTopology_ = &(*theCaloTopology);
108 }

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

◆ produce()

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

Definition at line 111 of file Skim_HighPtTrackEcalDetIdProducer.cc.

111  {
112  using namespace edm;
113  using reco::TrackCollection;
114  // if(!iSetup) continue;
115  Handle<TrackCollection> tkTracks;
116  iEvent.getByToken(inputCollectionToken_, tkTracks);
117  std::unique_ptr<DetIdCollection> interestingDetIdCollection(new DetIdCollection());
118  for (TrackCollection::const_iterator itTrack = tkTracks->begin(); itTrack != tkTracks->end(); ++itTrack) {
119  if (itTrack->pt() > ptcut_) {
122  if (info.crossedEcalIds.empty())
123  break;
124 
125  if (!info.crossedEcalIds.empty()) {
126  DetId centerId = info.crossedEcalIds.front();
127 
130  const std::vector<DetId>& ids = topology->getWindow(centerId, 5, 5);
131  for (std::vector<DetId>::const_iterator id = ids.begin(); id != ids.end(); ++id)
134  interestingDetIdCollection->push_back(*id);
135  }
136  }
137  }
139 }

References TrackDetectorAssociator::associate(), caloTopology_, DetId::Ecal, spr::find(), CaloTopology::getSubdetectorTopology(), CaloTopology::getWindow(), triggerObjects_cff::id, iEvent, info(), inputCollectionToken_, TrackDetectorAssociator::InsideOut, interestingDetIdCollectionProducer_cfi::interestingDetIdCollection, eostools::move(), parameters_, ptcut_, DetId::subdetId(), ecaldqm::topology(), and trackAssociator_.

Member Data Documentation

◆ caloTopology_

const CaloTopology* HighPtTrackEcalDetIdProducer::caloTopology_
private

Definition at line 65 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by beginRun(), and produce().

◆ inputCollectionToken_

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

Definition at line 64 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().

◆ parameters_

TrackAssociatorParameters HighPtTrackEcalDetIdProducer::parameters_
private

◆ ptcut_

double HighPtTrackEcalDetIdProducer::ptcut_
private

Definition at line 68 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().

◆ trackAssociator_

TrackDetectorAssociator HighPtTrackEcalDetIdProducer::trackAssociator_
private

Definition at line 66 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().

BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:29
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackDetectorAssociator::useDefaultPropagator
void useDefaultPropagator()
use the default propagator
Definition: TrackDetectorAssociator.cc:81
CaloTopology::getWindow
std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
Get the neighbors of the given cell in a window of given size.
Definition: CaloTopology.cc:64
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::Handle
Definition: AssociativeIterator.h:50
DetId
Definition: DetId.h:17
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
HighPtTrackEcalDetIdProducer::inputCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > inputCollectionToken_
Definition: Skim_HighPtTrackEcalDetIdProducer.cc:64
ecaldqm::topology
const CaloTopology * topology(nullptr)
edm::ESHandle< CaloTopology >
TrackAssociatorParameters::loadParameters
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
Definition: TrackAssociatorParameters.cc:18
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
edm::ParameterSet
Definition: ParameterSet.h:47
CaloTopology::getSubdetectorTopology
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
iEvent
int iEvent
Definition: GenABIO.cc:224
HighPtTrackEcalDetIdProducer::parameters_
TrackAssociatorParameters parameters_
Definition: Skim_HighPtTrackEcalDetIdProducer.cc:67
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
TrackDetectorAssociator::InsideOut
Definition: TrackDetectorAssociator.h:50
DetId::Ecal
Definition: DetId.h:27
get
#define get
TrackDetMatchInfo
Definition: TrackDetMatchInfo.h:13
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetIdCollection
edm::EDCollection< DetId > DetIdCollection
Definition: DetIdCollection.h:7
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TrackDetectorAssociator::associate
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:110
HighPtTrackEcalDetIdProducer::ptcut_
double ptcut_
Definition: Skim_HighPtTrackEcalDetIdProducer.cc:68
HighPtTrackEcalDetIdProducer::caloTopology_
const CaloTopology * caloTopology_
Definition: Skim_HighPtTrackEcalDetIdProducer.cc:65
interestingDetIdCollectionProducer_cfi.interestingDetIdCollection
interestingDetIdCollection
Definition: interestingDetIdCollectionProducer_cfi.py:11
HighPtTrackEcalDetIdProducer::trackAssociator_
TrackDetectorAssociator trackAssociator_
Definition: Skim_HighPtTrackEcalDetIdProducer.cc:66
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ConsumesCollector
Definition: ConsumesCollector.h:45