222 reco::TrackCollection::const_iterator trkItr;
236 if (recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
237 leadPV =
math::XYZPoint( (*recVtxs)[0].
x(),(*recVtxs)[0].
y(), (*recVtxs)[0].
z() );
238 }
else if (beamSpotH.
isValid()) {
239 leadPV = beamSpotH->position();
242 edm::LogInfo(
"IsoTrack") <<
"Primary Vertex " << leadPV;
244 << beamSpotH->position();
258 if (!triggerEventHandle.
isValid()) {
262 triggerEvent = *(triggerEventHandle.
product());
268 if (triggerResults.isValid()) {
269 std::vector<std::string>
modules;
271 const std::vector<std::string> & triggerNames_ = triggerNames.
triggerNames();
272 for (
unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
274 int hlt = triggerResults->accept(iHLT);
276 if (triggerNames_[iHLT].
find(
trigNames[
i].c_str())!=std::string::npos) {
277 if (hlt > 0)
ok =
true;
279 edm::LogInfo(
"IsoTrack") <<
"This is the trigger we are looking for "
280 << triggerNames_[iHLT] <<
" Flag "
288 std::vector<math::XYZTLorentzVector> vec[3];
290 for (
unsigned int ifilter=0; ifilter<triggerEvent.
sizeFilters();
292 std::vector<int>
Keys;
295 for (
unsigned int imodule=0; imodule<moduleLabels.size();
297 if (label.find(moduleLabels[imodule]) != std::string::npos) {
300 for (
unsigned int ifiltrKey=0; ifiltrKey<triggerEvent.
filterKeys(ifilter).size(); ++ifiltrKey) {
301 Keys.push_back(triggerEvent.
filterKeys(ifilter)[ifiltrKey]);
305 if (label.find(
"hltL1s") != std::string::npos) {
306 vec[0].push_back(v4);
307 }
else if (label.find(
"PFJet") != std::string::npos) {
308 vec[2].push_back(v4);
310 vec[1].push_back(v4);
313 if (label.find(
"L2Filter") != std::string::npos) {
314 vec[1].push_back(v4);
315 }
else if (label.find(
"Filter") != std::string::npos) {
316 vec[2].push_back(v4);
318 vec[0].push_back(v4);
322 edm::LogInfo(
"IsoTrack") <<
"key " << ifiltrKey <<
" : pt "
323 << TO.pt() <<
" eta " << TO.eta()
324 <<
" phi " << TO.phi() <<
" mass "
325 << TO.mass() <<
" Id " << TO.id();
330 <<
":" << vec[1].size() <<
":"
337 double deta, dphi, dr;
341 for (
int lvl=1; lvl<3; lvl++) {
342 for (
unsigned int i=0;
i<vec[lvl].size();
i++) {
343 deta =
dEta(vec[0][0],vec[lvl][
i]);
344 dphi =
dPhi(vec[0][0],vec[lvl][
i]);
345 dr =
dR(vec[0][0],vec[lvl][
i]);
348 <<
" deta " << deta <<
" dphi "
349 << dphi <<
" dR " << dr;
352 mindRvec1 = vec[lvl][
i];
365 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
367 trkCaloDirections, ((
verbosity/100)%10>2));
369 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
370 unsigned int nTracks(0), nselTracks(0);
371 for (trkDetItr = trkCaloDirections.begin(),nTracks=0;
372 trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++) {
373 const reco::Track* pTrack = &(*(trkDetItr->trkItr));
375 pTrack->
pz(), pTrack->
p());
378 <<
" (pt/eta/phi/p) :" << pTrack->
pt()
379 <<
"/" << pTrack->
eta() <<
"/"
380 << pTrack->
phi() <<
"/" << pTrack->
p();
384 for (
unsigned int k=0;
k<vec[2].size(); ++
k) {
385 dr =
dR(vec[2][
k],v4);
388 mindRvec2 = vec[2][
k];
393 edm::LogInfo(
"IsoTrack") <<
"Closest L3 object at mindr :"
401 oneCutParameters.
maxDzPV = 100;
407 oneCutParameters.
maxDzPV = 100;
414 if (trkDetItr->okHCAL) {
420 << qltyFlag <<
"|" << trkDetItr->okECAL
421 <<
"/" << trkDetItr->okHCAL;
422 if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
424 int nRH_eMipDR(0), nNearTRKs(0), nRecHits(-999);
427 trkDetItr->pointHCAL,
428 trkDetItr->pointECAL,
429 a_mipR, trkDetItr->directionECAL,
432 std::vector<DetId> ids;
435 trkDetItr->directionHCAL,nRecHits,
437 for (
unsigned int k=0;
k<ids.size(); ++
k) {
446 <<
" (pt/eta/phi/p) :" << pTrack->
pt()
447 <<
"/" << pTrack->
eta() <<
"/"
448 << pTrack->
phi() <<
"/" <<
t_p <<
"\n"
451 <<
" eHcal" <<
t_eHcal <<
" ieta "
467 edm::LogInfo(
"IsoTrack") <<
"New trigger menu found !!!";
469 for (
unsigned itrig=0; itrig<triggerNames_.size(); itrig++) {
471 if (triggerindx >=
n)
473 << triggerindx <<
" does not exist";
476 << triggerindx <<
" exists";
unsigned int size() const
number of trigger paths in trigger table
double p() const
momentum vector magnitude
edm::InputTag triggerEvent_
EventNumber_t event() const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
double dPhi(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
The single EDProduct to be saved for each event (AOD case)
trigger::size_type sizeFilters() const
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const Keys & filterKeys(trigger::size_type index) const
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() const
std::vector< std::string > trigNames
double phi() const
azimuthal angle of momentum vector
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
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Strings const & triggerNames() const
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
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.
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
double eta() const
pseudorapidity of momentum vector
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
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
std::vector< double > * t_HitEnergies
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< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
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)
std::string theTrackQuality
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< size_type > Keys
double dR(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
T const * product() const
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
spr::trackSelectionParameters selectionParameters
double dEta(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
std::vector< unsigned int > * t_DetIds
HLTConfigProvider hltConfig_
double py() const
y coordinate of momentum vector
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_