CMS 3D CMS Logo

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
 
typedef VertexCollection L1VertexCollectionType
 
typedef Vertex L1VertexType
 
- 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

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

Private Attributes

const float bendChi2Max_
 
const float Chi2RphidofMax_
 
const float Chi2RzdofMax_
 
bool debug_
 
float deltaZ_
 
const bool displaced_
 
vector< double > etaRegions_
 
const int highPtTracks_
 
std::string L1ExtendedMetCollectionName
 
std::string L1MetCollectionName
 
const float maxEta_
 
const float maxPt_
 
const float maxZ0_
 
const float minPt_
 
const int nPSStubsMin_
 
const int nStubsmin_
 
const edm::EDGetTokenT< VertexCollectionpvToken_
 
const edm::EDGetTokenT< L1TTTrackCollectionTypetrackToken_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 
vector< double > z0Thresholds_
 

Detailed Description

Definition at line 33 of file L1TrackerEtMissProducer.cc.

Member Typedef Documentation

◆ L1TTTrackCollectionType

Definition at line 36 of file L1TrackerEtMissProducer.cc.

◆ L1TTTrackType

Definition at line 35 of file L1TrackerEtMissProducer.cc.

◆ L1VertexCollectionType

Definition at line 39 of file L1TrackerEtMissProducer.cc.

◆ L1VertexType

Definition at line 38 of file L1TrackerEtMissProducer.cc.

Constructor & Destructor Documentation

◆ L1TrackerEtMissProducer()

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

Definition at line 75 of file L1TrackerEtMissProducer.cc.

References displaced_, edm::ParameterSet::getParameter(), L1ExtendedMetCollectionName, L1MetCollectionName, and AlCaHLTBitMon_QueryRunRegistry::string.

76  : maxZ0_((float)iConfig.getParameter<double>("maxZ0")),
77  deltaZ_((float)iConfig.getParameter<double>("deltaZ")),
78  Chi2RphidofMax_((float)iConfig.getParameter<double>("chi2rphidofMax")),
79  Chi2RzdofMax_((float)iConfig.getParameter<double>("chi2rzdofMax")),
80  bendChi2Max_((float)iConfig.getParameter<double>("bendChi2Max")),
81  minPt_((float)iConfig.getParameter<double>("minPt")),
82  nStubsmin_(iConfig.getParameter<int>("nStubsmin")),
83  nPSStubsMin_(iConfig.getParameter<int>("nPSStubsMin")),
84  maxPt_((float)iConfig.getParameter<double>("maxPt")),
85  maxEta_((float)iConfig.getParameter<double>("maxEta")),
86  highPtTracks_(iConfig.getParameter<int>("highPtTracks")),
87  displaced_(iConfig.getParameter<bool>("displaced")),
88  z0Thresholds_(iConfig.getParameter<std::vector<double>>("z0Thresholds")),
89  etaRegions_(iConfig.getParameter<std::vector<double>>("etaRegions")),
90  debug_(iConfig.getParameter<bool>("debug")),
91  pvToken_(consumes<L1VertexCollectionType>(iConfig.getParameter<edm::InputTag>("L1VertexInputTag"))),
92  trackToken_(consumes<L1TTTrackCollectionType>(iConfig.getParameter<edm::InputTag>("L1TrackInputTag"))),
93  tTopoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd>(edm::ESInputTag("", ""))) {
94  L1MetCollectionName = (std::string)iConfig.getParameter<std::string>("L1MetCollectionName");
95 
96  if (displaced_) {
97  L1ExtendedMetCollectionName = (std::string)iConfig.getParameter<std::string>("L1MetExtendedCollectionName");
98  produces<TkEtMissCollection>(L1ExtendedMetCollectionName);
99  } else
100  produces<TkEtMissCollection>(L1MetCollectionName);
101 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< VertexCollection > pvToken_
const edm::EDGetTokenT< L1TTTrackCollectionType > trackToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_

◆ ~L1TrackerEtMissProducer()

L1TrackerEtMissProducer::~L1TrackerEtMissProducer ( )
override

Definition at line 103 of file L1TrackerEtMissProducer.cc.

103 {}

Member Function Documentation

◆ beginJob()

void L1TrackerEtMissProducer::beginJob ( void  )
privatevirtual

Definition at line 249 of file L1TrackerEtMissProducer.cc.

249 {}

◆ endJob()

void L1TrackerEtMissProducer::endJob ( void  )
privatevirtual

Definition at line 251 of file L1TrackerEtMissProducer.cc.

251 {}

◆ produce()

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

Definition at line 105 of file L1TrackerEtMissProducer.cc.

References funct::abs(), bendChi2Max_, Chi2RphidofMax_, Chi2RzdofMax_, funct::cos(), debug_, deltaZ_, displaced_, EgHLTOffHistBins_cfi::et, PVValHelper::eta, etaRegions_, edm::EventSetup::getData(), highPtTracks_, iEvent, createfilelist::int, edm::HandleBase::isValid(), L1ExtendedMetCollectionName, L1MetCollectionName, 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_, HLTMuonOfflineAnalyzer_cfi::z0, and z0Thresholds_.

105  {
106  using namespace edm;
107 
108  std::unique_ptr<TkEtMissCollection> METCollection(new TkEtMissCollection);
109 
110  // Tracker Topology
111  const TrackerTopology& tTopo = iSetup.getData(tTopoToken_);
112 
114  iEvent.getByToken(pvToken_, L1VertexHandle);
115 
116  edm::Handle<L1TTTrackCollectionType> L1TTTrackHandle;
117  iEvent.getByToken(trackToken_, L1TTTrackHandle);
118  L1TTTrackCollectionType::const_iterator trackIter;
119 
120  if (!L1VertexHandle.isValid()) {
121  LogError("L1TrackerEtMissProducer") << "\nWarning: VertexCollection not found in the event. Exit\n";
122  return;
123  }
124 
125  if (!L1TTTrackHandle.isValid()) {
126  LogError("L1TrackerEtMissProducer") << "\nWarning: L1TTTrackCollection not found in the event. Exit\n";
127  return;
128  }
129 
130  float sumPx = 0;
131  float sumPy = 0;
132  float etTot = 0;
133  double sumPx_PU = 0;
134  double sumPy_PU = 0;
135  double etTot_PU = 0;
136  float zVTX = L1VertexHandle->begin()->z0();
137 
138  int numtracks = 0;
139  int numqualitytracks = 0;
140  int numassoctracks = 0;
141 
142  for (trackIter = L1TTTrackHandle->begin(); trackIter != L1TTTrackHandle->end(); ++trackIter) {
143  numtracks++;
144  float pt = trackIter->momentum().perp();
145  float phi = trackIter->momentum().phi();
146  float eta = trackIter->momentum().eta();
147  float chi2rphidof = trackIter->chi2XYRed();
148  float chi2rzdof = trackIter->chi2ZRed();
149  float bendChi2 = trackIter->stubPtConsistency();
150  float z0 = trackIter->z0();
151  //unsigned int Sector = trackIter->phiSector();
152  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>>>
153  theStubs = trackIter->getStubRefs();
154  int nstubs = (int)theStubs.size();
155 
156  if (pt < minPt_)
157  continue;
158  if (std::abs(z0) > maxZ0_)
159  continue;
160  if (std::abs(eta) > maxEta_)
161  continue;
162  if (chi2rphidof > Chi2RphidofMax_)
163  continue;
164  if (chi2rzdof > Chi2RzdofMax_)
165  continue;
166  if (bendChi2 > bendChi2Max_)
167  continue;
168 
169  if (maxPt_ > 0 && pt > maxPt_) {
170  if (highPtTracks_ == 0)
171  continue; // ignore these very high PT tracks: truncate
172  if (highPtTracks_ == 1)
173  pt = maxPt_; // saturate
174  }
175 
176  int nPS = 0; // number of stubs in PS modules
177  // loop over the stubs
178  for (unsigned int istub = 0; istub < (unsigned int)theStubs.size(); istub++) {
179  DetId detId(theStubs.at(istub)->getDetId());
180  if (detId.det() == DetId::Detector::Tracker) {
181  if ((detId.subdetId() == StripSubdetector::TOB && tTopo.tobLayer(detId) <= 3) ||
182  (detId.subdetId() == StripSubdetector::TID && tTopo.tidRing(detId) <= 9))
183  nPS++;
184  }
185  }
186 
187  if (nstubs < nStubsmin_)
188  continue;
189  if (nPS < nPSStubsMin_)
190  continue;
191 
192  numqualitytracks++;
193 
194  if (!displaced_) { // if displaced, deltaZ = 3.0 cm, very loose
195  // construct deltaZ cut to be based on track eta
196  for (unsigned int reg = 0; reg < etaRegions_.size() - 1; reg++) {
197  if (std::abs(eta) >= etaRegions_[reg] && std::abs(eta) < etaRegions_[reg + 1]) {
198  deltaZ_ = z0Thresholds_[reg];
199  break;
200  }
201  }
202  if (std::abs(eta) >= etaRegions_[etaRegions_.size() - 1]) {
203  deltaZ_ = z0Thresholds_[etaRegions_.size() - 1];
204  break;
205  }
206  }
207 
208  if (std::abs(z0 - zVTX) <= deltaZ_) {
209  numassoctracks++;
210  sumPx += pt * cos(phi);
211  sumPy += pt * sin(phi);
212  etTot += pt;
213  } else { // PU sums
214  sumPx_PU += pt * cos(phi);
215  sumPy_PU += pt * sin(phi);
216  etTot_PU += pt;
217  }
218  } // end loop over tracks
219 
220  float et = sqrt(sumPx * sumPx + sumPy * sumPy);
221  double etphi = atan2(sumPy, sumPx);
222 
223  math::XYZTLorentzVector missingEt(-sumPx, -sumPy, 0, et);
224 
225  if (debug_) {
226  edm::LogVerbatim("L1TrackerEtMissProducer") << "====Global Pt===="
227  << "\n"
228  << "Px: " << sumPx << "| Py: " << sumPy << "\n"
229  << "====MET==="
230  << "\n"
231  << "MET: " << et << "| Phi: " << etphi << "\n"
232 
233  << "# Intial Tracks: " << numtracks << "\n"
234  << "# Tracks after Quality Cuts: " << numqualitytracks << "\n"
235  << "# Tracks Associated to Vertex: " << numassoctracks << "\n"
236  << "========================================================"
237  << "\n";
238  }
239 
240  int ibx = 0;
241  METCollection->push_back(TkEtMiss(missingEt, TkEtMiss::kMET, etphi, numassoctracks, ibx));
242 
243  if (displaced_)
245  else
247 } // end producer
std::vector< TkEtMiss > TkEtMissCollection
Definition: TkEtMissFwd.h:10
Log< level::Info, true > LogVerbatim
unsigned int tobLayer(const DetId &id) const
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
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int iEvent
Definition: GenABIO.cc:224
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool getData(T &iHolder) const
Definition: EventSetup.h:122
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< VertexCollection > pvToken_
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
const edm::EDGetTokenT< L1TTTrackCollectionType > trackToken_
unsigned int tidRing(const DetId &id) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
static constexpr auto TID
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ bendChi2Max_

const float L1TrackerEtMissProducer::bendChi2Max_
private

Definition at line 54 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ Chi2RphidofMax_

const float L1TrackerEtMissProducer::Chi2RphidofMax_
private

Definition at line 52 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ Chi2RzdofMax_

const float L1TrackerEtMissProducer::Chi2RzdofMax_
private

Definition at line 53 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ debug_

bool L1TrackerEtMissProducer::debug_
private

Definition at line 64 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ deltaZ_

float L1TrackerEtMissProducer::deltaZ_
private

Definition at line 51 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ displaced_

const bool L1TrackerEtMissProducer::displaced_
private

Definition at line 61 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ etaRegions_

vector<double> L1TrackerEtMissProducer::etaRegions_
private

Definition at line 63 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ highPtTracks_

const int L1TrackerEtMissProducer::highPtTracks_
private

Definition at line 60 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ L1ExtendedMetCollectionName

std::string L1TrackerEtMissProducer::L1ExtendedMetCollectionName
private

Definition at line 67 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ L1MetCollectionName

std::string L1TrackerEtMissProducer::L1MetCollectionName
private

Definition at line 66 of file L1TrackerEtMissProducer.cc.

Referenced by L1TrackerEtMissProducer(), and produce().

◆ maxEta_

const float L1TrackerEtMissProducer::maxEta_
private

Definition at line 59 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ maxPt_

const float L1TrackerEtMissProducer::maxPt_
private

Definition at line 58 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ maxZ0_

const float L1TrackerEtMissProducer::maxZ0_
private

Definition at line 50 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ minPt_

const float L1TrackerEtMissProducer::minPt_
private

Definition at line 55 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ nPSStubsMin_

const int L1TrackerEtMissProducer::nPSStubsMin_
private

Definition at line 57 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ nStubsmin_

const int L1TrackerEtMissProducer::nStubsmin_
private

Definition at line 56 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ pvToken_

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

Definition at line 69 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ trackToken_

const edm::EDGetTokenT<L1TTTrackCollectionType> L1TrackerEtMissProducer::trackToken_
private

Definition at line 70 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ tTopoToken_

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

Definition at line 71 of file L1TrackerEtMissProducer.cc.

Referenced by produce().

◆ z0Thresholds_

vector<double> L1TrackerEtMissProducer::z0Thresholds_
private

Definition at line 62 of file L1TrackerEtMissProducer.cc.

Referenced by produce().