CMS 3D CMS Logo

DTLocalTriggerTPTest.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author C. Battilana S. Marcellini - INFN Bologna
5  *
6  * threadsafe version (//-) oct/nov 2014 - WATWanAbdullah -ncpp-um-my
7  *
8  */
9 
10 // This class header
12 
13 // Framework headers
17 
18 // Geometry
21 
22 // Root
23 #include "TF1.h"
24 #include "TProfile.h"
25 
26 //C++ headers
27 #include <iostream>
28 #include <sstream>
29 
30 using namespace edm;
31 using namespace std;
32 
34  setConfig(ps, "DTLocalTriggerTP");
35  baseFolderTM = "DT/11-LocalTriggerTP-TM/";
36 
37  bookingdone = false;
38 }
39 
41 
43  vector<string>::const_iterator iTr = trigSources.begin();
44  vector<string>::const_iterator trEnd = trigSources.end();
45  vector<string>::const_iterator iHw = hwSources.begin();
46  vector<string>::const_iterator hwEnd = hwSources.end();
47 
48  //Booking
49  if (parameters.getUntrackedParameter<bool>("staticBooking", true)) {
50  for (; iTr != trEnd; ++iTr) {
51  trigSource = (*iTr);
52  for (; iHw != hwEnd; ++iHw) {
53  hwSource = (*iHw);
54  // Loop over the TriggerUnits
55  for (int wh = -2; wh <= 2; ++wh) {
56  bookWheelHistos(ibooker, wh, "CorrectBXPhi");
57  bookWheelHistos(ibooker, wh, "ResidualBXPhi");
58  }
59  }
60  }
61  }
62 
63  bookingdone = true;
64 }
65 
68 }
69 
71  if (!bookingdone)
72  Bookings(ibooker, igetter);
73 
74  // Loop over Trig & Hw sources
75  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
76  trigSource = (*iTr);
77  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
78  hwSource = (*iHw);
79  // Loop over the TriggerUnits
80  for (int stat = 1; stat <= 4; ++stat) {
81  for (int wh = -2; wh <= 2; ++wh) {
82  for (int sect = 1; sect <= 12; ++sect) {
83  DTChamberId chId(wh, stat, sect);
84 
85  // Perform TM common plot analysis (Phi ones)
86  TH2F* BXvsQual = getHisto<TH2F>(igetter.get(getMEName("BXvsQual_In", "LocalTriggerPhiIn", chId)));
87  if (BXvsQual) {
88  if (BXvsQual->GetEntries() > 1) {
89  TH1D* BX = BXvsQual->ProjectionY();
90  int BXOK_bin = BX->GetMaximumBin();
91  double BXMean = BX->GetMean();
92  double BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
93  delete BX;
94 
95  if (whME[wh].find(fullName("CorrectBXPhi")) == whME[wh].end()) {
96  bookWheelHistos(ibooker, wh, "ResidualBXPhi");
97  bookWheelHistos(ibooker, wh, "CorrectBXPhi");
98  }
99 
100  std::map<std::string, MonitorElement*>* innerME = &(whME[wh]);
101  innerME->find(fullName("CorrectBXPhi"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
102  innerME->find(fullName("ResidualBXPhi"))
103  ->second->setBinContent(sect, stat, round(25. * (BXMean - BX_OK)) + 0.00001);
104  }
105  }
106  }
107  }
108  }
109  }
110  }
111 }
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:30
MessageLogger.h
DTLocalTriggerBaseTest::beginRun
void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.
Definition: DTLocalTriggerBaseTest.cc:37
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
DQMStore.h
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
DTLocalTriggerTPTest::Bookings
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: DTLocalTriggerTPTest.cc:42
DTLocalTriggerTPTest::runClientDiagnostic
void runClientDiagnostic(DQMStore::IBooker &, DQMStore::IGetter &) override
Run client analysis.
Definition: DTLocalTriggerTPTest.cc:70
DTLocalTriggerTPTest::~DTLocalTriggerTPTest
~DTLocalTriggerTPTest() override
Destructor.
Definition: DTLocalTriggerTPTest.cc:40
mps_fire.end
end
Definition: mps_fire.py:242
newFWLiteAna.fullName
fullName
Definition: newFWLiteAna.py:122
DTGeometry.h
edm::ParameterSet
Definition: ParameterSet.h:47
dtFineDelayCorr_cfi.hwSource
hwSource
Definition: dtFineDelayCorr_cfi.py:26
dtFineDelayCorr_cfi.hwSources
hwSources
Definition: dtFineDelayCorr_cfi.py:9
edm::EventSetup
Definition: EventSetup.h:58
DTLocalTriggerTPTest::beginRun
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
BeginRun.
Definition: DTLocalTriggerTPTest.cc:66
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DTLocalTriggerTPTest.h
std
Definition: JetResolutionObject.h:76
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
EventSetup.h
L1TStage2uGTEmulatorClient_cff.BX
BX
Definition: L1TStage2uGTEmulatorClient_cff.py:9
dqm::implementation::IBooker
Definition: DQMStore.h:43
DTChamberId
Definition: DTChamberId.h:14
MuonGeometryRecord.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm_modernize_messagelogger.stat
stat
Definition: edm_modernize_messagelogger.py:27
DTLocalTriggerTPTest::DTLocalTriggerTPTest
DTLocalTriggerTPTest(const edm::ParameterSet &ps)
Constructor.
Definition: DTLocalTriggerTPTest.cc:33