71 vector<string>::const_iterator iTr =
trigSources.begin();
72 vector<string>::const_iterator trEnd =
trigSources.end();
73 vector<string>::const_iterator iHw =
hwSources.begin();
74 vector<string>::const_iterator hwEnd =
hwSources.end();
79 for (; iTr != trEnd; ++iTr){
81 for (; iHw != hwEnd; ++iHw){
84 for (
int wh=-2; wh<=2; ++wh){
85 for (
int sect=1; sect<=12; ++sect){
86 for (
int stat=1; stat<=4; ++stat){
126 for (vector<string>::const_iterator iHw =
hwSources.begin(); iHw !=
hwSources.end(); ++iHw){
129 for (
int stat=1; stat<=4; ++stat){
130 for (
int wh=-2; wh<=2; ++wh){
131 for (
int sect=1; sect<=12; ++sect){
133 int sector_id = (wh+3)+(sect-1)*5;
134 uint32_t indexCh = chId.
rawId();
137 TH2F * TrackPosvsAngle = getHisto<TH2F>(igetter.
get(
getMEName(
"TrackPosvsAngle",
"Segment", chId)));
138 TH2F * TrackPosvsAngleandTrig = getHisto<TH2F>(igetter.
get(
getMEName(
"TrackPosvsAngleandTrig",
"Segment", chId)));
139 TH2F * TrackPosvsAngleandTrigHHHL = getHisto<TH2F>(igetter.
get(
getMEName(
"TrackPosvsAngleandTrigHHHL",
"Segment", chId)));
141 if (TrackPosvsAngle && TrackPosvsAngleandTrig && TrackPosvsAngleandTrigHHHL && TrackPosvsAngle->GetEntries()>1) {
162 std::map<std::string,MonitorElement*> *innerME = &(
secME[sector_id]);
163 TH1D* TrackPos = TrackPosvsAngle->ProjectionY();
164 TH1D*
TrackAngle = TrackPosvsAngle->ProjectionX();
165 TH1D* TrackPosandTrig = TrackPosvsAngleandTrig->ProjectionY();
166 TH1D* TrackAngleandTrig = TrackPosvsAngleandTrig->ProjectionX();
167 TH1D* TrackPosandTrigHHHL = TrackPosvsAngleandTrigHHHL->ProjectionY();
168 TH1D* TrackAngleandTrigHHHL = TrackPosvsAngleandTrigHHHL->ProjectionX();
169 float binEff = float(TrackPosandTrig->GetEntries())/TrackPos->GetEntries();
170 float binEffHHHL = float(TrackPosandTrigHHHL->GetEntries())/TrackPos->GetEntries();
171 float binErr =
sqrt(binEff*(1-binEff)/TrackPos->GetEntries());
172 float binErrHHHL =
sqrt(binEffHHHL*(1-binEffHHHL)/TrackPos->GetEntries());
176 globalEff->setBinError(stat,binErr);
178 innerME = &(
whME[wh]);
179 globalEff = innerME->find(
fullName(
"TrigEffPhi"))->second;
180 globalEff->setBinContent(sect,stat,binEff);
181 globalEff->setBinError(sect,stat,binErr);
182 globalEff = innerME->find(
fullName(
"TrigEffHHHLPhi"))->second;
183 globalEff->setBinContent(sect,stat,binEffHHHL);
184 globalEff->setBinError(sect,stat,binErrHHHL);
198 TH2F * TrackThetaPosvsAngle = getHisto<TH2F>(igetter.
get(
getMEName(
"TrackThetaPosvsAngle",
"Segment", chId)));
199 TH2F * TrackThetaPosvsAngleandTrig = getHisto<TH2F>(igetter.
get(
getMEName(
"TrackThetaPosvsAngleandTrig",
"Segment", chId)));
200 TH2F * TrackThetaPosvsAngleandTrigH = getHisto<TH2F>(igetter.
get(
getMEName(
"TrackThetaPosvsAngleandTrigH",
"Segment", chId)));
202 if (TrackThetaPosvsAngle && TrackThetaPosvsAngleandTrig && TrackThetaPosvsAngleandTrigH && TrackThetaPosvsAngle->GetEntries()>1) {
222 std::map<std::string,MonitorElement*> *innerME = &(
secME[sector_id]);
223 TH1D* TrackThetaPos = TrackThetaPosvsAngle->ProjectionY();
224 TH1D* TrackThetaAngle = TrackThetaPosvsAngle->ProjectionX();
225 TH1D* TrackThetaPosandTrig = TrackThetaPosvsAngleandTrig->ProjectionY();
226 TH1D* TrackThetaAngleandTrig = TrackThetaPosvsAngleandTrig->ProjectionX();
227 TH1D* TrackThetaPosandTrigH = TrackThetaPosvsAngleandTrigH->ProjectionY();
228 TH1D* TrackThetaAngleandTrigH = TrackThetaPosvsAngleandTrigH->ProjectionX();
229 float binEff = float(TrackThetaPosandTrig->GetEntries())/TrackThetaPos->GetEntries();
230 float binErr =
sqrt(binEff*(1-binEff)/TrackThetaPos->GetEntries());
231 float binEffH = float(TrackThetaPosandTrigH->GetEntries())/TrackThetaPos->GetEntries();
232 float binErrH =
sqrt(binEffH*(1-binEffH)/TrackThetaPos->GetEntries());
236 globalEff->setBinError(stat,binErr);
238 innerME = &(
whME[wh]);
239 globalEff = innerME->find(
fullName(
"TrigEffTheta"))->second;
240 globalEff->setBinContent(sect,stat,binEff);
241 globalEff->setBinError(sect,stat,binErr);
242 globalEff = innerME->find(
fullName(
"TrigEffHTheta"))->second;
243 globalEff->setBinContent(sect,stat,binEffH);
244 globalEff->setBinError(sect,stat,binErrH);
251 makeEfficiencyME2D(TrackThetaPosvsAngleandTrig,TrackThetaPosvsAngle,innerME->find(
fullName(
"TrigEffPosvsAngleTheta"))->second);
252 makeEfficiencyME2D(TrackThetaPosvsAngleandTrigH,TrackThetaPosvsAngle,innerME->find(
fullName(
"TrigEffPosvsAngleHTheta"))->second);
267 efficiency->Divide(numerator,denominator,1,1,
"");
269 int nbins = efficiency->GetNbinsX();
272 float bineff = efficiency->GetBinContent(
bin);
274 if (denominator->GetBinContent(
bin)){
275 error =
sqrt(bineff*(1-bineff)/denominator->GetBinContent(
bin));
279 efficiency->SetBinContent(
bin,1.);
282 efficiency->SetBinError(
bin,error);
291 efficiency->Divide(numerator,denominator,1,1,
"");
293 int nbinsx = efficiency->GetNbinsX();
294 int nbinsy = efficiency->GetNbinsY();
295 for (
int binx=1; binx<=nbinsx; ++binx){
296 for (
int biny=1; biny<=nbinsy; ++biny){
298 float bineff = efficiency->GetBinContent(binx,biny);
300 if (denominator->GetBinContent(binx,biny)){
301 error =
sqrt(bineff*(1-bineff)/denominator->GetBinContent(binx,biny));
305 efficiency->SetBinContent(binx,biny,0.);
308 efficiency->SetBinError(binx,biny,error);
316 stringstream wheel; wheel << chambId.
wheel();
318 stringstream sector; sector << chambId.
sector();
322 string HistoName = fullType +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
325 "/Sector" + sector.str() +
326 "/Station" + station.str() +
"/Segment");
329 <<
"/Sector" << sector.str() <<
"/Station" << station.str() <<
"/Segment/" <<
HistoName;
332 uint32_t indexChId = chambId.
rawId();
333 if (htype.find(
"TrigEffAnglePhi") == 0){
334 chambME[indexChId][fullType] = ibooker.
book1D(HistoName.c_str(),
"Trigger efficiency vs angle of incidence (Phi)",16,-40.,40.);
336 else if (htype.find(
"TrigEffAngleHHHLPhi") == 0){
337 chambME[indexChId][fullType] = ibooker.
book1D(HistoName.c_str(),
"Trigger efficiency (HH/HL) vs angle of incidence (Phi)",16,-40.,40.);
339 else if (htype.find(
"TrigEffAngleTheta") == 0){
340 chambME[indexChId][fullType] = ibooker.
book1D(HistoName.c_str(),
"Trigger efficiency vs angle of incidence (Theta)",16,-40.,40.);
342 else if (htype.find(
"TrigEffAngleHTheta") == 0){
343 chambME[indexChId][fullType] = ibooker.
book1D(HistoName.c_str(),
"Trigger efficiency (H) vs angle of incidence (Theta)",16,-40.,40.);
345 else if (htype.find(
"TrigEffPosPhi") == 0 ){
349 chambME[indexChId][fullType] = ibooker.
book1D(HistoName.c_str(),
"Trigger efficiency vs position (Phi)",
nbins,
min,
max);
351 else if (htype.find(
"TrigEffPosvsAnglePhi") == 0 ){
355 chambME[indexChId][fullType] = ibooker.
book2D(HistoName.c_str(),
"Trigger efficiency position vs angle (Phi)",16,-40.,40.,
nbins,
min,
max);
357 else if (htype.find(
"TrigEffPosvsAngleHHHLPhi") == 0 ){
361 chambME[indexChId][fullType] = ibooker.
book2D(HistoName.c_str(),
"Trigger efficiency (HH/HL) pos vs angle (Phi)",16,-40.,40.,
nbins,
min,
max);
363 else if (htype.find(
"TrigEffPosHHHLPhi") == 0 ){
367 chambME[indexChId][fullType] = ibooker.
book1D(HistoName.c_str(),
"Trigger efficiency (HH/HL) vs position (Phi)",
nbins,
min,
max);
369 else if (htype.find(
"TrigEffPosTheta") == 0){
373 chambME[indexChId][fullType] = ibooker.
book1D(HistoName.c_str(),
"Trigger efficiency vs position (Theta)",
nbins,
min,
max);
375 else if (htype.find(
"TrigEffPosHTheta") == 0){
379 chambME[indexChId][fullType] = ibooker.
book1D(HistoName.c_str(),
"Trigger efficiency (H) vs position (Theta)",
nbins,
min,
max);
381 else if (htype.find(
"TrigEffPosvsAngleTheta") == 0 ){
385 chambME[indexChId][fullType] = ibooker.
book2D(HistoName.c_str(),
"Trigger efficiency pos vs angle (Theta)",16,-40.,40.,
nbins,
min,
max);
387 else if (htype.find(
"TrigEffPosvsAngleHTheta") == 0 ){
391 chambME[indexChId][fullType] = ibooker.
book2D(HistoName.c_str(),
"Trigger efficiency (H) pos vs angle (Theta)",16,-40.,40.,
nbins,
min,
max);
std::map< int, std::map< std::string, MonitorElement * > > secME
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > trigSources
void setBinContent(int binx, double content)
set content of bin (1-D)
void thetaRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute theta range in local chamber coordinates.
void runClientDiagnostic(DQMStore::IBooker &, DQMStore::IGetter &)
DQM Client Diagnostic.
std::map< int, std::map< std::string, MonitorElement * > > whME
void makeEfficiencyME(TH1D *numerator, TH1D *denominator, MonitorElement *result)
Compute efficiency plots.
DTTrigGeomUtils * trigGeomUtils
std::string baseFolderDCC
MonitorElement * get(const std::string &path)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
void makeEfficiencyME2D(TH2F *numerator, TH2F *denominator, MonitorElement *result)
Compute 2D efficiency plots.
std::string baseFolderDDU
void beginRun(edm::Run const &run, edm::EventSetup const &context)
BeginRun.
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Perform client diagnostic in online.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
edm::ESHandle< DTGeometry > muonGeom
uint32_t rawId() const
get the raw id
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
void bookChambHistos(DQMStore::IBooker &, DTChamberId chambId, std::string htype)
Book the new MEs (for each chamber)
MonitorElement * book1D(Args &&...args)
DTLocalTriggerEfficiencyTest(const edm::ParameterSet &ps)
Constructor.
std::string category()
Get message logger name.
void phiRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute phi range in local chamber coordinates.
edm::ParameterSet parameters
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
TH1F * getTH1F(void) const
std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId &chambid)
Get the ME name (by chamber)
void bookSectorHistos(DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
Book the new MEs (for each sector)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
std::string & topFolder(bool isDCC)
Get top folder name.
void setConfig(const edm::ParameterSet &ps, std::string name)
Set configuration variables.
int station() const
Return the station number.
TH2F * getTH2F(void) const
std::vector< std::string > hwSources
virtual ~DTLocalTriggerEfficiencyTest()
Destructor.
int wheel() const
Return the wheel number.
void bookWheelHistos(DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
Book the new MEs (for each wheel)
std::string fullName(std::string htype)
Create fullname from histo partial name.