59 ttree_track_hits_->Branch(
"evt", &
evt,
"evt/I", bufsize);
60 ttree_track_hits_->Branch(
"run", &
run,
"run/I", bufsize);
62 ttree_track_hits_->Branch(
"subdetId", &
subdetId,
"subdetId/I", bufsize);
64 ttree_track_hits_->Branch(
"layer" , &
layer ,
"layer/I" , bufsize);
65 ttree_track_hits_->Branch(
"ladder", &
ladder,
"ladder/I", bufsize);
66 ttree_track_hits_->Branch(
"mod" , &
mod ,
"mod/I" , bufsize);
68 ttree_track_hits_->Branch(
"side" , &
side ,
"side/I" , bufsize);
69 ttree_track_hits_->Branch(
"disk" , &
disk ,
"disk/I" , bufsize);
70 ttree_track_hits_->Branch(
"blade" , &
blade ,
"blade/I" , bufsize);
71 ttree_track_hits_->Branch(
"panel" , &
panel ,
"panel/I" , bufsize);
72 ttree_track_hits_->Branch(
"plaq" , &
plaq ,
"plaq/I" , bufsize);
74 ttree_track_hits_->Branch(
"half" , &
half ,
"half/I" , bufsize);
75 ttree_track_hits_->Branch(
"flipped", &
flipped,
"flipped/I", bufsize);
77 ttree_track_hits_->Branch(
"rechitx", &
rechitx,
"rechitx/F" , bufsize);
78 ttree_track_hits_->Branch(
"rechity", &
rechity,
"rechity/F" , bufsize);
79 ttree_track_hits_->Branch(
"rechitz", &
rechitz,
"rechitz/F" , bufsize);
81 ttree_track_hits_->Branch(
"rechiterrx", &
rechiterrx,
"rechiterrx/F" , bufsize);
82 ttree_track_hits_->Branch(
"rechiterry", &
rechiterry,
"rechiterry/F" , bufsize);
84 ttree_track_hits_->Branch(
"rechitresx", &
rechitresx,
"rechitresx/F" , bufsize);
85 ttree_track_hits_->Branch(
"rechitresy", &
rechitresy,
"rechitresy/F" , bufsize);
87 ttree_track_hits_->Branch(
"rechitpullx", &
rechitpullx,
"rechitpullx/F", bufsize);
88 ttree_track_hits_->Branch(
"rechitpully", &
rechitpully,
"rechitpully/F", bufsize);
90 ttree_track_hits_->Branch(
"npix" , &
npix ,
"npix/I" , bufsize);
91 ttree_track_hits_->Branch(
"nxpix" , &
nxpix ,
"nxpix/I" , bufsize);
92 ttree_track_hits_->Branch(
"nypix" , &
nypix ,
"nypix/I" , bufsize);
93 ttree_track_hits_->Branch(
"charge", &
charge,
"charge/F", bufsize);
95 ttree_track_hits_->Branch(
"edgex", &
edgex,
"edgex/I", bufsize);
96 ttree_track_hits_->Branch(
"edgey", &
edgey,
"edgey/I", bufsize);
98 ttree_track_hits_->Branch(
"bigx", &
bigx,
"bigx/I", bufsize);
99 ttree_track_hits_->Branch(
"bigy", &
bigy,
"bigy/I", bufsize);
101 ttree_track_hits_->Branch(
"alpha", &
alpha,
"alpha/F", bufsize);
102 ttree_track_hits_->Branch(
"beta" , &
beta ,
"beta/F" , bufsize);
104 ttree_track_hits_->Branch(
"trk_alpha", &
trk_alpha,
"trk_alpha/F", bufsize);
105 ttree_track_hits_->Branch(
"trk_beta" , &
trk_beta ,
"trk_beta/F" , bufsize);
107 ttree_track_hits_->Branch(
"phi", &
phi,
"phi/F", bufsize);
108 ttree_track_hits_->Branch(
"eta", &
eta,
"eta/F", bufsize);
110 ttree_track_hits_->Branch(
"simhitx", &
simhitx,
"simhitx/F", bufsize);
111 ttree_track_hits_->Branch(
"simhity", &
simhity,
"simhity/F", bufsize);
113 ttree_track_hits_->Branch(
"nsimhit", &
nsimhit,
"nsimhit/I", bufsize);
114 ttree_track_hits_->Branch(
"pidhit" , &
pidhit ,
"pidhit/I" , bufsize);
115 ttree_track_hits_->Branch(
"simproc", &
simproc,
"simproc/I", bufsize);
117 ttree_track_hits_->Branch(
"hit_probx" , &
hit_probx ,
"hit_probx/F" , bufsize);
118 ttree_track_hits_->Branch(
"hit_proby" , &
hit_proby ,
"hit_proby/F" , bufsize);
119 ttree_track_hits_->Branch(
"hit_cprob0", &
hit_cprob0,
"hit_cprob0/F", bufsize);
120 ttree_track_hits_->Branch(
"hit_cprob1", &
hit_cprob1,
"hit_cprob1/F", bufsize);
121 ttree_track_hits_->Branch(
"hit_cprob2", &
hit_cprob2,
"hit_cprob2/F", bufsize);
269 cout <<
"evt = " <<
evt << endl;
272 float radtodeg = 180.0 /
math_pi;
278 float mindist = 999999.9;
280 std::vector<PSimHit> matched;
295 for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++)
297 DetId detId = ((*it)->geographicalId());
300 if (dsmatch == recHitColl->end())
continue;
306 std::vector<PSimHit> matched;
309 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter)
315 if ( matched.empty() )
317 cout <<
"SiPixelErrorEstimation::analyze: rechits without associated simhit !!!!!!!"
456 cout <<
"SiPixelErrorEstimation::analyze: Not in a pixel detector !!!!!" << endl;
465 const int maxPixelCol = pixeliter->cluster()->maxPixelCol();
466 const int maxPixelRow = pixeliter->cluster()->maxPixelRow();
467 const int minPixelCol = pixeliter->cluster()->minPixelCol();
468 const int minPixelRow = pixeliter->cluster()->minPixelRow();
508 if ( tmp_nrows == 80 )
510 else if ( tmp_nrows == 160 )
513 cout <<
"-------------------------------------------------- Wrong module size !!!" << endl;
533 else std::cout <<
"We are not in the pixel detector" << (int)detId.
subdetId() << endl;
548 bool found_hit_from_generated_particle =
false;
551 float closest_dist = 99999.9;
552 std::vector<PSimHit>::const_iterator closest_simhit = matched.begin();
554 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
m < matched.end();
m++)
558 int pid = (*m).particleType();
563 float simhitx = 0.5 * ( (*m).entryPoint().x() + (*m).exitPoint().x() );
564 float simhity = 0.5 * ( (*m).entryPoint().y() + (*m).exitPoint().y() );
566 float x_res = simhitx -
rechitx;
567 float y_res = simhity -
rechity;
569 float dist =
sqrt( x_res*x_res + y_res*y_res );
571 if ( dist < closest_dist )
575 found_hit_from_generated_particle =
true;
581 if (
checkType_ && !found_hit_from_generated_particle )
584 all_x1 = (*closest_simhit).entryPoint().x();
585 all_y1 = (*closest_simhit).entryPoint().y();
586 all_z1 = (*closest_simhit).entryPoint().z();
587 all_x2 = (*closest_simhit).exitPoint().x();
588 all_y2 = (*closest_simhit).exitPoint().y();
589 all_z2 = (*closest_simhit).exitPoint().z();
592 (*closest_simhit).entryPoint().y(),
593 (*closest_simhit).entryPoint().z() ) );
596 (*closest_simhit).exitPoint().y(),
597 (*closest_simhit).exitPoint().z() ) );
607 (*closest_simhit).entryPoint().y(),
608 (*closest_simhit).entryPoint().z() ) );
611 (*closest_simhit).exitPoint().y(),
612 (*closest_simhit).exitPoint().z() ) );
627 SiPixelRecHit::ClusterRef
const& clust = pixeliter->cluster();
649 all_simpx = (*closest_simhit).momentumAtEntry().x();
650 all_simpy = (*closest_simhit).momentumAtEntry().y();
651 all_simpz = (*closest_simhit).momentumAtEntry().z();
652 all_eloss = (*closest_simhit).energyLoss();
655 all_pidhit = (*closest_simhit).particleType();
665 SimTrackContainer::const_iterator trksiter;
666 for (trksiter = trks.begin(); trksiter != trks.end(); trksiter++)
667 if ( (
int)trksiter->trackId() ==
all_trkid )
680 const std::vector<SiPixelCluster::Pixel>& pixvector = clust->pixels();
681 for (
int i=0;
i<(int)pixvector.size(); ++
i)
714 reco::TrackCollection::const_iterator tciter;
716 if ( tracks->size() > 0 )
719 for ( tciter=tracks->begin(); tciter!=tracks->end(); ++tciter)
785 error = (*it)->localPositionError();
793 npix = matchedhit->cluster()->size();
794 nxpix = matchedhit->cluster()->sizeX();
795 nypix = matchedhit->cluster()->sizeY();
796 charge = matchedhit->cluster()->charge();
800 hit_cprob0 = (float)matchedhit->clusterProbability(0);
801 hit_cprob1 = (float)matchedhit->clusterProbability(1);
802 hit_cprob2 = (float)matchedhit->clusterProbability(2);
811 if ( !matched.empty() )
814 float distx, disty, dist;
815 bool found_hit_from_generated_particle =
false;
817 int n_assoc_muon = 0;
819 vector<PSimHit>::const_iterator closestit = matched.begin();
820 for (vector<PSimHit>::const_iterator
m=matched.begin();
m<matched.end(); ++
m)
824 int pid = (*m).particleType();
829 float simhitx = 0.5 * ( (*m).entryPoint().x() + (*m).exitPoint().x() );
830 float simhity = 0.5 * ( (*m).entryPoint().y() + (*m).exitPoint().y() );
832 distx = fabs(
rechitx - simhitx);
833 disty = fabs(
rechity - simhity);
834 dist =
sqrt( distx*distx + disty*disty );
836 if ( dist < mindist )
842 found_hit_from_generated_particle =
true;
848 if (
checkType_ && !found_hit_from_generated_particle )
857 detId = (*it)->geographicalId();
864 pidhit = (*closestit).particleType();
865 simproc = (int)(*closestit).processType();
867 simhitx = 0.5*( (*closestit).entryPoint().x() + (*closestit).exitPoint().x() );
868 simhity = 0.5*( (*closestit).entryPoint().y() + (*closestit).exitPoint().y() );
875 float simhitpx = (*closestit).momentumAtEntry().x();
876 float simhitpy = (*closestit).momentumAtEntry().y();
877 float simhitpz = (*closestit).momentumAtEntry().z();
879 beta = atan2(simhitpz, simhitpy) * radtodeg;
880 alpha = atan2(simhitpz, simhitpx) * radtodeg;
886 float locx = simhitpx;
887 float locy = simhitpy;
888 float locz = simhitpz;
890 bool isFlipped =
false;
902 trk_beta = acos(locy/
sqrt(locy*locy+locz*locz)) * radtodeg;
905 phi = tciter->momentum().phi() /
math_pi*180.0;
906 eta = tciter->momentum().eta();
908 const int maxPixelCol = (*matchedhit).cluster()->maxPixelCol();
909 const int maxPixelRow = (*matchedhit).cluster()->maxPixelRow();
910 const int minPixelCol = (*matchedhit).cluster()->minPixelCol();
911 const int minPixelRow = (*matchedhit).cluster()->minPixelRow();
943 if ( tmp_nrows == 80 )
945 else if ( tmp_nrows == 160 )
948 cout <<
"-------------------------------------------------- Wrong module size !!!" << endl;
987 cout <<
"---------------- RecHit with no associated SimHit !!! -------------------------- " << endl;
1012 cout <<
"---------------------------------------------- Not a pixel detector !!!!!!!!!!!!!!" << endl;
1019 float xcenter = cl.
x();
1020 float ycenter = cl.
y();
1028 float gp_mod =
sqrt( gp.
x()*gp.
x() + gp.
y()*gp.
y() + gp.
z()*gp.
z() );
1031 float gpx = gp.
x()/gp_mod;
1032 float gpy = gp.
y()/gp_mod;
1033 float gpz = gp.
z()/gp_mod;
1060 float gv_dot_gvx = gv.
x()*gvx.
x() + gv.
y()*gvx.
y() + gv.
z()*gvx.
z();
1061 float gv_dot_gvy = gv.
x()*gvy.
x() + gv.
y()*gvy.
y() + gv.
z()*gvy.
z();
1062 float gv_dot_gvz = gv.
x()*gvz.
x() + gv.
y()*gvz.
y() + gv.
z()*gvz.
z();
1065 alpha = atan2( gv_dot_gvz, gv_dot_gvx );
1066 beta = atan2( gv_dot_gvz, gv_dot_gvy );
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
unsigned int panel() const
panel id
virtual bool containsBigPixelInX(const int &ixmin, const int &ixmax) const =0
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
TTree * ttree_track_hits_
virtual int ncolumns() const =0
#define DEFINE_FWK_MODULE(type)
std::vector< Track > TrackCollection
collection of Tracks
virtual int nrows() const =0
virtual ~SiPixelErrorEstimation()
unsigned int ladder() const
ladder id
static int position[TOTALCHAMBERS][3]
unsigned int layer() const
layer id
unsigned int blade() const
blade id
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
virtual bool isItEdgePixelInX(int ixbin) const =0
unsigned int module() const
det id
SiPixelErrorEstimation(const edm::ParameterSet &)
unsigned int module() const
det id
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
virtual bool containsBigPixelInY(const int &iymin, const int &iymax) const =0
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int disk() const
disk id
Point3DBase< float, LocalTag > Local3DPoint
void computeAnglesFromDetPosition(const SiPixelCluster &cl, const GeomDetUnit &det, float &alpha, float &beta)
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
T const * product() const
Pixel cluster – collection of neighboring pixels above threshold.
virtual bool isItEdgePixelInY(int iybin) const =0
const BoundPlane & surface() const
The nominal surface of the GeomDet.
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
unsigned int side() const
positive or negative id
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const PositionType & position() const
std::vector< SimTrack > SimTrackContainer