CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
AlCaIsoTracksProducer Class Reference
Inheritance diagram for AlCaIsoTracksProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AlCaIsoTracksProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~AlCaIsoTracksProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

Private Member Functions

virtual void beginJob ()
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void endJob ()
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
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)
 
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_
 
double etaL1
 
const CaloGeometrygeo
 
HLTConfigProvider hltConfig_
 
std::vector< std::string > HLTNames
 
std::string l1Filter
 
std::string l2Filter
 
std::string l3Filter
 
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_
 
int nAll
 
int nGood
 
int nRun
 
double phiL1
 
std::string processName
 
double ptL1
 
double pTrackMin_
 
spr::trackSelectionParameters selectionParameters
 
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< int > trigKount
 
std::vector< std::string > trigNames
 
std::vector< int > trigPass
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 79 of file AlCaIsoTracksProducer.cc.

Constructor & Destructor Documentation

AlCaIsoTracksProducer::AlCaIsoTracksProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 125 of file AlCaIsoTracksProducer.cc.

References a_charIsoR, a_coneR, a_mipR, eEcalMax_, eIsolation_, edm::ParameterSet::getParameter(), edm::InputTag::instance(), relval_steps::k, l1Filter, l2Filter, l3Filter, 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, spr::trackSelectionParameters::minLayerCrossed, spr::trackSelectionParameters::minOuterHit, spr::trackSelectionParameters::minPt, spr::trackSelectionParameters::minQuality, processName, pTrackMin_, reco::TrackBase::qualityByName(), selectionParameters, AlCaHLTBitMon_QueryRunRegistry::string, theTrackQuality, tok_bs_, tok_EB_, tok_EE_, tok_genTrack_, tok_hbhe_, tok_hltGT_, tok_recVtx_, tok_trigEvt_, tok_trigRes_, trigKount, trigNames, and trigPass.

125  :
126  nRun(0), nAll(0), nGood(0), ptL1(0), etaL1(0), phiL1(0) {
127  //Get the run parameters
128  const double isolationRadius(28.9);
129  trigNames = iConfig.getParameter<std::vector<std::string> >("Triggers");
130  theTrackQuality = iConfig.getParameter<std::string>("TrackQuality");
131  processName = iConfig.getParameter<std::string>("ProcessName");
132  l1Filter = iConfig.getParameter<std::string>("L1Filter");
133  l2Filter = iConfig.getParameter<std::string>("L2Filter");
134  l3Filter = iConfig.getParameter<std::string>("L3Filter");
135  selectionParameters.minPt = iConfig.getParameter<double>("MinTrackPt");
137  selectionParameters.maxDxyPV = iConfig.getParameter<double>("MaxDxyPV");
138  selectionParameters.maxDzPV = iConfig.getParameter<double>("MaxDzPV");
139  selectionParameters.maxChi2 = iConfig.getParameter<double>("MaxChi2");
140  selectionParameters.maxDpOverP = iConfig.getParameter<double>("MaxDpOverP");
141  selectionParameters.minOuterHit = iConfig.getParameter<int>("MinOuterHit");
142  selectionParameters.minLayerCrossed = iConfig.getParameter<int>("MinLayerCrossed");
143  selectionParameters.maxInMiss = iConfig.getParameter<int>("MaxInMiss");
144  selectionParameters.maxOutMiss = iConfig.getParameter<int>("MaxOutMiss");
145  a_coneR = iConfig.getParameter<double>("ConeRadius");
146  a_charIsoR = a_coneR + isolationRadius;
147  a_mipR = iConfig.getParameter<double>("ConeRadiusMIP");
148  pTrackMin_ = iConfig.getParameter<double>("MinimumTrackP");
149  eEcalMax_ = iConfig.getParameter<double>("MaximumEcalEnergy");
150  eIsolation_ = iConfig.getParameter<double>("IsolationEnergy");
151  labelGenTrack_ = iConfig.getParameter<edm::InputTag>("TrackLabel");
152  labelRecVtx_ = iConfig.getParameter<edm::InputTag>("VertexLabel");
153  labelBS_ = iConfig.getParameter<edm::InputTag>("BeamSpotLabel");
154  labelEB_ = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
155  labelEE_ = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
156  labelHBHE_ = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
157  labelHltGT_ = iConfig.getParameter<edm::InputTag>("L1GTSeedLabel");
158  labelTriggerEvent_ = iConfig.getParameter<edm::InputTag>("TriggerEventLabel");
159  labelTriggerResults_ = iConfig.getParameter<edm::InputTag>("TriggerResultLabel");
160  labelIsoTk_ = iConfig.getParameter<std::string>("IsoTrackLabel");
161 
162  // define tokens for access
163  tok_hltGT_ = consumes<trigger::TriggerFilterObjectWithRefs>(labelHltGT_);
164  tok_trigEvt_ = consumes<trigger::TriggerEvent>(labelTriggerEvent_);
165  tok_trigRes_ = consumes<edm::TriggerResults>(labelTriggerResults_);
166  tok_genTrack_ = consumes<reco::TrackCollection>(labelGenTrack_);
167  tok_recVtx_ = consumes<reco::VertexCollection>(labelRecVtx_);
168  tok_bs_ = consumes<reco::BeamSpot>(labelBS_);
169  tok_EB_ = consumes<EcalRecHitCollection>(labelEB_);
170  tok_EE_ = consumes<EcalRecHitCollection>(labelEE_);
171  tok_hbhe_ = consumes<HBHERecHitCollection>(labelHBHE_);
172 
173  edm::LogInfo("HcalIsoTrack") <<"Parameters read from config file \n"
174  <<"\t minPt " << selectionParameters.minPt
175  <<"\t theTrackQuality " << theTrackQuality
176  <<"\t minQuality " << selectionParameters.minQuality
177  <<"\t maxDxyPV " << selectionParameters.maxDxyPV
178  <<"\t maxDzPV " << selectionParameters.maxDzPV
179  <<"\t maxChi2 " << selectionParameters.maxChi2
180  <<"\t maxDpOverP " << selectionParameters.maxDpOverP
181  <<"\t minOuterHit " << selectionParameters.minOuterHit
182  <<"\t minLayerCrossed " << selectionParameters.minLayerCrossed
183  <<"\t maxInMiss " << selectionParameters.maxInMiss
184  <<"\t maxOutMiss " << selectionParameters.maxOutMiss
185  <<"\t a_coneR " << a_coneR
186  <<"\t a_charIsoR " << a_charIsoR
187  <<"\t a_mipR " << a_mipR
188  <<"\t pTrackMin " << pTrackMin_
189  <<"\t eEcalMax " << eEcalMax_
190  <<"\t eIsolation " << eIsolation_;
191  edm::LogInfo("HcalIsoTrack") << "Process " << processName << " L1Filter:"
192  << l1Filter << " L2Filter:" << l2Filter
193  << " L3Filter:" << l3Filter;
194  for (unsigned int k=0; k<trigNames.size(); ++k)
195  edm::LogInfo("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames[k];
196 
197  std::vector<int> dummy(trigNames.size(),0);
198  trigKount = trigPass = dummy;
199 
200  //create also IsolatedPixelTrackCandidateCollection which contains isolation info and reference to primary track
201  produces<reco::HcalIsolatedTrackCandidateCollection>(labelIsoTk_);
202  produces<reco::VertexCollection>(labelRecVtx_.label());
203  produces<EcalRecHitCollection>(labelEB_.instance());
204  produces<EcalRecHitCollection>(labelEE_.instance());
205  produces<HBHERecHitCollection>(labelHBHE_.label());
206 
207  edm::LogInfo("HcalIsoTrack") << " Expected to produce the collections:\n"
208  << "reco::HcalIsolatedTrackCandidateCollection "
209  << " with label HcalIsolatedTrackCollection\n"
210  << "reco::VertexCollection with label " << labelRecVtx_.label() << "\n"
211  << "EcalRecHitCollection with label EcalRecHitsEB\n"
212  << "EcalRecHitCollection with label EcalRecHitsEE\n"
213  << "HBHERecHitCollection with label " << labelHBHE_.label();
214 }
T getParameter(std::string const &) const
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
spr::trackSelectionParameters selectionParameters
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hltGT_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::vector< std::string > trigNames
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< int > trigPass
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:114
std::string const & label() const
Definition: InputTag.h:42
std::vector< int > trigKount
reco::TrackBase::TrackQuality minQuality
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
std::string const & instance() const
Definition: InputTag.h:43
AlCaIsoTracksProducer::~AlCaIsoTracksProducer ( )

Definition at line 217 of file AlCaIsoTracksProducer.cc.

217 { }

Member Function Documentation

void AlCaIsoTracksProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 350 of file AlCaIsoTracksProducer.cc.

350 { }
void AlCaIsoTracksProducer::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 361 of file AlCaIsoTracksProducer.cc.

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

361  {
362  bool changed(false);
363  edm::LogInfo("HcalIsoTrack") << "Run[" << nRun << "] " << iRun.run()
364  << " hltconfig.init " << hltConfig_.init(iRun,iSetup,processName,changed);
365 
367  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
368  bField = bFieldH.product();
370  iSetup.get<CaloGeometryRecord>().get(pG);
371  geo = pG.product();
372 }
const CaloGeometry * geo
const MagneticField * bField
HLTConfigProvider hltConfig_
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::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 352 of file AlCaIsoTracksProducer.cc.

References relval_steps::k, nAll, nGood, nRun, trigKount, trigNames, and trigPass.

352  {
353  edm::LogInfo("HcalIsoTrack") << "Finds " << nGood << " good tracks in "
354  << nAll << " events from " << nRun << " runs";
355  for (unsigned int k=0; k<trigNames.size(); ++k)
356  edm::LogInfo("HcalIsoTrack") << "Trigger[" << k << "]: " << trigNames[k]
357  << " Events " << trigKount[k] << " Passed "
358  << trigPass[k];
359 }
std::vector< std::string > trigNames
std::vector< int > trigPass
std::vector< int > trigKount
void AlCaIsoTracksProducer::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 374 of file AlCaIsoTracksProducer.cc.

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

374  {
375  nRun++;
376  edm::LogInfo("HcalIsoTrack") << "endRun[" << nRun << "] " << iRun.run();
377 }
void AlCaIsoTracksProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 220 of file AlCaIsoTracksProducer.cc.

References edm::EventBase::bunchCrossing(), etaL1, 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, phiL1, edm::Handle< T >::product(), ptL1, 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, detailsBasic3DVector::y, and detailsBasic3DVector::z.

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

220  {
221 
222  nAll++;
223 #ifdef DebugLog
224  edm::LogInfo("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event "
225  << iEvent.id().event() << " Luminosity "
226  << iEvent.luminosityBlock() << " Bunch "
227  << iEvent.bunchCrossing();
228 #endif
229  //Step1: Get all the relevant containers
230  trigger::TriggerEvent triggerEvent;
231  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
232  iEvent.getByToken(tok_trigEvt_, triggerEventHandle);
233  if (!triggerEventHandle.isValid()) {
234  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelTriggerEvent_;
235  return;
236  }
238  iEvent.getByToken(tok_trigRes_, triggerResults);
239  if (!triggerResults.isValid()) {
240  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelTriggerResults_;
241  return;
242  }
243 
245  iEvent.getByToken(tok_genTrack_, trkCollection);
246  if (!trkCollection.isValid()) {
247  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_;
248  return;
249  }
250  reco::TrackCollection::const_iterator trkItr;
252  iEvent.getByToken(tok_recVtx_, recVtxs);
253  if (!trkCollection.isValid()) {
254  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_;
255  return;
256  }
257 
258  edm::Handle<reco::BeamSpot> beamSpotH;
259  iEvent.getByToken(tok_bs_, beamSpotH);
260  math::XYZPoint leadPV(0,0,0);
261  if (recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
262  leadPV = math::XYZPoint((*recVtxs)[0].x(),(*recVtxs)[0].y(),
263  (*recVtxs)[0].z());
264  } else if (beamSpotH.isValid()) {
265  leadPV = beamSpotH->position();
266  }
267 #ifdef DebugLog
268  edm::LogInfo("HcalIsoTrack") << "Primary Vertex " << leadPV;
269 #endif
270 
271  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
272  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
273  if (!barrelRecHitsHandle.isValid()) {
274  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEB_;
275  return;
276  }
277  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
278  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
279  if (!endcapRecHitsHandle.isValid()) {
280  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEE_;
281  return;
282  }
284  iEvent.getByToken(tok_hbhe_, hbhe);
285  if (!hbhe.isValid()) {
286  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelHBHE_;
287  return;
288  }
289 
290  //Get L1 trigger object
291  ptL1 = etaL1 = phiL1 = 0;
293  iEvent.getByToken(tok_hltGT_, l1trigobj);
294 
295  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1tauobjref;
296  l1trigobj->getObjects(trigger::TriggerL1TauJet, l1tauobjref);
297  setPtEtaPhi(l1tauobjref,ptL1,etaL1,phiL1);
298 
299  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1jetobjref;
300  l1trigobj->getObjects(trigger::TriggerL1CenJet, l1jetobjref);
301  setPtEtaPhi(l1jetobjref,ptL1,etaL1,phiL1);
302 
303  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1forjetobjref;
304  l1trigobj->getObjects(trigger::TriggerL1ForJet, l1forjetobjref);
305  setPtEtaPhi(l1forjetobjref,ptL1,etaL1,phiL1);
306 
307  //For valid HLT record
308  if (!triggerEventHandle.isValid()) {
309  edm::LogWarning("HcalIsoTrack") << "Error! Can't get the product "
311  } else {
312  trigger::TriggerEvent triggerEvent = *(triggerEventHandle.product());
313  if (triggerResults.isValid()) {
314  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
315  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
316  reco::HcalIsolatedTrackCandidateCollection* isotk = select(triggerResults,triggerNames_,trkCollection,leadPV, barrelRecHitsHandle, endcapRecHitsHandle, hbhe);
317 #ifdef DebugLog
318  edm::LogInfo("HcalIsoTrack") << "AlCaIsoTracksProducer::select returns "
319  << isotk->size() << " isolated tracks";
320 #endif
321  std::auto_ptr<reco::HcalIsolatedTrackCandidateCollection> outputHcalIsoTrackColl(isotk);
322  std::auto_ptr<reco::VertexCollection> outputVColl(new reco::VertexCollection);
323  std::auto_ptr<EBRecHitCollection> outputEBColl(new EBRecHitCollection);
324  std::auto_ptr<EERecHitCollection> outputEEColl(new EERecHitCollection);
325  std::auto_ptr<HBHERecHitCollection> outputHBHEColl(new HBHERecHitCollection);
326 
327  if (isotk->size() > 0) {
328  for (reco::VertexCollection::const_iterator vtx=recVtxs->begin(); vtx!=recVtxs->end(); ++vtx)
329  outputVColl->push_back(*vtx);
330 
331  for (edm::SortedCollection<EcalRecHit>::const_iterator ehit=barrelRecHitsHandle->begin(); ehit!=barrelRecHitsHandle->end(); ++ehit)
332  outputEBColl->push_back(*ehit);
333 
334  for (edm::SortedCollection<EcalRecHit>::const_iterator ehit=endcapRecHitsHandle->begin(); ehit!=endcapRecHitsHandle->end(); ++ehit)
335  outputEEColl->push_back(*ehit);
336 
337  for (std::vector<HBHERecHit>::const_iterator hhit=hbhe->begin(); hhit!=hbhe->end(); ++hhit)
338  outputHBHEColl->push_back(*hhit);
339  }
340 
341  iEvent.put(outputHcalIsoTrackColl, labelIsoTk_);
342  iEvent.put(outputVColl, labelRecVtx_.label());
343  iEvent.put(outputEBColl, labelEB_.instance());
344  iEvent.put(outputEEColl, labelEE_.instance());
345  iEvent.put(outputHBHEColl, labelHBHE_.label());
346  }
347  }
348 }
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:208
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:449
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
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
float float float z
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:113
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:40
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:42
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)
edm::EventID id() const
Definition: EventBase.h:60
Definition: DDAxes.h:10
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
std::string const & instance() const
Definition: InputTag.h:43
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 
)
private

Definition at line 380 of file AlCaIsoTracksProducer.cc.

References a_charIsoR, a_mipR, bField, spr::chargeIsolationCone(), spr::eCone_ecal(), eEcalMax_, eIsolation_, reco::TrackBase::eta(), etaL1, spr::find(), geo, spr::goodTrack(), runregparse::hlt, i, HcalDetId::ieta(), HcalDetId::iphi(), convertSQLiteXML::ok, reco::TrackBase::p(), phi, reco::TrackBase::phi(), phiL1, spr::propagateCALO(), reco::TrackBase::pt(), ptL1, pTrackMin_, reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), selectionParameters, reco::HcalIsolatedTrackCandidate::SetEnergyEcal(), reco::HcalIsolatedTrackCandidate::SetEtaPhiEcal(), reco::HcalIsolatedTrackCandidate::SetEtaPhiHcal(), reco::HcalIsolatedTrackCandidate::setL1(), reco::HcalIsolatedTrackCandidate::SetMaxP(), reco::HcalIsolatedTrackCandidate::setTrack(), theTrackQuality, HLT_25ns14e33_v3_cff::trackCollection, trigKount, trigNames, and trigPass.

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().

385  {
386 
388  bool ok(false);
389 
390  // Find a good HLT trigger
391  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
392  int hlt = triggerResults->accept(iHLT);
393  for (unsigned int i=0; i<trigNames.size(); ++i) {
394  if (triggerNames_[iHLT].find(trigNames[i].c_str())!=std::string::npos) {
395  trigKount[i]++;
396  if (hlt > 0) {
397  ok = true;
398  trigPass[i]++;
399  }
400  edm::LogInfo("HcalIsoTrack") << "The trigger we are looking for "
401  << triggerNames_[iHLT] << " Flag "
402  << hlt << ":" << ok;
403  }
404  }
405  }
406 
407  //Propagate tracks to calorimeter surface)
408  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
409  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality,
410  trkCaloDirections, false);
411 
412  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
413  unsigned int nTracks(0), nselTracks(0);
414  for (trkDetItr = trkCaloDirections.begin(),nTracks=0;
415  trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++) {
416  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
417  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(),
418  pTrack->pz(), pTrack->p());
419 #ifdef DebugLog
420  edm::LogInfo("HcalIsoTrack") << "This track : " << nTracks
421  << " (pt|eta|phi|p) :" << pTrack->pt()
422  << "|" << pTrack->eta() << "|"
423  << pTrack->phi() << "|" << pTrack->p();
424 #endif
425  //Selection of good track
426  bool qltyFlag = spr::goodTrack(pTrack,leadPV,selectionParameters,false);
427 #ifdef DebugLog
428  edm::LogInfo("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << qltyFlag
429  << "|" << trkDetItr->okECAL << "|"
430  << trkDetItr->okHCAL;
431 #endif
432  if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
433  double t_p = pTrack->p();
434  nselTracks++;
435  int nRH_eMipDR(0), nNearTRKs(0);
436  double eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
437  endcapRecHitsHandle,
438  trkDetItr->pointHCAL,
439  trkDetItr->pointECAL, a_mipR,
440  trkDetItr->directionECAL,
441  nRH_eMipDR);
442  double hmaxNearP = spr::chargeIsolationCone(nTracks,
443  trkCaloDirections,
444  a_charIsoR,
445  nNearTRKs, false);
446 #ifdef DebugLog
447  edm::LogInfo("HcalIsoTrack") << "This track : " << nTracks
448  << " (pt|eta|phi|p) :" << pTrack->pt()
449  << "|" << pTrack->eta() << "|"
450  << pTrack->phi() << "|" << t_p
451  << " e_MIP " << eMipDR
452  << " Chg Isolation " << hmaxNearP;
453 #endif
454  if (t_p>pTrackMin_ && eMipDR<eEcalMax_ && hmaxNearP<eIsolation_) {
455  reco::HcalIsolatedTrackCandidate newCandidate(v4);
456  newCandidate.SetMaxP(hmaxNearP);
457  newCandidate.SetEnergyEcal(eMipDR);
458  newCandidate.setL1(ptL1,etaL1,phiL1);
459  newCandidate.SetEtaPhiEcal((trkDetItr->pointECAL).eta(),
460  (trkDetItr->pointECAL).phi());
461  HcalDetId detId = HcalDetId(trkDetItr->detIdHCAL);
462  newCandidate.SetEtaPhiHcal((trkDetItr->pointHCAL).eta(),
463  (trkDetItr->pointHCAL).phi(),
464  detId.ieta(), detId.iphi());
465  int indx(0);
466  reco::TrackCollection::const_iterator trkItr1;
467  for (trkItr1=trkCollection->begin(); trkItr1 != trkCollection->end(); ++trkItr1,++indx) {
468  const reco::Track* pTrack1 = &(*trkItr1);
469  if (pTrack1 == pTrack) {
470  reco::TrackRef tRef = reco::TrackRef(trkCollection,indx);
471  newCandidate.setTrack(tRef);
472  break;
473  }
474  }
475  trackCollection->push_back(newCandidate);
476  }
477  }
478  }
479  return trackCollection;
480 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:568
int i
Definition: DBlmapReader.cc:9
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
spr::trackSelectionParameters selectionParameters
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:598
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:580
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
std::vector< std::string > trigNames
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:604
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:574
int ieta() const
get the cell ieta
Definition: HcalDetId.h:36
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
std::vector< int > trigPass
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:592
int iphi() const
get the cell iphi
Definition: HcalDetId.h:38
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:19
std::vector< int > trigKount
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:586
Definition: DDAxes.h:10
void AlCaIsoTracksProducer::setPtEtaPhi ( std::vector< edm::Ref< l1extra::L1JetParticleCollection > > &  objref,
double &  ptL1,
double &  etaL1,
double &  phiL1 
)
private

Definition at line 482 of file AlCaIsoTracksProducer.cc.

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

Referenced by produce().

482  {
483 
484  for (unsigned int p=0; p<objref.size(); p++) {
485  if (objref[p]->pt()>ptL1) {
486  ptL1 = objref[p]->pt();
487  phiL1 = objref[p]->phi();
488  etaL1 = objref[p]->eta();
489  }
490  }
491 }

Member Data Documentation

double AlCaIsoTracksProducer::a_charIsoR
private

Definition at line 102 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

double AlCaIsoTracksProducer::a_coneR
private

Definition at line 102 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

double AlCaIsoTracksProducer::a_mipR
private

Definition at line 102 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

const MagneticField* AlCaIsoTracksProducer::bField
private

Definition at line 109 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun(), and select().

double AlCaIsoTracksProducer::eEcalMax_
private

Definition at line 103 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

double AlCaIsoTracksProducer::eIsolation_
private

Definition at line 103 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

double AlCaIsoTracksProducer::etaL1
private

Definition at line 111 of file AlCaIsoTracksProducer.cc.

Referenced by produce(), and select().

const CaloGeometry* AlCaIsoTracksProducer::geo
private

Definition at line 110 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun(), and select().

HLTConfigProvider AlCaIsoTracksProducer::hltConfig_
private

Definition at line 96 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun().

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

Definition at line 97 of file AlCaIsoTracksProducer.cc.

std::string AlCaIsoTracksProducer::l1Filter
private

Definition at line 101 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

std::string AlCaIsoTracksProducer::l2Filter
private

Definition at line 101 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

std::string AlCaIsoTracksProducer::l3Filter
private

Definition at line 101 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

edm::InputTag AlCaIsoTracksProducer::labelBS_
private

Definition at line 107 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

edm::InputTag AlCaIsoTracksProducer::labelEB_
private

Definition at line 107 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelEE_
private

Definition at line 107 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelGenTrack_
private

Definition at line 106 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelHBHE_
private

Definition at line 107 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelHltGT_
private

Definition at line 106 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer().

std::string AlCaIsoTracksProducer::labelIsoTk_
private

Definition at line 108 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelRecVtx_
private

Definition at line 106 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelTriggerEvent_
private

Definition at line 105 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::InputTag AlCaIsoTracksProducer::labelTriggerResults_
private

Definition at line 105 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

int AlCaIsoTracksProducer::nAll
private

Definition at line 104 of file AlCaIsoTracksProducer.cc.

Referenced by endJob(), and produce().

int AlCaIsoTracksProducer::nGood
private

Definition at line 104 of file AlCaIsoTracksProducer.cc.

Referenced by endJob().

int AlCaIsoTracksProducer::nRun
private

Definition at line 104 of file AlCaIsoTracksProducer.cc.

Referenced by beginRun(), endJob(), and endRun().

double AlCaIsoTracksProducer::phiL1
private

Definition at line 111 of file AlCaIsoTracksProducer.cc.

Referenced by produce(), and select().

std::string AlCaIsoTracksProducer::processName
private
double AlCaIsoTracksProducer::ptL1
private

Definition at line 111 of file AlCaIsoTracksProducer.cc.

Referenced by produce(), select(), and setPtEtaPhi().

double AlCaIsoTracksProducer::pTrackMin_
private

Definition at line 103 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

spr::trackSelectionParameters AlCaIsoTracksProducer::selectionParameters
private

Definition at line 99 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

std::string AlCaIsoTracksProducer::theTrackQuality
private

Definition at line 100 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and select().

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

Definition at line 118 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 119 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 120 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 116 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 121 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 113 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 117 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 114 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 115 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

std::vector<int> AlCaIsoTracksProducer::trigKount
private

Definition at line 98 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), endJob(), and select().

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

Definition at line 97 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), endJob(), and select().

std::vector<int> AlCaIsoTracksProducer::trigPass
private

Definition at line 98 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), endJob(), and select().