20 std::vector<spr::propagatedTrackID> vdets;
33 reco::TrackCollection::const_iterator trkItr;
34 for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
38 vdet.
ok = (pTrack->
quality(trackQuality_));
42 if (debug)
std::cout <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta() <<
" phi " << trkItr->phi() <<
" Flag " << vdet.
ok << std::endl;
66 vdets.push_back(vdet);
70 std::cout <<
"propagateCALO:: for " << vdets.size() <<
" tracks" << std::endl;
71 for (
unsigned int i=0;
i<vdets.size(); ++
i) {
72 std::cout <<
"Track [" <<
i <<
"] Flag: " << vdets[
i].ok <<
" ECAL (" << vdets[
i].okECAL <<
") ";
91 reco::TrackCollection::const_iterator trkItr;
92 for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
96 trkD.
ok = (pTrack->
quality(trackQuality_));
100 if (debug)
std::cout <<
"Propagate track " << indx <<
" p " << trkItr->p() <<
" eta " << trkItr->eta() <<
" phi " << trkItr->phi() <<
" Flag " << trkD.
ok << std::endl;
123 trkDir.push_back(trkD);
127 std::cout <<
"propagateCALO:: for " << trkDir.size() <<
" tracks" << std::endl;
128 for (
unsigned int i=0;
i<trkDir.size(); ++
i) {
129 std::cout <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL <<
")";
130 if (trkDir[
i].okECAL) {
131 std::cout <<
" point " << trkDir[
i].pointECAL <<
" direction "
132 << trkDir[
i].directionECAL <<
" ";
133 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
139 std::cout <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
140 if (trkDir[
i].okHCAL) {
141 std::cout <<
" point " << trkDir[
i].pointHCAL <<
" direction "
142 << trkDir[
i].directionHCAL <<
" "
156 std::vector<spr::propagatedGenTrackID> trkDir;
158 HepMC::GenEvent::particle_const_iterator
p;
159 for (p=genEvent->particles_begin(),indx=0; p != genEvent->particles_end(); ++
p,++indx) {
165 trkD.
pdgId = ((*p)->pdg_id());
166 trkD.
charge = ((pdt->particle(trkD.
pdgId))->
ID().threeCharge())/3;
168 if (debug)
std::cout <<
"Propagate track " << indx <<
" pdg " << trkD.
pdgId <<
" charge " << trkD.
charge <<
" p " << momentum << std::endl;
171 if ( (*p)->status()==1 &&
std::abs((*p)->momentum().eta()) < etaMax ) {
173 0.1*(*p)->production_vertex()->position().y(),
174 0.1*(*p)->production_vertex()->position().z());
199 trkDir.push_back(trkD);
203 std::cout <<
"propagateCALO:: for " << trkDir.size() <<
" tracks" << std::endl;
204 for (
unsigned int i=0;
i<trkDir.size(); ++
i) {
205 if (trkDir[
i].okECAL)
std::cout <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL <<
")";
206 if (trkDir[
i].okECAL) {
207 std::cout <<
" point " << trkDir[
i].pointECAL <<
" direction "
208 << trkDir[
i].directionECAL <<
" ";
209 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
215 if (trkDir[
i].okECAL)
std::cout <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
216 if (trkDir[
i].okHCAL) {
217 std::cout <<
" point " << trkDir[
i].pointHCAL <<
" direction "
218 << trkDir[
i].directionHCAL <<
" "
233 std::vector<spr::propagatedGenParticleID> trkDir;
235 reco::GenParticleCollection::const_iterator
p;
236 for (p=genParticles->begin(),indx=0; p != genParticles->end(); ++
p,++indx) {
242 trkD.
pdgId = (p->pdgId());
243 trkD.
charge = p->charge();
245 if (debug)
std::cout <<
"Propagate track " << indx <<
" pdg " << trkD.
pdgId <<
" charge " << trkD.
charge <<
" p " << momentum << std::endl;
248 if ( p->status()==1 &&
std::abs(momentum.
eta()) < etaMax ) {
274 trkDir.push_back(trkD);
278 std::cout <<
"propagateCALO:: for " << trkDir.size() <<
" tracks" << std::endl;
279 for (
unsigned int i=0;
i<trkDir.size(); ++
i) {
280 if (trkDir[
i].okECAL)
std::cout <<
"Track [" <<
i <<
"] Flag: " << trkDir[
i].ok <<
" ECAL (" << trkDir[
i].okECAL <<
")";
281 if (trkDir[
i].okECAL) {
282 std::cout <<
" point " << trkDir[
i].pointECAL <<
" direction "
283 << trkDir[
i].directionECAL <<
" ";
284 if (trkDir[
i].detIdECAL.subdetId() ==
EcalBarrel) {
290 if (trkDir[
i].okECAL)
std::cout <<
" HCAL (" << trkDir[
i].okHCAL <<
")";
291 if (trkDir[
i].okHCAL) {
292 std::cout <<
" point " << trkDir[
i].pointHCAL <<
" direction "
293 << trkDir[
i].directionHCAL <<
" "
314 if (debug)
std::cout <<
"Propagate track " << thisTrk <<
" charge " << trk.
charge <<
" position " << trk.
position <<
" p " << trk.
momentum <<
" Flag " << trkD.
ok << std::endl;
342 std::cout <<
"propagateCALO:: for track [" << thisTrk <<
"] Flag: " << trkD.
ok <<
" ECAL (" << trkD.
okECAL <<
") HCAL (" << trkD.
okHCAL <<
")" << std::endl;
388 return std::pair<math::XYZPoint,bool>(track.
point,track.
ok);
415 return std::pair<math::XYZPoint,bool>(track.
point,track.
ok);
423 return std::pair<math::XYZPoint,bool>(track1.point,track1.ok);
433 if (debug)
std::cout <<
"propagateTrackerEnd:: Vertex " << vertex <<
" Momentum " << momentum <<
" Charge " <<
charge <<
" Radius " << radius <<
" Z " << zdist << std::endl;
459 math::XYZPoint vDiff(point.x()-vertex.x(), point.y()-vertex.y(), point.z()-vertex.z());
460 double dphi = direction.
phi()-momentum.
phi();
461 double rdist =
std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
462 double rat = 0.5*dphi/
std::sin(0.5*dphi);
463 double dZ = vDiff.z();
464 double dS = rdist*rat;
467 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;
470 return std::pair<math::XYZPoint,double>(
point,length);
476 if (debug)
std::cout <<
"propagateCalo:: Vertex " << tpVertex <<
" Momentum " << tpMomentum <<
" Charge " << tpCharge <<
" Radius " << radius <<
" Z " << zdist <<
" Corner " << corner << std::endl;
487 if (tpMomentum.
eta() < 0) {
498 if (absEta < corner) {
512 track.
point.SetXYZ(-999., -999., -999.);
517 std::cout <<
"propagateCalo:: Barrel " << tsosb.
isValid() <<
" Endcap " << tsose.
isValid() <<
" OverAll " << track.
ok <<
" Point " << track.
point <<
" Direction " << track.
direction << std::endl;
521 double rdist =
std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
522 double pt = tpMomentum.
perp();
523 double rat = 0.5*dphi/
std::sin(0.5*dphi);
524 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;
534 edm::SimTrackContainer::const_iterator itr = SimTk->end();
535 for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
536 if ( simTrkItr->trackId() == thisTrk ) {
537 if (debug)
std::cout <<
"matched trackId (maximum occurance) " << thisTrk <<
" type " << simTrkItr->type() << std::endl;
543 if (itr != SimTk->end()) {
544 int vertIndex = itr->vertIndex();
545 if (vertIndex != -1 && vertIndex < (
int)SimVtx->size()) {
546 edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
547 for (
int iv=0; iv<vertIndex; iv++) simVtxItr++;
551 trk.
charge = (int)(itr->charge());
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
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.
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)
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
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
HepMC::GenEvent::particle_const_iterator trkItr
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
reco::TrackCollection::const_iterator trkItr
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
GlobalVector directionHCAL
XYZPointD XYZPoint
point in space with cartesian internal representation
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)
reco::TrackCollection::const_iterator trkItr
int charge() const
track electric charge
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)
*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