CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DTLocalTriggerTest Class Reference

#include <DTLocalTriggerTest.h>

Inheritance diagram for DTLocalTriggerTest:
DTLocalTriggerBaseTest DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DTLocalTriggerTest (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTLocalTriggerTest ()
 Destructor. More...
 
- Public Member Functions inherited from DTLocalTriggerBaseTest
 DTLocalTriggerBaseTest ()
 Constructor. More...
 
virtual ~DTLocalTriggerBaseTest ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void Bookings (DQMStore::IBooker &, DQMStore::IGetter &)
 
void fillGlobalSummary (DQMStore::IGetter &)
 
void runClientDiagnostic (DQMStore::IBooker &, DQMStore::IGetter &)
 Run client analysis. More...
 
- Protected Member Functions inherited from DTLocalTriggerBaseTest
void bookCmsHistos (DQMStore::IBooker &, std::string hTag, std::string folder="", bool isGlb=false)
 Book the new MEs (CMS summary) More...
 
void bookSectorHistos (DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
 Book the new MEs (for each sector) More...
 
void bookWheelHistos (DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
 Book the new MEs (for each wheel) More...
 
std::string category ()
 Get message logger name. More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 Perform client diagnostic in online. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &context)
 Perform client diagnostic in offline. More...
 
std::string fullName (std::string htype)
 Create fullname from histo partial name. More...
 
template<class T >
TgetHisto (MonitorElement *me)
 Convert ME to Histogram fo type T. More...
 
std::string getMEName (std::string histoTag, std::string subfolder, const DTChamberId &chambid)
 Get the ME name (by chamber) More...
 
std::string getMEName (std::string histoTag, std::string subfolder, int wh)
 Get the ME name (by wheel) More...
 
std::pair< float, float > phiRange (const DTChamberId &id)
 Calculate phi range for histograms. More...
 
void setConfig (const edm::ParameterSet &ps, std::string name)
 Set configuration variables. More...
 
std::string & topFolder (bool isTM)
 Get top folder name. More...
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

bool bookingdone
 
int nMinEvts
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DTLocalTriggerBaseTest
std::string baseFolderDDU
 
std::string baseFolderTM
 
std::map< std::string,
MonitorElement * > 
cmsME
 
std::string hwSource
 
std::vector< std::string > hwSources
 
edm::ESHandle< DTGeometrymuonGeom
 
int nevents
 
unsigned int nLumiSegs
 
edm::ParameterSet parameters
 
int prescaleFactor
 
int run
 
bool runOnline
 
std::map< int, std::map
< std::string, MonitorElement * > > 
secME
 
std::string sourceFolder
 
std::string testName
 
std::string trigSource
 
std::vector< std::string > trigSources
 
std::map< int, std::map
< std::string, MonitorElement * > > 
whME
 

Detailed Description

Definition at line 18 of file DTLocalTriggerTest.h.

Constructor & Destructor Documentation

DTLocalTriggerTest::DTLocalTriggerTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 37 of file DTLocalTriggerTest.cc.

References edm::ParameterSet::getUntrackedParameter().

37  {
38 
39  setConfig(ps,"DTLocalTrigger");
40  baseFolderTM = "DT/03-LocalTrigger-TM/";
41  baseFolderDDU = "DT/04-LocalTrigger-DDU/";
42  nMinEvts = ps.getUntrackedParameter<int>("nEventsCert", 5000);
43 
44  bookingdone = 0;
45 
46 }
T getUntrackedParameter(std::string const &, T const &) const
void setConfig(const edm::ParameterSet &ps, std::string name)
Set configuration variables.
DTLocalTriggerTest::~DTLocalTriggerTest ( )
virtual

Destructor.

Definition at line 49 of file DTLocalTriggerTest.cc.

49  {
50 
51 }

Member Function Documentation

void DTLocalTriggerTest::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from DTLocalTriggerBaseTest.

Definition at line 134 of file DTLocalTriggerTest.cc.

References DTLocalTriggerBaseTest::beginRun().

134  {
135 
137 
138 }
void beginRun(edm::Run const &run, edm::EventSetup const &context)
BeginRun.
void DTLocalTriggerTest::Bookings ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protected

Definition at line 54 of file DTLocalTriggerTest.cc.

References HLT_FULL_cff::parameters.

54  {
55 
56  vector<string>::const_iterator iTr = trigSources.begin();
57  vector<string>::const_iterator trEnd = trigSources.end();
58  vector<string>::const_iterator iHw = hwSources.begin();
59  vector<string>::const_iterator hwEnd = hwSources.end();
60 
61  //Booking
62  if(parameters.getUntrackedParameter<bool>("staticBooking", true)){
63  for (; iTr != trEnd; ++iTr){
64  trigSource = (*iTr);
65  for (; iHw != hwEnd; ++iHw){
66  hwSource = (*iHw);
67  // Loop over the TriggerUnits
68  for (int wh=-2; wh<=2; ++wh){
69  if (hwSource=="COM") {
70 
71  bookWheelHistos(ibooker,wh,"MatchingPhi");
72  }
73  else {
74  for (int sect=1; sect<=12; ++sect){
75 
76  bookSectorHistos(ibooker,wh,sect,"BXDistribPhi");
77  bookSectorHistos(ibooker,wh,sect,"QualDistribPhi");
78  }
79 
80  bookWheelHistos(ibooker,wh,"CorrectBXPhi");
81  bookWheelHistos(ibooker,wh,"ResidualBXPhi");
82  bookWheelHistos(ibooker,wh,"CorrFractionPhi");
83  bookWheelHistos(ibooker,wh,"2ndFractionPhi");
84  bookWheelHistos(ibooker,wh,"TriggerInclusivePhi");
85  bookWheelHistos(ibooker,wh,"CorrectBXTheta");
86  if (hwSource=="DDU") {
87 
88  bookWheelHistos(ibooker,wh,"HFractionTheta");
89  }
90  }
91  }
92  }
93  }
94  }
95  // Summary test histo booking (only static)
96  for (iTr = trigSources.begin(); iTr != trEnd; ++iTr){
97  trigSource = (*iTr);
98  for (iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
99  hwSource = (*iHw);
100  // Loop over the TriggerUnits
101  for (int wh=-2; wh<=2; ++wh){
102  if (hwSource=="COM") {
103 
104  bookWheelHistos(ibooker,wh,"MatchingSummary","Summaries");
105  }
106  else {
107 
108  bookWheelHistos(ibooker,wh,"CorrFractionSummary","Summaries");
109  bookWheelHistos(ibooker,wh,"2ndFractionSummary","Summaries");
110  }
111  }
112  if (hwSource=="COM") {
113 
114  bookCmsHistos(ibooker,"MatchingSummary","Summaries");
115  }
116  else {
117 
118  bookCmsHistos(ibooker,"CorrFractionSummary");
119  bookCmsHistos(ibooker,"2ndFractionSummary");
120  }
121  if (hwSource=="TM") {
122 
123  bookCmsHistos(ibooker,"TrigGlbSummary","",true);
124  bookCmsHistos(ibooker,"TrigGlbSummary","",true);
125  }
126 
127  }
128  }
129 
130  bookingdone = 1;
131 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > trigSources
void bookSectorHistos(DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
Book the new MEs (for each sector)
std::vector< std::string > hwSources
void bookWheelHistos(DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
Book the new MEs (for each wheel)
void bookCmsHistos(DQMStore::IBooker &, std::string hTag, std::string folder="", bool isGlb=false)
Book the new MEs (CMS summary)
void DTLocalTriggerTest::fillGlobalSummary ( DQMStore::IGetter igetter)
protected

Definition at line 394 of file DTLocalTriggerTest.cc.

References python.rootplot.argparse::category, corr, newFWLiteAna::fullName, DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getFloatValue(), LogTrace, lumiPlot::lut, edm::min(), and edm::second().

394  {
395 
396  float glbPerc[5] = { 1., 0.9, 0.6, 0.3, 0.01 };
397  trigSource = "";
398  hwSource = "TM";
399 
400  int nSecReadout = 0;
401 
402  for (int wh=-2; wh<=2; ++wh) {
403  for (int sect=1; sect<=12; ++sect) {
404 
405  float maxErr = 8.;
406  int corr = cmsME.find(fullName("CorrFractionSummary"))->second->getBinContent(sect,wh+3);
407  int second = cmsME.find(fullName("2ndFractionSummary"))->second->getBinContent(sect,wh+3);
408  int lut=0;
409  MonitorElement * lutsME = igetter.get(topFolder(hwSource=="TM") + "Summaries/TrigLutSummary");
410  if (lutsME) {
411  lut = lutsME->getBinContent(sect,wh+3);
412  maxErr+=4;
413  } else {
414  LogTrace(category()) << "[" << testName
415  << "Test]: TM Lut test Summary histo not found." << endl;
416  }
417  (corr <5 || second<5) && nSecReadout++;
418  int errcode = ((corr<5 ? corr : 4) + (second<5 ? second : 4) + (lut<5 ? lut : 4) );
419  errcode = min(int((errcode/maxErr + 0.01)*5),5);
420  cmsME.find("TrigGlbSummary")->second->setBinContent(sect,wh+3,glbPerc[errcode]);
421 
422  }
423  }
424 
425  if (!nSecReadout)
426  cmsME.find("TrigGlbSummary")->second->Reset(); // white histo id TM is not RO
427 
428  string nEvtsName = "DT/EventInfo/Counters/nProcessedEventsTrigger";
429  MonitorElement * meProcEvts = igetter.get(nEvtsName);
430 
431  if (meProcEvts) {
432  int nProcEvts = meProcEvts->getFloatValue();
433  cmsME.find("TrigGlbSummary")->second->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
434  } else {
435  cmsME.find("TrigGlbSummary")->second->setEntries(nMinEvts + 1);
436  LogVerbatim (category()) << "[" << testName
437  << "Test]: ME: " << nEvtsName << " not found!" << endl;
438  }
439 
440 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
U second(std::pair< T, U > const &p)
double getFloatValue(void) const
tuple lut
Definition: lumiPlot.py:244
T min(T a, T b)
Definition: MathUtil.h:58
#define LogTrace(id)
JetCorrectorParameters corr
Definition: classes.h:5
std::string category()
Get message logger name.
std::string & topFolder(bool isTM)
Get top folder name.
double getBinContent(int binx) const
get content of bin (1-D)
std::map< std::string, MonitorElement * > cmsME
std::string fullName(std::string htype)
Create fullname from histo partial name.
void DTLocalTriggerTest::runClientDiagnostic ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protectedvirtual

Run client analysis.

Implements DTLocalTriggerBaseTest.

Definition at line 140 of file DTLocalTriggerTest.cc.

References rpcdqm::BX, end, spr::find(), newFWLiteAna::fullName, DQMStore::IGetter::get(), and HLT_FULL_cff::parameters.

140  {
141 
142  if (!bookingdone) Bookings(ibooker,igetter);
143 
144  // Loop over Trig & Hw sources
145  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
146  trigSource = (*iTr);
147  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
148  hwSource = (*iHw);
149  // Loop over the TriggerUnits
150  for (int stat=1; stat<=4; ++stat){
151  for (int wh=-2; wh<=2; ++wh){
152  for (int sect=1; sect<=12; ++sect){
153  DTChamberId chId(wh,stat,sect);
154  int sector_id = (wh+3)+(sect-1)*5;
155 
156  if (hwSource=="COM") {
157  // Perform TM-DDU matching test and generates summaries (Phi view)
158  TH2F * DDUvsTM = getHisto<TH2F>(igetter.get(getMEName("QualDDUvsQualTM","LocalTriggerPhi", chId)));
159  if (DDUvsTM) {
160 
161  int matchSummary = 1;
162 
163  if (DDUvsTM->GetEntries()>1) {
164 
165  double entries = DDUvsTM->GetEntries();
166  double corrEntries = 0;
167  for (int ibin=2; ibin<=8; ++ibin) {
168  corrEntries += DDUvsTM->GetBinContent(ibin,ibin);
169  }
170  double corrRatio = corrEntries/entries;
171 
172  if (corrRatio < parameters.getUntrackedParameter<double>("matchingFracError",.65)){
173  matchSummary = 2;
174  }
175  else if (corrRatio < parameters.getUntrackedParameter<double>("matchingFracWarning",.85)){
176  matchSummary = 3;
177  }
178  else {
179  matchSummary = 0;
180  }
181 
182  if( whME[wh].find(fullName("MatchingPhi")) == whME[wh].end() ){
183  bookWheelHistos(ibooker,wh,"MatchingPhi");
184  }
185 
186  whME[wh].find(fullName("MatchingPhi"))->second->setBinContent(sect,stat,corrRatio);
187 
188  }
189 
190  whME[wh].find(fullName("MatchingSummary"))->second->setBinContent(sect,stat,matchSummary);
191 
192  }
193  }
194  else {
195  // Perform TM/DDU common plot analysis (Phi ones)
196  TH2F * BXvsQual = getHisto<TH2F>(igetter.get(getMEName("BXvsQual","LocalTriggerPhi", chId)));
197  TH1F * BestQual = getHisto<TH1F>(igetter.get(getMEName("BestQual","LocalTriggerPhi", chId)));
198  TH2F * Flag1stvsQual = getHisto<TH2F>(igetter.get(getMEName("Flag1stvsQual","LocalTriggerPhi", chId)));
199  if (BXvsQual && Flag1stvsQual && BestQual) {
200 
201  int corrSummary = 1;
202  int secondSummary = 1;
203 
204  if (BestQual->GetEntries()>1) {
205 
206  TH1D* BXHH = BXvsQual->ProjectionY("",6,7,"");
207  TH1D* Flag1st = Flag1stvsQual->ProjectionY();
208  int BXOK_bin = BXHH->GetEntries()>=1 ? BXHH->GetMaximumBin() : 51;
209  double BXMean = BXHH->GetEntries()>=1 ? BXHH->GetMean() : 51;
210  double BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
211  double trigsFlag2nd = Flag1st->GetBinContent(2);
212  double trigs = Flag1st->GetEntries();
213  double besttrigs = BestQual->GetEntries();
214  double besttrigsCorr = BestQual->Integral(5,7,"");
215  delete BXHH;
216  delete Flag1st;
217 
218  double corrFrac = besttrigsCorr/besttrigs;
219  double secondFrac = trigsFlag2nd/trigs;
220  if (corrFrac < parameters.getUntrackedParameter<double>("corrFracError",.5)){
221  corrSummary = 2;
222  }
223  else if (corrFrac < parameters.getUntrackedParameter<double>("corrFracWarning",.6)){
224  corrSummary = 3;
225  }
226  else {
227  corrSummary = 0;
228  }
229  if (secondFrac > parameters.getUntrackedParameter<double>("secondFracError",.2)){
230  secondSummary = 2;
231  }
232  else if (secondFrac > parameters.getUntrackedParameter<double>("secondFracWarning",.1)){
233  secondSummary = 3;
234  }
235  else {
236  secondSummary = 0;
237  }
238 
239  if( secME[sector_id].find(fullName("BXDistribPhi")) == secME[sector_id].end() ){
240  bookSectorHistos(ibooker,wh,sect,"QualDistribPhi");
241  bookSectorHistos(ibooker,wh,sect,"BXDistribPhi");
242  }
243 
244  TH1D* BXDistr = BXvsQual->ProjectionY();
245  TH1D* QualDistr = BXvsQual->ProjectionX();
246  std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]);
247 
248  int nbinsBX = BXDistr->GetNbinsX();
249  int firstBinCenter = static_cast<int>(BXDistr->GetBinCenter(1));
250  int lastBinCenter = static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
251  int iMin = firstBinCenter>-4 ? firstBinCenter : -4;
252  int iMax = lastBinCenter<20 ? lastBinCenter : 20;
253  for (int ibin=iMin+5;ibin<=iMax+5; ++ibin) {
254  innerME->find(fullName("BXDistribPhi"))->second->setBinContent(ibin,stat,BXDistr->GetBinContent(ibin-5-firstBinCenter+1));
255  }
256  for (int ibin=1;ibin<=7;++ibin) {
257  innerME->find(fullName("QualDistribPhi"))->second->setBinContent(ibin,stat,QualDistr->GetBinContent(ibin));
258  }
259 
260  delete BXDistr;
261  delete QualDistr;
262 
263  if( whME[wh].find(fullName("CorrectBXPhi")) == whME[wh].end() ){
264  bookWheelHistos(ibooker,wh,"ResidualBXPhi");
265  bookWheelHistos(ibooker,wh,"CorrectBXPhi");
266  bookWheelHistos(ibooker,wh,"CorrFractionPhi");
267  bookWheelHistos(ibooker,wh,"2ndFractionPhi");
268  bookWheelHistos(ibooker,wh,"TriggerInclusivePhi");
269  }
270 
271  innerME = &(whME[wh]);
272  innerME->find(fullName("CorrectBXPhi"))->second->setBinContent(sect,stat,BX_OK+0.00001);
273  innerME->find(fullName("ResidualBXPhi"))->second->setBinContent(sect,stat,round(25.*(BXMean-BX_OK))+0.00001);
274  innerME->find(fullName("CorrFractionPhi"))->second->setBinContent(sect,stat,corrFrac);
275  innerME->find(fullName("TriggerInclusivePhi"))->second->setBinContent(sect,stat,besttrigs);
276  innerME->find(fullName("2ndFractionPhi"))->second->setBinContent(sect,stat,secondFrac);
277 
278  }
279 
280  whME[wh].find(fullName("CorrFractionSummary"))->second->setBinContent(sect,stat,corrSummary);
281  whME[wh].find(fullName("2ndFractionSummary"))->second->setBinContent(sect,stat,secondSummary);
282 
283  }
284 
285  if (hwSource=="DDU") {
286  TH2F * ThetaBXvsQual = getHisto<TH2F>(igetter.get(getMEName("ThetaBXvsQual","LocalTriggerTheta", chId)));
287  TH1F * ThetaBestQual = getHisto<TH1F>(igetter.get(getMEName("ThetaBestQual","LocalTriggerTheta", chId)));
288 
289  // no theta triggers in stat 4!
290  if (ThetaBXvsQual && ThetaBestQual && stat<4 && ThetaBestQual->GetEntries()>1) {
291  TH1D* BXH = ThetaBXvsQual->ProjectionY("",4,4,"");
292  int BXOK_bin = BXH->GetEffectiveEntries()>=1 ? BXH->GetMaximumBin(): 10;
293  double BX_OK = ThetaBXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
294  double trigs = ThetaBestQual->GetEntries();
295  double trigsH = ThetaBestQual->GetBinContent(4);
296  delete BXH;
297 
298  if( whME[wh].find(fullName("HFractionTheta")) == whME[wh].end() ){
299  bookWheelHistos(ibooker,wh,"CorrectBXTheta");
300  bookWheelHistos(ibooker,wh,"HFractionTheta");
301  }
302  std::map<std::string,MonitorElement*> *innerME = &(whME.find(wh)->second);
303  innerME->find(fullName("CorrectBXTheta"))->second->setBinContent(sect,stat,BX_OK+0.00001);
304  innerME->find(fullName("HFractionTheta"))->second->setBinContent(sect,stat,trigsH/trigs);
305 
306  }
307  }
308  else if (hwSource=="TM") {
309  // Perform TM plot analysis (Theta ones)
310  TH2F * ThetaPosvsBX = getHisto<TH2F>(igetter.get(getMEName("PositionvsBX","LocalTriggerTheta", chId)));
311 
312  // no theta triggers in stat 4!
313  if (ThetaPosvsBX && stat<4 && ThetaPosvsBX->GetEntries()>1) {
314  TH1D* BX = ThetaPosvsBX->ProjectionX();
315  int BXOK_bin = BX->GetEffectiveEntries()>=1 ? BX->GetMaximumBin(): 10;
316  double BX_OK = ThetaPosvsBX->GetXaxis()->GetBinCenter(BXOK_bin);
317  delete BX;
318 
319  if( whME[wh].find(fullName("CorrectBXTheta")) == whME[wh].end() ){
320  bookWheelHistos(ibooker,wh,"CorrectBXTheta");
321  }
322  std::map<std::string,MonitorElement*> *innerME = &(whME.find(wh)->second);
323  innerME->find(fullName("CorrectBXTheta"))->second->setBinContent(sect,stat,BX_OK+0.00001);
324 
325  }
326  }
327  }
328 
329  }
330  }
331  }
332  }
333  }
334 
335  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
336  trigSource = (*iTr);
337  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
338  hwSource = (*iHw);
339  for (int wh=-2; wh<=2; ++wh){
340  std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
341  if(hwSource=="COM") {
342  TH2F* matchWhSummary = getHisto<TH2F>(innerME->find(fullName("MatchingSummary"))->second);
343  for (int sect=1; sect<=12; ++sect){
344  int matchErr = 0;
345  int matchNoData = 0;
346  for (int stat=1; stat<=4; ++stat){
347  switch (static_cast<int>(matchWhSummary->GetBinContent(sect,stat))) {
348  case 1:
349  matchNoData++;
350  case 2:
351  matchErr++;
352  }
353  }
354  if (matchNoData == 4) matchErr = 5;
355  cmsME.find(fullName("MatchingSummary"))->second->setBinContent(sect,wh+3,matchErr);
356  }
357  }
358  else {
359  TH2F* corrWhSummary = getHisto<TH2F>(innerME->find(fullName("CorrFractionSummary"))->second);
360  TH2F* secondWhSummary = getHisto<TH2F>(innerME->find(fullName("2ndFractionSummary"))->second);
361  for (int sect=1; sect<=12; ++sect){
362  int corrErr = 0;
363  int secondErr = 0;
364  int corrNoData = 0;
365  int secondNoData = 0;
366  for (int stat=1; stat<=4; ++stat){
367  switch (static_cast<int>(corrWhSummary->GetBinContent(sect,stat))) {
368  case 1:
369  corrNoData++;
370  case 2:
371  corrErr++;
372  }
373  switch (static_cast<int>(secondWhSummary->GetBinContent(sect,stat))) {
374  case 1:
375  secondNoData++;
376  case 2:
377  secondErr++;
378  }
379  }
380  if (corrNoData == 4) corrErr = 5;
381  if (secondNoData == 4) secondErr = 5;
382  cmsME.find(fullName("CorrFractionSummary"))->second->setBinContent(sect,wh+3,corrErr);
383  cmsME.find(fullName("2ndFractionSummary"))->second->setBinContent(sect,wh+3,secondErr);
384  }
385  }
386  }
387  }
388  }
389 
390  fillGlobalSummary(igetter);
391 
392 }
std::map< int, std::map< std::string, MonitorElement * > > secME
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > trigSources
std::map< int, std::map< std::string, MonitorElement * > > whME
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void fillGlobalSummary(DQMStore::IGetter &)
#define end
Definition: vmac.h:37
std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId &chambid)
Get the ME name (by chamber)
std::map< std::string, MonitorElement * > cmsME
void bookSectorHistos(DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
Book the new MEs (for each sector)
std::vector< std::string > hwSources
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.

Member Data Documentation

bool DTLocalTriggerTest::bookingdone
private

Definition at line 45 of file DTLocalTriggerTest.h.

int DTLocalTriggerTest::nMinEvts
private

Definition at line 43 of file DTLocalTriggerTest.h.