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 ()
 
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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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::EDGetTokenT
< EcalRecHitCollection
barrelecalCollection_
 
edm::EDGetTokenT< edm::View
< reco::CaloCluster > > 
bcBarrelCollection_
 
edm::EDGetTokenT< edm::View
< reco::CaloCluster > > 
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::EDGetTokenT
< EcalRecHitCollection
endcapecalCollection_
 
std::vector< int > flagsexclEB_
 
std::vector< int > flagsexclEE_
 
edm::EDGetTokenT
< CaloTowerCollection
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::EDGetTokenT< edm::View
< reco::CaloCluster > > 
scHybridBarrelProducer_
 
edm::EDGetTokenT< edm::View
< reco::CaloCluster > > 
scIslandEndcapProducer_
 
std::vector< int > severitiesexclEB_
 
std::vector< int > severitiesexclEE_
 
edm::ESHandle< CaloGeometrytheCaloGeom_
 
InOutConversionSeedFindertheInOutSeedFinder_
 
InOutConversionTrackFindertheInOutTrackFinder_
 
const NavigationSchooltheNavigationSchool_
 
OutInConversionSeedFindertheOutInSeedFinder_
 
OutInConversionTrackFindertheOutInTrackFinder_
 
edm::ESHandle< TrajectoryBuildertheTrajectoryBuilder_
 
std::string trajectoryBuilderName_
 
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
 
- 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

Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 41 of file ConversionTrackCandidateProducer.h.

Constructor & Destructor Documentation

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

Definition at line 48 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, trajectoryBuilderName_, useNumXtals_, and vetoClusteredHits_.

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

Definition at line 137 of file ConversionTrackCandidateProducer.cc.

137 {}

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 151 of file ConversionTrackCandidateProducer.cc.

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

151  {
152 
154  theEventSetup.get<NavigationSchoolRecord>().get("SimpleNavigationSchool", nav);
156 
157  // get the Out In Seed Finder
159 
160  // get the Out In Track Finder
161  theOutInTrackFinder_ = new OutInConversionTrackFinder ( theEventSetup, conf_ );
162 
163 
164  // get the In Out Seed Finder
166 
167 
168  // get the In Out Track Finder
169  theInOutTrackFinder_ = new InOutConversionTrackFinder ( theEventSetup, conf_ );
170 }
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 339 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().

353 {
354 
355  // std::cout << "ConversionTrackCandidateProducer builcollections bc size " << bcHandle->size() << "\n";
356  //const CaloGeometry* geometry = theCaloGeom_.product();
357 
358  // Loop over SC in the barrel and reconstruct converted photons
359  for (unsigned i = 0; i < scHandle->size(); ++i ) {
360 
361  reco::CaloClusterPtr aClus= scHandle->ptrAt(i);
362 
363  // preselection based in Et and H/E cut.
364  if (aClus->energy()/cosh(aClus->eta()) <= minSCEt_) continue;
365  if (aClus->eta() > 1.479 && aClus->eta() < 1.556 ) continue;
366 
367  const reco::CaloCluster* pClus=&(*aClus);
368  const reco::SuperCluster* sc=dynamic_cast<const reco::SuperCluster*>(pClus);
369  double scEt = sc->energy()/cosh(sc->eta());
370  const CaloTowerCollection* hcalTowersColl = hcalTowersHandle.product();
371  EgammaTowerIsolation towerIso(hOverEConeSize_,0.,0.,-1,hcalTowersColl) ;
372  double HoE = towerIso.getTowerESum(sc)/sc->energy();
373  if (HoE >= maxHOverE_) continue;
374 
378  isoEtaSlice_,
379  isoEtMin_,
380  isoEMin_,
381  theCaloGeom_,
382  &(*ecalRecHits),
383  sevLevel,
384  DetId::Ecal);
385 
386  ecalIso.setVetoClustered(vetoClusteredHits_);
387  ecalIso.setUseNumCrystals(useNumXtals_);
388  if (isBarrel) {
389  ecalIso.doFlagChecks(flagsexclEB_);
390  ecalIso.doSeverityChecks(ecalRecHitHandle.product(), severitiesexclEB_);
391  } else {
392  ecalIso.doFlagChecks(flagsexclEE_);
393  ecalIso.doSeverityChecks(ecalRecHitHandle.product(), severitiesexclEE_);
394  }
395 
396  double ecalIsolation = ecalIso.getEtSum(sc);
397  if ( ecalIsolation > ecalIsoCut_offset_ + ecalIsoCut_slope_*scEt ) continue;
398 
399  // Now launch the seed finding
400  theOutInSeedFinder_->setCandidate(pClus->energy(), GlobalPoint(pClus->position().x(),pClus->position().y(),pClus->position().z() ) );
401  theOutInSeedFinder_->makeSeeds( bcHandle );
402 
403  std::vector<Trajectory> theOutInTracks= theOutInTrackFinder_->tracks(theOutInSeedFinder_->seeds(), outInTrackCandidates);
404 
405  theInOutSeedFinder_->setCandidate(pClus->energy(), GlobalPoint(pClus->position().x(),pClus->position().y(),pClus->position().z() ) );
406  theInOutSeedFinder_->setTracks( theOutInTracks );
407  theInOutSeedFinder_->makeSeeds( bcHandle);
408 
409  std::vector<Trajectory> theInOutTracks= theInOutTrackFinder_->tracks(theInOutSeedFinder_->seeds(), inOutTrackCandidates);
410 
411  // Debug
412  // 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";
413 
414 
416  for (std::vector<Trajectory>::const_iterator it = theOutInTracks.begin(); it != theOutInTracks.end(); ++it) {
417  caloPtrVecOutIn_.push_back(aClus);
418  // std::cout << "ConversionTrackCandidateProducer Barrel OutIn Tracks Number of hits " << (*it).foundHits() << "\n";
419  }
420 
421  for (std::vector<Trajectory>::const_iterator it = theInOutTracks.begin(); it != theInOutTracks.end(); ++it) {
422  caloPtrVecInOut_.push_back(aClus);
423  // std::cout << "ConversionTrackCandidateProducer Barrel InOut Tracks Number of hits " << (*it).foundHits() << "\n";
424  }
425  }
426 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:124
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:161
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:81
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 173 of file ConversionTrackCandidateProducer.cc.

References theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, and theOutInTrackFinder_.

173  {
174  delete theOutInSeedFinder_;
175  delete theOutInTrackFinder_;
176  delete theInOutSeedFinder_;
177  delete theInOutTrackFinder_;
178 }
void ConversionTrackCandidateProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
virtual

Implements edm::EDProducer.

Definition at line 183 of file ConversionTrackCandidateProducer.cc.

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

183  {
184 
185  using namespace edm;
186  nEvt_++;
187  // std::cout << "ConversionTrackCandidateProducer Analyzing event number " << theEvent.id() << " Global Counter " << nEvt_ << "\n";
188 
189 
190 
191  setEventSetup( theEventSetup );
192 
193  // get the trajectory builder and initialize it with the data
196  theEvent.getByLabel(edm::InputTag("MeasurementTrackerEvent"), data);
197  std::auto_ptr<BaseCkfTrajectoryBuilder> trajectoryBuilder;
198  trajectoryBuilder.reset((dynamic_cast<const BaseCkfTrajectoryBuilder &>(*theTrajectoryBuilder_)).clone(&*data));
199 
200  theOutInSeedFinder_->setEvent(theEvent);
201  theInOutSeedFinder_->setEvent(theEvent);
202  theOutInTrackFinder_->setTrajectoryBuilder(*trajectoryBuilder);
203  theInOutTrackFinder_->setTrajectoryBuilder(*trajectoryBuilder);
204 
205 // Set the navigation school
207 
208  //
209  // create empty output collections
210  //
211  // Out In Track Candidates
212  std::auto_ptr<TrackCandidateCollection> outInTrackCandidate_p(new TrackCandidateCollection);
213  // In Out Track Candidates
214  std::auto_ptr<TrackCandidateCollection> inOutTrackCandidate_p(new TrackCandidateCollection);
215  // Track Candidate calo Cluster Association
216  std::auto_ptr<reco::TrackCandidateCaloClusterPtrAssociation> outInAssoc_p(new reco::TrackCandidateCaloClusterPtrAssociation);
217  std::auto_ptr<reco::TrackCandidateCaloClusterPtrAssociation> inOutAssoc_p(new reco::TrackCandidateCaloClusterPtrAssociation);
218 
219  // Get the basic cluster collection in the Barrel
220  bool validBarrelBCHandle=true;
222  theEvent.getByToken(bcBarrelCollection_, bcBarrelHandle);
223  if (!bcBarrelHandle.isValid()) {
224  edm::LogError("ConversionTrackCandidateProducer")
225  << "Error! Can't get the Barrel Basic Clusters!";
226  validBarrelBCHandle=false;
227  }
228 
229 
230  // Get the basic cluster collection in the Endcap
231  bool validEndcapBCHandle=true;
233  theEvent.getByToken(bcEndcapCollection_, bcEndcapHandle);
234  if (!bcEndcapHandle.isValid()) {
235  edm::LogError("CoonversionTrackCandidateProducer")
236  << "Error! Can't get the Endcap Basic Clusters";
237  validEndcapBCHandle=false;
238  }
239 
240 
241 
242  // Get the Super Cluster collection in the Barrel
243  bool validBarrelSCHandle=true;
245  theEvent.getByToken(scHybridBarrelProducer_,scBarrelHandle);
246  if (!scBarrelHandle.isValid()) {
247  edm::LogError("CoonversionTrackCandidateProducer")
248  << "Error! Can't get the barrel superclusters!";
249  validBarrelSCHandle=false;
250  }
251 
252 
253  // Get the Super Cluster collection in the Endcap
254  bool validEndcapSCHandle=true;
256  theEvent.getByToken(scIslandEndcapProducer_,scEndcapHandle);
257  if (!scEndcapHandle.isValid()) {
258  edm::LogError("CoonversionTrackCandidateProducer")
259  << "Error! Can't get the endcap superclusters!";
260  validEndcapSCHandle=false;
261  }
262 
263 
264  // get the geometry from the event setup:
265  theEventSetup.get<CaloGeometryRecord>().get(theCaloGeom_);
266 
267  // get Hcal towers collection
268  Handle<CaloTowerCollection> hcalTowersHandle;
269  theEvent.getByToken(hcalTowers_, hcalTowersHandle);
270 
271  edm::Handle<EcalRecHitCollection> ecalhitsCollEB;
272  edm::Handle<EcalRecHitCollection> ecalhitsCollEE;
273 
274  theEvent.getByToken(endcapecalCollection_, ecalhitsCollEE);
275  theEvent.getByToken(barrelecalCollection_, ecalhitsCollEB);
276 
278  theEventSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
279  const EcalSeverityLevelAlgo* sevLevel = sevlv.product();
280 
281  std::auto_ptr<CaloRecHitMetaCollectionV> RecHitsEE(0);
282  RecHitsEE = std::auto_ptr<CaloRecHitMetaCollectionV>(new EcalRecHitMetaCollection(ecalhitsCollEE.product()));
283 
284  std::auto_ptr<CaloRecHitMetaCollectionV> RecHitsEB(0);
285  RecHitsEB = std::auto_ptr<CaloRecHitMetaCollectionV>(new EcalRecHitMetaCollection(ecalhitsCollEB.product()));
286 
287 
288  caloPtrVecOutIn_.clear();
289  caloPtrVecInOut_.clear();
290 
291  bool isBarrel=true;
292  if ( validBarrelBCHandle && validBarrelSCHandle )
293  buildCollections(isBarrel, scBarrelHandle, bcBarrelHandle, ecalhitsCollEB, &(*RecHitsEB), sevLevel, hcalTowersHandle, *outInTrackCandidate_p, *inOutTrackCandidate_p, caloPtrVecOutIn_, caloPtrVecInOut_);
294 
295  if ( validEndcapBCHandle && validEndcapSCHandle ) {
296  isBarrel=false;
297  buildCollections(isBarrel, scEndcapHandle, bcEndcapHandle, ecalhitsCollEE, &(*RecHitsEE), sevLevel, hcalTowersHandle, *outInTrackCandidate_p, *inOutTrackCandidate_p, caloPtrVecOutIn_, caloPtrVecInOut_);
298  }
299 
300 
301  // std::cout << " ConversionTrackCandidateProducer caloPtrVecOutIn_ size " << caloPtrVecOutIn_.size() << " caloPtrVecInOut_ size " << caloPtrVecInOut_.size() << "\n";
302 
303 
304 
305  // put all products in the event
306  // Barrel
307  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*outInTrackCandidate_p).size() << " Out In track Candidates " << "\n";
308  const edm::OrphanHandle<TrackCandidateCollection> refprodOutInTrackC = theEvent.put( outInTrackCandidate_p, OutInTrackCandidateCollection_ );
309  //std::cout << "ConversionTrackCandidateProducer refprodOutInTrackC size " << (*(refprodOutInTrackC.product())).size() << "\n";
310  //
311  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*inOutTrackCandidate_p).size() << " In Out track Candidates " << "\n";
312  const edm::OrphanHandle<TrackCandidateCollection> refprodInOutTrackC = theEvent.put( inOutTrackCandidate_p, InOutTrackCandidateCollection_ );
313  //std::cout << "ConversionTrackCandidateProducer refprodInOutTrackC size " << (*(refprodInOutTrackC.product())).size() << "\n";
314 
315 
316  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerOI(*outInAssoc_p);
317  fillerOI.insert(refprodOutInTrackC, caloPtrVecOutIn_.begin(), caloPtrVecOutIn_.end());
318  fillerOI.fill();
319  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerIO(*inOutAssoc_p);
320  fillerIO.insert(refprodInOutTrackC, caloPtrVecInOut_.begin(), caloPtrVecInOut_.end());
321  fillerIO.fill();
322 
323 
324 
325  // std::cout << "ConversionTrackCandidateProducer Putting in the event OutIn track - SC association: size " << (*outInAssoc_p).size() << "\n";
326  theEvent.put( outInAssoc_p, OutInTrackSuperClusterAssociationCollection_);
327 
328  // std::cout << "ConversionTrackCandidateProducer Putting in the event InOut track - SC association: size " << (*inOutAssoc_p).size() << "\n";
329  theEvent.put( inOutAssoc_p, InOutTrackSuperClusterAssociationCollection_);
330 
333 
334 
335 
336 }
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
std::vector< TrackCandidate > TrackCandidateCollection
void setTrajectoryBuilder(const TrajectoryBuilder &builder)
edm::EDGetTokenT< EcalRecHitCollection > endcapecalCollection_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecInOut_
edm::ESHandle< TrajectoryBuilder > theTrajectoryBuilder_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
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_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
void setEvent(const edm::Event &e)
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
SimpleCaloRecHitMetaCollection< EcalRecHitCollection > EcalRecHitMetaCollection
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
tuple clone
Definition: statics.py:58
edm::EDGetTokenT< EcalRecHitCollection > barrelecalCollection_
void ConversionTrackCandidateProducer::setEventSetup ( const edm::EventSetup es)
private

Initialize EventSetup objects at each event.

Definition at line 139 of file ConversionTrackCandidateProducer.cc.

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

Referenced by produce().

139  {
140 
141 
142  theOutInSeedFinder_->setEventSetup(theEventSetup);
143  theInOutSeedFinder_->setEventSetup(theEventSetup);
144  theOutInTrackFinder_->setEventSetup(theEventSetup);
145  theInOutTrackFinder_->setEventSetup(theEventSetup);
146 
147 
148 }
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::EDGetTokenT<EcalRecHitCollection> ConversionTrackCandidateProducer::barrelecalCollection_
private

Definition at line 72 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

edm::EDGetTokenT<edm::View<reco::CaloCluster> > ConversionTrackCandidateProducer::bcBarrelCollection_
private

Definition at line 66 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

edm::EDGetTokenT<edm::View<reco::CaloCluster> > ConversionTrackCandidateProducer::bcEndcapCollection_
private

Definition at line 67 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 108 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and produce().

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

Definition at line 107 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::EDGetTokenT<EcalRecHitCollection> ConversionTrackCandidateProducer::endcapecalCollection_
private

Definition at line 73 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 71 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 60 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::InOutTrackSuperClusterAssociationCollection_
private

Definition at line 64 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 54 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::OutInTrackCandidateCollection_
private

Definition at line 59 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::OutInTrackSuperClusterAssociationCollection_
private

Definition at line 63 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

edm::EDGetTokenT<edm::View<reco::CaloCluster> > ConversionTrackCandidateProducer::scHybridBarrelProducer_
private

Definition at line 68 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

edm::EDGetTokenT<edm::View<reco::CaloCluster> > ConversionTrackCandidateProducer::scIslandEndcapProducer_
private

Definition at line 69 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 95 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 100 of file ConversionTrackCandidateProducer.h.

Referenced by beginRun(), and produce().

OutInConversionSeedFinder* ConversionTrackCandidateProducer::theOutInSeedFinder_
private
OutInConversionTrackFinder* ConversionTrackCandidateProducer::theOutInTrackFinder_
private
edm::ESHandle<TrajectoryBuilder> ConversionTrackCandidateProducer::theTrajectoryBuilder_
private

Definition at line 98 of file ConversionTrackCandidateProducer.h.

Referenced by produce().

std::string ConversionTrackCandidateProducer::trajectoryBuilderName_
private

Definition at line 97 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

bool ConversionTrackCandidateProducer::useNumXtals_
private
std::vector<edm::Ref<reco::SuperClusterCollection> > ConversionTrackCandidateProducer::vecOfSCRefForInOut
private

Definition at line 111 of file ConversionTrackCandidateProducer.h.

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

Definition at line 110 of file ConversionTrackCandidateProducer.h.

bool ConversionTrackCandidateProducer::vetoClusteredHits_
private