41 doublemuonExpr_ = dimuonparms.getParameter<std::vector<std::string> >(
"hltPaths");
51 cout <<
"[MuonRecoOneHLT] beginJob " << endl;
60 muReco = dbe->
book1D(
"Muon_Reco",
"Muon Reconstructed Tracks", 6, 1, 7);
61 muReco->setBinLabel(1,
"glb+tk+sta");
62 muReco->setBinLabel(2,
"glb+sta");
63 muReco->setBinLabel(3,
"tk+sta");
64 muReco->setBinLabel(4,
"tk");
65 muReco->setBinLabel(5,
"sta");
66 muReco->setBinLabel(6,
"calo");
128 cout <<
"[MuonRecoOneHLT] beginRun " << endl;
129 cout <<
"[MuonRecoOneHLT] Is MuonEventFlag On? "<< _SignleMuonEventFlag->on() << endl;
143 cout <<
"[MuonRecoOneHLT] analyze "<< endl;
153 unsigned int theIndexOfThePrimaryVertex = 999.;
159 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
160 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
161 theIndexOfThePrimaryVertex = ind;
166 if (theIndexOfThePrimaryVertex<100) {
167 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
168 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
170 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
180 errVtx(2,2) = bs.
sigmaZ();
194 std::map<float,reco::Muon> muonMap;
195 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
196 muonMap[recoMu->pt()] = *recoMu;
198 std::vector<reco::Muon> LeadingMuon;
199 for( std::map<float,reco::Muon>::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){
200 LeadingMuon.push_back( (*rit).second );
205 iEvent.
getByLabel(
"offlineBeamSpot", beamSpotHandle);
206 beamSpot = *beamSpotHandle;
209 const unsigned int nTrig(triggerNames.
size());
210 bool _trig_SingleMu =
false;
211 bool _trig_DoubleMu =
false;
212 for (
unsigned int i=0;
i<nTrig;++
i){
214 _trig_SingleMu =
true;
216 _trig_DoubleMu =
true;
219 cout <<
"[MuonRecoOneHLT] Trigger Fired ? "<< _trig_SingleMu << endl;
222 if (!_trig_SingleMu && !_trig_DoubleMu)
return;
223 if (LeadingMuon.size() == 0)
return;
227 if(LeadingMuon[0].isGlobalMuon()) {
228 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is global - filling the histos";
229 if(LeadingMuon[0].isTrackerMuon() && LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(1);
230 if(!(LeadingMuon[0].isTrackerMuon()) && LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(2);
231 if(!LeadingMuon[0].isStandAloneMuon())
232 LogTrace(
metname)<<
"[MuonRecoOneHLT] ERROR: the mu is global but not standalone!";
235 reco::TrackRef recoCombinedGlbTrack = LeadingMuon[0].combinedMuon();
253 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
260 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is tracker only - filling the histos";
262 reco::TrackRef recoCombinedGlbTrack = LeadingMuon[0].combinedMuon();
271 if(LeadingMuon[0].isTrackerMuon() && !(LeadingMuon[0].isGlobalMuon())) {
272 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is tracker only - filling the histos";
273 if(LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(3);
274 if(!(LeadingMuon[0].isStandAloneMuon()))
muReco->
Fill(4);
286 if(LeadingMuon[0].isStandAloneMuon() && !(LeadingMuon[0].isGlobalMuon())) {
287 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is STA only - filling the histos";
288 if(!(LeadingMuon[0].isTrackerMuon()))
muReco->
Fill(5);
299 if(LeadingMuon[0].isCaloMuon() && !(LeadingMuon[0].isGlobalMuon()) && !(LeadingMuon[0].isTrackerMuon()) && !(LeadingMuon[0].isStandAloneMuon()))
T getParameter(std::string const &) const
edm::ParameterSet parameters
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
MonitorElement * phiTight
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
GenericTriggerEventFlag * _DoubleMuonEventFlag
MonitorElement * chi2OvDFTrack
bool accept() const
Has at least one path accepted the event?
math::Error< dimension >::type Error
covariance error matrix (3x3)
GenericTriggerEventFlag * _SingleMuonEventFlag
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Strings::size_type size() const
MonitorElement * etaTight
MonitorElement * etaStaTrack
static int position[TOTALCHAMBERS][3]
std::vector< std::string > doublemuonExpr_
std::vector< std::string > expressionsFromDB(const std::string &key, const edm::EventSetup &setup)
Reads and returns logical expressions from DB.
MonitorElement * chi2OvDFStaTrack
edm::InputTag theMuonCollectionLabel
math::XYZPoint Point
point in the space
double BeamWidthX() const
beam width X
std::vector< MonitorElement * > phiGlbTrack
MonitorElement * ptStaTrack
std::vector< std::string > singlemuonExpr_
std::vector< MonitorElement * > ptGlbTrack
MonitorElement * etaTrack
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual ~MuonRecoOneHLT()
Destructor.
std::vector< MonitorElement * > etaGlbTrack
MonitorElement * phiTrack
std::string const & triggerName(unsigned int index) const
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
MonitorElement * phiStaTrack
const Point & position() const
position
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
void analyze(const edm::Event &, const edm::EventSetup &, const edm::TriggerResults &)
Get the analysis.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup)
MuonRecoOneHLT(const edm::ParameterSet &, MuonServiceProxy *theService)
Constructor.
void setCurrentFolder(const std::string &fullpath)
MonitorElement * chi2OvDFTight
std::vector< MonitorElement * > chi2OvDFGlbTrack