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  * $Date: 2010/01/05 10:15:46 $
5  * $Revision: 1.4 $
6  * \author C. Battilana S. Marcellini - INFN Bologna
7  */
8 
9 
10 // This class header
12 
13 // Framework headers
18 
19 // Geometry
22 
23 // Root
24 #include "TF1.h"
25 #include "TProfile.h"
26 
27 
28 //C++ headers
29 #include <iostream>
30 #include <sstream>
31 
32 using namespace edm;
33 using namespace std;
34 
35 
37 
38  setConfig(ps,"DTLocalTriggerTP");
39  baseFolderDCC = "DT/11-LocalTriggerTP-DCC/";
40  baseFolderDDU = "DT/12-LocalTriggerTP-DDU/";
41 
42 
43 }
44 
45 
47 
48 }
49 
51 
53 
54 
55  vector<string>::const_iterator iTr = trigSources.begin();
56  vector<string>::const_iterator trEnd = trigSources.end();
57  vector<string>::const_iterator iHw = hwSources.begin();
58  vector<string>::const_iterator hwEnd = hwSources.end();
59 
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  bookWheelHistos(wh,"CorrectBXPhi");
70  bookWheelHistos(wh,"ResidualBXPhi");
71  }
72  }
73  }
74  }
75 
76 }
77 
78 
80 
82 
83 }
84 
85 
87 
88  // Loop over Trig & Hw sources
89  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
90  trigSource = (*iTr);
91  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
92  hwSource = (*iHw);
93  // Loop over the TriggerUnits
94  for (int stat=1; stat<=4; ++stat){
95  for (int wh=-2; wh<=2; ++wh){
96  for (int sect=1; sect<=12; ++sect){
97  DTChamberId chId(wh,stat,sect);
98  // int sector_id = (wh+3)+(sect-1)*5;
99  // uint32_t indexCh = chId.rawId();
100 
101 
102  // Perform DCC/DDU common plot analysis (Phi ones)
103  TH2F * BXvsQual = getHisto<TH2F>(dbe->get(getMEName("BXvsQual","LocalTriggerPhi", chId)));
104  if ( BXvsQual ) {
105 
106  if (BXvsQual->GetEntries()>1) {
107 
108  TH1D* BX = BXvsQual->ProjectionY();
109  int BXOK_bin = BX->GetMaximumBin();
110  double BXMean = BX->GetMean();
111  double BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
112  delete BX;
113 
114  if( whME[wh].find(fullName("CorrectBXPhi")) == whME[wh].end() ){
115  bookWheelHistos(wh,"ResidualBXPhi");
116  bookWheelHistos(wh,"CorrectBXPhi");
117  }
118 
119  std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
120  innerME->find(fullName("CorrectBXPhi"))->second->setBinContent(sect,stat,BX_OK+0.00001);
121  innerME->find(fullName("ResidualBXPhi"))->second->setBinContent(sect,stat,round(25.*(BXMean-BX_OK))+0.00001);
122  }
123 
124  }
125  }
126  }
127  }
128  }
129  }
130 
131 }
132 
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:38
string fullName
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
virtual ~DTLocalTriggerTPTest()
Destructor.
Definition: Run.h:33