241 reco::TrackCollection::const_iterator trkItr;
242 if (!trkCollection.
isValid()) {
256 if (recVtxs.
isValid() && recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
257 leadPV =
math::XYZPoint( (*recVtxs)[0].
x(),(*recVtxs)[0].
y(), (*recVtxs)[0].
z() );
258 }
else if (beamSpotH.
isValid()) {
259 leadPV = beamSpotH->position();
262 edm::LogInfo(
"HcalIsoTrack") <<
"Primary Vertex " << leadPV;
264 << beamSpotH->position();
269 if (!barrelRecHitsHandle.
isValid()) {
275 if (!endcapRecHitsHandle.
isValid()) {
287 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
289 trkCaloDirections,
false);
290 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
300 if (!triggerEventHandle.
isValid()) {
304 triggerEvent = *(triggerEventHandle.
product());
310 if (triggerResults.isValid()) {
311 std::vector<std::string>
modules;
313 const std::vector<std::string> & triggerNames_ = triggerNames.
triggerNames();
314 for (
unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
316 int hlt = triggerResults->accept(iHLT);
318 if (triggerNames_[iHLT].
find(
trigNames[
i].c_str())!=std::string::npos) {
327 << triggerNames_[iHLT] <<
" Flag "
336 std::vector<math::XYZTLorentzVector> vec[3];
338 for (
unsigned int ifilter=0; ifilter<triggerEvent.
sizeFilters();
340 std::vector<int>
Keys;
343 for (
unsigned int imodule=0; imodule<moduleLabels.size();
345 if (label.find(moduleLabels[imodule]) != std::string::npos) {
349 for (
unsigned int ifiltrKey=0; ifiltrKey<triggerEvent.
filterKeys(ifilter).size(); ++ifiltrKey) {
350 Keys.push_back(triggerEvent.
filterKeys(ifilter)[ifiltrKey]);
353 if (label.find(
l2Filter) != std::string::npos) {
354 vec[1].push_back(v4);
355 }
else if (label.find(
l3Filter) != std::string::npos) {
356 vec[2].push_back(v4);
357 }
else if (label.find(
l1Filter) != std::string::npos ||
359 vec[0].push_back(v4);
362 edm::LogInfo(
"HcalIsoTrack") <<
"key " << ifiltrKey<<
" : pt "
363 << TO.pt() <<
" eta "<< TO.eta()
364 <<
" phi " << TO.phi()<<
" mass "
365 << TO.mass() <<
" Id "<<TO.id();
369 edm::LogInfo(
"HcalIsoTrack") <<
"sizes " << vec[0].size() <<
":"
370 << vec[1].size() <<
":" <<vec[2].size();
379 for (
int lvl=1; lvl<3; lvl++) {
380 for (
unsigned int i=0;
i<vec[lvl].size();
i++) {
381 dr =
dR(vec[0][0],vec[lvl][
i]);
388 mindRvec1 = vec[lvl][
i];
396 if (vec[2].
size()>0) {
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));
408 pTrack->
pz(), pTrack->
p());
410 edm::LogInfo(
"HcalIsoTrack") <<
"This track : " << nTracks
411 <<
" (pt|eta|phi|p) :" << pTrack->
pt()
412 <<
"|" << pTrack->
eta() <<
"|"
413 << pTrack->
phi() <<
"|" <<pTrack->
p();
418 for (
unsigned int k=0;
k<vec[2].size(); ++
k) {
419 dr =
dR(vec[2][
k],v4);
422 mindRvec2 = vec[2][
k];
427 edm::LogInfo(
"HcalIsoTrack") <<
"Closest L3 object at mindr :"
435 oneCutParameters.
maxDzPV = 100;
438 bool qltyFlag =
spr::goodTrack(pTrack,leadPV,oneCutParameters,
false);
441 oneCutParameters.
maxDzPV = 100;
448 if (trkDetItr->okHCAL) {
453 edm::LogInfo(
"HcalIsoTrack") <<
"qltyFlag|okECAL|okHCAL : "
454 << qltyFlag <<
"|" << trkDetItr->okECAL
455 <<
"|" << trkDetItr->okHCAL;
457 t_qltyFlag = (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL);
461 int nRH_eMipDR(0), nNearTRKs(0), nRecHits(-999);
464 trkDetItr->pointHCAL,
465 trkDetItr->pointECAL,
466 a_mipR, trkDetItr->directionECAL,
469 std::vector<DetId> ids;
472 trkDetItr->directionHCAL,nRecHits,
474 for (
unsigned int k=0;
k<ids.size(); ++
k) {
481 edm::LogInfo(
"HcalIsoTrack") <<
"This track : " << nTracks
482 <<
" (pt|eta|phi|p) :" << pTrack->
pt()
483 <<
"|" << pTrack->
eta() <<
"|"
484 << pTrack->
phi() <<
"|" <<
t_p;
487 <<
" eHcal" <<
t_eHcal <<
" ieta "
491 for (
unsigned int lll=0;lll<
t_DetIds->size();lll++) {
493 <<
" hit enery is = "
515 edm::LogInfo(
"HcalIsoTrack") <<
"New trigger menu found !!!";
518 for (
unsigned itrig=0; itrig<triggerNames_.size(); itrig++) {
520 if (triggerindx >=
n)
521 edm::LogInfo(
"HcalIsoTrack") << triggerNames_[itrig] <<
" "
522 << triggerindx <<
" does not exist in "
523 <<
"the current menu";
526 edm::LogInfo(
"HcalIsoTrack") << triggerNames_[itrig] <<
" "
527 << triggerindx <<
" exists";
unsigned int size() const
number of trigger paths in trigger table
double p() const
momentum vector magnitude
EventNumber_t event() const
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
The single EDProduct to be saved for each event (AOD case)
trigger::size_type sizeFilters() const
std::vector< int > trigKount
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const Keys & filterKeys(trigger::size_type index) const
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() const
double phi() const
azimuthal angle of momentum vector
std::vector< std::string > trgnames
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::vector< double > * t_HitEnergies
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
double px() const
x coordinate of momentum vector
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Strings const & triggerNames() const
std::vector< unsigned int > * t_DetIds
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
double eta() const
pseudorapidity of momentum vector
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
const TriggerObjectCollection & getObjects() const
double pt() const
track transverse momentum
int ieta() const
get the cell ieta
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)
static std::string const triggerResults
HLTConfigProvider hltConfig_
double pz() const
z coordinate of momentum vector
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< bool > * t_trgbits
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
const edm::InputTag filterTag(trigger::size_type index) const
T const * product() const
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, bool debug=false)
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< size_type > Keys
T const * product() const
std::string labelGenTrack_
double dR(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
std::vector< int > trigPass
std::vector< std::string > trigNames
spr::trackSelectionParameters selectionParameters
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
edm::InputTag triggerEvent_
tuple size
Write out results.
double py() const
y coordinate of momentum vector
std::string theTrackQuality