24 theMuonCollectionLabel_ = consumes<edm::View<reco::Muon> >(
parameters.getParameter<
edm::InputTag>(
"MuonCollection"));
26 tnbins_ =
parameters.getParameter<
int>(
"tnbins");
27 tnbinsrpc_ =
parameters.getParameter<
int>(
"tnbinsrpc");
28 terrnbins_ =
parameters.getParameter<
int>(
"terrnbins");
29 terrnbinsrpc_ =
parameters.getParameter<
int>(
"terrnbinsrpc");
30 ndofnbins_ =
parameters.getParameter<
int>(
"ndofnbins");
31 ptnbins_ =
parameters.getParameter<
int>(
"ptnbins");
32 etanbins_ =
parameters.getParameter<
int>(
"etanbins");
33 tmax_ =
parameters.getParameter<
double>(
"tmax");
34 tmaxrpc_ =
parameters.getParameter<
double>(
"tmaxrpc");
35 terrmax_ =
parameters.getParameter<
double>(
"terrmax");
36 terrmaxrpc_ =
parameters.getParameter<
double>(
"terrmaxrpc");
37 ndofmax_ =
parameters.getParameter<
double>(
"ndofmax");
38 ptmax_ =
parameters.getParameter<
double>(
"ptmax");
39 etamax_ =
parameters.getParameter<
double>(
"etamax");
40 tmin_ =
parameters.getParameter<
double>(
"tmin");
41 tminrpc_ =
parameters.getParameter<
double>(
"tminrpc");
42 terrmin_ =
parameters.getParameter<
double>(
"terrmin");
43 terrminrpc_ =
parameters.getParameter<
double>(
"terrminrpc");
44 ndofmin_ =
parameters.getParameter<
double>(
"ndofmin");
45 ptmin_ =
parameters.getParameter<
double>(
"ptmin");
46 etamin_ =
parameters.getParameter<
double>(
"etamin");
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");
55 theFolder_ =
parameters.getParameter<
string>(
"folder");
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";
160 if (!
muons.isValid())
167 if (!
muon->isStandAloneMuon() ||
muon->isGlobalMuon())
172 if (
muon->isGlobalMuon()) {
181 bool cmbok = (
time.nDof > 7);
185 if ((fabs(rpcTime.
timeAtIpInOut) > 10) && !(cmbok && fabs(
time.timeAtIpInOut) < 10))
187 else if (cmbok && (
time.timeAtIpInOut > 20 ||
time.timeAtIpInOut < -45))
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);
234 timeAtIpInOut_[theEta][theObject]->Fill(
time.timeAtIpInOut);
235 timeAtIpInOutRPC_[theEta][theObject]->Fill(rpcTime.
timeAtIpInOut);
236 timeAtIpInOutErr_[theEta][theObject]->Fill(
time.timeAtIpInOutErr);
virtual void setCurrentFolder(std::string const &fullpath)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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())
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)