4 #include <Math/Functions.h>
5 #include <Math/SVector.h>
6 #include <Math/SMatrix.h>
25 #include "Math/VectorUtil.h"
27 #include <Math/GenVector/PxPyPzE4D.h>
28 #include <Math/GenVector/PxPyPzM4D.h>
47 virtual void endJob() ;
78 void bookRecoToSim(std::string
const &);
79 void bookSimToReco(std::string
const &);
129 "Frequency for the different track categories",
130 numberVertexClassifier_,
132 numberVertexClassifier_ - 0.5
137 HistIndex_[
"rs_All_FlightDistance2d"]=
dqmStore_->
book1D(
"rs_All_FlightDistance2d",
"Transverse flight distance [cm]", 100, 0, 5 );
138 HistIndex_[
"rs_SecondaryVertex_FlightDistance2d"]=
dqmStore_->
book1D(
"rs_SecondaryVertex_FlightDistance2d",
"Transverse flight distance [cm]", 100, 0, 5 );
139 HistIndex_[
"rs_BSV_FlightDistance2d"]=
dqmStore_->
book1D(
"rs_BSV_FlightDistance2d",
"Transverse flight distance [cm]", 100, 0, 5 );
140 HistIndex_[
"rs_BWeakDecay_FlightDistance2d"]=
dqmStore_->
book1D(
"rs_BWeakDecay_FlightDistance2d",
"Transverse flight distance [cm]", 100, 0, 5 );
141 HistIndex_[
"rs_CWeakDecay_FlightDistance2d"]=
dqmStore_->
book1D(
"rs_CWeakDecay_FlightDistance2d",
"Transverse flight distance [cm]", 100, 0, 5 );
142 HistIndex_[
"rs_Light_FlightDistance2d"]=
dqmStore_->
book1D(
"rs_Light_FlightDistance2d",
"Transverse flight distance [cm]", 100, 0, 5 );
145 HistIndex_[
"rs_SecondaryVertex_nRecVtx"]=
dqmStore_->
book1D(
"rs_SecondaryVertex_nRecVtx",
"Number of Vertices per event", 11, -0.5, 10.5 );
147 HistIndex_[
"rs_BWeakDecay_nRecVtx"]=
dqmStore_->
book1D(
"rs_BWeakDecay_nRecVtx",
"Number of Vertices per event", 11, -0.5, 10.5 );
148 HistIndex_[
"rs_CWeakDecay_nRecVtx"]=
dqmStore_->
book1D(
"rs_CWeakDecay_nRecVtx",
"Number of Vertices per event", 11, -0.5, 10.5 );
155 HistIndex_[
"sr_SecondaryVertex_nRecVtx"]=
dqmStore_->
book1D(
"sr_SecondaryVertex_nRecVtx",
"Number of Vertices per event", 11, -0.5, 10.5 );
157 HistIndex_[
"sr_BWeakDecay_nRecVtx"]=
dqmStore_->
book1D(
"sr_BWeakDecay_nRecVtx",
"Number of Vertices per event", 11, -0.5, 10.5 );
158 HistIndex_[
"sr_CWeakDecay_nRecVtx"]=
dqmStore_->
book1D(
"sr_CWeakDecay_nRecVtx",
"Number of Vertices per event", 11, -0.5, 10.5 );
187 std::cout <<
"*** Analyzing " <<
event.id() <<
" n_event = " <<
n_event << std::endl << std::endl;
200 cout <<
"* Event " <<
n_event <<
" ; svTagInfoCollection->size() = " << svTagInfoCollection->size() << endl;
219 for (std::size_t
index = 0;
index < svTagInfoCollection->size(); ++
index){
224 for ( std::size_t vindex = 0; vindex < svTagInfo->nVertices(); ++vindex ){
231 double rs_quality = tracer.
quality();
243 HistIndex_[
"rs_All_MatchQuality"]->Fill( rs_quality );
245 HistIndex_[
"rs_All_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex,
true ).value() );
251 HistIndex_[
"rs_SecondaryVertex_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex,
true ).value() );
258 HistIndex_[
"rs_BWeakDecay_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex,
true ).value() );
264 HistIndex_[
"rs_BSV_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex,
true ).value() );
273 HistIndex_[
"rs_CWeakDecay_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex,
true ).value() );
280 HistIndex_[
"rs_Light_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex,
true ).value() );
286 cout <<
" VertexCategories::Fake!!" << endl;
295 HistIndex_[
"rs_All_nRecVtx"]->Fill( rs_nall );
296 HistIndex_[
"rs_SecondaryVertex_nRecVtx"]->Fill( rs_nsv );
297 HistIndex_[
"rs_BWeakDecay_nRecVtx"]->Fill( rs_nbv );
298 HistIndex_[
"rs_BSV_nRecVtx"]->Fill( rs_nbsv );
299 HistIndex_[
"rs_CWeakDecay_nRecVtx"]->Fill( rs_ncv );
300 HistIndex_[
"rs_Light_nRecVtx"]->Fill( rs_nlv );
317 double sr_quality = tracer.
quality();
321 HistIndex_[
"sr_All_MatchQuality"]->Fill( sr_quality );
364 HistIndex_[
"sr_All_nRecVtx"]->Fill( sr_nall );
365 HistIndex_[
"sr_SecondaryVertex_nRecVtx"]->Fill( sr_nsv );
366 HistIndex_[
"sr_BWeakDecay_nRecVtx"]->Fill( sr_nbv );
367 HistIndex_[
"sr_BSV_nRecVtx"]->Fill( sr_nbsv );
368 HistIndex_[
"sr_CWeakDecay_nRecVtx"]->Fill( sr_ncv );
369 HistIndex_[
"sr_Light_nRecVtx"]->Fill( rs_nlv );
394 std::string
name = prefix +
"_Pullx";
396 name = prefix +
"_Pully";
398 name = prefix +
"_Pullz";
401 name = prefix +
"_Resx";
403 name = prefix +
"_Resy";
405 name = prefix +
"_Resz";
408 name = prefix +
"_Chi2Norm";
410 name = prefix +
"_Chi2Prob";
413 name = prefix +
"_nRecTrks";
416 name = prefix +
"_AverageTrackWeight";
419 name = prefix +
"_Mass";
422 name = prefix +
"_RecPt";
425 name = prefix +
"_RecEta";
428 name = prefix +
"_RecCharge";
431 name = prefix +
"_RecTrackPt";
434 name = prefix +
"_RecTrackEta";
437 name = prefix +
"_nSimTrks";
440 name = prefix +
"_SimPt";
443 name = prefix +
"_SimEta";
446 name = prefix +
"_SimCharge";
449 name = prefix +
"_SimTrackPt";
452 name = prefix +
"_SimTrackEta";
462 std::string
name = prefix +
"_Pullx";
464 name = prefix +
"_Pully";
466 name = prefix +
"_Pullz";
469 name = prefix +
"_Resx";
471 name = prefix +
"_Resy";
473 name = prefix +
"_Resz";
476 name = prefix +
"_Chi2Norm";
478 name = prefix +
"_Chi2Prob";
481 name = prefix +
"_nRecTrks";
484 name = prefix +
"_AverageTrackWeight";
487 name = prefix +
"_Mass";
490 name = prefix +
"_RecPt";
493 name = prefix +
"_RecEta";
496 name = prefix +
"_RecCharge";
499 name = prefix +
"_RecTrackPt";
502 name = prefix +
"_RecTrackEta";
505 name = prefix +
"_nSimTrks";
508 name = prefix +
"_SimPt";
511 name = prefix +
"_SimEta";
514 name = prefix +
"_SimCharge";
517 name = prefix +
"_SimTrackPt";
520 name = prefix +
"_SimTrackEta";
530 double pullx = (vertex.
x() - simVertex->position().x())/vertex.
xError();
531 double pully = (vertex.
y() - simVertex->position().y())/vertex.
yError();
532 double pullz = (vertex.
z() - simVertex->position().z())/vertex.
zError();
534 double resx = vertex.
x() - simVertex->position().x();
535 double resy = vertex.
y() - simVertex->position().y();
536 double resz = vertex.
z() - simVertex->position().z();
541 double sum_weight = 0.;
547 double thePiMass = 0.13957;
550 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > vec;
552 vec.SetPx( (**recDaughter).px() );
553 vec.SetPy( (**recDaughter).py() );
554 vec.SetPz( (**recDaughter).pz() );
563 p = (**recDaughter).momentum();
566 charge += (*recDaughter)->charge();
568 HistIndex_[prefix +
"_RecTrackPt"]->Fill( (*recDaughter)->pt() );
569 HistIndex_[prefix +
"_RecTrackEta"]->Fill( (*recDaughter)->eta() );
573 double mass = sum.M();
574 double pt =
sqrt( momentum.Perp2() );
575 double eta = momentum.Eta();
579 for (
TrackingVertex::tp_iterator simDaughter = simVertex->daughterTracks_begin(); simDaughter != simVertex->daughterTracks_end(); ++simDaughter ){
582 p = (**simDaughter).momentum();
585 simcharge += (*simDaughter)->charge();
587 HistIndex_[prefix +
"_SimTrackPt"]->Fill( (*simDaughter)->pt() );
588 HistIndex_[prefix +
"_SimTrackEta"]->Fill( (*simDaughter)->eta() );
591 double simpt =
sqrt( simmomentum.Perp2() );
592 double simeta = simmomentum.Eta();
597 HistIndex_[prefix +
"_nSimTrks"]->Fill( simVertex->nDaughterTracks() );
604 HistIndex_[prefix +
"_AverageTrackWeight"]->Fill( sum_weight/tracksize );
605 HistIndex_[prefix +
"_Chi2Norm"]->Fill(chi2norm);
606 HistIndex_[prefix +
"_Chi2Prob"]->Fill(chi2prob);
609 HistIndex_[prefix +
"_RecCharge"]->Fill(charge);
613 HistIndex_[prefix +
"_SimCharge"]->Fill(simcharge);
620 double pullx = (vertex->
x() - simVertex->position().x())/vertex->
xError();
621 double pully = (vertex->
y() - simVertex->position().y())/vertex->
yError();
622 double pullz = (vertex->
z() - simVertex->position().z())/vertex->
zError();
624 double resx = vertex->
x() - simVertex->position().x();
625 double resy = vertex->
y() - simVertex->position().y();
626 double resz = vertex->
z() - simVertex->position().z();
631 double sum_weight = 0.;
637 double thePiMass = 0.13957;
640 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > vec;
642 vec.SetPx( (**recDaughter).px() );
643 vec.SetPy( (**recDaughter).py() );
644 vec.SetPz( (**recDaughter).pz() );
653 p = (**recDaughter).momentum();
656 charge += (*recDaughter)->charge();
658 HistIndex_[prefix +
"_RecTrackPt"]->Fill( (*recDaughter)->pt() );
659 HistIndex_[prefix +
"_RecTrackEta"]->Fill( (*recDaughter)->eta() );
664 double mass = sum.M();
665 double pt =
sqrt( momentum.Perp2() );
666 double eta = momentum.Eta();
670 for (
TrackingVertex::tp_iterator simDaughter = simVertex->daughterTracks_begin(); simDaughter != simVertex->daughterTracks_end(); ++simDaughter ){
673 p = (**simDaughter).momentum();
676 simcharge += (*simDaughter)->charge();
678 HistIndex_[prefix +
"_SimTrackPt"]->Fill( (*simDaughter)->pt() );
679 HistIndex_[prefix +
"_SimTrackEta"]->Fill( (*simDaughter)->eta() );
682 double simpt =
sqrt( simmomentum.Perp2() );
683 double simeta = simmomentum.Eta();
688 HistIndex_[prefix +
"_nSimTrks"]->Fill( simVertex->nDaughterTracks() );
695 HistIndex_[prefix +
"_AverageTrackWeight"]->Fill( sum_weight/tracksize );
696 HistIndex_[prefix +
"_Chi2Norm"]->Fill(chi2norm);
697 HistIndex_[prefix +
"_Chi2Prob"]->Fill(chi2prob);
700 HistIndex_[prefix +
"_RecCharge"]->Fill(charge);
704 HistIndex_[prefix +
"_SimCharge"]->Fill(simcharge);
713 std::cout <<
" ====== Total Number of analyzed events: " <<
n_event <<
" ====== " << std::endl;
715 std::cout <<
" ====== Total Number of R2S SecondaryVertex: " <<
rs_total_nsv <<
" ====== " << std::endl;
717 std::cout <<
" ====== Total Number of R2S BWeakDecay::SecondaryVertex: " <<
rs_total_nbsv <<
" ====== " << std::endl;
722 std::cout <<
" ====== Total Number of S2R SecondaryVertex: " <<
sr_total_nsv <<
" ====== " << std::endl;
724 std::cout <<
" ====== Total Number of S2R BWeakDecay::SecondaryVertex: " <<
sr_total_nbsv <<
" ====== " << std::endl;
728 std::cout <<
" ====== Total Number of Fake Vertices: " <<
total_nfake <<
" ====== " << std::endl;
This class traces the simulated and generated history of a given track.
T getUntrackedParameter(std::string const &, T const &) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
VertexHistory const & history() const
Returns a reference to the vertex history used in the classification.
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
trackRef_iterator tracks_end() const
last iterator over tracks
double zError() const
error on z
#define DEFINE_FWK_MODULE(type)
double y() const
y coordinate
void bookSimToReco(std::string const &)
const reco::VertexBaseRef & recoVertex() const
Return a reference to the reconstructed track.
void fillSimToReco(std::string const &, reco::VertexBaseRef const &, TrackingVertexRef const &)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Category
Categories available to vertexes.
recoBSVTagInfoValidationAnalyzer(const edm::ParameterSet &)
VertexClassifierByProxy< reco::SecondaryVertexTagInfoCollection > classifier_
edm::InputTag svTagInfoProducer_
double chi2() const
chi-squares
double z() const
y coordinate
std::map< std::string, MonitorElement * > HistIndex_
float ChiSquaredProbability(double chiSquared, double nrDOF)
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
bool is(Category category) const
Returns track flag for a given category.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::InputTag trackingTruth_
void bookRecoToSim(std::string const &)
const TrackingVertexRef & simVertex() const
Return the initial tracking vertex from the history.
double x() const
x coordinate
double xError() const
error on x
XYZVectorD XYZVector
spatial vector with cartesian internal representation
VertexClassifierByProxy< Collection > const & evaluate(TrackingVertexRef const &vertex)
Classify the TrackingVertex in categories.
Int_t numberVertexClassifier_
virtual void newEvent(edm::Event const &event, edm::EventSetup const &config)
Pre-process event information (for accessing reconstraction information).
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
double normalizedChi2() const
chi-squared divided by n.d.o.f.
static const char * Names[]
Name of the different categories.
double quality() const
Return the quality of the match.
trackRef_iterator tracks_begin() const
first iterator over tracks
void fillRecoToSim(std::string const &, reco::Vertex const &, TrackingVertexRef const &)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
double yError() const
error on y
void setCurrentFolder(const std::string &fullpath)
size_t tracksSize() const
number of tracks