97 LogTrace(
metname)<<
"[DiMuonHistograms] Analyze the mu in different eta regions";
105 unsigned int theIndexOfThePrimaryVertex = 999.;
110 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
111 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
112 theIndexOfThePrimaryVertex = ind;
118 if (theIndexOfThePrimaryVertex<100) {
119 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
120 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
123 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
132 errVtx(2,2) = bs.
sigmaZ();
140 TLorentzVector Mu1, Mu2;
142 float InvMass = -99.;
144 for (reco::MuonCollection::const_iterator recoMu1 = muons->begin(); recoMu1!=muons->end(); ++recoMu1) {
148 for (reco::MuonCollection::const_iterator recoMu2 = recoMu1; recoMu2!=muons->end(); ++recoMu2){
150 if (recoMu1==recoMu2)
continue;
153 if (recoMu1->isGlobalMuon() && recoMu2->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);
195 if (recoMu2->isStandAloneMuon() && recoMu1->isTrackerMuon()) {
199 Mu2.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
200 Mu1.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
202 charge = recoStaTrack->charge()*recoTrack->charge();
204 InvMass = (Mu1+Mu2).M();
205 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
218 if (recoMu1->isStandAloneMuon() && recoMu2->isTrackerMuon()) {
222 Mu1.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
223 Mu2.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
225 charge = recoStaTrack->charge()*recoTrack->charge();
227 InvMass = (Mu1+Mu2).M();
228 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
243 if (recoMu1->isTrackerMuon() && recoMu2->isTrackerMuon()) {
247 Mu2.SetPxPyPzE(recoTrack2->px(), recoTrack2->py(),recoTrack2->pz(), recoTrack2->p());
248 Mu1.SetPxPyPzE(recoTrack1->px(), recoTrack1->py(),recoTrack1->pz(), recoTrack1->p());
250 charge = recoTrack1->charge()*recoTrack2->charge();
252 InvMass = (Mu1+Mu2).M();
253 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
273 InvMass = (Mu1+Mu2).M();
274 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)
static int position[TOTALCHAMBERS][3]
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
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 &)