45 meEtSpectrumReal_[1] = 0;
93 array.resize(
nSM, static_cast<MonitorElement*>(0) );
122 for (
int iside = 0; iside < 2; iside++) {
134 for (
int i = 0;
i < 18;
i++) {
154 (
prefixME_ +
"/EETriggerTowerTask").c_str(),
false );
156 setup(
"Emulated Digis",
157 (
prefixME_ +
"/EETriggerTowerTask/Emulated").c_str(),
true);
160 edm::LogError(
"EETriggerTowerTask") <<
"Bad DQMStore, cannot book MonitorElements.";
165 std::string
const &folder,
179 name =
"EETTT Et spectrum " + nameext +
" EE -";
183 name =
"EETTT Et spectrum " + nameext +
" EE +";
187 name =
"EETTT TP matching index EE -";
191 name =
"EETTT TP matching index EE +";
195 name =
"EETTT max TP matching index EE -";
199 name =
"EETTT max TP matching index EE +";
204 for (
int i=0;
i<=11;
i++ ) xbins[
i] =
i-1;
208 for (
int i=12;
i<=22;
i++) xbins[
i] = 3371+
i-12;
210 for (
int i=23;
i<=50;
i++) xbins[
i] = 3382+(
i-23)*6;
212 name =
"EETTT Et vs bx " + nameext +
" EE -";
217 name =
"EETTT Et vs bx " + nameext +
" EE +";
222 name =
"EETTT TP occupancy vs bx " + nameext +
" EE -";
227 name =
"EETTT TP occupancy vs bx " + nameext +
" EE +";
233 name =
"EETTT TCC timing calo triggers " + nameext +
" EE -";
238 name =
"EETTT TCC timing calo triggers " + nameext +
" EE +";
245 name =
"EETTT TCC timing muon triggers " + nameext +
" EE -";
250 name =
"EETTT TCC timing muon triggers " + nameext +
" EE +";
257 name =
"EETTT Et spectrum " + nameext +
" EE -";
261 name =
"EETTT Et spectrum " + nameext +
" EE +";
265 name =
"EETTT Et spectrum " + nameext +
" max EE -";
269 name =
"EETTT Et spectrum " + nameext +
" max EE +";
274 for (
int i = 0;
i < 18;
i++) {
282 if (
i+1 >= 1 &&
i+1 <= 9 ) (*meEtMap)[
i]->setAxisTitle(
"101-ix", 1);
283 (*meEtMap)[
i]->setAxisTitle(
"iy", 2);
293 if ( i+1 >= 1 && i+1 <= 9 )
meEmulError_[
i]->setAxisTitle(
"101-ix", 1);
303 if ( i+1 >= 1 && i+1 <= 9 )
meEmulMatch_[
i]->setAxisTitle(
"101-ix", 1);
307 name =
"EETTT EmulFineGrainVetoError " +
Numbers::sEE(i+1);
323 if ( !
init_ )
return;
355 int neetpd = realDigis->size();
356 LogDebug(
"EETriggerTowerTask") <<
"event " <<
ievt_ <<
" trigger primitive digi collection size: " << neetpd;
412 int readoutCrystalsInTower[108][41];
413 for (
int itcc = 0; itcc < 108; itcc++) {
414 for (
int itt = 0; itt < 41; itt++) readoutCrystalsInTower[itcc][itt] = 0;
433 readoutCrystalsInTower[itcc-1][itt-1]++;
443 bool caloTrg =
false;
444 bool muonTrg =
false;
448 int ntrigs = hltResults->size();
453 for (
int itrig = 0; itrig != ntrigs; ++itrig ) {
454 std::string trigName = triggerNames.
triggerName(itrig);
455 bool accept = hltResults->accept(itrig);
464 edm::LogWarning(
"EBTriggerTowerTask") <<
" zero size trigger names in input TriggerResults";
479 float xvalEt = tpdigiItr->compressedEt();
480 float xvalVeto = 0.5 + tpdigiItr->fineGrain();
483 bool goodVeto =
true;
485 int compDigiInterest = -1;
488 for (
int j=0;
j<6;
j++) matchSample[
j]=
false;
492 if ( ismt >= 1 && ismt <= 9 ) {
500 for (
int j=0;
j<5;
j++) {
501 float EtTP = (*tpdigiItr)[
j].compressedEt();
502 if ( EtTP > maxEt ) {
508 if ( ismt >= 1 && ismt <= 9 ) {
517 if ( compDigiItr != compDigis->end() ) {
518 int compDigiEt = compDigiItr->compressedEt();
519 compDigiInterest = (compDigiItr->ttFlag() & 0x3);
521 if ( ismt >= 1 && ismt <= 9 ) {
522 if ( compDigiEt > 0 ) nTP[0]++;
526 if ( compDigiEt > 0 ) nTP[1]++;
533 matchSample[0]=
false;
534 bool matchedAny=
false;
536 for (
int j=0;
j<5;
j++) {
537 if ((*tpdigiItr)[
j].compressedEt() == compDigiEt ) {
538 matchSample[
j+1]=
true;
541 matchSample[
j+1]=
false;
545 if (!matchedAny) matchSample[0]=
true;
548 if (readoutCrystalsInTower[itcc-1][itt-1] ==
int(crystals->size()) &&
549 (compDigiInterest == 1 || compDigiInterest == 3) && compDigiEt > 0) {
551 if ( tpdigiItr->compressedEt() != compDigiEt ) {
554 if ( tpdigiItr->fineGrain() != compDigiItr->fineGrain() ) {
558 for (
int j=0;
j<6;
j++) {
559 if (matchSample[
j]) {
561 int index = ( j==0 ) ? -1 : j;
563 if ( ismt >= 1 && ismt <= 9 ) {
569 for (
unsigned int i=0;
i<crystals->size();
i++ ) {
576 if ( ismt >= 1 && ismt <= 9 ) ix = 101 - ix;
582 if ( ismt >= 1 && ismt <= 9 ) {
602 for (
unsigned int i=0;
i<crystals->size();
i++ ) {
609 if ( ismt >= 1 && ismt <= 9 ) ix = 101 - ix;
625 for (
unsigned int i=0;
i<crystals->size();
i++ ) {
632 if ( ismt >= 1 && ismt <= 9 ) ix = 101 - ix;
637 if ( meEtMap[ismt-1] ) meEtMap[ismt-1]->Fill(xix, xiy, xvalEt);
638 if ( meVeto[ismt-1] ) meVeto[ismt-1]->Fill(xix, xiy, xvalVeto);
bool enableCleanup_
remove MEs
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
static std::string sEE(const unsigned ism)
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
virtual ~EETriggerTowerTask()
Destructor.
array1 meVetoEmul_
Emulated fine grain veto vs ix vs iy, for each SM.
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.
MonitorElement * meEtBxReal_[2]
number and ET average of TP vs bx for the whole EE+/-
void rmdir(const std::string &fullpath)
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.
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="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
static const int nSM
number of supermodules
static const int nTTPhi
number of trigger towers in phi
MonitorElement * meOccupancyBxReal_[2]
std::vector< T >::const_iterator const_iterator
int bunchCrossing() const
void reserveArray(array1 &array)
reserve an array to hold one histogram per supermodule
MonitorElement * meEtSpectrumEmul_[2]
edm::InputTag emulCollection_
to find the input collection of emulated digis
static int ix0EE(const unsigned ism)
void beginJob(void)
BeginJob.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
static int iy0EE(const unsigned ism)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
void tag(MonitorElement *me, unsigned int myTag)
static std::vector< DetId > * crystals(const EcalTrigTowerDetId &id)
edm::InputTag HLTResultsCollection_
to find the input collection of HLT bits
std::vector< MonitorElement * > array1
1D array
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
static const int nTTEta
number of trigger towers in eta
static unsigned iTCC(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
DQMStore * dqmStore_
DQM back-end interface.
std::string HLTCaloHLTBit_
MonitorElement * meEmulMatchMaxIndex1D_[2]
array1 meEtMapEmul_
Emulated Et vs ix vs iy, for each SM.
array1 meVetoReal_
fine grain veto vs ix vs iy, for each SM
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
array1 meEtMapReal_
Et vs ix vs iy, for each SM.
std::string prefixME_
path to MEs
EETriggerTowerTask(const edm::ParameterSet &ps)
Constructor.
MonitorElement * meEtSpectrumEmulMax_[2]
std::string HLTMuonHLTBit_
bool mergeRuns_
merge MEs across runs
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
std::string const & triggerName(unsigned int index) const
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
MonitorElement * meEtSpectrumReal_[2]
ET spectrums for the whole EE+/-.
edm::InputTag realCollection_
to find the input collection of real digis
static EcalSubdetector subDet(const EBDetId &id)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * meTCCTimingCalo_[2]
TCC timing.
int ism(int ieta, int iphi)
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 * meEmulMatchIndex1D_[2]
1D emulator match 1D
void setCurrentFolder(const std::string &fullpath)
void cleanup(void)
Cleanup.
edm::InputTag EEDigiCollection_
to find the input collection of crystal digis
static unsigned iTT(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
MonitorElement * meTCCTimingMuon_[2]
int ievt_
local event counter
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")