CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ConversionTrackCandidateProducer Class Reference

#include <ConversionTrackCandidateProducer.h>

Inheritance diagram for ConversionTrackCandidateProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &es) final
 
 ConversionTrackCandidateProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~ConversionTrackCandidateProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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, const EcalRecHitCollection &ecalRecHits, 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< EcalRecHitCollectionbarrelecalCollection_
 
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_
 
double ecalIsoCut_offset_
 
double ecalIsoCut_slope_
 
edm::EDGetTokenT< EcalRecHitCollectionendcapecalCollection_
 
std::vector< int > flagsexclEB_
 
std::vector< int > flagsexclEE_
 
edm::EDGetTokenT< CaloTowerCollectionhcalTowers_
 
double hOverEConeSize_
 
std::string InOutTrackCandidateCollection_
 
std::string InOutTrackSuperClusterAssociationCollection_
 
double isoConeR_
 
double isoEMin_
 
double isoEtaSlice_
 
double isoEtMin_
 
double isoInnerConeR_
 
double maxHOverE_
 
edm::EDGetTokenT< MeasurementTrackerEventmeasurementTrkEvtToken_
 
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_
 
std::unique_ptr< InOutConversionSeedFindertheInOutSeedFinder_
 
std::unique_ptr< InOutConversionTrackFindertheInOutTrackFinder_
 
std::unique_ptr< OutInConversionSeedFindertheOutInSeedFinder_
 
std::unique_ptr< OutInConversionTrackFindertheOutInTrackFinder_
 
std::unique_ptr< BaseCkfTrajectoryBuildertheTrajectoryBuilder_
 
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::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 38 of file ConversionTrackCandidateProducer.h.

Constructor & Destructor Documentation

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

Definition at line 55 of file ConversionTrackCandidateProducer.cc.

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

56  : theTrajectoryBuilder_(createBaseCkfTrajectoryBuilder(
57  config.getParameter<edm::ParameterSet>("TrajectoryBuilderPSet"), consumesCollector())),
58  theOutInSeedFinder_(new OutInConversionSeedFinder(config, consumesCollector())),
60  theInOutSeedFinder_(new InOutConversionSeedFinder(config, consumesCollector())),
62  //std::cout << "ConversionTrackCandidateProducer CTOR " << "\n";
63  nEvt_ = 0;
64 
65  // use onfiguration file to setup input/output collection names
66 
68  consumes<edm::View<reco::CaloCluster> >(config.getParameter<edm::InputTag>("bcBarrelCollection"));
70  consumes<edm::View<reco::CaloCluster> >(config.getParameter<edm::InputTag>("bcEndcapCollection"));
71 
73  consumes<edm::View<reco::CaloCluster> >(config.getParameter<edm::InputTag>("scHybridBarrelProducer"));
75  consumes<edm::View<reco::CaloCluster> >(config.getParameter<edm::InputTag>("scIslandEndcapProducer"));
76 
77  OutInTrackCandidateCollection_ = config.getParameter<std::string>("outInTrackCandidateCollection");
78  InOutTrackCandidateCollection_ = config.getParameter<std::string>("inOutTrackCandidateCollection");
79 
81  config.getParameter<std::string>("outInTrackCandidateSCAssociationCollection");
83  config.getParameter<std::string>("inOutTrackCandidateSCAssociationCollection");
84 
86  consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("barrelEcalRecHitCollection"));
88  consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("endcapEcalRecHitCollection"));
89  hcalTowers_ = consumes<CaloTowerCollection>(config.getParameter<edm::InputTag>("hcalTowers"));
90  measurementTrkEvtToken_ = consumes<MeasurementTrackerEvent>(edm::InputTag("MeasurementTrackerEvent"));
91  hOverEConeSize_ = config.getParameter<double>("hOverEConeSize");
92  maxHOverE_ = config.getParameter<double>("maxHOverE");
93  minSCEt_ = config.getParameter<double>("minSCEt");
94  isoConeR_ = config.getParameter<double>("isoConeR");
95  isoInnerConeR_ = config.getParameter<double>("isoInnerConeR");
96  isoEtaSlice_ = config.getParameter<double>("isoEtaSlice");
97  isoEtMin_ = config.getParameter<double>("isoEtMin");
98  isoEMin_ = config.getParameter<double>("isoEMin");
99  vetoClusteredHits_ = config.getParameter<bool>("vetoClusteredHits");
100  useNumXtals_ = config.getParameter<bool>("useNumXstals");
101  ecalIsoCut_offset_ = config.getParameter<double>("ecalIsoCut_offset");
102  ecalIsoCut_slope_ = config.getParameter<double>("ecalIsoCut_slope");
103 
104  //Flags and Severities to be excluded from photon calculations
105  const std::vector<std::string> flagnamesEB =
106  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEB");
107 
108  const std::vector<std::string> flagnamesEE =
109  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEE");
110 
111  flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
112 
113  flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
114 
115  const std::vector<std::string> severitynamesEB =
116  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcludedEB");
117 
118  severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
119 
120  const std::vector<std::string> severitynamesEE =
121  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcludedEE");
122 
123  severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
124 
125  // Register the product
126  produces<TrackCandidateCollection>(OutInTrackCandidateCollection_);
127  produces<TrackCandidateCollection>(InOutTrackCandidateCollection_);
128 
129  produces<reco::TrackCandidateCaloClusterPtrAssociation>(OutInTrackSuperClusterAssociationCollection_);
130  produces<reco::TrackCandidateCaloClusterPtrAssociation>(InOutTrackSuperClusterAssociationCollection_);
131 }
std::unique_ptr< OutInConversionSeedFinder > theOutInSeedFinder_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
edm::EDGetTokenT< EcalRecHitCollection > endcapecalCollection_
Definition: config.py:1
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkEvtToken_
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder_
std::unique_ptr< OutInConversionTrackFinder > theOutInTrackFinder_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
std::unique_ptr< InOutConversionSeedFinder > theInOutSeedFinder_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
std::unique_ptr< InOutConversionTrackFinder > theInOutTrackFinder_
edm::EDGetTokenT< EcalRecHitCollection > barrelecalCollection_
ConversionTrackCandidateProducer::~ConversionTrackCandidateProducer ( )
override

Definition at line 133 of file ConversionTrackCandidateProducer.cc.

133 {}

Member Function Documentation

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

Definition at line 142 of file ConversionTrackCandidateProducer.cc.

References edm::EventSetup::get(), edm::ESHandle< T >::product(), theInOutSeedFinder_, theOutInSeedFinder_, and theTrajectoryBuilder_.

142  {
144  theEventSetup.get<NavigationSchoolRecord>().get("SimpleNavigationSchool", nav);
145  const NavigationSchool* navigation = nav.product();
146  theTrajectoryBuilder_->setNavigationSchool(navigation);
147  theOutInSeedFinder_->setNavigationSchool(navigation);
148  theInOutSeedFinder_->setNavigationSchool(navigation);
149 }
std::unique_ptr< OutInConversionSeedFinder > theOutInSeedFinder_
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder_
std::unique_ptr< InOutConversionSeedFinder > theInOutSeedFinder_
T const * product() const
Definition: ESHandle.h:86
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,
const EcalRecHitCollection ecalRecHits,
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 294 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_, isoConeR_, isoEMin_, isoEtaSlice_, isoEtMin_, isoInnerConeR_, maxHOverE_, minSCEt_, reco::CaloCluster::position(), edm::Handle< T >::product(), SimDataFormats::CaloAnalysis::sc, EgammaRecHitIsolation::setUseNumCrystals(), EgammaRecHitIsolation::setVetoClustered(), severitiesexclEB_, severitiesexclEE_, theCaloGeom_, theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, theOutInTrackFinder_, useNumXtals_, and vetoClusteredHits_.

Referenced by produce().

308 {
309  //std::cout << "ConversionTrackCandidateProducer is barrel " << isBarrel << "\n";
310  //std::cout << "ConversionTrackCandidateProducer builcollections sc size " << scHandle->size() << "\n";
311  //std::cout << "ConversionTrackCandidateProducer builcollections bc size " << bcHandle->size() << "\n";
312  //const CaloGeometry* geometry = theCaloGeom_.product();
313 
314  // Loop over SC in the barrel and reconstruct converted photons
315  for (auto const& aClus : scHandle->ptrs()) {
316  // preselection based in Et and H/E cut.
317  if (aClus->energy() / cosh(aClus->eta()) <= minSCEt_)
318  continue;
319  if (aClus->eta() > 1.479 && aClus->eta() < 1.556)
320  continue;
321 
322  const reco::CaloCluster* pClus = &(*aClus);
323  const reco::SuperCluster* sc = dynamic_cast<const reco::SuperCluster*>(pClus);
324  double scEt = sc->energy() / cosh(sc->eta());
325  const CaloTowerCollection* hcalTowersColl = hcalTowersHandle.product();
326  EgammaTowerIsolation towerIso(hOverEConeSize_, 0., 0., -1, hcalTowersColl);
327  double HoE = towerIso.getTowerESum(sc) / sc->energy();
328  if (HoE >= maxHOverE_)
329  continue;
330 
332  EgammaRecHitIsolation ecalIso(
334 
335  ecalIso.setVetoClustered(vetoClusteredHits_);
336  ecalIso.setUseNumCrystals(useNumXtals_);
337  if (isBarrel) {
338  ecalIso.doFlagChecks(flagsexclEB_);
339  ecalIso.doSeverityChecks(ecalRecHitHandle.product(), severitiesexclEB_);
340  } else {
341  ecalIso.doFlagChecks(flagsexclEE_);
342  ecalIso.doSeverityChecks(ecalRecHitHandle.product(), severitiesexclEE_);
343  }
344 
345  double ecalIsolation = ecalIso.getEtSum(sc);
346  if (ecalIsolation > ecalIsoCut_offset_ + ecalIsoCut_slope_ * scEt)
347  continue;
348 
349  // Now launch the seed finding
350  theOutInSeedFinder_->setCandidate(pClus->energy(),
351  GlobalPoint(pClus->position().x(), pClus->position().y(), pClus->position().z()));
352  theOutInSeedFinder_->makeSeeds(bcHandle);
353 
354  std::vector<Trajectory> theOutInTracks =
355  theOutInTrackFinder_->tracks(theOutInSeedFinder_->seeds(), outInTrackCandidates);
356 
357  theInOutSeedFinder_->setCandidate(pClus->energy(),
358  GlobalPoint(pClus->position().x(), pClus->position().y(), pClus->position().z()));
359  theInOutSeedFinder_->setTracks(theOutInTracks);
360  theInOutSeedFinder_->makeSeeds(bcHandle);
361 
362  std::vector<Trajectory> theInOutTracks =
363  theInOutTrackFinder_->tracks(theInOutSeedFinder_->seeds(), inOutTrackCandidates);
364 
365  // Debug
366  // 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";
367 
369  for (std::vector<Trajectory>::const_iterator it = theOutInTracks.begin(); it != theOutInTracks.end(); ++it) {
370  caloPtrVecOutIn_.push_back(aClus);
371  // std::cout << "ConversionTrackCandidateProducer Barrel OutIn Tracks Number of hits " << (*it).foundHits() << "\n";
372  }
373 
374  for (std::vector<Trajectory>::const_iterator it = theInOutTracks.begin(); it != theInOutTracks.end(); ++it) {
375  caloPtrVecInOut_.push_back(aClus);
376  // std::cout << "ConversionTrackCandidateProducer Barrel InOut Tracks Number of hits " << (*it).foundHits() << "\n";
377  }
378  }
379 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:153
std::unique_ptr< OutInConversionSeedFinder > theOutInSeedFinder_
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecInOut_
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:180
std::unique_ptr< OutInConversionTrackFinder > theOutInTrackFinder_
double energy() const
cluster energy
Definition: CaloCluster.h:148
std::unique_ptr< InOutConversionSeedFinder > theInOutSeedFinder_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecOutIn_
T const * product() const
Definition: Handle.h:69
std::unique_ptr< InOutConversionTrackFinder > theInOutTrackFinder_
void ConversionTrackCandidateProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 151 of file ConversionTrackCandidateProducer.cc.

References barrelecalCollection_, bcBarrelCollection_, bcEndcapCollection_, buildCollections(), caloPtrVecInOut_, caloPtrVecOutIn_, data, endcapecalCollection_, edm::helper::Filler< Map >::fill(), edm::EventSetup::get(), edm::Event::getByToken(), hcalTowers_, InOutTrackCandidateCollection_, InOutTrackSuperClusterAssociationCollection_, edm::helper::Filler< Map >::insert(), PixelPluginsPhase0_cfi::isBarrel, edm::HandleBase::isValid(), measurementTrkEvtToken_, eostools::move(), nEvt_, OutInTrackCandidateCollection_, OutInTrackSuperClusterAssociationCollection_, edm::ESHandle< T >::product(), edm::Event::put(), scHybridBarrelProducer_, scIslandEndcapProducer_, setEventSetup(), theCaloGeom_, theInOutSeedFinder_, theOutInSeedFinder_, and theTrajectoryBuilder_.

151  {
152  using namespace edm;
153  nEvt_++;
154  // std::cout << "ConversionTrackCandidateProducer Analyzing event number " << theEvent.id() << " Global Counter " << nEvt_ << "\n";
155 
156  // get the trajectory builder and initialize it with the data
158  theEvent.getByToken(measurementTrkEvtToken_, data);
159  theTrajectoryBuilder_->setEvent(theEvent, theEventSetup, &*data);
160 
161  // this need to be done after the initialization of the TrajectoryBuilder!
162  setEventSetup(theEventSetup);
163 
164  theOutInSeedFinder_->setEvent(theEvent);
165  theInOutSeedFinder_->setEvent(theEvent);
166 
167  //
168  // create empty output collections
169  //
170  // Out In Track Candidates
171  auto outInTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
172  // In Out Track Candidates
173  auto inOutTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
174  // Track Candidate calo Cluster Association
175  auto outInAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
176  auto inOutAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
177 
178  // Get the basic cluster collection in the Barrel
179  bool validBarrelBCHandle = true;
181  theEvent.getByToken(bcBarrelCollection_, bcBarrelHandle);
182  if (!bcBarrelHandle.isValid()) {
183  edm::LogError("ConversionTrackCandidateProducer") << "Error! Can't get the Barrel Basic Clusters!";
184  validBarrelBCHandle = false;
185  }
186 
187  // Get the basic cluster collection in the Endcap
188  bool validEndcapBCHandle = true;
190  theEvent.getByToken(bcEndcapCollection_, bcEndcapHandle);
191  if (!bcEndcapHandle.isValid()) {
192  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the Endcap Basic Clusters";
193  validEndcapBCHandle = false;
194  }
195 
196  // Get the Super Cluster collection in the Barrel
197  bool validBarrelSCHandle = true;
199  theEvent.getByToken(scHybridBarrelProducer_, scBarrelHandle);
200  if (!scBarrelHandle.isValid()) {
201  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the barrel superclusters!";
202  validBarrelSCHandle = false;
203  }
204 
205  // Get the Super Cluster collection in the Endcap
206  bool validEndcapSCHandle = true;
208  theEvent.getByToken(scIslandEndcapProducer_, scEndcapHandle);
209  if (!scEndcapHandle.isValid()) {
210  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the endcap superclusters!";
211  validEndcapSCHandle = false;
212  }
213 
214  // get the geometry from the event setup:
215  theEventSetup.get<CaloGeometryRecord>().get(theCaloGeom_);
216 
217  // get Hcal towers collection
218  Handle<CaloTowerCollection> hcalTowersHandle;
219  theEvent.getByToken(hcalTowers_, hcalTowersHandle);
220 
221  edm::Handle<EcalRecHitCollection> ecalhitsCollEB;
222  edm::Handle<EcalRecHitCollection> ecalhitsCollEE;
223 
224  theEvent.getByToken(endcapecalCollection_, ecalhitsCollEE);
225  theEvent.getByToken(barrelecalCollection_, ecalhitsCollEB);
226 
228  theEventSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
229  const EcalSeverityLevelAlgo* sevLevel = sevlv.product();
230 
231  caloPtrVecOutIn_.clear();
232  caloPtrVecInOut_.clear();
233 
234  bool isBarrel = true;
235  if (validBarrelBCHandle && validBarrelSCHandle)
236  buildCollections(isBarrel,
237  scBarrelHandle,
238  bcBarrelHandle,
239  ecalhitsCollEB,
240  *ecalhitsCollEB,
241  sevLevel,
242  hcalTowersHandle,
243  *outInTrackCandidate_p,
244  *inOutTrackCandidate_p,
247 
248  if (validEndcapBCHandle && validEndcapSCHandle) {
249  isBarrel = false;
250  buildCollections(isBarrel,
251  scEndcapHandle,
252  bcEndcapHandle,
253  ecalhitsCollEE,
254  *ecalhitsCollEE,
255  sevLevel,
256  hcalTowersHandle,
257  *outInTrackCandidate_p,
258  *inOutTrackCandidate_p,
261  }
262 
263  // std::cout << " ConversionTrackCandidateProducer caloPtrVecOutIn_ size " << caloPtrVecOutIn_.size() << " caloPtrVecInOut_ size " << caloPtrVecInOut_.size() << "\n";
264 
265  // put all products in the event
266  // Barrel
267  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*outInTrackCandidate_p).size() << " Out In track Candidates " << "\n";
268  const edm::OrphanHandle<TrackCandidateCollection> refprodOutInTrackC =
269  theEvent.put(std::move(outInTrackCandidate_p), OutInTrackCandidateCollection_);
270  //std::cout << "ConversionTrackCandidateProducer refprodOutInTrackC size " << (*(refprodOutInTrackC.product())).size() << "\n";
271  //
272  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*inOutTrackCandidate_p).size() << " In Out track Candidates " << "\n";
273  const edm::OrphanHandle<TrackCandidateCollection> refprodInOutTrackC =
274  theEvent.put(std::move(inOutTrackCandidate_p), InOutTrackCandidateCollection_);
275  //std::cout << "ConversionTrackCandidateProducer refprodInOutTrackC size " << (*(refprodInOutTrackC.product())).size() << "\n";
276 
277  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerOI(*outInAssoc_p);
278  fillerOI.insert(refprodOutInTrackC, caloPtrVecOutIn_.begin(), caloPtrVecOutIn_.end());
279  fillerOI.fill();
280  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerIO(*inOutAssoc_p);
281  fillerIO.insert(refprodInOutTrackC, caloPtrVecInOut_.begin(), caloPtrVecInOut_.end());
282  fillerIO.fill();
283 
284  // std::cout << "ConversionTrackCandidateProducer Putting in the event OutIn track - SC association: size " << (*outInAssoc_p).size() << "\n";
285  theEvent.put(std::move(outInAssoc_p), OutInTrackSuperClusterAssociationCollection_);
286 
287  // std::cout << "ConversionTrackCandidateProducer Putting in the event InOut track - SC association: size " << (*inOutAssoc_p).size() << "\n";
288  theEvent.put(std::move(inOutAssoc_p), InOutTrackSuperClusterAssociationCollection_);
289 
290  theOutInSeedFinder_->clear();
291  theInOutSeedFinder_->clear();
292 }
std::unique_ptr< OutInConversionSeedFinder > theOutInSeedFinder_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
edm::EDGetTokenT< EcalRecHitCollection > endcapecalCollection_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecInOut_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkEvtToken_
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
bool isValid() const
Definition: HandleBase.h:70
std::unique_ptr< InOutConversionSeedFinder > theInOutSeedFinder_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecOutIn_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
void buildCollections(bool detector, const edm::Handle< edm::View< reco::CaloCluster > > &scHandle, const edm::Handle< edm::View< reco::CaloCluster > > &bcHandle, edm::Handle< EcalRecHitCollection > ecalRecHitHandle, const EcalRecHitCollection &ecalRecHits, 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)
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< EcalRecHitCollection > barrelecalCollection_
def move(src, dest)
Definition: eostools.py:511
void ConversionTrackCandidateProducer::setEventSetup ( const edm::EventSetup es)
private

Initialize EventSetup objects at each event.

Definition at line 135 of file ConversionTrackCandidateProducer.cc.

References theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, and theOutInTrackFinder_.

Referenced by produce().

135  {
136  theOutInSeedFinder_->setEventSetup(theEventSetup);
137  theInOutSeedFinder_->setEventSetup(theEventSetup);
138  theOutInTrackFinder_->setEventSetup(theEventSetup);
139  theInOutTrackFinder_->setEventSetup(theEventSetup);
140 }
std::unique_ptr< OutInConversionSeedFinder > theOutInSeedFinder_
std::unique_ptr< OutInConversionTrackFinder > theOutInTrackFinder_
std::unique_ptr< InOutConversionSeedFinder > theInOutSeedFinder_
std::unique_ptr< InOutConversionTrackFinder > theInOutTrackFinder_

Member Data Documentation

edm::EDGetTokenT<EcalRecHitCollection> ConversionTrackCandidateProducer::barrelecalCollection_
private

Definition at line 63 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 58 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 59 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 96 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and produce().

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

Definition at line 95 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and produce().

double ConversionTrackCandidateProducer::ecalIsoCut_offset_
private
double ConversionTrackCandidateProducer::ecalIsoCut_slope_
private
edm::EDGetTokenT<EcalRecHitCollection> ConversionTrackCandidateProducer::endcapecalCollection_
private

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

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 53 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::InOutTrackSuperClusterAssociationCollection_
private

Definition at line 56 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
edm::EDGetTokenT<MeasurementTrackerEvent> ConversionTrackCandidateProducer::measurementTrkEvtToken_
private

Definition at line 65 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

double ConversionTrackCandidateProducer::minSCEt_
private
int ConversionTrackCandidateProducer::nEvt_
private

Definition at line 47 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::OutInTrackCandidateCollection_
private

Definition at line 52 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::OutInTrackSuperClusterAssociationCollection_
private

Definition at line 55 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 60 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

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

Referenced by buildCollections(), and produce().

std::unique_ptr<InOutConversionSeedFinder> ConversionTrackCandidateProducer::theInOutSeedFinder_
private
std::unique_ptr<InOutConversionTrackFinder> ConversionTrackCandidateProducer::theInOutTrackFinder_
private

Definition at line 93 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and setEventSetup().

std::unique_ptr<OutInConversionSeedFinder> ConversionTrackCandidateProducer::theOutInSeedFinder_
private
std::unique_ptr<OutInConversionTrackFinder> ConversionTrackCandidateProducer::theOutInTrackFinder_
private

Definition at line 91 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and setEventSetup().

std::unique_ptr<BaseCkfTrajectoryBuilder> ConversionTrackCandidateProducer::theTrajectoryBuilder_
private

Definition at line 88 of file ConversionTrackCandidateProducer.h.

Referenced by beginRun(), and produce().

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

Definition at line 99 of file ConversionTrackCandidateProducer.h.

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

Definition at line 98 of file ConversionTrackCandidateProducer.h.

bool ConversionTrackCandidateProducer::vetoClusteredHits_
private