CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
CastorRecHitPerChan Namespace Reference

Functions

template<class RecHit >
void perChanHists (const RecHit &rhit, std::map< HcalCastorDetId, MonitorElement * > &toolE, std::map< HcalCastorDetId, MonitorElement * > &toolT, DQMStore *dbe, std::string baseFolder)
 

Function Documentation

template<class RecHit >
void CastorRecHitPerChan::perChanHists ( const RecHit &  rhit,
std::map< HcalCastorDetId, MonitorElement * > &  toolE,
std::map< HcalCastorDetId, MonitorElement * > &  toolT,
DQMStore dbe,
std::string  baseFolder 
)
inline

Definition at line 124 of file CastorRecHitMonitor.cc.

References DQMStore::book1D(), MonitorElement::Fill(), mergeVDriftHistosByStation::name, and DQMStore::setCurrentFolder().

127  {
128 
129  std::map<HcalCastorDetId,MonitorElement*>::iterator _mei;
130 
131  std::string type = "CastorRecHitPerChannel";
132  if(dbe) dbe->setCurrentFolder(baseFolder+"/"+type);
133 
135  _mei=toolE.find(rhit.id()); //-- look for a histogram with this hit's id !!!
136  if (_mei!=toolE.end()){
137  if (_mei->second==0) return;
138  else _mei->second->Fill(rhit.energy()); //-- if it's there, fill it with energy
139  }
140  else{
141  if(dbe){
142  char name[1024];
143  sprintf(name,"CastorRecHit Energy zside=%d module=%d sector=%d", rhit.id().zside(), rhit.id().module(), rhit.id().sector());
144  toolE[rhit.id()] = dbe->book1D(name,name,60,-10,20);
145  toolE[rhit.id()]->Fill(rhit.energy());
146  }
147  }
148 
150  _mei=toolT.find(rhit.id()); //-- look for a histogram with this hit's id
151  if (_mei!=toolT.end()){
152  if (_mei->second==0) return;
153  else _mei->second->Fill(rhit.time()); //-- if it's there, fill it with time
154  }
155  else{
156  if(dbe){
157  char name[1024];
158  sprintf(name,"CastorRecHit Time zside=%d module=%d sector=%d", rhit.id().zside(), rhit.id().module(), rhit.id().sector());
159  toolT[rhit.id()] = dbe->book1D(name,name,200,-100,100);
160  toolT[rhit.id()]->Fill(rhit.time());
161  }
162  }
163 
164 
165  }
type
Definition: HCALResponse.h:22
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void Fill(long long x)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429