Skip to content

Commit

Permalink
added code format and checks
Browse files Browse the repository at this point in the history
  • Loading branch information
abaty committed Oct 6, 2020
1 parent a0881f5 commit 9f7ab42
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PrimaryVertexProducer::PrimaryVertexProducer(const edm::ParameterSet& conf) : th

//check if this is a recovery iteration
isRecoveryIteration = conf.getParameter<bool>("isRecoveryIteration");
if(isRecoveryIteration){
if (isRecoveryIteration) {
recoveryVtxToken = consumes<reco::VertexCollection>(conf.getParameter<edm::InputTag>("recoveryVtxCollection"));
}

Expand Down Expand Up @@ -156,20 +156,20 @@ void PrimaryVertexProducer::produce(edm::Event& iEvent, const edm::EventSetup& i
}

//if this is a recovery iteration, check if we already have a valid PV
if(isRecoveryIteration){
if (isRecoveryIteration) {
edm::Handle<reco::VertexCollection> oldPVs;
iEvent.getByToken(recoveryVtxToken, oldPVs);
const reco::VertexCollection* oldVertices;
oldVertices = oldPVs.product();
//look for the first valid (not-BeamSpot) vertex
for(size_t i = 0; i < oldVertices->size(); ++i){
if(!((*oldVertices)[i].isFake())){
for (size_t i = 0; i < oldVertices->size(); ++i) {
if (!((*oldVertices)[i].isFake())) {
//found a valid vertex, write the first one to the collection and return
//otherwise continue with regular vertexing procedure
auto result = std::make_unique<reco::VertexCollection>();
reco::VertexCollection & vColl = (*result);
reco::VertexCollection& vColl = (*result);
vColl.push_back((*oldVertices)[i]);
iEvent.put(std::move(result), algorithms.begin()->label);
iEvent.put(std::move(result), algorithms.begin()->label);
return;
}
}
Expand Down Expand Up @@ -440,8 +440,8 @@ void PrimaryVertexProducer::fillDescriptions(edm::ConfigurationDescriptions& des
psd0.add<std::string>("algorithm", "DA_vect");
desc.add<edm::ParameterSetDescription>("TkClusParameters", psd0);
}
desc.add<bool>("isRecoveryIteration",false);
desc.add<edm::InputTag>("recoveryVtxCollection",edm::InputTag("offlinePrimaryVertices"));
desc.add<bool>("isRecoveryIteration", false);
desc.add<edm::InputTag>("recoveryVtxCollection", edm::InputTag("offlinePrimaryVertices"));

descriptions.add("primaryVertexProducer", desc);
}
Expand Down

0 comments on commit 9f7ab42

Please sign in to comment.