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
ConversionTrackCandidateProducer Class Reference

#include <ConversionTrackCandidateProducer.h>

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

Public Member Functions

virtual void beginRun (edm::Run const &, edm::EventSetup const &es) overridefinal
 
 ConversionTrackCandidateProducer (const edm::ParameterSet &ps)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &es) overridefinal
 
virtual void produce (edm::Event &evt, const edm::EventSetup &es)
 
 ~ConversionTrackCandidateProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
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
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void buildCollections (bool detector, const edm::Handle< edm::View< reco::CaloCluster > > &scHandle, const edm::Handle< edm::View< reco::CaloCluster > > &bcHandle, edm::Handle< EcalRecHitCollection > ecalRecHitHandle, CaloRecHitMetaCollectionV *metaEcalRecHits, const EcalSeverityLevelAlgo *sevLev, const edm::Handle< CaloTowerCollection > &hcalTowersHandle, TrackCandidateCollection &outInTracks, TrackCandidateCollection &inOutTracks, std::vector< edm::Ptr< reco::CaloCluster > > &vecRecOI, std::vector< edm::Ptr< reco::CaloCluster > > &vecRecIO)
 
void setEventSetup (const edm::EventSetup &es)
 Initialize EventSetup objects at each event. More...
 

Private Attributes

edm::InputTag barrelecalCollection_
 
edm::InputTag bcBarrelCollection_
 
edm::InputTag bcEndcapCollection_
 
std::vector< edm::Ptr
< reco::CaloCluster > > 
caloPtrVecInOut_
 
std::vector< edm::Ptr
< reco::CaloCluster > > 
caloPtrVecOutIn_
 
edm::ParameterSet conf_
 
double ecalIsoCut_offset_
 
double ecalIsoCut_slope_
 
edm::InputTag endcapecalCollection_
 
std::vector< int > flagsexclEB_
 
std::vector< int > flagsexclEE_
 
edm::InputTag hcalTowers_
 
double hOverEConeSize_
 
std::string InOutTrackCandidateCollection_
 
std::string InOutTrackSuperClusterAssociationCollection_
 
double isoConeR_
 
double isoEMin_
 
double isoEtaSlice_
 
double isoEtMin_
 
double isoInnerConeR_
 
double maxHOverE_
 
double minSCEt_
 
int nEvt_
 
std::string OutInTrackCandidateCollection_
 
std::string OutInTrackSuperClusterAssociationCollection_
 
edm::InputTag scHybridBarrelProducer_
 
edm::InputTag scIslandEndcapProducer_
 
std::vector< int > severitiesexclEB_
 
std::vector< int > severitiesexclEE_
 
edm::ESHandle< CaloGeometrytheCaloGeom_
 
InOutConversionSeedFindertheInOutSeedFinder_
 
InOutConversionTrackFindertheInOutTrackFinder_
 
const NavigationSchooltheNavigationSchool_
 
OutInConversionSeedFindertheOutInSeedFinder_
 
OutInConversionTrackFindertheOutInTrackFinder_
 
bool useNumXtals_
 
std::vector< edm::Ref
< reco::SuperClusterCollection > > 
vecOfSCRefForInOut
 
std::vector< edm::Ref
< reco::SuperClusterCollection > > 
vecOfSCRefForOutIn
 
bool vetoClusteredHits_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- 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

Id:
ConversionTrackCandidateProducer.h,v 1.19 2013/02/27 20:33:00 eulisse Exp
Date:
2013/02/27 20:33:00
Revision:
1.19
Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 43 of file ConversionTrackCandidateProducer.h.

Constructor & Destructor Documentation

ConversionTrackCandidateProducer::ConversionTrackCandidateProducer ( const edm::ParameterSet ps)

Definition at line 45 of file ConversionTrackCandidateProducer.cc.

References barrelecalCollection_, bcBarrelCollection_, bcEndcapCollection_, conf_, ecalIsoCut_offset_, ecalIsoCut_slope_, endcapecalCollection_, flagsexclEB_, flagsexclEE_, edm::ParameterSet::getParameter(), hcalTowers_, hOverEConeSize_, InOutTrackCandidateCollection_, InOutTrackSuperClusterAssociationCollection_, isoConeR_, isoEMin_, isoEtaSlice_, isoEtMin_, isoInnerConeR_, maxHOverE_, minSCEt_, nEvt_, OutInTrackCandidateCollection_, OutInTrackSuperClusterAssociationCollection_, scHybridBarrelProducer_, scIslandEndcapProducer_, severitiesexclEB_, severitiesexclEE_, AlCaHLTBitMon_QueryRunRegistry::string, useNumXtals_, and vetoClusteredHits_.

45  :
46  conf_(config),
52 {
53  //std::cout << "ConversionTrackCandidateProducer CTOR " << "\n";
54  nEvt_=0;
55 
56  // use onfiguration file to setup input/output collection names
57 
58 
59  bcBarrelCollection_ = conf_.getParameter<edm::InputTag>("bcBarrelCollection");
60  bcEndcapCollection_ = conf_.getParameter<edm::InputTag>("bcEndcapCollection");
61 
62  scHybridBarrelProducer_ = conf_.getParameter<edm::InputTag>("scHybridBarrelProducer");
63  scIslandEndcapProducer_ = conf_.getParameter<edm::InputTag>("scIslandEndcapProducer");
64 
65  OutInTrackCandidateCollection_ = conf_.getParameter<std::string>("outInTrackCandidateCollection");
66  InOutTrackCandidateCollection_ = conf_.getParameter<std::string>("inOutTrackCandidateCollection");
67 
68 
69  OutInTrackSuperClusterAssociationCollection_ = conf_.getParameter<std::string>("outInTrackCandidateSCAssociationCollection");
70  InOutTrackSuperClusterAssociationCollection_ = conf_.getParameter<std::string>("inOutTrackCandidateSCAssociationCollection");
71 
72  barrelecalCollection_ = conf_.getParameter<edm::InputTag>("barrelEcalRecHitCollection");
73  endcapecalCollection_ = conf_.getParameter<edm::InputTag>("endcapEcalRecHitCollection");
74 
76  hOverEConeSize_ = conf_.getParameter<double>("hOverEConeSize");
77  maxHOverE_ = conf_.getParameter<double>("maxHOverE");
78  minSCEt_ = conf_.getParameter<double>("minSCEt");
79  isoConeR_ = conf_.getParameter<double>("isoConeR");
80  isoInnerConeR_ = conf_.getParameter<double>("isoInnerConeR");
81  isoEtaSlice_ = conf_.getParameter<double>("isoEtaSlice");
82  isoEtMin_ = conf_.getParameter<double>("isoEtMin");
83  isoEMin_ = conf_.getParameter<double>("isoEMin");
84  vetoClusteredHits_ = conf_.getParameter<bool>("vetoClusteredHits");
85  useNumXtals_ = conf_.getParameter<bool>("useNumXstals");
86  ecalIsoCut_offset_ = conf_.getParameter<double>("ecalIsoCut_offset");
87  ecalIsoCut_slope_ = conf_.getParameter<double>("ecalIsoCut_slope");
88 
89  //Flags and Severities to be excluded from photon calculations
90  const std::vector<std::string> flagnamesEB =
91  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEB");
92 
93  const std::vector<std::string> flagnamesEE =
94  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEE");
95 
96  flagsexclEB_=
97  StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
98 
100  StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
101 
102  const std::vector<std::string> severitynamesEB =
103  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcludedEB");
104 
106  StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
107 
108  const std::vector<std::string> severitynamesEE =
109  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcludedEE");
110 
112  StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
113 
114 
115  // Register the product
116  produces< TrackCandidateCollection > (OutInTrackCandidateCollection_);
117  produces< TrackCandidateCollection > (InOutTrackCandidateCollection_);
118 
119  produces< reco::TrackCandidateCaloClusterPtrAssociation > ( OutInTrackSuperClusterAssociationCollection_);
120  produces< reco::TrackCandidateCaloClusterPtrAssociation > ( InOutTrackSuperClusterAssociationCollection_);
121 
122 
123 }
T getParameter(std::string const &) const
ConversionTrackCandidateProducer::~ConversionTrackCandidateProducer ( )

Definition at line 125 of file ConversionTrackCandidateProducer.cc.

125 {}

Member Function Documentation

void ConversionTrackCandidateProducer::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
finaloverridevirtual

Reimplemented from edm::EDProducer.

Definition at line 139 of file ConversionTrackCandidateProducer.cc.

References conf_, edm::EventSetup::get(), edm::ESHandle< class >::product(), theInOutSeedFinder_, theInOutTrackFinder_, theNavigationSchool_, theOutInSeedFinder_, and theOutInTrackFinder_.

139  {
140 
142  theEventSetup.get<NavigationSchoolRecord>().get("SimpleNavigationSchool", nav);
144 
145  // get the Out In Seed Finder
147 
148  // get the Out In Track Finder
149  theOutInTrackFinder_ = new OutInConversionTrackFinder ( theEventSetup, conf_ );
150 
151 
152  // get the In Out Seed Finder
154 
155 
156  // get the In Out Track Finder
157  theInOutTrackFinder_ = new InOutConversionTrackFinder ( theEventSetup, conf_ );
158 }
T const * product() const
Definition: ESHandle.h:62
void ConversionTrackCandidateProducer::buildCollections ( bool  detector,
const edm::Handle< edm::View< reco::CaloCluster > > &  scHandle,
const edm::Handle< edm::View< reco::CaloCluster > > &  bcHandle,
edm::Handle< EcalRecHitCollection ecalRecHitHandle,
CaloRecHitMetaCollectionV metaEcalRecHits,
const EcalSeverityLevelAlgo sevLev,
const edm::Handle< CaloTowerCollection > &  hcalTowersHandle,
TrackCandidateCollection outInTracks,
TrackCandidateCollection inOutTracks,
std::vector< edm::Ptr< reco::CaloCluster > > &  vecRecOI,
std::vector< edm::Ptr< reco::CaloCluster > > &  vecRecIO 
)
private

Definition at line 315 of file ConversionTrackCandidateProducer.cc.

References caloPtrVecInOut_, caloPtrVecOutIn_, EgammaRecHitIsolation::doFlagChecks(), EgammaRecHitIsolation::doSeverityChecks(), DetId::Ecal, ecalIsoCut_offset_, ecalIsoCut_slope_, RecoTauCleanerPlugins::ecalIsolation, reco::CaloCluster::energy(), reco::CaloCluster::eta(), flagsexclEB_, flagsexclEE_, EgammaRecHitIsolation::getEtSum(), EgammaTowerIsolation::getTowerESum(), hOverEConeSize_, i, isoConeR_, isoEMin_, isoEtaSlice_, isoEtMin_, isoInnerConeR_, OutInConversionSeedFinder::makeSeeds(), InOutConversionSeedFinder::makeSeeds(), maxHOverE_, minSCEt_, reco::CaloCluster::position(), edm::Handle< T >::product(), ConversionSeedFinder::seeds(), ConversionSeedFinder::setCandidate(), InOutConversionSeedFinder::setTracks(), EgammaRecHitIsolation::setUseNumCrystals(), EgammaRecHitIsolation::setVetoClustered(), severitiesexclEB_, severitiesexclEE_, theCaloGeom_, theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, theOutInTrackFinder_, InOutConversionTrackFinder::tracks(), OutInConversionTrackFinder::tracks(), useNumXtals_, and vetoClusteredHits_.

Referenced by produce().

329 {
330 
331  // std::cout << "ConversionTrackCandidateProducer builcollections bc size " << bcHandle->size() << "\n";
332  //const CaloGeometry* geometry = theCaloGeom_.product();
333 
334  // Loop over SC in the barrel and reconstruct converted photons
335  for (unsigned i = 0; i < scHandle->size(); ++i ) {
336 
337  reco::CaloClusterPtr aClus= scHandle->ptrAt(i);
338 
339  // preselection based in Et and H/E cut.
340  if (aClus->energy()/cosh(aClus->eta()) <= minSCEt_) continue;
341  const reco::CaloCluster* pClus=&(*aClus);
342  const reco::SuperCluster* sc=dynamic_cast<const reco::SuperCluster*>(pClus);
343  double scEt = sc->energy()/cosh(sc->eta());
344  const CaloTowerCollection* hcalTowersColl = hcalTowersHandle.product();
345  EgammaTowerIsolation towerIso(hOverEConeSize_,0.,0.,-1,hcalTowersColl) ;
346  double HoE = towerIso.getTowerESum(sc)/sc->energy();
347  if (HoE >= maxHOverE_) continue;
348 
352  isoEtaSlice_,
353  isoEtMin_,
354  isoEMin_,
355  theCaloGeom_,
356  &(*ecalRecHits),
357  sevLevel,
358  DetId::Ecal);
359 
360  ecalIso.setVetoClustered(vetoClusteredHits_);
361  ecalIso.setUseNumCrystals(useNumXtals_);
362  if (isBarrel) {
363  ecalIso.doFlagChecks(flagsexclEB_);
364  ecalIso.doSeverityChecks(ecalRecHitHandle.product(), severitiesexclEB_);
365  } else {
366  ecalIso.doFlagChecks(flagsexclEE_);
367  ecalIso.doSeverityChecks(ecalRecHitHandle.product(), severitiesexclEE_);
368  }
369 
370  double ecalIsolation = ecalIso.getEtSum(sc);
371  if ( ecalIsolation > ecalIsoCut_offset_ + ecalIsoCut_slope_*scEt ) continue;
372 
373  // Now launch the seed finding
374  theOutInSeedFinder_->setCandidate(pClus->energy(), GlobalPoint(pClus->position().x(),pClus->position().y(),pClus->position().z() ) );
375  theOutInSeedFinder_->makeSeeds( bcHandle );
376 
377  std::vector<Trajectory> theOutInTracks= theOutInTrackFinder_->tracks(theOutInSeedFinder_->seeds(), outInTrackCandidates);
378 
379  theInOutSeedFinder_->setCandidate(pClus->energy(), GlobalPoint(pClus->position().x(),pClus->position().y(),pClus->position().z() ) );
380  theInOutSeedFinder_->setTracks( theOutInTracks );
381  theInOutSeedFinder_->makeSeeds( bcHandle);
382 
383  std::vector<Trajectory> theInOutTracks= theInOutTrackFinder_->tracks(theInOutSeedFinder_->seeds(), inOutTrackCandidates);
384 
385  // Debug
386  // std::cout << "ConversionTrackCandidateProducer theOutInTracks.size() " << theOutInTracks.size() << " theInOutTracks.size() " << theInOutTracks.size() << " Event pointer to out in track size barrel " << outInTrackCandidates.size() << " in out track size " << inOutTrackCandidates.size() << "\n";
387 
388 
390  for (std::vector<Trajectory>::const_iterator it = theOutInTracks.begin(); it != theOutInTracks.end(); ++it) {
391  caloPtrVecOutIn_.push_back(aClus);
392  // std::cout << "ConversionTrackCandidateProducer Barrel OutIn Tracks Number of hits " << (*it).foundHits() << "\n";
393  }
394 
395  for (std::vector<Trajectory>::const_iterator it = theInOutTracks.begin(); it != theInOutTracks.end(); ++it) {
396  caloPtrVecInOut_.push_back(aClus);
397  // std::cout << "ConversionTrackCandidateProducer Barrel InOut Tracks Number of hits " << (*it).foundHits() << "\n";
398  }
399  }
400 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:123
int i
Definition: DBlmapReader.cc:9
void setTracks(std::vector< Trajectory > const &in)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecInOut_
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:160
virtual std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidate) const
virtual void makeSeeds(const edm::Handle< edm::View< reco::CaloCluster > > &allBc) const
double energy() const
cluster energy
Definition: CaloCluster.h:120
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecOutIn_
TrajectorySeedCollection & seeds()
virtual std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidates) const
virtual void setCandidate(float e, GlobalPoint pos) const
T const * product() const
Definition: Handle.h:74
virtual void makeSeeds(const edm::Handle< edm::View< reco::CaloCluster > > &allBc) const
void ConversionTrackCandidateProducer::endRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
finaloverridevirtual

Reimplemented from edm::EDProducer.

Definition at line 161 of file ConversionTrackCandidateProducer.cc.

References theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, and theOutInTrackFinder_.

161  {
162  delete theOutInSeedFinder_;
163  delete theOutInTrackFinder_;
164  delete theInOutSeedFinder_;
165  delete theInOutTrackFinder_;
166 }
void ConversionTrackCandidateProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
virtual

Implements edm::EDProducer.

Definition at line 171 of file ConversionTrackCandidateProducer.cc.

References barrelecalCollection_, bcBarrelCollection_, bcEndcapCollection_, buildCollections(), caloPtrVecInOut_, caloPtrVecOutIn_, ConversionSeedFinder::clear(), endcapecalCollection_, edm::helper::Filler< Map >::fill(), edm::EventSetup::get(), edm::Event::getByLabel(), hcalTowers_, InOutTrackCandidateCollection_, InOutTrackSuperClusterAssociationCollection_, edm::helper::Filler< Map >::insert(), edm::InputTag::label(), nEvt_, OutInTrackCandidateCollection_, OutInTrackSuperClusterAssociationCollection_, edm::Event::put(), scHybridBarrelProducer_, scIslandEndcapProducer_, ConversionTrackFinder::setEvent(), ConversionSeedFinder::setEvent(), setEventSetup(), theCaloGeom_, theInOutSeedFinder_, theInOutTrackFinder_, theNavigationSchool_, theOutInSeedFinder_, and theOutInTrackFinder_.

171  {
172 
173  using namespace edm;
174  nEvt_++;
175  // std::cout << "ConversionTrackCandidateProducer Analyzing event number " << theEvent.id() << " Global Counter " << nEvt_ << "\n";
176 
177 
178 
179  setEventSetup( theEventSetup );
180  theOutInSeedFinder_->setEvent(theEvent);
181  theInOutSeedFinder_->setEvent(theEvent);
182  theOutInTrackFinder_->setEvent(theEvent);
183  theInOutTrackFinder_->setEvent(theEvent);
184 
185 // Set the navigation school
187 
188  //
189  // create empty output collections
190  //
191  // Out In Track Candidates
192  std::auto_ptr<TrackCandidateCollection> outInTrackCandidate_p(new TrackCandidateCollection);
193  // In Out Track Candidates
194  std::auto_ptr<TrackCandidateCollection> inOutTrackCandidate_p(new TrackCandidateCollection);
195  // Track Candidate calo Cluster Association
196  std::auto_ptr<reco::TrackCandidateCaloClusterPtrAssociation> outInAssoc_p(new reco::TrackCandidateCaloClusterPtrAssociation);
197  std::auto_ptr<reco::TrackCandidateCaloClusterPtrAssociation> inOutAssoc_p(new reco::TrackCandidateCaloClusterPtrAssociation);
198 
199  // Get the basic cluster collection in the Barrel
200  bool validBarrelBCHandle=true;
202  theEvent.getByLabel(bcBarrelCollection_, bcBarrelHandle);
203  if (!bcBarrelHandle.isValid()) {
204  edm::LogError("ConversionTrackCandidateProducer") << "Error! Can't get the product "<<bcBarrelCollection_.label();
205  validBarrelBCHandle=false;
206  }
207 
208 
209  // Get the basic cluster collection in the Endcap
210  bool validEndcapBCHandle=true;
212  theEvent.getByLabel(bcEndcapCollection_, bcEndcapHandle);
213  if (!bcEndcapHandle.isValid()) {
214  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the product "<<bcEndcapCollection_.label();
215  validEndcapBCHandle=false;
216  }
217 
218 
219 
220  // Get the Super Cluster collection in the Barrel
221  bool validBarrelSCHandle=true;
223  theEvent.getByLabel(scHybridBarrelProducer_,scBarrelHandle);
224  if (!scBarrelHandle.isValid()) {
225  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the product "<<scHybridBarrelProducer_.label();
226  validBarrelSCHandle=false;
227  }
228 
229 
230  // Get the Super Cluster collection in the Endcap
231  bool validEndcapSCHandle=true;
233  theEvent.getByLabel(scIslandEndcapProducer_,scEndcapHandle);
234  if (!scEndcapHandle.isValid()) {
235  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the product "<<scIslandEndcapProducer_.label();
236  validEndcapSCHandle=false;
237  }
238 
239 
240  // get the geometry from the event setup:
241  theEventSetup.get<CaloGeometryRecord>().get(theCaloGeom_);
242 
243  // get Hcal towers collection
244  Handle<CaloTowerCollection> hcalTowersHandle;
245  theEvent.getByLabel(hcalTowers_, hcalTowersHandle);
246 
247  edm::Handle<EcalRecHitCollection> ecalhitsCollEB;
248  edm::Handle<EcalRecHitCollection> ecalhitsCollEE;
249 
250  theEvent.getByLabel(endcapecalCollection_, ecalhitsCollEE);
251  theEvent.getByLabel(barrelecalCollection_, ecalhitsCollEB);
252 
254  theEventSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
255  const EcalSeverityLevelAlgo* sevLevel = sevlv.product();
256 
257  std::auto_ptr<CaloRecHitMetaCollectionV> RecHitsEE(0);
258  RecHitsEE = std::auto_ptr<CaloRecHitMetaCollectionV>(new EcalRecHitMetaCollection(ecalhitsCollEE.product()));
259 
260  std::auto_ptr<CaloRecHitMetaCollectionV> RecHitsEB(0);
261  RecHitsEB = std::auto_ptr<CaloRecHitMetaCollectionV>(new EcalRecHitMetaCollection(ecalhitsCollEB.product()));
262 
263 
264  caloPtrVecOutIn_.clear();
265  caloPtrVecInOut_.clear();
266 
267  bool isBarrel=true;
268  if ( validBarrelBCHandle && validBarrelSCHandle )
269  buildCollections(isBarrel, scBarrelHandle, bcBarrelHandle, ecalhitsCollEB, &(*RecHitsEB), sevLevel, hcalTowersHandle, *outInTrackCandidate_p, *inOutTrackCandidate_p, caloPtrVecOutIn_, caloPtrVecInOut_);
270 
271  if ( validEndcapBCHandle && validEndcapSCHandle ) {
272  isBarrel=false;
273  buildCollections(isBarrel, scEndcapHandle, bcEndcapHandle, ecalhitsCollEE, &(*RecHitsEE), sevLevel, hcalTowersHandle, *outInTrackCandidate_p, *inOutTrackCandidate_p, caloPtrVecOutIn_, caloPtrVecInOut_);
274  }
275 
276 
277  // std::cout << " ConversionTrackCandidateProducer caloPtrVecOutIn_ size " << caloPtrVecOutIn_.size() << " caloPtrVecInOut_ size " << caloPtrVecInOut_.size() << "\n";
278 
279 
280 
281  // put all products in the event
282  // Barrel
283  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*outInTrackCandidate_p).size() << " Out In track Candidates " << "\n";
284  const edm::OrphanHandle<TrackCandidateCollection> refprodOutInTrackC = theEvent.put( outInTrackCandidate_p, OutInTrackCandidateCollection_ );
285  //std::cout << "ConversionTrackCandidateProducer refprodOutInTrackC size " << (*(refprodOutInTrackC.product())).size() << "\n";
286  //
287  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*inOutTrackCandidate_p).size() << " In Out track Candidates " << "\n";
288  const edm::OrphanHandle<TrackCandidateCollection> refprodInOutTrackC = theEvent.put( inOutTrackCandidate_p, InOutTrackCandidateCollection_ );
289  //std::cout << "ConversionTrackCandidateProducer refprodInOutTrackC size " << (*(refprodInOutTrackC.product())).size() << "\n";
290 
291 
292  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerOI(*outInAssoc_p);
293  fillerOI.insert(refprodOutInTrackC, caloPtrVecOutIn_.begin(), caloPtrVecOutIn_.end());
294  fillerOI.fill();
295  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerIO(*inOutAssoc_p);
296  fillerIO.insert(refprodInOutTrackC, caloPtrVecInOut_.begin(), caloPtrVecInOut_.end());
297  fillerIO.fill();
298 
299 
300 
301  // std::cout << "ConversionTrackCandidateProducer Putting in the event OutIn track - SC association: size " << (*outInAssoc_p).size() << "\n";
302  theEvent.put( outInAssoc_p, OutInTrackSuperClusterAssociationCollection_);
303 
304  // std::cout << "ConversionTrackCandidateProducer Putting in the event InOut track - SC association: size " << (*inOutAssoc_p).size() << "\n";
305  theEvent.put( inOutAssoc_p, InOutTrackSuperClusterAssociationCollection_);
306 
309 
310 
311 
312 }
std::vector< TrackCandidate > TrackCandidateCollection
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecInOut_
void setEvent(const edm::Event &e)
void buildCollections(bool detector, const edm::Handle< edm::View< reco::CaloCluster > > &scHandle, const edm::Handle< edm::View< reco::CaloCluster > > &bcHandle, edm::Handle< EcalRecHitCollection > ecalRecHitHandle, CaloRecHitMetaCollectionV *metaEcalRecHits, const EcalSeverityLevelAlgo *sevLev, const edm::Handle< CaloTowerCollection > &hcalTowersHandle, TrackCandidateCollection &outInTracks, TrackCandidateCollection &inOutTracks, std::vector< edm::Ptr< reco::CaloCluster > > &vecRecOI, std::vector< edm::Ptr< reco::CaloCluster > > &vecRecIO)
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecOutIn_
void setEvent(const edm::Event &e)
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
std::string const & label() const
Definition: InputTag.h:42
SimpleCaloRecHitMetaCollection< EcalRecHitCollection > EcalRecHitMetaCollection
void ConversionTrackCandidateProducer::setEventSetup ( const edm::EventSetup es)
private

Initialize EventSetup objects at each event.

Definition at line 127 of file ConversionTrackCandidateProducer.cc.

References ConversionTrackFinder::setEventSetup(), ConversionSeedFinder::setEventSetup(), theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, and theOutInTrackFinder_.

Referenced by produce().

127  {
128 
129 
130  theOutInSeedFinder_->setEventSetup(theEventSetup);
131  theInOutSeedFinder_->setEventSetup(theEventSetup);
132  theOutInTrackFinder_->setEventSetup(theEventSetup);
133  theInOutTrackFinder_->setEventSetup(theEventSetup);
134 
135 
136 }
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.

Member Data Documentation

edm::InputTag ConversionTrackCandidateProducer::barrelecalCollection_
private

Definition at line 74 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

edm::InputTag ConversionTrackCandidateProducer::bcBarrelCollection_
private

Definition at line 68 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

edm::InputTag ConversionTrackCandidateProducer::bcEndcapCollection_
private

Definition at line 69 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::vector<edm::Ptr<reco::CaloCluster> > ConversionTrackCandidateProducer::caloPtrVecInOut_
private

Definition at line 107 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and produce().

std::vector<edm::Ptr<reco::CaloCluster> > ConversionTrackCandidateProducer::caloPtrVecOutIn_
private

Definition at line 106 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and produce().

edm::ParameterSet ConversionTrackCandidateProducer::conf_
private
double ConversionTrackCandidateProducer::ecalIsoCut_offset_
private
double ConversionTrackCandidateProducer::ecalIsoCut_slope_
private
edm::InputTag ConversionTrackCandidateProducer::endcapecalCollection_
private

Definition at line 75 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::vector<int> ConversionTrackCandidateProducer::flagsexclEB_
private
std::vector<int> ConversionTrackCandidateProducer::flagsexclEE_
private
edm::InputTag ConversionTrackCandidateProducer::hcalTowers_
private

Definition at line 73 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

double ConversionTrackCandidateProducer::hOverEConeSize_
private
std::string ConversionTrackCandidateProducer::InOutTrackCandidateCollection_
private

Definition at line 62 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::InOutTrackSuperClusterAssociationCollection_
private

Definition at line 66 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

double ConversionTrackCandidateProducer::isoConeR_
private
double ConversionTrackCandidateProducer::isoEMin_
private
double ConversionTrackCandidateProducer::isoEtaSlice_
private
double ConversionTrackCandidateProducer::isoEtMin_
private
double ConversionTrackCandidateProducer::isoInnerConeR_
private
double ConversionTrackCandidateProducer::maxHOverE_
private
double ConversionTrackCandidateProducer::minSCEt_
private
int ConversionTrackCandidateProducer::nEvt_
private

Definition at line 56 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::OutInTrackCandidateCollection_
private

Definition at line 61 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::OutInTrackSuperClusterAssociationCollection_
private

Definition at line 65 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

edm::InputTag ConversionTrackCandidateProducer::scHybridBarrelProducer_
private

Definition at line 70 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

edm::InputTag ConversionTrackCandidateProducer::scIslandEndcapProducer_
private

Definition at line 71 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::vector<int> ConversionTrackCandidateProducer::severitiesexclEB_
private
std::vector<int> ConversionTrackCandidateProducer::severitiesexclEE_
private
edm::ESHandle<CaloGeometry> ConversionTrackCandidateProducer::theCaloGeom_
private

Definition at line 97 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and produce().

InOutConversionSeedFinder* ConversionTrackCandidateProducer::theInOutSeedFinder_
private
InOutConversionTrackFinder* ConversionTrackCandidateProducer::theInOutTrackFinder_
private
const NavigationSchool* ConversionTrackCandidateProducer::theNavigationSchool_
private

Definition at line 99 of file ConversionTrackCandidateProducer.h.

Referenced by beginRun(), and produce().

OutInConversionSeedFinder* ConversionTrackCandidateProducer::theOutInSeedFinder_
private
OutInConversionTrackFinder* ConversionTrackCandidateProducer::theOutInTrackFinder_
private
bool ConversionTrackCandidateProducer::useNumXtals_
private
std::vector<edm::Ref<reco::SuperClusterCollection> > ConversionTrackCandidateProducer::vecOfSCRefForInOut
private

Definition at line 110 of file ConversionTrackCandidateProducer.h.

std::vector<edm::Ref<reco::SuperClusterCollection> > ConversionTrackCandidateProducer::vecOfSCRefForOutIn
private

Definition at line 109 of file ConversionTrackCandidateProducer.h.

bool ConversionTrackCandidateProducer::vetoClusteredHits_
private