19 #include "HepMC/GenEvent.h"
20 #include "HepMC/GenVertex.h"
32 #include <gsl/gsl_math.h>
33 #include <gsl/gsl_eigen.h>
57 tversion = tversion.Remove(0,1);
58 tversion = tversion.Remove(tversion.Length()-1,tversion.Length());
59 outputFile_ = std::string(tversion)+
"_"+outputFile_;
62 for(std::vector<std::string>::iterator isample = vtxSample_.begin(); isample!=vtxSample_.end(); ++isample) {
63 if ( *isample ==
"offlinePrimaryVertices" ) suffixSample_.push_back(
"AVF");
64 if ( *isample ==
"offlinePrimaryVerticesWithBS" ) suffixSample_.push_back(
"wBS");
66 if ( suffixSample_.size() == 0 )
throw cms::Exception(
"NoVertexSamples") <<
" no known vertex samples given";
68 rootFile_ =
new TFile(outputFile_.c_str(),
"RECREATE");
94 std::cout <<
" PrimaryVertexAnalyzer::beginJob conversion from sim units to rec units is " << simUnit_ << std::endl;
99 for (std::vector<std::string>::iterator isuffix= suffixSample_.begin(); isuffix!=suffixSample_.end(); isuffix++) {
101 hdir[*isuffix] = rootFile_->mkdir(TString(*isuffix));
102 hdir[*isuffix]->cd();
103 h[
"nbvtx"+ *isuffix] =
new TH1F(TString(
"nbvtx"+ *isuffix),
"Reconstructed Vertices in Event",20,-0.5,19.5);
104 h[
"nbtksinvtx"+ *isuffix] =
new TH1F(TString(
"nbtksinvtx"+ *isuffix),
"Reconstructed Tracks in Vertex",200,-0.5,199.5);
105 h[
"resx"+ *isuffix] =
new TH1F(TString(
"resx"+ *isuffix),
"Residual X",100,-0.04,0.04);
106 h[
"resy"+ *isuffix] =
new TH1F(TString(
"resy"+ *isuffix),
"Residual Y",100,-0.04,0.04);
107 h[
"resz"+ *isuffix] =
new TH1F(TString(
"resz"+ *isuffix),
"Residual Z",100,-0.1,0.1);
108 h[
"pullx"+ *isuffix] =
new TH1F(TString(
"pullx"+ *isuffix),
"Pull X",100,-25.,25.);
109 h[
"pully"+ *isuffix] =
new TH1F(TString(
"pully"+ *isuffix),
"Pull Y",100,-25.,25.);
110 h[
"pullz"+ *isuffix] =
new TH1F(TString(
"pullz"+ *isuffix),
"Pull Z",100,-25.,25.);
111 h[
"vtxchi2"+ *isuffix] =
new TH1F(TString(
"vtxchi2"+ *isuffix),
"#chi^{2}",100,0.,100.);
112 h[
"vtxndf"+ *isuffix] =
new TH1F(TString(
"vtxndf"+ *isuffix),
"ndof",100,0.,100.);
113 h[
"tklinks"+ *isuffix] =
new TH1F(TString(
"tklinks"+ *isuffix),
"Usable track links",2,-0.5,1.5);
114 h[
"nans"+ *isuffix] =
new TH1F(TString(
"nans"+ *isuffix),
"Illegal values for x,y,z,xx,xy,xz,yy,yz,zz",9,0.5,9.5);
116 h[
"vtxprob"+ *isuffix] =
new TH1F(TString(
"vtxprob"+ *isuffix),
"#chi^{2} probability",100,0.,1.);
117 h[
"eff"+ *isuffix] =
new TH1F(TString(
"eff"+ *isuffix),
"efficiency",2, -0.5, 1.5);
118 h[
"efftag"+ *isuffix] =
new TH1F(TString(
"efftag"+ *isuffix),
"efficiency tagged vertex",2, -0.5, 1.5);
119 h[
"effvseta"+ *isuffix] =
new TProfile(TString(
"effvseta"+ *isuffix),
"efficiency vs eta",20, -2.5, 2.5, 0, 1.);
120 h[
"effvsptsq"+ *isuffix] =
new TProfile(TString(
"effvsptsq"+ *isuffix),
"efficiency vs ptsq",20, 0., 10000., 0, 1.);
121 h[
"effvsntrk"+ *isuffix] =
new TProfile(TString(
"effvsntrk"+ *isuffix),
"efficiency vs # simtracks",200, 0., 200., 0, 1.);
122 h[
"effvsnrectrk"+ *isuffix] =
new TProfile(TString(
"effvsnrectrk"+ *isuffix),
"efficiency vs # rectracks",200, 0., 200., 0, 1.);
123 h[
"effvsz"+ *isuffix] =
new TProfile(TString(
"effvsz"+ *isuffix),
"efficiency vs z",40, -20., 20., 0, 1.);
124 h[
"nbsimtksinvtx"+ *isuffix]=
new TH1F(TString(
"nbsimtksinvtx"+ *isuffix),
"simulated tracks in vertex",100,-0.5,99.5);
125 h[
"xrec"+ *isuffix] =
new TH1F(TString(
"xrec"+ *isuffix),
"reconstructed x",100,-0.1,0.1);
126 h[
"yrec"+ *isuffix] =
new TH1F(TString(
"yrec"+ *isuffix),
"reconstructed y",100,-0.1,0.1);
127 h[
"zrec"+ *isuffix] =
new TH1F(TString(
"zrec"+ *isuffix),
"reconstructed z",100,-20.,20.);
128 h[
"xsim"+ *isuffix] =
new TH1F(TString(
"xsim"+ *isuffix),
"simulated x",100,-0.1,0.1);
129 h[
"ysim"+ *isuffix] =
new TH1F(TString(
"ysim"+ *isuffix),
"simulated y",100,-0.1,0.1);
130 h[
"zsim"+ *isuffix] =
new TH1F(TString(
"zsim"+ *isuffix),
"simulated z",100,-20.,20.);
131 h[
"nrecvtx"+ *isuffix] =
new TH1F(TString(
"nrecvtx"+ *isuffix),
"# of reconstructed vertices", 50, -0.5, 49.5);
132 h[
"nsimvtx"+ *isuffix] =
new TH1F(TString(
"nsimvtx"+ *isuffix),
"# of simulated vertices", 50, -0.5, 49.5);
133 h[
"nrectrk"+ *isuffix] =
new TH1F(TString(
"nrectrk"+ *isuffix),
"# of reconstructed tracks", 200, -0.5, 199.5);
134 h[
"nsimtrk"+ *isuffix] =
new TH1F(TString(
"nsimtrk"+ *isuffix),
"# of simulated tracks", 200, -0.5, 199.5);
135 h[
"xrectag"+ *isuffix] =
new TH1F(TString(
"xrectag"+ *isuffix),
"reconstructed x, signal vtx",100,-0.1,0.1);
136 h[
"yrectag"+ *isuffix] =
new TH1F(TString(
"yrectag"+ *isuffix),
"reconstructed y, signal vtx",100,-0.1,0.1);
137 h[
"zrectag"+ *isuffix] =
new TH1F(TString(
"zrectag"+ *isuffix),
"reconstructed z, signal vtx",100,-20.,20.);
138 h[
"rapidity"+ *isuffix] =
new TH1F(TString(
"rapidity"+ *isuffix),
"rapidity ",100,-10., 10.);
139 h[
"pt"+ *isuffix] =
new TH1F(TString(
"pt"+ *isuffix),
"pt ",100,0., 20.);
140 h[
"nrectrk0vtx"+ *isuffix] =
new TH1F(TString(
"nrectrk0vtx"+ *isuffix),
"# rec tracks no vertex ",200,0., 200.);
141 h[
"zdistancetag"+ *isuffix] =
new TH1F(TString(
"zdistancetag"+ *isuffix),
"z-distance between tagged and generated",100, -0.1, 0.1);
142 h[
"puritytag"+ *isuffix] =
new TH1F(TString(
"puritytag"+ *isuffix),
"purity of primary vertex tags",2, -0.5, 1.5);
151 for (std::map<std::string, TDirectory*>::const_iterator idir=hdir.begin(); idir!=hdir.end(); idir++){
153 for(std::map<std::string,TH1*>::const_iterator
hist=
h.begin();
hist!=
h.end();
hist++){
154 if (TString(
hist->first).Contains(idir->first))
hist->second->Write();
163 return (fabs(vsim.
z*simUnit_-vrec.
z())<0.0500);
167 double ctau=(pdt->particle(
abs(p->pdg_id()) ))->lifetime();
168 if(verbose_)
std::cout <<
"isResonance " << p->pdg_id() <<
" " << ctau << std::endl;
169 return ctau >0 && ctau <1
e-6;
173 return ( !p->end_vertex() && p->status()==1 );
179 return part->charge()!=0;
182 return pdt->particle( -p->pdg_id() )!=0;
188 for(reco::VertexCollection::const_iterator
v=recVtxs->begin();
189 v!=recVtxs->end(); ++
v){
190 std::cout <<
"Recvtx "<< std::setw(3) << std::setfill(
' ')<<ivtx++
191 <<
"#trk " << std::setw(3) <<
v->tracksSize()
192 <<
" chi2 " << std::setw(4) <<
v->chi2()
193 <<
" ndof " << std::setw(3) <<
v->ndof() << std::endl
194 <<
" x " << std::setw(8) <<std::fixed << std::setprecision(4) <<
v->x()
195 <<
" dx " << std::setw(8) <<
v->xError()<< std::endl
196 <<
" y " << std::setw(8) <<
v->y()
197 <<
" dy " << std::setw(8) <<
v->yError()<< std::endl
198 <<
" z " << std::setw(8) <<
v->z()
199 <<
" dz " << std::setw(8) <<
v->zError()
207 for(SimVertexContainer::const_iterator vsim=simVtxs->begin();
208 vsim!=simVtxs->end(); ++vsim){
209 std::cout << i++ <<
")" << std::scientific
210 <<
" evtid=" << vsim->eventId().event()
211 <<
" sim x=" << vsim->position().x()*simUnit_
212 <<
" sim y=" << vsim->position().y()*simUnit_
213 <<
" sim z=" << vsim->position().z()*simUnit_
214 <<
" sim t=" << vsim->position().t()
215 <<
" parent=" << vsim->parentIndex()
222 std::cout <<
" simTrks type, (momentum), vertIndex, genpartIndex" << std::endl;
224 for(SimTrackContainer::const_iterator
t=simTrks->begin();
225 t!=simTrks->end(); ++
t){
230 << (*t).genpartIndex();
243 std::vector<PrimaryVertexAnalyzer::simPrimaryVertex> simpv;
244 const HepMC::GenEvent* evt=evtMC->GetEvent();
246 if(verbose_)
std::cout <<
"process id " <<evt->signal_process_id()<<std::endl;
247 if(verbose_)
std::cout <<
"signal process vertex "<< ( evt->signal_process_vertex() ?
248 evt->signal_process_vertex()->barcode() : 0 ) <<std::endl;
249 if(verbose_)
std::cout <<
"number of vertices " << evt->vertices_size() << std::endl;
253 for(HepMC::GenEvent::vertex_const_iterator vitr= evt->vertices_begin();
254 vitr != evt->vertices_end(); ++vitr )
256 HepMC::FourVector
pos = (*vitr)->position();
259 bool hasMotherVertex=
false;
260 if(verbose_)
std::cout <<
"mothers of vertex[" << ++idx <<
"]: " << std::endl;
261 for ( HepMC::GenVertex::particle_iterator
265 HepMC::GenVertex * mv=(*mother)->production_vertex();
267 hasMotherVertex=
true;
271 if(verbose_)(*mother)->print();
274 if(hasMotherVertex) {
continue;}
280 for(std::vector<simPrimaryVertex>::iterator v0=simpv.begin();
281 v0!=simpv.end(); v0++){
282 if( (fabs(sv.x-v0->x)<1
e-5) && (fabs(sv.y-v0->y)<1
e-5) && (fabs(sv.z-v0->z)<1
e-5)){
290 if(verbose_)
std::cout <<
"this is a new vertex " << sv.x <<
" " << sv.y <<
" " << sv.z << std::endl;
294 if(verbose_)
std::cout <<
"this is not new vertex " << sv.x <<
" " << sv.y <<
" " << sv.z << std::endl;
296 vp->genVertex.push_back((*vitr)->barcode());
298 for ( HepMC::GenVertex::particle_iterator
299 daughter = (*vitr)->particles_begin(HepMC::descendants);
300 daughter != (*vitr)->particles_end(HepMC::descendants);
302 if (isFinalstateParticle(*daughter)){
303 if (
find(vp->finalstateParticles.begin(), vp->finalstateParticles.end(),(*daughter)->barcode())
304 == vp->finalstateParticles.end()){
305 vp->finalstateParticles.push_back((*daughter)->barcode());
306 HepMC::FourVector
m=(*daughter)->momentum();
309 vp->ptot.setPx(vp->ptot.px()+m.px());
310 vp->ptot.setPy(vp->ptot.py()+m.py());
311 vp->ptot.setPz(vp->ptot.pz()+m.pz());
312 vp->ptot.setE(vp->ptot.e()+m.e());
313 vp->ptsq+=(m.perp())*(m.perp());
314 if ( (m.perp()>0.8) && (fabs(m.pseudoRapidity())<2.5) && isCharged( *daughter ) ){
318 h[
"rapidity"+
suffix]->Fill(m.pseudoRapidity());
319 h[
"pt"+
suffix]->Fill(m.perp());
338 std::vector<PrimaryVertexAnalyzer::simPrimaryVertex> simpv;
340 for(SimTrackContainer::const_iterator
t=simTrks->begin();
341 t!=simTrks->end(); ++
t){
342 if ( !(
t->noVertex()) && !(
t->type()==-99) ){
349 HepMC::GenVertex * gv=gp->production_vertex();
351 for ( HepMC::GenVertex::particle_iterator
352 daughter = gv->particles_begin(HepMC::descendants);
353 daughter != gv->particles_end(HepMC::descendants);
355 if (isFinalstateParticle(*daughter)){
356 ptsq+=(*daughter)->momentum().perp()*(*daughter)->momentum().perp();
359 primary = ( gv->position().t()==0);
362 resonance= ( isResonance(*(gp->production_vertex()->particles_in_const_begin())));
363 if (gp->status()==1){
365 track=not isCharged(gp);
370 const HepMC::FourVector &
v=(*simVtxs)[
t->vertIndex()].position();
372 if(primary
or resonance){
376 for(std::vector<simPrimaryVertex>::iterator v0=simpv.begin();
377 v0!=simpv.end(); v0++){
378 if( (fabs(v0->x-v.x())<0.001) && (fabs(v0->y-v.y())<0.001) && (fabs(v0->z-v.z())<0.001) ){
380 v0->simTrackIndex.push_back(idx);
381 if (ptsq>(*v0).ptsq){(*v0).ptsq=ptsq;}
386 if(newVertex && !resonance){
389 anotherVertex.ptsq=ptsq;
390 simpv.push_back(anotherVertex);
410 iEvent.
getByLabel(recoTrackProducer_, recTrks);
418 for (
int ivtxSample=0; ivtxSample!= (int)vtxSample_.size(); ++ivtxSample) {
419 std::string isuffix = suffixSample_[ivtxSample];
422 iEvent.
getByLabel(vtxSample_[ivtxSample], recVtxs);
427 std::cout <<
"Some problem occurred with the particle data table. This may not work !." <<std::endl;
436 std::cout <<
"no HepMCProduct found"<< std::endl;
440 std::cout <<
"generator HepMCProduct found"<< std::endl;
448 printRecVtxs(recVtxs);
455 std::vector<simPrimaryVertex> simpv;
457 simpv=getSimPVs(evtMC,isuffix);
461 h[
"nsimvtx"+isuffix]->Fill(simpv.size());
463 for(std::vector<simPrimaryVertex>::iterator vsim=simpv.begin();
464 vsim!=simpv.end(); vsim++){
468 h[
"nbsimtksinvtx"+isuffix]->Fill(vsim->nGenTrk);
469 h[
"xsim"+isuffix]->Fill(vsim->x*simUnit_);
470 h[
"ysim"+isuffix]->Fill(vsim->y*simUnit_);
471 h[
"zsim"+isuffix]->Fill(vsim->z*simUnit_);
472 nsimtrk+=vsim->nGenTrk;
475 for(reco::VertexCollection::const_iterator vrec=recVtxs->begin();
476 vrec!=recVtxs->end(); ++vrec){
477 if ( matchVertex(*vsim,*vrec) ){
479 if( ((vsim->recVtx) && (fabs(vsim->recVtx->position().z()-vsim->z)>fabs(vrec->z()-vsim->z)))
482 vsim->recVtx=&(*vrec);
486 h[
"nsimtrk"+isuffix]->Fill(
float(nsimtrk));
492 if(verbose_){
std::cout <<
"primary matched " << vsim->x <<
" " << vsim->y <<
" " << vsim->z << std:: endl;}
494 h[
"resx"+isuffix]->Fill( vsim->recVtx->x()-vsim->x*simUnit_ );
495 h[
"resy"+isuffix]->Fill( vsim->recVtx->y()-vsim->y*simUnit_ );
496 h[
"resz"+isuffix]->Fill( vsim->recVtx->z()-vsim->z*simUnit_ );
497 h[
"pullx"+isuffix]->Fill( (vsim->recVtx->x()-vsim->x*simUnit_)/vsim->recVtx->xError() );
498 h[
"pully"+isuffix]->Fill( (vsim->recVtx->y()-vsim->y*simUnit_)/vsim->recVtx->yError() );
499 h[
"pullz"+isuffix]->Fill( (vsim->recVtx->z()-vsim->z*simUnit_)/vsim->recVtx->zError() );
500 h[
"eff"+isuffix]->Fill( 1.);
502 if (vsim->recVtx==&(*recVtxs->begin())){
503 h[
"efftag"+isuffix]->Fill( 1.);
505 h[
"efftag"+isuffix]->Fill( 0.);
508 h[
"effvseta"+isuffix]->Fill(vsim->ptot.pseudoRapidity(),1.);
509 h[
"effvsptsq"+isuffix]->Fill(vsim->ptsq,1.);
510 h[
"effvsntrk"+isuffix]->Fill(vsim->nGenTrk,1.);
511 h[
"effvsnrectrk"+isuffix]->Fill(recTrks->size(),1.);
512 h[
"effvsz"+isuffix]->Fill(vsim->z*simUnit_,1.);
516 if(verbose_){
std::cout <<
"primary not found " << vsim->x <<
" " << vsim->y <<
" " << vsim->z <<
" nGenTrk=" << vsim->nGenTrk << std::endl;}
518 h[
"eff"+isuffix]->Fill( 0.);
519 if(simpv.size()==1){
h[
"efftag"+isuffix]->Fill( 0.); }
520 h[
"effvseta"+isuffix]->Fill(vsim->ptot.pseudoRapidity(),0.);
521 h[
"effvsptsq"+isuffix]->Fill(vsim->ptsq,0.);
522 h[
"effvsntrk"+isuffix]->Fill(
float(vsim->nGenTrk),0.);
523 h[
"effvsnrectrk"+isuffix]->Fill(recTrks->size(),0.);
524 h[
"effvsz"+isuffix]->Fill(vsim->z*simUnit_,0.);
531 if (recVtxs->size()>0 && simpv.size()>0){
532 Double_t dz=(*recVtxs->begin()).
z() - (*simpv.begin()).
z*simUnit_;
533 h[
"zdistancetag"+isuffix]->Fill(dz);
534 if( fabs(dz)<0.0500){
535 h[
"puritytag"+isuffix]->Fill(1.);
538 h[
"puritytag"+isuffix]->Fill(0.);
547 h[
"nrecvtx"+isuffix]->Fill(recVtxs->size());
548 h[
"nrectrk"+isuffix]->Fill(recTrks->size());
549 h[
"nbvtx"+isuffix]->Fill(recVtxs->size()*1.);
550 if((recVtxs->size()==0)||recVtxs->begin()->isFake()) {
h[
"nrectrk0vtx"+isuffix]->Fill(recTrks->size());}
552 for(reco::VertexCollection::const_iterator
v=recVtxs->begin();
553 v!=recVtxs->end(); ++
v){
555 if(
v->isFake())
continue;
559 t!=
v->tracks_end();
t++) {
561 if ( (**t).charge() < -1 || (**t).charge() > 1 ) {
562 h[
"tklinks"+isuffix]->Fill(0.);
565 h[
"tklinks"+isuffix]->Fill(1.);
571 h[
"tklinks"+isuffix]->Fill(0.);
574 h[
"nbtksinvtx"+isuffix]->Fill(
v->tracksSize());
575 h[
"vtxchi2"+isuffix]->Fill(
v->chi2());
576 h[
"vtxndf"+isuffix]->Fill(
v->ndof());
578 h[
"xrec"+isuffix]->Fill(
v->position().x());
579 h[
"yrec"+isuffix]->Fill(
v->position().y());
580 h[
"zrec"+isuffix]->Fill(
v->position().z());
581 if (
v==recVtxs->begin()){
582 h[
"xrectag"+isuffix]->Fill(
v->position().x());
583 h[
"yrectag"+isuffix]->Fill(
v->position().y());
584 h[
"zrectag"+isuffix]->Fill(
v->position().z());
587 bool problem =
false;
588 h[
"nans"+isuffix]->Fill(1.,
isnan(
v->position().x())*1.);
589 h[
"nans"+isuffix]->Fill(2.,
isnan(
v->position().y())*1.);
590 h[
"nans"+isuffix]->Fill(3.,
isnan(
v->position().z())*1.);
593 for (
int i = 0;
i != 3;
i++) {
594 for (
int j =
i;
j != 3;
j++) {
596 h[
"nans"+isuffix]->Fill(index*1.,
isnan(
v->covariance(
i,
j))*1.);
597 if (
isnan(
v->covariance(
i,
j))) problem =
true;
599 if (
j ==
i &&
v->covariance(
i,
j) < 0) {
600 h[
"nans"+isuffix]->Fill(index*1., 1.);
612 t!=
v->tracks_end();
t++) {
613 std::cout <<
"Track " << itk++ << std::endl;
615 for (
int i = 0;
i != 5;
i++) {
616 for (
int j = 0;
j != 5;
j++) {
617 data[i2] = (**t).covariance(
i,
j);
618 std::cout << std:: scientific << data[i2] <<
" ";
624 = gsl_matrix_view_array (data, 5, 5);
626 gsl_vector *eval = gsl_vector_alloc (5);
627 gsl_matrix *evec = gsl_matrix_alloc (5, 5);
629 gsl_eigen_symmv_workspace * w =
630 gsl_eigen_symmv_alloc (5);
632 gsl_eigen_symmv (&m.matrix, eval, evec, w);
634 gsl_eigen_symmv_free (w);
636 gsl_eigen_symmv_sort (eval, evec,
637 GSL_EIGEN_SORT_ABS_ASC);
642 for (i = 0; i < 5; i++) {
644 = gsl_vector_get (eval, i);
645 gsl_vector_view evec_i
646 = gsl_matrix_column (evec, i);
648 printf (
"eigenvalue = %g\n", eval_i);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< simPrimaryVertex > getSimPVs(const edm::Handle< edm::HepMCProduct > evtMC, std::string suffix)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool isCharged(const HepMC::GenParticle *p)
bool isFinalstateParticle(const HepMC::GenParticle *p)
void printSimTrks(const edm::Handle< edm::SimTrackContainer > simVtrks)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void getData(T &iHolder) const
std::vector< int > simTrackIndex
const std::pair< int, int > resonance[nResonances]
virtual void analyze(const edm::Event &, const edm::EventSetup &)
double z() const
y coordinate
float ChiSquaredProbability(double chiSquared, double nrDOF)
HepPDT::ParticleData ParticleData
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::string getReleaseVersion()
bool isResonance(const HepMC::GenParticle *p)
void printRecVtxs(const edm::Handle< reco::VertexCollection > recVtxs)
PrimaryVertexAnalyzer(const edm::ParameterSet &)
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
bool matchVertex(const simPrimaryVertex &vsim, const reco::Vertex &vrec)
void printSimVtxs(const edm::Handle< edm::SimVertexContainer > simVtxs)