76 array.resize(
nSM, static_cast<MonitorElement*>(0) );
115 for (
int i = 0;
i < 36;
i++) {
135 (
prefixME_ +
"/EBTriggerTowerTask").c_str(),
false );
137 setup(
"Emulated Digis",
138 (
prefixME_ +
"/EBTriggerTowerTask/Emulated").c_str(),
true);
141 edm::LogError(
"EBTriggerTowerTask") <<
"Bad DQMStore, cannot book MonitorElements.";
160 name =
"EBTTT Et spectrum " + nameext;
164 name =
"EBTTT TP matching index";
168 name =
"EBTTT max TP matching index";
173 for (
int i=0;
i<=11;
i++ ) xbins[
i] =
i-1;
177 for (
int i=12;
i<=22;
i++) xbins[
i] = 3371+
i-12;
179 for (
int i=23;
i<=50;
i++) xbins[
i] = 3382+(
i-23)*6;
181 name =
"EBTTT Et vs bx " + nameext;
186 name =
"EBTTT TP occupancy vs bx " + nameext;
192 name =
"EBTTT TCC timing calo triggers " + nameext;
199 name =
"EBTTT TCC timing muon triggers " + nameext;
206 name =
"EBTTT Et spectrum " + nameext;
210 name =
"EBTTT Et spectrum " + nameext +
" max";
215 for (
int i = 0;
i < 36;
i++) {
218 (*meEtMap)[
i] =
dqmStore_->
bookProfile2D(name, name,
nTTEta, 0,
nTTEta,
nTTPhi, 0,
nTTPhi, 256, 0, 256.);
220 (*meEtMap)[
i]->setAxisTitle(
"iphi'", 2);
232 meEmulMatch_[
i] =
dqmStore_->
book3D(name, name,
nTTEta, 0.,
nTTEta,
nTTPhi, 0.,
nTTPhi, 6, 0., 6.);
238 name =
"EBTTT EmulFineGrainVetoError " +
Numbers::sEB(i+1);
251 if ( !
init_ )
return;
283 int nebtpd = realDigis->size();
284 LogDebug(
"EBTriggerTowerTask") <<
"event " <<
ievt_ <<
" trigger primitive digi collection size: " << nebtpd;
292 edm::LogWarning(
"EBTriggerTowerTask") <<
"realCollection not available";
311 edm::LogWarning(
"EBTriggerTowerTask") <<
"HLTResultsCollection not available";
315 edm::LogInfo(
"EBTriggerTowerTask") <<
"emulCollection not available";
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;
350 readoutCrystalsInTower[itcc-1][itt-1]++;
355 edm::LogWarning(
"EBTriggerTowerTask") <<
"EBDigiCollection not available";
360 bool caloTrg =
false;
361 bool muonTrg =
false;
365 int ntrigs = hltResults->size();
370 for (
int itrig = 0; itrig != ntrigs; ++itrig ) {
372 bool accept = hltResults->accept(itrig);
381 edm::LogWarning(
"EBTriggerTowerTask") <<
" zero size trigger names in input TriggerResults";
392 int iet =
std::abs(tpdigiItr->id().ieta());
393 int ipt = tpdigiItr->id().iphi();
398 if ( ipt > 72 ) ipt = ipt - 72;
402 if ( tpdigiItr->id().zside() > 0 ) ipt = 5 - ipt;
404 float xiet = iet-0.5;
405 float xipt = ipt-0.5;
410 float xvalEt = tpdigiItr->compressedEt();
411 float xvalVeto = 0.5 + tpdigiItr->fineGrain();
414 bool goodVeto =
true;
416 int compDigiInterest = -1;
419 for (
int j=0;
j<6;
j++) matchSample[
j]=
false;
427 for (
int j=0;
j<5;
j++) {
428 float EtTP = (*tpdigiItr)[
j].compressedEt();
429 if ( EtTP > maxEt ) {
439 if ( compDigiItr != compDigis->end() ) {
440 int compDigiEt = compDigiItr->compressedEt();
441 compDigiInterest = (compDigiItr->ttFlag() & 0x3);
443 if ( compDigiEt > 0 ) nTP++;
449 matchSample[0]=
false;
450 bool matchedAny=
false;
452 for (
int j=0;
j<5;
j++) {
453 if ((*tpdigiItr)[
j].compressedEt() == compDigiEt ) {
454 matchSample[
j+1]=
true;
457 matchSample[
j+1]=
false;
461 if (!matchedAny) matchSample[0]=
true;
464 if (readoutCrystalsInTower[itcc-1][itt-1] == 25 &&
465 (compDigiInterest == 1 || compDigiInterest == 3) && compDigiEt > 0) {
467 if ( tpdigiItr->compressedEt() != compDigiEt ) {
470 if ( tpdigiItr->fineGrain() != compDigiItr->fineGrain() ) {
474 for (
int j=0;
j<6;
j++) {
475 if (matchSample[
j]) {
477 int index = ( j==0 ) ? -1 : j;
504 if ( meEtMap[ismt-1] ) meEtMap[ismt-1]->Fill(xiet, xipt, xvalEt);
505 if ( meVeto[ismt-1] ) meVeto[ismt-1]->Fill(xiet, xipt, xvalVeto);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
EBTriggerTowerTask(const edm::ParameterSet &ps)
Constructor.
static const int nTTPhi
number of trigger towers in phi
void beginJob(void)
BeginJob.
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
edm::EDGetTokenT< EBDigiCollection > EBDigiCollection_
to find the input collection of crystal digis
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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.
Some "id" conversions.
static std::string sEB(const unsigned ism)
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
std::vector< EcalTriggerPrimitiveDigi >::const_iterator const_iterator
int bunchCrossing() const
std::string HLTCaloHLTBit_
MonitorElement * meEtSpectrumReal_
ET spectrums for the whole EB.
edm::EDGetTokenT< EcalTrigPrimDigiCollection > realCollection_
to find the input collection of real digis
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
edm::EDGetTokenT< EcalTrigPrimDigiCollection > emulCollection_
to find the input collection of emulated digis
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
static const int nTTEta
number of trigger towers in eta
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
bool enableCleanup_
remove MEs
void tag(MonitorElement *me, unsigned int myTag)
static const int nSM
number of supermodules
static unsigned iTCC(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
std::string outputFile_
debug output root file. if empty, no output file created.
bool mergeRuns_
merge MEs across runs
MonitorElement * meEmulMatchMaxIndex1D_
Abs< T >::type abs(const T &t)
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")
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
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.
std::string HLTMuonHLTBit_
virtual ~EBTriggerTowerTask()
Destructor.
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.
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
std::string const & triggerName(unsigned int index) const
void cleanup(void)
Cleanup.
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
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.
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
MonitorElement * meEmulMatchIndex1D_
1D emulator match 1D
static EcalSubdetector subDet(const EBDetId &id)
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.
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)
void Reset(void)
reset ME (ie. contents, errors, etc)
MonitorElement * meTCCTimingCalo_
TCC timing.
MonitorElement * meEtSpectrumEmul_
void setCurrentFolder(const std::string &fullpath)
static unsigned iTT(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
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")