Skip to content

Commit

Permalink
latest comments addressed.
Browse files Browse the repository at this point in the history
  • Loading branch information
tschuh committed Mar 25, 2020
1 parent b7491bf commit d7a9441
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 27 deletions.
1 change: 0 additions & 1 deletion L1Trigger/TrackerDTC/interface/DTC.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace trackerDTC {
// pop_front function which additionally returns copy of deleted front
Stub* pop_front(Stubs& stubs);

private:
// helper class to store configurations
Settings* settings_;
// container of stubs on this DTC
Expand Down
2 changes: 0 additions & 2 deletions L1Trigger/TrackerDTC/interface/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace trackerDTC {
// handles 2 pi overflow
double deltaPhi(double phi) { return reco::deltaPhi(phi, 0.); }

private:
// track trigger dtc id [0-215]
int dtcId_;
// DTC module id [0-71]
Expand All @@ -35,7 +34,6 @@ namespace trackerDTC {
int blockId_;
// routing block channel id [0-35]
int blockChannelId_;

// +z or -z
bool side_;
// barrel or endcap
Expand Down
1 change: 0 additions & 1 deletion L1Trigger/TrackerDTC/interface/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ namespace trackerDTC {
// collection of modules connected to a specific dtc
const std::vector<Module*>& modules(int dtcId) const;

public:
// ED parameter

edm::InputTag inputTagTTStubDetSetVec() const { return inputTagTTStubDetSetVec_; }
Expand Down
1 change: 0 additions & 1 deletion L1Trigger/TrackerDTC/interface/SettingsHybrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace trackerDTC {
public:
enum SensorType { barrelPS, barrel2S, diskPS, disk2S, numSensorTypes };

public:
SettingsHybrid(const edm::ParameterSet& iConfig, Settings* settings);
~SettingsHybrid() {}

Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/TrackerDTC/interface/SettingsTMTT.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace trackerDTC {
int numBinsPhiT() const { return numBinsPhiT_; }
double chosenRofZ() const { return chosenRofZ_; }
double beamWindowZ() const { return beamWindowZ_; }
double bounderiesEta(const int& eta) const { return bounderiesEta_[eta]; }
double boundariesEta(const int& eta) const { return boundariesEta_[eta]; }

// format specific parameter

Expand Down Expand Up @@ -55,7 +55,7 @@ namespace trackerDTC {
// has to be >= max stub z / 2 in cm
const double halfLength_;
// defining r-z sector shape
const std::vector<double> bounderiesEta_;
const std::vector<double> boundariesEta_;

// derived format specific parameter

Expand Down
1 change: 0 additions & 1 deletion L1Trigger/TrackerDTC/interface/Stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ namespace trackerDTC {
// 64 bit stub in tmtt data format
TTDTC::BV formatTMTT(int region) const;

private:
// stores, calculates and provides run-time constants
Settings* settings_;
// underlying TTStubRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,21 @@ using namespace edm;

namespace trackerDTC {

/*! \class TrackerDTCProducer
/*! \class trackerDTC::Producer
* \brief Class to produce hardware like structured TTStub Collection used by Track Trigger emulators
* \author Thomas Schuh
* \date 2020, Jan
*/
class Producer : public stream::EDProducer<> {
public:
explicit Producer(const ParameterSet&);

~Producer() override {}

private:
void beginRun(const Run&, const EventSetup&) override;

void produce(Event&, const EventSetup&) override;

void endJob() {}

private:
// helper class to store configurations
Settings settings_;
// collection of outer tracker sensor modules
Expand Down Expand Up @@ -123,8 +119,7 @@ namespace trackerDTC {

// apply cabling map
auto acc = [](int& sum, const TTStubDetSet* module) { return sum += module ? module->size() : 0; };
static const vector<const TTStubDetSet*> nullDTC(settings_.numModulesPerDTC(), nullptr);
vector<vector<const TTStubDetSet*>> ttDTCs(settings_.numDTCs(), nullDTC);
vector<vector<const TTStubDetSet*>> ttDTCs(settings_.numDTCs(), vector<const TTStubDetSet*>(settings_.numModulesPerDTC(), nullptr));
TTStubDetSetVec::const_iterator ttModule;
for (ttModule = handleTTStubDetSetVec->begin(); ttModule != handleTTStubDetSetVec->end(); ttModule++) {
// DetSetVec->detId + 1 = tk layout det id
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/TrackerDTC/python/Format_TMTT_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
ChosenRofZ = cms.double( 50. ), # critical radius defining r-z sector shape in cm
BeamWindowZ = cms.double( 15. ), # half lumi region size in cm
HalfLength = cms.double( 270. ), # has to be >= max stub z / 2 in cm
BounderiesEta = cms.vdouble( -2.40, -2.08, -1.68, -1.26, -0.90, -0.62, -0.41, -0.20, 0.0, 0.20, 0.41, 0.62, 0.90, 1.26, 1.68, 2.08, 2.40 ) # defining r-z sector shape
BoundariesEta = cms.vdouble( -2.40, -2.08, -1.68, -1.26, -0.90, -0.62, -0.41, -0.20, 0.0, 0.20, 0.41, 0.62, 0.90, 1.26, 1.68, 2.08, 2.40 ) # defining r-z sector shape

)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ def useTMTT(process):
from L1Trigger.TrackerDTC.Producer_Defaults_cfi import TrackerDTCProducer_params
from L1Trigger.TrackerDTC.Format_TMTT_cfi import TrackerDTCFormat_params
TrackerDTCProducer_params.ParamsED.DataFormat = "TMTT"
process.TrackerDTCProducer = cms.EDProducer('TrackerDTCProducer', TrackerDTCProducer_params, TrackerDTCFormat_params )
process.TrackerDTCProducer = cms.EDProducer('trackerDTC::Producer', TrackerDTCProducer_params, TrackerDTCFormat_params )
return process
2 changes: 1 addition & 1 deletion L1Trigger/TrackerDTC/src/Settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ namespace trackerDTC {
// check current coniguration consistency with input configuration
void Settings::checkConfiguration() {
const double bField = magneticField_->inTesla(GlobalPoint(0., 0., 0.)).z();
if (fabs(bField - bField_) > bFieldError_) {
if (abs(bField - bField_) > bFieldError_) {
cms::Exception exception("LogicError");
exception << "Magnetic Field from EventSetup (" << bField << ") differs more then " << bFieldError_
<< " from configured value (" << bField_ << ").";
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/TrackerDTC/src/SettingsHybrid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ namespace trackerDTC {

auto comp = [](const double& lhs, const double& rhs) { return lhs > 0. ? (rhs > 0. ? lhs < rhs : true) : false; };

const double rangeRT = 2. * max(fabs(settings->outerRadius_ - settings->chosenRofPhi_),
fabs(settings->innerRadius_ - settings->chosenRofPhi_));
const double rangeRT = 2. * max(abs(settings->outerRadius_ - settings->chosenRofPhi_),
abs(settings->innerRadius_ - settings->chosenRofPhi_));
const double rangePhi = settings->baseRegion_ + rangeRT * settings->rangeQoverPt_ / 2.;

bool error(false);
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/TrackerDTC/src/SettingsTMTT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ namespace trackerDTC {
chosenRofZ_(paramsFormat_.getParameter<double>("ChosenRofZ")),
beamWindowZ_(paramsFormat_.getParameter<double>("BeamWindowZ")),
halfLength_(paramsFormat_.getParameter<double>("HalfLength")),
bounderiesEta_(paramsFormat_.getParameter<vector<double> >("BounderiesEta")) {
boundariesEta_(paramsFormat_.getParameter<vector<double> >("BoundariesEta")) {
// number of eta sectors used during track finding
numSectorsEta_ = bounderiesEta_.size() - 1;
numSectorsEta_ = boundariesEta_.size() - 1;
// cut on zT
maxZT_ = settings->maxCot_ * chosenRofZ_;
// width of phi sector in rad
Expand Down
10 changes: 5 additions & 5 deletions L1Trigger/TrackerDTC/src/Stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace trackerDTC {
// extrapolated z at radius T assuming z0=0
const double zT = settings_->tmtt()->chosenRofZ() * z_ / r_;
// extrapolated z0 window at radius T
const double dZT = settings_->tmtt()->beamWindowZ() * fabs(1. - settings_->tmtt()->chosenRofZ() / r_);
const double dZT = settings_->tmtt()->beamWindowZ() * abs(1. - settings_->tmtt()->chosenRofZ() / r_);
double zTMin = zT - dZT;
double zTMax = zT + dZT;
if (zTMin >= settings_->tmtt()->maxZT() || zTMax < -settings_->tmtt()->maxZT())
Expand All @@ -73,7 +73,7 @@ namespace trackerDTC {
cot_ = {zTMin / settings_->tmtt()->chosenRofZ(), zTMax / settings_->tmtt()->chosenRofZ()};

} else if (settings_->dataFormat() == "Hybrid") {
if (fabs(z_ / r_) > settings_->maxCot())
if (abs(z_ / r_) > settings_->maxCot())
// did not pass eta cut
valid_ = false;
}
Expand Down Expand Up @@ -129,7 +129,7 @@ namespace trackerDTC {

// decode bend
const vector<double>& bendEncoding = module->bendEncoding_;
const int uBend = distance(bendEncoding.begin(), find(bendEncoding.begin(), bendEncoding.end(), fabs(bend_)));
const int uBend = distance(bendEncoding.begin(), find(bendEncoding.begin(), bendEncoding.end(), abs(bend_)));
bend_ = pow(-1, signbit(bend_)) * (uBend - (int)bendEncoding.size() / 2);
}

Expand Down Expand Up @@ -211,12 +211,12 @@ namespace trackerDTC {
// assign stub to eta sectors within a processing region
pair<int, int> setcorEta({0, format->numSectorsEta() - 1});
for (int bin = 0; bin < format->numSectorsEta(); bin++)
if (asinh(cot_.first) < format->bounderiesEta(bin + 1)) {
if (asinh(cot_.first) < format->boundariesEta(bin + 1)) {
setcorEta.first = bin;
break;
}
for (int bin = setcorEta.first; bin < format->numSectorsEta(); bin++)
if (asinh(cot_.second) < format->bounderiesEta(bin + 1)) {
if (asinh(cot_.second) < format->boundariesEta(bin + 1)) {
setcorEta.second = bin;
break;
}
Expand Down

0 comments on commit d7a9441

Please sign in to comment.