Skip to content

Commit

Permalink
add a safety volume, and make the fall back warning/error verbose
Browse files Browse the repository at this point in the history
---
yaml
---
svn_rev: 87957
current_ref: refs/heads/l1t-devel-CMSSW_7_4_0_pre5
current_commit: 31f65a1
head_branch: refs/heads/l1t-devel-CMSSW_7_4_0_pre5
migrated_from: v3
  • Loading branch information
vlimant committed Apr 30, 2010
1 parent 64297a7 commit 3316072
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/l1t-devel-CMSSW_7_4_0_pre5: e5b49e9c99527b3f3b949564a37fca748f083511
refs/heads/l1t-devel-CMSSW_7_4_0_pre5: 31f65a1ad0909c73d0ad096a8dde8f04489c923e
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
author: Francisco Yumiceva, Fermilab ([email protected])
version $Id: BeamSpotOnlineProducer.h,v 1.2 2010/03/02 17:29:47 yumiceva Exp $
version $Id: BeamSpotOnlineProducer.h,v 1.3 2010/04/15 19:40:27 yumiceva Exp $
________________________________________________________________**/

Expand Down Expand Up @@ -38,6 +38,7 @@ class BeamSpotOnlineProducer: public edm::EDProducer {

InputTag scalertag_;
bool changeFrame_;
double theMaxZ,theMaxR2;
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ BeamSpotOnlineProducer::BeamSpotOnlineProducer(const ParameterSet& iconf)
scalertag_ = iconf.getParameter<InputTag>("label");
changeFrame_ = iconf.getParameter<bool>("changeToCMSCoordinates");

theMaxR2 = iconf.getParameter<double>("maxRadius");
theMaxR2*=theMaxR2;
theMaxZ = iconf.getParameter<double>("maxZ");

produces<reco::BeamSpot>();

}
Expand Down Expand Up @@ -72,15 +76,28 @@ BeamSpotOnlineProducer::produce(Event& iEvent, const EventSetup& iSetup)
aSpot.setType( reco::BeamSpot::LHC ); // flag value from scalars

// check if we have a valid beam spot fit result from online DQM

bool fallBackToDB=false;

if ( spotOnline.x() == 0 &&
spotOnline.y() == 0 &&
spotOnline.z() == 0 &&
spotOnline.width_x() == 0 &&
spotOnline.width_y() == 0 ) {

//edm::LogInfo("RecoVertex/BeamSpotProducer")
//<< "Online Beam Spot producer fall back to DB value " << "\n";
spotOnline.width_y() == 0 )
{
edm::LogWarning("BeamSpotFromDB")
<< "Online Beam Spot producer falls back to DB value because the scaler values are zero ";
fallBackToDB=true;
}
double r2=spotOnline.x()*spotOnline.x() + spotOnline.y()*spotOnline.y();
if (fabs(spotOnline.z())>=theMaxZ || r2>=theMaxR2){
edm::LogError("BeamSpotFromDB")
<< "Online Beam Spot producer falls back to DB value because the scaler values are too big to be true :"
<<spotOnline.x()<<" "<<spotOnline.y()<<" "<<spotOnline.z();
fallBackToDB=true;
}

if (fallBackToDB){

edm::ESHandle< BeamSpotObjects > beamhandle;
iSetup.get<BeamSpotObjectsRcd>().get(beamhandle);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import FWCore.ParameterSet.Config as cms

onlineBeamSpotProducer = cms.EDProducer('BeamSpotOnlineProducer',
label = cms.InputTag('scalersRawToDigi'),
changeToCMSCoordinates = cms.bool(False)
label = cms.InputTag('scalersRawToDigi'),
changeToCMSCoordinates = cms.bool(False),
maxZ = cms.double(40),
maxRadius = cms.double(2)
)

0 comments on commit 3316072

Please sign in to comment.