CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
tmtt::StubWindowSuggest Class Reference

#include <StubWindowSuggest.h>

Public Member Functions

void printResults () const
 
void process (const TrackerTopology *trackerTopo, const Stub *stub)
 
void setFEWindows (const StubFEWindows *sw)
 
 StubWindowSuggest (const Settings *settings)
 

Private Member Functions

void updateStoredWindow (const TrackerTopology *trackerTopo, const Stub *stub, double bendWind)
 

Private Attributes

const float ptMin_
 
const Settingssettings_
 
std::unique_ptr< StubFEWindowssw_
 

Detailed Description

======================================================================================================== This provides recommendations to CMS for the stub window sizes to be used in the FE electronics. It prints the output as a python configuration file in the form of L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py .

The recommendations are based on the TMTT method of using the stub bend. Whilst they give high efficiency, they do not take into account the requirement to limit the FE electronics band-width,

so tighter cuts may be needed in reality.

Definition at line 28 of file StubWindowSuggest.h.

Constructor & Destructor Documentation

◆ StubWindowSuggest()

tmtt::StubWindowSuggest::StubWindowSuggest ( const Settings settings)
inline

Definition at line 31 of file StubWindowSuggest.h.

31 : settings_(settings), ptMin_(settings->houghMinPt()) {}
const Settings * settings_

Member Function Documentation

◆ printResults()

void tmtt::StubWindowSuggest::printResults ( ) const

Definition at line 63 of file StubWindowSuggest.cc.

References DMR_cfg::cut, and submitPVValidationJobs::text.

Referenced by tmtt::TMTrackProducer::globalEndJob().

63  {
64  PrintL1trk(1) << "==============================================================================";
65  PrintL1trk(1) << " Stub window sizes that TMTT suggests putting inside ";
66  PrintL1trk(1) << " /L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py";
67  PrintL1trk(1) << " (These should give good efficiency, but tighter windows may be needed to";
68  PrintL1trk(1) << " limit the data rate from the FE tracker electronics).";
69  PrintL1trk(1) << "==============================================================================";
70 
71  std::stringstream text;
72  string div;
73 
74  text << "BarrelCut = cms.vdouble( ";
75  div = "";
76  for (const auto& cut : sw_->windowSizeBarrelLayers()) {
77  text << div << cut;
78  div = ", ";
79  }
80  text << "),";
81  PrintL1trk(1) << text.str();
82 
83  PrintL1trk(1) << "TiltedBarrelCutSet = cms.VPSET( ";
84  for (const auto& cutVec : sw_->windowSizeTiltedLayersRings()) {
85  text.str("");
86  text << " cms.PSet( TiltedCut = cms.vdouble(";
87  if (cutVec.empty())
88  text << "0";
89  div = "";
90  for (const auto& cut : cutVec) {
91  text << div << cut;
92  div = ", ";
93  }
94  text << "), ),";
95  PrintL1trk(1) << text.str();
96  }
97  PrintL1trk(1) << "),";
98 
99  PrintL1trk(1) << "EndcapCutSet = cms.VPSET( ";
100  for (const auto& cutVec : sw_->windowSizeEndcapDisksRings()) {
101  text.str("");
102  text << " cms.PSet( EndcapCut = cms.vdouble(";
103  if (cutVec.empty())
104  text << "0";
105  div = "";
106  for (const auto& cut : cutVec) {
107  text << div << cut;
108  div = ", ";
109  }
110  text << "), ),";
111  PrintL1trk(1) << text.str();
112  }
113  PrintL1trk(1) << ")";
114 
115  PrintL1trk(1) << "==============================================================================";
116  }
std::unique_ptr< StubFEWindows > sw_

◆ process()

void tmtt::StubWindowSuggest::process ( const TrackerTopology trackerTopo,
const Stub stub 
)

Definition at line 30 of file StubWindowSuggest.cc.

References funct::abs(), tmtt::Stub::bendCutInFrontend(), createfilelist::int, mutex, and tmtt::Stub::qOverPtOverBend().

30  {
31  static std::mutex myMutex;
32  std::lock_guard<std::mutex> myGuard(myMutex); // Allow only one thread.
33 
34  // Half-size of FE chip bend window corresponding to Pt range in which tracks are to be found.
35  const double invPtMax = 1 / ptMin_;
36  double bendHalfWind = invPtMax / std::abs(stub->qOverPtOverBend());
37  // Increase half-indow size to allow for resolution in bend.
38  bendHalfWind += stub->bendCutInFrontend();
39  // Stub bend is measured here in half-integer values.
40  bendHalfWind = int(2 * bendHalfWind) / 2.;
41 
42  // Compare with half-size of FE bend window stored in arrays.
43  this->updateStoredWindow(trackerTopo, stub, bendHalfWind);
44  }
static std::mutex mutex
Definition: Proxy.cc:8
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void updateStoredWindow(const TrackerTopology *trackerTopo, const Stub *stub, double bendWind)

◆ setFEWindows()

void tmtt::StubWindowSuggest::setFEWindows ( const StubFEWindows sw)

Definition at line 18 of file StubWindowSuggest.cc.

References mutex.

Referenced by tmtt::TMTrackProducer::beginRun().

18  {
19  static std::mutex myMutex;
20  std::lock_guard<std::mutex> myGuard(myMutex); // Allow only one thread.
21  // Only need to create FE windows once.
22  if (not sw_) {
23  sw_ = std::make_unique<StubFEWindows>(*sw); // Copy
24  sw_->setZero();
25  }
26  }
std::unique_ptr< StubFEWindows > sw_
static std::mutex mutex
Definition: Proxy.cc:8

◆ updateStoredWindow()

void tmtt::StubWindowSuggest::updateStoredWindow ( const TrackerTopology trackerTopo,
const Stub stub,
double  bendWind 
)
private

Definition at line 48 of file StubWindowSuggest.cc.

References tmtt::TrackerModule::detId(), and tmtt::Stub::trackerModule().

50  {
51  // Code accessing geometry inspired by L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc
52 
53  DetId stDetId(stub->trackerModule()->detId());
54 
55  double* storedHalfWindow = sw_->storedWindowSize(trackerTopo, stDetId);
56 
57  if (*storedHalfWindow < bendHalfWind)
58  *storedHalfWindow = bendHalfWind;
59  }
std::unique_ptr< StubFEWindows > sw_
Definition: DetId.h:17

Member Data Documentation

◆ ptMin_

const float tmtt::StubWindowSuggest::ptMin_
private

Definition at line 49 of file StubWindowSuggest.h.

◆ settings_

const Settings* tmtt::StubWindowSuggest::settings_
private

Definition at line 48 of file StubWindowSuggest.h.

◆ sw_

std::unique_ptr<StubFEWindows> tmtt::StubWindowSuggest::sw_
private

Definition at line 52 of file StubWindowSuggest.h.