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 //======================= Destructor ===============================//
21 //==================================================================//
23 }
24 
25 
26 //==================================================================//
27 //=========================== reset ===============================//
28 //==================================================================//
30 }
31 
32 
33 //==================================================================//
34 //=========================== done ===============================//
35 //==================================================================//
37 }
38 
39 
40 //==================================================================//
41 //=========================== setup ===============================//
42 //==================================================================//
44 
46  baseFolder_ = rootFolder_+"CastorTowerJetMonitor";
47 
48  if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::setup (start)" << std::endl;
49 
52  phiTower=0; depthTower=0; nJets=0; energyJet =0; etaJet=0; phiJet=0;
53 
54 
55  if ( m_dbe !=NULL ) {
56 
58  meEVT_ = m_dbe->bookInt("TowerJet Event Number");
59  meEVT_->Fill(ievt_);
60 
62 
64  meCastorTowerEnergy = m_dbe->book1D("CASTOR Tower Total Energy","CASTOR Tower Total Energy",200,0,1000);
65  meCastorTowerEMEnergy = m_dbe->book1D("CASTOR Tower EM Energy","CASTOR Tower EM Energy",200,0,1000);
66  meCastorTowerHADEnergy = m_dbe->book1D("CASTOR Tower HAD Energy","CASTOR Tower HAD Energy",200,0,1000);
67  meCastorTowerFEM = m_dbe->book1D("CASTOR Tower fem - EM to Total Energy Fraction","CASTOR fem - EM to Total Energy Fraction",20,0,1.2);
68  meCastorTowerEta = m_dbe->book1D("CASTOR Tower Eta","CASTOR Tower Eta",42,-7,7);
69  meCastorTowerPhi = m_dbe->book1D("CASTOR Tower Phi","CASTOR Tower Phi",35,-3.5,3.5);
70  meCastorTowerDepth = m_dbe->book1D("CASTOR Tower Depth","CASTOR Tower Depth",200,0,1000);
71  meCastorTowerMultiplicity = m_dbe->book1D("CASTOR Tower Multiplicity","CASTOR Tower Multiplicity",20,0,20);
72 
73 
75  meCastorJetEnergy = m_dbe->book1D("CASTOR BasicJet Total Energy","CASTOR BasicJet Total Energy",200,0,2000);
76  meCastorJetEta = m_dbe->book1D("CASTOR BasicJet Eta","CASTOR BasicJet Eta",42,-7,7);
77  meCastorJetPhi = m_dbe->book1D("CASTOR BasicJet Phi","CASTOR BasicJet Phi",35,-3.5,3.5);
78  meCastorJetMultiplicity = m_dbe->book1D("CASTOR BasicJet Multiplicity","CASTOR BasicJet Multiplicity",16,0,16);
79  meCastorJetIDMultiplicity = m_dbe->book1D("CASTOR JetID Multiplicity","CASTOR JetID Multiplicity",16,0,16);
80  //-- add more here.....
81 
82  }
83 
84 
85  else{
86  if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::setup - NO DQMStore service" << std::endl;
87  }
88 
89  if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::setup (end)" << std::endl;
90 
91 
92  return;
93 }
94 
95 
96 
97 
98 //=============================================================================//
99 //=========================== processEvent for Towers ========================//
100 //============================================================================//
101 
103 {
104 
105 
106  if(fVerbosity>0)
107  std::cout << "==>CastorTowerJetMonitor::processEventTowers !!!"<< std::endl;
108 
109 
110  if(!m_dbe) {
111  if(fVerbosity>0) std::cout<<"CastorTowerJetMonitor::processEventTowers DQMStore is not instantiated!!!"<<std::endl;
112  return;
113  }
114 
115  meEVT_->Fill(ievt_);
116 
118  nTowers=0;
119 
123 
124  if(castorTowers.size()>0){
125 
126  //for (size_t l=0; l<castorTowers.size() ; l++)
127 
128 
129  for(reco::CastorTowerCollection::const_iterator iTower= castorTowers.begin(); iTower!= castorTowers.end(); iTower++) {
130 
132  energyTower = iTower->energy();
134  emEnergyTower = iTower->emEnergy();
136  hadEnergyTower=iTower->hadEnergy();
138  femTower=iTower->fem();
140  etaTower=iTower->eta();
142  phiTower=iTower->phi();
144  depthTower=iTower->depth();
145 
146 
147  if (energyTower>0) { //-- just a check
148 
157 
158  nTowers++;
159  }
160  }
162  }
163 
164 
165  else {
166  if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::processEvent NO Castor Towers !!!" << std::endl;
167  }
168 
169  ievt_++;
170 
171  return;
172 }
173 
174 
175 
176 //=============================================================================//
177 //=========================== processEvent for BasicJets =====================//
178 //============================================================================//
179 
181 
182  if(fVerbosity>0)
183  std::cout << "==>CastorTowerJetMonitor::processEventJets !!!"<< std::endl;
184 
185  if(!m_dbe) {
186  if(fVerbosity>0) std::cout<<"CastorTowerJetMonitor::processEventJets DQMStore is not instantiated!!!"<<std::endl;
187  return;
188  }
189 
190  nJets=0;
192  for(reco::BasicJet::const_iterator ibegin = castorBasicJets.begin(), iend = castorBasicJets.end(), ijet = ibegin; ijet!= iend; ++ijet) {
193  idx = ijet - ibegin;
194  nJets++;
195  //-- leave it empty for now - no time now...
196  //-- add new stuff here...
197  }
199 
200  return;
201 }
202 
203 
204 //============================================================================//
205 //=========================== processEvent for JetIDs =======================//
206 //============================================================================//
207 
209 
210 
211  if(fVerbosity>0)
212  std::cout << "==>CastorTowerJetMonitor::processEventJetIDs !!!"<< std::endl;
213 
214  if(!m_dbe) {
215  if(fVerbosity>0) std::cout<<"CastorTowerJetMonitor::processEventJetIDs DQMStore is not instantiated!!!"<<std::endl;
216  return;
217  }
218 
219  nJetIDs=0;
220 
222  for(reco::CastorJetIDValueMap::const_iterator iJetID= castorJetIDs.begin(); iJetID!= castorJetIDs.end(); iJetID++) {
223  //-- leave it empty for now - no time now...
224  //-- add new stuff here
225  nJetIDs++;
226  }
228 
229 
230  return;
231 }
232 
233 
234 
MonitorElement * meCastorJetEnergy
MonitorElement * meCastorTowerHADEnergy
MonitorElement * meCastorTowerEta
const_iterator end() const
Definition: ValueMap.h:197
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:717
MonitorElement * meCastorJetPhi
#define NULL
Definition: scimark2.h:8
MonitorElement * meCastorJetMultiplicity
Jets made from CaloTowers.
Definition: BasicJet.h:21
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:196
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:624
std::vector< CastorTower > CastorTowerCollection
collection of CastorTower objects
Definition: CastorTower.h:136
void processEventJetIDs(const reco::CastorJetIDValueMap &castorJetIDs)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429