CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
MultiplicityTimeCorrelations Class Reference

#include <DPGAnalysis/SiStripTools/src/MultiplicityTimeCorrelations.cc>

Inheritance diagram for MultiplicityTimeCorrelations:
edm::EDAnalyzer

Public Member Functions

 MultiplicityTimeCorrelations (const edm::ParameterSet &)
 
 ~MultiplicityTimeCorrelations ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag _apvphasecoll
 
std::map< unsigned int, int > _binmax
 
std::vector< int > _dbxbins
 
std::map< int, std::map
< unsigned int, TH1F * > > 
_dbxhistos
 
DigiBXCorrHistogramMaker
< EventWithHistory
_digibxcorrhmevent
 
EventWithHistoryFilter _evfilter
 
edm::InputTag _hecollection
 
int _highorbit
 
int _loworbit
 
int _mindbx
 
int _mintrpltdbx
 
edm::InputTag _multiplicityMap
 
std::map< unsigned int,
std::string > 
_subdets
 
SiStripTKNumbers _trnumb
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 61 of file MultiplicityTimeCorrelations.cc.

Constructor & Destructor Documentation

MultiplicityTimeCorrelations::MultiplicityTimeCorrelations ( const edm::ParameterSet iConfig)
explicit

Definition at line 117 of file MultiplicityTimeCorrelations.cc.

References _binmax, _dbxbins, _dbxhistos, _digibxcorrhmevent, _evfilter, _hecollection, _mindbx, _mintrpltdbx, _subdets, _trnumb, edm::ParameterSet::addUntrackedParameter(), newFWLiteAna::bin, DigiBXCorrHistogramMaker< T >::book(), edm::ParameterSet::getUntrackedParameter(), reco_calib_source_client_cfg::labels, LogDebug, TFileDirectory::make(), TFileDirectory::mkdir(), SiStripTKNumbers::nstrips(), and EventWithHistoryFilter::set().

117  :
118  _digibxcorrhmevent(iConfig),
119  _evfilter(),
120  _hecollection(iConfig.getParameter<edm::InputTag>("historyProduct")),
121  _apvphasecoll(iConfig.getParameter<edm::InputTag>("apvPhaseCollection")),
122  _multiplicityMap(iConfig.getParameter<edm::InputTag>("multiplicityMap")),
123  _subdets(),
124  _binmax(),
125  _loworbit(iConfig.getUntrackedParameter<int>("lowedgeOrbit")),
126  _highorbit(iConfig.getUntrackedParameter<int>("highedgeOrbit")),
127  _mindbx(iConfig.getUntrackedParameter<int>("minDBX")),
128  _mintrpltdbx(iConfig.getUntrackedParameter<int>("minTripletDBX")),
129  _trnumb(),
130  _dbxbins(iConfig.getUntrackedParameter<std::vector<int> >("dbxBins"))
131 {
132  //now do what ever initialization is needed
133 
134  // configure the filter
135 
136  edm::ParameterSet filterConfig;
137  filterConfig.addUntrackedParameter<edm::InputTag>("historyProduct",_hecollection);
138  if(_mindbx>0) {
139  std::vector<int> dbxrange;
140  dbxrange.push_back(_mindbx+1);
141  dbxrange.push_back(-1);
142  filterConfig.addUntrackedParameter<std::vector<int> >("dbxRange",dbxrange);
143  }
144  if(_mintrpltdbx>0) {
145  std::vector<int> dbxtrpltrange;
146  dbxtrpltrange.push_back(_mintrpltdbx+1);
147  dbxtrpltrange.push_back(-1);
148  filterConfig.addUntrackedParameter<std::vector<int> >("dbxTripletRange",dbxtrpltrange);
149  }
150 
151  _evfilter.set(filterConfig);
152 
153  //
154 
156 
157  // create map of labels
158 
159  std::vector<edm::ParameterSet> wantedsubds(iConfig.getUntrackedParameter<std::vector<edm::ParameterSet> >("wantedSubDets"));
160 
161  for(std::vector<edm::ParameterSet>::iterator ps=wantedsubds.begin();ps!=wantedsubds.end();++ps) {
162  _subdets[ps->getParameter<unsigned int>("detSelection")] = ps->getParameter<std::string>("detLabel");
163  _binmax[ps->getParameter<unsigned int>("detSelection")] = ps->getParameter<int>("binMax");
164  }
165  std::map<int,std::string> labels;
166 
167  for(std::map<unsigned int,std::string>::const_iterator subd=_subdets.begin();subd!=_subdets.end();++subd) {
168  labels[int(subd->first)] = subd->second;
169  }
170 
171  //
172 
173  _digibxcorrhmevent.book("EventProcs",labels);
174 
175  TFileDirectory subdbxbin = tfserv->mkdir("DBXDebugging");
176 
177  for(std::vector<int>::const_iterator bin=_dbxbins.begin();bin!=_dbxbins.end();bin++) {
178  char hname[200]; char htitle[200];
179 
180  edm::LogInfo("DBXHistosBinMaxValue") << "Setting bin max values";
181 
182  for(std::map<unsigned int, std::string>::const_iterator subd=_subdets.begin();subd!=_subdets.end();++subd) {
183  if(_binmax.find(subd->first)==_binmax.end()) {
184  edm::LogVerbatim("DBXHistosNotConfiguredBinMax") << "Bin max for " << subd->second
185  << " not configured: " << _trnumb.nstrips(int(subd->first)) << " used";
186  _binmax[subd->first] = _trnumb.nstrips(int(subd->first));
187  }
188 
189  edm::LogVerbatim("DBXHistosBinMaxValue") << "Bin max for " << subd->second << " is " << _binmax[subd->first];
190 
191 
192 
193  sprintf(hname,"sumn%sdigi_%d",subd->second.c_str(),*bin);
194  sprintf(htitle,"%s digi multiplicity at DBX = %d",subd->second.c_str(),*bin);
195  LogDebug("DBXDebug") << "creating histogram " << hname << " " << htitle;
196  _dbxhistos[*bin][subd->first]= subdbxbin.make<TH1F>(hname,htitle,1000,0.,_binmax[subd->first]/(20*1000)*1000);
197  _dbxhistos[*bin][subd->first]->GetXaxis()->SetTitle("Number of Digis");
198  }
199  /*
200  sprintf(hname,"sumntkdigi_%d",*bin);
201  sprintf(htitle,"TK digi multiplicity at DBX = %d",*bin);
202  LogDebug("DBXDebug") << "creating histogram " << hname << " " << htitle;
203  _dbxtkhistos[*bin]= subdbxbin.make<TH1F>(hname,htitle,1000,0.,_trnumb.nstrips(0)/(20*1000)*1000);
204  _dbxtkhistos[*bin]->GetXaxis()->SetTitle("Number of Digis");
205 
206  sprintf(hname,"sumntibdigi_%d",*bin);
207  sprintf(htitle,"TIB digi multiplicity at DBX = %d",*bin);
208  LogDebug("DBXDebug") << "creating histogram " << hname << " " << htitle;
209  _dbxtibhistos[*bin]= subdbxbin.make<TH1F>(hname,htitle,1000,0.,_trnumb.nstrips(SiStripDetId::TIB)/(20*1000)*1000);
210  _dbxtibhistos[*bin]->GetXaxis()->SetTitle("Number of Digis");
211 
212  sprintf(hname,"sumntiddigi_%d",*bin);
213  sprintf(htitle,"TID digi multiplicity at DBX = %d",*bin);
214  LogDebug("DBXDebug") << "creating histogram " << hname << " " << htitle;
215  _dbxtidhistos[*bin]= subdbxbin.make<TH1F>(hname,htitle,1000,0.,_trnumb.nstrips(SiStripDetId::TID)/(20*1000)*1000);
216  _dbxtidhistos[*bin]->GetXaxis()->SetTitle("Number of Digis");
217 
218  sprintf(hname,"sumntobdigi_%d",*bin);
219  sprintf(htitle,"TOB digi multiplicity at DBX = %d",*bin);
220  LogDebug("DBXDebug") << "creating histogram " << hname << " " << htitle;
221  _dbxtobhistos[*bin]= subdbxbin.make<TH1F>(hname,htitle,1000,0.,_trnumb.nstrips(SiStripDetId::TOB)/(20*1000)*1000);
222  _dbxtobhistos[*bin]->GetXaxis()->SetTitle("Number of Digis");
223 
224  sprintf(hname,"sumntecdigi_%d",*bin);
225  sprintf(htitle,"TEC digi multiplicity at DBX = %d",*bin);
226  LogDebug("DBXDebug") << "creating histogram " << hname << " " << htitle;
227  _dbxtechistos[*bin]= subdbxbin.make<TH1F>(hname,htitle,1000,0.,_trnumb.nstrips(SiStripDetId::TEC)/(20*1000)*1000);
228  _dbxtechistos[*bin]->GetXaxis()->SetTitle("Number of Digis");
229  */
230  }
231 
232 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< unsigned int, int > _binmax
DigiBXCorrHistogramMaker< EventWithHistory > _digibxcorrhmevent
std::map< unsigned int, std::string > _subdets
std::map< int, std::map< unsigned int, TH1F * > > _dbxhistos
int nstrips(const SiStripDetId &detid) const
void book(const char *dirname, const std::map< int, std::string > &labels)
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:209
void set(const edm::ParameterSet &iConfig)
T * make() const
make new ROOT object
MultiplicityTimeCorrelations::~MultiplicityTimeCorrelations ( )

Definition at line 235 of file MultiplicityTimeCorrelations.cc.

236 {
237 
238  // do anything here that needs to be done at desctruction time
239  // (e.g. close files, deallocate resources etc.)
240 
241 }

Member Function Documentation

void MultiplicityTimeCorrelations::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 250 of file MultiplicityTimeCorrelations.cc.

References _apvphasecoll, _dbxhistos, _digibxcorrhmevent, _evfilter, _hecollection, _highorbit, _loworbit, _multiplicityMap, _subdets, DigiBXCorrHistogramMaker< T >::fill(), edm::Event::getByLabel(), VarParsing::mult, edm::EventBase::orbitNumber(), and EventWithHistoryFilter::selected().

251 {
252  using namespace edm;
253 
254  // get Phase
255 
257  iEvent.getByLabel(_apvphasecoll,apvphase);
258 
259  // get HE
260 
262  iEvent.getByLabel(_hecollection,he);
263 
264  // check if the event is selected
265 
266  if((_loworbit < 0 || iEvent.orbitNumber() >= _loworbit) &&
267  (_highorbit < 0 || iEvent.orbitNumber() <= _highorbit)) {
268 
269  if(_evfilter.selected(iEvent,iSetup)) {
270 
271 
272  //Compute digi multiplicity
273  /*
274  int ntkdigi=0;
275  int ntibdigi=0;
276  int ntiddigi=0;
277  int ntobdigi=0;
278  int ntecdigi=0;
279  */
281  iEvent.getByLabel(_multiplicityMap,mults);
282 
283  // create map of digi multiplicity
284 
285  std::map<int,int> digimap;
286  for(std::map<unsigned int, int>::const_iterator mult=mults->begin();mult!=mults->end();++mult) {
287  if(_subdets.find(mult->first)!=_subdets.end()) digimap[int(mult->first)] = mult->second;
288  }
289 
290  _digibxcorrhmevent.fill(*he,digimap,apvphase);
291 
292  // fill debug histos
293 
294  if(he->depth()!=0) {
295 
296  long long dbx = he->deltaBX();
297 
298  if(_dbxhistos.find(dbx)!=_dbxhistos.end()) {
299  for(std::map<unsigned int,int>::const_iterator ndigi=mults->begin();ndigi!=mults->end();++ndigi) {
300  _dbxhistos[dbx][ndigi->first]->Fill(ndigi->second);
301  }
302  }
303  if(_dbxhistos.find(-1)!=_dbxhistos.end()) {
304  for(std::map<unsigned int,int>::const_iterator ndigi=mults->begin();ndigi!=mults->end();++ndigi) {
305  _dbxhistos[-1][ndigi->first]->Fill(ndigi->second);
306  }
307  }
308  /*
309  if(_dbxtkhistos.find(dbx)!=_dbxtkhistos.end()) {
310  _dbxtkhistos[dbx]->Fill(ntkdigi);
311  }
312  if(_dbxtkhistos.find(-1)!=_dbxtkhistos.end()) {
313  _dbxtkhistos[-1]->Fill(ntkdigi);
314  }
315 
316  if(_dbxtibhistos.find(dbx)!=_dbxtibhistos.end()) {
317  _dbxtibhistos[dbx]->Fill(ntibdigi);
318  }
319  if(_dbxtibhistos.find(-1)!=_dbxtibhistos.end()) {
320  _dbxtibhistos[-1]->Fill(ntibdigi);
321  }
322 
323  if(_dbxtidhistos.find(dbx)!=_dbxtidhistos.end()) {
324  _dbxtidhistos[dbx]->Fill(ntiddigi);
325  }
326  if(_dbxtidhistos.find(-1)!=_dbxtidhistos.end()) {
327  _dbxtidhistos[-1]->Fill(ntiddigi);
328  }
329  if(_dbxtobhistos.find(dbx)!=_dbxtobhistos.end()) {
330  _dbxtobhistos[dbx]->Fill(ntobdigi);
331  }
332  if(_dbxtobhistos.find(-1)!=_dbxtobhistos.end()) {
333  _dbxtobhistos[-1]->Fill(ntobdigi);
334  }
335  if(_dbxtechistos.find(dbx)!=_dbxtechistos.end()) {
336  _dbxtechistos[dbx]->Fill(ntecdigi);
337  }
338  if(_dbxtechistos.find(-1)!=_dbxtechistos.end()) {
339  _dbxtechistos[-1]->Fill(ntecdigi);
340  }
341  */
342  }
343  }
344  }
345 }
DigiBXCorrHistogramMaker< EventWithHistory > _digibxcorrhmevent
std::map< unsigned int, std::string > _subdets
std::map< int, std::map< unsigned int, TH1F * > > _dbxhistos
int orbitNumber() const
Definition: EventBase.h:63
const bool selected(const EventWithHistory &he, const edm::EventSetup &iSetup) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void fill(const T &he, const std::map< int, int > &ndigi, const edm::Handle< APVCyclePhaseCollection > &phase)
void MultiplicityTimeCorrelations::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 350 of file MultiplicityTimeCorrelations.cc.

References _highorbit, _loworbit, and LogDebug.

351 {
352 
353  LogDebug("IntegerDebug") << " int max and min " << INT_MIN << " " << INT_MAX;
354  LogDebug("IntegerDebug") << " uint max and min " << UINT_MAX;
355  LogDebug("IntegerDebug") << " long max and min " << LONG_MIN << " " << LONG_MAX;
356  LogDebug("IntegerDebug") << " ulong max and min " << ULONG_MAX;
357  LogDebug("IntegerDebug") << " long long max and min " << LLONG_MIN << " " << LLONG_MAX;
358  LogDebug("IntegerDebug") << " u long long max and min " << ULLONG_MAX;
359 
360 
361  edm::LogInfo("MultiplicityTimeCorrelations") << " Correlation studies performed only in the orbit # range " << _loworbit << " " << _highorbit ;
362 
363 }
#define LogDebug(id)
void MultiplicityTimeCorrelations::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 366 of file MultiplicityTimeCorrelations.cc.

References _digibxcorrhmevent, DigiBXCorrHistogramMaker< T >::beginRun(), and edm::RunBase::run().

366  {
367 
369 
370 }
RunNumber_t run() const
Definition: RunBase.h:42
DigiBXCorrHistogramMaker< EventWithHistory > _digibxcorrhmevent
void beginRun(const unsigned int nrun)
void MultiplicityTimeCorrelations::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 377 of file MultiplicityTimeCorrelations.cc.

377  {
378 }
void MultiplicityTimeCorrelations::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 373 of file MultiplicityTimeCorrelations.cc.

373  {
374 }

Member Data Documentation

edm::InputTag MultiplicityTimeCorrelations::_apvphasecoll
private

Definition at line 89 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze().

std::map<unsigned int, int> MultiplicityTimeCorrelations::_binmax
private

Definition at line 92 of file MultiplicityTimeCorrelations.cc.

Referenced by MultiplicityTimeCorrelations().

std::vector<int> MultiplicityTimeCorrelations::_dbxbins
private

Definition at line 102 of file MultiplicityTimeCorrelations.cc.

Referenced by MultiplicityTimeCorrelations().

std::map<int,std::map<unsigned int,TH1F*> > MultiplicityTimeCorrelations::_dbxhistos
private

Definition at line 79 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and MultiplicityTimeCorrelations().

DigiBXCorrHistogramMaker<EventWithHistory> MultiplicityTimeCorrelations::_digibxcorrhmevent
private

Definition at line 76 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), beginRun(), and MultiplicityTimeCorrelations().

EventWithHistoryFilter MultiplicityTimeCorrelations::_evfilter
private

Definition at line 77 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and MultiplicityTimeCorrelations().

edm::InputTag MultiplicityTimeCorrelations::_hecollection
private

Definition at line 88 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and MultiplicityTimeCorrelations().

int MultiplicityTimeCorrelations::_highorbit
private

Definition at line 95 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and beginJob().

int MultiplicityTimeCorrelations::_loworbit
private

Definition at line 94 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and beginJob().

int MultiplicityTimeCorrelations::_mindbx
private

Definition at line 97 of file MultiplicityTimeCorrelations.cc.

Referenced by MultiplicityTimeCorrelations().

int MultiplicityTimeCorrelations::_mintrpltdbx
private

Definition at line 98 of file MultiplicityTimeCorrelations.cc.

Referenced by MultiplicityTimeCorrelations().

edm::InputTag MultiplicityTimeCorrelations::_multiplicityMap
private

Definition at line 90 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze().

std::map<unsigned int, std::string> MultiplicityTimeCorrelations::_subdets
private

Definition at line 91 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and MultiplicityTimeCorrelations().

SiStripTKNumbers MultiplicityTimeCorrelations::_trnumb
private

Definition at line 100 of file MultiplicityTimeCorrelations.cc.

Referenced by MultiplicityTimeCorrelations().