104 LogTrace(
metname)<<
"[DiMuonHistograms] Analyze the mu in different eta regions";
112 unsigned int theIndexOfThePrimaryVertex = 999.;
117 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
118 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
119 theIndexOfThePrimaryVertex = ind;
125 if (theIndexOfThePrimaryVertex<100) {
126 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
127 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
130 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
139 errVtx(2,2) = bs.
sigmaZ();
147 TLorentzVector Mu1, Mu2;
149 float InvMass = -99.;
151 for (reco::MuonCollection::const_iterator recoMu1 = muons->begin(); recoMu1!=muons->end(); ++recoMu1) {
155 for (reco::MuonCollection::const_iterator recoMu2 = recoMu1; recoMu2!=muons->end(); ++recoMu2){
157 if (recoMu1==recoMu2)
continue;
160 if (recoMu1->isGlobalMuon() && recoMu2->isGlobalMuon()) {
164 Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(), recoCombinedGlbTrack1->py(),recoCombinedGlbTrack1->pz(), recoCombinedGlbTrack1->p());
165 Mu2.SetPxPyPzE(recoCombinedGlbTrack2->px(), recoCombinedGlbTrack2->py(),recoCombinedGlbTrack2->pz(), recoCombinedGlbTrack2->p());
167 charge = recoCombinedGlbTrack1->charge()*recoCombinedGlbTrack2->charge();
169 InvMass = (Mu1+Mu2).M();
170 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
175 if(fabs(recoCombinedGlbTrack1->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack1->eta())<
EtaCutMax &&
176 fabs(recoCombinedGlbTrack2->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack2->eta())<
EtaCutMax){
188 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
193 if(fabs(recoCombinedGlbTrack1->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack1->eta())<
EtaCutMax &&
194 fabs(recoCombinedGlbTrack2->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack2->eta())<
EtaCutMax){
195 if (InvMass > 55. && InvMass < 125.)
TightTightMuon[iEtaRegion]->Fill(InvMass);
202 if (recoMu2->isStandAloneMuon() && recoMu1->isTrackerMuon()) {
206 Mu2.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
207 Mu1.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
209 charge = recoStaTrack->charge()*recoTrack->charge();
211 InvMass = (Mu1+Mu2).M();
212 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
225 if (recoMu1->isStandAloneMuon() && recoMu2->isTrackerMuon()) {
229 Mu1.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
230 Mu2.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
232 charge = recoStaTrack->charge()*recoTrack->charge();
234 InvMass = (Mu1+Mu2).M();
235 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
250 if (recoMu1->isTrackerMuon() && recoMu2->isTrackerMuon()) {
254 Mu2.SetPxPyPzE(recoTrack2->px(), recoTrack2->py(),recoTrack2->pz(), recoTrack2->p());
255 Mu1.SetPxPyPzE(recoTrack1->px(), recoTrack1->py(),recoTrack1->pz(), recoTrack1->p());
257 charge = recoTrack1->charge()*recoTrack2->charge();
259 InvMass = (Mu1+Mu2).M();
260 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
280 InvMass = (Mu1+Mu2).M();
281 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< MonitorElement * > GlbGlbMuon_LM
math::Error< dimension >::type Error
covariance error matrix (3x3)
bool isSoftMuon(const reco::Muon &, const reco::Vertex &)
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
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_
std::vector< MonitorElement * > TrkTrkMuon_HM
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
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 &)