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)
 
static void prevalidate (ConfigurationDescriptions &)
 

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_, 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 276 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().

276  {
277 
278  if ( ! init_ ) this->setup();
279 
280  ievt_++;
281 
283 
284  if ( e.getByLabel(realCollection_, realDigis) ) {
285 
286  int nebtpd = realDigis->size();
287  LogDebug("EBTriggerTowerTask") << "event " << ievt_ <<" trigger primitive digi collection size: " << nebtpd;
288 
289  processDigis( e,
290  realDigis,
291  meEtMapReal_,
292  meVetoReal_);
293 
294  } else {
295  edm::LogWarning("EBTriggerTowerTask") << realCollection_ << " not available";
296  }
297 
299 
300  if ( e.getByLabel(emulCollection_, emulDigis) ) {
301 
303 
304  if ( !e.getByLabel(HLTResultsCollection_, hltResults) ) {
306  }
307 
308  if ( !e.getByLabel(HLTResultsCollection_, hltResults) ) {
310  }
311 
312  if ( e.getByLabel(HLTResultsCollection_, hltResults) ) {
313 
314  processDigis( e,
315  emulDigis,
316  meEtMapEmul_,
317  meVetoEmul_,
318  realDigis,
319  hltResults);
320 
321  } else {
322  edm::LogWarning("EBTriggerTowerTask") << HLTResultsCollection_ << " not available";
323  }
324 
325  } else {
326  edm::LogInfo("EBTriggerTowerTask") << emulCollection_ << " not available";
327  }
328 
329 }
#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:356
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:2530
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:429
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:50
void EBTriggerTowerTask::cleanup ( void  )
protected

Cleanup.

Definition at line 252 of file EBTriggerTowerTask.cc.

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

Referenced by endJob().

252  {
253 
254  if ( ! init_ ) return;
255 
256  if ( dqmStore_ ) {
257 
258  if ( !outputFile_.empty() ) dqmStore_->save( outputFile_.c_str() );
259 
260  dqmStore_->rmdir( prefixME_ + "/EBTriggerTowerTask" );
261 
262  }
263 
264  init_ = false;
265 
266 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2530
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:2113
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 268 of file EBTriggerTowerTask.cc.

References cleanup(), enableCleanup_, and ievt_.

268  {
269 
270  edm::LogInfo("EBTriggerTowerTask") << "analyzed " << ievt_ << " events";
271 
272  if ( enableCleanup_ ) this->cleanup();
273 
274 }
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 332 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().

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

150  {
151 
152  array1* meEtMap = &meEtMapReal_;
153 
154  if ( emulated ) {
155  meEtMap = &meEtMapEmul_;
156  }
157 
158  dqmStore_->setCurrentFolder(folder);
159 
160  std::string name;
161 
162  if (!emulated) {
163  name = "EBTTT Et spectrum " + nameext;
164  meEtSpectrumReal_ = dqmStore_->book1D(name, name, 256, 0., 256.);
165  meEtSpectrumReal_->setAxisTitle("energy (ADC)", 1);
166 
167  name = "EBTTT TP matching index";
168  meEmulMatchIndex1D_ = dqmStore_->book1D(name, name, 7, -1., 6.);
169  meEmulMatchIndex1D_->setAxisTitle("TP data matching emulator", 1);
170 
171  name = "EBTTT max TP matching index";
172  meEmulMatchMaxIndex1D_ = dqmStore_->book1D(name, name, 7, -1., 6.);
173  meEmulMatchMaxIndex1D_->setAxisTitle("Max TP data matching emulator", 1);
174 
175  double xbins[51];
176  for ( int i=0; i<=11; i++ ) xbins[i] = i-1; // begin of orbit
177  // abort gap in presence of calibration: [3381-3500]
178  // abort gap in absence of calibration: [3444-3500]
179  // using the wider abort gap always, start finer binning at bx=3371
180  for ( int i=12; i<=22; i++) xbins[i] = 3371+i-12;
181  // use 29 bins for the abort gap
182  for ( int i=23; i<=50; i++) xbins[i] = 3382+(i-23)*6;
183 
184  name = "EBTTT Et vs bx " + nameext;
185  meEtBxReal_ = dqmStore_->bookProfile(name, name, 50, xbins, 256, 0, 256);
186  meEtBxReal_->setAxisTitle("bunch crossing", 1);
187  meEtBxReal_->setAxisTitle("energy (ADC)", 2);
188 
189  name = "EBTTT TP occupancy vs bx " + nameext;
190  meOccupancyBxReal_ = dqmStore_->bookProfile(name, name, 50, xbins, 2448, 0, 2448);
191  meOccupancyBxReal_->setAxisTitle("bunch crossing", 1);
192  meOccupancyBxReal_->setAxisTitle("TP number", 2);
193 
194  if ( HLTCaloHLTBit_ != "" ) {
195  name = "EBTTT TCC timing calo triggers " + nameext;
196  meTCCTimingCalo_ = dqmStore_->book2D(name, name, 36, 37, 73, 7, -1., 6.);
197  meTCCTimingCalo_->setAxisTitle("nTCC", 1);
198  meTCCTimingCalo_->setAxisTitle("TP data matching emulator", 2);
199  }
200 
201  if ( HLTMuonHLTBit_ != "" ) {
202  name = "EBTTT TCC timing muon triggers " + nameext;
203  meTCCTimingMuon_ = dqmStore_->book2D(name, name, 36, 37, 73, 7, -1., 6.);
204  meTCCTimingMuon_->setAxisTitle("nTCC", 1);
205  meTCCTimingMuon_->setAxisTitle("TP data matching emulator", 2);
206  }
207 
208  } else {
209  name = "EBTTT Et spectrum " + nameext;
210  meEtSpectrumEmul_ = dqmStore_->book1D(name, name, 256, 0., 256.);
211  meEtSpectrumEmul_->setAxisTitle("energy (ADC)", 1);
212 
213  name = "EBTTT Et spectrum " + nameext + " max";
214  meEtSpectrumEmulMax_ = dqmStore_->book1D(name, name, 256, 0., 256.);
215  meEtSpectrumEmulMax_->setAxisTitle("energy (ADC)", 1);
216  }
217 
218  for (int i = 0; i < 36; i++) {
219 
220  name = "EBTTT Et map " + nameext + " " + Numbers::sEB(i+1);
221  (*meEtMap)[i] = dqmStore_->bookProfile2D(name, name, nTTEta, 0, nTTEta, nTTPhi, 0, nTTPhi, 256, 0, 256.);
222  (*meEtMap)[i]->setAxisTitle("ieta'", 1);
223  (*meEtMap)[i]->setAxisTitle("iphi'", 2);
224  dqmStore_->tag((*meEtMap)[i], i+1);
225 
226  if (!emulated) {
227 
228  name = "EBTTT EmulError " + Numbers::sEB(i+1);
229  meEmulError_[i] = dqmStore_->book2D(name, name, nTTEta, 0., nTTEta, nTTPhi, 0., nTTPhi );
230  meEmulError_[i]->setAxisTitle("ieta'", 1);
231  meEmulError_[i]->setAxisTitle("iphi'", 2);
232  dqmStore_->tag(meEmulError_[i], i+1);
233 
234  name = "EBTTT EmulMatch " + Numbers::sEB(i+1);
235  meEmulMatch_[i] = dqmStore_->book3D(name, name, nTTEta, 0., nTTEta, nTTPhi, 0., nTTPhi, 6, 0., 6.);
236  meEmulMatch_[i]->setAxisTitle("ieta'", 1);
237  meEmulMatch_[i]->setAxisTitle("iphi'", 2);
238  meEmulMatch_[i]->setAxisTitle("TP timing", 3);
239  dqmStore_->tag(meEmulMatch_[i], i+1);
240 
241  name ="EBTTT EmulFineGrainVetoError " + Numbers::sEB(i+1);
242  meVetoEmulError_[i] = dqmStore_->book2D(name, name, nTTEta, 0., nTTEta, nTTPhi, 0., nTTPhi);
243  meVetoEmulError_[i]->setAxisTitle("ieta'", 1);
244  meVetoEmulError_[i]->setAxisTitle("iphi'", 2);
245  dqmStore_->tag(meVetoEmulError_[i], i+1);
246 
247  }
248  }
249 
250 }
int i
Definition: DBlmapReader.cc:9
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:717
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:979
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
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:1354
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:1031
std::vector< MonitorElement * > array1
1D array
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
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:845
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:429
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:1175

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(), and reset().

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(), and reset().

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().