CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
AlCaIsoTracksProducer Class Reference
Inheritance diagram for AlCaIsoTracksProducer:
edm::stream::EDProducer< edm::GlobalCache< AlCaIsoTracks::Counters > >

Public Member Functions

 AlCaIsoTracksProducer (edm::ParameterSet const &, const AlCaIsoTracks::Counters *count)
 
void endStream () override
 
void produce (edm::Event &, edm::EventSetup const &) override
 
 ~AlCaIsoTracksProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< AlCaIsoTracks::Counters > >
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void globalEndJob (const AlCaIsoTracks::Counters *counters)
 
static std::unique_ptr< AlCaIsoTracks::CountersinitializeGlobalCache (edm::ParameterSet const &)
 

Private Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
reco::HcalIsolatedTrackCandidateCollectionselect (edm::Handle< edm::TriggerResults > &triggerResults, const std::vector< std::string > &triggerNames_, edm::Handle< reco::TrackCollection > &trkCollection, math::XYZPoint &leadPV, edm::Handle< EcalRecHitCollection > &barrelRecHitsHandle, edm::Handle< EcalRecHitCollection > &endcapRecHitsHandle, edm::Handle< HBHERecHitCollection > &hbhe, double ptL1, double etaL1, double phiL1)
 
void setPtEtaPhi (std::vector< edm::Ref< l1extra::L1JetParticleCollection > > &objref, double &ptL1, double &etaL1, double &phiL1)
 

Private Attributes

double a_charIsoR_
 
double a_coneR_
 
double a_mipR_
 
const MagneticFieldbField
 
double eEcalMax_
 
double eIsolate_
 
const CaloGeometrygeo
 
HLTConfigProvider hltConfig_
 
std::vector< std::string > HLTNames_
 
edm::InputTag labelBS_
 
edm::InputTag labelEB_
 
edm::InputTag labelEE_
 
edm::InputTag labelGenTrack_
 
edm::InputTag labelHBHE_
 
edm::InputTag labelHltGT_
 
std::string labelIsoTk_
 
edm::InputTag labelRecVtx_
 
edm::InputTag labelTriggerEvent_
 
edm::InputTag labelTriggerResults_
 
double maxRestrictionP_
 
unsigned int nAll_
 
unsigned int nGood_
 
unsigned int nRange_
 
unsigned int nRun_
 
int preScale_
 
std::string processName_
 
double pTrackHigh_
 
double pTrackLow_
 
double pTrackMin_
 
spr::trackSelectionParameters selectionParameter_
 
double slopeRestrictionP_
 
std::string theTrackQuality_
 
edm::EDGetTokenT< reco::BeamSpottok_bs_
 
edm::EDGetTokenT< EcalRecHitCollectiontok_EB_
 
edm::EDGetTokenT< EcalRecHitCollectiontok_EE_
 
edm::EDGetTokenT< reco::TrackCollectiontok_genTrack_
 
edm::EDGetTokenT< HBHERecHitCollectiontok_hbhe_
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstok_hltGT_
 
edm::EDGetTokenT< reco::VertexCollectiontok_recVtx_
 
edm::EDGetTokenT< trigger::TriggerEventtok_trigEvt_
 
edm::EDGetTokenT< edm::TriggerResultstok_trigRes_
 
std::vector< std::string > trigNames_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< AlCaIsoTracks::Counters > >
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

Definition at line 88 of file AlCaIsoTracksProducer.cc.

Constructor & Destructor Documentation

AlCaIsoTracksProducer::AlCaIsoTracksProducer ( edm::ParameterSet const &  iConfig,
const AlCaIsoTracks::Counters count 
)
explicit

Definition at line 138 of file AlCaIsoTracksProducer.cc.

References a_charIsoR_, a_coneR_, a_mipR_, eEcalMax_, eIsolate_, edm::ParameterSet::getParameter(), edm::InputTag::instance(), gen::k, edm::InputTag::label(), labelBS_, labelEB_, labelEE_, labelGenTrack_, labelHBHE_, labelHltGT_, labelIsoTk_, labelRecVtx_, labelTriggerEvent_, labelTriggerResults_, spr::trackSelectionParameters::maxChi2, spr::trackSelectionParameters::maxDpOverP, spr::trackSelectionParameters::maxDxyPV, spr::trackSelectionParameters::maxDzPV, spr::trackSelectionParameters::maxInMiss, spr::trackSelectionParameters::maxOutMiss, maxRestrictionP_, spr::trackSelectionParameters::minLayerCrossed, spr::trackSelectionParameters::minOuterHit, spr::trackSelectionParameters::minPt, spr::trackSelectionParameters::minQuality, preScale_, processName_, pTrackHigh_, pTrackLow_, pTrackMin_, reco::TrackBase::qualityByName(), selectionParameter_, slopeRestrictionP_, AlCaHLTBitMon_QueryRunRegistry::string, theTrackQuality_, tok_bs_, tok_EB_, tok_EE_, tok_genTrack_, tok_hbhe_, tok_hltGT_, tok_recVtx_, tok_trigEvt_, tok_trigRes_, and trigNames_.

138  :
139  nRun_(0), nAll_(0), nGood_(0), nRange_(0) {
140  //Get the run parameters
141  const double isolationRadius(28.9);
142  trigNames_ = iConfig.getParameter<std::vector<std::string> >("Triggers");
143  theTrackQuality_ = iConfig.getParameter<std::string>("TrackQuality");
144  processName_ = iConfig.getParameter<std::string>("ProcessName");
145  selectionParameter_.minPt = iConfig.getParameter<double>("MinTrackPt");;
147  selectionParameter_.maxDxyPV = iConfig.getParameter<double>("MaxDxyPV");
148  selectionParameter_.maxDzPV = iConfig.getParameter<double>("MaxDzPV");
149  selectionParameter_.maxChi2 = iConfig.getParameter<double>("MaxChi2");
150  selectionParameter_.maxDpOverP = iConfig.getParameter<double>("MaxDpOverP");
151  selectionParameter_.minOuterHit = iConfig.getParameter<int>("MinOuterHit");
152  selectionParameter_.minLayerCrossed = iConfig.getParameter<int>("MinLayerCrossed");
153  selectionParameter_.maxInMiss = iConfig.getParameter<int>("MaxInMiss");
154  selectionParameter_.maxOutMiss = iConfig.getParameter<int>("MaxOutMiss");
155  a_coneR_ = iConfig.getParameter<double>("ConeRadius");
156  a_charIsoR_ = a_coneR_ + isolationRadius;
157  a_mipR_ = iConfig.getParameter<double>("ConeRadiusMIP");
158  pTrackMin_ = iConfig.getParameter<double>("MinimumTrackP");
159  eEcalMax_ = iConfig.getParameter<double>("MaximumEcalEnergy");
160  // Different isolation cuts are described in DN-2016/029
161  // Tight cut uses 2 GeV; Loose cut uses 10 GeV
162  // Eta dependent cut uses (maxRestrictionP_ * exp(|ieta|*log(2.5)/18))
163  // with the factor for exponential slopeRestrictionP_ = log(2.5)/18
164  // maxRestrictionP_ = 8 GeV as came from a study
165  maxRestrictionP_ = iConfig.getParameter<double>("MaxTrackP");
166  slopeRestrictionP_ = iConfig.getParameter<double>("SlopeTrackP");
167  eIsolate_ = iConfig.getParameter<double>("IsolationEnergy");
168  pTrackLow_ = iConfig.getParameter<double>("MomentumRangeLow");
169  pTrackHigh_ = iConfig.getParameter<double>("MomentumRangeHigh");
170  preScale_ = iConfig.getParameter<int>("PreScaleFactor");
171  labelGenTrack_ = iConfig.getParameter<edm::InputTag>("TrackLabel");
172  labelRecVtx_ = iConfig.getParameter<edm::InputTag>("VertexLabel");
173  labelBS_ = iConfig.getParameter<edm::InputTag>("BeamSpotLabel");
174  labelEB_ = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
175  labelEE_ = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
176  labelHBHE_ = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
177  labelHltGT_ = iConfig.getParameter<edm::InputTag>("L1GTSeedLabel");
178  labelTriggerEvent_ = iConfig.getParameter<edm::InputTag>("TriggerEventLabel");
179  labelTriggerResults_ = iConfig.getParameter<edm::InputTag>("TriggerResultLabel");
180  labelIsoTk_ = iConfig.getParameter<std::string>("IsoTrackLabel");
181 
182  // define tokens for access
183  tok_hltGT_ = consumes<trigger::TriggerFilterObjectWithRefs>(labelHltGT_);
184  tok_trigEvt_ = consumes<trigger::TriggerEvent>(labelTriggerEvent_);
185  tok_trigRes_ = consumes<edm::TriggerResults>(labelTriggerResults_);
186  tok_genTrack_ = consumes<reco::TrackCollection>(labelGenTrack_);
187  tok_recVtx_ = consumes<reco::VertexCollection>(labelRecVtx_);
188  tok_bs_ = consumes<reco::BeamSpot>(labelBS_);
189  tok_EB_ = consumes<EcalRecHitCollection>(labelEB_);
190  tok_EE_ = consumes<EcalRecHitCollection>(labelEE_);
191  tok_hbhe_ = consumes<HBHERecHitCollection>(labelHBHE_);
192 
193  edm::LogInfo("HcalIsoTrack") <<"Parameters read from config file \n"
194  <<"\t minPt " << selectionParameter_.minPt
195  <<"\t theTrackQuality " << theTrackQuality_
196  <<"\t minQuality " << selectionParameter_.minQuality
197  <<"\t maxDxyPV " << selectionParameter_.maxDxyPV
198  <<"\t maxDzPV " << selectionParameter_.maxDzPV
199  <<"\t maxChi2 " << selectionParameter_.maxChi2
200  <<"\t maxDpOverP " << selectionParameter_.maxDpOverP
201  <<"\t minOuterHit " << selectionParameter_.minOuterHit
202  <<"\t minLayerCrossed " << selectionParameter_.minLayerCrossed
203  <<"\t maxInMiss " << selectionParameter_.maxInMiss
204  <<"\t maxOutMiss " << selectionParameter_.maxOutMiss << "\n"
205  <<"\t a_coneR " << a_coneR_
206  <<"\t a_charIsoR " << a_charIsoR_
207  <<"\t a_mipR " << a_mipR_
208  <<"\t pTrackMin " << pTrackMin_
209  <<"\t eEcalMax " << eEcalMax_
210  <<"\t maxRestrictionP_ "<< maxRestrictionP_
211  <<"\t slopeRestrictionP_ " << slopeRestrictionP_
212  <<"\t eIsolate_ " << eIsolate_
213  <<"\t Process " << processName_ << "\n"
214  <<"\t Precale factor " << preScale_
215  <<"\t in momentum range " << pTrackLow_
216  <<":" << pTrackHigh_;
217  for (unsigned int k=0; k<trigNames_.size(); ++k)
218  edm::LogInfo("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k];
219 
220  //create also IsolatedPixelTrackCandidateCollection which contains isolation info and reference to primary track
221  produces<reco::HcalIsolatedTrackCandidateCollection>(labelIsoTk_);
222  produces<reco::VertexCollection>(labelRecVtx_.label());
223  produces<EcalRecHitCollection>(labelEB_.instance());
224  produces<EcalRecHitCollection>(labelEE_.instance());
225  produces<HBHERecHitCollection>(labelHBHE_.label());
226 
227  edm::LogInfo("HcalIsoTrack") << " Expected to produce the collections:\n"
228  << "reco::HcalIsolatedTrackCandidateCollection "
229  << " with label HcalIsolatedTrackCollection\n"
230  << "reco::VertexCollection with label " << labelRecVtx_.label() << "\n"
231  << "EcalRecHitCollection with label EcalRecHitsEB\n"
232  << "EcalRecHitCollection with label EcalRecHitsEE\n"
233  << "HBHERecHitCollection with label " << labelHBHE_.label();
234 }
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hltGT_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
int k[5][pyjets_maxn]
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:134
std::string const & label() const
Definition: InputTag.h:36
spr::trackSelectionParameters selectionParameter_
std::vector< std::string > trigNames_
reco::TrackBase::TrackQuality minQuality
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
std::string const & instance() const
Definition: InputTag.h:37
AlCaIsoTracksProducer::~AlCaIsoTracksProducer ( )
override

Definition at line 237 of file AlCaIsoTracksProducer.cc.

237 { }

Member Function Documentation

void AlCaIsoTracksProducer::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 406 of file AlCaIsoTracksProducer.cc.

References bField, geo, edm::EventSetup::get(), hltConfig_, HLTConfigProvider::init(), nRun_, processName_, edm::ESHandle< T >::product(), and edm::RunBase::run().

406  {
407  bool changed(false);
408  edm::LogInfo("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run()
409  << " hltconfig.init " << hltConfig_.init(iRun,iSetup,processName_,changed);
410 
412  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
413  bField = bFieldH.product();
415  iSetup.get<CaloGeometryRecord>().get(pG);
416  geo = pG.product();
417 }
const CaloGeometry * geo
const MagneticField * bField
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
T const * product() const
Definition: ESHandle.h:84
void AlCaIsoTracksProducer::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivate

Definition at line 419 of file AlCaIsoTracksProducer.cc.

References nRun_, and edm::RunBase::run().

419  {
420  edm::LogInfo("HcalIsoTrack") << "endRun [" << nRun_ << "] " << iRun.run();
421  ++nRun_;
422 }
void AlCaIsoTracksProducer::endStream ( )
override

Definition at line 394 of file AlCaIsoTracksProducer.cc.

References nAll_, nGood_, and nRange_.

394  {
395  globalCache()->nAll_ += nAll_;
396  globalCache()->nGood_ += nGood_;
397  globalCache()->nRange_ += nRange_;
398 }
void AlCaIsoTracksProducer::globalEndJob ( const AlCaIsoTracks::Counters counters)
static

Definition at line 400 of file AlCaIsoTracksProducer.cc.

References AlCaIsoTracks::Counters::nAll_, AlCaIsoTracks::Counters::nGood_, and AlCaIsoTracks::Counters::nRange_.

400  {
401  edm::LogInfo("HcalIsoTrack") << "Finds " << count->nGood_ <<" good tracks in "
402  << count->nAll_ << " events and " << count->nRange_
403  << " events in the momentum raange";
404 }
static std::unique_ptr<AlCaIsoTracks::Counters> AlCaIsoTracksProducer::initializeGlobalCache ( edm::ParameterSet const &  )
inlinestatic

Definition at line 93 of file AlCaIsoTracksProducer.cc.

References Ecal2004TBTDCRanges_v1_cff::endRun, photonIsolationHIProducer_cfi::hbhe, TauGenJetsDecayModeSelectorAllHadrons_cfi::select, setPtEtaPhi(), and triggerResults.

93  {
94  return std::make_unique<AlCaIsoTracks::Counters>();
95  }
void AlCaIsoTracksProducer::produce ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
override

Definition at line 240 of file AlCaIsoTracksProducer.cc.

References edm::SortedCollection< T, SORT >::begin(), edm::EventBase::bunchCrossing(), edm::SortedCollection< T, SORT >::end(), edm::EventID::event(), edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), photonIsolationHIProducer_cfi::hbhe, edm::EventBase::id(), edm::InputTag::instance(), edm::HandleBase::isValid(), edm::InputTag::label(), labelEB_, labelEE_, labelGenTrack_, labelHBHE_, labelIsoTk_, labelRecVtx_, labelTriggerEvent_, labelTriggerResults_, edm::EventBase::luminosityBlock(), eostools::move(), nAll_, nGood_, nRange_, reco::BeamSpot::position(), preScale_, edm::Handle< T >::product(), pTrackHigh_, pTrackLow_, edm::Event::put(), edm::EventID::run(), select(), setPtEtaPhi(), tok_bs_, tok_EB_, tok_EE_, tok_genTrack_, tok_hbhe_, tok_hltGT_, tok_recVtx_, tok_trigEvt_, tok_trigRes_, trigger::TriggerL1CenJet, trigger::TriggerL1ForJet, trigger::TriggerL1TauJet, edm::TriggerNames::triggerNames(), edm::Event::triggerNames(), triggerResults, badGlobalMuonTaggersAOD_cff::vtx, x, y, and z.

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

240  {
241 
242  nAll_++;
243 #ifdef DebugLog
244  edm::LogInfo("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event "
245  << iEvent.id().event() << " Luminosity "
246  << iEvent.luminosityBlock() << " Bunch "
247  << iEvent.bunchCrossing();
248 #endif
249  bool valid(true);
250  //Step1: Get all the relevant containers
251  trigger::TriggerEvent triggerEvent;
252  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
253  iEvent.getByToken(tok_trigEvt_, triggerEventHandle);
254  if (!triggerEventHandle.isValid()) {
255  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelTriggerEvent_;
256  valid = false;
257  }
259  iEvent.getByToken(tok_trigRes_, triggerResults);
260  if (!triggerResults.isValid()) {
261  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelTriggerResults_;
262  valid = false;
263  }
264 
266  iEvent.getByToken(tok_genTrack_, trkCollection);
267  if (!trkCollection.isValid()) {
268  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_;
269  valid = false;
270  }
271  reco::TrackCollection::const_iterator trkItr;
272 
274  iEvent.getByToken(tok_recVtx_, recVtxs);
275  if (!recVtxs.isValid()) {
276  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_;
277  valid = false;
278  }
279 
280  edm::Handle<reco::BeamSpot> beamSpotH;
281  iEvent.getByToken(tok_bs_, beamSpotH);
282  math::XYZPoint leadPV(0,0,0);
283  if (valid) {
284  if (!recVtxs->empty() && !((*recVtxs)[0].isFake())) {
285  leadPV = math::XYZPoint((*recVtxs)[0].x(),(*recVtxs)[0].y(),
286  (*recVtxs)[0].z());
287  } else if (beamSpotH.isValid()) {
288  leadPV = beamSpotH->position();
289  }
290  }
291 #ifdef DebugLog
292  edm::LogInfo("HcalIsoTrack") << "Primary Vertex " << leadPV;
293 #endif
294 
295  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
296  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
297  if (!barrelRecHitsHandle.isValid()) {
298  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEB_;
299  valid = false;
300  }
301  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
302  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
303  if (!endcapRecHitsHandle.isValid()) {
304  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEE_;
305  valid = false;
306  }
308  iEvent.getByToken(tok_hbhe_, hbhe);
309  if (!hbhe.isValid()) {
310  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelHBHE_;
311  valid = false;
312  }
313 
314  //Get L1 trigger object
315  double ptL1(0), etaL1(0), phiL1(0);
317  iEvent.getByToken(tok_hltGT_, l1trigobj);
318 
319  if (l1trigobj.isValid()) {
320  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1tauobjref;
321  l1trigobj->getObjects(trigger::TriggerL1TauJet, l1tauobjref);
322  setPtEtaPhi(l1tauobjref,ptL1,etaL1,phiL1);
323 
324  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1jetobjref;
325  l1trigobj->getObjects(trigger::TriggerL1CenJet, l1jetobjref);
326  setPtEtaPhi(l1jetobjref,ptL1,etaL1,phiL1);
327 
328  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1forjetobjref;
329  l1trigobj->getObjects(trigger::TriggerL1ForJet, l1forjetobjref);
330  setPtEtaPhi(l1forjetobjref,ptL1,etaL1,phiL1);
331  } else {
332  valid = false;
333  }
334 
335  auto outputHcalIsoTrackColl = std::make_unique<reco::HcalIsolatedTrackCandidateCollection>();
336  auto outputVColl = std::make_unique<reco::VertexCollection>();
337  auto outputEBColl = std::make_unique<EBRecHitCollection>();
338  auto outputEEColl = std::make_unique<EERecHitCollection>();
339  auto outputHBHEColl = std::make_unique<HBHERecHitCollection>();
340 
341  //For valid HLT record
342  if (!valid) {
343  edm::LogWarning("HcalIsoTrack") << "Error! Can't get some of the products";
344  } else {
345  trigger::TriggerEvent triggerEvent = *(triggerEventHandle.product());
346  if (triggerResults.isValid()) {
347  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
348  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
349  reco::HcalIsolatedTrackCandidateCollection* isotk = select(triggerResults, triggerNames_, trkCollection, leadPV, barrelRecHitsHandle, endcapRecHitsHandle, hbhe, ptL1, etaL1, phiL1);
350 #ifdef DebugLog
351  edm::LogInfo("HcalIsoTrack") << "AlCaIsoTracksProducer::select returns "
352  << isotk->size() << " isolated tracks";
353 #endif
354 
355  if (!isotk->empty()) {
356  int ntrin(0), ntrout(0);
357  for (reco::HcalIsolatedTrackCandidateCollection::const_iterator itr=isotk->begin(); itr!=isotk->end(); ++itr) {
358  if (itr->p() > pTrackLow_ && itr->p() < pTrackHigh_) ntrin++;
359  else ntrout++;
360  }
361  bool selectEvent = ntrout > 0;
362  if (!selectEvent && ntrin > 0) {
363  ++nRange_;
364  if (preScale_ <= 1) selectEvent = true;
365  else if (nRange_%preScale_ == 1) selectEvent = true;
366  }
367  if (selectEvent) {
368  for (reco::HcalIsolatedTrackCandidateCollection::const_iterator itr=isotk->begin(); itr!=isotk->end(); ++itr)
369  outputHcalIsoTrackColl->push_back(*itr);
370 
371  for (reco::VertexCollection::const_iterator vtx=recVtxs->begin(); vtx!=recVtxs->end(); ++vtx)
372  outputVColl->push_back(*vtx);
373 
374  for (edm::SortedCollection<EcalRecHit>::const_iterator ehit=barrelRecHitsHandle->begin(); ehit!=barrelRecHitsHandle->end(); ++ehit)
375  outputEBColl->push_back(*ehit);
376 
377  for (edm::SortedCollection<EcalRecHit>::const_iterator ehit=endcapRecHitsHandle->begin(); ehit!=endcapRecHitsHandle->end(); ++ehit)
378  outputEEColl->push_back(*ehit);
379 
380  for (std::vector<HBHERecHit>::const_iterator hhit=hbhe->begin(); hhit!=hbhe->end(); ++hhit)
381  outputHBHEColl->push_back(*hhit);
382  ++nGood_;
383  }
384  }
385  }
386  }
387  iEvent.put(std::move(outputHcalIsoTrackColl), labelIsoTk_);
388  iEvent.put(std::move(outputVColl), labelRecVtx_.label());
389  iEvent.put(std::move(outputEBColl), labelEB_.instance());
390  iEvent.put(std::move(outputEEColl), labelEE_.instance());
391  iEvent.put(std::move(outputHBHEColl), labelHBHE_.label());
392 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
std::vector< T >::const_iterator const_iterator
int bunchCrossing() const
Definition: EventBase.h:66
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hltGT_
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
std::vector< HcalIsolatedTrackCandidate > HcalIsolatedTrackCandidateCollection
collectin of HcalIsolatedTrackCandidate objects
void setPtEtaPhi(std::vector< edm::Ref< l1extra::L1JetParticleCollection > > &objref, double &ptL1, double &etaL1, double &phiL1)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
static std::string const triggerResults
Definition: EdmProvDump.cc:42
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
const_iterator end() const
T const * product() const
Definition: Handle.h:81
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::string const & label() const
Definition: InputTag.h:36
edm::EventID id() const
Definition: EventBase.h:60
const Point & position() const
position
Definition: BeamSpot.h:62
reco::HcalIsolatedTrackCandidateCollection * select(edm::Handle< edm::TriggerResults > &triggerResults, const std::vector< std::string > &triggerNames_, edm::Handle< reco::TrackCollection > &trkCollection, math::XYZPoint &leadPV, edm::Handle< EcalRecHitCollection > &barrelRecHitsHandle, edm::Handle< EcalRecHitCollection > &endcapRecHitsHandle, edm::Handle< HBHERecHitCollection > &hbhe, double ptL1, double etaL1, double phiL1)
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
std::string const & instance() const
Definition: InputTag.h:37
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:301
def move(src, dest)
Definition: eostools.py:511
const_iterator begin() const
reco::HcalIsolatedTrackCandidateCollection * AlCaIsoTracksProducer::select ( edm::Handle< edm::TriggerResults > &  triggerResults,
const std::vector< std::string > &  triggerNames_,
edm::Handle< reco::TrackCollection > &  trkCollection,
math::XYZPoint leadPV,
edm::Handle< EcalRecHitCollection > &  barrelRecHitsHandle,
edm::Handle< EcalRecHitCollection > &  endcapRecHitsHandle,
edm::Handle< HBHERecHitCollection > &  hbhe,
double  ptL1,
double  etaL1,
double  phiL1 
)
private

Definition at line 425 of file AlCaIsoTracksProducer.cc.

References a_charIsoR_, a_mipR_, edm::HLTGlobalStatus::accept(), bField, spr::chargeIsolationCone(), spr::eCone_ecal(), eEcalMax_, eIsolate_, reco::TrackBase::eta(), JetChargeProducer_cfi::exp, spr::find(), geo, spr::goodTrack(), ValidationMatrix::hlt, mps_fire::i, HcalDetId::ieta(), HcalDetId::ietaAbs(), HcalDetId::iphi(), maxRestrictionP_, nTracks(), convertSQLiteXML::ok, reco::TrackBase::p(), phi, reco::TrackBase::phi(), spr::propagateCALO(), reco::TrackBase::pt(), pTrackMin_, reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), selectionParameter_, reco::HcalIsolatedTrackCandidate::SetEnergyEcal(), reco::HcalIsolatedTrackCandidate::SetEtaPhiEcal(), reco::HcalIsolatedTrackCandidate::SetEtaPhiHcal(), reco::HcalIsolatedTrackCandidate::setL1(), reco::HcalIsolatedTrackCandidate::SetMaxP(), reco::HcalIsolatedTrackCandidate::setTrack(), edm::HLTGlobalStatus::size(), slopeRestrictionP_, theTrackQuality_, findElectronsInSiStrips_cfi::trackCollection, and trigNames_.

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), produce(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().

431  {
432 
434  bool ok(false);
435 
436  // Find a good HLT trigger
437  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
438  int hlt = triggerResults->accept(iHLT);
439  for (unsigned int i=0; i<trigNames_.size(); ++i) {
440  if (triggerNames_[iHLT].find(trigNames_[i])!=std::string::npos) {
441  if (hlt > 0) {
442  ok = true;
443  }
444  edm::LogInfo("HcalIsoTrack") << "The trigger we are looking for "
445  << triggerNames_[iHLT] << " Flag "
446  << hlt << ":" << ok;
447  }
448  }
449  }
450 
451  //Propagate tracks to calorimeter surface)
452  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
454  trkCaloDirections, false);
455 
456  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
457  unsigned int nTracks(0), nselTracks(0);
458  for (trkDetItr = trkCaloDirections.begin(),nTracks=0;
459  trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++) {
460  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
461  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(),
462  pTrack->pz(), pTrack->p());
463 #ifdef DebugLog
464  edm::LogInfo("HcalIsoTrack") << "This track : " << nTracks
465  << " (pt|eta|phi|p) :" << pTrack->pt()
466  << "|" << pTrack->eta() << "|"
467  << pTrack->phi() << "|" << pTrack->p();
468 #endif
469  //Selection of good track
470  bool qltyFlag = spr::goodTrack(pTrack,leadPV,selectionParameter_,false);
471 #ifdef DebugLog
472  edm::LogInfo("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << qltyFlag
473  << "|" << trkDetItr->okECAL << "|"
474  << trkDetItr->okHCAL;
475 #endif
476  if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
477  double t_p = pTrack->p();
478  nselTracks++;
479  int nRH_eMipDR(0), nNearTRKs(0);
480  double eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
481  endcapRecHitsHandle,
482  trkDetItr->pointHCAL,
483  trkDetItr->pointECAL, a_mipR_,
484  trkDetItr->directionECAL,
485  nRH_eMipDR);
486  double hmaxNearP = spr::chargeIsolationCone(nTracks,
487  trkCaloDirections,
488  a_charIsoR_,
489  nNearTRKs, false);
490  HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL);
491  int ieta = detId.ietaAbs();
492  double eIsolation = (maxRestrictionP_*exp(slopeRestrictionP_*((double)(ieta))));
493  if (eIsolation < eIsolate_) eIsolation = eIsolate_;
494 #ifdef DebugLog
495  edm::LogInfo("HcalIsoTrack") << "This track : " << nTracks
496  << " (pt|eta|phi|p) :" << pTrack->pt()
497  << "|" << pTrack->eta() << "|"
498  << pTrack->phi() << "|" << t_p
499  << " e_MIP " << eMipDR
500  << " Chg Isolation " << hmaxNearP
501  << ":" << eIsolation;
502 #endif
503  if (t_p>pTrackMin_ && eMipDR<eEcalMax_ && hmaxNearP<eIsolation) {
504  reco::HcalIsolatedTrackCandidate newCandidate(v4);
505  newCandidate.SetMaxP(hmaxNearP);
506  newCandidate.SetEnergyEcal(eMipDR);
507  newCandidate.setL1(ptL1,etaL1,phiL1);
508  newCandidate.SetEtaPhiEcal((trkDetItr->pointECAL).eta(),
509  (trkDetItr->pointECAL).phi());
510  HcalDetId detId = HcalDetId(trkDetItr->detIdHCAL);
511  newCandidate.SetEtaPhiHcal((trkDetItr->pointHCAL).eta(),
512  (trkDetItr->pointHCAL).phi(),
513  detId.ieta(), detId.iphi());
514  int indx(0);
515  reco::TrackCollection::const_iterator trkItr1;
516  for (trkItr1=trkCollection->begin(); trkItr1 != trkCollection->end(); ++trkItr1,++indx) {
517  const reco::Track* pTrack1 = &(*trkItr1);
518  if (pTrack1 == pTrack) {
519  reco::TrackRef tRef = reco::TrackRef(trkCollection,indx);
520  newCandidate.setTrack(tRef);
521  break;
522  }
523  }
524  trackCollection->push_back(newCandidate);
525  }
526  }
527  }
528  return trackCollection;
529 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:648
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
const unsigned int nTracks(const reco::Vertex &sv)
bool accept() const
Has at least one path accepted the event?
const CaloGeometry * geo
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:678
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:660
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:684
std::vector< HcalIsolatedTrackCandidate > HcalIsolatedTrackCandidateCollection
collectin of HcalIsolatedTrackCandidate objects
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
unsigned int size() const
Get number of paths stored.
double pt() const
track transverse momentum
Definition: TrackBase.h:654
int ieta() const
get the cell ieta
Definition: HcalDetId.h:159
double eCone_ecal(const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
const MagneticField * bField
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:672
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:154
int iphi() const
get the cell iphi
Definition: HcalDetId.h:161
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
spr::trackSelectionParameters selectionParameter_
std::vector< std::string > trigNames_
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:666
void AlCaIsoTracksProducer::setPtEtaPhi ( std::vector< edm::Ref< l1extra::L1JetParticleCollection > > &  objref,
double &  ptL1,
double &  etaL1,
double &  phiL1 
)
private

Definition at line 531 of file AlCaIsoTracksProducer.cc.

References DEFINE_FWK_MODULE, AlCaHLTBitMon_ParallelJobs::p, and EnergyCorrector::pt.

Referenced by produce().

531  {
532 
533  for (unsigned int p=0; p<objref.size(); p++) {
534  if (objref[p]->pt()>ptL1) {
535  ptL1 = objref[p]->pt();
536  phiL1 = objref[p]->phi();
537  etaL1 = objref[p]->eta();
538  }
539  }
540 }

Member Data Documentation

double AlCaIsoTracksProducer::a_charIsoR_
private

Definition at line 115 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

double AlCaIsoTracksProducer::a_coneR_
private

Definition at line 115 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

double AlCaIsoTracksProducer::a_mipR_
private

Definition at line 115 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

const MagneticField* AlCaIsoTracksProducer::bField
private

Definition at line 123 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun(), and select().

double AlCaIsoTracksProducer::eEcalMax_
private

Definition at line 116 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

double AlCaIsoTracksProducer::eIsolate_
private

Definition at line 116 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

const CaloGeometry* AlCaIsoTracksProducer::geo
private

Definition at line 124 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun(), and select().

HLTConfigProvider AlCaIsoTracksProducer::hltConfig_
private

Definition at line 109 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun().

std::vector<std::string> AlCaIsoTracksProducer::HLTNames_
private

Definition at line 110 of file AlCaIsoTracksProducer.cc.

edm::InputTag AlCaIsoTracksProducer::labelBS_
private

Definition at line 121 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

edm::InputTag AlCaIsoTracksProducer::labelEB_
private

Definition at line 121 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelEE_
private

Definition at line 121 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelGenTrack_
private

Definition at line 120 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelHBHE_
private

Definition at line 121 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelHltGT_
private

Definition at line 120 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

std::string AlCaIsoTracksProducer::labelIsoTk_
private

Definition at line 122 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelRecVtx_
private

Definition at line 120 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelTriggerEvent_
private

Definition at line 119 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelTriggerResults_
private

Definition at line 119 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::maxRestrictionP_
private

Definition at line 114 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

unsigned int AlCaIsoTracksProducer::nAll_
private

Definition at line 111 of file AlCaIsoTracksProducer.cc.

Referenced by endStream(), and produce().

unsigned int AlCaIsoTracksProducer::nGood_
private

Definition at line 111 of file AlCaIsoTracksProducer.cc.

Referenced by endStream(), and produce().

unsigned int AlCaIsoTracksProducer::nRange_
private

Definition at line 111 of file AlCaIsoTracksProducer.cc.

Referenced by endStream(), and produce().

unsigned int AlCaIsoTracksProducer::nRun_
private

Definition at line 111 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun(), and endRun().

int AlCaIsoTracksProducer::preScale_
private

Definition at line 118 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

std::string AlCaIsoTracksProducer::processName_
private

Definition at line 113 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and beginRun().

double AlCaIsoTracksProducer::pTrackHigh_
private

Definition at line 117 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::pTrackLow_
private

Definition at line 117 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::pTrackMin_
private

Definition at line 116 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

spr::trackSelectionParameters AlCaIsoTracksProducer::selectionParameter_
private

Definition at line 112 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

double AlCaIsoTracksProducer::slopeRestrictionP_
private

Definition at line 114 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

std::string AlCaIsoTracksProducer::theTrackQuality_
private

Definition at line 113 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

edm::EDGetTokenT<reco::BeamSpot> AlCaIsoTracksProducer::tok_bs_
private

Definition at line 131 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<EcalRecHitCollection> AlCaIsoTracksProducer::tok_EB_
private

Definition at line 132 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<EcalRecHitCollection> AlCaIsoTracksProducer::tok_EE_
private

Definition at line 133 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<reco::TrackCollection> AlCaIsoTracksProducer::tok_genTrack_
private

Definition at line 129 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<HBHERecHitCollection> AlCaIsoTracksProducer::tok_hbhe_
private

Definition at line 134 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> AlCaIsoTracksProducer::tok_hltGT_
private

Definition at line 126 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<reco::VertexCollection> AlCaIsoTracksProducer::tok_recVtx_
private

Definition at line 130 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<trigger::TriggerEvent> AlCaIsoTracksProducer::tok_trigEvt_
private

Definition at line 127 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<edm::TriggerResults> AlCaIsoTracksProducer::tok_trigRes_
private

Definition at line 128 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

std::vector<std::string> AlCaIsoTracksProducer::trigNames_
private

Definition at line 110 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().