CMS 3D CMS Logo

ElectronSqPtTkIsolationProducer.cc
Go to the documentation of this file.
7 
11 
14 
16  // use configuration file to setup input/output collection names
17  electronProducer_ = conf_.getParameter<edm::InputTag>("electronProducer");
18 
19  trackProducer_ = conf_.getParameter<edm::InputTag>("trackProducer");
20 
21  ptMin_ = conf_.getParameter<double>("ptMin");
22  intRadius_ = conf_.getParameter<double>("intRadius");
23  extRadius_ = conf_.getParameter<double>("extRadius");
24  maxVtxDist_ = conf_.getParameter<double>("maxVtxDist");
25 
26  absolut_ = conf_.getParameter<bool>("absolut");
27 
28  //register your products
29  produces<reco::CandViewDoubleAssociations>();
30 }
31 
33 
35  // Get the filtered objects
37  iEvent.getByLabel(electronProducer_, electronHandle);
38 
39  //get the tracks
41  iEvent.getByLabel(trackProducer_, tracks);
42  const reco::TrackCollection* trackCollection = tracks.product();
43 
46 
48 
49  for (unsigned int i = 0; i < electronHandle->size(); ++i) {
50  double isoValue = myTkIsolation.getPtTracks(&(electronHandle->at(i)));
51  if (absolut_ == true) {
52  isoMap->setValue(i, isoValue);
53  } else {
54  reco::SuperClusterRef sc = (electronHandle->at(i)).superCluster();
55  double et = sc.get()->energy() * sin(2 * atan(exp(-sc.get()->eta())));
56  isoMap->setValue(i, isoValue / et);
57  }
58  }
59 
60  std::unique_ptr<reco::CandViewDoubleAssociations> isolMap(isoMap);
61  iEvent.put(std::move(isolMap));
62 }
edm::RefProd
Definition: EDProductfwd.h:25
Handle.h
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
ElectronSqPtTkIsolationProducer::~ElectronSqPtTkIsolationProducer
~ElectronSqPtTkIsolationProducer() override
Definition: ElectronSqPtTkIsolationProducer.cc:32
ElectronSqPtTkIsolationProducer::conf_
edm::ParameterSet conf_
Definition: ElectronSqPtTkIsolationProducer.h:30
ESHandle.h
ElectronSqPtTkIsolation.h
reco::CandViewDoubleAssociations
edm::AssociationVector< CandidateBaseRefProd, std::vector< double > > CandViewDoubleAssociations
Definition: CandAssociation.h:36
ElectronSqPtTkIsolationProducer.h
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
edm::Handle< reco::GsfElectronCollection >
edm::Ref< SuperClusterCollection >
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
CandidateFwd.h
config
Definition: config.py:1
ElectronSqPtTkIsolationProducer::electronProducer_
edm::InputTag electronProducer_
Definition: ElectronSqPtTkIsolationProducer.h:20
edm::AssociationVector::setValue
void setValue(size_type i, typename CVal::value_type const &val)
Definition: AssociationVector.h:216
ElectronSqPtTkIsolationProducer::ElectronSqPtTkIsolationProducer
ElectronSqPtTkIsolationProducer(const edm::ParameterSet &)
Definition: ElectronSqPtTkIsolationProducer.cc:15
edm::AssociationVector
Definition: AssociationVector.h:67
ElectronSqPtTkIsolationProducer::ptMin_
double ptMin_
Definition: ElectronSqPtTkIsolationProducer.h:23
GsfElectronFwd.h
edm::ParameterSet
Definition: ParameterSet.h:36
CandAssociation.h
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
Event.h
ElectronSqPtTkIsolationProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: ElectronSqPtTkIsolationProducer.cc:34
iEvent
int iEvent
Definition: GenABIO.cc:224
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
ElectronSqPtTkIsolationProducer::trackProducer_
edm::InputTag trackProducer_
Definition: ElectronSqPtTkIsolationProducer.h:21
edm::EventSetup
Definition: EventSetup.h:57
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ElectronSqPtTkIsolationProducer::extRadius_
double extRadius_
Definition: ElectronSqPtTkIsolationProducer.h:25
eostools.move
def move(src, dest)
Definition: eostools.py:511
ElectronSqPtTkIsolationProducer::absolut_
bool absolut_
Definition: ElectronSqPtTkIsolationProducer.h:28
ElectronSqPtTkIsolationProducer::intRadius_
double intRadius_
Definition: ElectronSqPtTkIsolationProducer.h:24
ElectronSqPtTkIsolation::getPtTracks
double getPtTracks(const reco::GsfElectron *) const
Definition: ElectronSqPtTkIsolation.cc:60
EventSetup.h
Exception.h
ElectronSqPtTkIsolation
Definition: ElectronSqPtTkIsolation.h:16
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
edm::Event
Definition: Event.h:73
ElectronSqPtTkIsolationProducer::maxVtxDist_
double maxVtxDist_
Definition: ElectronSqPtTkIsolationProducer.h:26
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::RefToBaseProd
Definition: RefToBase.h:65