CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 > > edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AlCaIsoTracksProducer (edm::ParameterSet const &, const AlCaIsoTracks::Counters *count)
 
virtual void endStream () override
 
virtual void produce (edm::Event &, edm::EventSetup const &) override
 
 ~AlCaIsoTracksProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< AlCaIsoTracks::Counters > >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void globalEndJob (const AlCaIsoTracks::Counters *counters)
 
static std::unique_ptr
< AlCaIsoTracks::Counters
initializeGlobalCache (edm::ParameterSet const &)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
virtual 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 eIsolation_
 
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 maxRestrictionPt_
 
unsigned int nAll_
 
unsigned int nGood_
 
unsigned int nRun_
 
std::string processName_
 
double pTrackMin_
 
spr::trackSelectionParameters selectionParameter_
 
double slopeRestrictionPt_
 
std::string theTrackQuality_
 
edm::EDGetTokenT< reco::BeamSpottok_bs_
 
edm::EDGetTokenT
< EcalRecHitCollection
tok_EB_
 
edm::EDGetTokenT
< EcalRecHitCollection
tok_EE_
 
edm::EDGetTokenT
< reco::TrackCollection
tok_genTrack_
 
edm::EDGetTokenT
< HBHERecHitCollection
tok_hbhe_
 
edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
tok_hltGT_
 
edm::EDGetTokenT
< reco::VertexCollection
tok_recVtx_
 
edm::EDGetTokenT
< trigger::TriggerEvent
tok_trigEvt_
 
edm::EDGetTokenT
< edm::TriggerResults
tok_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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

Definition at line 87 of file AlCaIsoTracksProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 135 of file AlCaIsoTracksProducer.cc.

References a_charIsoR_, a_coneR_, a_mipR_, eEcalMax_, eIsolation_, edm::ParameterSet::getParameter(), edm::InputTag::instance(), relval_2017::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, maxRestrictionPt_, spr::trackSelectionParameters::minLayerCrossed, spr::trackSelectionParameters::minOuterHit, spr::trackSelectionParameters::minPt, spr::trackSelectionParameters::minQuality, processName_, pTrackMin_, reco::TrackBase::qualityByName(), selectionParameter_, slopeRestrictionPt_, AlCaHLTBitMon_QueryRunRegistry::string, theTrackQuality_, tok_bs_, tok_EB_, tok_EE_, tok_genTrack_, tok_hbhe_, tok_hltGT_, tok_recVtx_, tok_trigEvt_, tok_trigRes_, and trigNames_.

135  :
136  nRun_(0), nAll_(0), nGood_(0) {
137  //Get the run parameters
138  const double isolationRadius(28.9);
139  trigNames_ = iConfig.getParameter<std::vector<std::string> >("Triggers");
140  theTrackQuality_ = iConfig.getParameter<std::string>("TrackQuality");
141  processName_ = iConfig.getParameter<std::string>("ProcessName");
142  maxRestrictionPt_ = iConfig.getParameter<double>("MinTrackPt");
143  slopeRestrictionPt_ = iConfig.getParameter<double>("SlopeTrackPt");
144  selectionParameter_.minPt = (slopeRestrictionPt_ > 0) ? (maxRestrictionPt_ - 2.5/slopeRestrictionPt_) : maxRestrictionPt_;
146  selectionParameter_.maxDxyPV = iConfig.getParameter<double>("MaxDxyPV");
147  selectionParameter_.maxDzPV = iConfig.getParameter<double>("MaxDzPV");
148  selectionParameter_.maxChi2 = iConfig.getParameter<double>("MaxChi2");
149  selectionParameter_.maxDpOverP = iConfig.getParameter<double>("MaxDpOverP");
150  selectionParameter_.minOuterHit = iConfig.getParameter<int>("MinOuterHit");
151  selectionParameter_.minLayerCrossed = iConfig.getParameter<int>("MinLayerCrossed");
152  selectionParameter_.maxInMiss = iConfig.getParameter<int>("MaxInMiss");
153  selectionParameter_.maxOutMiss = iConfig.getParameter<int>("MaxOutMiss");
154  a_coneR_ = iConfig.getParameter<double>("ConeRadius");
155  a_charIsoR_ = a_coneR_ + isolationRadius;
156  a_mipR_ = iConfig.getParameter<double>("ConeRadiusMIP");
157  pTrackMin_ = iConfig.getParameter<double>("MinimumTrackP");
158  eEcalMax_ = iConfig.getParameter<double>("MaximumEcalEnergy");
159  eIsolation_ = iConfig.getParameter<double>("IsolationEnergy");
160  labelGenTrack_ = iConfig.getParameter<edm::InputTag>("TrackLabel");
161  labelRecVtx_ = iConfig.getParameter<edm::InputTag>("VertexLabel");
162  labelBS_ = iConfig.getParameter<edm::InputTag>("BeamSpotLabel");
163  labelEB_ = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
164  labelEE_ = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
165  labelHBHE_ = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
166  labelHltGT_ = iConfig.getParameter<edm::InputTag>("L1GTSeedLabel");
167  labelTriggerEvent_ = iConfig.getParameter<edm::InputTag>("TriggerEventLabel");
168  labelTriggerResults_ = iConfig.getParameter<edm::InputTag>("TriggerResultLabel");
169  labelIsoTk_ = iConfig.getParameter<std::string>("IsoTrackLabel");
170 
171  // define tokens for access
172  tok_hltGT_ = consumes<trigger::TriggerFilterObjectWithRefs>(labelHltGT_);
173  tok_trigEvt_ = consumes<trigger::TriggerEvent>(labelTriggerEvent_);
174  tok_trigRes_ = consumes<edm::TriggerResults>(labelTriggerResults_);
175  tok_genTrack_ = consumes<reco::TrackCollection>(labelGenTrack_);
176  tok_recVtx_ = consumes<reco::VertexCollection>(labelRecVtx_);
177  tok_bs_ = consumes<reco::BeamSpot>(labelBS_);
178  tok_EB_ = consumes<EcalRecHitCollection>(labelEB_);
179  tok_EE_ = consumes<EcalRecHitCollection>(labelEE_);
180  tok_hbhe_ = consumes<HBHERecHitCollection>(labelHBHE_);
181 
182  edm::LogInfo("HcalIsoTrack") <<"Parameters read from config file \n"
183  <<"\t minPt " << maxRestrictionPt_
184  <<":" << slopeRestrictionPt_
185  <<"\t theTrackQuality " << theTrackQuality_
186  <<"\t minQuality " << selectionParameter_.minQuality
187  <<"\t maxDxyPV " << selectionParameter_.maxDxyPV
188  <<"\t maxDzPV " << selectionParameter_.maxDzPV
189  <<"\t maxChi2 " << selectionParameter_.maxChi2
190  <<"\t maxDpOverP " << selectionParameter_.maxDpOverP
191  <<"\t minOuterHit " << selectionParameter_.minOuterHit
192  <<"\t minLayerCrossed " << selectionParameter_.minLayerCrossed
193  <<"\t maxInMiss " << selectionParameter_.maxInMiss
194  <<"\t maxOutMiss " << selectionParameter_.maxOutMiss
195  <<"\t a_coneR " << a_coneR_
196  <<"\t a_charIsoR " << a_charIsoR_
197  <<"\t a_mipR " << a_mipR_
198  <<"\t pTrackMin " << pTrackMin_
199  <<"\t eEcalMax " << eEcalMax_
200  <<"\t eIsolation " << eIsolation_
201  << "\tProcess " << processName_;
202  for (unsigned int k=0; k<trigNames_.size(); ++k)
203  edm::LogInfo("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k];
204 
205  //create also IsolatedPixelTrackCandidateCollection which contains isolation info and reference to primary track
206  produces<reco::HcalIsolatedTrackCandidateCollection>(labelIsoTk_);
207  produces<reco::VertexCollection>(labelRecVtx_.label());
208  produces<EcalRecHitCollection>(labelEB_.instance());
209  produces<EcalRecHitCollection>(labelEE_.instance());
210  produces<HBHERecHitCollection>(labelHBHE_.label());
211 
212  edm::LogInfo("HcalIsoTrack") << " Expected to produce the collections:\n"
213  << "reco::HcalIsolatedTrackCandidateCollection "
214  << " with label HcalIsolatedTrackCollection\n"
215  << "reco::VertexCollection with label " << labelRecVtx_.label() << "\n"
216  << "EcalRecHitCollection with label EcalRecHitsEB\n"
217  << "EcalRecHitCollection with label EcalRecHitsEE\n"
218  << "HBHERecHitCollection with label " << labelHBHE_.label();
219 }
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_
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
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 ( )

Definition at line 222 of file AlCaIsoTracksProducer.cc.

222 { }

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 376 of file AlCaIsoTracksProducer.cc.

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

376  {
377  bool changed(false);
378  edm::LogInfo("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run()
379  << " hltconfig.init " << hltConfig_.init(iRun,iSetup,processName_,changed);
380 
382  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
383  bField = bFieldH.product();
385  iSetup.get<CaloGeometryRecord>().get(pG);
386  geo = pG.product();
387 }
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:86
void AlCaIsoTracksProducer::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 389 of file AlCaIsoTracksProducer.cc.

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

389  {
390  edm::LogInfo("HcalIsoTrack") << "endRun [" << nRun_ << "] " << iRun.run();
391  ++nRun_;
392 }
void AlCaIsoTracksProducer::endStream ( )
overridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 366 of file AlCaIsoTracksProducer.cc.

References nAll_, and nGood_.

366  {
367  globalCache()->nAll_ += nAll_;
368  globalCache()->nGood_ += nGood_;
369 }
void AlCaIsoTracksProducer::globalEndJob ( const AlCaIsoTracks::Counters counters)
static

Definition at line 371 of file AlCaIsoTracksProducer.cc.

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

371  {
372  edm::LogInfo("HcalIsoTrack") << "Finds " << count->nGood_ <<" good tracks in "
373  << count->nAll_ << " events";
374 }
static std::unique_ptr<AlCaIsoTracks::Counters> AlCaIsoTracksProducer::initializeGlobalCache ( edm::ParameterSet const &  )
inlinestatic

Definition at line 92 of file AlCaIsoTracksProducer.cc.

92  {
93  return std::unique_ptr<AlCaIsoTracks::Counters>(new AlCaIsoTracks::Counters());
94  }
void AlCaIsoTracksProducer::produce ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 225 of file AlCaIsoTracksProducer.cc.

References edm::EventBase::bunchCrossing(), edm::EventID::event(), edm::Event::getByToken(), edm::EventBase::id(), edm::InputTag::instance(), edm::HandleBase::isValid(), edm::InputTag::label(), labelEB_, labelEE_, labelGenTrack_, labelHBHE_, labelIsoTk_, labelRecVtx_, labelTriggerEvent_, labelTriggerResults_, edm::EventBase::luminosityBlock(), nAll_, nGood_, edm::Handle< T >::product(), 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, x, y, and z.

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

225  {
226 
227  nAll_++;
228 #ifdef DebugLog
229  edm::LogInfo("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event "
230  << iEvent.id().event() << " Luminosity "
231  << iEvent.luminosityBlock() << " Bunch "
232  << iEvent.bunchCrossing();
233 #endif
234  bool valid(true);
235  //Step1: Get all the relevant containers
236  trigger::TriggerEvent triggerEvent;
237  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
238  iEvent.getByToken(tok_trigEvt_, triggerEventHandle);
239  if (!triggerEventHandle.isValid()) {
240  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelTriggerEvent_;
241  valid = false;
242  }
244  iEvent.getByToken(tok_trigRes_, triggerResults);
245  if (!triggerResults.isValid()) {
246  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelTriggerResults_;
247  valid = false;
248  }
249 
251  iEvent.getByToken(tok_genTrack_, trkCollection);
252  if (!trkCollection.isValid()) {
253  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_;
254  valid = false;
255  }
256  reco::TrackCollection::const_iterator trkItr;
257 
259  iEvent.getByToken(tok_recVtx_, recVtxs);
260  if (!recVtxs.isValid()) {
261  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_;
262  valid = false;
263  }
264 
265  edm::Handle<reco::BeamSpot> beamSpotH;
266  iEvent.getByToken(tok_bs_, beamSpotH);
267  math::XYZPoint leadPV(0,0,0);
268  if (valid) {
269  if (recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
270  leadPV = math::XYZPoint((*recVtxs)[0].x(),(*recVtxs)[0].y(),
271  (*recVtxs)[0].z());
272  } else if (beamSpotH.isValid()) {
273  leadPV = beamSpotH->position();
274  }
275  }
276 #ifdef DebugLog
277  edm::LogInfo("HcalIsoTrack") << "Primary Vertex " << leadPV;
278 #endif
279 
280  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
281  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
282  if (!barrelRecHitsHandle.isValid()) {
283  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEB_;
284  valid = false;
285  }
286  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
287  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
288  if (!endcapRecHitsHandle.isValid()) {
289  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEE_;
290  valid = false;
291  }
293  iEvent.getByToken(tok_hbhe_, hbhe);
294  if (!hbhe.isValid()) {
295  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelHBHE_;
296  valid = false;
297  }
298 
299  //Get L1 trigger object
300  double ptL1(0), etaL1(0), phiL1(0);
302  iEvent.getByToken(tok_hltGT_, l1trigobj);
303 
304  if (l1trigobj.isValid()) {
305  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1tauobjref;
306  l1trigobj->getObjects(trigger::TriggerL1TauJet, l1tauobjref);
307  setPtEtaPhi(l1tauobjref,ptL1,etaL1,phiL1);
308 
309  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1jetobjref;
310  l1trigobj->getObjects(trigger::TriggerL1CenJet, l1jetobjref);
311  setPtEtaPhi(l1jetobjref,ptL1,etaL1,phiL1);
312 
313  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1forjetobjref;
314  l1trigobj->getObjects(trigger::TriggerL1ForJet, l1forjetobjref);
315  setPtEtaPhi(l1forjetobjref,ptL1,etaL1,phiL1);
316  } else {
317  valid = false;
318  }
319 
320  std::auto_ptr<reco::HcalIsolatedTrackCandidateCollection> outputHcalIsoTrackColl(new reco::HcalIsolatedTrackCandidateCollection);
321  std::auto_ptr<reco::VertexCollection> outputVColl(new reco::VertexCollection);
322  std::auto_ptr<EBRecHitCollection> outputEBColl(new EBRecHitCollection);
323  std::auto_ptr<EERecHitCollection> outputEEColl(new EERecHitCollection);
324  std::auto_ptr<HBHERecHitCollection> outputHBHEColl(new HBHERecHitCollection);
325 
326  //For valid HLT record
327  if (!valid) {
328  edm::LogWarning("HcalIsoTrack") << "Error! Can't get some of the products";
329  } else {
330  trigger::TriggerEvent triggerEvent = *(triggerEventHandle.product());
331  if (triggerResults.isValid()) {
332  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
333  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
334  reco::HcalIsolatedTrackCandidateCollection* isotk = select(triggerResults, triggerNames_, trkCollection, leadPV, barrelRecHitsHandle, endcapRecHitsHandle, hbhe, ptL1, etaL1, phiL1);
335 #ifdef DebugLog
336  edm::LogInfo("HcalIsoTrack") << "AlCaIsoTracksProducer::select returns "
337  << isotk->size() << " isolated tracks";
338 #endif
339 
340  if (isotk->size() > 0) {
341  for (reco::HcalIsolatedTrackCandidateCollection::const_iterator itr=isotk->begin(); itr!=isotk->end(); ++itr)
342  outputHcalIsoTrackColl->push_back(*itr);
343 
344  for (reco::VertexCollection::const_iterator vtx=recVtxs->begin(); vtx!=recVtxs->end(); ++vtx)
345  outputVColl->push_back(*vtx);
346 
347  for (edm::SortedCollection<EcalRecHit>::const_iterator ehit=barrelRecHitsHandle->begin(); ehit!=barrelRecHitsHandle->end(); ++ehit)
348  outputEBColl->push_back(*ehit);
349 
350  for (edm::SortedCollection<EcalRecHit>::const_iterator ehit=endcapRecHitsHandle->begin(); ehit!=endcapRecHitsHandle->end(); ++ehit)
351  outputEEColl->push_back(*ehit);
352 
353  for (std::vector<HBHERecHit>::const_iterator hhit=hbhe->begin(); hhit!=hbhe->end(); ++hhit)
354  outputHBHEColl->push_back(*hhit);
355  ++nGood_;
356  }
357  }
358  }
359  iEvent.put(outputHcalIsoTrackColl, labelIsoTk_);
360  iEvent.put(outputVColl, labelRecVtx_.label());
361  iEvent.put(outputEBColl, labelEB_.instance());
362  iEvent.put(outputEEColl, labelEE_.instance());
363  iEvent.put(outputHBHEColl, labelHBHE_.label());
364 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:215
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:462
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
std::vector< T >::const_iterator const_iterator
int bunchCrossing() const
Definition: EventBase.h:65
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:62
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
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:41
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
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:59
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
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 395 of file AlCaIsoTracksProducer.cc.

References a_charIsoR_, a_mipR_, funct::abs(), bField, spr::chargeIsolationCone(), spr::eCone_ecal(), eEcalMax_, eIsolation_, reco::TrackBase::eta(), spr::find(), geo, spr::goodTrack(), runregparse::hlt, i, HcalDetId::ieta(), HcalDetId::iphi(), maxRestrictionPt_, spr::trackSelectionParameters::minPt, 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(), slopeRestrictionPt_, theTrackQuality_, HLT_25ns10e33_v2_cff::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().

401  {
402 
404  bool ok(false);
405 
406  // Find a good HLT trigger
407  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
408  int hlt = triggerResults->accept(iHLT);
409  for (unsigned int i=0; i<trigNames_.size(); ++i) {
410  if (triggerNames_[iHLT].find(trigNames_[i].c_str())!=std::string::npos) {
411  if (hlt > 0) {
412  ok = true;
413  }
414  edm::LogInfo("HcalIsoTrack") << "The trigger we are looking for "
415  << triggerNames_[iHLT] << " Flag "
416  << hlt << ":" << ok;
417  }
418  }
419  }
420 
421  //Propagate tracks to calorimeter surface)
422  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
424  trkCaloDirections, false);
425 
426  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
427  unsigned int nTracks(0), nselTracks(0);
428  for (trkDetItr = trkCaloDirections.begin(),nTracks=0;
429  trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++) {
430  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
431  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(),
432  pTrack->pz(), pTrack->p());
433 #ifdef DebugLog
434  edm::LogInfo("HcalIsoTrack") << "This track : " << nTracks
435  << " (pt|eta|phi|p) :" << pTrack->pt()
436  << "|" << pTrack->eta() << "|"
437  << pTrack->phi() << "|" << pTrack->p();
438 #endif
439  //Selection of good track
441  bool qltyFlag = spr::goodTrack(pTrack,leadPV,selectionParameter_,false);
442 #ifdef DebugLog
443  edm::LogInfo("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << qltyFlag
444  << "|" << trkDetItr->okECAL << "|"
445  << trkDetItr->okHCAL;
446 #endif
447  if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
448  double t_p = pTrack->p();
449  nselTracks++;
450  int nRH_eMipDR(0), nNearTRKs(0);
451  double eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
452  endcapRecHitsHandle,
453  trkDetItr->pointHCAL,
454  trkDetItr->pointECAL, a_mipR_,
455  trkDetItr->directionECAL,
456  nRH_eMipDR);
457  double hmaxNearP = spr::chargeIsolationCone(nTracks,
458  trkCaloDirections,
459  a_charIsoR_,
460  nNearTRKs, false);
461 #ifdef DebugLog
462  edm::LogInfo("HcalIsoTrack") << "This track : " << nTracks
463  << " (pt|eta|phi|p) :" << pTrack->pt()
464  << "|" << pTrack->eta() << "|"
465  << pTrack->phi() << "|" << t_p
466  << " e_MIP " << eMipDR
467  << " Chg Isolation " << hmaxNearP;
468 #endif
469  if (t_p>pTrackMin_ && eMipDR<eEcalMax_ && hmaxNearP<eIsolation_) {
470  reco::HcalIsolatedTrackCandidate newCandidate(v4);
471  newCandidate.SetMaxP(hmaxNearP);
472  newCandidate.SetEnergyEcal(eMipDR);
473  newCandidate.setL1(ptL1,etaL1,phiL1);
474  newCandidate.SetEtaPhiEcal((trkDetItr->pointECAL).eta(),
475  (trkDetItr->pointECAL).phi());
476  HcalDetId detId = HcalDetId(trkDetItr->detIdHCAL);
477  newCandidate.SetEtaPhiHcal((trkDetItr->pointHCAL).eta(),
478  (trkDetItr->pointHCAL).phi(),
479  detId.ieta(), detId.iphi());
480  int indx(0);
481  reco::TrackCollection::const_iterator trkItr1;
482  for (trkItr1=trkCollection->begin(); trkItr1 != trkCollection->end(); ++trkItr1,++indx) {
483  const reco::Track* pTrack1 = &(*trkItr1);
484  if (pTrack1 == pTrack) {
485  reco::TrackRef tRef = reco::TrackRef(trkCollection,indx);
486  newCandidate.setTrack(tRef);
487  break;
488  }
489  }
490  trackCollection->push_back(newCandidate);
491  }
492  }
493  }
494  return trackCollection;
495 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
int i
Definition: DBlmapReader.cc:9
const unsigned int nTracks(const reco::Vertex &sv)
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
const CaloGeometry * geo
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:640
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:622
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
std::vector< HcalIsolatedTrackCandidate > HcalIsolatedTrackCandidateCollection
collectin of HcalIsolatedTrackCandidate objects
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
double pt() const
track transverse momentum
Definition: TrackBase.h:616
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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:634
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:124
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:628
void AlCaIsoTracksProducer::setPtEtaPhi ( std::vector< edm::Ref< l1extra::L1JetParticleCollection > > &  objref,
double &  ptL1,
double &  etaL1,
double &  phiL1 
)
private

Definition at line 497 of file AlCaIsoTracksProducer.cc.

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

Referenced by produce().

497  {
498 
499  for (unsigned int p=0; p<objref.size(); p++) {
500  if (objref[p]->pt()>ptL1) {
501  ptL1 = objref[p]->pt();
502  phiL1 = objref[p]->phi();
503  etaL1 = objref[p]->eta();
504  }
505  }
506 }

Member Data Documentation

double AlCaIsoTracksProducer::a_charIsoR_
private

Definition at line 114 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

double AlCaIsoTracksProducer::a_coneR_
private

Definition at line 114 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

double AlCaIsoTracksProducer::a_mipR_
private

Definition at line 114 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

const MagneticField* AlCaIsoTracksProducer::bField
private

Definition at line 120 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun(), and select().

double AlCaIsoTracksProducer::eEcalMax_
private

Definition at line 115 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

double AlCaIsoTracksProducer::eIsolation_
private

Definition at line 115 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

const CaloGeometry* AlCaIsoTracksProducer::geo
private

Definition at line 121 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun(), and select().

HLTConfigProvider AlCaIsoTracksProducer::hltConfig_
private

Definition at line 108 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun().

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

Definition at line 109 of file AlCaIsoTracksProducer.cc.

edm::InputTag AlCaIsoTracksProducer::labelBS_
private

Definition at line 118 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

edm::InputTag AlCaIsoTracksProducer::labelEB_
private

Definition at line 118 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelEE_
private

Definition at line 118 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelGenTrack_
private

Definition at line 117 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelHBHE_
private

Definition at line 118 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelHltGT_
private

Definition at line 117 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

std::string AlCaIsoTracksProducer::labelIsoTk_
private

Definition at line 119 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelRecVtx_
private

Definition at line 117 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelTriggerEvent_
private

Definition at line 116 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelTriggerResults_
private

Definition at line 116 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::maxRestrictionPt_
private

Definition at line 113 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

unsigned int AlCaIsoTracksProducer::nAll_
private

Definition at line 110 of file AlCaIsoTracksProducer.cc.

Referenced by endStream(), and produce().

unsigned int AlCaIsoTracksProducer::nGood_
private

Definition at line 110 of file AlCaIsoTracksProducer.cc.

Referenced by endStream(), and produce().

unsigned int AlCaIsoTracksProducer::nRun_
private

Definition at line 110 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun(), and endRun().

std::string AlCaIsoTracksProducer::processName_
private

Definition at line 112 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and beginRun().

double AlCaIsoTracksProducer::pTrackMin_
private

Definition at line 115 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

spr::trackSelectionParameters AlCaIsoTracksProducer::selectionParameter_
private

Definition at line 111 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

double AlCaIsoTracksProducer::slopeRestrictionPt_
private

Definition at line 113 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

std::string AlCaIsoTracksProducer::theTrackQuality_
private

Definition at line 112 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

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

Definition at line 128 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 129 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 130 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 126 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 131 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 123 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 127 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 124 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 125 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 109 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().