96 LogTrace(
metname)<<
"[DiMuonHistograms] Analyze the mu in different eta regions";
104 unsigned int theIndexOfThePrimaryVertex = 999.;
109 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
110 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
111 theIndexOfThePrimaryVertex = ind;
117 if (theIndexOfThePrimaryVertex<100) {
118 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
119 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
122 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
131 errVtx(2,2) = bs.
sigmaZ();
139 TLorentzVector Mu1, Mu2;
141 float InvMass = -99.;
150 if (muon1==muon2)
continue;
153 if (muon1->isGlobalMuon() && muon2->isGlobalMuon()) {
157 Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(), recoCombinedGlbTrack1->py(),recoCombinedGlbTrack1->pz(), recoCombinedGlbTrack1->p());
158 Mu2.SetPxPyPzE(recoCombinedGlbTrack2->px(), recoCombinedGlbTrack2->py(),recoCombinedGlbTrack2->pz(), recoCombinedGlbTrack2->p());
160 charge = recoCombinedGlbTrack1->charge()*recoCombinedGlbTrack2->charge();
162 InvMass = (Mu1+Mu2).M();
163 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
168 if(fabs(recoCombinedGlbTrack1->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack1->eta())<
EtaCutMax &&
169 fabs(recoCombinedGlbTrack2->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack2->eta())<
EtaCutMax){
181 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
186 if(fabs(recoCombinedGlbTrack1->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack1->eta())<
EtaCutMax &&
187 fabs(recoCombinedGlbTrack2->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack2->eta())<
EtaCutMax){
188 if (InvMass > 55. && InvMass < 125.)
TightTightMuon[iEtaRegion]->Fill(InvMass);
196 if (muon2->isStandAloneMuon() && muon1->isTrackerMuon()) {
200 Mu2.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
201 Mu1.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
203 charge = recoStaTrack->charge()*recoTrack->charge();
205 InvMass = (Mu1+Mu2).M();
206 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
219 if (muon1->isStandAloneMuon() && muon2->isTrackerMuon()) {
223 Mu1.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
224 Mu2.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
226 charge = recoStaTrack->charge()*recoTrack->charge();
228 InvMass = (Mu1+Mu2).M();
229 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
244 if (muon1->isTrackerMuon() && muon2->isTrackerMuon()) {
248 Mu2.SetPxPyPzE(recoTrack2->px(), recoTrack2->py(),recoTrack2->pz(), recoTrack2->p());
249 Mu1.SetPxPyPzE(recoTrack1->px(), recoTrack1->py(),recoTrack1->pz(), recoTrack1->p());
251 charge = recoTrack1->charge()*recoTrack2->charge();
253 InvMass = (Mu1+Mu2).M();
254 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
274 InvMass = (Mu1+Mu2).M();
275 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< edm::View< reco::Muon > > 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
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 &)