CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
L1TrackerEtMissProducer Class Reference
Inheritance diagram for L1TrackerEtMissProducer:
edm::stream::EDProducer<>

Public Types

typedef std::vector< L1TTTrackTypeL1TTTrackCollectionType
 
typedef TTTrack< Ref_Phase2TrackerDigi_L1TTTrackType
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

 L1TrackerEtMissProducer (const edm::ParameterSet &)
 
 ~L1TrackerEtMissProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

float bendChi2Max_
 
float chi2dofMax_
 
float deltaZ_
 
bool displaced_
 
int highPtTracks_
 
float maxEta_
 
float maxPt_
 
float maxZ0_
 
float minPt_
 
int nPSStubsMin_
 
int nStubsmin_
 
const edm::EDGetTokenT< TkPrimaryVertexCollectionpvToken_
 
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 

Detailed Description

Definition at line 30 of file L1TrackerEtMissProducer.cc.

Member Typedef Documentation

◆ L1TTTrackCollectionType

Definition at line 33 of file L1TrackerEtMissProducer.cc.

◆ L1TTTrackType

Definition at line 32 of file L1TrackerEtMissProducer.cc.

Constructor & Destructor Documentation

◆ L1TrackerEtMissProducer()

L1TrackerEtMissProducer::L1TrackerEtMissProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 62 of file L1TrackerEtMissProducer.cc.

63  : pvToken_(consumes<TkPrimaryVertexCollection>(iConfig.getParameter<edm::InputTag>("L1VertexInputTag"))),
65  iConfig.getParameter<edm::InputTag>("L1TrackInputTag"))),
66  tTopoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd>(edm::ESInputTag("", ""))) {
67  maxZ0_ = (float)iConfig.getParameter<double>("maxZ0");
68  deltaZ_ = (float)iConfig.getParameter<double>("deltaZ");
69  chi2dofMax_ = (float)iConfig.getParameter<double>("chi2dofMax");
70  bendChi2Max_ = (float)iConfig.getParameter<double>("bendChi2Max");
71  minPt_ = (float)iConfig.getParameter<double>("minPt");
72  nStubsmin_ = iConfig.getParameter<int>("nStubsmin");
73  nPSStubsMin_ = iConfig.getParameter<int>("nPSStubsMin");
74  maxPt_ = (float)iConfig.getParameter<double>("maxPt");
75  maxEta_ = (float)iConfig.getParameter<double>("maxEta");
76  highPtTracks_ = iConfig.getParameter<int>("highPtTracks");
77  displaced_ = iConfig.getParameter<bool>("displaced");
78 
79  if (displaced_)
80  produces<TkEtMissCollection>("L1TrackerEtMissExtended");
81  else
82  produces<TkEtMissCollection>("L1TrackerEtMiss");
83 }

References bendChi2Max_, chi2dofMax_, deltaZ_, displaced_, dqmMemoryStats::float, edm::ParameterSet::getParameter(), highPtTracks_, maxEta_, maxPt_, maxZ0_, minPt_, nPSStubsMin_, and nStubsmin_.

◆ ~L1TrackerEtMissProducer()

L1TrackerEtMissProducer::~L1TrackerEtMissProducer ( )
override

Definition at line 85 of file L1TrackerEtMissProducer.cc.

85 {}

Member Function Documentation

◆ produce()

void L1TrackerEtMissProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 87 of file L1TrackerEtMissProducer.cc.

87  {
88  using namespace edm;
89 
90  std::unique_ptr<TkEtMissCollection> METCollection(new TkEtMissCollection);
91 
92  // Tracker Topology
93  const TrackerTopology& tTopo = iSetup.getData(tTopoToken_);
94 
96  iEvent.getByToken(pvToken_, L1VertexHandle);
97 
99  iEvent.getByToken(trackToken_, L1TTTrackHandle);
100  L1TTTrackCollectionType::const_iterator trackIter;
101 
102  if (!L1VertexHandle.isValid()) {
103  LogError("L1TrackerEtMissProducer") << "\nWarning: TkPrimaryVertexCollection not found in the event. Exit\n";
104  return;
105  }
106 
107  if (!L1TTTrackHandle.isValid()) {
108  LogError("L1TrackerEtMissProducer") << "\nWarning: L1TTTrackCollection not found in the event. Exit\n";
109  return;
110  }
111 
112  float sumPx = 0;
113  float sumPy = 0;
114  float etTot = 0;
115  double sumPx_PU = 0;
116  double sumPy_PU = 0;
117  double etTot_PU = 0;
118  float zVTX = L1VertexHandle->begin()->zvertex();
119 
120  for (trackIter = L1TTTrackHandle->begin(); trackIter != L1TTTrackHandle->end(); ++trackIter) {
121  float pt = trackIter->momentum().perp();
122  float phi = trackIter->momentum().phi();
123  float eta = trackIter->momentum().eta();
124  float chi2dof = trackIter->chi2Red();
125  float bendChi2 = trackIter->stubPtConsistency();
126  float z0 = trackIter->z0();
127  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_> >, TTStub<Ref_Phase2TrackerDigi_> > >
128  theStubs = trackIter->getStubRefs();
129  int nstubs = (int)theStubs.size();
130 
131  if (pt < minPt_)
132  continue;
133  if (fabs(z0) > maxZ0_)
134  continue;
135  if (fabs(eta) > maxEta_)
136  continue;
137  if (chi2dof > chi2dofMax_)
138  continue;
139  if (bendChi2 > bendChi2Max_)
140  continue;
141 
142  if (maxPt_ > 0 && pt > maxPt_) {
143  if (highPtTracks_ == 0)
144  continue; // ignore these very high PT tracks: truncate
145  if (highPtTracks_ == 1)
146  pt = maxPt_; // saturate
147  }
148 
149  int nPS = 0; // number of stubs in PS modules
150  // loop over the stubs
151  for (unsigned int istub = 0; istub < (unsigned int)theStubs.size(); istub++) {
152  DetId detId(theStubs.at(istub)->getDetId());
153  if (detId.det() == DetId::Detector::Tracker) {
154  if ((detId.subdetId() == StripSubdetector::TOB && tTopo.tobLayer(detId) <= 3) ||
155  (detId.subdetId() == StripSubdetector::TID && tTopo.tidRing(detId) <= 9))
156  nPS++;
157  }
158  }
159 
160  if (nstubs < nStubsmin_)
161  continue;
162  if (nPS < nPSStubsMin_)
163  continue;
164 
165  if (!displaced_) { // if displaced, deltaZ = 3.0 cm, very loose
166  // construct deltaZ cut to be based on track eta
167  if (fabs(eta) >= 0 && fabs(eta) < 0.7)
168  deltaZ_ = 0.4;
169  else if (fabs(eta) >= 0.7 && fabs(eta) < 1.0)
170  deltaZ_ = 0.6;
171  else if (fabs(eta) >= 1.0 && fabs(eta) < 1.2)
172  deltaZ_ = 0.76;
173  else if (fabs(eta) >= 1.2 && fabs(eta) < 1.6)
174  deltaZ_ = 1.0;
175  else if (fabs(eta) >= 1.6 && fabs(eta) < 2.0)
176  deltaZ_ = 1.7;
177  else if (fabs(eta) >= 2.0 && fabs(eta) <= 2.4)
178  deltaZ_ = 2.2;
179  }
180 
181  if (fabs(z0 - zVTX) <= deltaZ_) {
182  sumPx += pt * cos(phi);
183  sumPy += pt * sin(phi);
184  etTot += pt;
185  } else { // PU sums
186  sumPx_PU += pt * cos(phi);
187  sumPy_PU += pt * sin(phi);
188  etTot_PU += pt;
189  }
190  } // end loop over tracks
191 
192  float et = sqrt(sumPx * sumPx + sumPy * sumPy);
193  double etmiss_PU = sqrt(sumPx_PU * sumPx_PU + sumPy_PU * sumPy_PU);
194 
195  math::XYZTLorentzVector missingEt(-sumPx, -sumPy, 0, et);
196  int ibx = 0;
197  METCollection->push_back(TkEtMiss(missingEt, TkEtMiss::kMET, etTot, etmiss_PU, etTot_PU, ibx));
198 
199  if (displaced_)
200  iEvent.put(std::move(METCollection), "L1TrackerEtMissExtended");
201  else
202  iEvent.put(std::move(METCollection), "L1TrackerEtMiss");
203 } // end producer

References bendChi2Max_, chi2dofMax_, funct::cos(), deltaZ_, displaced_, EgHLTOffHistBins_cfi::et, PVValHelper::eta, edm::EventSetup::getData(), highPtTracks_, iEvent, createfilelist::int, edm::HandleBase::isValid(), maxEta_, maxPt_, maxZ0_, minPt_, eostools::move(), nPSStubsMin_, nStubsmin_, phi, DiDispStaMuonMonitor_cfi::pt, pvToken_, funct::sin(), mathSSE::sqrt(), StripSubdetector::TID, TrackerTopology::tidRing(), StripSubdetector::TOB, TrackerTopology::tobLayer(), align::Tracker, trackToken_, tTopoToken_, and HLTMuonOfflineAnalyzer_cfi::z0.

Member Data Documentation

◆ bendChi2Max_

float L1TrackerEtMissProducer::bendChi2Max_
private

Definition at line 48 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ chi2dofMax_

float L1TrackerEtMissProducer::chi2dofMax_
private

Definition at line 47 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ deltaZ_

float L1TrackerEtMissProducer::deltaZ_
private

Definition at line 45 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ displaced_

bool L1TrackerEtMissProducer::displaced_
private

Definition at line 54 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ highPtTracks_

int L1TrackerEtMissProducer::highPtTracks_
private

Definition at line 53 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ maxEta_

float L1TrackerEtMissProducer::maxEta_
private

Definition at line 46 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ maxPt_

float L1TrackerEtMissProducer::maxPt_
private

Definition at line 52 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ maxZ0_

float L1TrackerEtMissProducer::maxZ0_
private

Definition at line 44 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ minPt_

float L1TrackerEtMissProducer::minPt_
private

Definition at line 49 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ nPSStubsMin_

int L1TrackerEtMissProducer::nPSStubsMin_
private

Definition at line 51 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ nStubsmin_

int L1TrackerEtMissProducer::nStubsmin_
private

Definition at line 50 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ pvToken_

const edm::EDGetTokenT<TkPrimaryVertexCollection> L1TrackerEtMissProducer::pvToken_
private

Definition at line 56 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ trackToken_

const edm::EDGetTokenT<std::vector<TTTrack<Ref_Phase2TrackerDigi_> > > L1TrackerEtMissProducer::trackToken_
private

Definition at line 57 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ tTopoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> L1TrackerEtMissProducer::tTopoToken_
private

Definition at line 58 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

l1t::TkEtMiss
Definition: TkEtMiss.h:9
edm::ESInputTag
Definition: ESInputTag.h:87
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
TTTrack
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
L1TrackerEtMissProducer::maxPt_
float maxPt_
Definition: L1TrackerEtMissProducer.cc:52
edm::Handle
Definition: AssociativeIterator.h:50
TrackerTopology::tidRing
unsigned int tidRing(const DetId &id) const
Definition: TrackerTopology.h:218
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
align::Tracker
Definition: StructureType.h:70
reco::METCollection
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:22
l1t::TkEtMissCollection
std::vector< TkEtMiss > TkEtMissCollection
Definition: TkEtMissFwd.h:10
DetId
Definition: DetId.h:17
L1TrackerEtMissProducer::nPSStubsMin_
int nPSStubsMin_
Definition: L1TrackerEtMissProducer.cc:51
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
PVValHelper::eta
Definition: PVValidationHelpers.h:70
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
TTStub
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
L1TrackerEtMissProducer::trackToken_
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
Definition: L1TrackerEtMissProducer.cc:57
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
L1TrackerEtMissProducer::nStubsmin_
int nStubsmin_
Definition: L1TrackerEtMissProducer.cc:50
L1TrackerEtMissProducer::minPt_
float minPt_
Definition: L1TrackerEtMissProducer.cc:49
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
L1TrackerEtMissProducer::maxEta_
float maxEta_
Definition: L1TrackerEtMissProducer.cc:46
L1TrackerEtMissProducer::deltaZ_
float deltaZ_
Definition: L1TrackerEtMissProducer.cc:45
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
DDAxes::phi
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1TrackerEtMissProducer::bendChi2Max_
float bendChi2Max_
Definition: L1TrackerEtMissProducer.cc:48
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
L1TrackerEtMissProducer::maxZ0_
float maxZ0_
Definition: L1TrackerEtMissProducer.cc:44
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
L1TrackerEtMissProducer::displaced_
bool displaced_
Definition: L1TrackerEtMissProducer.cc:54
L1TrackerEtMissProducer::tTopoToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Definition: L1TrackerEtMissProducer.cc:58
METCollection
Collection of MET.
L1TrackerEtMissProducer::highPtTracks_
int highPtTracks_
Definition: L1TrackerEtMissProducer.cc:53
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
L1TrackerEtMissProducer::pvToken_
const edm::EDGetTokenT< TkPrimaryVertexCollection > pvToken_
Definition: L1TrackerEtMissProducer.cc:56
edm::InputTag
Definition: InputTag.h:15
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
L1TrackerEtMissProducer::chi2dofMax_
float chi2dofMax_
Definition: L1TrackerEtMissProducer.cc:47