Skip to content

Commit

Permalink
Merge pull request #38561 from alejands/piZeroTask_12_5_X
Browse files Browse the repository at this point in the history
Incorporate PiZeroAnalyzer code into ECAL DQM
  • Loading branch information
cmsbuild authored Jun 30, 2022
2 parents 84321a9 + da75b0e commit 576008a
Show file tree
Hide file tree
Showing 5 changed files with 459 additions and 4 deletions.
70 changes: 70 additions & 0 deletions DQM/EcalMonitorTasks/interface/PiZeroTask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#ifndef DQM_EcalMonitorTasks_PiZeroTask_H
#define DQM_EcalMonitorTasks_PiZeroTask_H

#include "DQM/EcalMonitorTasks/interface/DQWorkerTask.h"
#include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h"

#include "DataFormats/EcalRawData/interface/EcalDCCHeaderBlock.h"
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"

#include "TVector3.h"

namespace ecaldqm {

class PiZeroTask : public DQWorkerTask {
public:
PiZeroTask();
~PiZeroTask() override = default;

bool filterRunType(short const*) override;
bool analyze(void const*, Collections) override;
void runOnEBRecHits(EcalRecHitCollection const&);

private:
void setParams(edm::ParameterSet const&) override;

static const int MAXCLUS = 2000;
static const int MAXPI0S = 200;

// Parameters needed for pi0 finding
double seleXtalMinEnergy_;

double clusSeedThr_;
int clusEtaSize_;
int clusPhiSize_;

double selePtGammaOne_;
double selePtGammaTwo_;
double seleS4S9GammaOne_;
double seleS4S9GammaTwo_;
double selePtPi0_;
double selePi0Iso_;
double selePi0BeltDR_;
double selePi0BeltDeta_;
double seleMinvMaxPi0_;
double seleMinvMinPi0_;

edm::ParameterSet posCalcParameters_;
};

inline bool PiZeroTask::analyze(void const* collection_data, Collections collection) {
switch (collection) {
case kEBRecHit:
if (collection_data)
runOnEBRecHits(*static_cast<EcalRecHitCollection const*>(collection_data));
return true;
case kEERecHit: // This module does not run on EERecHits
break;
default:
break;
}

return false;
}

} // namespace ecaldqm

#endif
7 changes: 5 additions & 2 deletions DQM/EcalMonitorTasks/python/EcalMonitorTask_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from DQM.EcalMonitorTasks.SelectiveReadoutTask_cfi import ecalSelectiveReadoutTask
from DQM.EcalMonitorTasks.TimingTask_cfi import ecalTimingTask
from DQM.EcalMonitorTasks.TrigPrimTask_cfi import ecalTrigPrimTask
from DQM.EcalMonitorTasks.ecalPiZeroTask_cfi import ecalPiZeroTask

from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
ecalMonitorTask = DQMEDAnalyzer('EcalDQMonitorTask',
Expand All @@ -28,7 +29,8 @@
"RawDataTask",
"RecoSummaryTask",
"TimingTask",
"TrigPrimTask"
"TrigPrimTask",
"PiZeroTask"
),
# task parameters (included from indivitual cfis)
workerParameters = cms.untracked.PSet(
Expand All @@ -41,7 +43,8 @@
RecoSummaryTask = ecalRecoSummaryTask,
SelectiveReadoutTask = ecalSelectiveReadoutTask,
TimingTask = ecalTimingTask,
TrigPrimTask = ecalTrigPrimTask
TrigPrimTask = ecalTrigPrimTask,
PiZeroTask = ecalPiZeroTask
),
commonParameters = ecalCommonParams,
collectionTags = ecalDQMCollectionTags,
Expand Down
95 changes: 95 additions & 0 deletions DQM/EcalMonitorTasks/python/ecalPiZeroTask_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import FWCore.ParameterSet.Config as cms

ecalPiZeroTask = cms.untracked.PSet(
params = cms.untracked.PSet(
# Parameters needed for pi0 finding
seleXtalMinEnergy = cms.double(0.0),
clusSeedThr = cms.double(0.5),
clusEtaSize = cms.int32(3),
clusPhiSize = cms.int32(3),
selePtGammaOne = cms.double(0.9),
selePtGammaTwo = cms.double(0.9),
seleS4S9GammaOne = cms.double(0.85),
seleS4S9GammaTwo = cms.double(0.85),
selePtPi0 = cms.double(2.5),
selePi0Iso = cms.double(0.5),
selePi0BeltDR = cms.double(0.2),
selePi0BeltDeta = cms.double(0.05),
seleMinvMaxPi0 = cms.double(0.5),
seleMinvMinPi0 = cms.double(0.0),
posCalcParameters = cms.PSet(T0_barl = cms.double(5.7),
T0_endc = cms.double(3.1),
T0_endcPresh = cms.double(1.2),
LogWeighted = cms.bool(True),
W0 = cms.double(4.2),
X0 = cms.double(0.89)
),
),
MEs = cms.untracked.PSet(
Pi0MinvEB = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sPiZeroTask/%(prefix)sPZT%(suffix)s Pi0 Invariant Mass'),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('EB'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
nbins = cms.untracked.int32(100),
low = cms.untracked.double(0.),
high = cms.untracked.double(0.5),
title = cms.untracked.string('Inv Mass [GeV]')
),
description = cms.untracked.string('Pi0 Invariant Mass in EB')
),
Pi0Pt1EB = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sPiZeroTask/%(prefix)sPZT%(suffix)s Pi0 Pt 1st most energetic photon'),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('EB'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
nbins = cms.untracked.int32(100),
low = cms.untracked.double(0.),
high = cms.untracked.double(20.),
title = cms.untracked.string('1st photon Pt [GeV]')
),
description = cms.untracked.string('Pt 1st most energetic Pi0 photon in EB')
),
Pi0Pt2EB = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sPiZeroTask/%(prefix)sPZT%(suffix)s Pi0 Pt 2nd most energetic photon'),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('EB'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
nbins = cms.untracked.int32(100),
low = cms.untracked.double(0.),
high = cms.untracked.double(20.),
title = cms.untracked.string('2nd photon Pt [GeV]')
),
description = cms.untracked.string('Pt 2nd most energetic Pi0 photon in EB')
),
Pi0PtEB = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sPiZeroTask/%(prefix)sPZT%(suffix)s Pi0 Pt'),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('EB'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
nbins = cms.untracked.int32(100),
low = cms.untracked.double(0.),
high = cms.untracked.double(20.),
title = cms.untracked.string('Pi0 Pt [GeV]')
),
description = cms.untracked.string('Pi0 Pt in EB')
),
Pi0IsoEB = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sPiZeroTask/%(prefix)sPZT%(suffix)s Pi0 Iso'),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('EB'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
nbins = cms.untracked.int32(50),
low = cms.untracked.double(0.),
high = cms.untracked.double(1.),
title = cms.untracked.string('Pi0 Iso')
),
description = cms.untracked.string('Pi0 Iso in EB')
)
)
)
Loading

0 comments on commit 576008a

Please sign in to comment.