test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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::EDProducer
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 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(), HLT_25ns10e33_v2_cff::parameters, 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 ( )

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 
)
overridevirtual

Reimplemented from edm::EDProducer.

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 }
const T & get() const
Definition: EventSetup.h:56
void HighPtTrackEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 123 of file Skim_HighPtTrackEcalDetIdProducer.cc.

References TrackDetectorAssociator::associate(), caloTopology_, TrackDetMatchInfo::crossedEcalIds, DetId::Ecal, spr::find(), edm::Event::getByToken(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), info(), inputCollectionToken_, TrackDetectorAssociator::InsideOut, 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::auto_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.size()==0) break;
137 
138  if(info.crossedEcalIds.size()>0){
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 )
144  if(std::find(interestingDetIdCollection->begin(), interestingDetIdCollection->end(), *id)
145  == interestingDetIdCollection->end())
146  interestingDetIdCollection->push_back(*id);
147  }
148  }
149 
150  }
151  iEvent.put(interestingDetIdCollection);
152 
153 }
static const TGPicture * info(bool iBackgroundIsBlack)
CaloTopology const * topology(0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::vector< DetId > crossedEcalIds
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
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:26
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
edm::EDCollection< DetId > DetIdCollection
edm::EDGetTokenT< reco::TrackCollection > inputCollectionToken_

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().