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.";
165 sprintf(histo,
"EBTTT Et spectrum %s", nameext);
169 sprintf(histo,
"EBTTT TP matching index");
173 sprintf(histo,
"EBTTT max TP matching index");
178 for (
int i=0;
i<=11;
i++ ) xbins[
i] =
i-1;
182 for (
int i=12;
i<=22;
i++) xbins[
i] = 3371+
i-12;
184 for (
int i=23;
i<=51;
i++) xbins[
i] = 3382+(
i-23)*6;
186 sprintf(histo,
"EBTTT Et vs bx %s", nameext);
191 sprintf(histo,
"EBTTT TP occupancy vs bx %s", nameext);
197 sprintf(histo,
"EBTTT TCC timing calo triggers %s", nameext);
204 sprintf(histo,
"EBTTT TCC timing muon triggers %s", nameext);
211 sprintf(histo,
"EBTTT Et spectrum %s", nameext);
215 sprintf(histo,
"EBTTT Et spectrum %s max", nameext);
220 for (
int i = 0;
i < 36;
i++) {
222 sprintf(histo,
"EBTTT Et map %s %s", nameext,
Numbers::sEB(
i+1).c_str());
223 (*meEtMap)[
i] =
dqmStore_->
bookProfile2D(histo, histo,
nTTEta, 0,
nTTEta,
nTTPhi, 0,
nTTPhi, 256, 0, 256.);
225 (*meEtMap)[
i]->setAxisTitle(
"iphi'", 2);
230 sprintf(histo,
"EBTTT EmulError %s",
Numbers::sEB(i+1).c_str());
236 sprintf(histo,
"EBTTT EmulMatch %s",
Numbers::sEB(i+1).c_str());
237 meEmulMatch_[
i] =
dqmStore_->
book3D(histo, histo,
nTTEta, 0.,
nTTEta,
nTTPhi, 0.,
nTTPhi, 6, 0., 6.);
243 sprintf(histo,
"EBTTT EmulFineGrainVetoError %s",
Numbers::sEB(i+1).c_str());
256 if ( !
init_ )
return;
288 int nebtpd = realDigis->size();
289 LogDebug(
"EBTriggerTowerTask") <<
"event " <<
ievt_ <<
" trigger primitive digi collection size: " << nebtpd;
344 int readoutCrystalsInTower[108][68];
345 for (
int itcc = 0; itcc < 108; itcc++) {
346 for (
int itt = 0; itt < 68; itt++) readoutCrystalsInTower[itcc][itt] = 0;
363 readoutCrystalsInTower[itcc-1][itt-1]++;
373 bool caloTrg =
false;
374 bool muonTrg =
false;
378 int ntrigs = hltResults->size();
383 for (
int itrig = 0; itrig != ntrigs; ++itrig ) {
384 std::string trigName = triggerNames.
triggerName(itrig);
385 bool accept = hltResults->accept(itrig);
394 edm::LogWarning(
"EBTriggerTowerTask") <<
" zero size trigger names in input TriggerResults";
405 int iet =
std::abs(tpdigiItr->id().ieta());
406 int ipt = tpdigiItr->id().iphi();
411 if ( ipt > 72 ) ipt = ipt - 72;
415 if ( tpdigiItr->id().zside() > 0 ) ipt = 5 - ipt;
417 float xiet = iet-0.5;
418 float xipt = ipt-0.5;
423 float xvalEt = tpdigiItr->compressedEt();
424 float xvalVeto = 0.5 + tpdigiItr->fineGrain();
427 bool goodVeto =
true;
429 int compDigiInterest = -1;
432 for (
int j=0;
j<6;
j++) matchSample[
j]=
false;
440 for (
int j=0;
j<5;
j++) {
441 float EtTP = (*tpdigiItr)[
j].compressedEt();
442 if ( EtTP > maxEt ) {
452 if ( compDigiItr != compDigis->end() ) {
453 int compDigiEt = compDigiItr->compressedEt();
454 compDigiInterest = (compDigiItr->ttFlag() & 0x3);
456 if ( compDigiEt > 0 ) nTP++;
462 matchSample[0]=
false;
463 bool matchedAny=
false;
465 for (
int j=0;
j<5;
j++) {
466 if ((*tpdigiItr)[
j].compressedEt() == compDigiEt ) {
467 matchSample[
j+1]=
true;
470 matchSample[
j+1]=
false;
474 if (!matchedAny) matchSample[0]=
true;
477 if (readoutCrystalsInTower[itcc-1][itt-1] == 25 &&
478 (compDigiInterest == 1 || compDigiInterest == 3) && compDigiEt > 0) {
480 if ( tpdigiItr->compressedEt() != compDigiEt ) {
483 if ( tpdigiItr->fineGrain() != compDigiItr->fineGrain() ) {
487 for (
int j=0;
j<6;
j++) {
488 if (matchSample[
j]) {
490 int index = ( j==0 ) ? -1 : j;
517 if ( meEtMap[ismt-1] ) meEtMap[ismt-1]->Fill(xiet, xipt, xvalEt);
518 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 std::string sEB(const int ism)
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.
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
static int iTCC(const int ism, const EcalSubdetector subdet, const int i1, const int i2)
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 int iTT(const int ism, const EcalSubdetector subdet, const int i1, const int i2)
bool enableCleanup_
remove MEs
void tag(MonitorElement *me, unsigned int myTag)
static const int nSM
number of supermodules
static int iSM(const int ism, const EcalSubdetector subdet)
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.
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)
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")