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;
62 edm::LogVerbatim(
"IsoTrack") <<
"Propagate to ECAL " << info.second <<
" at (" << info.first.x() <<
", "
63 << info.first.y() <<
", " << info.first.z() <<
")";
80 std::ostringstream st1;
91 edm::LogVerbatim(
"IsoTrack") <<
"Propagate to HCAL " << info.second <<
" at (" << info.first.x() <<
", "
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;
165 vdet.
okECAL = info.second;
181 vdet.
okHCAL = info.second;
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;
306 vdet.
okECAL = info.second;
322 vdet.
okHCAL = info.second;
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;
442 for (p = genParticles->begin(), indx = 0; p != genParticles->end(); ++
p, ++indx) {
448 trkD.
pdgId = (p->pdgId());
449 trkD.
charge = p->charge();
453 <<
" p " << momentum;
455 if (p->status() == 1 &&
std::abs(momentum.
eta()) < etaMax) {
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());
675 std::pair<math::XYZPoint, bool>
info =
propagateECAL(vertex, momentum, 0, bField, debug);
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);
752 edm::LogVerbatim(
"IsoTrack") <<
"propagateTrackerEnd:: Vertex " << vertex <<
" Momentum " << momentum
753 <<
" Charge " <<
charge <<
" Radius " << radius <<
" Z " << zdist;
779 math::XYZPoint vDiff(point.x() - vertex.x(), point.y() - vertex.y(), point.z() - vertex.z());
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 "
807 << tpCharge <<
" Radius " << radius <<
" Z " << zdist <<
" Corner " << corner;
819 if (tpMomentum.
eta() < 0) {
830 if (absEta < corner) {
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());
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++)
893 trk.
charge = (int)(itr->charge());
908 const std::pair<double, double> rz,
914 edm::LogVerbatim(
"IsoTrack") <<
"Propagate track with charge " <<
charge <<
" position " << vertex <<
" p "
916 std::pair<HcalDetId, HcalDetId> ids =
propagateHCAL(geo, bField, vertex, momentum,
charge, typeRZ, rz, debug);
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;
981 edm::LogVerbatim(
"IsoTrack") <<
"Iteration " <<
k <<
" Point " << point <<
" ID " << st1.str();
986 edm::LogVerbatim(
"IsoTrack") <<
"propagateCalo:: Front " << id1 <<
" Back " << id2;
987 return std::pair<HcalDetId, HcalDetId>(id1, id2);
double p() const
momentum vector magnitude
Log< level::Info, true > LogVerbatim
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
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)
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
static const double zBackTE
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)
static const double zFrontHE
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
double phi() const
azimuthal angle of momentum vector
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)
double px() const
x coordinate of momentum vector
const math::XYZPoint & outerPosition() const
position of the outermost hit
static const double rFrontHB
HepMC::GenEvent::particle_const_iterator trkItr
const math::XYZPoint & innerPosition() const
position of the innermost hit
static const double rBackHB
reco::TrackCollection::const_iterator trkItr
static const double zFrontEE
double eta() const
pseudorapidity of momentum vector
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 PlanePointer build(Args &&...args)
static const double rFrontEB
if(conf_.getParameter< bool >("UseStripCablingDB"))
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Abs< T >::type abs(const T &t)
GlobalVector directionECAL
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)
GlobalPoint getPosition(const DetId &id) const
double pz() const
z coordinate of momentum vector
virtual DetId getClosestCell(const GlobalPoint &r) const
double vz() const
z coordinate of the reference point on track
static TrackQuality qualityByName(const std::string &name)
GlobalVector directionHCAL
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
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)
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
GlobalVector directionHCAL
bool quality(const TrackQuality) const
Track quality.
double vy() const
y coordinate of the reference point on track
GlobalVector directionECAL
std::pair< math::XYZPoint, double > propagateTrackerEnd(const reco::Track *, const MagneticField *, bool debug=false)
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
reco::TrackCollection::const_iterator trkItr
int charge() const
track electric charge
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)
static const double etaBETrak
*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
double py() const
y coordinate of momentum vector
double vx() const
x coordinate of the reference point on track
Global3DVector GlobalVector
GlobalVector globalDirection() const