CMS 3D CMS Logo

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

#include <EBTriggerTowerTask.h>

Inheritance diagram for EBTriggerTowerTask:
edm::EDAnalyzer

Public Member Functions

 EBTriggerTowerTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EBTriggerTowerTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Static Public Attributes

static const int nSM = 36
 number of supermodules More...
 
static const int nTTEta = 17
 number of trigger towers in eta More...
 
static const int nTTPhi = 4
 number of trigger towers in phi More...
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void cleanup (void)
 Cleanup. More...
 
void endJob (void)
 EndJob. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun. More...
 
void reset (void)
 Reset. More...
 
void setup (void)
 Setup. More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Types

typedef std::vector
< MonitorElement * > 
array1
 1D array More...
 

Private Member Functions

void processDigis (const edm::Event &e, const edm::Handle< EcalTrigPrimDigiCollection > &digis, array1 &meEtMap, array1 &meVeto, const edm::Handle< EcalTrigPrimDigiCollection > &compDigis=edm::Handle< EcalTrigPrimDigiCollection >(), const edm::Handle< edm::TriggerResults > &hltResults=edm::Handle< edm::TriggerResults >())
 process a collection of digis, either real or emulated More...
 
void reserveArray (array1 &array)
 reserve an array to hold one histogram per supermodule More...
 
void setup (std::string const &nameext, std::string const &folder, bool emulated)
 book monitor elements for real, or emulated digis More...
 

Private Attributes

DQMStoredqmStore_
 DQM back-end interface. More...
 
edm::InputTag EBDigiCollection_
 to find the input collection of crystal digis More...
 
edm::InputTag emulCollection_
 to find the input collection of emulated digis More...
 
bool enableCleanup_
 remove MEs More...
 
std::string HLTCaloHLTBit_
 
std::string HLTMuonHLTBit_
 
edm::InputTag HLTResultsCollection_
 to find the input collection of HLT bits More...
 
int ievt_
 local event counter More...
 
bool init_
 init flag More...
 
array1 meEmulError_
 
array1 meEmulMatch_
 
MonitorElementmeEmulMatchIndex1D_
 1D emulator match 1D More...
 
MonitorElementmeEmulMatchMaxIndex1D_
 
MonitorElementmeEtBxReal_
 number and ET average of TP vs bx More...
 
array1 meEtMapEmul_
 Emulated Et vs ix vs iy, for each SM. More...
 
array1 meEtMapReal_
 Et vs ix vs iy, for each SM. More...
 
MonitorElementmeEtSpectrumEmul_
 
MonitorElementmeEtSpectrumEmulMax_
 
MonitorElementmeEtSpectrumReal_
 ET spectrums for the whole EB. More...
 
MonitorElementmeOccupancyBxReal_
 
bool mergeRuns_
 merge MEs across runs More...
 
MonitorElementmeTCCTimingCalo_
 TCC timing. More...
 
MonitorElementmeTCCTimingMuon_
 
array1 meVetoEmul_
 Emulated fine grain veto vs iphi vs ieta, for each SM. More...
 
array1 meVetoEmulError_
 
array1 meVetoReal_
 fine grain veto vs iphi vs ieta, for each SM More...
 
std::string outputFile_
 debug output root file. if empty, no output file created. More...
 
std::string prefixME_
 path to MEs More...
 
edm::InputTag realCollection_
 to find the input collection of real digis More...
 

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)
 

Detailed Description

Definition at line 23 of file EBTriggerTowerTask.h.

Member Typedef Documentation

typedef std::vector<MonitorElement*> EBTriggerTowerTask::array1
private

1D array

Definition at line 72 of file EBTriggerTowerTask.h.

Constructor & Destructor Documentation

EBTriggerTowerTask::EBTriggerTowerTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 27 of file EBTriggerTowerTask.cc.

References dqmStore_, EBDigiCollection_, emulCollection_, enableCleanup_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLTCaloHLTBit_, HLTMuonHLTBit_, HLTResultsCollection_, init_, LogDebug, meEmulError_, meEmulMatch_, meEmulMatchIndex1D_, meEmulMatchMaxIndex1D_, meEtBxReal_, meEtMapEmul_, meEtMapReal_, meEtSpectrumEmul_, meEtSpectrumEmulMax_, meEtSpectrumReal_, meOccupancyBxReal_, mergeRuns_, meTCCTimingCalo_, meTCCTimingMuon_, meVetoEmul_, meVetoEmulError_, meVetoReal_, cmsCodeRules.cppFunctionSkipper::operator, outputFile_, prefixME_, realCollection_, and reserveArray().

27  {
28 
29  init_ = false;
30 
32 
33  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
34 
35  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
36 
37  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
38 
42  meEtBxReal_ = 0;
44  meTCCTimingCalo_ = 0;
45  meTCCTimingMuon_ = 0;
48 
56 
57  realCollection_ = ps.getParameter<edm::InputTag>("EcalTrigPrimDigiCollectionReal");
58  emulCollection_ = ps.getParameter<edm::InputTag>("EcalTrigPrimDigiCollectionEmul");
59  EBDigiCollection_ = ps.getParameter<edm::InputTag>("EBDigiCollection");
60  HLTResultsCollection_ = ps.getParameter<edm::InputTag>("HLTResultsCollection");
61 
62  HLTCaloHLTBit_ = ps.getUntrackedParameter<std::string>("HLTCaloHLTBit", "");
63  HLTMuonHLTBit_ = ps.getUntrackedParameter<std::string>("HLTMuonHLTBit", "");
64 
65  outputFile_ = ps.getUntrackedParameter<std::string>("OutputRootFile", "");
66 
67  LogDebug("EBTriggerTowerTask") << "REAL digis: " << realCollection_;
68  LogDebug("EBTriggerTowerTask") << "EMULATED digis: " << emulCollection_;
69 
70 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag realCollection_
to find the input collection of real digis
MonitorElement * meEtSpectrumReal_
ET spectrums for the whole EB.
edm::InputTag HLTResultsCollection_
to find the input collection of HLT bits
bool enableCleanup_
remove MEs
std::string outputFile_
debug output root file. if empty, no output file created.
bool mergeRuns_
merge MEs across runs
MonitorElement * meEmulMatchMaxIndex1D_
edm::InputTag emulCollection_
to find the input collection of emulated digis
array1 meVetoReal_
fine grain veto vs iphi vs ieta, for each SM
MonitorElement * meEtBxReal_
number and ET average of TP vs bx
array1 meEtMapEmul_
Emulated Et vs ix vs iy, for each SM.
edm::InputTag EBDigiCollection_
to find the input collection of crystal digis
array1 meEtMapReal_
Et vs ix vs iy, for each SM.
MonitorElement * meTCCTimingMuon_
void reserveArray(array1 &array)
reserve an array to hold one histogram per supermodule
std::string prefixME_
path to MEs
DQMStore * dqmStore_
DQM back-end interface.
MonitorElement * meEmulMatchIndex1D_
1D emulator match 1D
array1 meVetoEmul_
Emulated fine grain veto vs iphi vs ieta, for each SM.
MonitorElement * meOccupancyBxReal_
MonitorElement * meEtSpectrumEmulMax_
MonitorElement * meTCCTimingCalo_
TCC timing.
MonitorElement * meEtSpectrumEmul_
EBTriggerTowerTask::~EBTriggerTowerTask ( )
virtual

Destructor.

Definition at line 72 of file EBTriggerTowerTask.cc.

72  {
73 
74 }

Member Function Documentation

void EBTriggerTowerTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 278 of file EBTriggerTowerTask.cc.

References emulCollection_, edm::Event::getByLabel(), JetPDSkim_cfg::hltResults, HLTResultsCollection_, ievt_, init_, edm::InputTag::instance(), edm::InputTag::label(), LogDebug, meEtMapEmul_, meEtMapReal_, meVetoEmul_, meVetoReal_, processDigis(), realCollection_, and setup().

278  {
279 
280  if ( ! init_ ) this->setup();
281 
282  ievt_++;
283 
285 
286  if ( e.getByLabel(realCollection_, realDigis) ) {
287 
288  int nebtpd = realDigis->size();
289  LogDebug("EBTriggerTowerTask") << "event " << ievt_ <<" trigger primitive digi collection size: " << nebtpd;
290 
291  processDigis( e,
292  realDigis,
293  meEtMapReal_,
294  meVetoReal_);
295 
296  } else {
297  edm::LogWarning("EBTriggerTowerTask") << realCollection_ << " not available";
298  }
299 
301 
302  if ( e.getByLabel(emulCollection_, emulDigis) ) {
303 
305 
306  if ( !e.getByLabel(HLTResultsCollection_, hltResults) ) {
308  }
309 
310  if ( !e.getByLabel(HLTResultsCollection_, hltResults) ) {
312  }
313 
314  if ( e.getByLabel(HLTResultsCollection_, hltResults) ) {
315 
316  processDigis( e,
317  emulDigis,
318  meEtMapEmul_,
319  meVetoEmul_,
320  realDigis,
321  hltResults);
322 
323  } else {
324  edm::LogWarning("EBTriggerTowerTask") << HLTResultsCollection_ << " not available";
325  }
326 
327  } else {
328  edm::LogInfo("EBTriggerTowerTask") << emulCollection_ << " not available";
329  }
330 
331 }
#define LogDebug(id)
void setup(void)
Setup.
edm::InputTag realCollection_
to find the input collection of real digis
edm::InputTag HLTResultsCollection_
to find the input collection of HLT bits
void processDigis(const edm::Event &e, const edm::Handle< EcalTrigPrimDigiCollection > &digis, array1 &meEtMap, array1 &meVeto, const edm::Handle< EcalTrigPrimDigiCollection > &compDigis=edm::Handle< EcalTrigPrimDigiCollection >(), const edm::Handle< edm::TriggerResults > &hltResults=edm::Handle< edm::TriggerResults >())
process a collection of digis, either real or emulated
edm::InputTag emulCollection_
to find the input collection of emulated digis
array1 meVetoReal_
fine grain veto vs iphi vs ieta, for each SM
array1 meEtMapEmul_
Emulated Et vs ix vs iy, for each SM.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
int ievt_
local event counter
array1 meEtMapReal_
Et vs ix vs iy, for each SM.
std::string const & label() const
Definition: InputTag.h:25
array1 meVetoEmul_
Emulated fine grain veto vs iphi vs ieta, for each SM.
std::string const & instance() const
Definition: InputTag.h:26
void EBTriggerTowerTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 83 of file EBTriggerTowerTask.cc.

References dqmStore_, ievt_, prefixME_, DQMStore::rmdir(), and DQMStore::setCurrentFolder().

83  {
84 
85  ievt_ = 0;
86 
87  if ( dqmStore_ ) {
88  dqmStore_->setCurrentFolder(prefixME_ + "/EBTriggerTowerTask");
89  dqmStore_->rmdir(prefixME_ + "/EBTriggerTowerTask");
90  }
91 
92 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2311
int ievt_
local event counter
std::string prefixME_
path to MEs
DQMStore * dqmStore_
DQM back-end interface.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void EBTriggerTowerTask::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 94 of file EBTriggerTowerTask.cc.

References Numbers::initGeometry(), mergeRuns_, and reset().

94  {
95 
96  Numbers::initGeometry(c, false);
97 
98  if ( ! mergeRuns_ ) this->reset();
99 
100 }
bool mergeRuns_
merge MEs across runs
void reset(void)
Reset.
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:45
void EBTriggerTowerTask::cleanup ( void  )
protected

Cleanup.

Definition at line 254 of file EBTriggerTowerTask.cc.

References dqmStore_, init_, outputFile_, prefixME_, DQMStore::rmdir(), and DQMStore::save().

Referenced by endJob().

254  {
255 
256  if ( ! init_ ) return;
257 
258  if ( dqmStore_ ) {
259 
260  if ( !outputFile_.empty() ) dqmStore_->save( outputFile_.c_str() );
261 
262  dqmStore_->rmdir( prefixME_ + "/EBTriggerTowerTask" );
263 
264  }
265 
266  init_ = false;
267 
268 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2311
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1898
std::string outputFile_
debug output root file. if empty, no output file created.
std::string prefixME_
path to MEs
DQMStore * dqmStore_
DQM back-end interface.
void EBTriggerTowerTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 270 of file EBTriggerTowerTask.cc.

References cleanup(), enableCleanup_, and ievt_.

270  {
271 
272  edm::LogInfo("EBTriggerTowerTask") << "analyzed " << ievt_ << " events";
273 
274  if ( enableCleanup_ ) this->cleanup();
275 
276 }
bool enableCleanup_
remove MEs
int ievt_
local event counter
void cleanup(void)
Cleanup.
void EBTriggerTowerTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 102 of file EBTriggerTowerTask.cc.

102  {
103 
104 }
void EBTriggerTowerTask::processDigis ( const edm::Event e,
const edm::Handle< EcalTrigPrimDigiCollection > &  digis,
array1 meEtMap,
array1 meVeto,
const edm::Handle< EcalTrigPrimDigiCollection > &  compDigis = edm::Handle<EcalTrigPrimDigiCollection>(),
const edm::Handle< edm::TriggerResults > &  hltResults = edm::Handle<edm::TriggerResults>() 
)
private

process a collection of digis, either real or emulated

Definition at line 334 of file EBTriggerTowerTask.cc.

References abs, accept(), edm::EventBase::bunchCrossing(), EBDigiCollection_, EcalBarrel, MonitorElement::Fill(), edm::Event::getByLabel(), HLTCaloHLTBit_, HLTMuonHLTBit_, getHLTprescales::index, Numbers::iSM(), edm::HandleBase::isValid(), Numbers::iTCC(), Numbers::iTT(), j, meEmulError_, meEmulMatch_, meEmulMatchIndex1D_, meEmulMatchMaxIndex1D_, meEtBxReal_, meEtSpectrumEmul_, meEtSpectrumEmulMax_, meEtSpectrumReal_, meOccupancyBxReal_, meTCCTimingCalo_, meTCCTimingMuon_, meVetoEmulError_, Numbers::subDet(), edm::TriggerNames::triggerName(), and edm::Event::triggerNames().

Referenced by analyze().

338  {
339 
340  int bx = e.bunchCrossing();
341  int nTP = 0;
342 
343  // map<EcalTrigTowerDetId, int> crystalsInTower;
344  int readoutCrystalsInTower[108][68];
345  for (int itcc = 0; itcc < 108; itcc++) {
346  for (int itt = 0; itt < 68; itt++) readoutCrystalsInTower[itcc][itt] = 0;
347  }
348 
349  if ( compDigis.isValid() ) {
350 
351  edm::Handle<EBDigiCollection> crystalDigis;
352 
353  if ( e.getByLabel(EBDigiCollection_, crystalDigis) ) {
354 
355  for ( EBDigiCollection::const_iterator cDigiItr = crystalDigis->begin(); cDigiItr != crystalDigis->end(); ++cDigiItr ) {
356 
357  EBDetId id = cDigiItr->id();
358  EcalTrigTowerDetId towid = id.tower();
359 
360  int itcc = Numbers::iTCC( towid );
361  int itt = Numbers::iTT( towid );
362 
363  readoutCrystalsInTower[itcc-1][itt-1]++;
364 
365  }
366 
367  } else {
368  edm::LogWarning("EBTriggerTowerTask") << EBDigiCollection_ << " not available";
369  }
370 
371  }
372 
373  bool caloTrg = false;
374  bool muonTrg = false;
375 
376  if ( hltResults.isValid() ) {
377 
378  int ntrigs = hltResults->size();
379  if ( ntrigs!=0 ) {
380 
381  const edm::TriggerNames & triggerNames = e.triggerNames(*hltResults);
382 
383  for ( int itrig = 0; itrig != ntrigs; ++itrig ) {
384  std::string trigName = triggerNames.triggerName(itrig);
385  bool accept = hltResults->accept(itrig);
386 
387  if ( trigName == HLTCaloHLTBit_ ) caloTrg = accept;
388 
389  if ( trigName == HLTMuonHLTBit_ ) muonTrg = accept;
390 
391  }
392 
393  } else {
394  edm::LogWarning("EBTriggerTowerTask") << " zero size trigger names in input TriggerResults";
395  }
396 
397  }
398 
399  for ( EcalTrigPrimDigiCollection::const_iterator tpdigiItr = digis->begin(); tpdigiItr != digis->end(); ++tpdigiItr ) {
400 
401  if ( Numbers::subDet( tpdigiItr->id() ) != EcalBarrel ) continue;
402 
403  int ismt = Numbers::iSM( tpdigiItr->id() );
404 
405  int iet = std::abs(tpdigiItr->id().ieta());
406  int ipt = tpdigiItr->id().iphi();
407 
408  // phi_tower: change the range from global to SM-local
409  // phi==0 is in the middle of a SM
410  ipt = ipt + 2;
411  if ( ipt > 72 ) ipt = ipt - 72;
412  ipt = (ipt-1)%4 + 1;
413 
414  // phi_tower: SM-local phi runs opposite to global in EB+
415  if ( tpdigiItr->id().zside() > 0 ) ipt = 5 - ipt;
416 
417  float xiet = iet-0.5;
418  float xipt = ipt-0.5;
419 
420  int itt = Numbers::iTT( tpdigiItr->id() );
421  int itcc = Numbers::iTCC( tpdigiItr->id() );
422 
423  float xvalEt = tpdigiItr->compressedEt();
424  float xvalVeto = 0.5 + tpdigiItr->fineGrain();
425 
426  bool good = true;
427  bool goodVeto = true;
428 
429  int compDigiInterest = -1;
430 
431  bool matchSample[6];
432  for (int j=0; j<6; j++) matchSample[j]=false;
433 
434  if ( compDigis.isValid() ) {
435 
436  if ( meEtSpectrumEmul_ ) meEtSpectrumEmul_->Fill( xvalEt );
437 
438  float maxEt = 0;
439  int maxTPIndex = -1;
440  for (int j=0; j<5; j++) {
441  float EtTP = (*tpdigiItr)[j].compressedEt();
442  if ( EtTP > maxEt ) {
443  maxEt = EtTP;
444  maxTPIndex = j+1;
445  }
446  }
447 
449  if ( meEmulMatchMaxIndex1D_ && maxEt > 0 ) meEmulMatchMaxIndex1D_->Fill( maxTPIndex );
450 
451  EcalTrigPrimDigiCollection::const_iterator compDigiItr = compDigis->find( tpdigiItr->id().rawId() );
452  if ( compDigiItr != compDigis->end() ) {
453  int compDigiEt = compDigiItr->compressedEt();
454  compDigiInterest = (compDigiItr->ttFlag() & 0x3);
455 
456  if ( compDigiEt > 0 ) nTP++;
457  if ( meEtSpectrumReal_ ) meEtSpectrumReal_->Fill( compDigiEt );
458  if ( meEtBxReal_ && compDigiEt > 0 ) meEtBxReal_->Fill( bx, compDigiEt );
459 
460  // compare the 5 TPs with different time-windows
461  // sample 0 means no match, 1-5: sample of the TP that matches
462  matchSample[0]=false;
463  bool matchedAny=false;
464 
465  for (int j=0; j<5; j++) {
466  if ((*tpdigiItr)[j].compressedEt() == compDigiEt ) {
467  matchSample[j+1]=true;
468  matchedAny=true;
469  } else {
470  matchSample[j+1]=false;
471  }
472  }
473 
474  if (!matchedAny) matchSample[0]=true;
475 
476  // check if the tower has been readout completely and if it is medium or high interest
477  if (readoutCrystalsInTower[itcc-1][itt-1] == 25 &&
478  (compDigiInterest == 1 || compDigiInterest == 3) && compDigiEt > 0) {
479 
480  if ( tpdigiItr->compressedEt() != compDigiEt ) {
481  good = false;
482  }
483  if ( tpdigiItr->fineGrain() != compDigiItr->fineGrain() ) {
484  goodVeto = false;
485  }
486 
487  for (int j=0; j<6; j++) {
488  if (matchSample[j]) {
489 
490  int index = ( j==0 ) ? -1 : j;
491 
492  meEmulMatchIndex1D_->Fill(index+0.5);
493 
494  meEmulMatch_[ismt-1]->Fill(xiet, xipt, j+0.5);
495  if ( meTCCTimingCalo_ && caloTrg ) meTCCTimingCalo_->Fill( itcc, index+0.5 );
496  if ( meTCCTimingMuon_ && muonTrg ) meTCCTimingMuon_->Fill( itcc, index+0.5 );
497 
498  }
499  }
500 
501  } // check readout
502 
503  } else {
504  good = false;
505  goodVeto = false;
506  }
507 
508  if (!good ) {
509  if ( meEmulError_[ismt-1] ) meEmulError_[ismt-1]->Fill(xiet, xipt);
510  }
511  if (!goodVeto) {
512  if ( meVetoEmulError_[ismt-1] ) meVetoEmulError_[ismt-1]->Fill(xiet, xipt);
513  }
514 
515  } // compDigis.isValid
516 
517  if ( meEtMap[ismt-1] ) meEtMap[ismt-1]->Fill(xiet, xipt, xvalEt);
518  if ( meVeto[ismt-1] ) meVeto[ismt-1]->Fill(xiet, xipt, xvalVeto);
519 
520  } // loop on TP
521 
522  if ( meOccupancyBxReal_ ) meOccupancyBxReal_->Fill( bx, nTP );
523 
524 }
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:208
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
std::vector< T >::const_iterator const_iterator
int bunchCrossing() const
Definition: EventBase.h:62
#define abs(x)
Definition: mlp_lapack.h:159
MonitorElement * meEtSpectrumReal_
ET spectrums for the whole EB.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:21
static int iTCC(const int ism, const EcalSubdetector subdet, const int i1, const int i2)
Definition: Numbers.cc:621
static int iTT(const int ism, const EcalSubdetector subdet, const int i1, const int i2)
Definition: Numbers.cc:526
void Fill(long long x)
static int iSM(const int ism, const EcalSubdetector subdet)
Definition: Numbers.cc:222
MonitorElement * meEmulMatchMaxIndex1D_
int j
Definition: DBlmapReader.cc:9
MonitorElement * meEtBxReal_
number and ET average of TP vs bx
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
edm::InputTag EBDigiCollection_
to find the input collection of crystal digis
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
MonitorElement * meTCCTimingMuon_
MonitorElement * meEmulMatchIndex1D_
1D emulator match 1D
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:136
MonitorElement * meOccupancyBxReal_
MonitorElement * meEtSpectrumEmulMax_
MonitorElement * meTCCTimingCalo_
TCC timing.
MonitorElement * meEtSpectrumEmul_
void EBTriggerTowerTask::reserveArray ( array1 array)
private

reserve an array to hold one histogram per supermodule

Definition at line 76 of file EBTriggerTowerTask.cc.

References nSM.

Referenced by EBTriggerTowerTask().

76  {
77 
78  array.reserve( nSM );
79  array.resize( nSM, static_cast<MonitorElement*>(0) );
80 
81 }
static const int nSM
number of supermodules
void EBTriggerTowerTask::reset ( void  )
protected

Reset.

Definition at line 106 of file EBTriggerTowerTask.cc.

References i, meEmulError_, meEmulMatch_, meEmulMatchIndex1D_, meEmulMatchMaxIndex1D_, meEtBxReal_, meEtMapEmul_, meEtMapReal_, meEtSpectrumEmul_, meEtSpectrumEmulMax_, meEtSpectrumReal_, meOccupancyBxReal_, meTCCTimingCalo_, meTCCTimingMuon_, meVetoEmul_, meVetoEmulError_, meVetoReal_, and MonitorElement::Reset().

Referenced by beginRun().

106  {
107 
111  if ( meEtBxReal_ ) meEtBxReal_->Reset();
117 
118  for (int i = 0; i < 36; i++) {
119 
120  if ( meEtMapReal_[i] ) meEtMapReal_[i]->Reset();
121  if ( meVetoReal_[i] ) meVetoReal_[i]->Reset();
122  if ( meEtMapEmul_[i] ) meEtMapEmul_[i]->Reset();
123  if ( meVetoEmul_[i] ) meVetoEmul_[i]->Reset();
124  if ( meEmulError_[i] ) meEmulError_[i]->Reset();
125  if ( meEmulMatch_[i] ) meEmulMatch_[i]->Reset();
126  if ( meVetoEmulError_[i] ) meVetoEmulError_[i]->Reset();
127 
128  }
129 
130 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEtSpectrumReal_
ET spectrums for the whole EB.
MonitorElement * meEmulMatchMaxIndex1D_
array1 meVetoReal_
fine grain veto vs iphi vs ieta, for each SM
MonitorElement * meEtBxReal_
number and ET average of TP vs bx
array1 meEtMapEmul_
Emulated Et vs ix vs iy, for each SM.
array1 meEtMapReal_
Et vs ix vs iy, for each SM.
MonitorElement * meTCCTimingMuon_
MonitorElement * meEmulMatchIndex1D_
1D emulator match 1D
array1 meVetoEmul_
Emulated fine grain veto vs iphi vs ieta, for each SM.
MonitorElement * meOccupancyBxReal_
MonitorElement * meEtSpectrumEmulMax_
void Reset(void)
reset ME (ie. contents, errors, etc)
MonitorElement * meTCCTimingCalo_
TCC timing.
MonitorElement * meEtSpectrumEmul_
void EBTriggerTowerTask::setup ( void  )
protected

Setup.

Definition at line 132 of file EBTriggerTowerTask.cc.

References dqmStore_, init_, and prefixME_.

Referenced by analyze().

132  {
133 
134  init_ = true;
135 
136  if ( dqmStore_ ) {
137  setup( "Real Digis",
138  (prefixME_ + "/EBTriggerTowerTask").c_str(), false );
139 
140  setup( "Emulated Digis",
141  (prefixME_ + "/EBTriggerTowerTask/Emulated").c_str(), true);
142  }
143  else {
144  edm::LogError("EBTriggerTowerTask") << "Bad DQMStore, cannot book MonitorElements.";
145  }
146 }
void setup(void)
Setup.
std::string prefixME_
path to MEs
DQMStore * dqmStore_
DQM back-end interface.
void EBTriggerTowerTask::setup ( std::string const &  nameext,
std::string const &  folder,
bool  emulated 
)
private

book monitor elements for real, or emulated digis

Definition at line 148 of file EBTriggerTowerTask.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::book3D(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), dqmStore_, HLTCaloHLTBit_, HLTMuonHLTBit_, i, meEmulError_, meEmulMatch_, meEmulMatchIndex1D_, meEmulMatchMaxIndex1D_, meEtBxReal_, meEtMapEmul_, meEtMapReal_, meEtSpectrumEmul_, meEtSpectrumEmulMax_, meEtSpectrumReal_, meOccupancyBxReal_, meTCCTimingCalo_, meTCCTimingMuon_, meVetoEmul_, meVetoEmulError_, meVetoReal_, mergeVDriftHistosByStation::name, nTTEta, nTTPhi, Numbers::sEB(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), DQMStore::tag(), and fw3dlego::xbins.

150  {
151 
152  array1* meEtMap = &meEtMapReal_;
153  array1* meVeto = &meVetoReal_;
154 
155  if ( emulated ) {
156  meEtMap = &meEtMapEmul_;
157  meVeto = &meVetoEmul_;
158  }
159 
160  dqmStore_->setCurrentFolder(folder);
161 
162  std::string name;
163 
164  if (!emulated) {
165  name = "EBTTT Et spectrum " + nameext;
166  meEtSpectrumReal_ = dqmStore_->book1D(name, name, 256, 0., 256.);
167  meEtSpectrumReal_->setAxisTitle("energy (ADC)", 1);
168 
169  name = "EBTTT TP matching index";
170  meEmulMatchIndex1D_ = dqmStore_->book1D(name, name, 7, -1., 6.);
171  meEmulMatchIndex1D_->setAxisTitle("TP data matching emulator", 1);
172 
173  name = "EBTTT max TP matching index";
174  meEmulMatchMaxIndex1D_ = dqmStore_->book1D(name, name, 7, -1., 6.);
175  meEmulMatchMaxIndex1D_->setAxisTitle("Max TP data matching emulator", 1);
176 
177  double xbins[51];
178  for ( int i=0; i<=11; i++ ) xbins[i] = i-1; // begin of orbit
179  // abort gap in presence of calibration: [3381-3500]
180  // abort gap in absence of calibration: [3444-3500]
181  // using the wider abort gap always, start finer binning at bx=3371
182  for ( int i=12; i<=22; i++) xbins[i] = 3371+i-12;
183  // use 29 bins for the abort gap
184  for ( int i=23; i<=50; i++) xbins[i] = 3382+(i-23)*6;
185 
186  name = "EBTTT Et vs bx " + nameext;
187  meEtBxReal_ = dqmStore_->bookProfile(name, name, 50, xbins, 256, 0, 256);
188  meEtBxReal_->setAxisTitle("bunch crossing", 1);
189  meEtBxReal_->setAxisTitle("energy (ADC)", 2);
190 
191  name = "EBTTT TP occupancy vs bx " + nameext;
192  meOccupancyBxReal_ = dqmStore_->bookProfile(name, name, 50, xbins, 2448, 0, 2448);
193  meOccupancyBxReal_->setAxisTitle("bunch crossing", 1);
194  meOccupancyBxReal_->setAxisTitle("TP number", 2);
195 
196  if ( HLTCaloHLTBit_ != "" ) {
197  name = "EBTTT TCC timing calo triggers " + nameext;
198  meTCCTimingCalo_ = dqmStore_->book2D(name, name, 36, 37, 73, 7, -1., 6.);
199  meTCCTimingCalo_->setAxisTitle("nTCC", 1);
200  meTCCTimingCalo_->setAxisTitle("TP data matching emulator", 2);
201  }
202 
203  if ( HLTMuonHLTBit_ != "" ) {
204  name = "EBTTT TCC timing muon triggers " + nameext;
205  meTCCTimingMuon_ = dqmStore_->book2D(name, name, 36, 37, 73, 7, -1., 6.);
206  meTCCTimingMuon_->setAxisTitle("nTCC", 1);
207  meTCCTimingMuon_->setAxisTitle("TP data matching emulator", 2);
208  }
209 
210  } else {
211  name = "EBTTT Et spectrum " + nameext;
212  meEtSpectrumEmul_ = dqmStore_->book1D(name, name, 256, 0., 256.);
213  meEtSpectrumEmul_->setAxisTitle("energy (ADC)", 1);
214 
215  name = "EBTTT Et spectrum " + nameext + " max";
216  meEtSpectrumEmulMax_ = dqmStore_->book1D(name, name, 256, 0., 256.);
217  meEtSpectrumEmulMax_->setAxisTitle("energy (ADC)", 1);
218  }
219 
220  for (int i = 0; i < 36; i++) {
221 
222  name = "EBTTT Et map " + nameext + " " + Numbers::sEB(i+1);
223  (*meEtMap)[i] = dqmStore_->bookProfile2D(name, name, nTTEta, 0, nTTEta, nTTPhi, 0, nTTPhi, 256, 0, 256.);
224  (*meEtMap)[i]->setAxisTitle("ieta'", 1);
225  (*meEtMap)[i]->setAxisTitle("iphi'", 2);
226  dqmStore_->tag((*meEtMap)[i], i+1);
227 
228  if (!emulated) {
229 
230  name = "EBTTT EmulError " + Numbers::sEB(i+1);
231  meEmulError_[i] = dqmStore_->book2D(name, name, nTTEta, 0., nTTEta, nTTPhi, 0., nTTPhi );
232  meEmulError_[i]->setAxisTitle("ieta'", 1);
233  meEmulError_[i]->setAxisTitle("iphi'", 2);
234  dqmStore_->tag(meEmulError_[i], i+1);
235 
236  name = "EBTTT EmulMatch " + Numbers::sEB(i+1);
237  meEmulMatch_[i] = dqmStore_->book3D(name, name, nTTEta, 0., nTTEta, nTTPhi, 0., nTTPhi, 6, 0., 6.);
238  meEmulMatch_[i]->setAxisTitle("ieta'", 1);
239  meEmulMatch_[i]->setAxisTitle("iphi'", 2);
240  meEmulMatch_[i]->setAxisTitle("TP timing", 3);
241  dqmStore_->tag(meEmulMatch_[i], i+1);
242 
243  name ="EBTTT EmulFineGrainVetoError " + Numbers::sEB(i+1);
244  meVetoEmulError_[i] = dqmStore_->book2D(name, name, nTTEta, 0., nTTEta, nTTPhi, 0., nTTPhi);
245  meVetoEmulError_[i]->setAxisTitle("ieta'", 1);
246  meVetoEmulError_[i]->setAxisTitle("iphi'", 2);
247  dqmStore_->tag(meVetoEmulError_[i], i+1);
248 
249  }
250  }
251 
252 }
int i
Definition: DBlmapReader.cc:9
static std::string sEB(const int ism)
Definition: Numbers.cc:87
static const int nTTPhi
number of trigger towers in phi
const double xbins[]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
Definition: DQMStore.cc:776
MonitorElement * meEtSpectrumReal_
ET spectrums for the whole EB.
static const int nTTEta
number of trigger towers in eta
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1151
MonitorElement * meEmulMatchMaxIndex1D_
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:828
std::vector< MonitorElement * > array1
1D array
array1 meVetoReal_
fine grain veto vs iphi vs ieta, for each SM
MonitorElement * meEtBxReal_
number and ET average of TP vs bx
array1 meEtMapEmul_
Emulated Et vs ix vs iy, for each SM.
array1 meEtMapReal_
Et vs ix vs iy, for each SM.
MonitorElement * meTCCTimingMuon_
DQMStore * dqmStore_
DQM back-end interface.
MonitorElement * meEmulMatchIndex1D_
1D emulator match 1D
array1 meVetoEmul_
Emulated fine grain veto vs iphi vs ieta, for each SM.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
MonitorElement * meOccupancyBxReal_
MonitorElement * meEtSpectrumEmulMax_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * meTCCTimingCalo_
TCC timing.
MonitorElement * meEtSpectrumEmul_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:972

Member Data Documentation

DQMStore* EBTriggerTowerTask::dqmStore_
private

DQM back-end interface.

Definition at line 120 of file EBTriggerTowerTask.h.

Referenced by beginJob(), cleanup(), EBTriggerTowerTask(), and setup().

edm::InputTag EBTriggerTowerTask::EBDigiCollection_
private

to find the input collection of crystal digis

Definition at line 138 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), and processDigis().

edm::InputTag EBTriggerTowerTask::emulCollection_
private

to find the input collection of emulated digis

Definition at line 135 of file EBTriggerTowerTask.h.

Referenced by analyze(), and EBTriggerTowerTask().

bool EBTriggerTowerTask::enableCleanup_
private

remove MEs

Definition at line 126 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), and endJob().

std::string EBTriggerTowerTask::HLTCaloHLTBit_
private

Definition at line 142 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), and setup().

std::string EBTriggerTowerTask::HLTMuonHLTBit_
private

Definition at line 143 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), and setup().

edm::InputTag EBTriggerTowerTask::HLTResultsCollection_
private

to find the input collection of HLT bits

Definition at line 141 of file EBTriggerTowerTask.h.

Referenced by analyze(), and EBTriggerTowerTask().

int EBTriggerTowerTask::ievt_
private

local event counter

Definition at line 95 of file EBTriggerTowerTask.h.

Referenced by analyze(), beginJob(), and endJob().

bool EBTriggerTowerTask::init_
private

init flag

Definition at line 117 of file EBTriggerTowerTask.h.

Referenced by analyze(), cleanup(), EBTriggerTowerTask(), and setup().

array1 EBTriggerTowerTask::meEmulError_
private

error flag vs iphi vs ieta, for each SM the error flag is set to true in case of a discrepancy between the emulator and the real data

Definition at line 112 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

array1 EBTriggerTowerTask::meEmulMatch_
private

Definition at line 113 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

MonitorElement* EBTriggerTowerTask::meEmulMatchIndex1D_
private

1D emulator match 1D

Definition at line 149 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

MonitorElement* EBTriggerTowerTask::meEmulMatchMaxIndex1D_
private

Definition at line 150 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

MonitorElement* EBTriggerTowerTask::meEtBxReal_
private

number and ET average of TP vs bx

Definition at line 158 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

array1 EBTriggerTowerTask::meEtMapEmul_
private

Emulated Et vs ix vs iy, for each SM.

Definition at line 104 of file EBTriggerTowerTask.h.

Referenced by analyze(), EBTriggerTowerTask(), reset(), and setup().

array1 EBTriggerTowerTask::meEtMapReal_
private

Et vs ix vs iy, for each SM.

Definition at line 98 of file EBTriggerTowerTask.h.

Referenced by analyze(), EBTriggerTowerTask(), reset(), and setup().

MonitorElement* EBTriggerTowerTask::meEtSpectrumEmul_
private

Definition at line 154 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

MonitorElement* EBTriggerTowerTask::meEtSpectrumEmulMax_
private

Definition at line 155 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

MonitorElement* EBTriggerTowerTask::meEtSpectrumReal_
private

ET spectrums for the whole EB.

Definition at line 153 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

MonitorElement* EBTriggerTowerTask::meOccupancyBxReal_
private

Definition at line 159 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

bool EBTriggerTowerTask::mergeRuns_
private

merge MEs across runs

Definition at line 129 of file EBTriggerTowerTask.h.

Referenced by beginRun(), and EBTriggerTowerTask().

MonitorElement* EBTriggerTowerTask::meTCCTimingCalo_
private

TCC timing.

Definition at line 162 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

MonitorElement* EBTriggerTowerTask::meTCCTimingMuon_
private

Definition at line 163 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

array1 EBTriggerTowerTask::meVetoEmul_
private

Emulated fine grain veto vs iphi vs ieta, for each SM.

Definition at line 107 of file EBTriggerTowerTask.h.

Referenced by analyze(), EBTriggerTowerTask(), reset(), and setup().

array1 EBTriggerTowerTask::meVetoEmulError_
private

Definition at line 114 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), processDigis(), reset(), and setup().

array1 EBTriggerTowerTask::meVetoReal_
private

fine grain veto vs iphi vs ieta, for each SM

Definition at line 101 of file EBTriggerTowerTask.h.

Referenced by analyze(), EBTriggerTowerTask(), reset(), and setup().

const int EBTriggerTowerTask::nSM = 36
static

number of supermodules

Definition at line 40 of file EBTriggerTowerTask.h.

Referenced by reserveArray().

const int EBTriggerTowerTask::nTTEta = 17
static

number of trigger towers in eta

Definition at line 34 of file EBTriggerTowerTask.h.

Referenced by setup().

const int EBTriggerTowerTask::nTTPhi = 4
static

number of trigger towers in phi

Definition at line 37 of file EBTriggerTowerTask.h.

Referenced by setup().

std::string EBTriggerTowerTask::outputFile_
private

debug output root file. if empty, no output file created.

Definition at line 146 of file EBTriggerTowerTask.h.

Referenced by cleanup(), and EBTriggerTowerTask().

std::string EBTriggerTowerTask::prefixME_
private

path to MEs

Definition at line 123 of file EBTriggerTowerTask.h.

Referenced by beginJob(), cleanup(), EBTriggerTowerTask(), and setup().

edm::InputTag EBTriggerTowerTask::realCollection_
private

to find the input collection of real digis

Definition at line 132 of file EBTriggerTowerTask.h.

Referenced by analyze(), and EBTriggerTowerTask().