25 std::vector<spr::propagatedTrackID> vdets;
28 reco::TrackCollection::const_iterator trkItr;
29 for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
33 vdet.
ok = (pTrack->
quality(trackQuality_));
37 if (debug)
std::cout <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta() <<
" phi " << trkItr->phi() <<
" Flag " << vdet.
ok << std::endl;
58 if (debug)
std::cout <<
"Track charge " <<
charge <<
" p " << momentum <<
" position " << vertex << std::endl;
60 std::pair<math::XYZPoint,bool>
info =
84 std::cout <<
"Track [" << indx <<
"] Flag: " << vdet.
ok <<
" ECAL (" 92 vdets.push_back(vdet);
96 std::cout <<
"propagateCALO:: for " << vdets.size() <<
" tracks" << std::endl;
97 for (
unsigned int i=0;
i<vdets.size(); ++
i) {
98 std::cout <<
"Track [" <<
i <<
"] Flag: " << vdets[
i].ok <<
" ECAL (" << vdets[
i].okECAL <<
") ";
112 std::vector<spr::propagatedTrackID> vdets;
125 reco::TrackCollection::const_iterator trkItr;
126 for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
130 vdet.
ok = (pTrack->
quality(trackQuality_));
134 if (debug)
std::cout <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta() <<
" phi " << trkItr->phi() <<
" Flag " << vdet.
ok << std::endl;
137 vdet.
okECAL = info.second;
150 vdet.
okHCAL = info.second;
158 std::cout <<
"Track [" << indx <<
"] Flag: " << vdet.
ok <<
" ECAL (" 166 vdets.push_back(vdet);
170 std::cout <<
"propagateCALO:: for " << vdets.size() <<
" tracks" << std::endl;
171 for (
unsigned int i=0;
i<vdets.size(); ++
i) {
172 std::cout <<
"Track [" <<
i <<
"] Flag: " << vdets[
i].ok <<
" ECAL (" << vdets[
i].okECAL <<
") ";
191 reco::TrackCollection::const_iterator trkItr;
192 for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
196 trkD.
ok = (pTrack->
quality(trackQuality_));
200 if (debug)
std::cout <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta() <<
" phi " << trkItr->phi() <<
" Flag " << trkD.
ok << std::endl;
223 trkDir.push_back(trkD);
227 std::cout <<
"propagateCALO:: for " << trkDir.size() <<
" tracks" << std::endl;
228 for (
unsigned int i=0;
i<trkDir.size(); ++
i) {
229 std::cout <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL <<
")";
230 if (trkDir[
i].okECAL) {
231 std::cout <<
" point " << trkDir[
i].pointECAL <<
" direction " 232 << trkDir[
i].directionECAL <<
" ";
233 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
239 std::cout <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
240 if (trkDir[
i].okHCAL) {
241 std::cout <<
" point " << trkDir[
i].pointHCAL <<
" direction " 242 << trkDir[
i].directionHCAL <<
" " 261 if (debug)
std::cout <<
"Propagate track: p " << pTrack->
p() <<
" eta " << pTrack->
eta() <<
" phi " << pTrack->
phi() <<
" Flag " << vdet.
ok << std::endl;
264 vdet.
okECAL = info.second;
277 vdet.
okHCAL = info.second;
286 std::cout <<
"propagateCALO:: for 1 track" << std::endl;
304 std::vector<spr::propagatedGenTrackID> trkDir;
306 HepMC::GenEvent::particle_const_iterator
p;
307 for (p=genEvent->particles_begin(),indx=0; p != genEvent->particles_end(); ++
p,++indx) {
313 trkD.
pdgId = ((*p)->pdg_id());
314 trkD.
charge = ((pdt->particle(trkD.
pdgId))->
ID().threeCharge())/3;
316 if (debug)
std::cout <<
"Propagate track " << indx <<
" pdg " << trkD.
pdgId <<
" charge " << trkD.
charge <<
" p " << momentum << std::endl;
319 if ( (*p)->status()==1 &&
std::abs((*p)->momentum().eta()) < etaMax ) {
321 0.1*(*p)->production_vertex()->position().y(),
322 0.1*(*p)->production_vertex()->position().z());
347 trkDir.push_back(trkD);
351 std::cout <<
"propagateCALO:: for " << trkDir.size() <<
" tracks" << std::endl;
352 for (
unsigned int i=0;
i<trkDir.size(); ++
i) {
353 if (trkDir[
i].okECAL)
std::cout <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL <<
")";
354 if (trkDir[
i].okECAL) {
355 std::cout <<
" point " << trkDir[
i].pointECAL <<
" direction " 356 << trkDir[
i].directionECAL <<
" ";
357 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
363 if (trkDir[
i].okECAL)
std::cout <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
364 if (trkDir[
i].okHCAL) {
365 std::cout <<
" point " << trkDir[
i].pointHCAL <<
" direction " 366 << trkDir[
i].directionHCAL <<
" " 381 std::vector<spr::propagatedGenParticleID> trkDir;
383 reco::GenParticleCollection::const_iterator
p;
384 for (p=genParticles->begin(),indx=0; p != genParticles->end(); ++
p,++indx) {
390 trkD.
pdgId = (p->pdgId());
391 trkD.
charge = p->charge();
393 if (debug)
std::cout <<
"Propagate track " << indx <<
" pdg " << trkD.
pdgId <<
" charge " << trkD.
charge <<
" p " << momentum << std::endl;
396 if ( p->status()==1 &&
std::abs(momentum.
eta()) < etaMax ) {
422 trkDir.push_back(trkD);
426 std::cout <<
"propagateCALO:: for " << trkDir.size() <<
" tracks" << std::endl;
427 for (
unsigned int i=0;
i<trkDir.size(); ++
i) {
428 if (trkDir[
i].okECAL)
std::cout <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL <<
")";
429 if (trkDir[
i].okECAL) {
430 std::cout <<
" point " << trkDir[
i].pointECAL <<
" direction " 431 << trkDir[
i].directionECAL <<
" ";
432 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
438 if (trkDir[
i].okECAL)
std::cout <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
439 if (trkDir[
i].okHCAL) {
440 std::cout <<
" point " << trkDir[
i].pointHCAL <<
" direction " 441 << trkDir[
i].directionHCAL <<
" " 462 if (debug)
std::cout <<
"Propagate track " << thisTrk <<
" charge " << trk.
charge <<
" position " << trk.
position <<
" p " << trk.
momentum <<
" Flag " << trkD.
ok << std::endl;
490 std::cout <<
"propagateCALO:: for track [" << thisTrk <<
"] Flag: " << trkD.
ok <<
" ECAL (" << trkD.
okECAL <<
") HCAL (" << trkD.
okHCAL <<
")" << std::endl;
521 return std::pair<bool,HcalDetId>(
false,
HcalDetId());
550 return std::pair<math::XYZPoint,bool>(track.
point,track.
ok);
577 return std::pair<math::XYZPoint,bool>(track.
point,track.
ok);
585 return std::pair<math::XYZPoint,bool>(track1.point,track1.ok);
595 if (debug)
std::cout <<
"propagateTrackerEnd:: Vertex " << vertex <<
" Momentum " << momentum <<
" Charge " <<
charge <<
" Radius " << radius <<
" Z " << zdist << std::endl;
621 math::XYZPoint vDiff(point.x()-vertex.x(), point.y()-vertex.y(), point.z()-vertex.z());
622 double dphi = direction.
phi()-momentum.
phi();
623 double rdist =
std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
624 double rat = 0.5*dphi/
std::sin(0.5*dphi);
625 double dZ = vDiff.z();
626 double dS = rdist*rat;
629 std::cout <<
"propagateTracker:: Barrel " << tsosb.
isValid() <<
" Endcap " << tsose.
isValid() <<
" OverAll " << ok <<
" Point " << point <<
" RDist " << rdist <<
" dS " << dS <<
" dS/pt " << rdist*rat/momentum.perp() <<
" zdist " << dZ <<
" dz/pz " << dZ/momentum.z() <<
" Length " << length << std::endl;
632 return std::pair<math::XYZPoint,double>(
point,length);
638 if (debug)
std::cout <<
"propagateCalo:: Vertex " << tpVertex <<
" Momentum " << tpMomentum <<
" Charge " << tpCharge <<
" Radius " << radius <<
" Z " << zdist <<
" Corner " << corner << std::endl;
649 if (tpMomentum.
eta() < 0) {
660 if (absEta < corner) {
674 track.
point.SetXYZ(-999., -999., -999.);
679 std::cout <<
"propagateCalo:: Barrel " << tsosb.
isValid() <<
" Endcap " << tsose.
isValid() <<
" OverAll " << track.
ok <<
" Point " << track.
point <<
" Direction " << track.
direction << std::endl;
683 double rdist =
std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
684 double pt = tpMomentum.
perp();
685 double rat = 0.5*dphi/
std::sin(0.5*dphi);
686 std::cout <<
"RDist " << rdist <<
" pt " << pt <<
" r/pt " << rdist*rat/pt <<
" zdist " << vDiff.z() <<
" pz " << tpMomentum.
z() <<
" z/pz " << vDiff.z()/tpMomentum.
z() << std::endl;
696 edm::SimTrackContainer::const_iterator itr = SimTk->end();
697 for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
698 if ( simTrkItr->trackId() == thisTrk ) {
699 if (debug)
std::cout <<
"matched trackId (maximum occurance) " << thisTrk <<
" type " << simTrkItr->type() << std::endl;
705 if (itr != SimTk->end()) {
706 int vertIndex = itr->vertIndex();
707 if (vertIndex != -1 && vertIndex < (
int)SimVtx->size()) {
708 edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
709 for (
int iv=0; iv<vertIndex; iv++) simVtxItr++;
const double Z[kNumberCalorimeter]
virtual DetId getClosestCell(const GlobalPoint &r) const
double p() const
momentum vector magnitude
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, 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
static const double etaBEHcal
virtual DetId getClosestCell(const GlobalPoint &r) const
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
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
reco::TrackCollection::const_iterator trkItr
static const double zFrontEE
double eta() const
pseudorapidity of momentum vector
static const double rBackTB
static PlanePointer build(Args &&...args)
static const double rFrontEB
std::pair< bool, HcalDetId > propagateHCALBack(const reco::Track *, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
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)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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 const double zFrontTE
XYZPointD XYZPoint
point in space with cartesian internal representation
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
std::vector< spr::propagatedTrackID > propagateCosmicCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
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