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 edm::EDConsumerBase

Public Member Functions

 MultiplicityTimeCorrelations (const edm::ParameterSet &)
 
 ~MultiplicityTimeCorrelations ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

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
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 116 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(), tablePrinter::labels, LogDebug, TFileDirectory::make(), TFileService::mkdir(), SiStripTKNumbers::nstrips(), EventWithHistoryFilter::set(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 234 of file MultiplicityTimeCorrelations.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 249 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().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 349 of file MultiplicityTimeCorrelations.cc.

References _highorbit, _loworbit, and LogDebug.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 365 of file MultiplicityTimeCorrelations.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 372 of file MultiplicityTimeCorrelations.cc.

372  {
373 }

Member Data Documentation

edm::InputTag MultiplicityTimeCorrelations::_apvphasecoll
private

Definition at line 88 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze().

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

Definition at line 91 of file MultiplicityTimeCorrelations.cc.

Referenced by MultiplicityTimeCorrelations().

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

Definition at line 101 of file MultiplicityTimeCorrelations.cc.

Referenced by MultiplicityTimeCorrelations().

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

Definition at line 78 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and MultiplicityTimeCorrelations().

DigiBXCorrHistogramMaker<EventWithHistory> MultiplicityTimeCorrelations::_digibxcorrhmevent
private

Definition at line 75 of file MultiplicityTimeCorrelations.cc.

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

EventWithHistoryFilter MultiplicityTimeCorrelations::_evfilter
private

Definition at line 76 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and MultiplicityTimeCorrelations().

edm::InputTag MultiplicityTimeCorrelations::_hecollection
private

Definition at line 87 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and MultiplicityTimeCorrelations().

int MultiplicityTimeCorrelations::_highorbit
private

Definition at line 94 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and beginJob().

int MultiplicityTimeCorrelations::_loworbit
private

Definition at line 93 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and beginJob().

int MultiplicityTimeCorrelations::_mindbx
private

Definition at line 96 of file MultiplicityTimeCorrelations.cc.

Referenced by MultiplicityTimeCorrelations().

int MultiplicityTimeCorrelations::_mintrpltdbx
private

Definition at line 97 of file MultiplicityTimeCorrelations.cc.

Referenced by MultiplicityTimeCorrelations().

edm::InputTag MultiplicityTimeCorrelations::_multiplicityMap
private

Definition at line 89 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze().

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

Definition at line 90 of file MultiplicityTimeCorrelations.cc.

Referenced by analyze(), and MultiplicityTimeCorrelations().

SiStripTKNumbers MultiplicityTimeCorrelations::_trnumb
private

Definition at line 99 of file MultiplicityTimeCorrelations.cc.

Referenced by MultiplicityTimeCorrelations().