100 LogTrace(
metname)<<
"[DiMuonHistograms] Analyze the mu in different eta regions";
108 unsigned int theIndexOfThePrimaryVertex = 999.;
113 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
114 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
115 theIndexOfThePrimaryVertex = ind;
121 if (theIndexOfThePrimaryVertex<100) {
122 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
123 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
126 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
135 errVtx(2,2) = bs.
sigmaZ();
143 TLorentzVector Mu1, Mu2;
145 float InvMass = -99.;
157 if (muon1==muon2)
continue;
160 if (muon1->isGlobalMuon() && muon2->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++){
171 if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
172 fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
184 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
185 if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
186 fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
187 if (InvMass > 55. && InvMass < 125.)
TightTightMuon[iEtaRegion]->Fill(InvMass);
198 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
199 if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
200 fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
201 if (InvMass > 55. && InvMass < 125.)
MediumMediumMuon[iEtaRegion]->Fill(InvMass);
212 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
213 if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
214 fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
215 if (InvMass > 55. && InvMass < 125.)
LooseLooseMuon[iEtaRegion]->Fill(InvMass);
223 if (muon2->isStandAloneMuon() && muon1->isTrackerMuon()) {
227 Mu2.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
228 Mu1.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
230 charge = recoStaTrack->charge()*recoTrack->charge();
232 InvMass = (Mu1+Mu2).M();
233 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
234 if(fabs(recoStaTrack->eta())>EtaCutMin[iEtaRegion] && fabs(recoStaTrack->eta())<EtaCutMax[iEtaRegion] &&
235 fabs(recoTrack->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack->eta())<EtaCutMax[iEtaRegion]){
242 if (muon1->isStandAloneMuon() && muon2->isTrackerMuon()) {
246 Mu1.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
247 Mu2.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
249 charge = recoStaTrack->charge()*recoTrack->charge();
251 InvMass = (Mu1+Mu2).M();
252 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
253 if(fabs(recoStaTrack->eta())>EtaCutMin[iEtaRegion] && fabs(recoStaTrack->eta())<EtaCutMax[iEtaRegion] &&
254 fabs(recoTrack->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack->eta())<EtaCutMax[iEtaRegion]){
263 if (muon1->isTrackerMuon() && muon2->isTrackerMuon()) {
267 Mu2.SetPxPyPzE(recoTrack2->px(), recoTrack2->py(),recoTrack2->pz(), recoTrack2->p());
268 Mu1.SetPxPyPzE(recoTrack1->px(), recoTrack1->py(),recoTrack1->pz(), recoTrack1->p());
270 charge = recoTrack1->charge()*recoTrack2->charge();
272 InvMass = (Mu1+Mu2).M();
273 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
274 if(fabs(recoTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack1->eta())<EtaCutMax[iEtaRegion] &&
275 fabs(recoTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack2->eta())<EtaCutMax[iEtaRegion]){
289 InvMass = (Mu1+Mu2).M();
290 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
292 if(fabs(recoTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack1->eta())<EtaCutMax[iEtaRegion] &&
293 fabs(recoTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack2->eta())<EtaCutMax[iEtaRegion]){
std::vector< MonitorElement * > MediumMediumMuon
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< MonitorElement * > GlbGlbMuon_LM
math::Error< dimension >::type Error
covariance error matrix (3x3)
bool isMediumMuon(const reco::Muon &)
bool isLooseMuon(const reco::Muon &)
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 &)
std::vector< MonitorElement * > LooseLooseMuon