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 
7 
8 // This class header
10 
11 // Framework headers
16 
17 // Geometry
20 
21 // Root
22 #include "TF1.h"
23 #include "TProfile.h"
24 
25 
26 //C++ headers
27 #include <iostream>
28 #include <sstream>
29 
30 using namespace edm;
31 using namespace std;
32 
33 
35 
36  setConfig(ps,"DTLocalTriggerTP");
37  baseFolderDCC = "DT/11-LocalTriggerTP-DCC/";
38  baseFolderDDU = "DT/12-LocalTriggerTP-DDU/";
39 
40 
41 }
42 
43 
45 
46 }
47 
49 
51 
52 
53  vector<string>::const_iterator iTr = trigSources.begin();
54  vector<string>::const_iterator trEnd = trigSources.end();
55  vector<string>::const_iterator iHw = hwSources.begin();
56  vector<string>::const_iterator hwEnd = hwSources.end();
57 
58 
59  //Booking
60  if(parameters.getUntrackedParameter<bool>("staticBooking", true)){
61  for (; iTr != trEnd; ++iTr){
62  trigSource = (*iTr);
63  for (; iHw != hwEnd; ++iHw){
64  hwSource = (*iHw);
65  // Loop over the TriggerUnits
66  for (int wh=-2; wh<=2; ++wh){
67  bookWheelHistos(wh,"CorrectBXPhi");
68  bookWheelHistos(wh,"ResidualBXPhi");
69  }
70  }
71  }
72  }
73 
74 }
75 
76 
78 
80 
81 }
82 
83 
85 
86  // Loop over Trig & Hw sources
87  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
88  trigSource = (*iTr);
89  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
90  hwSource = (*iHw);
91  // Loop over the TriggerUnits
92  for (int stat=1; stat<=4; ++stat){
93  for (int wh=-2; wh<=2; ++wh){
94  for (int sect=1; sect<=12; ++sect){
95  DTChamberId chId(wh,stat,sect);
96  // int sector_id = (wh+3)+(sect-1)*5;
97  // uint32_t indexCh = chId.rawId();
98 
99 
100  // Perform DCC/DDU common plot analysis (Phi ones)
101  TH2F * BXvsQual = getHisto<TH2F>(dbe->get(getMEName("BXvsQual","LocalTriggerPhi", chId)));
102  if ( BXvsQual ) {
103 
104  if (BXvsQual->GetEntries()>1) {
105 
106  TH1D* BX = BXvsQual->ProjectionY();
107  int BXOK_bin = BX->GetMaximumBin();
108  double BXMean = BX->GetMean();
109  double BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
110  delete BX;
111 
112  if( whME[wh].find(fullName("CorrectBXPhi")) == whME[wh].end() ){
113  bookWheelHistos(wh,"ResidualBXPhi");
114  bookWheelHistos(wh,"CorrectBXPhi");
115  }
116 
117  std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
118  innerME->find(fullName("CorrectBXPhi"))->second->setBinContent(sect,stat,BX_OK+0.00001);
119  innerME->find(fullName("ResidualBXPhi"))->second->setBinContent(sect,stat,round(25.*(BXMean-BX_OK))+0.00001);
120  }
121 
122  }
123  }
124  }
125  }
126  }
127  }
128 
129 }
130 
dictionary parameters
Definition: Parameters.py:2
DTLocalTriggerTPTest(const edm::ParameterSet &ps)
Constructor.
void beginRun(edm::Run const &run, edm::EventSetup const &context)
BeginRun.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void runClientDiagnostic()
Run client analysis.
#define end
Definition: vmac.h:37
string fullName
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
virtual ~DTLocalTriggerTPTest()
Destructor.
Definition: Run.h:41