29 terrnbinsrpc_ = parameters.
getParameter<
int>(
"terrnbinsrpc");
36 terrmaxrpc_ = parameters.
getParameter<
double>(
"terrmaxrpc");
43 terrminrpc_ = parameters.
getParameter<
double>(
"terrminrpc");
48 etaBarrelMin_ = parameters.
getParameter<
double>(
"etaBarrelMin");
49 etaBarrelMax_ = parameters.
getParameter<
double>(
"etaBarrelMax");
50 etaEndcapMin_ = parameters.
getParameter<
double>(
"etaEndcapMin");
51 etaEndcapMax_ = parameters.
getParameter<
double>(
"etaEndcapMax");
52 etaOverlapMin_ = parameters.
getParameter<
double>(
"etaOverlapMin");
53 etaOverlapMax_ = parameters.
getParameter<
double>(
"etaOverlapMax");
66 EtaName_.push_back(
"_Overlap");
67 EtaName_.push_back(
"_Barrel");
68 EtaName_.push_back(
"_Endcap");
69 ObjectName_.push_back(
"Sta_");
70 ObjectName_.push_back(
"Glb_");
72 for (
unsigned int iEtaRegion = 0; iEtaRegion < 3; iEtaRegion++) {
79 for (
unsigned int iObjectName = 0; iObjectName < 1; iObjectName++) {
80 timeNDof_[iEtaRegion][iObjectName] = ibooker.
book1D(
81 ObjectName_[iObjectName] +
"timenDOF" + EtaName_[iEtaRegion],
"muon time ndof", ndofnbins_, 0, ndofmax_);
82 timeAtIpInOut_[iEtaRegion][iObjectName] = ibooker.
book1D(
83 ObjectName_[iObjectName] +
"timeAtIpInOut" + EtaName_[iEtaRegion],
"muon time", tnbins_, tmin_, tmax_);
84 timeAtIpInOutRPC_[iEtaRegion][iObjectName] =
85 ibooker.
book1D(ObjectName_[iObjectName] +
"timeAtIpInOutRPC" + EtaName_[iEtaRegion],
90 timeAtIpInOutErr_[iEtaRegion][iObjectName] =
91 ibooker.
book1D(ObjectName_[iObjectName] +
"timeAtIpInOutErr" + EtaName_[iEtaRegion],
96 timeAtIpInOutErrRPC_[iEtaRegion][iObjectName] =
97 ibooker.
book1D(ObjectName_[iObjectName] +
"timeAtIpInOutRPCErr" + EtaName_[iEtaRegion],
98 "muon rpc time error",
102 timeNDof_[iEtaRegion][iObjectName]->
setAxisTitle(
"Time nDof");
103 timeAtIpInOut_[iEtaRegion][iObjectName]->setAxisTitle(
"Combined time [ns]");
104 timeAtIpInOutErr_[iEtaRegion][iObjectName]->setAxisTitle(
"Combined time Error [ns]");
105 timeAtIpInOutRPC_[iEtaRegion][iObjectName]->setAxisTitle(
"RPC time [ns]");
106 timeAtIpInOutErrRPC_[iEtaRegion][iObjectName]->setAxisTitle(
"RPC time Error [ns]");
118 for (
unsigned int iObjectName = 0; iObjectName < 1; iObjectName++) {
119 etaptVeto_[iObjectName] = ibooker.
book2D(ObjectName_[iObjectName] +
"etapt",
120 "Eta and Pt distribution for muons not passing the veto",
127 etaVeto_[iObjectName] = ibooker.
book1D(ObjectName_[iObjectName] +
"eta",
128 "Eta distribution for muons not passing the veto",
132 ptVeto_[iObjectName] = ibooker.
book1D(
133 ObjectName_[iObjectName] +
"pt",
"Pt distribution for muons not passing the veto", ptnbins_, ptmin_, ptmax_);
134 yields_[iObjectName] = ibooker.
book1D(
135 ObjectName_[iObjectName] +
"yields",
"Number of muons passing/not passing the different conditions", 10, 0, 10);
136 yields_[iObjectName]->
setBinLabel(1,
"Not valid time");
137 yields_[iObjectName]->setBinLabel(2,
"Valid time");
138 yields_[iObjectName]->setBinLabel(3,
"Not Combined time");
139 yields_[iObjectName]->setBinLabel(4,
"Combined time");
140 yields_[iObjectName]->setBinLabel(5,
"Not RPC time");
141 yields_[iObjectName]->setBinLabel(6,
"RPC time");
142 yields_[iObjectName]->setBinLabel(7,
"Combined not RPC");
143 yields_[iObjectName]->setBinLabel(8,
"RPC not Combined");
144 yields_[iObjectName]->setBinLabel(9,
"Not passing veto");
145 yields_[iObjectName]->setBinLabel(10,
"Passing veto");
146 etaptVeto_[iObjectName]->setAxisTitle(
"p_{T} [GeV]");
147 etaptVeto_[iObjectName]->setAxisTitle(
"#eta#", 2);
148 ptVeto_[iObjectName]->setAxisTitle(
"p_{T} [GeV]");
149 etaVeto_[iObjectName]->setAxisTitle(
"#eta");
154 LogTrace(metname_) <<
"[MuonTiming] Analyze the mu";
158 iEvent.
getByToken(theMuonCollectionLabel_, muons);
167 if (!
muon->isStandAloneMuon() ||
muon->isGlobalMuon())
172 if (
muon->isGlobalMuon()) {
173 track =
muon->combinedMuon();
176 track =
muon->standAloneMuon();
181 bool cmbok = (time.
nDof > 7);
193 if (
muon->isTimeValid())
194 yields_[theObject]->
Fill(1);
196 yields_[theObject]->Fill(0);
199 yields_[theObject]->Fill(3);
201 yields_[theObject]->Fill(2);
204 yields_[theObject]->Fill(5);
206 yields_[theObject]->Fill(4);
209 yields_[theObject]->Fill(6);
211 yields_[theObject]->Fill(7);
214 yields_[theObject]->Fill(8);
216 yields_[theObject]->Fill(9);
220 etaptVeto_[theObject]->Fill(track->pt(), track->eta());
221 etaVeto_[theObject]->Fill(track->eta());
222 ptVeto_[theObject]->Fill(track->pt());
227 if (fabs(track->eta()) >= etaBarrelMin_ && fabs(track->eta()) <= etaBarrelMax_)
229 if (fabs(track->eta()) >= etaOverlapMin_ && fabs(track->eta()) <= etaOverlapMax_)
231 if (fabs(track->eta()) >= etaEndcapMin_ && fabs(track->eta()) <= etaEndcapMax_)
233 timeNDof_[theEta][theObject]->Fill(time.
nDof);
235 timeAtIpInOutRPC_[theEta][theObject]->Fill(rpcTime.
timeAtIpInOut);
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
void analyze(const edm::Event &, const edm::EventSetup &) override
Inizialize parameters for histo binning.
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
~MuonTiming() override
Destructor.
int nDof
number of muon stations used
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
MuonTiming(const edm::ParameterSet &)
Constructor.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)