79 array.resize(
nSM, static_cast<MonitorElement*>(0) );
118 for (
int i = 0;
i < 36;
i++) {
138 (
prefixME_ +
"/EBTriggerTowerTask").c_str(),
false );
140 setup(
"Emulated Digis",
141 (
prefixME_ +
"/EBTriggerTowerTask/Emulated").c_str(),
true);
144 edm::LogError(
"EBTriggerTowerTask") <<
"Bad DQMStore, cannot book MonitorElements.";
149 std::string
const &folder,
163 name =
"EBTTT Et spectrum " + nameext;
167 name =
"EBTTT TP matching index";
171 name =
"EBTTT max TP matching index";
176 for (
int i=0;
i<=11;
i++ ) xbins[
i] =
i-1;
180 for (
int i=12;
i<=22;
i++) xbins[
i] = 3371+
i-12;
182 for (
int i=23;
i<=50;
i++) xbins[
i] = 3382+(
i-23)*6;
184 name =
"EBTTT Et vs bx " + nameext;
189 name =
"EBTTT TP occupancy vs bx " + nameext;
195 name =
"EBTTT TCC timing calo triggers " + nameext;
202 name =
"EBTTT TCC timing muon triggers " + nameext;
209 name =
"EBTTT Et spectrum " + nameext;
213 name =
"EBTTT Et spectrum " + nameext +
" max";
218 for (
int i = 0;
i < 36;
i++) {
221 (*meEtMap)[
i] =
dqmStore_->
bookProfile2D(name, name,
nTTEta, 0,
nTTEta,
nTTPhi, 0,
nTTPhi, 256, 0, 256.);
223 (*meEtMap)[
i]->setAxisTitle(
"iphi'", 2);
235 meEmulMatch_[
i] =
dqmStore_->
book3D(name, name,
nTTEta, 0.,
nTTEta,
nTTPhi, 0.,
nTTPhi, 6, 0., 6.);
241 name =
"EBTTT EmulFineGrainVetoError " +
Numbers::sEB(i+1);
254 if ( !
init_ )
return;
286 int nebtpd = realDigis->size();
287 LogDebug(
"EBTriggerTowerTask") <<
"event " <<
ievt_ <<
" trigger primitive digi collection size: " << nebtpd;
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;
361 readoutCrystalsInTower[itcc-1][itt-1]++;
371 bool caloTrg =
false;
372 bool muonTrg =
false;
376 int ntrigs = hltResults->size();
381 for (
int itrig = 0; itrig != ntrigs; ++itrig ) {
382 std::string trigName = triggerNames.
triggerName(itrig);
383 bool accept = hltResults->accept(itrig);
392 edm::LogWarning(
"EBTriggerTowerTask") <<
" zero size trigger names in input TriggerResults";
403 int iet =
std::abs(tpdigiItr->id().ieta());
404 int ipt = tpdigiItr->id().iphi();
409 if ( ipt > 72 ) ipt = ipt - 72;
413 if ( tpdigiItr->id().zside() > 0 ) ipt = 5 - ipt;
415 float xiet = iet-0.5;
416 float xipt = ipt-0.5;
421 float xvalEt = tpdigiItr->compressedEt();
422 float xvalVeto = 0.5 + tpdigiItr->fineGrain();
425 bool goodVeto =
true;
427 int compDigiInterest = -1;
430 for (
int j=0;
j<6;
j++) matchSample[
j]=
false;
438 for (
int j=0;
j<5;
j++) {
439 float EtTP = (*tpdigiItr)[
j].compressedEt();
440 if ( EtTP > maxEt ) {
450 if ( compDigiItr != compDigis->end() ) {
451 int compDigiEt = compDigiItr->compressedEt();
452 compDigiInterest = (compDigiItr->ttFlag() & 0x3);
454 if ( compDigiEt > 0 ) nTP++;
460 matchSample[0]=
false;
461 bool matchedAny=
false;
463 for (
int j=0;
j<5;
j++) {
464 if ((*tpdigiItr)[
j].compressedEt() == compDigiEt ) {
465 matchSample[
j+1]=
true;
468 matchSample[
j+1]=
false;
472 if (!matchedAny) matchSample[0]=
true;
475 if (readoutCrystalsInTower[itcc-1][itt-1] == 25 &&
476 (compDigiInterest == 1 || compDigiInterest == 3) && compDigiEt > 0) {
478 if ( tpdigiItr->compressedEt() != compDigiEt ) {
481 if ( tpdigiItr->fineGrain() != compDigiItr->fineGrain() ) {
485 for (
int j=0;
j<6;
j++) {
486 if (matchSample[
j]) {
488 int index = ( j==0 ) ? -1 : j;
515 if ( meEtMap[ismt-1] ) meEtMap[ismt-1]->Fill(xiet, xipt, xvalEt);
516 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)
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.
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")
std::vector< T >::const_iterator const_iterator
int bunchCrossing() const
edm::InputTag realCollection_
to find the input collection of real digis
std::string HLTCaloHLTBit_
MonitorElement * meEtSpectrumReal_
ET spectrums for the whole EB.
edm::InputTag HLTResultsCollection_
to find the input collection of HLT bits
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
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_
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
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.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::string HLTMuonHLTBit_
virtual ~EBTriggerTowerTask()
Destructor.
edm::InputTag EBDigiCollection_
to find the input collection of crystal digis
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")