20 #include "TLorentzVector.h"
39 theMuonCollectionLabel_ = consumes<reco::MuonCollection> (
parameters.getParameter<
edm::InputTag>(
"MuonCollection"));
43 etaBin =
parameters.getParameter<
int>(
"etaBin");
44 etaBBin =
parameters.getParameter<
int>(
"etaBBin");
45 etaEBin =
parameters.getParameter<
int>(
"etaEBin");
47 etaBinLM =
parameters.getParameter<
int>(
"etaBinLM");
48 etaBBinLM =
parameters.getParameter<
int>(
"etaBBinLM");
49 etaEBinLM =
parameters.getParameter<
int>(
"etaEBinLM");
51 etaBMin =
parameters.getParameter<
double>(
"etaBMin");
52 etaBMax =
parameters.getParameter<
double>(
"etaBMax");
53 etaECMin =
parameters.getParameter<
double>(
"etaECMin");
54 etaECMax =
parameters.getParameter<
double>(
"etaECMax");
56 LowMassMin =
parameters.getParameter<
double>(
"LowMassMin");
57 LowMassMax =
parameters.getParameter<
double>(
"LowMassMax");
58 HighMassMin =
parameters.getParameter<
double>(
"HighMassMin");
59 HighMassMax =
parameters.getParameter<
double>(
"HighMassMax");
72 int nBin = 0, nBinLM = 0;
73 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
74 if (iEtaRegion==0) { EtaName =
""; nBin = etaBin;}
75 if (iEtaRegion==1) { EtaName =
"_Barrel"; nBin = etaBBin;}
76 if (iEtaRegion==2) { EtaName =
"_EndCap"; nBin = etaEBin;}
78 if (etaBinLM == 0) { nBinLM = nBin;}
80 if (iEtaRegion==0) { EtaName =
""; nBinLM = etaBinLM;}
81 if (iEtaRegion==1) { EtaName =
"_Barrel"; nBinLM = etaBBinLM;}
82 if (iEtaRegion==2) { EtaName =
"_EndCap"; nBinLM = etaEBinLM;}
85 GlbGlbMuon_LM.push_back(ibooker.
book1D(
"GlbGlbMuon_LM"+EtaName,
"InvMass_{GLB,GLB}"+EtaName,nBinLM, LowMassMin, LowMassMax));
86 TrkTrkMuon_LM.push_back(ibooker.
book1D(
"TrkTrkMuon_LM"+EtaName,
"InvMass_{TRK,TRK}"+EtaName,nBinLM, LowMassMin, LowMassMax));
87 StaTrkMuon_LM.push_back(ibooker.
book1D(
"StaTrkMuon_LM"+EtaName,
"InvMass_{STA,TRK}"+EtaName,nBinLM, LowMassMin, LowMassMax));
89 GlbGlbMuon_HM.push_back(ibooker.
book1D(
"GlbGlbMuon_HM"+EtaName,
"InvMass_{GLB,GLB}"+EtaName,nBin, HighMassMin, HighMassMax));
90 TrkTrkMuon_HM.push_back(ibooker.
book1D(
"TrkTrkMuon_HM"+EtaName,
"InvMass_{TRK,TRK}"+EtaName,nBin, HighMassMin, HighMassMax));
91 StaTrkMuon_HM.push_back(ibooker.
book1D(
"StaTrkMuon_HM"+EtaName,
"InvMass_{STA,TRK}"+EtaName,nBin, HighMassMin, HighMassMax));
94 TightTightMuon.push_back(ibooker.
book1D(
"TightTightMuon"+EtaName,
"InvMass_{Tight,Tight}"+EtaName,nBin, 55.0, 125.0));
97 SoftSoftMuon.push_back(ibooker.
book1D(
"SoftSoftMuon"+EtaName,
"InvMass_{Soft,Soft}"+EtaName,nBin, 5.0, 55.0));
103 LogTrace(
metname)<<
"[DiMuonHistograms] Analyze the mu in different eta regions";
105 iEvent.
getByToken(theMuonCollectionLabel_, muons);
111 unsigned int theIndexOfThePrimaryVertex = 999.;
116 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
117 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
118 theIndexOfThePrimaryVertex = ind;
124 if (theIndexOfThePrimaryVertex<100) {
125 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
126 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
129 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
132 iEvent.
getByToken(theBeamSpotLabel_,recoBeamSpotHandle);
138 errVtx(2,2) = bs.
sigmaZ();
146 TLorentzVector Mu1, Mu2;
148 float InvMass = -99.;
150 for (reco::MuonCollection::const_iterator recoMu1 = muons->begin(); recoMu1!=muons->end(); ++recoMu1) {
154 for (reco::MuonCollection::const_iterator recoMu2 = recoMu1; recoMu2!=muons->end(); ++recoMu2){
156 if (recoMu1==recoMu2)
continue;
159 if (recoMu1->isGlobalMuon() && recoMu2->isGlobalMuon()) {
163 Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(), recoCombinedGlbTrack1->py(),recoCombinedGlbTrack1->pz(), recoCombinedGlbTrack1->p());
164 Mu2.SetPxPyPzE(recoCombinedGlbTrack2->px(), recoCombinedGlbTrack2->py(),recoCombinedGlbTrack2->pz(), recoCombinedGlbTrack2->p());
166 charge = recoCombinedGlbTrack1->charge()*recoCombinedGlbTrack2->charge();
168 InvMass = (Mu1+Mu2).M();
169 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
170 if (iEtaRegion==0) {EtaCutMin= 0.; EtaCutMax=2.4; }
171 if (iEtaRegion==1) {EtaCutMin= etaBMin; EtaCutMax=etaBMax; }
172 if (iEtaRegion==2) {EtaCutMin= etaECMin; EtaCutMax=etaECMax; }
174 if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax &&
175 fabs(recoCombinedGlbTrack2->eta())>EtaCutMin && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax){
176 if (InvMass < LowMassMax) GlbGlbMuon_LM[iEtaRegion]->Fill(InvMass);
177 if (InvMass > HighMassMin) GlbGlbMuon_HM[iEtaRegion]->Fill(InvMass);
187 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
188 if (iEtaRegion==0) {EtaCutMin= 0.; EtaCutMax=2.4; }
189 if (iEtaRegion==1) {EtaCutMin= etaBMin; EtaCutMax=etaBMax; }
190 if (iEtaRegion==2) {EtaCutMin= etaECMin; EtaCutMax=etaECMax; }
192 if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax &&
193 fabs(recoCombinedGlbTrack2->eta())>EtaCutMin && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax){
194 if (InvMass > 55. && InvMass < 125.) TightTightMuon[iEtaRegion]->Fill(InvMass);
201 if (recoMu2->isStandAloneMuon() && recoMu1->isTrackerMuon()) {
205 Mu2.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
206 Mu1.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
208 charge = recoStaTrack->charge()*recoTrack->charge();
210 InvMass = (Mu1+Mu2).M();
211 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
212 if (iEtaRegion==0) {EtaCutMin= 0.; EtaCutMax=2.4; }
213 if (iEtaRegion==1) {EtaCutMin= etaBMin; EtaCutMax=etaBMax; }
214 if (iEtaRegion==2) {EtaCutMin= etaECMin; EtaCutMax=etaECMax; }
216 if(fabs(recoStaTrack->eta())>EtaCutMin && fabs(recoStaTrack->eta())<EtaCutMax &&
217 fabs(recoTrack->eta())>EtaCutMin && fabs(recoTrack->eta())<EtaCutMax){
218 if (InvMass < LowMassMax) StaTrkMuon_LM[iEtaRegion]->Fill(InvMass);
219 if (InvMass > HighMassMin) StaTrkMuon_HM[iEtaRegion]->Fill(InvMass);
224 if (recoMu1->isStandAloneMuon() && recoMu2->isTrackerMuon()) {
228 Mu1.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
229 Mu2.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
231 charge = recoStaTrack->charge()*recoTrack->charge();
233 InvMass = (Mu1+Mu2).M();
234 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
235 if (iEtaRegion==0) {EtaCutMin= 0.; EtaCutMax=2.4; }
236 if (iEtaRegion==1) {EtaCutMin= etaBMin; EtaCutMax=etaBMax; }
237 if (iEtaRegion==2) {EtaCutMin= etaECMin; EtaCutMax=etaECMax; }
239 if(fabs(recoStaTrack->eta())>EtaCutMin && fabs(recoStaTrack->eta())<EtaCutMax &&
240 fabs(recoTrack->eta())>EtaCutMin && fabs(recoTrack->eta())<EtaCutMax){
241 if (InvMass < LowMassMax) StaTrkMuon_LM[iEtaRegion]->Fill(InvMass);
242 if (InvMass > HighMassMin) StaTrkMuon_HM[iEtaRegion]->Fill(InvMass);
249 if (recoMu1->isTrackerMuon() && recoMu2->isTrackerMuon()) {
253 Mu2.SetPxPyPzE(recoTrack2->px(), recoTrack2->py(),recoTrack2->pz(), recoTrack2->p());
254 Mu1.SetPxPyPzE(recoTrack1->px(), recoTrack1->py(),recoTrack1->pz(), recoTrack1->p());
256 charge = recoTrack1->charge()*recoTrack2->charge();
258 InvMass = (Mu1+Mu2).M();
259 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
260 if (iEtaRegion==0) {EtaCutMin= 0.; EtaCutMax=2.4; }
261 if (iEtaRegion==1) {EtaCutMin= etaBMin; EtaCutMax=etaBMax; }
262 if (iEtaRegion==2) {EtaCutMin= etaECMin; EtaCutMax=etaECMax; }
264 if(fabs(recoTrack1->eta())>EtaCutMin && fabs(recoTrack1->eta())<EtaCutMax &&
265 fabs(recoTrack2->eta())>EtaCutMin && fabs(recoTrack2->eta())<EtaCutMax){
266 if (InvMass < LowMassMax) TrkTrkMuon_LM[iEtaRegion]->Fill(InvMass);
267 if (InvMass > HighMassMin) TrkTrkMuon_HM[iEtaRegion]->Fill(InvMass);
279 InvMass = (Mu1+Mu2).M();
280 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
281 if (iEtaRegion==0) {EtaCutMin= 0.; EtaCutMax=2.4; }
282 if (iEtaRegion==1) {EtaCutMin= etaBMin; EtaCutMax=etaBMax; }
283 if (iEtaRegion==2) {EtaCutMin= etaECMin; EtaCutMax=etaECMax; }
285 if(fabs(recoTrack1->eta())>EtaCutMin && fabs(recoTrack1->eta())<EtaCutMax &&
286 fabs(recoTrack2->eta())>EtaCutMin && fabs(recoTrack2->eta())<EtaCutMax){
287 SoftSoftMuon[iEtaRegion]->Fill(InvMass);
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
math::Error< dimension >::type Error
covariance error matrix (3x3)
bool isSoftMuon(const reco::Muon &, const reco::Vertex &)
MonitorElement * book1D(Args &&...args)
math::XYZPoint Point
point in the space
double BeamWidthX() const
beam width X
DiMuonHistograms(const edm::ParameterSet &pset)
void setCurrentFolder(const std::string &fullpath)
double sigmaZ() const
sigma z
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
double BeamWidthY() const
beam width Y
virtual ~DiMuonHistograms()
static int position[264][3]
const Point & position() const
position
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
void analyze(const edm::Event &, const edm::EventSetup &)