CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CastorTowerJetMonitor.cc
Go to the documentation of this file.
4 
5 //****************************************************//
6 //********** CastorTowerJetMonitor: ******************//
7 //********** Author: Dmytro Volyanskyy *************//
8 //********** Date : 18.03.2011 (first version) ******//
9 //****************************************************//
10 
11 
12 //==================================================================//
13 //======================= Constructor ==============================//
14 //==================================================================//
16  {
17 
18  }
19 
20 
21 //==================================================================//
22 //======================= Destructor ===============================//
23 //==================================================================//
25  {
26 
27  }
28 
29 
30 //==================================================================//
31 //=========================== reset ===============================//
32 //==================================================================//
34  {
35 
36  }
37 
38 
39 //==================================================================//
40 //=========================== done ===============================//
41 //==================================================================//
43  {
44 
45  }
46 
47 
48 //==================================================================//
49 //=========================== setup ===============================//
50 //==================================================================//
52  {
54 
55  if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::setup (start)" << std::endl;
56 
57  baseFolder_ = rootFolder_+"CastorTowerJetMonitor";
58 
61  phiTower=0; depthTower=0; nJets=0; energyJet =0; etaJet=0; phiJet=0;
62 
63  if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::setup (end)" << std::endl;
64 
65  return;
66 }
67 
68 
69 //=================================================================//
70 //========================== beginRun =============================//
71 //================================================================//
73  {
74  if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::beginRun (start)" << std::endl;
75 
76  if ( m_dbe !=NULL ) {
77 
79  meEVT_ = m_dbe->bookInt("TowerJet Event Number");
80  meEVT_->Fill(ievt_);
81 
83 
85  meCastorTowerEnergy = m_dbe->book1D("CASTOR Tower Total Energy","CASTOR Tower Total Energy",200,0,1000);
86  meCastorTowerEMEnergy = m_dbe->book1D("CASTOR Tower EM Energy","CASTOR Tower EM Energy",200,0,1000);
87  meCastorTowerHADEnergy = m_dbe->book1D("CASTOR Tower HAD Energy","CASTOR Tower HAD Energy",200,0,1000);
88  meCastorTowerFEM = m_dbe->book1D("CASTOR Tower fem - EM to Total Energy Fraction","CASTOR fem - EM to Total Energy Fraction",20,0,1.2);
89  meCastorTowerEta = m_dbe->book1D("CASTOR Tower Eta","CASTOR Tower Eta",42,-7,7);
90  meCastorTowerPhi = m_dbe->book1D("CASTOR Tower Phi","CASTOR Tower Phi",35,-3.5,3.5);
91  meCastorTowerDepth = m_dbe->book1D("CASTOR Tower Depth","CASTOR Tower Depth",200,0,1000);
92  meCastorTowerMultiplicity = m_dbe->book1D("CASTOR Tower Multiplicity","CASTOR Tower Multiplicity",20,0,20);
93 
94 
96  meCastorJetEnergy = m_dbe->book1D("CASTOR BasicJet Total Energy","CASTOR BasicJet Total Energy",200,0,2000);
97  meCastorJetEta = m_dbe->book1D("CASTOR BasicJet Eta","CASTOR BasicJet Eta",42,-7,7);
98  meCastorJetPhi = m_dbe->book1D("CASTOR BasicJet Phi","CASTOR BasicJet Phi",35,-3.5,3.5);
99  meCastorJetMultiplicity = m_dbe->book1D("CASTOR BasicJet Multiplicity","CASTOR BasicJet Multiplicity",16,0,16);
100  meCastorJetIDMultiplicity = m_dbe->book1D("CASTOR JetID Multiplicity","CASTOR JetID Multiplicity",16,0,16);
101  //-- add more here.....
102 
103  }
104  else
105  {
106  if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::setup - NO DQMStore service" << std::endl;
107  }
108 
109  if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::beginRun (end)" << std::endl;
110 
111 
112  return;
113  }
114 
115 
116 //=============================================================================//
117 //=========================== processEvent for Towers ========================//
118 //============================================================================//
119 
121 {
122 
123 
124  if(fVerbosity>0)
125  std::cout << "==>CastorTowerJetMonitor::processEventTowers !!!"<< std::endl;
126 
127 
128  if(!m_dbe) {
129  if(fVerbosity>0) std::cout<<"CastorTowerJetMonitor::processEventTowers DQMStore is not instantiated!!!"<<std::endl;
130  return;
131  }
132 
133  meEVT_->Fill(ievt_);
134 
136  nTowers=0;
137 
141 
142  if(castorTowers.size()>0){
143 
144  //for (size_t l=0; l<castorTowers.size() ; l++)
145 
146 
147  for(reco::CastorTowerCollection::const_iterator iTower= castorTowers.begin(); iTower!= castorTowers.end(); iTower++) {
148 
150  energyTower = iTower->energy();
152  emEnergyTower = iTower->emEnergy();
154  hadEnergyTower=iTower->hadEnergy();
156  femTower=iTower->fem();
158  etaTower=iTower->eta();
160  phiTower=iTower->phi();
162  depthTower=iTower->depth();
163 
164 
165  if (energyTower>0) { //-- just a check
166 
175 
176  nTowers++;
177  }
178  }
180  }
181 
182 
183  else {
184  if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::processEvent NO Castor Towers !!!" << std::endl;
185  }
186 
187  ievt_++;
188 
189  return;
190 }
191 
192 
193 
194 //=============================================================================//
195 //=========================== processEvent for BasicJets =====================//
196 //============================================================================//
197 
199 
200  if(fVerbosity>0)
201  std::cout << "==>CastorTowerJetMonitor::processEventJets !!!"<< std::endl;
202 
203  if(!m_dbe) {
204  if(fVerbosity>0) std::cout<<"CastorTowerJetMonitor::processEventJets DQMStore is not instantiated!!!"<<std::endl;
205  return;
206  }
207 
208  nJets=0;
210  for(reco::BasicJet::const_iterator ibegin = castorBasicJets.begin(), iend = castorBasicJets.end(), ijet = ibegin; ijet!= iend; ++ijet) {
211  idx = ijet - ibegin;
212  nJets++;
213  //-- leave it empty for now - no time now...
214  //-- add new stuff here...
215  }
217 
218  return;
219 }
220 
221 
222 //============================================================================//
223 //=========================== processEvent for JetIDs =======================//
224 //============================================================================//
225 
227 
228 
229  if(fVerbosity>0)
230  std::cout << "==>CastorTowerJetMonitor::processEventJetIDs !!!"<< std::endl;
231 
232  if(!m_dbe) {
233  if(fVerbosity>0) std::cout<<"CastorTowerJetMonitor::processEventJetIDs DQMStore is not instantiated!!!"<<std::endl;
234  return;
235  }
236 
237  nJetIDs=0;
238 
240  for(reco::CastorJetIDValueMap::const_iterator iJetID= castorJetIDs.begin(); iJetID!= castorJetIDs.end(); iJetID++) {
241  //-- leave it empty for now - no time now...
242  //-- add new stuff here
243  nJetIDs++;
244  }
246 
247 
248  return;
249 }
250 
251 
252 
MonitorElement * meCastorJetEnergy
MonitorElement * meCastorTowerHADEnergy
MonitorElement * meCastorTowerEta
const_iterator end() const
Definition: ValueMap.h:196
virtual void setup(const edm::ParameterSet &ps, DQMStore *dbe)
MonitorElement * meCastorJetEta
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup)
MonitorElement * meCastorJetPhi
#define NULL
Definition: scimark2.h:8
MonitorElement * meCastorJetMultiplicity
Jets made from CaloTowers.
Definition: BasicJet.h:20
MonitorElement * meCastorTowerMultiplicity
void Fill(long long x)
MonitorElement * meCastorTowerEMEnergy
std::string baseFolder_
MonitorElement * meCastorTowerDepth
void setup(const edm::ParameterSet &ps, DQMStore *dbe)
void processEventJets(const reco::BasicJet &castorBasicJets)
virtual const_iterator begin() const
first daughter const_iterator
void processEventTowers(const reco::CastorTowerCollection &castorTowers)
const_iterator begin() const
Definition: ValueMap.h:195
MonitorElement * meCastorTowerEnergy
MonitorElement * meCastorJetIDMultiplicity
virtual const_iterator end() const
last daughter const_iterator
std::string rootFolder_
MonitorElement * meCastorTowerFEM
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meCastorTowerPhi
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:849
std::vector< CastorTower > CastorTowerCollection
collection of CastorTower objects
Definition: CastorTower.h:126
void processEventJetIDs(const reco::CastorJetIDValueMap &castorJetIDs)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
Definition: Run.h:41