CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
11 // This class header
13 
14 // Framework headers
19 
20 // Geometry
23 
24 // Root
25 #include "TF1.h"
26 #include "TProfile.h"
27 
28 
29 //C++ headers
30 #include <iostream>
31 #include <sstream>
32 
33 using namespace edm;
34 using namespace std;
35 
36 
38 
39  setConfig(ps,"DTLocalTriggerTP");
40  baseFolderDCC = "DT/11-LocalTriggerTP-DCC/";
41  baseFolderDDU = "DT/12-LocalTriggerTP-DDU/";
42 
43  bookingdone = 0;
44 
45 }
46 
47 
49 
50 }
51 
52 
54  edm::LuminosityBlock const & lumiSeg, edm::EventSetup const & context) {
55 
56  if (bookingdone) return;
57 
58  vector<string>::const_iterator iTr = trigSources.begin();
59  vector<string>::const_iterator trEnd = trigSources.end();
60  vector<string>::const_iterator iHw = hwSources.begin();
61  vector<string>::const_iterator hwEnd = hwSources.end();
62 
63  //Booking
64  if(parameters.getUntrackedParameter<bool>("staticBooking", true)){
65  for (; iTr != trEnd; ++iTr){
66  trigSource = (*iTr);
67  for (; iHw != hwEnd; ++iHw){
68  hwSource = (*iHw);
69  // Loop over the TriggerUnits
70  for (int wh=-2; wh<=2; ++wh){
71  bookWheelHistos(ibooker,wh,"CorrectBXPhi");
72  bookWheelHistos(ibooker,wh,"ResidualBXPhi");
73  }
74  }
75  }
76  }
77 
78 
79  bookingdone = 1;
80 
81 }
82 
83 
85 
87 
88 }
89 
91  DQMStore::IGetter & igetter) {
92 
93  // Loop over Trig & Hw sources
94  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
95  trigSource = (*iTr);
96  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
97  hwSource = (*iHw);
98  // Loop over the TriggerUnits
99  for (int stat=1; stat<=4; ++stat){
100  for (int wh=-2; wh<=2; ++wh){
101  for (int sect=1; sect<=12; ++sect){
102  DTChamberId chId(wh,stat,sect);
103 
104  // Perform DCC/DDU common plot analysis (Phi ones)
105  TH2F * BXvsQual = getHisto<TH2F>(igetter.get(getMEName("BXvsQual","LocalTriggerPhi", chId)));
106  if ( BXvsQual ) {
107 
108  if (BXvsQual->GetEntries()>1) {
109 
110  TH1D* BX = BXvsQual->ProjectionY();
111  int BXOK_bin = BX->GetMaximumBin();
112  double BXMean = BX->GetMean();
113  double BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
114  delete BX;
115 
116  if( whME[wh].find(fullName("CorrectBXPhi")) == whME[wh].end() ){
117  bookWheelHistos(ibooker,wh,"ResidualBXPhi");
118  bookWheelHistos(ibooker,wh,"CorrectBXPhi");
119  }
120 
121  std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
122  innerME->find(fullName("CorrectBXPhi"))->second->setBinContent(sect,stat,BX_OK+0.00001);
123  innerME->find(fullName("ResidualBXPhi"))->second->setBinContent(sect,stat,round(25.*(BXMean-BX_OK))+0.00001);
124  }
125 
126  }
127  }
128  }
129  }
130  }
131  }
132 
133 }
134 
135 
137 
dictionary parameters
Definition: Parameters.py:2
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
DTLocalTriggerTPTest(const edm::ParameterSet &ps)
Constructor.
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)
Definition: FindCaloHit.cc:7
#define end
Definition: vmac.h:37
void runClientDiagnostic(DQMStore::IBooker &, DQMStore::IGetter &)
Run client analysis.
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
string fullName
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
virtual ~DTLocalTriggerTPTest()
Destructor.
Definition: Run.h:41