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_
 
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 124 of file AlCaIsoTracksProducer.cc.

References a_charIsoR, a_coneR, a_mipR, eEcalMax_, eIsolation_, edm::InputTag::encode(), edm::ParameterSet::getParameter(), relval_steps::k, l1Filter, l2Filter, l3Filter, labelBS_, labelEB_, labelEE_, labelGenTrack_, labelHBHE_, labelHltGT_, 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.

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

Definition at line 208 of file AlCaIsoTracksProducer.cc.

208 { }

Member Function Documentation

void AlCaIsoTracksProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 340 of file AlCaIsoTracksProducer.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 351 of file AlCaIsoTracksProducer.cc.

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

351  {
352  bool changed(false);
353  edm::LogInfo("HcalIsoTrack") << "Run[" << nRun << "] " << iRun.run()
354  << " hltconfig.init " << hltConfig_.init(iRun,iSetup,processName,changed);
355 
357  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
358  bField = bFieldH.product();
360  iSetup.get<CaloGeometryRecord>().get(pG);
361  geo = pG.product();
362 }
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 342 of file AlCaIsoTracksProducer.cc.

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

342  {
343  edm::LogInfo("HcalIsoTrack") << "Finds " << nGood << " good tracks in "
344  << nAll << " events from " << nRun << " runs";
345  for (unsigned int k=0; k<trigNames.size(); ++k)
346  edm::LogInfo("HcalIsoTrack") << "Trigger[" << k << "]: " << trigNames[k]
347  << " Events " << trigKount[k] << " Passed "
348  << trigPass[k];
349 }
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 364 of file AlCaIsoTracksProducer.cc.

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

364  {
365  nRun++;
366  edm::LogInfo("HcalIsoTrack") << "endRun[" << nRun << "] " << iRun.run();
367 }
void AlCaIsoTracksProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 211 of file AlCaIsoTracksProducer.cc.

References edm::EventBase::bunchCrossing(), edm::InputTag::encode(), etaL1, edm::EventID::event(), edm::Event::getByToken(), edm::EventBase::id(), edm::HandleBase::isValid(), edm::InputTag::label(), labelEB_, labelEE_, labelGenTrack_, labelHBHE_, labelRecVtx_, labelTriggerEvent_, labelTriggerResults_, LogDebug, 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().

211  {
212 
213  nAll++;
214  LogDebug("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event "
215  << iEvent.id().event() << " Luminosity "
216  << iEvent.luminosityBlock() << " Bunch "
217  << iEvent.bunchCrossing();
218 
219  //Step1: Get all the relevant containers
220  trigger::TriggerEvent triggerEvent;
221  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
222  iEvent.getByToken(tok_trigEvt_, triggerEventHandle);
223  if (!triggerEventHandle.isValid()) {
224  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelTriggerEvent_;
225  return;
226  }
228  iEvent.getByToken(tok_trigRes_, triggerResults);
229  if (!triggerResults.isValid()) {
230  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelTriggerResults_;
231  return;
232  }
233 
235  iEvent.getByToken(tok_genTrack_, trkCollection);
236  if (!trkCollection.isValid()) {
237  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_;
238  return;
239  }
240  reco::TrackCollection::const_iterator trkItr;
242  iEvent.getByToken(tok_recVtx_, recVtxs);
243  if (!trkCollection.isValid()) {
244  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_;
245  return;
246  }
247 
248  edm::Handle<reco::BeamSpot> beamSpotH;
249  iEvent.getByToken(tok_bs_, beamSpotH);
250  math::XYZPoint leadPV(0,0,0);
251  if (recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
252  leadPV = math::XYZPoint((*recVtxs)[0].x(),(*recVtxs)[0].y(),
253  (*recVtxs)[0].z());
254  } else if (beamSpotH.isValid()) {
255  leadPV = beamSpotH->position();
256  }
257  LogDebug("HcalIsoTrack") << "Primary Vertex " << leadPV;
258 
259  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
260  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
261  if (!barrelRecHitsHandle.isValid()) {
262  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEB_;
263  return;
264  }
265  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
266  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
267  if (!endcapRecHitsHandle.isValid()) {
268  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEE_;
269  return;
270  }
272  iEvent.getByToken(tok_hbhe_, hbhe);
273  if (!hbhe.isValid()) {
274  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelHBHE_;
275  return;
276  }
277 
278  //Get L1 trigger object
279  ptL1 = etaL1 = phiL1 = 0;
281  iEvent.getByToken(tok_hltGT_, l1trigobj);
282 
283  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1tauobjref;
284  l1trigobj->getObjects(trigger::TriggerL1TauJet, l1tauobjref);
285  setPtEtaPhi(l1tauobjref,ptL1,etaL1,phiL1);
286 
287  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1jetobjref;
288  l1trigobj->getObjects(trigger::TriggerL1CenJet, l1jetobjref);
289  setPtEtaPhi(l1jetobjref,ptL1,etaL1,phiL1);
290 
291  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1forjetobjref;
292  l1trigobj->getObjects(trigger::TriggerL1ForJet, l1forjetobjref);
293  setPtEtaPhi(l1forjetobjref,ptL1,etaL1,phiL1);
294 
295  //For valid HLT record
296  if (!triggerEventHandle.isValid()) {
297  edm::LogWarning("HcalIsoTrack") << "Error! Can't get the product "
299  } else {
300  trigger::TriggerEvent triggerEvent = *(triggerEventHandle.product());
301  if (triggerResults.isValid()) {
302  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
303  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
304  reco::HcalIsolatedTrackCandidateCollection* isotk = select(triggerResults,triggerNames_,trkCollection,leadPV, barrelRecHitsHandle, endcapRecHitsHandle, hbhe);
305 
306  if (isotk->size() > 0) {
307  std::auto_ptr<reco::HcalIsolatedTrackCandidateCollection> outputHcalIsoTrackColl(isotk);
308  std::auto_ptr<reco::TrackCollection> outputTColl(new reco::TrackCollection);
309  std::auto_ptr<reco::VertexCollection> outputVColl(new reco::VertexCollection);
310  std::auto_ptr<EBRecHitCollection> outputEBColl(new EBRecHitCollection);
311  std::auto_ptr<EERecHitCollection> outputEEColl(new EERecHitCollection);
312  std::auto_ptr<HBHERecHitCollection> outputHBHEColl(new HBHERecHitCollection);
313 
314  for (reco::TrackCollection::const_iterator track=trkCollection->begin(); track!=trkCollection->end(); ++track)
315  outputTColl->push_back(*track);
316 
317  for (reco::VertexCollection::const_iterator vtx=recVtxs->begin(); vtx!=recVtxs->end(); ++vtx)
318  outputVColl->push_back(*vtx);
319 
320  for (edm::SortedCollection<EcalRecHit>::const_iterator ehit=barrelRecHitsHandle->begin(); ehit!=barrelRecHitsHandle->end(); ++ehit)
321  outputEBColl->push_back(*ehit);
322 
323  for (edm::SortedCollection<EcalRecHit>::const_iterator ehit=endcapRecHitsHandle->begin(); ehit!=endcapRecHitsHandle->end(); ++ehit)
324  outputEEColl->push_back(*ehit);
325 
326  for (std::vector<HBHERecHit>::const_iterator hhit=hbhe->begin(); hhit!=hbhe->end(); ++hhit)
327  outputHBHEColl->push_back(*hhit);
328 
329  iEvent.put(outputHcalIsoTrackColl, "HcalIsolatedTrackCollection");
330  iEvent.put(outputTColl, labelGenTrack_.encode());
331  iEvent.put(outputVColl, labelRecVtx_.encode());
332  iEvent.put(outputEBColl, labelEB_.encode());
333  iEvent.put(outputEEColl, labelEE_.encode());
334  iEvent.put(outputHBHEColl, labelHBHE_.encode());
335  }
336  }
337  }
338 }
#define LogDebug(id)
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< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
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
std::string encode() const
Definition: InputTag.cc:164
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_
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 370 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(), LogDebug, 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_50ns_5e33_v1_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().

375  {
376 
378  bool ok(false);
379 
380  // Find a good HLT trigger
381  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
382  int hlt = triggerResults->accept(iHLT);
383  for (unsigned int i=0; i<trigNames.size(); ++i) {
384  if (triggerNames_[iHLT].find(trigNames[i].c_str())!=std::string::npos) {
385  trigKount[i]++;
386  if (hlt > 0) {
387  ok = true;
388  trigPass[i]++;
389  }
390  LogDebug("HcalIsoTrack") <<"This is the trigger we are looking for "
391  << triggerNames_[iHLT] << " Flag " << hlt
392  << ":" << ok;
393  }
394  }
395  }
396  if (ok) {
397  //Propagate tracks to calorimeter surface)
398  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
399  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality,
400  trkCaloDirections, false);
401 
402  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
403  unsigned int nTracks(0), nselTracks(0);
404  for (trkDetItr = trkCaloDirections.begin(),nTracks=0;
405  trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++) {
406  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
407  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(),
408  pTrack->pz(), pTrack->p());
409  LogDebug("HcalIsoTrack") << "This track : " << nTracks
410  << " (pt|eta|phi|p) :" << pTrack->pt()
411  << "|" << pTrack->eta() << "|"
412  << pTrack->phi() << "|" << pTrack->p();
413 
414  //Selection of good track
415  bool qltyFlag = spr::goodTrack(pTrack,leadPV,selectionParameters,false);
416  LogDebug("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << qltyFlag
417  << "|" << trkDetItr->okECAL << "|"
418  << trkDetItr->okHCAL;
419  if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
420  double t_p = pTrack->p();
421  nselTracks++;
422  int nRH_eMipDR(0), nNearTRKs(0);
423  double eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
424  endcapRecHitsHandle,
425  trkDetItr->pointHCAL,
426  trkDetItr->pointECAL, a_mipR,
427  trkDetItr->directionECAL,
428  nRH_eMipDR);
429  double hmaxNearP = spr::chargeIsolationCone(nTracks,
430  trkCaloDirections,
431  a_charIsoR,
432  nNearTRKs, false);
433  LogDebug("HcalIsoTrack") << "This track : " << nTracks
434  << " (pt|eta|phi|p) :" << pTrack->pt()
435  << "|" << pTrack->eta() << "|"
436  << pTrack->phi() << "|" << t_p
437  << "e_MIP " << eMipDR
438  << " Chg Isolation " << hmaxNearP;
439  if (t_p>pTrackMin_ && eMipDR<eEcalMax_ && hmaxNearP<eIsolation_) {
440  reco::HcalIsolatedTrackCandidate newCandidate(v4);
441  newCandidate.SetMaxP(hmaxNearP);
442  newCandidate.SetEnergyEcal(eMipDR);
443  newCandidate.setL1(ptL1,etaL1,phiL1);
444  newCandidate.SetEtaPhiEcal((trkDetItr->pointECAL).eta(),
445  (trkDetItr->pointECAL).phi());
446  HcalDetId detId = HcalDetId(trkDetItr->detIdHCAL);
447  newCandidate.SetEtaPhiHcal((trkDetItr->pointHCAL).eta(),
448  (trkDetItr->pointHCAL).phi(),
449  detId.ieta(), detId.iphi());
450  int indx(0);
451  reco::TrackCollection::const_iterator trkItr1;
452  for (trkItr1=trkCollection->begin(); trkItr1 != trkCollection->end(); ++trkItr1,++indx) {
453  const reco::Track* pTrack1 = &(*trkItr1);
454  if (pTrack1 == pTrack) {
455  reco::TrackRef tRef = reco::TrackRef(trkCollection,indx);
456  newCandidate.setTrack(tRef);
457  break;
458  }
459  }
460  trackCollection->push_back(newCandidate);
461  }
462  }
463  }
464  }
465  return trackCollection;
466 }
#define LogDebug(id)
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
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:693
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:675
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:699
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:669
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:687
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:681
Definition: DDAxes.h:10
void AlCaIsoTracksProducer::setPtEtaPhi ( std::vector< edm::Ref< l1extra::L1JetParticleCollection > > &  objref,
double &  ptL1,
double &  etaL1,
double &  phiL1 
)
private

Definition at line 468 of file AlCaIsoTracksProducer.cc.

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

Referenced by produce().

468  {
469 
470  for (unsigned int p=0; p<objref.size(); p++) {
471  if (objref[p]->pt()>ptL1) {
472  ptL1 = objref[p]->pt();
473  phiL1 = objref[p]->phi();
474  etaL1 = objref[p]->eta();
475  }
476  }
477 }

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 108 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 110 of file AlCaIsoTracksProducer.cc.

Referenced by produce(), and select().

const CaloGeometry* AlCaIsoTracksProducer::geo
private

Definition at line 109 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 105 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().

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 110 of file AlCaIsoTracksProducer.cc.

Referenced by produce(), and select().

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

Definition at line 110 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 117 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 118 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 119 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 115 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 120 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 112 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 116 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 113 of file AlCaIsoTracksProducer.cc.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 114 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().