CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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
< L1TTTrackType
L1TTTrackCollectionType
 
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
< TkPrimaryVertexCollection
pvToken_
 
const edm::EDGetTokenT
< std::vector< TTTrack
< Ref_Phase2TrackerDigi_ > > > 
trackToken_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken_
 

Detailed Description

Definition at line 30 of file L1TrackerEtMissProducer.cc.

Member Typedef Documentation

Definition at line 33 of file L1TrackerEtMissProducer.cc.

Definition at line 32 of file L1TrackerEtMissProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 62 of file L1TrackerEtMissProducer.cc.

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

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 }
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< TkPrimaryVertexCollection > pvToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
L1TrackerEtMissProducer::~L1TrackerEtMissProducer ( )
override

Definition at line 85 of file L1TrackerEtMissProducer.cc.

85 {}

Member Function Documentation

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

Definition at line 87 of file L1TrackerEtMissProducer.cc.

References bendChi2Max_, chi2dofMax_, funct::cos(), deltaZ_, displaced_, PVValHelper::eta, edm::Event::getByToken(), edm::EventSetup::getData(), highPtTracks_, maxEta_, maxPt_, maxZ0_, minPt_, eostools::move(), nPSStubsMin_, nStubsmin_, phi, DiDispStaMuonMonitor_cfi::pt, edm::Event::put(), pvToken_, funct::sin(), mathSSE::sqrt(), StripSubdetector::TID, StripSubdetector::TOB, align::Tracker, trackToken_, and tTopoToken_.

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
std::vector< TkEtMiss > TkEtMissCollection
Definition: TkEtMissFwd.h:10
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Log< level::Error, false > LogError
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:22
bool getData(T &iHolder) const
Definition: EventSetup.h:128
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
T sqrt(T t)
Definition: SSEVec.h:19
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
def move
Definition: eostools.py:511
static constexpr auto TOB
Collection of MET.
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
Definition: DetId.h:17
const edm::EDGetTokenT< TkPrimaryVertexCollection > pvToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
static constexpr auto TID

Member Data Documentation

float L1TrackerEtMissProducer::bendChi2Max_
private

Definition at line 48 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

float L1TrackerEtMissProducer::chi2dofMax_
private

Definition at line 47 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

float L1TrackerEtMissProducer::deltaZ_
private

Definition at line 45 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

bool L1TrackerEtMissProducer::displaced_
private

Definition at line 54 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

int L1TrackerEtMissProducer::highPtTracks_
private

Definition at line 53 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

float L1TrackerEtMissProducer::maxEta_
private

Definition at line 46 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

float L1TrackerEtMissProducer::maxPt_
private

Definition at line 52 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

float L1TrackerEtMissProducer::maxZ0_
private

Definition at line 44 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

float L1TrackerEtMissProducer::minPt_
private

Definition at line 49 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

int L1TrackerEtMissProducer::nPSStubsMin_
private

Definition at line 51 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

int L1TrackerEtMissProducer::nStubsmin_
private

Definition at line 50 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

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

Definition at line 56 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

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

Definition at line 57 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

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

Definition at line 58 of file L1TrackerEtMissProducer.cc.

Referenced by produce().