36 static constexpr
float REcal = 129.;
37 static constexpr
float ZEcal = 315.4;
53 float CorrectedEta(
float eta,
float zv)
const;
86 label_(iConfig.getParameter<
std::
string>(
"label")),
87 etMin_((
float)iConfig.getParameter<double>(
"ETmin")),
88 zMax_((
float)iConfig.getParameter<double>(
"ZMAX")),
89 chi2Max_((
float)iConfig.getParameter<double>(
"CHI2MAX")),
90 pTMinTra_((
float)iConfig.getParameter<double>(
"PTMINTRA")),
91 dR2Min_((
float)iConfig.getParameter<double>(
"DRmin") * (
float)iConfig.getParameter<double>(
"DRmin")),
92 dR2Max_((
float)iConfig.getParameter<double>(
"DRmax") * (
float)iConfig.getParameter<double>(
"DRmax")),
93 primaryVtxConstrain_(iConfig.getParameter<
bool>(
"PrimaryVtxConstrain")),
94 deltaZMax_((
float)iConfig.getParameter<double>(
"DeltaZMax")),
95 isoCut_((
float)iConfig.getParameter<double>(
"IsoCut")),
96 relativeIsolation_(iConfig.getParameter<
bool>(
"RelativeIsolation")) {
97 produces<TkEmCollection>(
label_);
106 auto result = std::make_unique<TkEmCollection>();
111 if (!L1TTTrackHandle.isValid()) {
112 LogError(
"L1TkEmParticleProducer") <<
"\nWarning: L1TTTrackCollectionType not found in the event. Exit." 118 float zvtxL1tk = -999;
122 if (!L1VertexHandle.
isValid()) {
124 <<
"Warning: TkPrimaryVertexCollection not found in the event. Won't use any PrimaryVertex constraint." 128 std::vector<TkPrimaryVertex>::const_iterator vtxIter = L1VertexHandle->begin();
131 zvtxL1tk = vtxIter->zvertex();
134 if (!L1TTTrackHandle.isValid()) {
135 LogError(
"L1TkEmParticleProducer") <<
"\nWarning: L1TTTrackCollectionType not found in the event. Exit." 145 LogError(
"L1TkEmParticleProducer") <<
"\nWarning: L1EmCollection not found in the event. Exit." << std::endl;
152 for (egIter = eGammaCollection.
begin(0); egIter != eGammaCollection.
end(0); ++egIter)
157 float et = egIter->et();
161 float eta = egIter->eta();
167 float phi = egIter->phi();
175 for (
const auto&
track : *L1TTTrackHandle) {
176 float Pt =
track.momentum().perp();
177 float Eta =
track.momentum().eta();
179 float z =
track.POCA().z();
189 if (dr2 < dR2Max_ && dr2 >=
dR2Min_) {
197 if (dr2 < dR2Max_ && dr2 >=
dR2Min_) {
202 float trkisol = -999;
203 float trkisolPV = -999;
207 trkisolPV = sumPtPV /
et;
244 float thetaprime = atan(-
REcal /
zv);
246 thetaprime = thetaprime +
M_PI;
247 float etaprime = -
log(
tan(0.5 * thetaprime));
253 float tanhalftheta =
exp(-
eta);
254 float tantheta = 2. * tanhalftheta / (1. - tanhalftheta * tanhalftheta);
267 float thetaprime = atan(tanthetaprime);
269 thetaprime = thetaprime +
M_PI;
270 etaprime = -
log(
tan(0.5 * thetaprime));
281 desc.add<
string>(
"label",
"EG");
285 desc.add<
double>(
"ETmin", -1.);
286 desc.add<
bool>(
"RelativeIsolation",
true);
287 desc.add<
double>(
"IsoCut", 0.23);
288 desc.add<
double>(
"ZMAX", 25.);
289 desc.add<
double>(
"CHI2MAX", 100.);
290 desc.add<
double>(
"PTMINTRA", 2.);
291 desc.add<
double>(
"DRmin", 0.07);
292 desc.add<
double>(
"DRmax", 0.30);
293 desc.add<
bool>(
"PrimaryVtxConstrain",
false);
294 desc.add<
double>(
"DeltaZMax", 0.6);
295 descriptions.
add(
"l1TkEmParticleProducer",
desc);
static constexpr float EtaECal
edm::Ref< EGammaBxCollection > EGammaRef
#define DEFINE_FWK_MODULE(type)
T const * product() const
~L1TkEmParticleProducer() override
const edm::EDGetTokenT< EGammaBxCollection > egToken_
Log< level::Error, false > LogError
const bool primaryVtxConstrain_
static constexpr float REcal
const edm::EDGetTokenT< TkPrimaryVertexCollection > vertexToken_
const_iterator begin(int bx) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
const edm::EDGetTokenT< L1TTTrackCollectionType > trackToken_
std::vector< T >::const_iterator const_iterator
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
const bool relativeIsolation_
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
L1TkEmParticleProducer(const edm::ParameterSet &)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Class to store the L1 Track Trigger tracks.
std::vector< TkPrimaryVertex > TkPrimaryVertexCollection
float CorrectedEta(float eta, float zv) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const_iterator end(int bx) const
static constexpr float ZEcal
std::vector< L1TTTrackType > L1TTTrackCollectionType
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Log< level::Warning, false > LogWarning