29 std::vector<spr::propagatedTrackID> vdets;
32 reco::TrackCollection::const_iterator trkItr;
33 for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
43 std::cout <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta() <<
" phi "
44 << trkItr->phi() <<
" Flag " << vdet.
ok << std::endl;
67 std::cout <<
"Propagate to ECAL " <<
info.second <<
" at (" <<
info.first.x() <<
", " <<
info.first.y() <<
", "
68 <<
info.first.z() <<
")\n";
99 std::cout <<
"Propagate to HCAL " <<
info.second <<
" at (" <<
info.first.x() <<
", " <<
info.first.y() <<
", "
100 <<
info.first.z() <<
")\n";
111 std::cout <<
"Track [" << indx <<
"] Flag: " << vdet.
ok <<
" ECAL (" << vdet.
okECAL <<
") ";
120 vdets.push_back(vdet);
125 std::cout <<
"propagateCALO:: for " << vdets.size() <<
" tracks" << std::endl;
126 for (
unsigned int i = 0;
i < vdets.size(); ++
i) {
127 std::cout <<
"Track [" <<
i <<
"] Flag: " << vdets[
i].ok <<
" ECAL (" << vdets[
i].okECAL <<
") ";
134 << (
HcalDetId)(vdets[
i].detIdEHCAL) << std::endl;
146 std::vector<spr::propagatedTrackID> vdets;
155 std::vector<spr::propagatedTrackID>& vdets,
163 reco::TrackCollection::const_iterator trkItr;
164 for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
174 std::cout <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta() <<
" phi "
175 << trkItr->phi() <<
" Flag " << vdet.
ok << std::endl;
203 std::cout <<
"Track [" << indx <<
"] Flag: " << vdet.
ok <<
" ECAL (" << vdet.
okECAL <<
") ";
212 vdets.push_back(vdet);
216 std::cout <<
"propagateCALO:: for " << vdets.size() <<
" tracks" << std::endl;
217 for (
unsigned int i = 0;
i < vdets.size(); ++
i) {
218 std::cout <<
"Track [" <<
i <<
"] Flag: " << vdets[
i].ok <<
" ECAL (" << vdets[
i].okECAL <<
") ";
225 << (
HcalDetId)(vdets[
i].detIdEHCAL) << std::endl;
235 std::vector<spr::propagatedTrackDirection>& trkDir,
243 reco::TrackCollection::const_iterator trkItr;
244 for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
254 std::cout <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta() <<
" phi "
255 << trkItr->phi() <<
" Flag " << trkD.
ok << std::endl;
281 trkDir.push_back(trkD);
285 std::cout <<
"propagateCALO:: for " << trkDir.size() <<
" tracks" << std::endl;
286 for (
unsigned int i = 0;
i < trkDir.size(); ++
i) {
287 std::cout <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL <<
")";
288 if (trkDir[
i].okECAL) {
289 std::cout <<
" point " << trkDir[
i].pointECAL <<
" direction " << trkDir[
i].directionECAL <<
" ";
290 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
296 std::cout <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
297 if (trkDir[
i].okHCAL) {
298 std::cout <<
" point " << trkDir[
i].pointHCAL <<
" direction " << trkDir[
i].directionHCAL <<
" "
322 std::cout <<
"Propagate track: p " << pTrack->
p() <<
" eta " << pTrack->
eta() <<
" phi " << pTrack->
phi()
323 <<
" Flag " << vdet.
ok << std::endl;
351 std::cout <<
"propagateCALO:: for 1 track" << std::endl;
375 std::vector<spr::propagatedGenTrackID> trkDir;
377 HepMC::GenEvent::particle_const_iterator
p;
378 for (
p =
genEvent->particles_begin(), indx = 0;
p !=
genEvent->particles_end(); ++
p, ++indx) {
384 trkD.
pdgId = ((*p)->pdg_id());
385 trkD.
charge = ((pdt->particle(trkD.
pdgId))->
ID().threeCharge()) / 3;
389 std::cout <<
"Propagate track " << indx <<
" pdg " << trkD.
pdgId <<
" charge " << trkD.
charge <<
" p "
390 << momentum << std::endl;
393 if ((*p)->status() == 1 &&
std::abs((*p)->momentum().eta()) <
etaMax) {
395 0.1 * (*p)->production_vertex()->position().y(),
396 0.1 * (*p)->production_vertex()->position().z());
426 trkDir.push_back(trkD);
430 std::cout <<
"propagateCALO:: for " << trkDir.size() <<
" tracks" << std::endl;
431 for (
unsigned int i = 0;
i < trkDir.size(); ++
i) {
432 if (trkDir[
i].okECAL)
433 std::cout <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL <<
")";
434 if (trkDir[
i].okECAL) {
435 std::cout <<
" point " << trkDir[
i].pointECAL <<
" direction " << trkDir[
i].directionECAL <<
" ";
436 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
442 if (trkDir[
i].okECAL)
443 std::cout <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
444 if (trkDir[
i].okHCAL) {
445 std::cout <<
" point " << trkDir[
i].pointHCAL <<
" direction " << trkDir[
i].directionHCAL <<
" "
448 if (trkDir[
i].okECAL)
466 std::vector<spr::propagatedGenParticleID> trkDir;
468 reco::GenParticleCollection::const_iterator
p;
475 trkD.
pdgId = (
p->pdgId());
480 std::cout <<
"Propagate track " << indx <<
" pdg " << trkD.
pdgId <<
" charge " << trkD.
charge <<
" p "
481 << momentum << std::endl;
515 trkDir.push_back(trkD);
519 std::cout <<
"propagateCALO:: for " << trkDir.size() <<
" tracks" << std::endl;
520 for (
unsigned int i = 0;
i < trkDir.size(); ++
i) {
521 if (trkDir[
i].okECAL)
522 std::cout <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL <<
")";
523 if (trkDir[
i].okECAL) {
524 std::cout <<
" point " << trkDir[
i].pointECAL <<
" direction " << trkDir[
i].directionECAL <<
" ";
525 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
531 if (trkDir[
i].okECAL)
532 std::cout <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
533 if (trkDir[
i].okHCAL) {
534 std::cout <<
" point " << trkDir[
i].pointHCAL <<
" direction " << trkDir[
i].directionHCAL <<
" "
537 if (trkDir[
i].okECAL)
563 std::cout <<
"Propagate track " << thisTrk <<
" charge " << trk.
charge <<
" position " << trk.
position <<
" p "
564 << trk.
momentum <<
" Flag " << trkD.
ok << std::endl;
597 std::cout <<
"propagateCALO:: for track [" << thisTrk <<
"] Flag: " << trkD.
ok <<
" ECAL (" << trkD.
okECAL
598 <<
") HCAL (" << trkD.
okHCAL <<
")" << std::endl;
634 std::cout <<
"Propagate track " << thisTrk <<
" charge " << trk.
charge <<
" position " << trk.
position <<
" p "
635 << trk.
momentum <<
" Flag " << trkD.
ok << std::endl;
650 std::cout <<
"propagateCALO:: for track [" << thisTrk <<
"] Flag: " << trkD.
ok <<
" ECAL (" << trkD.
okECAL
651 <<
") HCAL (" << trkD.
okHCAL <<
")" << std::endl;
675 return std::pair<bool, HcalDetId>(
false,
HcalDetId());
729 return std::pair<DetId, bool>(eId,
info.second);
736 return std::pair<math::XYZPoint, bool>(
track.point,
track.ok);
770 return std::pair<math::XYZPoint, bool>(
track.point,
track.ok);
779 return std::pair<math::XYZPoint, bool>(track1.point, track1.ok);
797 std::cout <<
"propagateTrackerEnd:: Vertex " <<
vertex <<
" Momentum " << momentum <<
" Charge " <<
charge
798 <<
" Radius " <<
radius <<
" Z " <<
zdist << std::endl;
826 double dphi = direction.
phi() - momentum.phi();
827 double rdist =
std::sqrt(vDiff.x() * vDiff.x() + vDiff.y() * vDiff.y());
828 double rat = 0.5 * dphi /
std::sin(0.5 * dphi);
829 double dZ = vDiff.z();
830 double dS = rdist * rat;
835 <<
ok <<
" Point " <<
point <<
" RDist " << rdist <<
" dS " << dS <<
" dS/pt "
836 << rdist * rat / momentum.perp() <<
" zdist " << dZ <<
" dz/pz " << dZ / momentum.z() <<
" Length "
837 << length << std::endl;
841 return std::pair<math::XYZPoint, double>(
point, length);
860 std::cout <<
"propagateCalo:: Vertex " << tpVertex <<
" Momentum " << tpMomentum <<
" Charge " << tpCharge
874 if (tpMomentum.
eta() < 0) {
899 track.point.SetXYZ(-999., -999., -999.);
906 <<
track.ok <<
" Point " <<
track.point <<
" Direction " <<
track.direction << std::endl;
909 track.point.x() - tpVertex.
x(),
track.point.y() - tpVertex.
y(),
track.point.z() - tpVertex.
z());
910 double dphi =
track.direction.phi() - tpMomentum.
phi();
911 double rdist =
std::sqrt(vDiff.x() * vDiff.x() + vDiff.y() * vDiff.y());
912 double pt = tpMomentum.
perp();
913 double rat = 0.5 * dphi /
std::sin(0.5 * dphi);
914 std::cout <<
"RDist " << rdist <<
" pt " <<
pt <<
" r/pt " << rdist * rat /
pt <<
" zdist " << vDiff.z()
915 <<
" pz " << tpMomentum.
z() <<
" z/pz " << vDiff.z() / tpMomentum.
z() << std::endl;
933 edm::SimTrackContainer::const_iterator
itr = SimTk->end();
934 for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
935 if (simTrkItr->trackId() == thisTrk) {
938 std::cout <<
"matched trackId (maximum occurance) " << thisTrk <<
" type " << simTrkItr->type() << std::endl;
945 if (
itr != SimTk->end()) {
946 int vertIndex =
itr->vertIndex();
947 if (vertIndex != -1 && vertIndex < (
int)SimVtx->size()) {
948 edm::SimVertexContainer::const_iterator simVtxItr = SimVtx->begin();
949 for (
int iv = 0; iv < vertIndex; iv++)
970 const std::pair<double, double> rz,
977 std::cout <<
"Propagate track with charge " <<
charge <<
" position " <<
vertex <<
" p " << momentum << std::endl;
980 bool ok = ((ids.first !=
HcalDetId()) && (ids.first.ieta() == ids.second.ieta()) &&
981 (ids.first.iphi() == ids.second.iphi()));
991 const std::pair<double, double> rz,
996 std::cout <<
"Propagate track " << thisTrk <<
" charge " << trk.
charge <<
" position " << trk.
position <<
" p "
999 std::pair<HcalDetId, HcalDetId> ids =
1001 bool ok = ((ids.first !=
HcalDetId()) && (ids.first.ieta() == ids.second.ieta()) &&
1002 (ids.first.iphi() == ids.second.iphi()));
1012 const std::pair<double, double> rz,
1021 std::cout <<
"propagateCalo:: Vertex " <<
vertex <<
" Momentum " << momentum <<
" Charge " <<
charge <<
" R/Z "
1022 << rz.first <<
" : " << rz.second <<
" Type " << typeRZ << std::endl;
1029 for (
int k = 0;
k < 2; ++
k) {
1031 double rzv = (
k == 0) ? rz.first : rz.second;
1061 std::cout <<
"propagateCalo:: Front " <<
id1 <<
" Back " <<
id2 << std::endl;
1063 return std::pair<HcalDetId, HcalDetId>(
id1,
id2);