30 if(trackSelectionAlgorithm==
"filter"){
32 }
else if (trackSelectionAlgorithm==
"filterWithThreshold"){
35 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown track selection algorithm: " + trackSelectionAlgorithm);
41 if (clusteringAlgorithm==
"gap"){
43 }
else if(clusteringAlgorithm==
"DA"){
47 #ifdef __GXX_EXPERIMENTAL_CXX0X__
48 else if(clusteringAlgorithm ==
"DA_vect") {
55 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown clustering algorithm: " + clusteringAlgorithm);
60 if (conf.
exists(
"vertexCollections")){
61 std::vector<edm::ParameterSet> vertexCollections =conf.
getParameter< std::vector<edm::ParameterSet> >(
"vertexCollections");
63 for( std::vector< edm::ParameterSet >::const_iterator algoconf = vertexCollections.begin(); algoconf != vertexCollections.end(); algoconf++){
67 if (fitterAlgorithm==
"KalmanVertexFitter") {
69 }
else if( fitterAlgorithm==
"AdaptiveVertexFitter") {
72 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
75 algorithm.
minNdof = algoconf->getParameter<
double>(
"minNdof");
80 produces<reco::VertexCollection>(algorithm.
label);
83 edm::LogWarning(
"MisConfiguration")<<
"this module's configuration has changed, please update to have a vertexCollections=cms.VPSet parameter.";
87 if (fitterAlgorithm==
"KalmanVertexFitter") {
89 }
else if( fitterAlgorithm==
"AdaptiveVertexFitter") {
92 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
101 produces<reco::VertexCollection>(algorithm.
label);
126 if (recoBeamSpotHandle.
isValid()){
127 beamSpot = *recoBeamSpotHandle;
129 edm::LogError(
"UnusableBeamSpot") <<
"No beam spot available from EventSetup";
134 if ( (beamVertexState.
error().
cxx() <= 0.) ||
135 (beamVertexState.
error().
cyy() <= 0.) ||
136 (beamVertexState.
error().
czz() <= 0.) ) {
151 std::vector<reco::TransientTrack> t_tks = (*theB).build(tks, beamSpot);
153 <<
"Found: " << t_tks.size() <<
" reconstructed tracks" <<
"\n";
163 if (
fVerbose){
std::cout <<
" clustering returned "<< clusters.size() <<
" clusters from " << seltks.size() <<
" selected tracks" <<std::endl;}
174 std::vector<TransientVertex> pvs;
175 for (std::vector< std::vector<reco::TransientTrack> >::const_iterator iclus
176 = clusters.begin(); iclus != clusters.end(); iclus++) {
180 if(
algorithm->useBeamConstraint && validBS &&((*iclus).size()>1) ){
182 v =
algorithm->fitter->vertex(*iclus, beamSpot);
184 }
else if( !(
algorithm->useBeamConstraint) && ((*iclus).size()>1) ) {
193 else std::cout <<
"Invalid fitted vertex\n";
198 && (!validBS || (*(
algorithm->vertexSelector))(
v,beamVertexState))
203 std::cout <<
"PrimaryVertexProducerAlgorithm::vertices candidates =" << pvs.size() << std::endl;
218 for (std::vector<TransientVertex>::const_iterator iv = pvs.begin();
219 iv != pvs.end(); iv++) {
226 if ( (bse.cxx() <= 0.) ||
228 (bse.czz() <= 0.) ) {
230 we(0,0)=10000; we(1,1)=10000; we(2,2)=10000;
233 std::cout <<
"RecoVertex/PrimaryVertexProducer: "
234 <<
"Beamspot with invalid errors "<<bse.matrix()<<std::endl;
235 std::cout <<
"Will put Vertex derived from dummy-fake BeamSpot into Event.\n";
241 std::cout <<
"RecoVertex/PrimaryVertexProducer: "
242 <<
" will put Vertex derived from BeamSpot into Event.\n";
249 for(reco::VertexCollection::const_iterator
v=vColl.begin();
250 v!=vColl.end(); ++
v){
252 <<
"#trk " << std::setw(3) <<
v->tracksSize()
253 <<
" chi2 " << std::setw(4) <<
v->chi2()
254 <<
" ndof " << std::setw(3) <<
v->ndof()
255 <<
" x " << std::setw(6) <<
v->position().x()
256 <<
" dx " << std::setw(6) <<
v->xError()
257 <<
" y " << std::setw(6) <<
v->position().y()
258 <<
" dy " << std::setw(6) <<
v->yError()
259 <<
" z " << std::setw(6) <<
v->position().z()
260 <<
" dz " << std::setw(6) <<
v->zError()
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
< trclass="colgroup">< tdclass="colgroup"colspan=5 > Ecal cluster collections</td ></tr >< tr >< td >< ahref="classreco_1_1BasicCluster.html"> reco::BasicCluster</a ></td >< td >< ahref="DataFormats_EgammaReco.html"> reco::BasicClusterCollection</a ></td >< td >< ahref="#"> hybridSuperClusters</a ></td >< tdclass="description"> Basic clusters reconstructed with hybrid algorithm(barrel only)</td >< td >S.Rahatlou</td ></tr >< tr >< td >< a href
edm::EDGetTokenT< reco::BeamSpot > bsToken
VertexFitter< 5 > * fitter
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::TrackCollection > trkToken
const AlgebraicSymMatrix33 & matrix() const
TrackClusterizerInZ * theTrackClusterizer
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< Vertex > VertexCollection
collection of Vertex objects
virtual std::vector< std::vector< reco::TransientTrack > > clusterize(const std::vector< reco::TransientTrack > &tracks) const =0
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
float degreesOfFreedom() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
VertexCompatibleWithBeam * vertexSelector
GlobalPoint position() const
TrackFilterForPVFindingBase * theTrackFilter
virtual std::vector< reco::TransientTrack > select(const std::vector< reco::TransientTrack > &tracks) const =0
virtual void produce(edm::Event &, const edm::EventSetup &)
std::vector< algo > algorithms
PrimaryVertexProducer(const edm::ParameterSet &)
GlobalError error() const
const Point & position() const
position
Covariance3DMatrix rotatedCovariance3D() const