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

Public Member Functions

 EBTriggerTowerTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EBTriggerTowerTask ()
 Destructor. More...
 
- 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 ()
 

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::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)
 

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::EDGetTokenT
< EBDigiCollection
EBDigiCollection_
 to find the input collection of crystal digis More...
 
edm::EDGetTokenT
< EcalTrigPrimDigiCollection
emulCollection_
 to find the input collection of emulated digis More...
 
bool enableCleanup_
 remove MEs More...
 
std::string HLTCaloHLTBit_
 
std::string HLTMuonHLTBit_
 
edm::EDGetTokenT
< edm::TriggerResults
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::EDGetTokenT
< EcalTrigPrimDigiCollection
realCollection_
 to find the input collection of real digis More...
 

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 &)
 

Detailed Description

Definition at line 22 of file EBTriggerTowerTask.h.

Member Typedef Documentation

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

1D array

Definition at line 71 of file EBTriggerTowerTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 24 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_, reserveArray(), and AlCaHLTBitMon_QueryRunRegistry::string.

24  {
25 
26  init_ = false;
27 
29 
30  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
31 
32  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
33 
34  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
35 
39  meEtBxReal_ = 0;
41  meTCCTimingCalo_ = 0;
42  meTCCTimingMuon_ = 0;
45 
53 
54  realCollection_ = consumes<EcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("EcalTrigPrimDigiCollectionReal"));
55  emulCollection_ = consumes<EcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("EcalTrigPrimDigiCollectionEmul"));
56  EBDigiCollection_ = consumes<EBDigiCollection>(ps.getParameter<edm::InputTag>("EBDigiCollection"));
57  HLTResultsCollection_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("HLTResultsCollection"));
58 
59  HLTCaloHLTBit_ = ps.getUntrackedParameter<std::string>("HLTCaloHLTBit", "");
60  HLTMuonHLTBit_ = ps.getUntrackedParameter<std::string>("HLTMuonHLTBit", "");
61 
62  outputFile_ = ps.getUntrackedParameter<std::string>("OutputRootFile", "");
63 
64  LogDebug("EBTriggerTowerTask") << "REAL digis: " << realCollection_;
65  LogDebug("EBTriggerTowerTask") << "EMULATED digis: " << emulCollection_;
66 
67 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< EBDigiCollection > EBDigiCollection_
to find the input collection of crystal digis
MonitorElement * meEtSpectrumReal_
ET spectrums for the whole EB.
edm::EDGetTokenT< EcalTrigPrimDigiCollection > realCollection_
to find the input collection of real digis
edm::EDGetTokenT< EcalTrigPrimDigiCollection > emulCollection_
to find the input collection of emulated digis
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_
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::EDGetTokenT< edm::TriggerResults > HLTResultsCollection_
to find the input collection of HLT bits
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 69 of file EBTriggerTowerTask.cc.

69  {
70 
71 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 273 of file EBTriggerTowerTask.cc.

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

273  {
274 
275  if ( ! init_ ) this->setup();
276 
277  ievt_++;
278 
280 
281  if ( e.getByToken(realCollection_, realDigis) ) {
282 
283  int nebtpd = realDigis->size();
284  LogDebug("EBTriggerTowerTask") << "event " << ievt_ <<" trigger primitive digi collection size: " << nebtpd;
285 
286  processDigis( e,
287  realDigis,
288  meEtMapReal_,
289  meVetoReal_);
290 
291  } else {
292  edm::LogWarning("EBTriggerTowerTask") << "realCollection not available";
293  }
294 
296 
297  if ( e.getByToken(emulCollection_, emulDigis) ) {
298 
300 
301  if ( e.getByToken(HLTResultsCollection_, hltResults) ) {
302 
303  processDigis( e,
304  emulDigis,
305  meEtMapEmul_,
306  meVetoEmul_,
307  realDigis,
308  hltResults);
309 
310  } else {
311  edm::LogWarning("EBTriggerTowerTask") << "HLTResultsCollection not available";
312  }
313 
314  } else {
315  edm::LogInfo("EBTriggerTowerTask") << "emulCollection not available";
316  }
317 
318 }
#define LogDebug(id)
void setup(void)
Setup.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< EcalTrigPrimDigiCollection > realCollection_
to find the input collection of real digis
edm::EDGetTokenT< EcalTrigPrimDigiCollection > emulCollection_
to find the input collection of emulated digis
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
array1 meVetoReal_
fine grain veto vs iphi vs ieta, for each SM
array1 meEtMapEmul_
Emulated Et vs ix vs iy, for each SM.
edm::EDGetTokenT< edm::TriggerResults > HLTResultsCollection_
to find the input collection of HLT bits
int ievt_
local event counter
array1 meEtMapReal_
Et vs ix vs iy, for each SM.
array1 meVetoEmul_
Emulated fine grain veto vs iphi vs ieta, for each SM.
void EBTriggerTowerTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file EBTriggerTowerTask.cc.

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

80  {
81 
82  ievt_ = 0;
83 
84  if ( dqmStore_ ) {
85  dqmStore_->setCurrentFolder(prefixME_ + "/EBTriggerTowerTask");
86  dqmStore_->rmdir(prefixME_ + "/EBTriggerTowerTask");
87  }
88 
89 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2730
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:584
void EBTriggerTowerTask::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file EBTriggerTowerTask.cc.

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

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

Cleanup.

Definition at line 249 of file EBTriggerTowerTask.cc.

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

Referenced by endJob().

249  {
250 
251  if ( ! init_ ) return;
252 
253  if ( dqmStore_ ) {
254 
255  if ( !outputFile_.empty() ) dqmStore_->save( outputFile_.c_str() );
256 
257  dqmStore_->rmdir( prefixME_ + "/EBTriggerTowerTask" );
258 
259  }
260 
261  init_ = false;
262 
263 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2730
std::string outputFile_
debug output root file. if empty, no output file created.
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2296
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 265 of file EBTriggerTowerTask.cc.

References cleanup(), enableCleanup_, and ievt_.

265  {
266 
267  edm::LogInfo("EBTriggerTowerTask") << "analyzed " << ievt_ << " events";
268 
269  if ( enableCleanup_ ) this->cleanup();
270 
271 }
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 99 of file EBTriggerTowerTask.cc.

99  {
100 
101 }
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 321 of file EBTriggerTowerTask.cc.

References funct::abs(), accept(), edm::EventBase::bunchCrossing(), EBDigiCollection_, EcalBarrel, MonitorElement::Fill(), edm::Event::getByToken(), 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_, AlCaHLTBitMon_QueryRunRegistry::string, Numbers::subDet(), edm::TriggerNames::triggerName(), and edm::Event::triggerNames().

Referenced by analyze().

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

reserve an array to hold one histogram per supermodule

Definition at line 73 of file EBTriggerTowerTask.cc.

References nSM.

Referenced by EBTriggerTowerTask().

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

Reset.

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

103  {
104 
108  if ( meEtBxReal_ ) meEtBxReal_->Reset();
114 
115  for (int i = 0; i < 36; i++) {
116 
117  if ( meEtMapReal_[i] ) meEtMapReal_[i]->Reset();
118  if ( meVetoReal_[i] ) meVetoReal_[i]->Reset();
119  if ( meEtMapEmul_[i] ) meEtMapEmul_[i]->Reset();
120  if ( meVetoEmul_[i] ) meVetoEmul_[i]->Reset();
121  if ( meEmulError_[i] ) meEmulError_[i]->Reset();
122  if ( meEmulMatch_[i] ) meEmulMatch_[i]->Reset();
123  if ( meVetoEmulError_[i] ) meVetoEmulError_[i]->Reset();
124 
125  }
126 
127 }
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 129 of file EBTriggerTowerTask.cc.

References dqmStore_, init_, and prefixME_.

Referenced by analyze().

129  {
130 
131  init_ = true;
132 
133  if ( dqmStore_ ) {
134  setup( "Real Digis",
135  (prefixME_ + "/EBTriggerTowerTask").c_str(), false );
136 
137  setup( "Emulated Digis",
138  (prefixME_ + "/EBTriggerTowerTask/Emulated").c_str(), true);
139  }
140  else {
141  edm::LogError("EBTriggerTowerTask") << "Bad DQMStore, cannot book MonitorElements.";
142  }
143 }
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 145 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(), AlCaHLTBitMon_QueryRunRegistry::string, DQMStore::tag(), and fw3dlego::xbins.

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

Member Data Documentation

DQMStore* EBTriggerTowerTask::dqmStore_
private

DQM back-end interface.

Definition at line 119 of file EBTriggerTowerTask.h.

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

edm::EDGetTokenT<EBDigiCollection> EBTriggerTowerTask::EBDigiCollection_
private

to find the input collection of crystal digis

Definition at line 137 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), and processDigis().

edm::EDGetTokenT<EcalTrigPrimDigiCollection> EBTriggerTowerTask::emulCollection_
private

to find the input collection of emulated digis

Definition at line 134 of file EBTriggerTowerTask.h.

Referenced by analyze(), and EBTriggerTowerTask().

bool EBTriggerTowerTask::enableCleanup_
private

remove MEs

Definition at line 125 of file EBTriggerTowerTask.h.

Referenced by EBTriggerTowerTask(), and endJob().

std::string EBTriggerTowerTask::HLTCaloHLTBit_
private

Definition at line 141 of file EBTriggerTowerTask.h.

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

std::string EBTriggerTowerTask::HLTMuonHLTBit_
private

Definition at line 142 of file EBTriggerTowerTask.h.

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

edm::EDGetTokenT<edm::TriggerResults> EBTriggerTowerTask::HLTResultsCollection_
private

to find the input collection of HLT bits

Definition at line 140 of file EBTriggerTowerTask.h.

Referenced by analyze(), and EBTriggerTowerTask().

int EBTriggerTowerTask::ievt_
private

local event counter

Definition at line 94 of file EBTriggerTowerTask.h.

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

bool EBTriggerTowerTask::init_
private

init flag

Definition at line 116 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 111 of file EBTriggerTowerTask.h.

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

array1 EBTriggerTowerTask::meEmulMatch_
private

Definition at line 112 of file EBTriggerTowerTask.h.

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

MonitorElement* EBTriggerTowerTask::meEmulMatchIndex1D_
private

1D emulator match 1D

Definition at line 148 of file EBTriggerTowerTask.h.

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

MonitorElement* EBTriggerTowerTask::meEmulMatchMaxIndex1D_
private

Definition at line 149 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 157 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 103 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 97 of file EBTriggerTowerTask.h.

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

MonitorElement* EBTriggerTowerTask::meEtSpectrumEmul_
private

Definition at line 153 of file EBTriggerTowerTask.h.

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

MonitorElement* EBTriggerTowerTask::meEtSpectrumEmulMax_
private

Definition at line 154 of file EBTriggerTowerTask.h.

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

MonitorElement* EBTriggerTowerTask::meEtSpectrumReal_
private

ET spectrums for the whole EB.

Definition at line 152 of file EBTriggerTowerTask.h.

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

MonitorElement* EBTriggerTowerTask::meOccupancyBxReal_
private

Definition at line 158 of file EBTriggerTowerTask.h.

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

bool EBTriggerTowerTask::mergeRuns_
private

merge MEs across runs

Definition at line 128 of file EBTriggerTowerTask.h.

Referenced by beginRun(), and EBTriggerTowerTask().

MonitorElement* EBTriggerTowerTask::meTCCTimingCalo_
private

TCC timing.

Definition at line 161 of file EBTriggerTowerTask.h.

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

MonitorElement* EBTriggerTowerTask::meTCCTimingMuon_
private

Definition at line 162 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 106 of file EBTriggerTowerTask.h.

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

array1 EBTriggerTowerTask::meVetoEmulError_
private

Definition at line 113 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 100 of file EBTriggerTowerTask.h.

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

const int EBTriggerTowerTask::nSM = 36
static

number of supermodules

Definition at line 39 of file EBTriggerTowerTask.h.

Referenced by reserveArray().

const int EBTriggerTowerTask::nTTEta = 17
static

number of trigger towers in eta

Definition at line 33 of file EBTriggerTowerTask.h.

Referenced by setup().

const int EBTriggerTowerTask::nTTPhi = 4
static

number of trigger towers in phi

Definition at line 36 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 145 of file EBTriggerTowerTask.h.

Referenced by cleanup(), and EBTriggerTowerTask().

std::string EBTriggerTowerTask::prefixME_
private

path to MEs

Definition at line 122 of file EBTriggerTowerTask.h.

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

edm::EDGetTokenT<EcalTrigPrimDigiCollection> EBTriggerTowerTask::realCollection_
private

to find the input collection of real digis

Definition at line 131 of file EBTriggerTowerTask.h.

Referenced by analyze(), and EBTriggerTowerTask().