106 LogTrace(
metname)<<
"[DiMuonHistograms] Analyze the mu in different eta regions";
114 unsigned int theIndexOfThePrimaryVertex = 999.;
119 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
120 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
121 theIndexOfThePrimaryVertex = ind;
127 if (theIndexOfThePrimaryVertex<100) {
128 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
129 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
132 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
141 errVtx(2,2) = bs.
sigmaZ();
149 TLorentzVector Mu1, Mu2;
151 float InvMass = -99.;
163 if (muon1==muon2)
continue;
166 if (muon1->isGlobalMuon() && muon2->isGlobalMuon()) {
170 Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(), recoCombinedGlbTrack1->py(),recoCombinedGlbTrack1->pz(), recoCombinedGlbTrack1->p());
171 Mu2.SetPxPyPzE(recoCombinedGlbTrack2->px(), recoCombinedGlbTrack2->py(),recoCombinedGlbTrack2->pz(), recoCombinedGlbTrack2->p());
173 charge = recoCombinedGlbTrack1->charge()*recoCombinedGlbTrack2->charge();
175 InvMass = (Mu1+Mu2).M();
176 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
177 if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
178 fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
190 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
191 if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
192 fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
193 if (InvMass > 55. && InvMass < 125.) {
207 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
208 if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
209 fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
210 if (InvMass > 55. && InvMass < 125.) {
224 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
225 if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
226 fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
227 if (InvMass > 55. && InvMass < 125.) {
238 if (muon2->isStandAloneMuon() && muon1->isTrackerMuon()) {
242 Mu2.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
243 Mu1.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
245 charge = recoStaTrack->charge()*recoTrack->charge();
247 InvMass = (Mu1+Mu2).M();
248 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
249 if(fabs(recoStaTrack->eta())>EtaCutMin[iEtaRegion] && fabs(recoStaTrack->eta())<EtaCutMax[iEtaRegion] &&
250 fabs(recoTrack->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack->eta())<EtaCutMax[iEtaRegion]){
257 if (muon1->isStandAloneMuon() && muon2->isTrackerMuon()) {
261 Mu1.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
262 Mu2.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
264 charge = recoStaTrack->charge()*recoTrack->charge();
266 InvMass = (Mu1+Mu2).M();
267 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
268 if(fabs(recoStaTrack->eta())>EtaCutMin[iEtaRegion] && fabs(recoStaTrack->eta())<EtaCutMax[iEtaRegion] &&
269 fabs(recoTrack->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack->eta())<EtaCutMax[iEtaRegion]){
278 if (muon1->isTrackerMuon() && muon2->isTrackerMuon()) {
282 Mu2.SetPxPyPzE(recoTrack2->px(), recoTrack2->py(),recoTrack2->pz(), recoTrack2->p());
283 Mu1.SetPxPyPzE(recoTrack1->px(), recoTrack1->py(),recoTrack1->pz(), recoTrack1->p());
285 charge = recoTrack1->charge()*recoTrack2->charge();
287 InvMass = (Mu1+Mu2).M();
288 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
289 if(fabs(recoTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack1->eta())<EtaCutMax[iEtaRegion] &&
290 fabs(recoTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack2->eta())<EtaCutMax[iEtaRegion]){
304 InvMass = (Mu1+Mu2).M();
305 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
307 if(fabs(recoTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack1->eta())<EtaCutMax[iEtaRegion] &&
308 fabs(recoTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack2->eta())<EtaCutMax[iEtaRegion]){
310 SoftSoftMuonBadFrac[iEtaRegion]->Fill(muon1->innerTrack()->lost()/muon1->innerTrack()->found());
std::vector< MonitorElement * > MediumMediumMuon
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< MonitorElement * > MediumMediumMuonBadFrac
std::vector< MonitorElement * > GlbGlbMuon_LM
std::vector< MonitorElement * > TightTightMuonBadFrac
math::Error< dimension >::type Error
covariance error matrix (3x3)
bool isLooseMuon(const reco::Muon &)
edm::EDGetTokenT< edm::View< reco::Muon > > theMuonCollectionLabel_
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
std::vector< MonitorElement * > LooseLooseMuonBadFrac
std::vector< MonitorElement * > SoftSoftMuon
math::XYZPoint Point
point in the space
double BeamWidthX() const
beam width X
std::vector< MonitorElement * > TrkTrkMuon_LM
std::vector< MonitorElement * > StaTrkMuon_LM
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
std::vector< MonitorElement * > SoftSoftMuonBadFrac
std::vector< MonitorElement * > TrkTrkMuon_HM
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
static int position[264][3]
std::vector< MonitorElement * > StaTrkMuon_HM
std::vector< MonitorElement * > GlbGlbMuon_HM
const Point & position() const
position
std::vector< MonitorElement * > TightTightMuon
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
std::vector< MonitorElement * > LooseLooseMuon