32 terrnbinsrpc_ = parameters.
getParameter<
int>(
"terrnbinsrpc");
39 terrmaxrpc_ = parameters.
getParameter<
double>(
"terrmaxrpc");
46 terrminrpc_ = parameters.
getParameter<
double>(
"terrminrpc");
51 etaBarrelMin_ = parameters.
getParameter<
double>(
"etaBarrelMin");
52 etaBarrelMax_ = parameters.
getParameter<
double>(
"etaBarrelMax");
53 etaEndcapMin_ = parameters.
getParameter<
double>(
"etaEndcapMin");
54 etaEndcapMax_ = parameters.
getParameter<
double>(
"etaEndcapMax");
55 etaOverlapMin_ = parameters.
getParameter<
double>(
"etaOverlapMin");
56 etaOverlapMax_ = parameters.
getParameter<
double>(
"etaOverlapMax");
73 EtaName_.push_back(
"_Overlap"); EtaName_.push_back(
"_Barrel"); EtaName_.push_back(
"_Endcap");
74 ObjectName_.push_back(
"Sta_"); ObjectName_.push_back(
"Glb_");
76 for (
unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
83 for(
unsigned int iObjectName=0; iObjectName<1; iObjectName++) {
84 timeNDof_[iEtaRegion][iObjectName] = ibooker.
book1D(ObjectName_[iObjectName] +
"timenDOF" + EtaName_[iEtaRegion],
"muon time ndof", ndofnbins_, 0, ndofmax_);
85 timeAtIpInOut_[iEtaRegion][iObjectName] = ibooker.
book1D(ObjectName_[iObjectName] +
"timeAtIpInOut" + EtaName_[iEtaRegion],
"muon time", tnbins_, tmin_, tmax_);
86 timeAtIpInOutRPC_[iEtaRegion][iObjectName] = ibooker.
book1D(ObjectName_[iObjectName] +
"timeAtIpInOutRPC" + EtaName_[iEtaRegion],
"muon rpc time", tnbinsrpc_, tminrpc_, tmaxrpc_);
87 timeAtIpInOutErr_[iEtaRegion][iObjectName] = ibooker.
book1D(ObjectName_[iObjectName] +
"timeAtIpInOutErr" + EtaName_[iEtaRegion],
"muon time error", terrnbins_, terrmin_, terrmax_);
88 timeAtIpInOutErrRPC_[iEtaRegion][iObjectName] = ibooker.
book1D(ObjectName_[iObjectName] +
"timeAtIpInOutRPCErr" + EtaName_[iEtaRegion],
"muon rpc time error", terrnbinsrpc_, terrminrpc_, terrmaxrpc_);
89 timeNDof_[iEtaRegion][iObjectName]->
setAxisTitle(
"Time nDof");
90 timeAtIpInOut_[iEtaRegion][iObjectName]->setAxisTitle(
"Combined time [ns]");
91 timeAtIpInOutErr_[iEtaRegion][iObjectName]->setAxisTitle(
"Combined time Error [ns]");
92 timeAtIpInOutRPC_[iEtaRegion][iObjectName]->setAxisTitle(
"RPC time [ns]");
93 timeAtIpInOutErrRPC_[iEtaRegion][iObjectName]->setAxisTitle(
"RPC time Error [ns]");
105 for(
unsigned int iObjectName=0; iObjectName<1; iObjectName++) {
106 etaptVeto_[iObjectName] = ibooker.
book2D(ObjectName_[iObjectName] +
"etapt",
"Eta and Pt distribution for muons not passing the veto", ptnbins_, ptmin_, ptmax_, etanbins_, etamin_, etamax_);
107 etaVeto_[iObjectName] = ibooker.
book1D(ObjectName_[iObjectName] +
"eta",
"Eta distribution for muons not passing the veto", etanbins_, etamin_, etamax_);
108 ptVeto_[iObjectName] = ibooker.
book1D(ObjectName_[iObjectName] +
"pt",
"Pt distribution for muons not passing the veto", ptnbins_, ptmin_, ptmax_);
109 yields_[iObjectName] = ibooker.
book1D(ObjectName_[iObjectName] +
"yields",
"Number of muons passing/not passing the different conditions", 10, 0, 10);
110 yields_[iObjectName]->
setBinLabel(1,
"Not valid time");
111 yields_[iObjectName]->setBinLabel(2,
"Valid time");
112 yields_[iObjectName]->setBinLabel(3,
"Not Combined time");
113 yields_[iObjectName]->setBinLabel(4,
"Combined time");
114 yields_[iObjectName]->setBinLabel(5,
"Not RPC time");
115 yields_[iObjectName]->setBinLabel(6,
"RPC time");
116 yields_[iObjectName]->setBinLabel(7,
"Combined not RPC");
117 yields_[iObjectName]->setBinLabel(8,
"RPC not Combined");
118 yields_[iObjectName]->setBinLabel(9,
"Not passing veto");
119 yields_[iObjectName]->setBinLabel(10,
"Passing veto");
120 etaptVeto_[iObjectName]->setAxisTitle(
"p_{T} [GeV]");
121 etaptVeto_[iObjectName]->setAxisTitle(
"#eta#", 2);
122 ptVeto_[iObjectName]->setAxisTitle(
"p_{T} [GeV]");
123 etaVeto_[iObjectName]->setAxisTitle(
"#eta");
132 LogTrace(metname_)<<
"[MuonTiming] Analyze the mu";
133 theService->update(iSetup);
137 iEvent.
getByToken(theMuonCollectionLabel_,muons);
146 if(!
muon->isStandAloneMuon() ||
muon->isGlobalMuon())
continue;
150 if(
muon->isGlobalMuon()) {track =
muon->combinedMuon(); theObject =
glb;}
151 else {track =
muon->standAloneMuon(); theObject = sta;}
154 bool cmbok =(time.
nDof > 7);
164 if(
muon->isTimeValid()) yields_[theObject]->
Fill(1);
165 else yields_[theObject]->Fill(0);
167 if(cmbok) yields_[theObject]->Fill(3);
168 else yields_[theObject]->Fill(2);
170 if(rpcok) yields_[theObject]->Fill(5);
171 else yields_[theObject]->Fill(4);
173 if(cmbok && !rpcok) yields_[theObject]->Fill(6);
174 if(!cmbok && rpcok) yields_[theObject]->Fill(7);
176 if(veto) yields_[theObject]->Fill(8);
177 else yields_[theObject]->Fill(9);
181 etaptVeto_[theObject]->Fill(track->pt(), track->eta());
182 etaVeto_[theObject]->Fill(track->eta());
183 ptVeto_[theObject]->Fill(track->pt());
188 if(fabs(track->eta()) >= etaBarrelMin_ && fabs(track->eta()) <= etaBarrelMax_) theEta =
barrel;
189 if(fabs(track->eta()) >= etaOverlapMin_ && fabs(track->eta()) <= etaOverlapMax_) theEta =
overlap;
190 if(fabs(track->eta()) >= etaEndcapMin_ && fabs(track->eta()) <= etaEndcapMax_) theEta =
endcap;
191 timeNDof_[theEta][theObject]->Fill(time.
nDof);
193 timeAtIpInOutRPC_[theEta][theObject]->Fill(rpcTime.
timeAtIpInOut);
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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)
virtual ~MuonTiming()
Destructor.
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)
MonitorElement * book1D(Args &&...args)
int nDof
number of muon stations used
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
MuonTiming(const edm::ParameterSet &)
Constructor.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)