CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
trackerTFP::ProducerZHTout Class Reference

transforms SF output into TTTracks More...

Inheritance diagram for trackerTFP::ProducerZHTout:
edm::stream::EDProducer<>

Public Member Functions

 ProducerZHTout (const ParameterSet &)
 
 ~ProducerZHTout () 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 beginRun (const Run &, const EventSetup &) override
 
virtual void endJob ()
 
void produce (Event &, const EventSetup &) override
 

Private Attributes

const DataFormatsdataFormats_ = nullptr
 
EDGetTokenT< StreamsStubedGetToken_
 
EDPutTokenT< vector< TTTrack< Ref_Phase2TrackerDigi_ > > > edPutToken_
 
ESGetToken< DataFormats, DataFormatsRcdesGetTokenDataFormats_
 
ESGetToken< Setup, SetupRcdesGetTokenSetup_
 
ParameterSet iConfig_
 
const Setupsetup_ = nullptr
 

Additional Inherited Members

- 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
 

Detailed Description

transforms SF output into TTTracks

Author
Thomas Schuh
Date
2020, July

Definition at line 32 of file ProducerZHTout.cc.

Constructor & Destructor Documentation

◆ ProducerZHTout()

trackerTFP::ProducerZHTout::ProducerZHTout ( const ParameterSet iConfig)
explicit

Definition at line 58 of file ProducerZHTout.cc.

References edGetToken_, edPutToken_, esGetTokenDataFormats_, esGetTokenSetup_, edm::ParameterSet::getParameter(), HLT_2022v15_cff::InputTag, and label.

58  : iConfig_(iConfig) {
59  const string& label = iConfig.getParameter<string>("LabelZHT");
60  const string& branchAcceptedStubs = iConfig.getParameter<string>("BranchAcceptedStubs");
61  const string& branchAcceptedTracks = iConfig.getParameter<string>("BranchAcceptedTracks");
62  // book in- and output ED products
63  edGetToken_ = consumes<StreamsStub>(InputTag(label, branchAcceptedStubs));
64  edPutToken_ = produces<vector<TTTrack<Ref_Phase2TrackerDigi_>>>(branchAcceptedTracks);
65  // book ES products
66  esGetTokenSetup_ = esConsumes<Setup, SetupRcd, Transition::BeginRun>();
67  esGetTokenDataFormats_ = esConsumes<DataFormats, DataFormatsRcd, Transition::BeginRun>();
68  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
char const * label
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
EDGetTokenT< StreamsStub > edGetToken_
EDPutTokenT< vector< TTTrack< Ref_Phase2TrackerDigi_ > > > edPutToken_

◆ ~ProducerZHTout()

trackerTFP::ProducerZHTout::~ProducerZHTout ( )
inlineoverride

Definition at line 35 of file ProducerZHTout.cc.

35 {}

Member Function Documentation

◆ beginRun()

void trackerTFP::ProducerZHTout::beginRun ( const Run iRun,
const EventSetup iSetup 
)
overrideprivate

Definition at line 70 of file ProducerZHTout.cc.

References tt::Setup::checkHistory(), tt::Setup::configurationSupported(), dataFormats_, esGetTokenDataFormats_, esGetTokenSetup_, edm::EventSetup::getData(), edm::ParameterSet::getParameter(), iConfig_, edm::Run::processHistory(), and setup_.

70  {
71  // helper class to store configurations
72  setup_ = &iSetup.getData(esGetTokenSetup_);
74  return;
75  // check process history if desired
76  if (iConfig_.getParameter<bool>("CheckHistory"))
78  // helper class to extract structured data from tt::Frames
80  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const DataFormats * dataFormats_
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
bool configurationSupported() const
Definition: Setup.h:60
ProcessHistory const & processHistory() const
Definition: Run.cc:115
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:238

◆ endJob()

virtual void trackerTFP::ProducerZHTout::endJob ( void  )
inlineprivatevirtual

Definition at line 40 of file ProducerZHTout.cc.

40 {}

◆ produce()

void trackerTFP::ProducerZHTout::produce ( Event iEvent,
const EventSetup iSetup 
)
overrideprivate

Definition at line 82 of file ProducerZHTout.cc.

References tt::Setup::configurationSupported(), trackerTFP::cot, dataFormats_, HLT_2022v15_cff::distance, edGetToken_, edPutToken_, trackerTFP::DataFormat::floating(), trackerTFP::DataFormats::format(), patZpeak::handle, mps_fire::i, l1ctLayer2EG_cff::id, iEvent, trackerTFP::inv2R, trackerTFP::DataFormats::numChannel(), tt::Setup::numRegions(), tt::Setup::numSectorsPhi(), trackerTFP::phiT, HLT_2022v15_cff::region, setup_, cms::cuda::stream, HLT_2022v15_cff::streams, HcalDetIdTransform::transform(), trackerTFP::Stub< Ts >::ttStubRef(), trackerTFP::zht, tt::Setup::zhtMaxTracks(), and trackerTFP::zT.

82  {
87  // empty SFout product
88  deque<TTTrack<Ref_Phase2TrackerDigi_>> ttTracks;
89  // read in SF Product and produce SFout product
92  iEvent.getByToken<StreamsStub>(edGetToken_, handle);
93  const StreamsStub& streams = *handle.product();
94  for (int region = 0; region < setup_->numRegions(); region++) {
95  for (int channel = 0; channel < dataFormats_->numChannel(Process::zht); channel++) {
96  const int index = region * dataFormats_->numChannel(Process::zht) + channel;
97  // convert stream to stubs
98  const StreamStub& stream = streams[index];
99  vector<StubZHT> stubs;
100  stubs.reserve(stream.size());
101  for (const FrameStub& frame : stream)
102  if (frame.first.isNonnull())
103  stubs.emplace_back(frame, dataFormats_);
104  // form tracks
105  int i(0);
106  for (auto it = stubs.begin(); it != stubs.end();) {
107  const auto start = it;
108  const int id = it->trackId();
109  auto different = [id](const StubZHT& stub) { return id != stub.trackId(); };
110  it = find_if(it, stubs.end(), different);
111  vector<TTStubRef> ttStubRefs;
112  ttStubRefs.reserve(distance(start, it));
113  transform(start, it, back_inserter(ttStubRefs), [](const StubZHT& stub) { return stub.ttStubRef(); });
114  const double zT = dfZT.floating(start->zT());
115  const double cot = dfCot.floating(start->cot());
116  const double phiT = dfPhiT.floating(start->phiT());
117  const double inv2R = dfinv2R.floating(start->inv2R());
118  ttTracks.emplace_back(inv2R, phiT, cot, zT, 0., 0., 0., 0., 0., 0, 0, 0.);
119  ttTracks.back().setStubRefs(ttStubRefs);
120  ttTracks.back().setPhiSector(start->sectorPhi() + region * setup_->numSectorsPhi());
121  ttTracks.back().setEtaSector(start->sectorEta());
122  ttTracks.back().setTrackSeedType(start->trackId());
123  if (i++ == setup_->zhtMaxTracks())
124  break;
125  }
126  }
127  }
128  }
129  // store product
130  iEvent.emplace(edPutToken_, ttTracks.begin(), ttTracks.end());
131  }
Definition: start.py:1
int numSectorsPhi() const
Definition: Setup.h:409
std::pair< TTStubRef, Frame > FrameStub
Definition: TTTypes.h:60
std::vector< StreamStub > StreamsStub
Definition: TTTypes.h:66
std::vector< FrameStub > StreamStub
Definition: TTTypes.h:63
const DataFormats * dataFormats_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
int numChannel(Process p) const
Definition: DataFormats.h:498
int iEvent
Definition: GenABIO.cc:224
int zhtMaxTracks() const
Definition: Setup.h:471
bool configurationSupported() const
Definition: Setup.h:60
EDGetTokenT< StreamsStub > edGetToken_
int numRegions() const
Definition: Setup.h:345
EDPutTokenT< vector< TTTrack< Ref_Phase2TrackerDigi_ > > > edPutToken_
const DataFormat & format(Variable v, Process p) const
Definition: DataFormats.h:506
unsigned transform(const HcalDetId &id, unsigned transformCode)

Member Data Documentation

◆ dataFormats_

const DataFormats* trackerTFP::ProducerZHTout::dataFormats_ = nullptr
private

Definition at line 55 of file ProducerZHTout.cc.

Referenced by beginRun(), and produce().

◆ edGetToken_

EDGetTokenT<StreamsStub> trackerTFP::ProducerZHTout::edGetToken_
private

Definition at line 43 of file ProducerZHTout.cc.

Referenced by produce(), and ProducerZHTout().

◆ edPutToken_

EDPutTokenT<vector<TTTrack<Ref_Phase2TrackerDigi_> > > trackerTFP::ProducerZHTout::edPutToken_
private

Definition at line 45 of file ProducerZHTout.cc.

Referenced by produce(), and ProducerZHTout().

◆ esGetTokenDataFormats_

ESGetToken<DataFormats, DataFormatsRcd> trackerTFP::ProducerZHTout::esGetTokenDataFormats_
private

Definition at line 49 of file ProducerZHTout.cc.

Referenced by beginRun(), and ProducerZHTout().

◆ esGetTokenSetup_

ESGetToken<Setup, SetupRcd> trackerTFP::ProducerZHTout::esGetTokenSetup_
private

Definition at line 47 of file ProducerZHTout.cc.

Referenced by beginRun(), and ProducerZHTout().

◆ iConfig_

ParameterSet trackerTFP::ProducerZHTout::iConfig_
private

Definition at line 51 of file ProducerZHTout.cc.

Referenced by beginRun().

◆ setup_

const Setup* trackerTFP::ProducerZHTout::setup_ = nullptr
private