22 #include "TLorentzVector.h"
73 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
102 unsigned int theIndexOfThePrimaryVertex = 999.;
108 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
109 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
110 theIndexOfThePrimaryVertex = ind;
115 if (theIndexOfThePrimaryVertex<100) {
116 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
117 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
119 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
129 errVtx(2,2) = bs.
sigmaZ();
137 LogTrace(
metname)<<
"[DiMuonHistograms] Analyze the mu in different eta regions";
143 iEvent.
getByLabel(
"offlineBeamSpot", beamSpotHandle);
144 beamSpot = *beamSpotHandle;
149 TLorentzVector Mu1, Mu2;
151 float InvMass = -99.;
153 for (reco::MuonCollection::const_iterator recoMu1 = muons->begin(); recoMu1!=muons->end(); ++recoMu1) {
157 for (reco::MuonCollection::const_iterator recoMu2 = recoMu1; recoMu2!=muons->end(); ++recoMu2){
159 if (recoMu1==recoMu2)
continue;
162 if (recoMu1->isGlobalMuon() && recoMu2->isGlobalMuon()) {
166 Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(), recoCombinedGlbTrack1->py(),recoCombinedGlbTrack1->pz(), recoCombinedGlbTrack1->p());
167 Mu2.SetPxPyPzE(recoCombinedGlbTrack2->px(), recoCombinedGlbTrack2->py(),recoCombinedGlbTrack2->pz(), recoCombinedGlbTrack2->p());
169 charge = recoCombinedGlbTrack1->charge()*recoCombinedGlbTrack2->charge();
171 InvMass = (Mu1+Mu2).M();
172 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
177 if(fabs(recoCombinedGlbTrack1->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack1->eta())<
EtaCutMax &&
178 fabs(recoCombinedGlbTrack2->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack2->eta())<
EtaCutMax){
190 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
195 if(fabs(recoCombinedGlbTrack1->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack1->eta())<
EtaCutMax &&
196 fabs(recoCombinedGlbTrack2->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack2->eta())<
EtaCutMax){
197 if (InvMass > 55. && InvMass < 125.)
TightTightMuon[iEtaRegion]->Fill(InvMass);
204 if (recoMu2->isStandAloneMuon() && recoMu1->isTrackerMuon()) {
208 Mu2.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
209 Mu1.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
211 charge = recoStaTrack->charge()*recoTrack->charge();
213 InvMass = (Mu1+Mu2).M();
214 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
227 if (recoMu1->isStandAloneMuon() && recoMu2->isTrackerMuon()) {
231 Mu1.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(),recoStaTrack->pz(), recoStaTrack->p());
232 Mu2.SetPxPyPzE(recoTrack->px(), recoTrack->py(),recoTrack->pz(), recoTrack->p());
234 charge = recoStaTrack->charge()*recoTrack->charge();
236 InvMass = (Mu1+Mu2).M();
237 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
252 if (recoMu1->isTrackerMuon() && recoMu2->isTrackerMuon()) {
256 Mu2.SetPxPyPzE(recoTrack2->px(), recoTrack2->py(),recoTrack2->pz(), recoTrack2->p());
257 Mu1.SetPxPyPzE(recoTrack1->px(), recoTrack1->py(),recoTrack1->pz(), recoTrack1->p());
259 charge = recoTrack1->charge()*recoTrack2->charge();
261 InvMass = (Mu1+Mu2).M();
262 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
282 InvMass = (Mu1+Mu2).M();
283 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
T getParameter(std::string const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::vector< MonitorElement * > GlbGlbMuon_LM
math::Error< dimension >::type Error
covariance error matrix (3x3)
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
edm::ParameterSet parameters
static int position[TOTALCHAMBERS][3]
bool isSoftMuon(const reco::Muon &, const reco::Vertex &)
std::vector< MonitorElement * > SoftSoftMuon
math::XYZPoint Point
point in the space
double BeamWidthX() const
beam width X
std::vector< MonitorElement * > TrkTrkMuon_LM
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
std::vector< MonitorElement * > StaTrkMuon_LM
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag theMuonCollectionLabel
DiMuonHistograms(const edm::ParameterSet &pset, MuonServiceProxy *theService)
std::vector< MonitorElement * > TrkTrkMuon_HM
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
virtual ~DiMuonHistograms()
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 &)
void setCurrentFolder(const std::string &fullpath)