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 Member Functions | Private Attributes
IsolatedEcalPixelTrackCandidateProducer Class Reference

#include <Calibration/HcalIsolatedTrackReco/src/IsolatedEcalPixelTrackCandidateProducer.cc>

Inheritance diagram for IsolatedEcalPixelTrackCandidateProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 IsolatedEcalPixelTrackCandidateProducer (const edm::ParameterSet &)
 
 ~IsolatedEcalPixelTrackCandidateProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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
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 (const std::string &iProcessName, std::vector< const char * > &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 Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

double coneSizeEta0_
 
double coneSizeEta1_
 
double hitCountEthr_
 
double hitEthr_
 
edm::EDGetTokenT
< EcalRecHitCollection
tok_eb
 
edm::EDGetTokenT
< EcalRecHitCollection
tok_ee
 
edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
tok_trigcand
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 20 of file IsolatedEcalPixelTrackCandidateProducer.h.

Constructor & Destructor Documentation

IsolatedEcalPixelTrackCandidateProducer::IsolatedEcalPixelTrackCandidateProducer ( const edm::ParameterSet conf)
explicit

Definition at line 37 of file IsolatedEcalPixelTrackCandidateProducer.cc.

References coneSizeEta0_, coneSizeEta1_, edm::ParameterSet::getParameter(), hitCountEthr_, hitEthr_, tok_eb, tok_ee, and tok_trigcand.

37  {
38 
39  coneSizeEta0_ = conf.getParameter<double>("EcalConeSizeEta0");
40  coneSizeEta1_ = conf.getParameter<double>("EcalConeSizeEta1");
41  hitCountEthr_ = conf.getParameter<double>("ECHitCountEnergyThreshold");
42  hitEthr_ = conf.getParameter<double>("ECHitEnergyThreshold");
43  tok_trigcand = consumes<trigger::TriggerFilterObjectWithRefs>(conf.getParameter<edm::InputTag>("filterLabel"));
44  tok_eb = consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EBRecHitSource"));
45  tok_ee = consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EERecHitSource"));
46 
47  //register your products
48  produces< reco::IsolatedPixelTrackCandidateCollection >();
49 }
T getParameter(std::string const &) const
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_trigcand
IsolatedEcalPixelTrackCandidateProducer::~IsolatedEcalPixelTrackCandidateProducer ( )

Definition at line 51 of file IsolatedEcalPixelTrackCandidateProducer.cc.

51 { }

Member Function Documentation

void IsolatedEcalPixelTrackCandidateProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 139 of file IsolatedEcalPixelTrackCandidateProducer.cc.

139 { }
void IsolatedEcalPixelTrackCandidateProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 142 of file IsolatedEcalPixelTrackCandidateProducer.cc.

142 { }
void IsolatedEcalPixelTrackCandidateProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 54 of file IsolatedEcalPixelTrackCandidateProducer.cc.

References funct::abs(), coneSizeEta0_, coneSizeEta1_, reco::deltaR(), PV3DBase< T, PVType, FrameType >::eta(), eta(), edm::EventSetup::get(), edm::Event::getByToken(), CaloGeometry::getPosition(), hitCountEthr_, hitEthr_, edm::HandleBase::isValid(), AlCaHLTBitMon_ParallelJobs::p, phi, PV3DBase< T, PVType, FrameType >::phi(), edm::ESHandle< class >::product(), edm::Event::put(), dttmaxenums::R, reco::IsolatedPixelTrackCandidate::setEnergyIn(), reco::IsolatedPixelTrackCandidate::setEnergyOut(), reco::IsolatedPixelTrackCandidate::setNHitIn(), reco::IsolatedPixelTrackCandidate::setNHitOut(), tok_eb, tok_ee, tok_trigcand, and trigger::TriggerTrack.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

54  {
55 #ifdef DebugLog
56  edm::LogInfo("HcalIsoTrack") << "==============Inside IsolatedEcalPixelTrackCandidateProducer";
57 #endif
59  iSetup.get<CaloGeometryRecord>().get(pG);
60  const CaloGeometry* geo = pG.product();
61 
63  iEvent.getByToken(tok_eb,ecalEB);
64 
66  iEvent.getByToken(tok_ee,ecalEE);
67 #ifdef DebugLog
68  edm::LogInfo("HcalIsoTrack") << "ecal Collections isValid: " << ecalEB.isValid() << "/" << ecalEE.isValid();
69 #endif
70 
72  iEvent.getByToken(tok_trigcand,trigCand);
73 
74  std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
75  trigCand->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
76  int nCand=isoPixTrackRefs.size();
77 
79 #ifdef DebugLog
80  edm::LogInfo("HcalIsoTrack") << "coneSize_ " << coneSizeEta0_ << "/"<< coneSizeEta1_ << " hitCountEthr_ " << hitCountEthr_ << " hitEthr_ " << hitEthr_;
81 #endif
82  for (int p=0; p<nCand; p++) {
83  int nhitIn(0), nhitOut(0);
84  double inEnergy(0), outEnergy(0);
85  std::pair<double,double> etaPhi(isoPixTrackRefs[p]->track()->eta(), isoPixTrackRefs[p]->track()->phi());
86  if (isoPixTrackRefs[p]->etaPhiEcalValid()) etaPhi = isoPixTrackRefs[p]->etaPhiEcal();
87  double etaAbs = std::abs(etaPhi.first);
88  double coneSize_ = (etaAbs > 1.5) ? coneSizeEta1_ : (coneSizeEta0_*(1.5-etaAbs)+coneSizeEta1_*etaAbs)/1.5;
89 #ifdef DebugLog
90  edm::LogInfo("HcalIsoTrack") << "Track: eta/phi " << etaPhi.first << "/" << etaPhi.second << " pt:" << isoPixTrackRefs[p]->track()->pt() << " cone " << coneSize_ << "\n" << "rechit size EB/EE : " << ecalEB->size() << "/" << ecalEE->size() << " coneSize_: " << coneSize_;
91 #endif
92  if (etaAbs<1.7) {
93  for (EcalRecHitCollection::const_iterator eItr=ecalEB->begin(); eItr!=ecalEB->end(); eItr++) {
94  GlobalPoint pos = geo->getPosition(eItr->detid());
95  double R = reco::deltaR(pos.eta(),pos.phi(),etaPhi.first,etaPhi.second);
96  if (R < coneSize_) {
97  nhitIn++;
98  inEnergy += (eItr->energy());
99  if (eItr->energy() > hitCountEthr_) nhitOut++;
100  if (eItr->energy() > hitEthr_) outEnergy += (eItr->energy());
101 #ifdef DebugLog
102  edm::LogInfo("HcalIsoTrack") << "Rechit Close to the track has energy " << eItr->energy() << " eta/phi: " << pos.eta() << "/" << pos.phi() << " deltaR: " << R;
103 #endif
104  }
105  }
106  }
107  if (etaAbs>1.25) {
108  for (EcalRecHitCollection::const_iterator eItr=ecalEE->begin(); eItr!=ecalEE->end(); eItr++) {
109  GlobalPoint pos = geo->getPosition(eItr->detid());
110  double R = reco::deltaR(pos.eta(),pos.phi(),etaPhi.first,etaPhi.second);
111  if (R < coneSize_) {
112  nhitIn++;
113  inEnergy += (eItr->energy());
114  if (eItr->energy() > hitCountEthr_) nhitOut++;
115  if (eItr->energy() > hitEthr_) outEnergy += (eItr->energy());
116 #ifdef DebugLog
117  edm::LogInfo("HcalIsoTrack") << "Rechit Close to the track has energy " << eItr->energy() << " eta/phi: " << pos.eta() << "/" << pos.phi() << " deltaR: " << R;
118 #endif
119  }
120  }
121  }
122 #ifdef DebugLog
123  edm::LogInfo("HcalIsoTrack") << "nhitIn:" << nhitIn << " inEnergy:" << inEnergy << " nhitOut:" << nhitOut << " outEnergy:" << outEnergy;
124 #endif
125  reco::IsolatedPixelTrackCandidate newca(*isoPixTrackRefs[p]);
126  newca.setEnergyIn(inEnergy);
127  newca.setEnergyOut(outEnergy);
128  newca.setNHitIn(nhitIn);
129  newca.setNHitOut(nhitOut);
130  iptcCollection->push_back(newca);
131  }
132 #ifdef DebugLog
133  edm::LogInfo("HcalIsoTrack") << "ncand:" << nCand << " outcollction size:" << iptcCollection->size();
134 #endif
135  std::auto_ptr<reco::IsolatedPixelTrackCandidateCollection> outCollection(iptcCollection);
136  iEvent.put(outCollection);
137 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< EcalRecHit >::const_iterator const_iterator
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
T eta() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
std::vector< IsolatedPixelTrackCandidate > IsolatedPixelTrackCandidateCollection
collectin of IsolatedPixelTrackCandidate objects
bool isValid() const
Definition: HandleBase.h:75
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
T eta() const
Definition: PV3DBase.h:76
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_trigcand
Definition: DDAxes.h:10

Member Data Documentation

double IsolatedEcalPixelTrackCandidateProducer::coneSizeEta0_
private
double IsolatedEcalPixelTrackCandidateProducer::coneSizeEta1_
private
double IsolatedEcalPixelTrackCandidateProducer::hitCountEthr_
private
double IsolatedEcalPixelTrackCandidateProducer::hitEthr_
private
edm::EDGetTokenT<EcalRecHitCollection> IsolatedEcalPixelTrackCandidateProducer::tok_eb
private
edm::EDGetTokenT<EcalRecHitCollection> IsolatedEcalPixelTrackCandidateProducer::tok_ee
private
edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> IsolatedEcalPixelTrackCandidateProducer::tok_trigcand
private