29 std::vector<spr::propagatedTrackID> vdets;
32 reco::TrackCollection::const_iterator trkItr;
33 for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
42 edm::LogVerbatim(
"IsoTrack") <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta()
43 <<
" phi " << trkItr->phi() <<
" Flag " << vdet.
ok;
63 <<
info.first.y() <<
", " <<
info.first.z() <<
")";
80 std::ostringstream st1;
92 <<
info.first.y() <<
", " <<
info.first.z() <<
")";
101 std::ostringstream st1;
110 vdets.push_back(vdet);
114 edm::LogVerbatim(
"IsoTrack") <<
"propagateCALO:: for " << vdets.size() <<
" tracks";
115 for (
unsigned int i = 0;
i < vdets.size(); ++
i) {
116 std::ostringstream st1;
118 st1 << (
EBDetId)(vdets[
i].detIdECAL);
120 st1 << (
EEDetId)(vdets[
i].detIdECAL);
122 edm::LogVerbatim(
"IsoTrack") <<
"Track [" <<
i <<
"] Flag: " << vdets[
i].ok <<
" ECAL (" << vdets[
i].okECAL
123 <<
") " << st1.str() <<
" HCAL (" << vdets[
i].okHCAL <<
") " 135 std::vector<spr::propagatedTrackID> vdets;
144 std::vector<spr::propagatedTrackID>& vdets,
152 reco::TrackCollection::const_iterator trkItr;
153 for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
162 edm::LogVerbatim(
"IsoTrack") <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta()
163 <<
" phi " << trkItr->phi() <<
" Flag " << vdet.
ok;
189 std::ostringstream st1;
198 vdets.push_back(vdet);
201 edm::LogVerbatim(
"IsoTrack") <<
"propagateCALO:: for " << vdets.size() <<
" tracks";
202 for (
unsigned int i = 0;
i < vdets.size(); ++
i) {
203 std::ostringstream st1;
205 st1 << (
EBDetId)(vdets[
i].detIdECAL);
207 st1 << (
EEDetId)(vdets[
i].detIdECAL);
209 edm::LogVerbatim(
"IsoTrack") <<
"Track [" <<
i <<
"] Flag: " << vdets[
i].ok <<
" ECAL (" << vdets[
i].okECAL
210 <<
") " << st1.str() <<
" HCAL (" << vdets[
i].okHCAL <<
") " 220 std::vector<spr::propagatedTrackDirection>& trkDir,
228 reco::TrackCollection::const_iterator trkItr;
229 for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
238 edm::LogVerbatim(
"IsoTrack") <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta()
239 <<
" phi " << trkItr->phi() <<
" Flag " << trkD.
ok;
264 trkDir.push_back(trkD);
267 edm::LogVerbatim(
"IsoTrack") <<
"propagateCALO:: for " << trkDir.size() <<
" tracks";
268 for (
unsigned int i = 0;
i < trkDir.size(); ++
i) {
269 std::ostringstream st1, st2;
270 if (trkDir[
i].okECAL) {
271 st1 <<
" point " << trkDir[
i].pointECAL <<
" direction " << trkDir[
i].directionECAL <<
" ";
272 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
273 st1 << (
EBDetId)(trkDir[
i].detIdECAL);
275 st1 << (
EEDetId)(trkDir[
i].detIdECAL);
278 if (trkDir[
i].okHCAL) {
279 st2 <<
" point " << trkDir[
i].pointHCAL <<
" direction " << trkDir[
i].directionHCAL <<
" " 282 edm::LogVerbatim(
"IsoTrack") <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL
283 <<
")" << st1.str() <<
" HCAL (" << trkDir[
i].okHCAL <<
")" << st2.str() <<
" Or " 303 edm::LogVerbatim(
"IsoTrack") <<
"Propagate track: p " << pTrack->
p() <<
" eta " << pTrack->
eta() <<
" phi " 304 << pTrack->
phi() <<
" Flag " << vdet.
ok;
331 std::ostringstream st1;
354 std::vector<spr::propagatedGenTrackID> trkDir;
356 HepMC::GenEvent::particle_const_iterator
p;
357 for (
p =
genEvent->particles_begin(), indx = 0;
p !=
genEvent->particles_end(); ++
p, ++indx) {
363 trkD.
pdgId = ((*p)->pdg_id());
364 trkD.
charge = ((pdt->particle(trkD.
pdgId))->
ID().threeCharge()) / 3;
368 <<
" p " << momentum;
370 if ((*p)->status() == 1 &&
std::abs((*p)->momentum().eta()) <
etaMax) {
372 0.1 * (*p)->production_vertex()->position().y(),
373 0.1 * (*p)->production_vertex()->position().z());
403 trkDir.push_back(trkD);
406 edm::LogVerbatim(
"IsoTrack") <<
"propagateCALO:: for " << trkDir.size() <<
" tracks";
407 for (
unsigned int i = 0;
i < trkDir.size(); ++
i) {
408 std::ostringstream st1, st2;
409 if (trkDir[
i].okECAL) {
410 st1 <<
" point " << trkDir[
i].pointECAL <<
" direction " << trkDir[
i].directionECAL <<
" ";
411 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
412 st1 << (
EBDetId)(trkDir[
i].detIdECAL);
414 st1 << (
EEDetId)(trkDir[
i].detIdECAL);
417 st2 <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
418 if (trkDir[
i].okHCAL) {
419 st2 <<
" point " << trkDir[
i].pointHCAL <<
" direction " << trkDir[
i].directionHCAL <<
" " 422 edm::LogVerbatim(
"IsoTrack") <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL
423 <<
")" << st1.str() << st2.str() <<
" Or " << (
HcalDetId)(trkDir[
i].detIdEHCAL);
439 std::vector<spr::propagatedGenParticleID> trkDir;
441 reco::GenParticleCollection::const_iterator
p;
448 trkD.
pdgId = (
p->pdgId());
453 <<
" p " << momentum;
486 trkDir.push_back(trkD);
489 edm::LogVerbatim(
"IsoTrack") <<
"propagateCALO:: for " << trkDir.size() <<
" tracks" << std::endl;
490 for (
unsigned int i = 0;
i < trkDir.size(); ++
i) {
491 std::ostringstream st1, st2;
492 if (trkDir[
i].okECAL) {
493 st1 <<
" point " << trkDir[
i].pointECAL <<
" direction " << trkDir[
i].directionECAL <<
" ";
494 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
495 st1 << (
EBDetId)(trkDir[
i].detIdECAL);
497 st1 << (
EEDetId)(trkDir[
i].detIdECAL);
500 st2 <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
501 if (trkDir[
i].okHCAL) {
502 st2 <<
" point " << trkDir[
i].pointHCAL <<
" direction " << trkDir[
i].directionHCAL <<
" " 505 edm::LogVerbatim(
"IsoTrack") <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL
506 <<
")" << st1.str() << st2.str() <<
" Or " << (
HcalDetId)(trkDir[
i].detIdEHCAL);
561 edm::LogVerbatim(
"IsoTrack") <<
"propagateCALO:: for track [" << thisTrk <<
"] Flag: " << trkD.
ok <<
" ECAL (" 563 std::ostringstream st1;
611 std::ostringstream st1;
616 edm::LogVerbatim(
"IsoTrack") <<
"propagateCALO:: for track [" << thisTrk <<
"] Flag: " << trkD.
ok <<
" ECAL (" 617 << trkD.
okECAL <<
") HCAL (" << trkD.
okHCAL <<
")" << st1.str();
636 return std::pair<bool, HcalDetId>(
false,
HcalDetId());
690 return std::pair<DetId, bool>(eId,
info.second);
697 return std::pair<math::XYZPoint, bool>(
track.point,
track.ok);
731 return std::pair<math::XYZPoint, bool>(
track.point,
track.ok);
740 return std::pair<math::XYZPoint, bool>(track1.point, track1.ok);
780 double dphi = direction.
phi() - momentum.phi();
781 double rdist =
std::sqrt(vDiff.x() * vDiff.x() + vDiff.y() * vDiff.y());
782 double rat = 0.5 * dphi /
std::sin(0.5 * dphi);
783 double dZ = vDiff.z();
784 double dS = rdist * rat;
788 <<
" OverAll " <<
ok <<
" Point " <<
point <<
" RDist " << rdist <<
" dS " << dS
789 <<
" dS/pt " << rdist * rat / momentum.perp() <<
" zdist " << dZ <<
" dz/pz " 790 << dZ / momentum.z() <<
" Length " << length;
793 return std::pair<math::XYZPoint, double>(
point, length);
806 edm::LogVerbatim(
"IsoTrack") <<
"propagateCalo:: Vertex " << tpVertex <<
" Momentum " << tpMomentum <<
" Charge " 819 if (tpMomentum.
eta() < 0) {
844 track.point.SetXYZ(-999., -999., -999.);
850 <<
" OverAll " <<
track.ok <<
" Point " <<
track.point <<
" Direction " 854 track.point.x() - tpVertex.
x(),
track.point.y() - tpVertex.
y(),
track.point.z() - tpVertex.
z());
855 double dphi =
track.direction.phi() - tpMomentum.
phi();
856 double rdist =
std::sqrt(vDiff.x() * vDiff.x() + vDiff.y() * vDiff.y());
857 double pt = tpMomentum.
perp();
858 double rat = 0.5 * dphi /
std::sin(0.5 * dphi);
859 edm::LogVerbatim(
"IsoTrack") <<
"RDist " << rdist <<
" pt " <<
pt <<
" r/pt " << rdist * rat /
pt <<
" zdist " 860 << vDiff.z() <<
" pz " << tpMomentum.
z() <<
" z/pz " << vDiff.z() / tpMomentum.
z()
873 edm::SimTrackContainer::const_iterator itr = SimTk->end();
874 for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
875 if (simTrkItr->trackId() == thisTrk) {
877 edm::LogVerbatim(
"IsoTrack") <<
"matched trackId (maximum occurance) " << thisTrk <<
" type " 878 << simTrkItr->type();
884 if (itr != SimTk->end()) {
885 int vertIndex = itr->vertIndex();
886 if (vertIndex != -1 && vertIndex < (
int)SimVtx->size()) {
887 edm::SimVertexContainer::const_iterator simVtxItr = SimVtx->begin();
888 for (
int iv = 0;
iv < vertIndex;
iv++)
908 const std::pair<double, double> rz,
917 bool ok = ((ids.first !=
HcalDetId()) && (ids.first.ieta() == ids.second.ieta()) &&
918 (ids.first.iphi() == ids.second.iphi()));
928 const std::pair<double, double> rz,
934 std::pair<HcalDetId, HcalDetId> ids =
936 bool ok = ((ids.first !=
HcalDetId()) && (ids.first.ieta() == ids.second.ieta()) &&
937 (ids.first.iphi() == ids.second.iphi()));
947 const std::pair<double, double> rz,
950 edm::LogVerbatim(
"IsoTrack") <<
"propagateCalo:: Vertex " <<
vertex <<
" Momentum " << momentum <<
" Charge " 951 <<
charge <<
" R/Z " << rz.first <<
" : " << rz.second <<
" Type " << typeRZ;
957 for (
int k = 0;
k < 2; ++
k) {
959 double rzv = (
k == 0) ? rz.first : rz.second;
976 std::ostringstream st1;
987 return std::pair<HcalDetId, HcalDetId>(
id1,
id2);
bool quality(const TrackQuality) const
Track quality.
Log< level::Info, true > LogVerbatim
static const double etaBEEcal
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
static const double zBackTE
const math::XYZPoint & outerPosition() const
position of the outermost hit
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
HepPDT::ParticleDataTable ParticleDataTable
static const double etaBEHcal
std::pair< DetId, bool > propagateIdECAL(const HcalDetId &id, const CaloGeometry *geo, const MagneticField *, bool debug=false)
reco::GenParticleCollection::const_iterator trkItr
TrackQuality
track quality
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
Geom::Phi< T > phi() const
double p() const
momentum vector magnitude
static const double zFrontHE
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
static const double zBackHE
GlobalVector directionECAL
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double rFrontHB
static PlanePointer build(Args &&... args)
HepMC::GenEvent::particle_const_iterator trkItr
static const double rBackHB
reco::TrackCollection::const_iterator trkItr
int charge() const
track electric charge
static const double zFrontEE
GlobalPoint globalPosition() const
static const double rBackTB
spr::propagatedTrackDirection propagateHCALBack(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
static const double rFrontEB
Abs< T >::type abs(const T &t)
GlobalVector directionECAL
double phi() const
azimuthal angle of momentum vector
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::pair< math::XYZPoint, bool > propagateTracker(const reco::Track *, const MagneticField *, bool debug=false)
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
spr::propagatedTrack propagateTrackToECAL(const reco::Track *, const MagneticField *, bool debug=false)
virtual DetId getClosestCell(const GlobalPoint &r) const
double eta() const
pseudorapidity of momentum vector
static TrackQuality qualityByName(const std::string &name)
GlobalVector directionHCAL
GlobalVector directionHCAL
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
static const double zFrontTE
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< spr::propagatedTrackID > propagateCosmicCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
GlobalVector globalDirection() const
GlobalVector directionHCAL
GlobalVector directionECAL
std::pair< math::XYZPoint, double > propagateTrackerEnd(const reco::Track *, const MagneticField *, bool debug=false)
GlobalPoint getPosition(const DetId &id) const
reco::TrackCollection::const_iterator trkItr
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
const math::XYZPoint & innerPosition() const
position of the innermost hit
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)
static const double etaBETrak
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Global3DVector GlobalVector